@graphysdk/viz-engine 1.9.0-beta.1790717670997 → 1.9.0-beta.1790718154132

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.
@@ -0,0 +1 @@
1
+ var Xn=Object.create,ar=Object.defineProperty,qn=Object.getOwnPropertyDescriptor,Jn=Object.getOwnPropertyNames,Zn=Object.getPrototypeOf,Qn=Object.prototype.hasOwnProperty,ea=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(var a=Jn(t),i=0,o=a.length,s;i<o;i++)s=a[i],!Qn.call(e,s)&&s!==r&&ar(e,s,{get:(l=>t[l]).bind(null,s),enumerable:!(n=qn(t,s))||n.enumerable});return e},ta=(e,t,r)=>(r=e!=null?Xn(Zn(e)):{},ea(t||!e||!e.__esModule?ar(r,"default",{value:e,enumerable:!0}):r,e));let F=require("color2k"),v=require("date-fns"),rt=require("lodash-es");var _t="#FFFFFF",Ue="#1A1A1A",ra=4.5,ir=e=>{try{const t=pe(e);return(0,F.getContrast)(t,_t)>(0,F.getContrast)(t,Ue)?_t:Ue}catch{return Ue}},na=(e,t)=>{try{const r=or(void 0,t);return r===void 0||(0,F.getContrast)(r,pe(e))>=ra?e:ir(r)}catch{return e}},or=(e,t)=>{try{const r=pe(t);if(e===void 0){const[,,,i]=(0,F.parseToRgba)(r);return i>=1?r:void 0}const n=pe(e),[,,,a]=(0,F.parseToRgba)(n);return a>=1?n:(0,F.parseToRgba)(r)[3]<1?void 0:(0,F.mix)(r,(0,F.opacify)(n,1),a)}catch{return}},aa=e=>{try{return(0,F.opacify)(pe(e),1)}catch{return}},sr=(e,t)=>{if(t>=1)return e;try{const[r,n,a,i]=(0,F.parseToRgba)(pe(e));return`rgba(${r}, ${n}, ${a}, ${Math.max(0,i*t)})`}catch{return e}},pe=e=>{const t=/^(rgb|hsl)a?\((.*)\)$/iu.exec(e.trim());if(t===null||t[1]===void 0||t[2]===void 0)return e;const r=t[2].split(/[\s,/]+/u).filter(u=>u!=="");if(r.length!==3&&r.length!==4)return e;const[n="",a,i,o]=r,s=[n.replace(/deg$/iu,""),a,i];if(o===void 0)return`${t[1]}(${s.join(", ")})`;const l=o.endsWith("%")?Number.parseFloat(o)/100:o;return`${t[1]}a(${[...s,l].join(", ")})`},Ie=e=>e instanceof Date&&(0,v.isValid)(e),ia=e=>Ie(e)||e===null,oa=e=>typeof e=="string",S=e=>typeof e=="number"&&!Number.isNaN(e)&&Number.isFinite(e),sa=e=>S(e)||e===null,G=Math.PI*2,la=8,ua=1e-9,ca=[0,Math.PI/2,Math.PI,G*3/4],lr=(e,t)=>Math.abs(t-e)>=G-ua,ie=e=>(e%G+G)%G,ur=(e,t,r)=>{if(lr(t,r))return!0;const n=ie(r-t);return ie(e-t)<=n},nt=(e,t)=>{const r=Math.abs(ie(e)-ie(t));return Math.min(r,G-r)},da=(e,t)=>{const r=ie(t-e);return r>Math.PI?r-G:r},fa=(e,t,r)=>e*G+t+r,cr=(e,t)=>({x:t*Math.sin(e),y:t*Math.cos(e)}),te=(e,t)=>{const r=cr(e,t);return{x:.5+r.x/2,y:.5+r.y/2}},dr=(e,t,r,n)=>{const a=[te(e,r),te(e,n),te(t,r),te(t,n)],i=Math.max(r,n),o=ca.filter(l=>ur(l,e,t)).map(l=>te(l,i)),s=[...a,...o];return{xMin:Math.min(...s.map(l=>l.x)),xMax:Math.max(...s.map(l=>l.x)),yMin:Math.min(...s.map(l=>l.y)),yMax:Math.max(...s.map(l=>l.y))}},fr=(e,t)=>({angle:ie(Math.atan2(e,t)),radius:Math.hypot(e,t)}),pr=(e,t)=>{const r=e.x-.5,n=e.y-.5;return{x:t>=1?r*2*t:r*2,y:t>=1?n*2:n*2/t}},pa=(e,t)=>{const{x:r,y:n}=pr(e,t);return fr(r,n)},hr="\0graphy\0_",b=e=>`${hr}${e}`,at={x:b("constantX")},ha={bar:b("barSeriesLabel"),line:b("lineSeriesLabel")},it={count:b("count"),mean:b("mean"),sum:b("sum")},Ce={group:b("group")},m={x:b("x"),y:b("y"),xMin:b("xMin"),xMax:b("xMax"),yMin:b("yMin"),yMax:b("yMax"),yRaw:b("yRaw")},ot={role:b("stackRole")},le={color:b("color"),size:b("size"),alpha:b("alpha"),strokeWidth:b("strokeWidth"),lineType:b("lineType")},Te={y:b("ruleY"),x:b("ruleX")},ol={...at,...it,...Ce,...m,...ot,...le,...Te},ga=new Set(Object.values(it)),gr=e=>b(`scaled_${e}`),ya=e=>e.startsWith(hr),ma=e=>ga.has(e);function q(e){return e[m.x]}function z(e){return e[m.y]}function J(e){return e[m.xMin]}function Z(e){return e[m.xMax]}function H(e){return e[m.yMin]}function K(e){return e[m.yMax]}function yr(e){return e[m.yRaw]}function ba(e,t){return e[gr(t)]}var va={xMin:0,xMax:1,yMin:0,yMax:1},mr=(e,t)=>{const r=J(e)??q(e),n=Z(e)??q(e),a=H(e)??z(e),i=K(e)??z(e);return!S(r)||!S(n)||!S(a)||!S(i)?null:t.type!=="polar"?{xMin:r,xMax:n,yMin:a,yMax:i}:{...dr(r,n,a,i),space:"disk"}},st=(e,t)=>{const r=(e.xMin+e.xMax)/2,n=(e.yMin+e.yMax)/2;switch(t){case"top":return{x:r,y:e.yMax};case"bottom":return{x:r,y:e.yMin};case"left":return{x:e.xMin,y:n};case"right":return{x:e.xMax,y:n};case"top-left":return{x:e.xMin,y:e.yMax};case"top-right":return{x:e.xMax,y:e.yMax};case"bottom-left":return{x:e.xMin,y:e.yMin};case"bottom-right":return{x:e.xMax,y:e.yMin};default:return{x:r,y:n}}},Aa=e=>st(va,e),Ne=e=>(Array.isArray(e)?e:[e]).map(t=>t instanceof Date?t.toISOString():String(t??"<null>")).join("\0"),Ea=(e,t)=>e===t?!0:Ie(e)&&Ie(t)?e.getTime()===t.getTime():!1,br=e=>e===null?"null":e instanceof Date?`date:${e.getTime()}`:`${typeof e}:${e}`,Ta=e=>e.length>0;function V(e){return e!=null}function Oa(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Pa(e){const{numeric:t,categorical:r,temporal:n}=e.groupVariableNamesByType();return n[0]??r[0]??t[0]??""}function Sa(e,t){const{categorical:r,temporal:n}=e.groupVariableNamesByType(),a=[...r,...n];return t===""||a.includes(t)?a:[t,...a]}function _a(e){const t=L(e.x);return t===null||t===at.x?"":t}function L(e){return V(e)?typeof e=="string"?e:"variable"in e?e.variable:null:null}function Pe(e){if(!(!V(e)||typeof e=="string")&&"value"in e)return e.value}function Ma(e,t){return[...new Set([...Object.keys(e),...Object.keys(t)])].every(r=>Mt(e[r])===Mt(t[r]))}function Mt(e){const t=L(e);if(t!==null)return`variable:${t}`;const r=Pe(e);return r===void 0?"":`value:${br(r)}`}var vr=["stack","dodge","identity","fill"],Ar=["solid","dashed","dotted"],j={line:{solid:[],dashed:[4,2],dotted:[1,1]},rule:{solid:[],dashed:[2,3],dotted:[0,2]},gridLine:{solid:[],dashed:[2,3],dotted:[1,3]},panelBorder:{solid:[],dashed:[2,3],dotted:[1,3]},directLabel:{solid:[],dashed:[2,3],dotted:[1,3]},arrow:{solid:[],dashed:[1.5,3],dotted:[0,2]}},xa=e=>Ar.includes(e);function he(e){return e==="stack"||e==="fill"}var Me="en-GB",lt=class extends Error{constructor(e){super(e.message,e.cause!==void 0?{cause:e.cause}:void 0),this.name=new.target.name,this.code=e.code,this.context=e.context,this.suggestion=e.suggestion}},oe=class extends lt{constructor(e){super(e),this.kind="user-input"}},x=class extends lt{constructor(e){super({...e,code:e.code??"INTERNAL_INVARIANT"}),this.kind="internal"}},ut=e=>e.type==="lookup",Er=e=>e.type==="text",ye=e=>e.type==="date"||e.type==="datetime"||e.type==="year"||e.type==="month_year"||e.type==="month"||e.type==="day_month"||e.type==="weekly_date_range"||e.type==="weekly_date_range_with_year"||e.type==="quarter"||e.type==="time",Tr=e=>e.type==="decimal"||e.type==="integer"||e.type==="percentage"||e.type==="duration"||e.type==="currency",La=e=>e.type==="currency",Ra=e=>e.type==="month"||e.type==="day_month"||e.type==="weekly_date_range",Or=e=>{if(ut(e))return Or(e.fallback);if(ye(e))return"temporal";if(Tr(e))return"numeric";if(Er(e))return"categorical";throw new x({message:`No data type found for value format: ${e.type}`})},wa=e=>ut(e)?e.fallback:e,Pr=class{constructor(){this.currentYear=new Date().getUTCFullYear(),this.previousDate=null,this.previousYear=null}incrementYearIfNeeded(e){this.previousYear===null?this.previousYear=e.getUTCFullYear():this.previousDate!==null&&(0,v.isBefore)(new Date(this.currentYear,e.getUTCMonth(),e.getUTCDate()),new Date(this.currentYear,this.previousDate.getUTCMonth(),this.previousDate.getUTCDate()))&&this.previousYear++;const t=new Date(e.getTime());return t.setUTCFullYear(this.previousYear),this.previousDate=t,t}},Sr={k:1e3,m:1e6,b:1e9,t:1e12},ct=["k","m","b","t"],Da=new RegExp(`^-?(\\d{1,3}(,\\d{3})*|\\d+)\\.?\\d*(${ct.join("|")})?$`,"i"),ka=/^-?\d{1,3}(?:,\d{3})*(?:\.\d+)?%?$/,se=e=>e===null||e instanceof Date||Array.isArray(e)||typeof e=="boolean"?!1:typeof e=="string"?Da.test(e)&&!Number.isNaN(Number(e.replace(new RegExp(`[,${ct.join("")}]`,"gi"),""))):Number.isFinite(Number(e)),_r=e=>se(e)?!0:typeof e=="string"?ka.test(e):!1,Ia=/^\d{4}-\d{2}-\d{2}(T|\s)\d{1,2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|\+00:00)?$/,Ca=/^\s*(1[89]\d{2}|2[01]\d{2})\s*$/,Na=[[/\bJan\b/i,"January"],[/\bFeb\b/i,"February"],[/\bMar\b/i,"March"],[/\bApr\b/i,"April"],[/\bJun\b/i,"June"],[/\bJul\b/i,"July"],[/\bAug\b/i,"August"],[/\bSept?\b/i,"September"],[/\bOct\b/i,"October"],[/\bNov\b/i,"November"],[/\bDec\b/i,"December"]],Fa={"en-US":"MDY","en-GB":"DMY","pt-PT":"DMY",ar:"DMY"},Mr=["/","-","."," "],xt=[["d","M","yy"],["d","MM","yy"],["d","MMMM","yy"],["dd","M","yy"],["dd","MM","yy"],["dd","MMMM","yy"],["do","MMMM","yy"],["d","M","yyyy"],["d","MM","yyyy"],["d","MMMM","yyyy"],["dd","M","yyyy"],["dd","MM","yyyy"],["dd","MMMM","yyyy"],["do","MMMM","yyyy"]],Lt=[["M","d","yy"],["M","dd","yy"],["MM","d","yy"],["MM","dd","yy"],["MMMM","d","yy"],["MMMM","dd","yy"],["MMMM","do","yy"],["M","d","yyyy"],["M","dd","yyyy"],["MM","d","yyyy"],["MM","dd","yyyy"],["MMMM","d","yyyy"],["MMMM","dd","yyyy"],["MMMM","do","yyyy"]],Rt=[["yyyy","M","d"],["yyyy","M","dd"],["yyyy","MM","d"],["yyyy","MM","dd"],["yyyy","MMMM","d"],["yyyy","MMMM","dd"],["yyyy","MMMM","do"]],xr=[["d","MMMM"],["dd","MMMM"],["do","MMMM"],["MMMM","d"],["MMMM","dd"],["MMMM","do"]],ja=[{dateFormat:"MMMM d, yyyy",type:"date"},{dateFormat:"MMMM dd, yyyy",type:"date"},{dateFormat:"MMMM do, yyyy",type:"date"},{dateFormat:"yyyy-MM",type:"month_year"}],Lr=1800,Rr=2199,Va=3,Ba=6,Wa=5,Ua=1,Ya=28,Ga=/\s*[–—]\s*|\s-\s/,za=e=>typeof e=="number"?Number.isInteger(e)&&e>=Lr&&e<=Rr:typeof e=="string"?Ca.test(e):!1,wr=(e,t)=>{const r=Se(e);return!t&&se(r)?$a(r):typeof r=="string"?t?(0,v.isValid)((0,v.parse)(r,t,new Date)):!!Dr(r)||Fe(r)&&(0,v.isValid)(new Date(r)):(0,v.isValid)(r)},Se=e=>{if(typeof e!="string")return e;let t=e;for(const[r,n]of Na)t=t.replace(r,n);return t},Dr=(e,t=Me)=>{const r=Se(e);return Fe(r)?{type:"datetime"}:Ir(t).find(n=>!ye(n)||n.type==="month"&&r.length<Va?!1:n.dateFormat&&(0,v.isValid)((0,v.parse)(r,n.dateFormat,new Date)))},Fe=e=>Ia.test(e.trim()),kr=e=>{if(e instanceof Date)return(0,v.isValid)(e)?e:null;if(typeof e!="string"||!Fe(e))return null;const t=new Date(e.trim());return(0,v.isValid)(t)?t:null},Ha=(e,t=Me)=>{const[r,n]=e.split(Ga);if(!r||!n)return;const a=Se(r).trim(),i=Se(n).trim();return Ka(t).find(o=>{if(!ye(o)||!o.dateFormat)return!1;const s=(0,v.parse)(a,o.dateFormat,new Date),l=(0,v.parse)(i,o.dateFormat,new Date);if(!(0,v.isValid)(s)||!(0,v.isValid)(l))return!1;const u=new Pr,c=u.incrementYearIfNeeded(s),p=u.incrementYearIfNeeded(l),d=(0,v.differenceInDays)(p,c);return(0,v.isWithinInterval)(new Date(c.getFullYear(),Ua,Ya),{start:c,end:p})&&d===Wa?!0:d===Ba})},Ir=e=>{const t={date:Cr(e),year:[["yyyy"]],day_month:xr,month_year:[["MMMM","yyyy"],["yyyy","MMMM"]],month:[["MMMM"]],quarter:[["QQQ","yyyy"],["yyyy","QQQ"]]};return[...ja,...Object.entries(t).flatMap(([r,n])=>n.flatMap(a=>Mr.map(i=>({dateFormat:a.join(i),type:r}))))]},Cr=e=>Fa[e]==="MDY"?[...Lt,...xt,...Rt]:[...xt,...Lt,...Rt],Ka=e=>{const t={weekly_date_range:xr,weekly_date_range_with_year:Cr(e)};return Object.entries(t).flatMap(([r,n])=>n.flatMap(a=>Mr.map(i=>({dateFormat:a.join(i),type:r}))))},$a=e=>{const t=Number(e);if(!(0,rt.isInteger)(t))return!1;const r=new Date(t),n=new Date(t*1e3),a=i=>(0,v.isValid)(i)&&i.getFullYear()>=Lr&&i.getFullYear()<=Rr;return a(r)||a(n)},Nr={$:"usd","£":"gbp","€":"eur","¥":"jpy","₹":"inr","₱":"php",P:"php","₩":"krw","₪":"ils","₫":"vnd","₽":"rub","฿":"thb",R$:"brl",Rp:"idr",RM:"myr","₦":"ngn",zł:"pln","₺":"try",kr:"dkk",Fr:"chf",R:"zar","د.إ":"aed","﷼":"sar",Ch$:"clp",NT$:"twd",HK$:"hkd",S$:"sgd",A$:"aud",C$:"cad",NZ$:"nzd",MX$:"mxn"},Fr=e=>{if(typeof e=="string"){const t=jr(e);return t.length?se(t):!1}return se(e)},Xa=e=>{const t=Vr(e),r=t?Nr[t]:void 0;if(!r)throw new x({message:"Could not get currency ISO"});return r},jr=e=>{const t=Vr(e);let r=e;if(t){const n=e.indexOf(t);n===0?r=e.slice(t.length):n===e.length-t.length?r=e.slice(0,e.length-t.length):e[0]==="-"&&n===1&&(r=`-${e.slice(t.length+1)}`)}return se(r)?r.split(",").join(""):""},Vr=e=>Object.keys(Nr).sort((t,r)=>r.length-t.length).find(t=>e.includes(t)),Br=e=>{const t=Object.entries(e);return!t.length||!t.some(([,r])=>!ge(r))},ge=e=>typeof e=="string"&&e.trim()===""||e===void 0||e===null||e==="-",qa=/\s*[–—]\s*|\s-\s/,Wr=(e,t,r)=>{if(ge(e))return null;switch(t.type){case"decimal":case"integer":case"duration":return Yr(e);case"percentage":return Ja(e);case"currency":return Za(e);case"datetime":case"date":case"year":case"month_year":case"month":case"day_month":case"quarter":case"time":return Ur(e,t.dateFormat,r);case"weekly_date_range":case"weekly_date_range_with_year":return Qa(e,t.dateFormat,r);case"text":return ei(e);case"lookup":throw new x({message:"Cannot parse: lookup value formats are produced by transforms, not raw input"});default:throw new x({message:`Unhandled value format: ${t.type}`})}},Ur=(e,t,r)=>{if(e instanceof Date)return(0,v.isValid)(e)?e:null;const n=Se(String(e).trim());if(n.length===0)return null;const a=new Date;if(t){const o=(0,v.parse)(n,t,a);return(0,v.isValid)(o)?Ye(o):null}for(const o of Ir(r)){if(!ye(o)||!o.dateFormat)continue;const s=(0,v.parse)(n,o.dateFormat,a);if((0,v.isValid)(s))return Ye(s)}const i=new Date(n);return wr(i)?Fe(n)?i:Ye(i):null},Yr=e=>{if(typeof e=="number")return Number.isFinite(e)?e:null;if(typeof e!="string")return null;let t=e.trim();if(!se(t))return null;let r=1;for(const n of ct)if(new RegExp(`${n}$`,"i").test(t)){r=Sr[n],t=t.slice(0,-1);break}return Number(t.split(",").join(""))*r},Ja=e=>{if(typeof e=="number")return Number.isFinite(e)?e:null;if(typeof e!="string")return null;const t=e.trim();if(!_r(t))return null;const r=Number(t.replace(/%/g,"").replace(/,/g,""))/100;return Number.isNaN(r)?null:r},Za=e=>{if(typeof e=="number")return Number.isFinite(e)?e:null;if(typeof e!="string")return null;const t=e.trim();return Fr(t)?Yr(jr(t)):null},Qa=(e,t,r)=>{const n=String(e).trim().split(qa),[a,i]=[n[0]?.trim(),n[1]?.trim()];return!a||!i?null:Ur(a,t,r)},ei=e=>String(e).trim(),Ye=e=>new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())),dt=(e,t,r)=>{if(t.type==="text"&&typeof e=="string")return e;const n=Wr(e,t,r);return n!==null||!ye(t)?n:kr(e)},ne=process.env.NODE_ENV!=="production";var je=!0,ti=e=>{je=e},ri=()=>je,ni=()=>{let e=null;const t={hits:0,misses:0};return Object.assign((n,a)=>{if(!je)return ne&&(t.misses+=1),a();if(e&&zr(e.args,n))return ne&&(t.hits+=1),e.out;ne&&(t.misses+=1);const i=a();return e={args:n,out:i},i},{stats:t,reset:()=>{e=null}})},Gr=()=>{const e=new WeakMap,t={hits:0,misses:0};return Object.assign((n,a,i)=>{if(!je)return ne&&(t.misses+=1),i();const o=e.get(n);if(o)for(let l=0;l<o.length;l+=1){const u=o[l];if(u&&zr(u.args,a))return ne&&(t.hits+=1),l>0&&(o.splice(l,1),o.unshift(u)),u.out}ne&&(t.misses+=1);const s=i();return o?(o.unshift({args:a,out:s}),o.length>16&&(o.length=16)):e.set(n,[{args:a,out:s}]),s},{stats:t})},ai=(...e)=>e.reduce((t,r)=>({hits:t.hits+r.hits,misses:t.misses+r.misses}),{hits:0,misses:0}),zr=(e,t)=>{if(e.length!==t.length)return!1;for(let r=0;r<e.length;r+=1)if(e[r]!==t[r])return!1;return!0},Hr=class{constructor(){this.memo=Gr(),this.singletonKey={}}get stats(){return this.memo.stats}compile(e){return this.memo(this.key(e),this.dependencies(e),()=>this.run(e))}key(e){return this.singletonKey}},Ve=(e,t)=>e>=0&&e<=1&&t>=0&&t<=1,ii=["x","y"],Kr=new Set(["x","y","ySecondary"]),ft=new Set(["color","size","alpha","strokeWidth","lineType"]),$r=e=>Kr.has(e),Xr=e=>ft.has(e),oi=e=>$r(e)||Xr(e);function qr(e){return e==="secondary"?"ySecondary":"y"}function si(e,t){return e==="y"?qr(t):"x"}function li(e){return e==="ySecondary"?"y":e}var ui=new Set(["count","sum","mean","median"]);function Jr(e,t){return ui.has(e)?"numeric":t}function Zr(e,t,r,n){if(n!==void 0&&n.type!=="numeric"&&(e==="sum"||e==="mean"||e==="median"))throw new oe({code:"INCOMPATIBLE_TYPE",message:`'${e}' requires a numeric variable (got '${n.type}' for '${n.variableName}')`,context:{variableName:n.variableName,variableType:n.type}});const a=r?.length??t.length;if(e==="count")return a;if(e==="median"||e==="mode"){const s=[];for(let l=0;l<a;l++){const u=Ge(t,r,l);ze(u)&&s.push(u)}return s.length===0?null:e==="median"?fi(s):pi(s)}if(e==="sum"||e==="mean"){let s=0,l=0;for(let u=0;u<a;u++){const c=Ge(t,r,u);ze(c)&&(s++,l+=Number(c))}return s===0?null:e==="sum"?l:l/s}const i=e==="min"?-1:1;let o=null;for(let s=0;s<a;s++){const l=Ge(t,r,s);ze(l)&&(o===null||ci(l,o)===i)&&(o=l)}return o}var Ge=(e,t,r)=>e[t?.[r]??r]??null,ze=e=>e!==null&&!(typeof e=="number"&&Number.isNaN(e)),ci=(e,t)=>e===null||t===null?0:e<t?-1:e>t?1:0,di=e=>e instanceof Date?e.getTime():e??null;function fi(e){const t=e.map(Number).sort((i,o)=>i-o);if(t.length===1)return t[0]??0;const r=(t.length-1)/2,n=Math.floor(r),a=t[n]??0;return a+((t[n+1]??a)-a)*(r-n)}function pi(e){const t=new Map;for(const a of e){const i=di(a),o=t.get(i);o===void 0?t.set(i,{value:a,count:1}):o.count++}let r=null,n=0;for(const{value:a,count:i}of t.values())i>n&&(n=i,r=a);return r}var hi=e=>e==null||typeof e=="number"&&Number.isNaN(e),gi=e=>e instanceof Date?e.getTime():e??null,qe=class X{constructor(t,r,n,a=null){this.rowShape=null,this.names=t,this.columns=r,this.rowCount=n,this.source=a}get columnCount(){return this.names.length}static from(t){const r=Object.entries(t);return new X(r.map(([n])=>n),new Map(r),r[0]?.[1].length??0)}columnNames(){return[...this.names]}hasColumn(t){return this.names.includes(t)}values(t){const r=this.columns.get(t);if(r!==void 0)return r;if(this.source===null||!this.names.includes(t))return;const n=this.source.table.values(t);if(n===void 0)return;const{indices:a}=this.source,i=new Array(a.length);for(let o=0;o<a.length;o++)i[o]=n[a[o]??0]??null;return this.columns.set(t,i),this.columns.size===this.names.length&&(this.source=null),i}assign(t,r){const n=this.gathered(),a=new Map(n.columns);a.set(t,r);const i=n.names.includes(t)?[...n.names]:[...n.names,t];return new X(i,a,n.names.length===0?r.length:n.rowCount)}select(t){const r=t.filter(a=>this.names.includes(a)),n=new Map;for(const a of r){const i=this.columns.get(a);i!==void 0&&n.set(a,i)}return new X(r,n,this.rowCount,this.source)}rename(t,r){const n=this.gathered(),a=new Map;for(const i of n.names){const o=n.columns.get(i);o!==void 0&&a.set(i===t?r:i,o)}return new X(n.names.map(i=>i===t?r:i),a,n.rowCount)}take(t){const r=this.source===null?{table:this,indices:t}:{table:this.source.table,indices:t.map(n=>this.source?.indices[n]??0)};return new X(this.names,new Map,t.length,r)}sortedIndices(t,r){const n=this.values(t);if(n===void 0)return Array.from({length:this.rowCount},(s,l)=>l);const a=[],i=[];for(let s=0;s<this.rowCount;s++)(hi(n[s])?a:i).push(s);const o=r==="asc"?1:-1;return i.sort((s,l)=>{const u=n[s],c=n[l];return u<c?-o:u>c?o:0}),a.length===0?i:r==="asc"?[...a,...i]:[...i,...a]}partition(t){const r=t.map(i=>this.values(i)).filter(i=>i!==void 0),n=r.length===1?r[0]:void 0,a=new Map;if(n!==void 0){for(let i=0;i<this.rowCount;i++){const o=gi(n[i]),s=a.get(o);s===void 0?a.set(o,{key:Ne(n[i]??null),indices:[i]}):s.indices.push(i)}return[...a.values()]}for(let i=0;i<this.rowCount;i++){const o=Ne(r.map(l=>l[i])),s=a.get(o);s===void 0?a.set(o,{key:o,indices:[i]}):s.indices.push(i)}return[...a.values()]}fold(t,r,n){const a=this.names.filter(d=>!t.includes(d)),i=this.rowCount*t.length,o=a.map(d=>({name:d,source:this.values(d)??[],repeated:new Array(i)})),s=t.map(d=>this.values(d)??[]),l=new Array(i),u=new Array(i);let c=0;for(let d=0;d<this.rowCount;d++)for(let h=0;h<t.length;h++,c++){for(const g of o)g.repeated[c]=g.source[d]??null;l[c]=t[h]??"",u[c]=s[h]?.[d]??null}const p=new Map;for(const{name:d,repeated:h}of o)p.set(d,h);return p.set(r,l),p.set(n,u),new X([...a,r,n],p,i)}objectAt(t){const{names:r,arrays:n,template:a}=this.rowShape??this.resolveRowShape(),i={...a};for(let o=0;o<r.length;o++)i[r[o]??""]=n[o]?.[t]??null;return i}*[Symbol.iterator](){for(let t=0;t<this.rowCount;t++)yield this.objectAt(t)}resolveRowShape(){const t={};for(const r of this.names)t[r]=null;return this.rowShape={names:this.names,arrays:this.names.map(r=>this.values(r)??[]),template:t},this.rowShape}gathered(){if(this.source===null)return this;for(const t of this.names)this.values(t);return new X(this.names,new Map(this.columns),this.rowCount)}};var Qr="value",Oe={numeric:{type:"decimal"},categorical:{type:"text"},temporal:{type:"datetime"}},wt={eq:(e,t)=>e===t,neq:(e,t)=>e!==t,gt:(e,t)=>e!==null&&t!==null&&e>t,gte:(e,t)=>e!==null&&t!==null&&e>=t,lt:(e,t)=>e!==null&&t!==null&&e<t,lte:(e,t)=>e!==null&&t!==null&&e<=t},Dt=e=>e===null?null:e instanceof Date?e.getTime():new Date(e).getTime(),en=(e,t)=>e==="count"?{type:"integer"}:t,tn=(e,t,r)=>{const n=e.values(t);if(n!==void 0)return n;if(r==="count")return new Array(e.rowCount);throw new x({message:`Variable '${t}' not defined`})},ae=class M{constructor(t={}){const{table:r,variableMetadata:n}=this.parseVariableMap(t);this.table=r,this.variableMetadata=n}static fromTrusted(t,r){const n=Object.create(M.prototype);return n.table=t,n.variableMetadata=r,n}size(){return this.table.rowCount}getVariableNames(){return this.table.columnNames()}hasVariable(t){return this.table.hasColumn(t)}addVariable(t,r,n,a){if(this.table.columnCount>0&&n.length!==this.size())throw new x({message:`Variable '${t}' has ${n.length} values, expected ${this.size()}`});const i={...this.variableMetadata,[t]:{type:r,valueFormat:this.resolveAddedVariableFormat(t,r,a)}},o=this.normalizeRawValues(r,n),s=this.table.assign(t,o);return M.fromTrusted(s,i)}addConstantVariable(t,r,n,a){const i={...this.variableMetadata,[t]:{type:r,valueFormat:this.resolveAddedVariableFormat(t,r,a),constant:{value:n}}},[o=null]=this.normalizeRawValues(r,[n]),s=this.table.assign(t,new Array(this.size()).fill(o));return M.fromTrusted(s,i)}getConstant(t){return this.variableMetadata[t]?.constant}deriveVariable(t,r,n,a){const i=Array.from({length:this.size()},(o,s)=>n(this.table.objectAt(s)));return this.addVariable(t,r,i,a)}deriveVariableFrom(t,r,n,a,i){const o=this.hasVariable(t)?this.getValues(t).map(a):Array.from({length:this.size()},()=>a(null));return this.addVariable(r,n,o,i)}renameVariable(t,r){const n=this.variableMetadata[t];if(!n)throw new x({message:`Variable ${t} not defined`});const a=this.table.rename(t,r),{[t]:i,...o}=this.variableMetadata,s={...o,[r]:n};return M.fromTrusted(a,s)}selectVariables(...t){const r=this.table.select(t),n=Object.fromEntries(Object.entries(this.variableMetadata).filter(([a])=>t.includes(a)));return M.fromTrusted(r,n)}getType(t){const r=this.variableMetadata[t];if(!r)throw new x({message:`Variable ${t} not defined`});return r.type}getValueFormat(t){const r=this.variableMetadata[t];if(!r)throw new x({message:`Variable ${t} not defined`});return r.valueFormat}groupVariableNamesByType(){const t={numeric:[],categorical:[],temporal:[]};for(const[r,{type:n}]of Object.entries(this.variableMetadata))t[n].push(r);return t}getValues(t,r){if(!this.hasVariable(t))throw new x({message:`Variable '${t}' not defined`});const n=this.getType(t);if(r?.type!==void 0&&n!==r.type){if(this.size()===0)return[];throw new x({message:`Variable '${t}' has type '${n}', expected '${r.type}'`})}let a=this.table.values(t)??[];return r?.distinct&&(a=this.getDistinctValues(n,a)),r?.skipNulls&&(a=this.skipNulls(a)),a}filter(t,r,n){if(this.hasVariable(t)&&this.getType(t)==="temporal")return this.filterByTimestamp(t,r,n);const a=wt[r],i=this.table.values(t)??[],o=[];for(let s=0;s<i.length;s++)a(i[s]??null,n)&&o.push(s);return M.fromTrusted(this.table.take(o),this.variableMetadata)}filterByMask(t){if(t.length!==this.size())throw new x({message:`Row mask length ${t.length} does not match dataset size ${this.size()}`});const r=[];for(let n=0;n<t.length;n++)t[n]===1&&r.push(n);return M.fromTrusted(this.table.take(r),this.variableMetadata)}take(t){return M.fromTrusted(this.table.take(t),this.variableMetadata)}orderBy(t,r="asc"){const n=this.table.take(this.table.sortedIndices(t,r));return M.fromTrusted(n,this.variableMetadata)}getAt(t){return t<0||t>=this.size()?null:this.table.objectAt(t)}getFirst(){return this.getAt(0)}getLast(){return this.getAt(this.size()-1)}findFirst(t){const r=this.size();for(let n=0;n<r;n++){const a=this.table.objectAt(n);if(t(a))return a}return null}findLast(t){for(let r=this.size()-1;r>=0;r--){const n=this.table.objectAt(r);if(t(n))return n}return null}groupBy(...t){return new yi(t,this.table,this.variableMetadata)}rollup(t){const r=qe.from(Object.fromEntries(Object.entries(t).map(([a,{variableName:i,aggregation:o}])=>[a,[Zr(o,tn(this.table,i,o),void 0,{type:this.variableMetadata[i]?.type??"numeric",variableName:i})]]))),n={};for(const[a,{variableName:i,aggregation:o}]of Object.entries(t)){const s=this.variableMetadata[i],l=s?.type??"numeric",u=s?.valueFormat??Oe[l];n[a]={type:Jr(o,l),valueFormat:en(o,u)}}return M.fromTrusted(r,n)}reshapeFromWideToLong({keep:t,reshape:r,keyName:n="key",valueName:a=Qr}={}){const{numeric:i,categorical:o,temporal:s}=this.groupVariableNamesByType(),l=t??[...o,...s],u=r??i.filter(d=>!l.includes(d));if(l.includes(n)||l.includes(a))throw new oe({code:"INVALID_DATA_SHAPE",message:`The variables to keep includes the variables '${n}' or '${a}' to create the key and value variables`});if(u.length===0){const d={};for(const h of l){const g=this.variableMetadata[h];g&&(d[h]={type:g.type,values:[],valueFormat:g.valueFormat})}return d[n]={type:"categorical",values:[],valueFormat:{type:"text"}},d[a]={type:"numeric",values:[],valueFormat:{type:"decimal"}},new M(d)}if(u.filter(d=>this.variableMetadata[d]?.type!=="numeric").length>0)throw new oe({code:"INVALID_DATA_SHAPE",message:"Only numeric variables can be reshaped"});const c=this.table.select([...l,...u]).fold(u,n,a),p={};for(const d of l){const h=this.variableMetadata[d];h&&(p[d]=h)}return p[n]={type:"categorical",valueFormat:{type:"text"}},p[a]={type:"numeric",valueFormat:mi(this.variableMetadata,u,n)},M.fromTrusted(c,p)}print(){console.table(this.variableMetadata),console.table([...this.table])}[Symbol.iterator](){return this.table[Symbol.iterator]()}filterByTimestamp(t,r,n){const a=wt[r],i=dt(n,this.getValueFormat(t),Me),o=Dt(i??n),s=this.getValues(t,{type:"temporal"}),l=[];for(let u=0;u<s.length;u++)a(Dt(s[u]??null),o)&&l.push(u);return M.fromTrusted(this.table.take(l),this.variableMetadata)}resolveAddedVariableFormat(t,r,n){if(n!==void 0)return n;const a=this.variableMetadata[t];return a?a.valueFormat:Oe[r]}parseVariableMap(t){const r={},n={};for(const[a,{type:i,values:o,valueFormat:s}]of Object.entries(t))r[a]=o,n[a]={type:i,valueFormat:s??Oe[i]};return{table:qe.from(r),variableMetadata:n}}normalizeRawValues(t,r){switch(t){case"numeric":return r.map(n=>typeof n!="number"||!Number.isFinite(n)?null:n);case"categorical":return r.map(n=>typeof n!="string"?null:n);case"temporal":return r.map(n=>!(n instanceof Date)||!(0,v.isValid)(n)?null:n);default:throw new x({message:`Cannot normalize raw value of unknown type: ${t}`})}}skipNulls(t){return t.filter(r=>r!==null)}getDistinctValues(t,r){const n=t==="temporal",a=new Set,i=[];for(const o of r){const s=n&&o instanceof Date?o.getTime():o;a.has(s)||(a.add(s),i.push(o))}return i}},yi=class{constructor(e,t,r){this.groupedBy=e,this.table=t,this.variableMetadata=r}forEach(e){this.table.partition(this.groupedBy).forEach(({key:t,indices:r},n)=>{e(ae.fromTrusted(this.table.take(r),this.variableMetadata),t,n)})}rollup(e){const t=this.table.partition(this.groupedBy),r={};for(const a of this.groupedBy){const i=this.table.values(a)??[];r[a]=t.map(({indices:o})=>i[o[0]??0]??null)}const n=Object.fromEntries(this.groupedBy.map(a=>{const i=this.variableMetadata[a],o=i?.type??"categorical";return[a,{type:o,valueFormat:i?.valueFormat??Oe[o]}]}));for(const[a,{variableName:i,aggregation:o}]of Object.entries(e)){const s=tn(this.table,i,o),l=this.variableMetadata[i],u=l?.type??"numeric";r[a]=t.map(({indices:p})=>Zr(o,s,p,{type:u,variableName:i}));const c=l?.valueFormat??Oe[u];n[a]={type:Jr(o,u),valueFormat:en(o,c)}}return ae.fromTrusted(qe.from(r),n)}};function mi(e,t,r){const n=t.map(s=>e[s]?.valueFormat??{type:"decimal"}),[a,...i]=n;if(!a)return{type:"decimal"};for(const s of n)if(s.type==="lookup")throw new oe({code:"INVALID_DATA_SHAPE",message:"Cannot reshape: a source column has a lookup format and lookups cannot nest"});if(i.every(s=>(0,rt.isEqual)(s,a))||a.type==="lookup")return a;const o={};for(const[s,l]of t.entries()){const u=Ne([l]),c=n[s];c&&c.type!=="lookup"&&(o[u]=c)}return{type:"lookup",byVariable:r,cases:o,fallback:a}}var pt=class{constructor(e){this.label=e,this.items=new Map}register(e,t){return this.items.set(e,t),this}get(e){if(!this.items.has(e)){const t=[...this.items.keys()].map(r=>`'${r}'`).join(", ");throw new oe({code:"UNKNOWN_REGISTERED_TYPE",message:`Unknown ${this.label}: '${e}' (available: ${t})`,context:{kind:this.label,requested:e,available:[...this.items.keys()]},suggestion:`Register a custom ${this.label} named '${e}' in the \`plugins\` array, or use one of: ${t}.`})}return this.items.get(e)}getAll(){return[...this.items.values()]}has(e){return this.items.has(e)}},bi=(e,t)=>{const r=typeof e=="string"?e.trim():e;if(se(r))return{type:"decimal"};const n=typeof r=="string"&&Dr(r,t);if(n)return n;const a=typeof r=="string"&&Ha(r,t);return a||(wr(e)?{type:"date"}:_r(e)?{type:"percentage"}:Fr(e)&&typeof e=="string"?{type:"currency",iso:Xa(e)}:{type:"text"})},vi={type:"year",dateFormat:"yyyy"},Ai={type:"text"},rn=e=>{const t=e._metadata?.parsingLocale??"en-GB",r={},n=Pi(e),a=Ti(e),i=n.size>0;for(const[o,s]of e.columns.entries()){if(s._metadata?.isHidden)continue;const l=n.get(s.key);if(ge(l)&&i)continue;const u=s.valueFormat??(ge(l)?Ai:o===a?vi:bi(l,t)),c=Or(u);r[s.key]=Oi(s.key,e.rows,u,c,t)}return new ae(r)},Ei=class extends Hr{dependencies(e){return[e]}run(e){return rn(e)}},Ti=e=>{if(e.columns.some(r=>r.valueFormat?.type==="year"))return-1;const t=Si(e.rows,5);return e.columns.findIndex(r=>{if(r.valueFormat)return!1;const n=t.map(a=>a[r.key]).filter(a=>!ge(a));return n.length>=2&&n.every(za)})},Oi=(e,t,r,n,a)=>({type:n,values:t.reduce((i,o)=>(Br(o)||i.push(Wr(o[e],r,a)),i),[]),valueFormat:r}),Pi=e=>{const t=new Map,r=new Set(e.columns.map(n=>n.key));for(const n of e.rows){for(const a of r){const i=n[a];ge(i)||(t.set(a,i),r.delete(a))}if(r.size===0)break}return t},Si=(e,t)=>{const r=[];for(const n of e)if(Br(n)||r.push(n),r.length===t)return r;return r},_i=new Set(["min","max","scalar"]),Mi={x:{min:m.xMin,max:m.xMax},y:{min:m.yMin,max:m.yMax}};function xi(e){const t=new Set;for(const r of e)r.role==="point"?t.add(r.axis):(r.role==="min"||r.role==="max")&&V(r.aes)&&t.add(r.aes);return[...t]}function Li(e){const t=new Set;for(const r of e)r.role==="point"&&t.add(r.axis),V(r.aes)&&t.add(r.aes);return[...t]}function Ri(e,t,r){let n=e;for(const a of t){if(a.role!=="min"&&a.role!=="max"||!V(a.aes))continue;const i=Mi[a.axis][a.role];if(n.hasVariable(i))continue;const o=L(r[a.aes]);!V(o)||!n.hasVariable(o)||(n=n.addVariable(i,"numeric",n.getValues(o,{type:"numeric"})))}return n}var nn=(e,t)=>{if(V(t.group)){const a=L(t.group);if(a!==null)return[a]}const r=new Set([L(t.x),L(t.y)].filter(V)),n=new Set;for(const a of ft){const i=L(t[a]);V(i)&&(r.has(i)||e.hasVariable(i)&&e.getType(i)==="categorical"&&n.add(i))}return[...n]},ht=(e,t)=>e.hasVariable(Ce.group)?e.getValues(Ce.group,{distinct:!0,skipNulls:!0}).length>1:nn(e,t).some(r=>e.getValues(r,{distinct:!0,skipNulls:!0}).length>1),gt=["none","xs","sm","md","lg","xl","full"],wi={point:Di,line:ki,area:Ii,bar:Ci,rule:Ni,tile:Fi},an=e=>typeof e=="string"&&gt.includes(e);function ue(e,t){return{type:"layer",id:t.id,geom:e,mapping:t.aes,stat:t.stat,params:t.params,position:t.position,yScaleType:t.yScaleType,transforms:t.transforms,interactive:t.interactive,dataLabels:t.dataLabels}}function Di(e={}){return ue("point",e)}function ki(e={}){return ue("line",e)}function Ii(e={}){return ue("area",e)}function Ci(e={}){return ue("bar",e)}function Ni(e={}){return ue("rule",e)}function Fi(e={}){return ue("tile",e)}var on=["diagonal","dots","crosshatch"],sn=["tile","stretch"],yt=e=>typeof e=="object"&&e!==null&&"gradient"in e,mt=e=>typeof e=="object"&&e!==null&&"pattern"in e,ln=e=>typeof e=="object"&&e!==null&&"image"in e,un=e=>typeof e!="object"?e:yt(e)?e.stops[0]?.color??"transparent":mt(e)?e.color:e.fallback,ji=e=>typeof e=="string"?e:JSON.stringify(e),Vi=["topLeft","topRight","bottomRight","bottomLeft"],Bi=["dimmed","hovered"],cn=["normal","italic","oblique"],dn=["none","uppercase","lowercase","capitalize"],fn=["none","underline","line-through"],pn=["butt","round","square"],hn=["miter","round","bevel"],gn=["normal","multiply","screen","overlay","darken","lighten"],yn=["circle","square","diamond","triangle","cross","star","wye"],Wi=["fill","stroke","alpha","saturation","blur","brightness","contrast","cornerRadius","strokeWidth","dashArray","lineCap","lineJoin","strokeAlpha","fillAlpha","size","symbol","fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","textTransform","textDecoration","textOutlineColor","textOutlineWidth","textShadow","lineHeight","textScale","textColor","offset","gap","length","paddingInline","paddingBlock","padding","margin","shadow","blendMode"],kt=1,It=1e3,Ct="'none' or a shadow object { offsetX, offsetY, blur, color }",Nt="a non-negative number of pixels, or an object of those per edge",Ui="a non-empty color string, a { light, dark } pair, or a token(...) reference",Yi=["top","right","bottom","left"],Re="a color, a { gradient, stops } object, a { pattern, color } object, or an { image, fallback } object",Ft="a number of pixels, or { topLeft, topRight, bottomRight, bottomLeft } in pixels",xe=e=>typeof e=="object"&&e!==null&&typeof e.light=="string"&&typeof e.dark=="string",bt=e=>typeof e=="object"&&e!==null&&typeof e.token=="string",mn=e=>typeof e=="string"?e.trim().length>0:xe(e)&&e.light.trim().length>0&&e.dark.trim().length>0;function f(e){return{token:e}}var Je=(e,t)=>{if(typeof e!="object"||e===null)return e;if(xe(e))return e[t];if(Array.isArray(e)){if(e.every(a=>typeof a=="number"))return e;const n=e.map(a=>Je(a,t));return n.every((a,i)=>a===e[i])?e:n}const r=Object.entries(e).map(([n,a])=>[n,Je(a,t)]);return r.every(([n,a])=>a===e[n])?e:Object.fromEntries(r)},T=e=>typeof e=="number"&&Number.isFinite(e),y=(e,t)=>({status:"rejected",expected:e,actual:t}),ee=e=>{const t=`one of ${e.map(r=>`'${String(r)}'`).join(", ")}`;return r=>e.includes(r)?{status:"accepted",value:r}:y(t,r)},re=(e,t)=>{if(typeof e=="string")return e.trim().length>0?{status:"accepted",value:e}:y("a non-empty color string",e);if(bt(e)){const r=t[e.token];return r===void 0?{status:"unknownToken",token:e.token}:mn(r)?{status:"accepted",value:typeof r=="string"?r:{light:r.light,dark:r.dark}}:{status:"dropped"}}return xe(e)&&e.light.trim().length>0&&e.dark.trim().length>0?{status:"accepted",value:{light:e.light,dark:e.dark}}:y(Ui,e)},Gi=(e,t)=>{if(typeof e!="object"||e===null||xe(e)||bt(e))return re(e,t);const r=e;if(yt(r)){const n=r.gradient;if(n!=="linear"&&n!=="radial")return y(Re,e);if(!Array.isArray(r.stops)||r.stops.length<2)return y("a gradient with at least two stops",e);const a=[];for(const i of r.stops){if(!T(i.offset)||i.offset<0||i.offset>1)return y("a gradient stop offset in [0, 1]",e);const o=re(i.color,t);if(o.status!=="accepted")return o;a.push({offset:i.offset,color:o.value})}return r.gradient==="radial"?{status:"accepted",value:{gradient:"radial",stops:a}}:r.angle!==void 0&&!T(r.angle)?y("a gradient angle in degrees",e):{status:"accepted",value:{gradient:"linear",...r.angle===void 0?{}:{angle:r.angle},stops:a}}}if(mt(r)){if(!on.includes(r.pattern))return y(Re,e);const n=re(r.color,t);if(n.status!=="accepted")return n;const a={pattern:r.pattern,color:n.value};if(r.background!==void 0){const i=re(r.background,t);if(i.status!=="accepted")return i;a.background=i.value}if(r.size!==void 0){if(!T(r.size)||r.size<=0)return y("a pattern size in pixels",e);a.size=r.size}return{status:"accepted",value:a}}if(ln(r)){if(typeof r.image!="string"||!r.image.startsWith("data:image/"))return y("an image as a data:image URI",e);if(r.fit!==void 0&&!sn.includes(r.fit))return y(Re,e);if(r.alpha!==void 0&&(!T(r.alpha)||r.alpha<0||r.alpha>1))return y("an image alpha in [0, 1]",e);if(r.size!==void 0&&(!T(r.size)||r.size<=0))return y("an image size in pixels",e);const n=re(r.fallback,t);return n.status!=="accepted"?n:{status:"accepted",value:{image:r.image,...r.fit===void 0?{}:{fit:r.fit},...r.alpha===void 0?{}:{alpha:r.alpha},...r.size===void 0?{}:{size:r.size},fallback:n.value}}}return y(Re,e)},jt=e=>{if(T(e)&&e>=0)return{status:"accepted",value:{top:e,right:e,bottom:e,left:e}};if(typeof e!="object"||e===null)return y(Nt,e);const t=e,r={};for(const n of Yi){const a=t[n];if(a!==void 0){if(!T(a)||a<0)return y(Nt,e);r[n]=a}}return{status:"accepted",value:r}},zi=e=>{if(T(e)&&e>=0)return{status:"accepted",value:e};if(typeof e!="object"||e===null)return y(Ft,e);const t=e,r={};for(const n of Vi){const a=t[n];if(!T(a)||a<0)return y(Ft,e);r[n]=a}return{status:"accepted",value:r}},Hi={color:re,paint:Gi,unitInterval:e=>T(e)&&e>=0&&e<=1?{status:"accepted",value:e}:y("a number in [0, 1]",e),pixels:e=>T(e)&&e>=0?{status:"accepted",value:e}:y("a non-negative number of pixels",e),barRadius:e=>an(e)||T(e)&&e>=0?{status:"accepted",value:e}:y(`a number of pixels or one of ${gt.map(t=>`'${t}'`).join(", ")}`,e),dashArray:e=>Array.isArray(e)&&e.every(t=>T(t)&&t>=0)?{status:"accepted",value:[...e]}:y("an array of non-negative dash and gap lengths, in stroke widths",e),fontFamily:e=>typeof e=="string"&&e.trim().length>0?{status:"accepted",value:e}:y("a non-empty CSS font-family list",e),fontWeight:e=>T(e)&&e>=kt&&e<=It?{status:"accepted",value:e}:y(`a number in [${kt}, ${It}]`,e),multiplier:e=>T(e)&&e>=0?{status:"accepted",value:e}:y("a non-negative multiple, 1 being unchanged",e),shadow:(e,t)=>{if(e==="none")return{status:"accepted",value:e};if(typeof e!="object"||e===null)return y(Ct,e);const r=e;if(!T(r.offsetX)||!T(r.offsetY)||!T(r.blur)||r.blur<0)return y(Ct,e);const n=re(r.color,t);return n.status!=="accepted"?n:{status:"accepted",value:{offsetX:r.offsetX,offsetY:r.offsetY,blur:r.blur,color:n.value}}},padding:jt,margin:jt,blendMode:ee(gn),signedPixels:e=>T(e)?{status:"accepted",value:e}:y("a number of pixels, negative allowed",e),fontStyle:ee(cn),textTransform:ee(dn),textDecoration:ee(fn),lineCap:ee(pn),lineJoin:ee(hn),pointSymbol:ee(yn),boxRadius:zi},bn=["kind","edge","axis","role","position","part"],Ki="#B84737",vn=.4,$i="sm",Xi=2,qi=8,Ji=12,Zi=Object.freeze({light:"#F5F1E9",dark:"#1F1E1C"}),Qi="#ffffff",eo=1,to=24,ro={top:24,right:24,bottom:24,left:24},W={stroke:"color",strokeWidth:"pixels",dashArray:"dashArray"},E={fontFamily:"fontFamily",fontSize:"pixels",fontWeight:"fontWeight",fontStyle:"fontStyle",letterSpacing:"signedPixels",textTransform:"textTransform",textDecoration:"textDecoration",textOutlineColor:"color",textOutlineWidth:"pixels",textShadow:"shadow",lineHeight:"multiplier",textColor:"color"},U={...E,paddingInline:"pixels",paddingBlock:"pixels",fill:"paint",stroke:"color",strokeWidth:"pixels",cornerRadius:"boxRadius",shadow:"shadow",alpha:"unitInterval"},no={offsetX:0,offsetY:2,blur:4,color:"rgba(14, 14, 52, 0.12)"},ao={offsetX:0,offsetY:4,blur:6,color:"rgba(14, 14, 52, 0.16)"},Ze=["where","state","layer"],An={fill:"paint",stroke:"color",alpha:"unitInterval",fillAlpha:"unitInterval",strokeAlpha:"unitInterval",saturation:"multiplier",blur:"pixels",brightness:"multiplier",contrast:"multiplier",shadow:"shadow",blendMode:"blendMode"},io=.3,oo=10,so=1,lo=24,uo=8,P={label:{fontSize:11.5,fontWeight:500,lineHeight:1},dataLabelOutside:{fontSize:12.5,fontWeight:600,lineHeight:1},tooltipHeading:{fontSize:12.5,fontWeight:700,lineHeight:1.3},tooltipRow:{fontSize:12.5,fontWeight:500,lineHeight:1.43},heading:{fontSize:18,fontWeight:600,lineHeight:1.25},subtitle:{fontSize:15,fontWeight:500,lineHeight:1.47},caption:{fontSize:12,fontWeight:500,lineHeight:1.3},source:{fontSize:12,fontWeight:500,lineHeight:1.3},sourceLink:{fontSize:12,fontWeight:400,lineHeight:1.3}},He={stroke:f("gridLine"),strokeWidth:1},Vt={fill:f("tooltipBackground"),stroke:f("tooltipBorder"),strokeWidth:1,cornerRadius:6,paddingBlock:8,paddingInline:10,shadow:{offsetX:0,offsetY:4,blur:12,color:"rgba(0, 0, 0, 0.18)"}},Bt={fill:f("textPrimary"),size:8,stroke:f("tooltipBackground"),strokeWidth:2,shadow:{offsetX:0,offsetY:1,blur:1.5,color:"rgba(14, 14, 52, 0.18)"}},Wt={fontSize:12,fontWeight:500,lineHeight:1.3,textColor:f("textPrimary"),fill:f("tooltipBackground"),stroke:f("tooltipBorder"),strokeWidth:1,cornerRadius:6,paddingInline:7,paddingBlock:4,shadow:{offsetX:0,offsetY:2,blur:6,color:"rgba(0, 0, 0, 0.12)"}},Ke={...W,length:"pixels"},ce={...E,margin:"margin"},de={...E,offset:"pixels",margin:"margin"},fe={gap:"pixels",margin:"margin"},$e={stroke:"color",strokeWidth:"pixels",offset:"pixels",cornerRadius:"pixels"},Ut={fill:"paint",stroke:"color",strokeWidth:"pixels",cornerRadius:"boxRadius",paddingInline:"pixels",paddingBlock:"pixels",shadow:"shadow",alpha:"unitInterval"},En=new Map;var co=(e=Object.values(Be))=>{const t=[],r=[],n=[],a=i=>{if(i.rest!==void 0&&t.push({select:i.select,declarations:i.rest}),i.dimmed!==void 0&&r.push({select:i.select,declarations:i.dimmed,when:{state:"dimmed"}}),i.hovered!==void 0&&n.push({select:i.select,declarations:i.hovered,when:{state:"hovered"}}),i.children!==void 0)for(const o of Object.values(i.children))a(o)};for(const i of e)a(i);return[...t,...r,...n]},fo=e=>{for(const t of e){Object.freeze(t.select);for(const r of Object.values(t.declarations))typeof r=="object"&&Object.freeze(r);Object.freeze(t.declarations),t.when!==void 0&&Object.freeze(t.when),Object.freeze(t)}return e},po=e=>En.get(Tn(e)),Yt=(e,t)=>({x:{select:{target:e,axis:"x"},vocabulary:t},y:{select:{target:e,axis:"y"},vocabulary:t}}),Gt=e=>({select:{target:"dataLabel",role:e},vocabulary:U,children:{inside:{select:{target:"dataLabel",role:e,position:"inside"},vocabulary:U,rest:{textColor:"#FFFFFF"}},outside:{select:{target:"dataLabel",role:e,position:"outside"},vocabulary:U,rest:{...P.dataLabelOutside}}}}),Be={geom:{select:{target:"geom"},vocabulary:An,options:Ze,aesthetics:{fill:"color",stroke:"color",alpha:"alpha"},rest:{alpha:1,strokeAlpha:1,shadow:"none",blendMode:"normal"},dimmed:{alpha:vn},hovered:{shadow:no},acceptsUnknownKinds:!0},panelBorder:{select:{target:"panelBorder"},vocabulary:{...W,cornerRadius:"pixels"},rest:{...He,dashArray:j.panelBorder.dashed,cornerRadius:6},children:{top:{select:{target:"panelBorder",edge:"top"},vocabulary:W},right:{select:{target:"panelBorder",edge:"right"},vocabulary:W},bottom:{select:{target:"panelBorder",edge:"bottom"},vocabulary:W},left:{select:{target:"panelBorder",edge:"left"},vocabulary:W}}},gridLine:{select:{target:"gridLine"},vocabulary:W,children:{x:{select:{target:"gridLine",axis:"x"},vocabulary:W,rest:{...He,dashArray:j.gridLine.dashed,strokeWidth:0}},y:{select:{target:"gridLine",axis:"y"},vocabulary:W,rest:{...He,dashArray:j.gridLine.dashed}}}},tickLine:{select:{target:"tickLine"},vocabulary:Ke,rest:{strokeWidth:0,length:0},children:{x:{select:{target:"tickLine",axis:"x"},vocabulary:Ke},y:{select:{target:"tickLine",axis:"y"},vocabulary:Ke}}},axisLabel:{select:{target:"axisLabel"},vocabulary:ce,rest:{...P.label,textColor:f("textPrimary")},children:{...Yt("axisLabel",ce),top:{select:{target:"axisLabel",edge:"top"},vocabulary:ce,rest:{margin:{bottom:8}}},bottom:{select:{target:"axisLabel",edge:"bottom"},vocabulary:ce,rest:{margin:{top:4,bottom:16}}},left:{select:{target:"axisLabel",edge:"left"},vocabulary:ce},right:{select:{target:"axisLabel",edge:"right"},vocabulary:ce}}},tickLabel:{select:{target:"tickLabel"},vocabulary:de,rest:{...P.label,textColor:f("textSecondary"),offset:oo,textOutlineColor:f("graphBackground"),textOutlineWidth:so},children:{...Yt("tickLabel",de),top:{select:{target:"tickLabel",edge:"top"},vocabulary:de},bottom:{select:{target:"tickLabel",edge:"bottom"},vocabulary:de},left:{select:{target:"tickLabel",edge:"left"},vocabulary:de,rest:{offset:14}},right:{select:{target:"tickLabel",edge:"right"},vocabulary:de,rest:{offset:14}}}},dataLabel:{select:{target:"dataLabel"},vocabulary:U,rest:{...P.label,textColor:f("textPrimary"),paddingInline:6,paddingBlock:2,cornerRadius:4},children:{aggregate:{select:{target:"dataLabel",role:"aggregate"},vocabulary:U,rest:{...P.dataLabelOutside}},observation:Gt("observation"),category:Gt("category")}},graph:{select:{target:"graph"},vocabulary:{fill:"paint",stroke:"color",strokeWidth:"pixels",cornerRadius:"pixels",fontFamily:"fontFamily",fontSize:"pixels",fontWeight:"fontWeight",lineHeight:"multiplier",textColor:"color",textScale:"multiplier",padding:"padding",blendMode:"blendMode",shadow:"shadow",alpha:"unitInterval"},rest:{fill:f("graphBackground"),strokeWidth:1,stroke:f("graphBorder"),cornerRadius:8,textScale:1,padding:24,blendMode:"normal"}},heading:{select:{target:"heading"},vocabulary:E,rest:{textColor:f("textPrimary")},partWildcard:!0,children:{h1:{select:{target:"heading",part:"h1"},vocabulary:E,rest:{...P.heading}},h2:{select:{target:"heading",part:"h2"},vocabulary:E,rest:{...P.subtitle}}}},caption:{select:{target:"caption"},vocabulary:E,rest:{...P.caption,textColor:f("textPrimary")}},source:{select:{target:"source"},vocabulary:E,rest:{...P.source,textColor:f("textSecondary")},children:{link:{select:{target:"source",part:"link"},vocabulary:E,rest:{...P.sourceLink,textColor:f("textSecondary")}}}},header:{select:{target:"header"},vocabulary:{margin:"margin"},rest:{margin:{bottom:10}}},footer:{select:{target:"footer"},vocabulary:{margin:"margin"},rest:{margin:{top:16}}},hoverGuide:{select:{target:"hoverGuide"},vocabulary:{stroke:"color",fill:"paint"},rest:{stroke:f("hoverGuideLine"),fill:f("hoverGuideFill")}},editOutline:{select:{target:"editOutline"},vocabulary:$e,rest:{strokeWidth:2,offset:2,cornerRadius:3},partWildcard:!0,children:{hover:{select:{target:"editOutline",part:"hover"},vocabulary:$e,rest:{stroke:f("editOutlineHover")}},selected:{select:{target:"editOutline",part:"selected"},vocabulary:$e,rest:{stroke:f("editOutlineSelected")}}}},tooltip:{select:{target:"tooltip"},vocabulary:Ut,rest:Vt,children:{heading:{select:{target:"tooltip",part:"heading"},vocabulary:E,rest:{...P.tooltipHeading,textColor:f("textPrimary")}},label:{select:{target:"tooltip",part:"label"},vocabulary:E,rest:{...P.tooltipRow,textColor:f("textPrimary")}},value:{select:{target:"tooltip",part:"value"},vocabulary:E,rest:{...P.tooltipRow,textColor:f("textSecondary")}},primaryRow:{select:{target:"tooltip",part:"primaryRow"},vocabulary:{fill:"paint"},rest:{fill:f("tooltipPrimaryRow")}}}},headline:{select:{target:"headline"},vocabulary:fe,rest:{gap:lo,margin:{bottom:4}}},headlineItem:{select:{target:"headlineItem"},vocabulary:{},children:{number:{select:{target:"headlineItem",part:"number"},vocabulary:E,rest:{fontSize:26,fontWeight:700,lineHeight:1.3,textColor:f("textPrimary")},children:{center:{select:{target:"headlineItem",part:"numberCenter"},vocabulary:E}}},caption:{select:{target:"headlineItem",part:"caption"},vocabulary:E,rest:{fontSize:12,textColor:f("textSecondary")}},label:{select:{target:"headlineItem",part:"label"},vocabulary:E,rest:{fontSize:12,textColor:f("textSecondary")}},swatch:{select:{target:"headlineItem",part:"swatch"},vocabulary:{size:"pixels"},rest:{size:12}},trend:{select:{target:"headlineItem",part:"trend"},vocabulary:E,rest:{fontSize:12,textColor:f("textSecondary")},children:{up:{select:{target:"headlineItem",part:"trendUp"},vocabulary:{textColor:"color"},rest:{textColor:f("trendPositive")}},down:{select:{target:"headlineItem",part:"trendDown"},vocabulary:{textColor:"color"},rest:{textColor:f("trendNegative")}},flat:{select:{target:"headlineItem",part:"trendFlat"},vocabulary:{textColor:"color"},rest:{textColor:f("trendNeutral")}}}}}},legend:{select:{target:"legend"},vocabulary:fe,rest:{gap:uo},children:{popover:{select:{target:"legend",part:"popover"},vocabulary:Ut,rest:Vt},top:{select:{target:"legend",edge:"top"},vocabulary:fe,rest:{margin:{bottom:8}}},bottom:{select:{target:"legend",edge:"bottom"},vocabulary:fe,rest:{margin:{top:16,bottom:10}}},left:{select:{target:"legend",edge:"left"},vocabulary:fe,rest:{margin:{right:10}}},right:{select:{target:"legend",edge:"right"},vocabulary:fe,rest:{margin:{left:10}}}}},legendItem:{select:{target:"legendItem"},vocabulary:{...E,paddingInline:"pixels",paddingBlock:"pixels",fill:"paint",stroke:"color",strokeWidth:"pixels",cornerRadius:"boxRadius",shadow:"shadow",alpha:"unitInterval"},rest:{...P.label,textColor:f("textSecondary"),strokeWidth:0,paddingInline:2,paddingBlock:4},children:{swatch:{select:{target:"legendItem",part:"swatch"},vocabulary:{size:"pixels",strokeWidth:"pixels"},rest:{size:12,strokeWidth:2}}}},directLabel:{select:{target:"directLabel"},vocabulary:{...E,stroke:"color",strokeWidth:"pixels",dashArray:"dashArray"},rest:{fontSize:12,fontWeight:500,lineHeight:1.3,textColor:f("textPrimary"),strokeWidth:1,dashArray:j.directLabel.dashed}},annotation:{select:{target:"annotation"},vocabulary:{fill:"paint",stroke:"color",alpha:"unitInterval",fillAlpha:"unitInterval"},options:["annotation"],children:{shape:{select:{target:"annotation",kind:"shape"},vocabulary:{fill:"paint",alpha:"unitInterval",fillAlpha:"unitInterval",stroke:"color",strokeWidth:"pixels"},options:["annotation"],rest:{fill:f("annotationShape"),alpha:1,fillAlpha:.25,strokeWidth:1}},arrow:{select:{target:"annotation",kind:"arrow"},vocabulary:{stroke:"color",strokeWidth:"pixels",dashArray:"dashArray"},options:["annotation"],rest:{stroke:f("annotationArrow"),strokeWidth:4,dashArray:j.arrow.solid},children:{outline:{select:{target:"annotation",kind:"arrow",part:"outline"},vocabulary:{stroke:"color",strokeWidth:"pixels",shadow:"shadow"},options:["annotation"],rest:{strokeWidth:0,shadow:"none"}}}},differenceArrow:{select:{target:"annotation",kind:"differenceArrow"},vocabulary:{stroke:"color",strokeWidth:"pixels"},options:["annotation"],rest:{stroke:f("annotationArrow"),strokeWidth:2},children:{label:{select:{target:"annotation",kind:"differenceArrow",part:"label"},vocabulary:U,options:["annotation"],rest:{...P.label,textColor:f("textPrimary"),fill:f("differenceLabelBackground"),strokeWidth:1,cornerRadius:4,paddingInline:6,paddingBlock:3}}}},text:{select:{target:"annotation",kind:"text"},vocabulary:{...U,fillAlpha:"unitInterval"},options:["annotation"],rest:{fill:"transparent",alpha:1,fillAlpha:1,strokeWidth:1.5,cornerRadius:9,paddingInline:6,paddingBlock:3,fontSize:15,fontWeight:500,lineHeight:1.25,textColor:f("textPrimary")}},image:{select:{target:"annotation",kind:"image"},vocabulary:{alpha:"unitInterval",cornerRadius:"boxRadius",shadow:"shadow"},options:["annotation"],rest:{alpha:1,cornerRadius:0}},pinnedNumber:{select:{target:"annotation",kind:"pinnedNumber"},vocabulary:{fill:"paint",size:"pixels",stroke:"color",strokeWidth:"pixels",shadow:"shadow"},options:["annotation"],rest:Bt,children:{label:{select:{target:"annotation",kind:"pinnedNumber",part:"label"},vocabulary:U,options:["annotation"],rest:Wt}}},comment:{select:{target:"annotation",kind:"comment"},vocabulary:{fill:"paint",size:"pixels",stroke:"color",strokeWidth:"pixels",shadow:"shadow"},options:["annotation"],rest:Bt,children:{label:{select:{target:"annotation",kind:"comment",part:"label"},vocabulary:U,options:["annotation"],rest:Wt}}}}}},Tn=e=>{let t=e.target;for(const r of bn){const n=e[r];n!==void 0&&(t+=`\0${r}:${n}`)}return t},On=e=>{if(En.set(Tn(e.select),e),e.children!==void 0)for(const t of Object.values(e.children))On(t)};for(const e of Object.values(Be))On(e);var vt=(e,t)=>{const r=L(t.x);return!r||!["numeric","temporal"].includes(e.getType(r))?e:e.orderBy(r,"asc")},At=(e,{coordSystem:t})=>{const r=q(e),n=z(e);return!S(r)||!S(n)?null:t.type==="polar"?te(r,n):{x:r,y:n}},ho=({positionRoles:e,aesthetics:t})=>[...xi(e),...t.filter(r=>r.required).map(r=>r.name)];function go(e){return e}var yo=e=>e.observation?.aesthetics??Be.geom.aesthetics,Pn=e=>e.observation?.sharedPaint===!1?{...e.observation.vocabulary}:{...An,...e.observation?.vocabulary},mo=(e,t)=>({select:{target:"geom",kind:e},vocabulary:Pn(t),aesthetics:yo(t),options:t.observation?.options??Ze,...zt(t.observation),children:Object.fromEntries(Object.entries(t.parts??{}).map(([r,n])=>[r,{select:{target:"geom",kind:e,part:r},vocabulary:n.vocabulary,options:n.options??Ze,...n.aesthetics===void 0?{}:{aesthetics:n.aesthetics},...zt(n)}]))}),zt=e=>({...e?.rest===void 0?{}:{rest:e.rest},...e?.dimmed===void 0?{}:{dimmed:e.dimmed},...e?.hovered===void 0?{}:{hovered:e.hovered}}),Q=class{constructor(){this.positionRoles=[],this.identityKey="x-group",this.defaultPosition="identity",this.defaultStat=null,this.supportedPositions=vr,this.defaultInteractive=!0,this.aesthetics=[],this.derivedVariables=[],this.highlightStrategy=null,this.supportedCoordTypes=["cartesian","flip"],this.spatialKind="points",this.grid={},this.legend={},this.dataLabelCoordTypes=[],this.isComposite=!1,this.tooltip=[],this.summaries={}}resolveParams(e){return(0,rt.merge)({},this.defaultParams,e.params)}},Ht=.5,me=e=>({x:0,y:0,width:e.width,height:e.height}),Et=e=>e==="panel-end"?"end":e==="panel-start"?"start":e,be=({box:e,panel:t,orientation:r,placement:n,justify:a,align:i,offset:o,alignOffset:s,labelWidth:l,labelHeight:u})=>{const c=a==="panel-start"||a==="panel-end",p=(r.valueAxis==="x"?e.height:e.width)===0,d={anchor:vo(a,r.valueDirectionSign),placement:c?"inside":n,offset:o},h={anchor:Ao(i),placement:p?n:"inside",offset:p?s??o:0},g=c?t:e,A=r.valueAxis==="x"?g:e,R=r.valueAxis==="y"?g:e,I=r.valueAxis==="x"?d:h,B=r.valueAxis==="x"?h:d,O=$t(I,{min:A.x,max:A.x+A.width,halfExtent:l/2}),w=$t(B,{min:R.y,max:R.y+R.height,halfExtent:u/2});return{x:O,y:w,position:bo(e,O,w,l,u)}},Kt=(e,t,r,n)=>r-n>=e-Ht&&r+n<=t+Ht,bo=(e,t,r,n,a)=>{if(e.width===0&&e.height===0)return"outside";const i=e.width===0||Kt(e.x,e.x+e.width,t,n/2),o=e.height===0||Kt(e.y,e.y+e.height,r,a/2);return i&&o?"inside":"outside"},vo=(e,t)=>e==="center"?"center":(e==="end"||e==="panel-end")==(t===1)?"max":"min",Ao=e=>e==="center"?"center":e==="start"?"min":"max",$t=({anchor:e,placement:t,offset:r},{min:n,max:a,halfExtent:i})=>{if(e==="center")return(n+a)/2;if(t==="inside"&&n===a)return n;const o=r+i;return e==="min"?t==="inside"?n+o:n-o:t==="inside"?a-o:a+o},Eo=e=>{const t=[];if(!e.layer.dataLabels.showDataLabels)return{labels:t,droppedCount:0};const{offset:r}=e.layer.dataLabels,n=Po(e.layer);for(const a of e.layer.data){const i=q(a),o=K(a)??z(a);if(i===null||o===null||!Ve(i,o))continue;const s=e.formatLabel(a);if(s==="")continue;const{width:l,height:u}=e.measureDataLabel("observation","outside",s),{box:c,orientation:p}=Oo(o,H(a),i,e.panelRect.width,e.panelRect.height),d=be({box:c,panel:me(e.panelRect),orientation:p,...n,offset:r,labelWidth:l,labelHeight:u});t.push({layerId:e.layer.id,x:d.x,y:d.y,text:s,width:l,height:u,isRotated:!1,role:"observation",position:"outside"})}return{labels:t,droppedCount:0}},To=e=>e.position==="fill"?"fill":he(e.position)?"stack":"none",Oo=(e,t,r,n,a)=>{const i=t??e,o=1-Math.max(e,i);return{box:{x:r*n,y:o*a,width:0,height:Math.abs(e-i)*a},orientation:{valueAxis:"y",valueDirectionSign:e>=i?-1:1}}},Po=e=>{const{position:t,justify:r,align:n}=e.dataLabels;return t==="auto"?{placement:"outside",justify:"end",align:"center"}:{placement:t,justify:ht(e.data,e.mapping)?Et(r):r,align:n}},So=class extends Q{constructor(...e){super(...e),this.type="area",this.styleTarget={observation:{vocabulary:{strokeWidth:"pixels",dashArray:"dashArray",lineCap:"lineCap",lineJoin:"lineJoin"},aesthetics:{fill:"color",fillAlpha:"alpha",strokeWidth:"strokeWidth",dashArray:"lineType"},rest:{fill:f("geom"),fillAlpha:io,strokeWidth:2,dashArray:j.line.solid}}},this.supportedCoordTypes=["cartesian","polar","flip"],this.defaultParams={curve:"linear",missingValues:"zero"},this.defaultPosition="stack",this.scaleConstraints={zeroBaseline:!0},this.positionRoles=[{axis:"x",role:"point",valueKind:"value"},{axis:"y",role:"min",valueKind:"value"},{axis:"y",role:"max",valueKind:"value",aes:"y"}],this.aesthetics=[{kind:"visual",name:"color"},{kind:"visual",name:"strokeWidth"},{kind:"visual",name:"lineType"},{kind:"visual",name:"alpha"}],this.summaries={perGroupHeadline:!0},this.dataLabels={cartesian:{offset:8},flip:{offset:8}},this.dataLabelCoordTypes=["cartesian","flip"],this.resolvePercentageValueStrategy=To,this.isComposite=!0,this.legend={suppressWhenSingleItem:!0,sidePlacement:"whenCrowded",directLabelSupport:{stack:!0,dodge:!0,identity:!0,fill:!0}},this.highlightStrategy="overlay-anchor",this.spatialKind="filled-buckets",this.resolveAnchorPosition=At,this.getDataLabelPlacements=t=>Eo(t)}resolveParams(e){const t=super.resolveParams(e);return t.missingValues==="gap"?{...t,missingValues:"zero"}:t}compile({data:e,mapping:t}){return e=vt(e,t),e.hasVariable(m.yMin)||(e=e.addConstantVariable(m.yMin,"numeric",0)),{data:e,mapping:{}}}},Sn=.7,_o=.1,Mo=.03,xo=.05,_n=e=>{const t=e[ot.role];return t??"solo"},Tt=(e,t,r)=>{const n={},a=i=>{const o=n[i];if(o!==void 0)return o;const{width:s,height:l}=e(t,i,r),u={width:s,height:l};return n[i]=u,u};return{get inside(){return a("inside")},get outside(){return a("outside")}}},Ot=(e,t)=>{const r=e.get("fill",t);if(r===void 0)return;const n=e.get("alpha",t)*(e.get("fillAlpha",t)??1);return sr(un(r),n)},we=6,Lo=.5,Ro=e=>{const t=[];let r=0;const n=he(e.layer.position),a=e.coordSystem.mainAxis==="y";if(e.layer.dataLabels.showDataLabels){const{entries:i,shouldRotate:o}=Do({layer:e.layer,mainAxis:e.coordSystem.mainAxis,panelRect:e.panelRect,measureDataLabel:e.measureDataLabel,formatLabel:e.formatLabel,isFlipped:a});for(const s of i){const l=e.layer.dataLabels.position==="auto"?Co({mainAxis:e.coordSystem.mainAxis,isStacked:n,isNegativeBar:s.isNegative,shouldRotate:o,bounds:s.bounds,boxes:s.boxes,panelWidth:e.panelRect.width,panelHeight:e.panelRect.height,offset:e.layer.dataLabels.offset}):Fo(e.layer.dataLabels,e.coordSystem.mainAxis,n,s,me(e.panelRect));if(l===null){r+=1;continue}const u=s.boxes[l.position];t.push({layerId:e.layer.id,x:l.x,y:l.y,text:s.text,width:u.width,height:u.height,isRotated:l.isRotated,role:"observation",position:l.position,...l.position==="inside"?{backdropColor:Ot(e.styleReaders,s.observation)}:{}})}}if(e.layer.dataLabels.showCategoryLabels)for(const i of jo(e,n))t.push(i);if(e.layer.dataLabels.showStackTotals){const i=Uo({layer:e.layer,mainAxis:e.coordSystem.mainAxis,panelRect:e.panelRect,measureDataLabel:e.measureDataLabel,formatAbsolute:e.formatAbsolute});for(const o of i)t.push(o)}return{labels:t,droppedCount:r}},wo=e=>e.position==="fill"?"fill":he(e.position)?"stack":"absoluteGrandTotal",Do=({layer:e,mainAxis:t,panelRect:r,measureDataLabel:n,formatLabel:a,isFlipped:i})=>{const o=[];let s=!1;const l=e.dataLabels.position==="auto",u=L(e.mapping.y);for(const c of e.data){const p=xn(t,c);if(p===null)continue;const d=a(c);if(d==="")continue;const h=Tt(n,"observation",d),g=Pt(p,r);l&&h.inside.width>g.width&&(s=!0);const A=u===null?null:c[u],R=S(A)&&A<0;o.push({isNegative:R,text:d,boxes:h,bounds:g,observation:c})}return{entries:o,shouldRotate:!i&&s}},Pt=(e,t)=>({x:e.x*t.width,y:e.y*t.height,width:e.width*t.width,height:e.height*t.height}),Mn=(e,t,r,n,a)=>{if(e==="x"){let s=1-a,l=a-n;return l<0&&(s+=l,l=-l),{x:t,y:s,width:r-t,height:l}}let i=t,o=r-t;return o<0&&(i+=o,o=-o),{x:i,y:1-a,width:o,height:a-n}},xn=(e,t)=>{const r=J(t),n=Z(t),a=H(t),i=K(t)??z(t);return r===null||n===null||a===null||i===null?null:Mn(e,r,n,a,i)},ko=(e,t)=>{const{xMin:r,xMax:n,yMin:a,yMax:i}=t.anchor;return Mn(e,r,n,a,i)},Io=(e,t)=>e==="x"?t?"bottom":"top":t?"left":"right",Qe=(e,t,r)=>r?{width:t,height:e}:{width:e,height:t},Co=e=>e.isStacked?Vo({bounds:e.bounds,box:e.boxes.inside,isRotated:e.shouldRotate}):Wo({edge:Io(e.mainAxis,e.isNegativeBar),bounds:e.bounds,boxes:e.boxes,isRotated:e.shouldRotate,panelWidth:e.panelWidth,panelHeight:e.panelHeight,offset:e.offset}),Ln=(e,t)=>e==="x"?{valueAxis:"y",valueDirectionSign:t?1:-1}:{valueAxis:"x",valueDirectionSign:t?-1:1},No=e=>e==="panel-start"||e==="panel-end",Fo=(e,t,r,n,a)=>{if(e.position==="auto")return null;const i=r&&e.position==="outside"?"inside":e.position,o=n.boxes[i],s=be({box:n.bounds,panel:a,orientation:Ln(t,n.isNegative),placement:i,justify:e.justify,align:e.align,offset:e.offset,labelWidth:o.width,labelHeight:o.height});if(i==="inside"&&!No(e.justify)){const l=t==="y",u=l?n.bounds.width:n.bounds.height;return(l?o.width:o.height)>u+Lo?null:{x:s.x,y:s.y,isRotated:!1,position:"inside"}}return{x:s.x,y:s.y,isRotated:!1,position:s.position}},jo=(e,t)=>{const r=[],{categoryPosition:n,categoryJustify:a,categoryAlign:i,categoryOffset:o}=e.layer.dataLabels,s=t&&n==="outside"?"inside":n,l=e.coordSystem.mainAxis,u=me(e.panelRect),c=L(e.layer.mapping.y);for(const p of e.layer.data){const d=xn(l,p);if(d===null)continue;const h=e.formatCategory(p);if(h===null||h==="")continue;const g=Tt(e.measureDataLabel,"category",h),A=g[s],R=Pt(d,e.panelRect),I=c===null?null:p[c],B=S(I)&&I<0,O=be({box:R,panel:u,orientation:Ln(l,B),placement:s,justify:a,align:i,offset:o,labelWidth:A.width,labelHeight:A.height}),w=g[O.position];r.push({layerId:e.layer.id,x:O.x,y:O.y,text:h,width:w.width,height:w.height,isRotated:!1,role:"category",position:O.position})}return r},Vo=({bounds:e,box:t,isRotated:r})=>{const n=Qe(t.width,t.height,r);return n.width>e.width||n.height>e.height?null:{x:e.x+e.width/2,y:e.y+e.height/2,isRotated:r,position:"inside"}},Bo=(e,t,r,n)=>{switch(e){case"top":return{edgeCoord:t.y,outwardSign:-1,panelExtent:n};case"bottom":return{edgeCoord:t.y+t.height,outwardSign:1,panelExtent:n};case"left":return{edgeCoord:t.x,outwardSign:-1,panelExtent:r};case"right":return{edgeCoord:t.x+t.width,outwardSign:1,panelExtent:r}}},Wo=({edge:e,bounds:t,boxes:r,isRotated:n,panelWidth:a,panelHeight:i,offset:o})=>{const s=e==="top"||e==="bottom",l=t.x+t.width/2,u=t.y+t.height/2,c=s?t.height:t.width,p=s?t.width:t.height,{edgeCoord:d,outwardSign:h,panelExtent:g}=Bo(e,t,a,i),A=Qe(r.inside.width,r.inside.height,n),R=s?A.height:A.width,I=s?A.width:A.height,B=R+o<c,O=I<=p;if(s?B:B&&O){if(s&&!O)return null;if(n)return{x:l,y:u,isRotated:!0,position:"inside"};const Le=d-h*(R/2+o);return{...s?{x:l,y:Le}:{x:Le,y:u},isRotated:!1,position:"inside"}}const w=Qe(r.outside.width,r.outside.height,n),_=(s?w.height:w.width)/2,C=d+h*(_+o);return C-_<0||C+_>g?null:{...s?{x:l,y:C}:{x:C,y:u},isRotated:n,position:"outside"}},Uo=({layer:e,mainAxis:t,panelRect:r,measureDataLabel:n,formatAbsolute:a})=>{const i=[],o=e.summary.stackTotals;if(o===void 0||o.length===0)return i;const s=t==="y";for(const l of o){const u=Pt(ko(t,l),r),c=a(l.total),{width:p,height:d}=n("aggregate","outside",c),h=l.anchor.direction==="positive";let g,A;s?(g=h?u.x+u.width+we+p/2:u.x-we-p/2,A=u.y+u.height/2):(g=u.x+u.width/2,A=h?u.y-we-d/2:u.y+u.height+we+d/2),i.push({layerId:e.id,x:g,y:A,text:c,width:p,height:d,isRotated:!1,role:"aggregate",position:"outside"})}return i};function Rn(e){return{startAngle:e[m.xMin],endAngle:e[m.xMax]}}function wn(e){return{innerRadius:e[m.yMin],outerRadius:e[m.yMax]??e[m.y]}}var Yo=" · ",Y=2,Go=e=>{const t=[];if(!e.layer.dataLabels.showDataLabels)return{labels:t,droppedCount:0};const{position:r,justify:n,align:a,offset:i,showCategoryLabels:o}=e.layer.dataLabels,s=e.coordSystem.bandAxis==="y",l=e.panelRect.width/2,u=e.panelRect.height/2,c=Math.min(e.panelRect.width,e.panelRect.height)/2,p=e.styleReaders;for(const d of e.layer.data){const{startAngle:h,endAngle:g}=Rn(d),{innerRadius:A,outerRadius:R}=wn(d);if(h===null||g===null||R===null)continue;const I=e.formatLabel(d);if(I==="")continue;const B=o?e.formatCategory(d):null,O=B===null?I:`${B}${Yo}${I}`,w={startAngle:h,endAngle:g,midAngle:(h+g)/2,innerRadiusPx:(A??0)*c,outerRadiusPx:R*c};let _,C;if(r==="auto"){const ve=e.measureDataLabel("observation","inside",O),$={width:ve.width,height:ve.height},We=Jt({wedge:w,position:"inside",offset:i,labelWidth:$.width,labelHeight:$.height}),Hn=s||Ho({wedge:w,labelRadius:We.labelRadius,labelAngle:We.labelAngle,labelWidth:$.width,labelHeight:$.height});if(_=We,C=$,!Hn){const St=e.measureDataLabel("observation","outside",O),Ae={width:St.width,height:St.height},Ee=Jt({wedge:w,position:"outside",offset:i,labelWidth:Ae.width,labelHeight:Ae.height}),Kn=l+Math.sin(Ee.labelAngle)*Ee.labelRadius,$n=u-Math.cos(Ee.labelAngle)*Ee.labelRadius;$o({x:Kn,y:$n,labelWidth:Ae.width,labelHeight:Ae.height,panelRect:e.panelRect})&&(_=Ee,C=Ae)}}else{const ve=Tt(e.measureDataLabel,"observation",O),$=ve[r];_=Xo({wedge:w,placement:r,justify:Et(n),align:a,offset:i,labelWidth:$.width,labelHeight:$.height}),C=ve[_.position]}const Le=l+Math.sin(_.labelAngle)*_.labelRadius,zn=u-Math.cos(_.labelAngle)*_.labelRadius;t.push({layerId:e.layer.id,x:Le,y:zn,text:O,width:C.width,height:C.height,isRotated:!1,role:"observation",position:_.position,..._.position==="inside"?{backdropColor:Ot(p,d)}:{}})}return{labels:t,droppedCount:0}},zo=()=>"absoluteGrandTotal",et=(e,t,r,n)=>{const a=Math.abs(e==="radial"?Math.sin(t):Math.cos(t)),i=Math.abs(e==="radial"?Math.cos(t):Math.sin(t));return a*(r/2)+i*(n/2)},Ho=({wedge:e,labelRadius:t,labelAngle:r,labelWidth:n,labelHeight:a})=>{if(t<=0)return!1;const i=Math.sin(r)*t,o=-Math.cos(r)*t,s={left:i-n/2,right:i+n/2,top:o-a/2,bottom:o+a/2},l=[[s.left,s.top],[s.right,s.top],[s.right,s.bottom],[s.left,s.bottom]],u=Math.hypot(Xt(0,s.left,s.right),Xt(0,s.top,s.bottom)),c=Math.max(...l.map(([d,h])=>Math.hypot(d,h)));if(u<e.innerRadiusPx-Y||c>e.outerRadiusPx+Y)return!1;const p=Math.abs(e.endAngle-e.startAngle)/2;return p>=Math.PI?!0:l.every(([d,h])=>{const g=Math.hypot(d,h);return g<=Y?!0:nt(Math.atan2(d,-h),e.midAngle)<=p+Y/g})?p<=Math.PI/2?!0:u<=Y?!1:!qt(e.startAngle,s)&&!qt(e.endAngle,s):!1},Ko=(e,t,r)=>{if(t<=0||t<e.innerRadiusPx-Y||t>e.outerRadiusPx+Y)return!1;const n=Math.abs(e.endAngle-e.startAngle)/2;return nt(r,e.midAngle)<=n+Y/t},Xt=(e,t,r)=>Math.min(r,Math.max(t,e)),qt=(e,t)=>{const r=Y,n=[[Math.sin(e),t.left+r,t.right-r],[-Math.cos(e),t.top+r,t.bottom-r]];let a=0,i=Number.POSITIVE_INFINITY;for(const[o,s,l]of n){if(s>l)return!1;if(Math.abs(o)<1e-9){if(s>0||l<0)return!1;continue}const u=s/o,c=l/o;a=Math.max(a,Math.min(u,c)),i=Math.min(i,Math.max(u,c))}return a<=i},$o=({x:e,y:t,labelWidth:r,labelHeight:n,panelRect:a})=>e-r/2>=0&&e+r/2<=a.width&&t-n/2>=0&&t+n/2<=a.height,Jt=({wedge:e,position:t,offset:r,labelWidth:n,labelHeight:a})=>t==="inside"?{labelRadius:(e.innerRadiusPx+e.outerRadiusPx)/2,labelAngle:e.midAngle,position:"inside"}:{labelRadius:e.outerRadiusPx+r+et("radial",e.midAngle,n,a),labelAngle:e.midAngle,position:"outside"},Xo=({wedge:e,placement:t,justify:r,align:n,offset:a,labelWidth:i,labelHeight:o})=>{const s=n==="start"?e.startAngle:n==="end"?e.endAngle:e.midAngle,l=a+et("radial",s,i,o);let u;if(r==="center")u=(e.innerRadiusPx+e.outerRadiusPx)/2;else if(r==="end")u=t==="inside"?e.outerRadiusPx-l:e.outerRadiusPx+l;else if(t==="inside")u=e.innerRadiusPx+l;else{const p=e.innerRadiusPx-l;u=p>=0?p:e.innerRadiusPx+l}let c=s;if(n!=="center"&&u>0){const p=et("tangential",s,i,o),d=Math.asin(Math.min(1,p/u));c=s+(n==="start"?1:-1)*d}return{labelRadius:u,labelAngle:c,position:Ko(e,u,c)?"inside":"outside"}},qo=class extends Q{constructor(...e){super(...e),this.type="bar",this.styleTarget={observation:{vocabulary:{cornerRadius:"barRadius",strokeWidth:"pixels"},aesthetics:{fill:"color",alpha:"alpha",strokeWidth:"strokeWidth"},rest:{fill:f("geom"),fillAlpha:1,cornerRadius:"sm",strokeWidth:1,stroke:f("geomBorder")},hovered:{stroke:f("hoverAffordance"),shadow:ao}}},this.defaultParams={},this.defaultPosition="dodge",this.positionRoles=[{axis:"x",role:"point",valueKind:"value"},{axis:"y",role:"min",valueKind:"value"},{axis:"y",role:"max",valueKind:"value",aes:"y"}],this.aesthetics=[{kind:"visual",name:"color"},{kind:"visual",name:"alpha"}],this.summaries={grandTotal:!0,stackTotals:!0,perGroupHeadline:!0},this.grid={cartesian:{hideGridX:!0},flip:{hideGridX:!0}},this.legend={suppressWhenSingleItem:!0,sidePlacement:"whenStackedVertical",directLabelSupport:{stack:!0,fill:!0}},this.scaleConstraints={discreteMainAxis:!0,zeroBaseline:!0},this.dataLabels={polar:{format:"percentage"}},this.dataLabelCoordTypes=["cartesian","flip","polar"],this.highlightStrategy="observation-rerender",this.supportedCoordTypes=["cartesian","polar","flip"],this.spatialKind="rects",this.resolveDataLabelDefaults=t=>he(t)?{justify:"center"}:{},this.resolveBandFraction=(t,r)=>tt(t,r.type),this.resolveAnchorPosition=(t,{coordSystem:r,position:n,purpose:a,align:i})=>{if(i!==void 0){const p=mr(t,r);return p===null?null:st(p,i)}if(r.type==="polar")return Jo(t);const o=he(n),s={isSolo:!o||_n(t)==="solo",isNegative:o&&Zo(t),purpose:a};if(r.mainAxis==="x"){const p=J(t),d=Z(t),h=Zt({lowerBound:H(t),upperBound:K(t)??z(t),options:s});return p===null||d===null||h===null?null:{x:(p+d)/2,y:h}}const l=H(t),u=K(t),c=Zt({lowerBound:J(t),upperBound:Z(t)??q(t),options:s});return l===null||u===null||c===null?null:{x:c,y:(l+u)/2}},this.getDataLabelPlacements=t=>t.coordSystem.type==="polar"?Go(t):Ro(t),this.resolvePercentageValueStrategy=(t,r)=>r==="polar"?zo():wo(t)}resolveParams(e){const{width:t,...r}=super.resolveParams(e),n=this.resolveWidthParam(t,e.diagnostics);return{...r,...n!==void 0&&{width:n}}}compile({data:e,mapping:t,params:r,coordType:n}){const a=tt(r,n);e=vt(e,t),e.hasVariable(m.yMin)||(e=e.addConstantVariable(m.yMin,"numeric",0));const i=a/2;return e=e.addConstantVariable(m.xMin,"numeric",-i).addConstantVariable(m.xMax,"numeric",i),{data:e,mapping:{}}}resolveWidthParam(e,t){if(e===void 0)return;const r=typeof e=="number"&&Number.isFinite(e)?e:null;if(r!==null&&r>0&&r<=1)return r;const n=r!==null&&r>1?1:void 0;return t?.addWarning({code:"INVALID_GEOM_PARAM",message:`Bar width must be a fraction in (0, 1], got ${String(e)}; falling back to ${n??"the default band"}.`,context:{geom:this.type,param:"width",expected:"0 < width <= 1",actual:r??String(e)},suggestion:"Set params.width to a fraction of the category band in (0, 1]."}),n}},tt=({width:e},t)=>e!==void 0?e:t==="polar"?1:Sn,Jo=e=>{const t=J(e),r=Z(e),n=H(e),a=K(e);return t===null||r===null||n===null||a===null?null:te((t+r)/2,(n+a)/2)},Zo=e=>{const t=yr(e);return S(t)&&t<0},Zt=e=>{const{lowerBound:t,upperBound:r,options:n}=e,a=n.isNegative?t:r;if(a===null)return null;if(n.purpose==="value"||n.isSolo)return a;const i=n.isNegative?r:t;return i===null?null:(i+a)/2},Qo=e=>{const t=[];if(!e.layer.dataLabels.showDataLabels)return{labels:t,droppedCount:0};const{offset:r}=e.layer.dataLabels,n=es(e.layer);for(const a of e.layer.data){const i=q(a),o=z(a);if(i===null||o===null||!Ve(i,o))continue;const s=e.formatLabel(a);if(s==="")continue;const{width:l,height:u}=e.measureDataLabel("observation","outside",s),c=be({box:{x:i*e.panelRect.width,y:(1-o)*e.panelRect.height,width:0,height:0},panel:me(e.panelRect),orientation:{valueAxis:"y",valueDirectionSign:-1},...n,offset:r,labelWidth:l,labelHeight:u});t.push({layerId:e.layer.id,x:c.x,y:c.y,text:s,width:l,height:u,isRotated:!1,role:"observation",position:c.position})}return{labels:t,droppedCount:0}},es=e=>{const{position:t,justify:r,align:n}=e.dataLabels;return t==="auto"?{placement:"outside",justify:"end",align:"center"}:{placement:t,justify:ht(e.data,e.mapping)?Et(r):r,align:n}},ts=class extends Q{constructor(...e){super(...e),this.type="line",this.styleTarget={observation:{vocabulary:{strokeWidth:"pixels",dashArray:"dashArray",lineCap:"lineCap",lineJoin:"lineJoin"},aesthetics:{stroke:"color",strokeAlpha:"alpha",strokeWidth:"strokeWidth",dashArray:"lineType"},rest:{stroke:f("geom"),strokeWidth:2,dashArray:j.line.solid}}},this.supportedCoordTypes=["cartesian","polar","flip"],this.defaultParams={curve:"linear",missingValues:"gap"},this.positionRoles=[{axis:"x",role:"point",valueKind:"value"},{axis:"y",role:"point",valueKind:"value"}],this.aesthetics=[{kind:"visual",name:"color"},{kind:"visual",name:"strokeWidth"},{kind:"visual",name:"lineType"},{kind:"visual",name:"alpha"}],this.summaries={perGroupHeadline:!0},this.dataLabels={cartesian:{offset:8},flip:{offset:8}},this.dataLabelCoordTypes=["cartesian","flip"],this.isComposite=!0,this.legend={suppressWhenSingleItem:!0,sidePlacement:"whenCrowded",directLabelSupport:{stack:!0,dodge:!0,identity:!0,fill:!0}},this.highlightStrategy="overlay-anchor",this.spatialKind="buckets",this.resolveAnchorPosition=At,this.getDataLabelPlacements=t=>Qo(t)}compile(e){return{data:vt(e.data,e.mapping),mapping:{}}}},rs=e=>{const t=[];if(!e.layer.dataLabels.showDataLabels)return{labels:t,droppedCount:0};const{offset:r}=e.layer.dataLabels,n=ns(e.layer),a=n.justify==="panel-start"||n.justify==="panel-end",i=e.styleReaders;for(const o of e.layer.data){const s=q(o),l=z(o);if(s===null||l===null||!Ve(s,l))continue;const u=e.formatLabel(o);if(u==="")continue;const{width:c,height:p}=e.measureDataLabel("observation","outside",u),d=i.get("size",o)/2,h=be({box:{x:s*e.panelRect.width,y:(1-l)*e.panelRect.height,width:0,height:0},panel:me(e.panelRect),orientation:{valueAxis:"y",valueDirectionSign:-1},...n,offset:a?r:r+d,alignOffset:r+d,labelWidth:c,labelHeight:p});t.push({layerId:e.layer.id,x:h.x,y:h.y,text:u,width:c,height:p,isRotated:!1,role:"observation",position:h.position})}return{labels:t,droppedCount:0}},ns=e=>{const{position:t,justify:r,align:n}=e.dataLabels;return t==="auto"?{placement:"outside",justify:"end",align:"center"}:{placement:t,justify:r,align:n}},as=class extends Q{constructor(...e){super(...e),this.type="point",this.styleTarget={observation:{vocabulary:{size:"pixels",symbol:"pointSymbol",strokeWidth:"pixels"},aesthetics:{fill:"color",alpha:"alpha",size:"size",strokeWidth:"strokeWidth"},rest:{fill:f("geom"),fillAlpha:1,size:8,symbol:"circle",stroke:f("hoverAffordance"),strokeWidth:1},hovered:{stroke:f("hoverAffordance")}}},this.supportedCoordTypes=["cartesian","polar","flip"],this.defaultParams={},this.positionRoles=[{axis:"x",role:"point",valueKind:"value"},{axis:"y",role:"point",valueKind:"value"}],this.aesthetics=[{kind:"visual",name:"color"},{kind:"visual",name:"size"},{kind:"visual",name:"alpha"}],this.summaries={perGroupHeadline:!0},this.highlightStrategy="overlay-anchor",this.dataLabelCoordTypes=["cartesian","flip"],this.resolveAnchorPosition=At,this.resolveValueSource=(t,r)=>{if(r!=="label")return null;const n=L(t.size);return n!==null?{variable:n}:null},this.getDataLabelPlacements=t=>rs(t)}compile({data:e}){return{data:e,mapping:{}}}},is=class extends Q{constructor(...e){super(...e),this.type="rule",this.styleTarget={observation:{vocabulary:{stroke:"color",strokeAlpha:"unitInterval",strokeWidth:"pixels",dashArray:"dashArray",lineCap:"lineCap",lineJoin:"lineJoin",shadow:"shadow",blendMode:"blendMode"},sharedPaint:!1,dashPresets:j.rule,aesthetics:{stroke:"color",strokeWidth:"strokeWidth",dashArray:"lineType"},rest:{stroke:f("ruleLine"),strokeWidth:1,dashArray:j.rule.dashed}},parts:{label:{vocabulary:E,options:["layer"],rest:{fontSize:11.5,fontWeight:500,lineHeight:1}}}},this.defaultParams={labelPosition:"start"},this.defaultInteractive=!1,this.positionRoles=[{axis:"y",role:"scalar",valueKind:"value",aes:"y"},{axis:"x",role:"scalar",valueKind:"value",aes:"x"}],this.highlightStrategy=null,this.spatialKind="noop",this.validateMapping=({mapping:t,computedVariables:r})=>{const n=r.has("x")||S(Pe(t.x)),a=r.has("y")||S(Pe(t.y));return n&&a?[{code:"INVALID_RULE_MAPPING",message:"rule geom requires exactly one of 'x' or 'y', both were provided"}]:!n&&!a?[{code:"INVALID_RULE_MAPPING",message:"rule geom requires a numeric value on 'x' or 'y'"}]:[]}}compile({data:e,mapping:t}){const r=Qt(t.y,e);if(r!==null)return{data:new ae({[Te.y]:{type:"numeric",values:[r.value],valueFormat:r.sourceFormat}}),mapping:{y:Te.y,x:void 0}};const n=Qt(t.x,e);return n!==null?{data:new ae({[Te.x]:{type:"numeric",values:[n.value],valueFormat:n.sourceFormat}}),mapping:{x:Te.x,y:void 0}}:{data:new ae,mapping:{x:void 0,y:void 0}}}},Qt=(e,t)=>{const r=Pe(e);if(S(r))return{value:r,sourceFormat:void 0};const n=L(e);if(n===null||!ma(n)||!t.hasVariable(n))return null;const[a]=t.getValues(n);return S(a)?{value:a,sourceFormat:t.getValueFormat(n)}:null};function Dn(e){return e[le.color]}function os(e){return e[le.alpha]}function ss(e){return e[le.size]}function ls(e){return e[le.strokeWidth]}function us(e){return e[le.lineType]}var kn=e=>{const t=J(e),r=Z(e),n=H(e),a=K(e);if(t===null||r===null||n===null||a===null)return null;const i=Math.min(t,r),o=Math.abs(r-t),s=Math.max(n,a),l=Math.abs(a-n);return{x:i,y:1-s,width:o,height:l}},In=e=>{const t=kn(e);if(!t)return null;const r=t.width*Mo,n=t.height*xo;return{x:t.x+r,y:t.y+n,width:t.width-r*2,height:t.height-n*2}},Cn=e=>!!Dn(e),Nn=e=>Cn(e)?In(e):null,er=4,cs=e=>{const t=[];if(!e.layer.dataLabels.showDataLabels)return{labels:t,droppedCount:0};const r=e.styleReaders;for(const n of e.layer.data){const a=Nn(n);if(a===null)continue;const i=e.formatLabel(n);if(i==="")continue;const{width:o,height:s}=e.measureDataLabel("observation","inside",i),l=a.width*e.panelRect.width,u=a.height*e.panelRect.height;o+er>l||s+er>u||t.push({layerId:e.layer.id,x:(a.x+a.width/2)*e.panelRect.width,y:(a.y+a.height/2)*e.panelRect.height,text:i,width:o,height:s,isRotated:!1,role:"observation",position:"inside",backdropColor:Ot(r,n)})}return{labels:t,droppedCount:0}},ds=e=>{const t=L(e.color);return t!==null?{variable:t}:null},fs=class extends Q{constructor(...e){super(...e),this.type="tile",this.styleTarget={observation:{vocabulary:{cornerRadius:"pixels",strokeWidth:"pixels"},aesthetics:{fill:"color",alpha:"alpha",strokeWidth:"strokeWidth"},rest:{fill:f("geom"),fillAlpha:1,cornerRadius:8,strokeWidth:0},hovered:{stroke:f("hoverAffordance"),strokeWidth:2}}},this.defaultParams={},this.positionRoles=[{axis:"x",role:"point",valueKind:"value"},{axis:"x",role:"min",valueKind:"value"},{axis:"x",role:"max",valueKind:"value"},{axis:"y",role:"point",valueKind:"value"},{axis:"y",role:"min",valueKind:"value"},{axis:"y",role:"max",valueKind:"value"}],this.supportedPositions=["identity"],this.supportedCoordTypes=["cartesian"],this.aesthetics=[{kind:"visual",name:"color",required:!0}],this.scaleConstraints={discreteMainAxis:!0,discreteCrossAxis:!0,bandPadding:0,inferredColor:!0},this.grid={cartesian:{hideGridX:!0,hideGridY:!0}},this.legend={suppressWhenSingleItem:!1},this.dataLabels={cartesian:{showDataLabels:!0}},this.dataLabelCoordTypes=["cartesian"],this.highlightStrategy="observation-rerender",this.spatialKind="cells",this.identityKey="x-y",this.tooltip=[{aes:"color"}],this.resolveValueSource=ds,this.resolveAnchorPosition=t=>{const r=J(t),n=Z(t),a=H(t),i=K(t);return r===null||n===null||a===null||i===null?null:{x:(r+n)/2,y:(a+i)/2}},this.getDataLabelPlacements=t=>cs(t)}compile({data:e}){return{data:e.addConstantVariable(m.xMin,"numeric",-.5).addConstantVariable(m.xMax,"numeric",.5).addConstantVariable(m.yMin,"numeric",-.5).addConstantVariable(m.yMax,"numeric",.5),mapping:{}}}},Fn=[new qo,new as,new ts,new So,new is,new fs],ps=class extends pt{constructor(){super("geom");for(const e of Fn)this.register(e.type,e)}},jn=class{compute(e){return this.computeStat(e)}},hs=class{constructor(){this.transformType="aggregate"}apply(e,t){const{options:r}=t,n={};for(const a of r.operations)n[a.as]={variableName:a.variableName,aggregation:a.op};return e.groupBy(...r.groupby).rollup(n)}},gs={numeric:{type:"decimal"},categorical:{type:"text"},temporal:{type:"datetime"}},ys=class{constructor(){this.transformType="constant"}apply(e,t){const{options:r}=t,n=dt(r.value,gs[r.type],Me);if(r.value!==null&&n===null)throw new oe({code:"INCOMPATIBLE_TYPE",message:`Constant '${r.variableName}' cannot be read as ${r.type}`,context:{variableName:r.variableName,variableType:r.type}});return e.addConstantVariable(r.variableName,r.type,n)}getIntroducedVariables(e){const{options:t}=e;return[t.variableName]}},ms=class{constructor(){this.transformType="filter"}apply(e,t){const{options:r}=t;return e.filter(r.variableName,r.operator,r.value)}},bs=class{constructor(){this.transformType="reshape"}apply(e,t){const{options:r}=t;return e.reshapeFromWideToLong({keep:r.keep,reshape:r.reshape,keyName:r.keyName,valueName:r.valueName})}getIntroducedVariables(e){const{options:t}=e;return[t.keyName??"key"]}},vs=class{constructor(){this.transformType="sort"}apply(e,t){const{options:r}=t;return e.orderBy(r.variableName,r.direction??"asc")}},As=[new hs,new ys,new ms,new bs,new vs],Es=class extends pt{constructor(){super("transform");for(const e of As)this.register(e.transformType,e)}};function Vn(e){if("definition"in e)return e.definition;if(Bn(e)||Wn(e)||Un(e))return e}function Ts(e){const t=[],r=[],n=[];for(const a of e){const i=Vn(a);i&&(Bn(i)?(t.push(i),i.defaultStat!==null&&r.push(i.defaultStat)):Wn(i)?r.push(i):Un(i)&&n.push(i))}return{geoms:t,stats:r,transforms:n,warnings:[...Xe("geom",t,a=>a.type),...Xe("stat",r,a=>a.type),...Xe("transform",n,a=>a.transformType),...Os(t),...Ps(t)]}}function Os(e){const t=[];for(const r of e)r.spatialKind==="render-hit-test"&&(r.identityKey!=="x-group"&&r.identityKey!=="x-y"||t.push({code:"RENDER_HIT_TEST_IDENTITY",message:`The render-hit-test geom '${r.type}' uses the position-derived '${r.identityKey}' identity, which has no meaning for render-owned geometry; its hover lookup will be empty.`,context:{kind:"geom",requested:r.type},suggestion:"Declare 'identityKey' as a column the geom owns (`{ variable: '<column>' }`) or 'index', so a hit-test result resolves to an observation."}));return t}function Ps(e){const t=[];for(const r of e)r.spatialKind!=="cells"||!r.supportedCoordTypes.includes("polar")||t.push({code:"SPATIAL_KIND_COORD_UNSUPPORTED",message:`The geom '${r.type}' declares polar support, but its 'cells' hit-test shape has no polar projection; its observations will not respond to hover under polar coords.`,context:{kind:"geom",requested:r.type},suggestion:"Drop 'polar' from 'supportedCoordTypes', or declare 'rects' as the spatial kind so a bandless polar layer hit-tests as an enclosure."});return t}function Xe(e,t,r){const n=new Map;for(const i of t){const o=r(i),s=n.get(o);s?s.add(i):n.set(o,new Set([i]))}const a=[];for(const[i,o]of n)o.size<2||a.push({code:"DUPLICATE_REGISTERED_TYPE",message:`Multiple plugins register the ${e} '${i}' (${o.size} definitions); the last in the array wins.`,context:{kind:e,requested:i},suggestion:`Remove the duplicate ${e} plugin(s) named '${i}', or rename them so each registers a distinct ${e}.`});return a}var Bn=e=>e instanceof Q,Wn=e=>e instanceof jn,Un=e=>"transformType"in e&&typeof e.apply=="function",Ss=["brick","gray","red","orange","yellow","green","cyan","blue","purple","pink"],_s=["cyan","pink","purple","red","orange","yellow","green","blue"],Yn=["#B84737","#BA7420","#0B8666","#3D63A8","#DD9583","#E2BF6B","#95CBA6","#AABCE5"],Gn="brick",N={red:"#E83562",orange:"#F38650",yellow:"#FBBC30",green:"#31FCB4",cyan:"#40F8FF",blue:"#279EFF",purple:"#B399FD",dark_purple:"#6D48D2",plum:"#C82184",pink:"#FC8497"},Ms=[N.purple,N.pink,N.yellow,N.blue,N.red,N.cyan,N.orange,N.plum,N.green,N.dark_purple],k={green:"#B2DDC9",cyan:"#A2D5E2",blue:"#AAC4FF",purple:"#B2A4FF",plum:"#DCA8C7",pink:"#FFCCD3",red:"#FFADAD",orange:"#FFDEB4",yellow:"#FDF7C3"},xs=[k.green,k.purple,k.red,k.cyan,k.pink,k.blue,k.orange,k.plum,k.yellow],_e={brick900:"#6E0500",brick800:"#881D11",brick700:"#A03522",brick600:"#B0523B",brick500:"#C06D56",brick400:"#CE8772",brick300:"#DBA28E",brick200:"#E7BDAC",brick100:"#F2D8CB",brick50:"#FCF4EA",gray900:"#1c1917",gray800:"#292524",gray700:"#44403c",gray600:"#57534e",gray500:"#78716c",gray400:"#a8a29e",gray300:"#d6d3d1",gray200:"#e7e5e4",gray100:"#f5f5f4",gray50:"#fafaf9",red900:"#7f1d1d",red800:"#991b1b",red700:"#b91c1c",red600:"#dc2626",red500:"#ef4444",red400:"#f87171",red300:"#fca5a5",red200:"#fecaca",red100:"#fee2e2",red50:"#fef2f2",orange900:"#7c2d12",orange800:"#9a3412",orange700:"#c2410c",orange600:"#ea580c",orange500:"#f97316",orange400:"#fb923c",orange300:"#fdba74",orange200:"#fed7aa",orange100:"#ffedd5",orange50:"#fff7ed",yellow900:"#553B0C",yellow800:"#6F4B08",yellow700:"#8D6300",yellow600:"#BD8A00",yellow500:"#E5B400",yellow400:"#FFC800",yellow300:"#FBDA2B",yellow200:"#FEED72",yellow100:"#FEF8B4",yellow50:"#FEFCE2",green900:"#064e3b",green800:"#065f46",green700:"#047857",green600:"#059669",green500:"#10b981",green400:"#34d399",green300:"#6ee7b7",green200:"#a7f3d0",green100:"#d1fae5",green50:"#ecfdf5",cyan900:"#164e63",cyan800:"#155e75",cyan700:"#0e7490",cyan600:"#0891B2",cyan500:"#06b6d4",cyan400:"#22d3ee",cyan300:"#67e8f9",cyan200:"#a5f3fc",cyan100:"#cffafe",cyan50:"#ecfeff",blue900:"#1e3a8a",blue800:"#1e40af",blue700:"#1d4ed8",blue600:"#2563eb",blue500:"#3b82f6",blue400:"#60a5fa",blue300:"#93c5fd",blue200:"#bfdbfe",blue100:"#dbeafe",blue50:"#eff6ff",purple900:"#4c1d95",purple800:"#5b21b6",purple700:"#6d28d9",purple600:"#7c3aed",purple500:"#8b5cf6",purple400:"#a78bfa",purple300:"#c4b5fd",purple200:"#ddd6fe",purple100:"#ede9fe",purple50:"#f5f3ff",pink900:"#751A5E",pink800:"#8F1972",pink700:"#AF1C8A",pink600:"#D326A8",pink500:"#E845BF",pink400:"#F979D9",pink300:"#FCABE8",pink200:"#FED0F3",pink100:"#FFE8F9",pink50:"#FFF4FC"},Ls=[_e.brick100,_e.brick900],Rs=[_e.gray200,k.green,k.red,_e.gray200],tr={dark:{1:[500],2:[600,400],3:[600,400,200],4:[600,500,300,100],5:[700,600,400,200,50],6:[600,500,400,300,200,100],7:[600,500,400,300,200,100,50],default:[700,600,500,400,300,200,100,50]},light:{1:[600],2:[700,500],3:[800,600,400],4:[800,600,400,300],5:[800,700,600,500,400],6:[800,700,600,500,400,300],7:[900,800,700,600,500,400,300],default:[900,800,700,600,500,400,300,200]}},D={cyan:"#22D3EE",pink:"#F377EF",purple:"#6528F7",red:"#FB2576",orange:"#FF9300",yellow:"#FBFF00",green:"#06FF00",blue:"#0079FF"},De=[D.cyan,D.pink,D.purple,D.red,D.orange,D.yellow,D.green,D.blue],ws=[D.cyan,D.green,D.red,D.cyan],ke={start:"#84D1FC",positive:"#84FC89",negative:"#FC8497",total:"#84D1FC"},Ds=[ke.start,ke.positive,ke.negative,ke.total],ks={transform:"linear",reverse:!1,nice:!0,domainMin:null,domainMax:null,range:null,scheme:null,interpolate:"lab",domainMid:null,symmetric:!1},Is={size:[4,20],alpha:[.1,1],strokeWidth:[1,4]},Cs={domainMin:null,domainMax:null,nice:!1,reverse:!1},Ns={range:null,domain:null,padding:.1,reverse:!1},rr={palette:{type:"default"}};function nr(e,t="light",r){return((r!==void 0?tr[t][r]:void 0)??tr[t].default).map(n=>_e[`${e}${n}`])}function Fs(e){const t=De.indexOf(D[e]);return t<=0?De:[...De.slice(t),...De.slice(0,t)]}function js(e,t={}){switch(e.type){case"default":return t.hasTouchingGeoms?nr(Gn,t.colorScheme??"light",t.groupCount):Yn;case"graphy":return e.variant==="waterfall"?Ds:Ms;case"pastel":return e.variant==="waterfall"?Rs:xs;case"neon":return e.variant==="waterfall"?ws:Fs(e.base);case"mono":return nr(e.base,e.variant??"light",t.groupCount);case"custom":return e.colors}}function Vs(e,t){if(!t)return e;const r=[...e];for(const[n,a]of Object.entries(t)){const i=Number(n);if(!Number.isInteger(i)||i<1)continue;const o=i-1;o<r.length&&(r[o]=a)}return r}function Bs(e,t,r,n){if(!t)return;const a=r?.type==="custom"?n[r.id]:void 0,i={};for(const[o,s]of Object.entries(t)){const l=Number(o);if(!(!Number.isInteger(l)||l<1)){if(s.hex!==void 0){i[l]=s.hex;continue}if(s.id!==void 0){const u=a?.find(c=>c.id===s.id)?.hex;u!==void 0?i[l]=u:e.diagnostics.addWarning({code:"PALETTE_NOT_FOUND",message:`Palette override at slot ${l} with id '${s.id}' did not resolve against the active palette — falling back to palette color.`,context:{requested:s.id,available:a?.map(c=>c.id)??[]},suggestion:"Define the override id in the active custom palette, or use a hex value instead."})}}}return Object.keys(i).length>0?i:void 0}function Ws(e,t,r){if(!t)return rr.palette;if(t.type==="custom"){const n=r[t.id];if(!n)return e.diagnostics.addWarning({code:"PALETTE_NOT_FOUND",message:`Custom palette with id "${t.id}" not found — falling back to the default palette.`,context:{requested:t.id,available:Object.keys(r)},suggestion:"Register the palette in customPalettes, or reference an existing palette id."}),rr.palette;const a=n.map(i=>i.hex);return{type:"custom",id:t.id,colors:a}}return t}function Us(e,t={}){const r=t;return{type:"scale",scaledAesthetic:e,scaleType:"continuous",transform:t.transform,reverse:t.reverse,nice:t.nice,clamp:t.clamp,domainMin:t.domainMin??null,domainMax:t.domainMax??null,range:t.range,scheme:r.scheme??null,interpolate:r.interpolate,domainMid:r.domainMid??null,symmetric:r.symmetric}}function Ys(e,t={}){return{type:"scale",scaledAesthetic:e,scaleType:"datetime",domainMin:t.domainMin??null,domainMax:t.domainMax??null,nice:t.nice,reverse:t.reverse,clamp:t.clamp}}function Gs(e,t={}){return{type:"scale",scaledAesthetic:e,scaleType:"discrete",range:t.range,domain:t.domain??null,padding:t.padding,reverse:t.reverse}}function zs(e,t={}){return{type:"scale",scaledAesthetic:e,scaleType:"identity"}}function Hs(e,t){return{type:"scale",scaledAesthetic:e,scaleType:"inferred",options:t}}function Ks(e,t={}){return{type:"scale",scaledAesthetic:e,scaleType:"palette",palette:t.palette,overrides:t.overrides}}var $s={labelCrossPosition:.5},Xs={kind:"rectangle",zOrder:"foreground"},qs={zOrder:"foreground",fit:"contain"},Js={x:8,y:8,unit:"px"},Zs={align:"center"},Qs={startArrowheadStyle:"none",endArrowheadStyle:"line-arrow"},el={thin:2,medium:4,thick:8},tl=.5,rl={strokeWidth:2,shadow:{offsetX:0,offsetY:1.15,blur:1.15,color:"rgba(0, 0, 0, 0.16)"}},nl={small:{arrow:{strokeWidth:2},label:{fontSize:12,fontWeight:500,paddingInline:6,paddingBlock:3,strokeWidth:1}},medium:{arrow:{strokeWidth:3},label:{fontSize:16,fontWeight:500,paddingInline:8,paddingBlock:4,strokeWidth:1.5}},large:{arrow:{strokeWidth:5},label:{fontSize:20,fontWeight:600,paddingInline:10,paddingBlock:5,strokeWidth:2}}},al={differenceArrow:"differenceArrows",shape:"shapes",arrow:"arrows",text:"textAnnotations",image:"images",sticker:"stickers",pinnedNumber:"pinnedNumbers",comment:"comments"},il={differenceArrow(e){return{type:"annotation",kind:"differenceArrow",annotation:e}},shape(e){return{type:"annotation",kind:"shape",annotation:e}},arrow(e){return{type:"annotation",kind:"arrow",annotation:e}},text(e){return{type:"annotation",kind:"text",annotation:e}},image(e){return{type:"annotation",kind:"image",annotation:e}},sticker(e){return{type:"annotation",kind:"sticker",annotation:e}},pinnedNumber(e){return{type:"annotation",kind:"pinnedNumber",annotation:e}},comment(e){return{type:"annotation",kind:"comment",annotation:e}}};Object.defineProperty(exports,"ANNOTATION_BUCKETS",{enumerable:!0,get:function(){return al}});Object.defineProperty(exports,"ARROW_DEFAULTS",{enumerable:!0,get:function(){return Qs}});Object.defineProperty(exports,"ARROW_STICKER_DECLARATIONS",{enumerable:!0,get:function(){return rl}});Object.defineProperty(exports,"ARROW_STROKE_WIDTHS_PX",{enumerable:!0,get:function(){return el}});Object.defineProperty(exports,"AXIS_KEYS",{enumerable:!0,get:function(){return ii}});Object.defineProperty(exports,"BAR_GROUP_SCALE_PADDING_FRACTION",{enumerable:!0,get:function(){return _o}});Object.defineProperty(exports,"BAR_WIDTH_FRACTION",{enumerable:!0,get:function(){return Sn}});Object.defineProperty(exports,"BORDER_RADIUS_TOKENS",{enumerable:!0,get:function(){return gt}});Object.defineProperty(exports,"BUILT_IN_GEOMS",{enumerable:!0,get:function(){return Fn}});Object.defineProperty(exports,"CONSTANT_VARIABLES",{enumerable:!0,get:function(){return at}});Object.defineProperty(exports,"CONTINUOUS_SCALE_DEFAULTS",{enumerable:!0,get:function(){return ks}});Object.defineProperty(exports,"ChronologicalDateManager",{enumerable:!0,get:function(){return Pr}});Object.defineProperty(exports,"DASH_PRESETS",{enumerable:!0,get:function(){return j}});Object.defineProperty(exports,"DATETIME_SCALE_DEFAULTS",{enumerable:!0,get:function(){return Cs}});Object.defineProperty(exports,"DEFAULT_BAR_CORNER_RADIUS",{enumerable:!0,get:function(){return $i}});Object.defineProperty(exports,"DEFAULT_COLOR_PALETTE",{enumerable:!0,get:function(){return Yn}});Object.defineProperty(exports,"DEFAULT_DIMMED_ALPHA",{enumerable:!0,get:function(){return vn}});Object.defineProperty(exports,"DEFAULT_GEOM_COLOR",{enumerable:!0,get:function(){return Ki}});Object.defineProperty(exports,"DEFAULT_GRAPH_BACKGROUND",{enumerable:!0,get:function(){return Zi}});Object.defineProperty(exports,"DEFAULT_GRAPH_BORDER_WIDTH_PX",{enumerable:!0,get:function(){return eo}});Object.defineProperty(exports,"DEFAULT_GRAPH_PADDING_EDGES_PX",{enumerable:!0,get:function(){return ro}});Object.defineProperty(exports,"DEFAULT_GRAPH_PADDING_PX",{enumerable:!0,get:function(){return to}});Object.defineProperty(exports,"DEFAULT_HEADLINE_SWATCH_SIZE_PX",{enumerable:!0,get:function(){return Ji}});Object.defineProperty(exports,"DEFAULT_HOVER_AFFORDANCE_COLOR",{enumerable:!0,get:function(){return Qi}});Object.defineProperty(exports,"DEFAULT_LOCALE",{enumerable:!0,get:function(){return Me}});Object.defineProperty(exports,"DEFAULT_MONO_BASE",{enumerable:!0,get:function(){return Gn}});Object.defineProperty(exports,"DEFAULT_POINT_SIZE_PX",{enumerable:!0,get:function(){return qi}});Object.defineProperty(exports,"DEFAULT_RESHAPE_VALUE_NAME",{enumerable:!0,get:function(){return Qr}});Object.defineProperty(exports,"DEFAULT_SEQUENTIAL_RAMP",{enumerable:!0,get:function(){return Ls}});Object.defineProperty(exports,"DEFAULT_STROKE_WIDTH_PX",{enumerable:!0,get:function(){return Xi}});Object.defineProperty(exports,"DIFFERENCE_ARROW_DEFAULTS",{enumerable:!0,get:function(){return $s}});Object.defineProperty(exports,"DIFFERENCE_ARROW_SIZE_DECLARATIONS",{enumerable:!0,get:function(){return nl}});Object.defineProperty(exports,"DISCRETE_SCALE_DEFAULTS",{enumerable:!0,get:function(){return Ns}});Object.defineProperty(exports,"DataCompiler",{enumerable:!0,get:function(){return Ei}});Object.defineProperty(exports,"Dataset",{enumerable:!0,get:function(){return ae}});Object.defineProperty(exports,"GROUP_VARIABLES",{enumerable:!0,get:function(){return Ce}});Object.defineProperty(exports,"Geom",{enumerable:!0,get:function(){return Q}});Object.defineProperty(exports,"GeomRegistry",{enumerable:!0,get:function(){return ps}});Object.defineProperty(exports,"IMAGE_ANNOTATION_DEFAULTS",{enumerable:!0,get:function(){return qs}});Object.defineProperty(exports,"IS_DEV",{enumerable:!0,get:function(){return ne}});Object.defineProperty(exports,"InternalError",{enumerable:!0,get:function(){return x}});Object.defineProperty(exports,"LAYER_LABEL_VARIABLES",{enumerable:!0,get:function(){return ha}});Object.defineProperty(exports,"LINE_TYPES",{enumerable:!0,get:function(){return Ar}});Object.defineProperty(exports,"MONO_BASES",{enumerable:!0,get:function(){return Ss}});Object.defineProperty(exports,"NEON_BASES",{enumerable:!0,get:function(){return _s}});Object.defineProperty(exports,"NON_POSITION_RANGE_DEFAULTS",{enumerable:!0,get:function(){return Is}});Object.defineProperty(exports,"POLAR_RIM_LABEL_GAP_PX",{enumerable:!0,get:function(){return la}});Object.defineProperty(exports,"POSITION_ADJUSTMENTS",{enumerable:!0,get:function(){return vr}});Object.defineProperty(exports,"POSITION_NUMERIC_ROLES",{enumerable:!0,get:function(){return _i}});Object.defineProperty(exports,"POSITION_VARIABLES",{enumerable:!0,get:function(){return m}});Object.defineProperty(exports,"Registry",{enumerable:!0,get:function(){return pt}});Object.defineProperty(exports,"SCALED_POSITION_AESTHETIC_KEYS",{enumerable:!0,get:function(){return Kr}});Object.defineProperty(exports,"SCALED_VISUAL_AESTHETIC_KEYS",{enumerable:!0,get:function(){return ft}});Object.defineProperty(exports,"SELECTION_PADDING_DEFAULT",{enumerable:!0,get:function(){return Js}});Object.defineProperty(exports,"SHAPE_DEFAULTS",{enumerable:!0,get:function(){return Xs}});Object.defineProperty(exports,"STACK_VARIABLES",{enumerable:!0,get:function(){return ot}});Object.defineProperty(exports,"STAT_VARIABLES",{enumerable:!0,get:function(){return it}});Object.defineProperty(exports,"STYLE_BLEND_MODES",{enumerable:!0,get:function(){return gn}});Object.defineProperty(exports,"STYLE_DOMAINS",{enumerable:!0,get:function(){return Hi}});Object.defineProperty(exports,"STYLE_FONT_STYLES",{enumerable:!0,get:function(){return cn}});Object.defineProperty(exports,"STYLE_IMAGE_FITS",{enumerable:!0,get:function(){return sn}});Object.defineProperty(exports,"STYLE_LINE_CAPS",{enumerable:!0,get:function(){return pn}});Object.defineProperty(exports,"STYLE_LINE_JOINS",{enumerable:!0,get:function(){return hn}});Object.defineProperty(exports,"STYLE_PATTERN_PRESETS",{enumerable:!0,get:function(){return on}});Object.defineProperty(exports,"STYLE_POINT_SYMBOLS",{enumerable:!0,get:function(){return yn}});Object.defineProperty(exports,"STYLE_PROPERTY_NAMES",{enumerable:!0,get:function(){return Wi}});Object.defineProperty(exports,"STYLE_SELECT_KEYS",{enumerable:!0,get:function(){return bn}});Object.defineProperty(exports,"STYLE_STATES",{enumerable:!0,get:function(){return Bi}});Object.defineProperty(exports,"STYLE_TARGETS",{enumerable:!0,get:function(){return Be}});Object.defineProperty(exports,"STYLE_TEXT_DECORATIONS",{enumerable:!0,get:function(){return fn}});Object.defineProperty(exports,"STYLE_TEXT_TRANSFORMS",{enumerable:!0,get:function(){return dn}});Object.defineProperty(exports,"SUFFIX_MULTIPLIERS",{enumerable:!0,get:function(){return Sr}});Object.defineProperty(exports,"Stage",{enumerable:!0,get:function(){return Hr}});Object.defineProperty(exports,"Stat",{enumerable:!0,get:function(){return jn}});Object.defineProperty(exports,"TAU",{enumerable:!0,get:function(){return G}});Object.defineProperty(exports,"TEXT_ANNOTATION_DEFAULTS",{enumerable:!0,get:function(){return Zs}});Object.defineProperty(exports,"TEXT_ANNOTATION_FADE_ALPHA",{enumerable:!0,get:function(){return tl}});Object.defineProperty(exports,"TransformRegistry",{enumerable:!0,get:function(){return Es}});Object.defineProperty(exports,"UserInputError",{enumerable:!0,get:function(){return oe}});Object.defineProperty(exports,"VISUAL_VARIABLES",{enumerable:!0,get:function(){return le}});Object.defineProperty(exports,"VizError",{enumerable:!0,get:function(){return lt}});Object.defineProperty(exports,"__toESM",{enumerable:!0,get:function(){return ta}});Object.defineProperty(exports,"alignToBoxPoint",{enumerable:!0,get:function(){return st}});Object.defineProperty(exports,"alignUnitFractions",{enumerable:!0,get:function(){return Aa}});Object.defineProperty(exports,"annotation",{enumerable:!0,get:function(){return il}});Object.defineProperty(exports,"applyOverrides",{enumerable:!0,get:function(){return Vs}});Object.defineProperty(exports,"areDataValuesEqual",{enumerable:!0,get:function(){return Ea}});Object.defineProperty(exports,"areMappingsEquivalent",{enumerable:!0,get:function(){return Ma}});Object.defineProperty(exports,"buildLayerSpec",{enumerable:!0,get:function(){return ue}});Object.defineProperty(exports,"buildPanelAnchorBox",{enumerable:!0,get:function(){return me}});Object.defineProperty(exports,"compositeColor",{enumerable:!0,get:function(){return or}});Object.defineProperty(exports,"continuous",{enumerable:!0,get:function(){return Us}});Object.defineProperty(exports,"createGeomStyleNode",{enumerable:!0,get:function(){return mo}});Object.defineProperty(exports,"createPerKeyMemo",{enumerable:!0,get:function(){return Gr}});Object.defineProperty(exports,"createSingleSlotMemo",{enumerable:!0,get:function(){return ni}});Object.defineProperty(exports,"cursorToPiePlane",{enumerable:!0,get:function(){return pr}});Object.defineProperty(exports,"cursorToPolar",{enumerable:!0,get:function(){return pa}});Object.defineProperty(exports,"datetime",{enumerable:!0,get:function(){return Ys}});Object.defineProperty(exports,"defineGeomStyleTarget",{enumerable:!0,get:function(){return go}});Object.defineProperty(exports,"deriveDeclaredAesthetics",{enumerable:!0,get:function(){return Li}});Object.defineProperty(exports,"deriveGeomRequiredAesthetics",{enumerable:!0,get:function(){return ho}});Object.defineProperty(exports,"discrete",{enumerable:!0,get:function(){return Gs}});Object.defineProperty(exports,"ensureReadableTextColor",{enumerable:!0,get:function(){return na}});Object.defineProperty(exports,"fillIntervalAesthetics",{enumerable:!0,get:function(){return Ri}});Object.defineProperty(exports,"findStyleTarget",{enumerable:!0,get:function(){return po}});Object.defineProperty(exports,"freezeWalkedEntries",{enumerable:!0,get:function(){return fo}});Object.defineProperty(exports,"geom",{enumerable:!0,get:function(){return wi}});Object.defineProperty(exports,"getAestheticFromScaleAestheticKey",{enumerable:!0,get:function(){return li}});Object.defineProperty(exports,"getAlpha",{enumerable:!0,get:function(){return os}});Object.defineProperty(exports,"getAngleExtent",{enumerable:!0,get:function(){return Rn}});Object.defineProperty(exports,"getColor",{enumerable:!0,get:function(){return Dn}});Object.defineProperty(exports,"getGroupVariables",{enumerable:!0,get:function(){return nn}});Object.defineProperty(exports,"getInsetTileRect",{enumerable:!0,get:function(){return In}});Object.defineProperty(exports,"getLineType",{enumerable:!0,get:function(){return us}});Object.defineProperty(exports,"getPaintedTileRect",{enumerable:!0,get:function(){return Nn}});Object.defineProperty(exports,"getRadiusExtent",{enumerable:!0,get:function(){return wn}});Object.defineProperty(exports,"getScaledAesthetic",{enumerable:!0,get:function(){return ba}});Object.defineProperty(exports,"getSize",{enumerable:!0,get:function(){return ss}});Object.defineProperty(exports,"getStableKey",{enumerable:!0,get:function(){return Ne}});Object.defineProperty(exports,"getStackRole",{enumerable:!0,get:function(){return _n}});Object.defineProperty(exports,"getStrokeWidth",{enumerable:!0,get:function(){return ls}});Object.defineProperty(exports,"getTileRectBounds",{enumerable:!0,get:function(){return kn}});Object.defineProperty(exports,"getX",{enumerable:!0,get:function(){return q}});Object.defineProperty(exports,"getXMax",{enumerable:!0,get:function(){return Z}});Object.defineProperty(exports,"getXMin",{enumerable:!0,get:function(){return J}});Object.defineProperty(exports,"getY",{enumerable:!0,get:function(){return z}});Object.defineProperty(exports,"getYMax",{enumerable:!0,get:function(){return K}});Object.defineProperty(exports,"getYMin",{enumerable:!0,get:function(){return H}});Object.defineProperty(exports,"getYRaw",{enumerable:!0,get:function(){return yr}});Object.defineProperty(exports,"hasMultipleGroups",{enumerable:!0,get:function(){return ht}});Object.defineProperty(exports,"identity",{enumerable:!0,get:function(){return zs}});Object.defineProperty(exports,"inferXVariable",{enumerable:!0,get:function(){return Pa}});Object.defineProperty(exports,"inferred",{enumerable:!0,get:function(){return Hs}});Object.defineProperty(exports,"isAngleWithinArc",{enumerable:!0,get:function(){return ur}});Object.defineProperty(exports,"isBorderRadiusToken",{enumerable:!0,get:function(){return an}});Object.defineProperty(exports,"isCategoricalValueFormat",{enumerable:!0,get:function(){return Er}});Object.defineProperty(exports,"isCompilerCachingEnabled",{enumerable:!0,get:function(){return ri}});Object.defineProperty(exports,"isCurrencyValueFormat",{enumerable:!0,get:function(){return La}});Object.defineProperty(exports,"isDateWithoutYearValueFormat",{enumerable:!0,get:function(){return Ra}});Object.defineProperty(exports,"isDefined",{enumerable:!0,get:function(){return V}});Object.defineProperty(exports,"isFullTurnSweep",{enumerable:!0,get:function(){return lr}});Object.defineProperty(exports,"isGradientPaint",{enumerable:!0,get:function(){return yt}});Object.defineProperty(exports,"isImagePaint",{enumerable:!0,get:function(){return ln}});Object.defineProperty(exports,"isInternalVariable",{enumerable:!0,get:function(){return ya}});Object.defineProperty(exports,"isLightDarkColor",{enumerable:!0,get:function(){return xe}});Object.defineProperty(exports,"isLineType",{enumerable:!0,get:function(){return xa}});Object.defineProperty(exports,"isLookupValueFormat",{enumerable:!0,get:function(){return ut}});Object.defineProperty(exports,"isNonEmptyArray",{enumerable:!0,get:function(){return Ta}});Object.defineProperty(exports,"isNumericDataValue",{enumerable:!0,get:function(){return sa}});Object.defineProperty(exports,"isNumericValueFormat",{enumerable:!0,get:function(){return Tr}});Object.defineProperty(exports,"isPatternPaint",{enumerable:!0,get:function(){return mt}});Object.defineProperty(exports,"isPlainObject",{enumerable:!0,get:function(){return Oa}});Object.defineProperty(exports,"isPointWithinPanel",{enumerable:!0,get:function(){return Ve}});Object.defineProperty(exports,"isPositionScale",{enumerable:!0,get:function(){return $r}});Object.defineProperty(exports,"isScaledAestheticKey",{enumerable:!0,get:function(){return oi}});Object.defineProperty(exports,"isStackedPosition",{enumerable:!0,get:function(){return he}});Object.defineProperty(exports,"isStrictCategoricalDataValue",{enumerable:!0,get:function(){return oa}});Object.defineProperty(exports,"isStrictNumericDataValue",{enumerable:!0,get:function(){return S}});Object.defineProperty(exports,"isStrictTemporalDataValue",{enumerable:!0,get:function(){return Ie}});Object.defineProperty(exports,"isStyleTokenRef",{enumerable:!0,get:function(){return bt}});Object.defineProperty(exports,"isTemporalDataValue",{enumerable:!0,get:function(){return ia}});Object.defineProperty(exports,"isTemporalValueFormat",{enumerable:!0,get:function(){return ye}});Object.defineProperty(exports,"isTilePainted",{enumerable:!0,get:function(){return Cn}});Object.defineProperty(exports,"isUsableTokenValue",{enumerable:!0,get:function(){return mn}});Object.defineProperty(exports,"isVisualScale",{enumerable:!0,get:function(){return Xr}});Object.defineProperty(exports,"measureSignedAngularDelta",{enumerable:!0,get:function(){return da}});Object.defineProperty(exports,"normalizeAngle",{enumerable:!0,get:function(){return ie}});Object.defineProperty(exports,"paintKey",{enumerable:!0,get:function(){return ji}});Object.defineProperty(exports,"palette",{enumerable:!0,get:function(){return Ks}});Object.defineProperty(exports,"parseAddressingValue",{enumerable:!0,get:function(){return dt}});Object.defineProperty(exports,"parseDataset",{enumerable:!0,get:function(){return rn}});Object.defineProperty(exports,"pickReadableTextColor",{enumerable:!0,get:function(){return ir}});Object.defineProperty(exports,"polarSectorToInscribedSquare",{enumerable:!0,get:function(){return dr}});Object.defineProperty(exports,"polarToUnit",{enumerable:!0,get:function(){return cr}});Object.defineProperty(exports,"positionToAngle",{enumerable:!0,get:function(){return fa}});Object.defineProperty(exports,"prefixInternalVariable",{enumerable:!0,get:function(){return b}});Object.defineProperty(exports,"readConstantValue",{enumerable:!0,get:function(){return Pe}});Object.defineProperty(exports,"readDataValueKey",{enumerable:!0,get:function(){return br}});Object.defineProperty(exports,"readFoldKeepVariables",{enumerable:!0,get:function(){return Sa}});Object.defineProperty(exports,"readISOInstant",{enumerable:!0,get:function(){return kr}});Object.defineProperty(exports,"readMainAxisVariable",{enumerable:!0,get:function(){return _a}});Object.defineProperty(exports,"readObservationBox",{enumerable:!0,get:function(){return mr}});Object.defineProperty(exports,"readObservationVocabulary",{enumerable:!0,get:function(){return Pn}});Object.defineProperty(exports,"readPlugins",{enumerable:!0,get:function(){return Ts}});Object.defineProperty(exports,"readVariableName",{enumerable:!0,get:function(){return L}});Object.defineProperty(exports,"removeAlpha",{enumerable:!0,get:function(){return aa}});Object.defineProperty(exports,"resolveAnchoredLabelCenter",{enumerable:!0,get:function(){return be}});Object.defineProperty(exports,"resolveBarBandFraction",{enumerable:!0,get:function(){return tt}});Object.defineProperty(exports,"resolveColorScheme",{enumerable:!0,get:function(){return Je}});Object.defineProperty(exports,"resolveDefinition",{enumerable:!0,get:function(){return Vn}});Object.defineProperty(exports,"resolvePaletteConfig",{enumerable:!0,get:function(){return Ws}});Object.defineProperty(exports,"resolvePaletteOverrides",{enumerable:!0,get:function(){return Bs}});Object.defineProperty(exports,"resolvePaletteRange",{enumerable:!0,get:function(){return js}});Object.defineProperty(exports,"resolvePositionScaleAesthetic",{enumerable:!0,get:function(){return si}});Object.defineProperty(exports,"resolveScaledAestheticVariable",{enumerable:!0,get:function(){return gr}});Object.defineProperty(exports,"resolveYScaleAesthetic",{enumerable:!0,get:function(){return qr}});Object.defineProperty(exports,"setCompilerCachingEnabled",{enumerable:!0,get:function(){return ti}});Object.defineProperty(exports,"sumMemoStats",{enumerable:!0,get:function(){return ai}});Object.defineProperty(exports,"toExplicitValueFormat",{enumerable:!0,get:function(){return wa}});Object.defineProperty(exports,"toPaintColor",{enumerable:!0,get:function(){return un}});Object.defineProperty(exports,"token",{enumerable:!0,get:function(){return f}});Object.defineProperty(exports,"unitToPolar",{enumerable:!0,get:function(){return fr}});Object.defineProperty(exports,"walkStyleTargets",{enumerable:!0,get:function(){return co}});Object.defineProperty(exports,"withAlpha",{enumerable:!0,get:function(){return sr}});Object.defineProperty(exports,"wrappedAngularDistance",{enumerable:!0,get:function(){return nt}});