import{truthy as k,error as h,hasOwnProperty as y,extend as $,isArray as p,field as ne,isString as b,isFunction as U,peek as R,isBoolean as re,isDate as ie,isNumber as oe,isObject as T,isRegExp as ae,toBoolean as se,toDate as ce,toNumber as ue,toString as fe,flush as le,lerp as de,pad as me,span as pe,inrange as ge,truncate as he,quarter as ve,utcquarter as xe,extent as we,clampRange as ye,panLinear as be,panLog as Se,panPow as Ne,panSymlog as Ee,zoomLinear as Pe,zoomLog as Ae,zoomPow as ze,zoomSymlog as Fe,stringValue as S,identity as Me,array as N}from"/-/vega-util@v1.17.2-LUfkDhormMyfWqy3Ts6U/dist=es2020,mode=imports,min/optimized/vega-util.js";import{Literal as v,constants as je,codegenExpression as $e,functions as Re,parseExpression as Te,CallExpression as De}from"/-/vega-expression@v5.1.1-K4clrYr2THuj5KncykTn/dist=es2020,mode=imports,min/optimized/vega-expression.js";import{bandSpace as Ie,scale as H,scaleFraction as qe,isRegisteredScale as Ge}from"/-/vega-scale@v7.4.1-M0T9Gn9zHGGuV6XhZsTO/dist=es2020,mode=imports,min/optimized/vega-scale.js";import{geoBounds as Le,geoCentroid as Be,geoArea as Ve}from"/-/d3-geo@v3.1.1-IFH102ROpDQE4rIMzW42/dist=es2020,mode=imports,min/optimized/d3-geo.js";import{rgb as Q,lab as Oe,hcl as Ye,hsl as Ce}from"/-/d3-color@v3.1.0-MWHDMwd2Pvp3NFjvrHgn/dist=es2020,mode=imports,min/optimized/d3-color.js";import{isTuple as W}from"/-/vega-dataflow@v5.7.6-WDoszrJUyhTwz7sPwzda/dist=es2020,mode=imports,min/optimized/vega-dataflow.js";import{Gradient as Xe,pathRender as ke,pathParse as Ue,Bounds as Z,intersect as He}from"/-/vega-scenegraph@v4.13.0-kC2RziuM0eIjiq6SsQ1g/dist=es2020,mode=imports,min/optimized/vega-scenegraph.js";import{selectionVisitor as D,selectionTest as Qe,selectionIdTest as We,selectionResolve as Ze,selectionTuples as Ke}from"/-/vega-selections@v5.4.2-kOpqaoZxiZQE5rKxTnvY/dist=es2020,mode=imports,min/optimized/vega-selections.js";import{random as Je,cumulativeNormal as _e,cumulativeLogNormal as tn,cumulativeUniform as en,densityNormal as nn,densityLogNormal as rn,densityUniform as on,quantileNormal as an,quantileLogNormal as sn,quantileUniform as cn,sampleNormal as un,sampleLogNormal as fn,sampleUniform as ln}from"/-/vega-statistics@v1.9.0-Qw8CjSQVQOg2M6VMgsme/dist=es2020,mode=imports,min/optimized/vega-statistics.js";import{utcOffset as dn,utcSequence as mn,timeOffset as pn,timeSequence as gn,timeUnitSpecifier as hn,week as vn,utcweek as xn,dayofyear as wn,utcdayofyear as yn}from"/-/vega-time@v2.1.2-0zBPNlF5GMoxR6YChBaP/dist=es2020,mode=imports,min/optimized/vega-time.js";import{range as bn}from"/-/d3-array@v3.2.4-G4hy00bPnjF6FrSYpT32/dist=es2020,mode=imports,min/optimized/d3-array.js";function I(t){const e=this.context.data[t];return e?e.values.value:[]}function K(t,e,n){const r=this.context.data[t]["index:"+e],i=r?r.value.get(n):void 0;return i&&i.count}function J(t,e){const n=this.context.dataflow,r=this.context.data[t],i=r.input;return n.pulse(i,n.changeset().remove(k).insert(e)),1}function _(t,e,n){if(t){const r=this.context.dataflow,i=t.mark.source;r.pulse(i,r.changeset().encode(t,e))}return n!==void 0?n:t}const x=t=>function(e,n){const r=this.context.dataflow.locale();return e===null?"null":r[t](n)(e)},tt=x("format"),q=x("timeFormat"),et=x("utcFormat"),nt=x("timeParse"),rt=x("utcParse"),E=new Date(2e3,0,1);function P(t,e,n){return!Number.isInteger(t)||!Number.isInteger(e)?"":(E.setYear(2e3),E.setMonth(t),E.setDate(e),q.call(this,E,n))}function it(t){return P.call(this,t,1,"%B")}function ot(t){return P.call(this,t,1,"%b")}function at(t){return P.call(this,0,2+t,"%A")}function st(t){return P.call(this,0,2+t,"%a")}const ct=":",ut="@",A="%",G="$";function z(t,e,n,r){e[0].type!==v&&h("First argument to data functions must be a string literal.");const i=e[0].value,o=ct+i;if(!y(o,r))try{r[o]=n.getData(i).tuplesRef()}catch(a){}}function ft(t,e,n,r){e[0].type!==v&&h("First argument to indata must be a string literal."),e[1].type!==v&&h("Second argument to indata must be a string literal.");const i=e[0].value,o=e[1].value,a=ut+o;y(a,r)||(r[a]=n.getData(i).indataRef(n,o))}function f(t,e,n,r){if(e[0].type===v)lt(n,r,e[0].value);else for(t in n.scales)lt(n,r,t)}function lt(t,e,n){const r=A+n;if(!y(e,r))try{e[r]=t.scaleRef(n)}catch(i){}}function m(t,e){if(U(t))return t;if(b(t)){const n=e.scales[t];return n&&Ge(n.value)?n.value:void 0}return}function Sn(t,e,n){e.__bandwidth=i=>i&&i.bandwidth?i.bandwidth():0,n._bandwidth=f,n._range=f,n._scale=f;const r=i=>"_["+(i.type===v?S(A+i.value):S(A)+"+"+t(i))+"]";return{_bandwidth:i=>`this.__bandwidth(${r(i[0])})`,_range:i=>`${r(i[0])}.range()`,_scale:i=>`${r(i[0])}(${t(i[1])})`}}function L(t,e){return function(n,r,i){if(n){const o=m(n,(i||this).context);return o&&o.path[t](r)}else return e(r)}}const dt=L("area",Ve),mt=L("bounds",Le),pt=L("centroid",Be);function gt(t,e){const n=m(t,(e||this).context);return n&&n.scale()}function ht(t){const e=this.context.group;let n=!1;if(e)for(;t;){if(t===e){n=!0;break}t=t.mark.group}return n}function B(t,e,n){try{t[e].apply(t,["EXPRESSION"].concat([].slice.call(n)))}catch(r){t.warn(r)}return n[n.length-1]}function vt(){return B(this.context.dataflow,"warn",arguments)}function xt(){return B(this.context.dataflow,"info",arguments)}function wt(){return B(this.context.dataflow,"debug",arguments)}function V(t){const e=t/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}function F(t){const e=Q(t),n=V(e.r),r=V(e.g),i=V(e.b);return .2126*n+.7152*r+.0722*i}function yt(t,e){const n=F(t),r=F(e),i=Math.max(n,r),o=Math.min(n,r);return(i+.05)/(o+.05)}function bt(){const t=[].slice.call(arguments);return t.unshift({}),$(...t)}function St(t,e){return t===e||t!==t&&e!==e?!0:p(t)?p(e)&&t.length===e.length?Nn(t,e):!1:T(t)&&T(e)?Nt(t,e):!1}function Nn(t,e){for(let n=0,r=t.length;nNt(t,e)}function Pt(t,e,n,r,i,o){const a=this.context.dataflow,u=this.context.data[t],c=u.input,l=a.stamp();let d=u.changes,g,j;if(a._trigger===!1||!(c.value.length||e||r))return 0;if((!d||d.stamp{u.modified=!0,a.pulse(c,d).run()},!0,1)),n&&(g=n===!0?k:p(n)||W(n)?n:Et(n),d.remove(g)),e&&d.insert(e),r&&(g=Et(r),c.value.some(g)?d.remove(g):d.insert(r)),i)for(j in o)d.modify(i,j,o[j]);return 1}function At(t){const e=t.touches,n=e[0].clientX-e[1].clientX,r=e[0].clientY-e[1].clientY;return Math.hypot(n,r)}function zt(t){const e=t.touches;return Math.atan2(e[0].clientY-e[1].clientY,e[0].clientX-e[1].clientX)}const Ft={};function Mt(t,e){const n=Ft[e]||(Ft[e]=ne(e));return p(t)?t.map(n):n(t)}function O(t){return p(t)||ArrayBuffer.isView(t)?t:null}function Y(t){return O(t)||(b(t)?t:null)}function jt(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r1?e-1:0),r=1;r1?e-1:0),r=1;r1?e-1:0),r=1;ro.stop(l(d),t(d))),o}function Xt(t,e,n){const r=m(t,(n||this).context);return function(i){return r?r.path.context(i)(e):""}}function kt(t){let e=null;return function(n){return n?ke(n,e=e||Ue(t)):t}}const Ut=t=>t.data;function Ht(t,e){const n=I.call(e,t);return n.root&&n.root.lookup||{}}function Qt(t,e,n){const r=Ht(t,this),i=r[e],o=r[n];return i&&o?i.path(o).map(Ut):void 0}function Wt(t,e){const n=Ht(t,this)[e];return n?n.ancestors().map(Ut):void 0}const Zt=()=>typeof window!="undefined"&&window||null;function Kt(){const t=Zt();return t?t.screen:{}}function Jt(){const t=Zt();return t?[t.innerWidth,t.innerHeight]:[void 0,void 0]}function _t(){const t=this.context.dataflow,e=t.container&&t.container();return e?[e.clientWidth,e.clientHeight]:[void 0,void 0]}function te(t,e,n){if(!t)return[];const[r,i]=t,o=new Z().set(r[0],r[1],i[0],i[1]),a=n||this.context.dataflow.scenegraph().root;return He(a,o,En(e))}function En(t){let e=null;if(t){const n=N(t.marktype),r=N(t.markname);e=i=>(!n.length||n.some(o=>i.marktype===o))&&(!r.length||r.some(o=>i.name===o))}return e}function Pn(t,e,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:5;t=N(t);const i=t[t.length-1];return i===void 0||Math.hypot(i[0]-e,i[1]-n)>r?[...t,[e,n]]:t}function An(t){return N(t).reduce((e,n,r)=>{let[i,o]=n;return e+=r==0?`M ${i},${o} `:r===t.length-1?" Z":`L ${i},${o} `},"")}function zn(t,e,n){const{x:r,y:i,mark:o}=n,a=new Z().set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[c,l]of e)ca.x2&&(a.x2=c),la.y2&&(a.y2=l);a.translate(r,i);const u=te([[a.x1,a.y1],[a.x2,a.y2]],t,o);return u.filter(c=>Fn(c.x,c.y,e))}function Fn(t,e,n){let r=0;for(let i=0,o=n.length-1;ie!=u>e&&t<(a-c)*(e-l)/(u-l)+c&&r++}return r&1}const w={random(){return Je()},cumulativeNormal:_e,cumulativeLogNormal:tn,cumulativeUniform:en,densityNormal:nn,densityLogNormal:rn,densityUniform:on,quantileNormal:an,quantileLogNormal:sn,quantileUniform:cn,sampleNormal:un,sampleLogNormal:fn,sampleUniform:ln,isArray:p,isBoolean:re,isDate:ie,isDefined(t){return t!==void 0},isNumber:oe,isObject:T,isRegExp:ae,isString:b,isTuple:W,isValid(t){return t!=null&&t===t},toBoolean:se,toDate(t){return ce(t)},toNumber:ue,toString:fe,indexof:$t,join:jt,lastindexof:Rt,replace:Dt,reverse:It,slice:Tt,flush:le,lerp:de,merge:bt,pad:me,peek:R,pluck:Mt,span:pe,inrange:ge,truncate:he,rgb:Q,lab:Oe,hcl:Ye,hsl:Ce,luminance:F,contrast:yt,sequence:bn,format:tt,utcFormat:et,utcParse:rt,utcOffset:dn,utcSequence:mn,timeFormat:q,timeParse:nt,timeOffset:pn,timeSequence:gn,timeUnitSpecifier:hn,monthFormat:it,monthAbbrevFormat:ot,dayFormat:at,dayAbbrevFormat:st,quarter:ve,utcquarter:xe,week:vn,utcweek:xn,dayofyear:wn,utcdayofyear:yn,warn:vt,info:xt,debug:wt,extent(t){return we(t)},inScope:ht,intersect:te,clampRange:ye,pinchDistance:At,pinchAngle:zt,screen:Kt,containerSize:_t,windowSize:Jt,bandspace:qt,setdata:J,pathShape:kt,panLinear:be,panLog:Se,panPow:Ne,panSymlog:Ee,zoomLinear:Pe,zoomLog:Ae,zoomPow:ze,zoomSymlog:Fe,encode:_,modify:Pt,lassoAppend:Pn,lassoPath:An,intersectLasso:zn},Mn=["view","item","group","xy","x","y"],jn="event.vega.",ee="this.",C={},X={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:t=>`_[${S(G+t)}]`,functions:$n,constants:je,visitors:C},M=$e(X);function $n(t){const e=Re(t);Mn.forEach(n=>e[n]=jn+n);for(const n in w)e[n]=ee+n;return $(e,Sn(t,w,C)),e}function s(t,e,n){return arguments.length===1?w[t]:(w[t]=e,n&&(C[t]=n),M&&(M.functions[t]=ee+t),this)}s("bandwidth",Gt,f),s("copy",Lt,f),s("domain",Bt,f),s("range",Ot,f),s("invert",Vt,f),s("scale",Yt,f),s("gradient",Ct,f),s("geoArea",dt,f),s("geoBounds",mt,f),s("geoCentroid",pt,f),s("geoShape",Xt,f),s("geoScale",gt,f),s("indata",K,ft),s("data",I,z),s("treePath",Qt,z),s("treeAncestors",Wt,z),s("vlSelectionTest",Qe,D),s("vlSelectionIdTest",We,D),s("vlSelectionResolve",Ze,D),s("vlSelectionTuples",Ke);function Rn(t,e){const n={};let r;try{t=b(t)?t:S(t)+"",r=Te(t)}catch(o){h("Expression parse error: "+t)}r.visit(o=>{if(o.type!==De)return;const a=o.callee.name,u=X.visitors[a];u&&u(a,o.arguments,e,n)});const i=M(r);return i.globals.forEach(o=>{const a=G+o;!y(n,a)&&e.getSignal(o)&&(n[a]=e.signalRef(o))}),{$expr:$({code:i.code},e.options.ast?{ast:r}:null),$fields:i.fields,$params:n}}export{ct as DataPrefix,ut as IndexPrefix,A as ScalePrefix,G as SignalPrefix,qt as bandspace,Gt as bandwidth,M as codeGenerator,X as codegenParams,_t as containerSize,yt as contrast,Lt as copy,I as data,z as dataVisitor,st as dayAbbrevFormat,at as dayFormat,wt as debug,Bt as domain,_ as encode,s as expressionFunction,tt as format,w as functionContext,dt as geoArea,mt as geoBounds,pt as geoCentroid,gt as geoScale,Xt as geoShape,ht as inScope,K as indata,ft as indataVisitor,$t as indexof,xt as info,Vt as invert,jt as join,Rt as lastindexof,F as luminance,bt as merge,Pt as modify,ot as monthAbbrevFormat,it as monthFormat,Rn as parseExpression,kt as pathShape,zt as pinchAngle,At as pinchDistance,Mt as pluck,Ot as range,Dt as replace,It as reverse,Yt as scale,Ct as scaleGradient,f as scaleVisitor,Kt as screen,J as setdata,Tt as slice,q as timeFormat,nt as timeParse,Wt as treeAncestors,Qt as treePath,et as utcFormat,rt as utcParse,vt as warn,Jt as windowSize};export default null;