/*! For license information please see 3.c092a0a076b0b4af78d2.js.LICENSE.txt */ (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[3],{"/ZBw":function(e,t,n){const i=n("u/28");const r=n("P86V");const o=(e,t,n)=>{let o=null;let s=null;let a=null;try{a=new r(t,n)}catch(u){return null}e.forEach(e=>{if(a.test(e)){if(!o||s.compare(e)===1){o=e;s=new i(o,n)}}});return o};e.exports=o},"0u8k":function(e,t,n){const i=n("ojZj");const r=(e,t)=>{const n=i(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null};e.exports=r},"8WEG":function(e){e.exports=JSON.parse('{"a":"5.15.0"}')},"8ZXz":function(e,t,n){const i=n("MDTW");const r=(e,t,n)=>i(e,t,n)!==0;e.exports=r},"9nwm":function(e,t,n){const i=n("KoYs");const r=n("MDTW");e.exports=(e,t,n)=>{const o=[];let s=null;let a=null;const u=e.sort((e,t)=>r(e,t,n));for(const r of u){const e=i(r,t,n);if(e){a=r;if(!s)s=r}else{if(a){o.push([s,a])}a=null;s=null}}if(s)o.push([s,null]);const c=[];for(const[i,r]of o){if(i===r)c.push(i);else if(!r&&i===u[0])c.push("*");else if(!r)c.push(`>=${i}`);else if(i===u[0])c.push(`<=${r}`);else c.push(`${i} - ${r}`)}const l=c.join(" || ");const f=typeof t.raw==="string"?t.raw:String(t);return l.length{if(typeof n==="string"){r=n;n=undefined}try{return new i(e,n).inc(t,r).version}catch(o){return null}};e.exports=r},CYKG:function(e,t,n){const i=n("P86V");const r=(e,t)=>{try{return new i(e,t).range||"*"}catch(n){return null}};e.exports=r},Cmeg:function(e,t,n){const i=n("u/28");const r=n("ojZj");const{re:o,t:s}=n("jLUY");const a=(e,t)=>{if(e instanceof i){return e}if(typeof e==="number"){e=String(e)}if(typeof e!=="string"){return null}t=t||{};let n=null;if(!t.rtl){n=e.match(o[s.COERCE])}else{let t;while((t=o[s.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length)){if(!n||t.index+t[0].length!==n.index+n[0].length){n=t}o[s.COERCERTL].lastIndex=t.index+t[1].length+t[2].length}o[s.COERCERTL].lastIndex=-1}if(n===null)return null;return r(`${n[2]}.${n[3]||"0"}.${n[4]||"0"}`,t)};e.exports=a},"E6/z":function(e,t,n){const i=n("u/28");const r=n("P86V");const o=(e,t,n)=>{let o=null;let s=null;let a=null;try{a=new r(t,n)}catch(u){return null}e.forEach(e=>{if(a.test(e)){if(!o||s.compare(e)===-1){o=e;s=new i(o,n)}}});return o};e.exports=o},HMYi:function(e,t,n){const i=n("u/28");const r=(e,t,n)=>{const r=new i(e,n);const o=new i(t,n);return r.compare(o)||r.compareBuild(o)};e.exports=r},J29t:function(e,t,n){"use strict";n.d(t,"f",(function(){return i}));n.d(t,"h",(function(){return r}));n.d(t,"g",(function(){return o}));n.d(t,"x",(function(){return d}));n.d(t,"y",(function(){return h}));n.d(t,"lb",(function(){return p}));n.d(t,"P",(function(){return g}));n.d(t,"hb",(function(){return m}));n.d(t,"s",(function(){return b}));n.d(t,"L",(function(){return j}));n.d(t,"d",(function(){return y}));n.d(t,"b",(function(){return x}));n.d(t,"e",(function(){return _}));n.d(t,"c",(function(){return w}));n.d(t,"a",(function(){return O}));n.d(t,"O",(function(){return D}));n.d(t,"kb",(function(){return S}));n.d(t,"R",(function(){return P}));n.d(t,"S",(function(){return I}));n.d(t,"T",(function(){return L}));n.d(t,"U",(function(){return U}));n.d(t,"mb",(function(){return W}));n.d(t,"nb",(function(){return G}));n.d(t,"ob",(function(){return H}));n.d(t,"pb",(function(){return V}));n.d(t,"W",(function(){return Y}));n.d(t,"ib",(function(){return X}));n.d(t,"i",(function(){return J}));n.d(t,"k",(function(){return Z}));n.d(t,"l",(function(){return ee}));n.d(t,"j",(function(){return te}));n.d(t,"m",(function(){return oe}));n.d(t,"n",(function(){return se}));n.d(t,"o",(function(){return c}));n.d(t,"p",(function(){return ae}));n.d(t,"q",(function(){return ue}));n.d(t,"r",(function(){return ce}));n.d(t,"t",(function(){return he}));n.d(t,"u",(function(){return f}));n.d(t,"v",(function(){return pe}));n.d(t,"w",(function(){return fe}));n.d(t,"z",(function(){return ge}));n.d(t,"A",(function(){return me}));n.d(t,"B",(function(){return k}));n.d(t,"C",(function(){return be}));n.d(t,"D",(function(){return ve}));n.d(t,"E",(function(){return Q}));n.d(t,"F",(function(){return ye}));n.d(t,"G",(function(){return E}));n.d(t,"H",(function(){return xe}));n.d(t,"I",(function(){return _e}));n.d(t,"J",(function(){return we}));n.d(t,"K",(function(){return Oe}));n.d(t,"M",(function(){return ke}));n.d(t,"N",(function(){return Ee}));n.d(t,"Q",(function(){return De}));n.d(t,"V",(function(){return C}));n.d(t,"X",(function(){return Ae}));n.d(t,"Y",(function(){return Se}));n.d(t,"Z",(function(){return l}));n.d(t,"ab",(function(){return Me}));n.d(t,"bb",(function(){return Ce}));n.d(t,"cb",(function(){return Fe}));n.d(t,"db",(function(){return $}));n.d(t,"fb",(function(){return Ne}));n.d(t,"eb",(function(){return Te}));n.d(t,"gb",(function(){return ze}));n.d(t,"jb",(function(){return Re}));var i=function(e,t,n){e.fields=t||[];e.fname=n;return e};function r(e){return e==null?null:e.fname}function o(e){return e==null?null:e.fields}var s=function(e){return e.length===1?a(e[0]):u(e)};const a=e=>function(t){return t[e]};const u=e=>{const t=e.length;return function(n){for(let i=0;is){l()}else{s=a+1}}else if(u==="["){if(a>s)l();r=s=a+1}else if(u==="]"){if(!r)c("Access path missing open bracket: "+e);if(r>0)l();r=0;s=a+1}}if(r)c("Access path missing closing bracket: "+e);if(i)c("Access path missing closing quote: "+e);if(a>s){a++;l()}return t};var f=function(e,t,n){const r=l(e);e=r.length===1?r[0]:e;return i((n&&n.get||s)(r),[e],t||e)};const d=f("id");const h=i(e=>e,[],"identity");const p=i(()=>0,[],"zero");const g=i(()=>1,[],"one");const m=i(()=>true,[],"true");const b=i(()=>false,[],"false");function v(e,t,n){const i=[t].concat([].slice.call(n));console[e].apply(console,i)}const y=0;const x=1;const _=2;const w=3;const O=4;var j=function(e,t){let n=e||y;return{level(e){if(arguments.length){n=+e;return this}else{return n}},error(){if(n>=x)v(t||"error","ERROR",arguments);return this},warn(){if(n>=_)v(t||"warn","WARN",arguments);return this},info(){if(n>=w)v(t||"log","INFO",arguments);return this},debug(){if(n>=O)v(t||"log","DEBUG",arguments);return this}}};var k=Array.isArray;var E=function(e){return e===Object(e)};const A=e=>e!=="__proto__";function D(...e){return e.reduce((e,t)=>{for(const n in t){if(n==="signals"){e.signals=M(e.signals,t.signals)}else{const i=n==="legend"?{layout:1}:n==="style"?true:null;S(e,n,t[n],i)}}return e},{})}function S(e,t,n,i){if(!A(t))return;let r,o;if(E(n)&&!k(n)){o=E(e[t])?e[t]:e[t]={};for(r in n){if(i&&(i===true||i[r])){S(o,r,n[r])}else if(A(r)){o[r]=n[r]}}}else{e[t]=n}}function M(e,t){if(e==null)return t;const n={},i=[];function r(e){if(!n[e.name]){n[e.name]=1;i.push(e)}}t.forEach(r);e.forEach(r);return i}var C=function(e){return e[e.length-1]};var $=function(e){return e==null||e===""?null:+e};const F=e=>t=>e*Math.exp(t);const N=e=>t=>Math.log(e*t);const T=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e));const z=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e;const R=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function B(e,t,n,i){const r=n(e[0]),o=n(C(e)),s=(o-r)*t;return[i(r-s),i(o-s)]}function P(e,t){return B(e,t,$,h)}function I(e,t){var n=Math.sign(e[0]);return B(e,t,N(n),F(n))}function L(e,t,n){return B(e,t,R(n),R(1/n))}function U(e,t,n){return B(e,t,T(n),z(n))}function q(e,t,n,i,r){const o=i(e[0]),s=i(C(e)),a=t!=null?i(t):(o+s)/2;return[r(a+(o-a)*n),r(a+(s-a)*n)]}function W(e,t,n){return q(e,t,n,$,h)}function G(e,t,n){const i=Math.sign(e[0]);return q(e,t,n,N(i),F(i))}function H(e,t,n,i){return q(e,t,n,R(i),R(1/i))}function V(e,t,n,i){return q(e,t,n,T(i),z(i))}function Y(e){return 1+~~(new Date(e).getMonth()/3)}function X(e){return 1+~~(new Date(e).getUTCMonth()/3)}var J=function(e){return e!=null?k(e)?e:[e]:[]};var Z=function(e,t,n){let i=e[0],r=e[1],o;if(r=n-t?[t,n]:[i=Math.min(Math.max(i,t),n-o),i+o]};var Q=function(e){return typeof e==="function"};const K="descending";var ee=function(e,t,n){n=n||{};t=J(t)||[];const r=[],s=[],a={},u=n.comparator||ne;J(e).forEach((e,i)=>{if(e==null)return;r.push(t[i]===K?-1:1);s.push(e=Q(e)?e:f(e,null,n));(o(e)||[]).forEach(e=>a[e]=1)});return s.length===0?null:i(u(s,r),Object.keys(a))};const te=(e,t)=>(et||t==null)&&e!=null?1:(t=t instanceof Date?+t:t,e=e instanceof Date?+e:e)!==e&&t===t?-1:t!==t&&e===e?1:0;const ne=(e,t)=>e.length===1?ie(e[0],t[0]):re(e,t,e.length);const ie=(e,t)=>function(n,i){return te(e(n),e(i))*t};const re=(e,t,n)=>{t.push(0);return function(i,r){let o,s=0,a=-1;while(s===0&&++ae};var se=function(e,t){let n;return i=>{if(n)clearTimeout(n);n=setTimeout(()=>(t(i),n=null),e)}};var ae=function(e){for(let t,n,i=1,r=arguments.length;is)s=r}}}else{for(r=t(e[n]);ns)s=r}}}}return[o,s]};var ce=function(e,t){const n=e.length;let i=-1,r,o,s,a,u;if(t==null){while(++i=o){r=s=o;break}}if(i===n)return[-1,-1];a=u=i;while(++io){r=o;a=i}if(s=o){r=s=o;break}}if(i===n)return[-1,-1];a=u=i;while(++io){r=o;a=i}if(s{r.set(t,e[t])});return r};var pe=function(e,t,n,i,r,o){if(!n&&n!==0)return o;const s=+n;let a=e[0],u=C(e),c;if(uo){s=r;r=o;o=s}n=n===undefined||n;i=i===undefined||i;return(n?r<=e:re.replace(/\\(.)/g,"$1")):J(e)}const r=e&&e.length,o=n&&n.get||s,a=e=>o(t?[e]:l(e));let u;if(!r){u=function(){return""}}else if(r===1){const t=a(e[0]);u=function(e){return""+t(e)}}else{const t=e.map(a);u=function(e){let n=""+t[0](e),i=0;while(++i{t={};n={};i=0};const o=(r,o)=>{if(++i>e){n=t;t={};i=1}return t[r]=o};r();return{clear:r,has:e=>fe(t,e)||fe(n,e),get:e=>fe(t,e)?t[e]:fe(n,e)?o(e,n[e]):undefined,set:(e,n)=>fe(t,e)?t[e]=n:o(e,n)}};var Ee=function(e,t,n,i){const r=t.length,o=n.length;if(!o)return t;if(!r)return n;const s=i||new t.constructor(r+o);let a=0,u=0,c=0;for(;a0?n[u++]:t[a++]}for(;a=0)n+=e;return n};var De=function(e,t,n,i){const r=n||" ",o=e+"",s=t-o.length;return s<=0?o:i==="left"?Ae(r,s)+o:i==="center"?Ae(r,~~(s/2))+o+Ae(r,Math.ceil(s/2)):o+Ae(r,s)};var Se=function(e){return e&&C(e)-e[0]||0};function Me(e){return k(e)?"["+e.map(Me)+"]":E(e)||_e(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}var Ce=function(e){return e==null||e===""?null:!e||e==="false"||e==="0"?false:!!e};const $e=e=>ye(e)?e:ve(e)?e:Date.parse(e);var Fe=function(e,t){t=t||$e;return e==null||e===""?null:t(e)};var Ne=function(e){return e==null||e===""?null:e+""};var Te=function(e){const t={},n=e.length;for(let i=0;ie.sort((e,n)=>i(e,n,t));e.exports=r},KoYs:function(e,t,n){const i=n("P86V");const r=(e,t,n)=>{try{t=new i(t,n)}catch(r){return false}return t.test(e)};e.exports=r},LN8h:function(e,t){const n=/^[0-9]+$/;const i=(e,t)=>{const i=n.test(e);const r=n.test(t);if(i&&r){e=+e;t=+t}return e===t?0:i&&!r?-1:r&&!i?1:ei(t,e);e.exports={compareIdentifiers:i,rcompareIdentifiers:r}},MDTW:function(e,t,n){const i=n("u/28");const r=(e,t,n)=>new i(e,n).compare(new i(t,n));e.exports=r},OMvs:function(e,t,n){const i=n("u/28");const r=n("bUMA");const{ANY:o}=r;const s=n("P86V");const a=n("KoYs");const u=n("usTL");const c=n("OPpX");const l=n("aNM5");const f=n("oqMh");const d=(e,t,n,d)=>{e=new i(e,d);t=new s(t,d);let h,p,g,m,b;switch(n){case">":h=u;p=l;g=c;m=">";b=">=";break;case"<":h=c;p=f;g=u;m="<";b="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(a(e,t,d)){return false}for(let i=0;i{if(e.semver===o){e=new r(">=0.0.0")}s=s||e;a=a||e;if(h(e.semver,s.semver,d)){s=e}else if(g(e.semver,a.semver,d)){a=e}});if(s.operator===m||s.operator===b){return false}if((!a.operator||a.operator===m)&&p(e,a.semver)){return false}else if(a.operator===b&&g(e,a.semver)){return false}}return true};e.exports=d},OPpX:function(e,t,n){const i=n("MDTW");const r=(e,t,n)=>i(e,t,n)<0;e.exports=r},P86V:function(e,t,n){class i{constructor(e,t){if(!t||typeof t!=="object"){t={loose:!!t,includePrerelease:false}}if(e instanceof i){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease){return e}else{return new i(e.raw,t)}}if(e instanceof r){this.raw=e.value;this.set=[[e]];this.format();return this}this.options=t;this.loose=!!t.loose;this.includePrerelease=!!t.includePrerelease;this.raw=e;this.set=e.split(/\s*\|\|\s*/).map(e=>this.parseRange(e.trim())).filter(e=>e.length);if(!this.set.length){throw new TypeError(`Invalid SemVer Range: ${e}`)}this.format()}format(){this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim();return this.range}toString(){return this.range}parseRange(e){const t=this.options.loose;e=e.trim();const n=t?a[u.HYPHENRANGELOOSE]:a[u.HYPHENRANGE];e=e.replace(n,O(this.options.includePrerelease));o("hyphen replace",e);e=e.replace(a[u.COMPARATORTRIM],c);o("comparator trim",e,a[u.COMPARATORTRIM]);e=e.replace(a[u.TILDETRIM],l);e=e.replace(a[u.CARETTRIM],f);e=e.split(/\s+/).join(" ");const i=t?a[u.COMPARATORLOOSE]:a[u.COMPARATOR];return e.split(" ").map(e=>h(e,this.options)).join(" ").split(/\s+/).map(e=>w(e,this.options)).filter(this.options.loose?e=>!!e.match(i):()=>true).map(e=>new r(e,this.options))}intersects(e,t){if(!(e instanceof i)){throw new TypeError("a Range is required")}return this.set.some(n=>d(n,t)&&e.set.some(e=>d(e,t)&&n.every(n=>e.every(e=>n.intersects(e,t)))))}test(e){if(!e){return false}if(typeof e==="string"){try{e=new s(e,this.options)}catch(t){return false}}for(let n=0;n{let n=true;const i=e.slice();let r=i.pop();while(n&&i.length){n=i.every(e=>r.intersects(e,t));r=i.pop()}return n};const h=(e,t)=>{o("comp",e,t);e=b(e,t);o("caret",e);e=g(e,t);o("tildes",e);e=y(e,t);o("xrange",e);e=_(e,t);o("stars",e);return e};const p=e=>!e||e.toLowerCase()==="x"||e==="*";const g=(e,t)=>e.trim().split(/\s+/).map(e=>m(e,t)).join(" ");const m=(e,t)=>{const n=t.loose?a[u.TILDELOOSE]:a[u.TILDE];return e.replace(n,(t,n,i,r,s)=>{o("tilde",e,t,n,i,r,s);let a;if(p(n)){a=""}else if(p(i)){a=`>=${n}.0.0 <${+n+1}.0.0-0`}else if(p(r)){a=`>=${n}.${i}.0 <${n}.${+i+1}.0-0`}else if(s){o("replaceTilde pr",s);a=`>=${n}.${i}.${r}-${s} <${n}.${+i+1}.0-0`}else{a=`>=${n}.${i}.${r} <${n}.${+i+1}.0-0`}o("tilde return",a);return a})};const b=(e,t)=>e.trim().split(/\s+/).map(e=>v(e,t)).join(" ");const v=(e,t)=>{o("caret",e,t);const n=t.loose?a[u.CARETLOOSE]:a[u.CARET];const i=t.includePrerelease?"-0":"";return e.replace(n,(t,n,r,s,a)=>{o("caret",e,t,n,r,s,a);let u;if(p(n)){u=""}else if(p(r)){u=`>=${n}.0.0${i} <${+n+1}.0.0-0`}else if(p(s)){if(n==="0"){u=`>=${n}.${r}.0${i} <${n}.${+r+1}.0-0`}else{u=`>=${n}.${r}.0${i} <${+n+1}.0.0-0`}}else if(a){o("replaceCaret pr",a);if(n==="0"){if(r==="0"){u=`>=${n}.${r}.${s}-${a} <${n}.${r}.${+s+1}-0`}else{u=`>=${n}.${r}.${s}-${a} <${n}.${+r+1}.0-0`}}else{u=`>=${n}.${r}.${s}-${a} <${+n+1}.0.0-0`}}else{o("no pr");if(n==="0"){if(r==="0"){u=`>=${n}.${r}.${s}${i} <${n}.${r}.${+s+1}-0`}else{u=`>=${n}.${r}.${s}${i} <${n}.${+r+1}.0-0`}}else{u=`>=${n}.${r}.${s} <${+n+1}.0.0-0`}}o("caret return",u);return u})};const y=(e,t)=>{o("replaceXRanges",e,t);return e.split(/\s+/).map(e=>x(e,t)).join(" ")};const x=(e,t)=>{e=e.trim();const n=t.loose?a[u.XRANGELOOSE]:a[u.XRANGE];return e.replace(n,(n,i,r,s,a,u)=>{o("xRange",e,n,i,r,s,a,u);const c=p(r);const l=c||p(s);const f=l||p(a);const d=f;if(i==="="&&d){i=""}u=t.includePrerelease?"-0":"";if(c){if(i===">"||i==="<"){n="<0.0.0-0"}else{n="*"}}else if(i&&d){if(l){s=0}a=0;if(i===">"){i=">=";if(l){r=+r+1;s=0;a=0}else{s=+s+1;a=0}}else if(i==="<="){i="<";if(l){r=+r+1}else{s=+s+1}}if(i==="<")u="-0";n=`${i+r}.${s}.${a}${u}`}else if(l){n=`>=${r}.0.0${u} <${+r+1}.0.0-0`}else if(f){n=`>=${r}.${s}.0${u} <${r}.${+s+1}.0-0`}o("xRange return",n);return n})};const _=(e,t)=>{o("replaceStars",e,t);return e.trim().replace(a[u.STAR],"")};const w=(e,t)=>{o("replaceGTE0",e,t);return e.trim().replace(a[t.includePrerelease?u.GTE0PRE:u.GTE0],"")};const O=e=>(t,n,i,r,o,s,a,u,c,l,f,d,h)=>{if(p(i)){n=""}else if(p(r)){n=`>=${i}.0.0${e?"-0":""}`}else if(p(o)){n=`>=${i}.${r}.0${e?"-0":""}`}else if(s){n=`>=${n}`}else{n=`>=${n}${e?"-0":""}`}if(p(c)){u=""}else if(p(l)){u=`<${+c+1}.0.0-0`}else if(p(f)){u=`<${c}.${+l+1}.0-0`}else if(d){u=`<=${c}.${l}.${f}-${d}`}else if(e){u=`<${c}.${l}.${+f+1}-0`}else{u=`<=${u}`}return`${n} ${u}`.trim()};const j=(e,t,n)=>{for(let i=0;i0){const i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch){return true}}}return false}return true}},Q5Jp:function(e,t,n){const i=n("MDTW");const r=(e,t,n)=>i(e,t,n)===0;e.exports=r},TKTO:function(e,t,n){const i=n("u/28");const r=(e,t)=>new i(e,t).patch;e.exports=r},TYmw:function(e,t,n){const i=n("jLUY");e.exports={re:i.re,src:i.src,tokens:i.t,SEMVER_SPEC_VERSION:n("sVxN").SEMVER_SPEC_VERSION,SemVer:n("u/28"),compareIdentifiers:n("LN8h").compareIdentifiers,rcompareIdentifiers:n("LN8h").rcompareIdentifiers,parse:n("ojZj"),valid:n("rO9k"),clean:n("0u8k"),inc:n("AVmQ"),diff:n("a3ga"),major:n("ThTk"),minor:n("wtW1"),patch:n("TKTO"),prerelease:n("iXBk"),compare:n("MDTW"),rcompare:n("uAX3"),compareLoose:n("sAu+"),compareBuild:n("HMYi"),sort:n("Ki7I"),rsort:n("b6f7"),gt:n("usTL"),lt:n("OPpX"),eq:n("Q5Jp"),neq:n("8ZXz"),gte:n("oqMh"),lte:n("aNM5"),cmp:n("xL5+"),coerce:n("Cmeg"),Comparator:n("bUMA"),Range:n("P86V"),satisfies:n("KoYs"),toComparators:n("fWOt"),maxSatisfying:n("E6/z"),minSatisfying:n("/ZBw"),minVersion:n("htQf"),validRange:n("CYKG"),outside:n("OMvs"),gtr:n("i9a2"),ltr:n("m2yQ"),intersects:n("UjdT"),simplifyRange:n("9nwm"),subset:n("xiiv")}},ThTk:function(e,t,n){const i=n("u/28");const r=(e,t)=>new i(e,t).major;e.exports=r},UjdT:function(e,t,n){const i=n("P86V");const r=(e,t,n)=>{e=new i(e,n);t=new i(t,n);return e.intersects(t)};e.exports=r},ZYJ9:function(e,t,n){"use strict";var i=/("(?:[^\\"]|\\.)*")|[:,]/g;e.exports=function e(t,n){var r,o,s;n=n||{};r=JSON.stringify([1],undefined,n.indent===undefined?2:n.indent).slice(2,-3);o=r===""?Infinity:n.maxLength===undefined?80:n.maxLength;s=n.replacer;return function e(t,n,a){var u,c,l,f,d,h,p,g,m,b,v,y;if(t&&typeof t.toJSON==="function"){t=t.toJSON()}v=JSON.stringify(t,s);if(v===undefined){return v}p=o-n.length-a;if(v.length<=p){m=v.replace(i,(function(e,t){return t||e+" "}));if(m.length<=p){return m}}if(s!=null){t=JSON.parse(v);s=undefined}if(typeof t==="object"&&t!==null){g=n+r;l=[];c=0;if(Array.isArray(t)){b="[";u="]";p=t.length;for(;c0){return[b,r+l.join(",\n"+g),u].join("\n"+n)}}return v}(t,"",0)}},a3ga:function(e,t,n){const i=n("ojZj");const r=n("Q5Jp");const o=(e,t)=>{if(r(e,t)){return null}else{const n=i(e);const r=i(t);const o=n.prerelease.length||r.prerelease.length;const s=o?"pre":"";const a=o?"prerelease":"";for(const e in n){if(e==="major"||e==="minor"||e==="patch"){if(n[e]!==r[e]){return s+e}}}return a}};e.exports=o},aNM5:function(e,t,n){const i=n("MDTW");const r=(e,t,n)=>i(e,t,n)<=0;e.exports=r},b6f7:function(e,t,n){const i=n("HMYi");const r=(e,t)=>e.sort((e,n)=>i(n,e,t));e.exports=r},bUMA:function(e,t,n){const i=Symbol("SemVer ANY");class r{static get ANY(){return i}constructor(e,t){if(!t||typeof t!=="object"){t={loose:!!t,includePrerelease:false}}if(e instanceof r){if(e.loose===!!t.loose){return e}else{e=e.value}}u("comparator",e,t);this.options=t;this.loose=!!t.loose;this.parse(e);if(this.semver===i){this.value=""}else{this.value=this.operator+this.semver.version}u("comp",this)}parse(e){const t=this.options.loose?o[s.COMPARATORLOOSE]:o[s.COMPARATOR];const n=e.match(t);if(!n){throw new TypeError(`Invalid comparator: ${e}`)}this.operator=n[1]!==undefined?n[1]:"";if(this.operator==="="){this.operator=""}if(!n[2]){this.semver=i}else{this.semver=new c(n[2],this.options.loose)}}toString(){return this.value}test(e){u("Comparator.test",e,this.options.loose);if(this.semver===i||e===i){return true}if(typeof e==="string"){try{e=new c(e,this.options)}catch(t){return false}}return a(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof r)){throw new TypeError("a Comparator is required")}if(!t||typeof t!=="object"){t={loose:!!t,includePrerelease:false}}if(this.operator===""){if(this.value===""){return true}return new l(e.value,t).test(this.value)}else if(e.operator===""){if(e.value===""){return true}return new l(this.value,t).test(e.semver)}const n=(this.operator===">="||this.operator===">")&&(e.operator===">="||e.operator===">");const i=(this.operator==="<="||this.operator==="<")&&(e.operator==="<="||e.operator==="<");const o=this.semver.version===e.semver.version;const s=(this.operator===">="||this.operator==="<=")&&(e.operator===">="||e.operator==="<=");const u=a(this.semver,"<",e.semver,t)&&(this.operator===">="||this.operator===">")&&(e.operator==="<="||e.operator==="<");const c=a(this.semver,">",e.semver,t)&&(this.operator==="<="||this.operator==="<")&&(e.operator===">="||e.operator===">");return n||i||o&&s||u||c}}e.exports=r;const{re:o,t:s}=n("jLUY");const a=n("xL5+");const u=n("uAKX");const c=n("u/28");const l=n("P86V")},fWOt:function(e,t,n){const i=n("P86V");const r=(e,t)=>new i(e,t).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" "));e.exports=r},"h+ee":function(e,t,n){"use strict";n.r(t);n.d(t,"DEFAULT_ACTIONS",(function(){return yue}));n.d(t,"guessMode",(function(){return Due}));n.d(t,"vega",(function(){return mue}));n.d(t,"vegaLite",(function(){return bue}));var i={};n.r(i);n.d(i,"JsonPatchError",(function(){return F}));n.d(i,"deepClone",(function(){return N}));n.d(i,"getValueByPointer",(function(){return R}));n.d(i,"applyOperation",(function(){return B}));n.d(i,"applyPatch",(function(){return P}));n.d(i,"applyReducer",(function(){return I}));n.d(i,"validator",(function(){return L}));n.d(i,"validate",(function(){return U}));n.d(i,"_areEquals",(function(){return q}));var r={};n.r(r);n.d(r,"unobserve",(function(){return J}));n.d(r,"observe",(function(){return Z}));n.d(r,"generate",(function(){return Q}));n.d(r,"compare",(function(){return ee}));var o={};n.r(o);n.d(o,"aggregate",(function(){return vc}));n.d(o,"bin",(function(){return xc}));n.d(o,"collect",(function(){return wc}));n.d(o,"compare",(function(){return Oc}));n.d(o,"countpattern",(function(){return kc}));n.d(o,"cross",(function(){return Ac}));n.d(o,"density",(function(){return Nc}));n.d(o,"dotbin",(function(){return Lc}));n.d(o,"expression",(function(){return qc}));n.d(o,"extent",(function(){return Gc}));n.d(o,"facet",(function(){return Vc}));n.d(o,"field",(function(){return Yc}));n.d(o,"filter",(function(){return Jc}));n.d(o,"flatten",(function(){return Zc}));n.d(o,"fold",(function(){return Qc}));n.d(o,"formula",(function(){return Kc}));n.d(o,"generate",(function(){return el}));n.d(o,"impute",(function(){return rl}));n.d(o,"joinaggregate",(function(){return ul}));n.d(o,"kde",(function(){return cl}));n.d(o,"key",(function(){return ll}));n.d(o,"load",(function(){return dl}));n.d(o,"lookup",(function(){return gl}));n.d(o,"multiextent",(function(){return ml}));n.d(o,"multivalues",(function(){return vl}));n.d(o,"params",(function(){return xl}));n.d(o,"pivot",(function(){return _l}));n.d(o,"prefacet",(function(){return kl}));n.d(o,"project",(function(){return El}));n.d(o,"proxy",(function(){return Dl}));n.d(o,"quantile",(function(){return Ml}));n.d(o,"relay",(function(){return $l}));n.d(o,"sample",(function(){return Fl}));n.d(o,"sequence",(function(){return Nl}));n.d(o,"sieve",(function(){return Tl}));n.d(o,"subflow",(function(){return Hc}));n.d(o,"timeunit",(function(){return zl}));n.d(o,"tupleindex",(function(){return Bl}));n.d(o,"values",(function(){return Pl}));n.d(o,"window",(function(){return Vl}));var s={};n.r(s);n.d(s,"interpolate",(function(){return Ex}));n.d(s,"interpolateArray",(function(){return mx}));n.d(s,"interpolateBasis",(function(){return nx}));n.d(s,"interpolateBasisClosed",(function(){return ix}));n.d(s,"interpolateDate",(function(){return vx}));n.d(s,"interpolateDiscrete",(function(){return J_}));n.d(s,"interpolateHue",(function(){return Z_}));n.d(s,"interpolateNumber",(function(){return yx}));n.d(s,"interpolateNumberArray",(function(){return px}));n.d(s,"interpolateObject",(function(){return xx}));n.d(s,"interpolateRound",(function(){return Ax}));n.d(s,"interpolateString",(function(){return kx}));n.d(s,"interpolateTransformCss",(function(){return ow}));n.d(s,"interpolateTransformSvg",(function(){return sw}));n.d(s,"interpolateZoom",(function(){return fw}));n.d(s,"interpolateRgb",(function(){return lx}));n.d(s,"interpolateRgbBasis",(function(){return dx}));n.d(s,"interpolateRgbBasisClosed",(function(){return hx}));n.d(s,"interpolateHsl",(function(){return hw}));n.d(s,"interpolateHslLong",(function(){return pw}));n.d(s,"interpolateLab",(function(){return Bw}));n.d(s,"interpolateHcl",(function(){return Iw}));n.d(s,"interpolateHclLong",(function(){return Lw}));n.d(s,"interpolateCubehelix",(function(){return eO}));n.d(s,"interpolateCubehelixLong",(function(){return tO}));n.d(s,"piecewise",(function(){return D_}));n.d(s,"quantize",(function(){return nO}));var a={};n.r(a);n.d(a,"bound",(function(){return ik}));n.d(a,"identifier",(function(){return sk}));n.d(a,"mark",(function(){return uk}));n.d(a,"overlap",(function(){return lk}));n.d(a,"render",(function(){return vk}));n.d(a,"viewlayout",(function(){return Yk}));var u={};n.r(u);n.d(u,"axisticks",(function(){return Qk}));n.d(u,"datajoin",(function(){return Kk}));n.d(u,"encode",(function(){return nE}));n.d(u,"legendentries",(function(){return iE}));n.d(u,"linkpath",(function(){return uE}));n.d(u,"pie",(function(){return OE}));n.d(u,"scale",(function(){return DE}));n.d(u,"sortitems",(function(){return LE}));n.d(u,"stack",(function(){return HE}));var c={};n.r(c);n.d(c,"contour",(function(){return xA}));n.d(c,"geojson",(function(){return jA}));n.d(c,"geopath",(function(){return HC}));n.d(c,"geopoint",(function(){return YC}));n.d(c,"geoshape",(function(){return XC}));n.d(c,"graticule",(function(){return t$}));n.d(c,"heatmap",(function(){return n$}));n.d(c,"isocontour",(function(){return aA}));n.d(c,"kde2d",(function(){return mA}));n.d(c,"projection",(function(){return a$}));var l={};n.r(l);n.d(l,"force",(function(){return NF}));var f={};n.r(f);n.d(f,"nest",(function(){return lN}));n.d(f,"pack",(function(){return WN}));n.d(f,"partition",(function(){return XN}));n.d(f,"stratify",(function(){return tT}));n.d(f,"tree",(function(){return _T}));n.d(f,"treelinks",(function(){return wT}));n.d(f,"treemap",(function(){return FT}));var d={};n.r(d);n.d(d,"loess",(function(){return TT}));n.d(d,"regression",(function(){return BT}));var h={};n.r(h);n.d(h,"voronoi",(function(){return dz}));var p={};n.r(p);n.d(p,"wordcloud",(function(){return Mz}));var g={};n.r(g);n.d(g,"crossfilter",(function(){return Uz}));n.d(g,"resolvefilter",(function(){return qz}));var m={};n.r(m);n.d(m,"version",(function(){return Wz["a"]}));n.d(m,"bandwidthNRD",(function(){return vu}));n.d(m,"bin",(function(){return yu}));n.d(m,"bootstrapCI",(function(){return wu}));n.d(m,"dotbin",(function(){return Ou}));n.d(m,"quantiles",(function(){return pu}));n.d(m,"quartiles",(function(){return gu}));n.d(m,"random",(function(){return xu}));n.d(m,"setRandom",(function(){return _u}));n.d(m,"randomLCG",(function(){return ku}));n.d(m,"randomInteger",(function(){return Eu}));n.d(m,"randomKDE",(function(){return zu}));n.d(m,"randomLogNormal",(function(){return Lu}));n.d(m,"sampleLogNormal",(function(){return Ru}));n.d(m,"densityLogNormal",(function(){return Bu}));n.d(m,"cumulativeLogNormal",(function(){return Pu}));n.d(m,"quantileLogNormal",(function(){return Iu}));n.d(m,"randomMixture",(function(){return Uu}));n.d(m,"randomNormal",(function(){return Tu}));n.d(m,"sampleNormal",(function(){return Mu}));n.d(m,"densityNormal",(function(){return Cu}));n.d(m,"cumulativeNormal",(function(){return $u}));n.d(m,"quantileNormal",(function(){return Fu}));n.d(m,"randomUniform",(function(){return Vu}));n.d(m,"sampleUniform",(function(){return qu}));n.d(m,"densityUniform",(function(){return Wu}));n.d(m,"cumulativeUniform",(function(){return Gu}));n.d(m,"quantileUniform",(function(){return Hu}));n.d(m,"regressionLinear",(function(){return Qu}));n.d(m,"regressionLog",(function(){return Ku}));n.d(m,"regressionExp",(function(){return ec}));n.d(m,"regressionPow",(function(){return tc}));n.d(m,"regressionQuad",(function(){return nc}));n.d(m,"regressionPoly",(function(){return ic}));n.d(m,"regressionLoess",(function(){return cc}));n.d(m,"sampleCurve",(function(){return pc}));n.d(m,"TIME_UNITS",(function(){return Rn}));n.d(m,"YEAR",(function(){return En}));n.d(m,"QUARTER",(function(){return An}));n.d(m,"MONTH",(function(){return Dn}));n.d(m,"WEEK",(function(){return Sn}));n.d(m,"DATE",(function(){return Mn}));n.d(m,"DAY",(function(){return Cn}));n.d(m,"DAYOFYEAR",(function(){return $n}));n.d(m,"HOURS",(function(){return Fn}));n.d(m,"MINUTES",(function(){return Nn}));n.d(m,"SECONDS",(function(){return Tn}));n.d(m,"MILLISECONDS",(function(){return zn}));n.d(m,"timeUnitSpecifier",(function(){return Ln}));n.d(m,"timeUnits",(function(){return Pn}));n.d(m,"dayofyear",(function(){return Ni}));n.d(m,"week",(function(){return Ti}));n.d(m,"utcdayofyear",(function(){return Ii}));n.d(m,"utcweek",(function(){return Li}));n.d(m,"timeFloor",(function(){return Zi}));n.d(m,"utcFloor",(function(){return er}));n.d(m,"timeInterval",(function(){return Fr}));n.d(m,"timeOffset",(function(){return zr}));n.d(m,"timeSequence",(function(){return Pr}));n.d(m,"utcInterval",(function(){return Nr}));n.d(m,"utcOffset",(function(){return Rr}));n.d(m,"utcSequence",(function(){return Ir}));n.d(m,"timeBin",(function(){return so}));n.d(m,"accessor",(function(){return oe["f"]}));n.d(m,"accessorName",(function(){return oe["h"]}));n.d(m,"accessorFields",(function(){return oe["g"]}));n.d(m,"id",(function(){return oe["x"]}));n.d(m,"identity",(function(){return oe["y"]}));n.d(m,"zero",(function(){return oe["lb"]}));n.d(m,"one",(function(){return oe["P"]}));n.d(m,"truthy",(function(){return oe["hb"]}));n.d(m,"falsy",(function(){return oe["s"]}));n.d(m,"logger",(function(){return oe["L"]}));n.d(m,"None",(function(){return oe["d"]}));n.d(m,"Error",(function(){return oe["b"]}));n.d(m,"Warn",(function(){return oe["e"]}));n.d(m,"Info",(function(){return oe["c"]}));n.d(m,"Debug",(function(){return oe["a"]}));n.d(m,"mergeConfig",(function(){return oe["O"]}));n.d(m,"writeConfig",(function(){return oe["kb"]}));n.d(m,"panLinear",(function(){return oe["R"]}));n.d(m,"panLog",(function(){return oe["S"]}));n.d(m,"panPow",(function(){return oe["T"]}));n.d(m,"panSymlog",(function(){return oe["U"]}));n.d(m,"zoomLinear",(function(){return oe["mb"]}));n.d(m,"zoomLog",(function(){return oe["nb"]}));n.d(m,"zoomPow",(function(){return oe["ob"]}));n.d(m,"zoomSymlog",(function(){return oe["pb"]}));n.d(m,"quarter",(function(){return oe["W"]}));n.d(m,"utcquarter",(function(){return oe["ib"]}));n.d(m,"array",(function(){return oe["i"]}));n.d(m,"clampRange",(function(){return oe["k"]}));n.d(m,"compare",(function(){return oe["l"]}));n.d(m,"ascending",(function(){return oe["j"]}));n.d(m,"constant",(function(){return oe["m"]}));n.d(m,"debounce",(function(){return oe["n"]}));n.d(m,"error",(function(){return oe["o"]}));n.d(m,"extend",(function(){return oe["p"]}));n.d(m,"extent",(function(){return oe["q"]}));n.d(m,"extentIndex",(function(){return oe["r"]}));n.d(m,"fastmap",(function(){return oe["t"]}));n.d(m,"field",(function(){return oe["u"]}));n.d(m,"flush",(function(){return oe["v"]}));n.d(m,"hasOwnProperty",(function(){return oe["w"]}));n.d(m,"inherits",(function(){return oe["z"]}));n.d(m,"inrange",(function(){return oe["A"]}));n.d(m,"isArray",(function(){return oe["B"]}));n.d(m,"isBoolean",(function(){return oe["C"]}));n.d(m,"isDate",(function(){return oe["D"]}));n.d(m,"isFunction",(function(){return oe["E"]}));n.d(m,"isNumber",(function(){return oe["F"]}));n.d(m,"isObject",(function(){return oe["G"]}));n.d(m,"isRegExp",(function(){return oe["H"]}));n.d(m,"isString",(function(){return oe["I"]}));n.d(m,"key",(function(){return oe["J"]}));n.d(m,"lerp",(function(){return oe["K"]}));n.d(m,"lruCache",(function(){return oe["M"]}));n.d(m,"merge",(function(){return oe["N"]}));n.d(m,"pad",(function(){return oe["Q"]}));n.d(m,"peek",(function(){return oe["V"]}));n.d(m,"repeat",(function(){return oe["X"]}));n.d(m,"span",(function(){return oe["Y"]}));n.d(m,"splitAccessPath",(function(){return oe["Z"]}));n.d(m,"stringValue",(function(){return oe["ab"]}));n.d(m,"toBoolean",(function(){return oe["bb"]}));n.d(m,"toDate",(function(){return oe["cb"]}));n.d(m,"toNumber",(function(){return oe["db"]}));n.d(m,"toString",(function(){return oe["fb"]}));n.d(m,"toSet",(function(){return oe["eb"]}));n.d(m,"truncate",(function(){return oe["gb"]}));n.d(m,"visitArray",(function(){return oe["jb"]}));n.d(m,"loader",(function(){return Vs}));n.d(m,"read",(function(){return Gs}));n.d(m,"inferType",(function(){return tt}));n.d(m,"inferTypes",(function(){return nt}));n.d(m,"typeParsers",(function(){return Qe}));n.d(m,"format",(function(){return Bt}));n.d(m,"formats",(function(){return Pt}));n.d(m,"responseType",(function(){return It}));n.d(m,"Bounds",(function(){return Zp}));n.d(m,"Gradient",(function(){return Lf}));n.d(m,"GroupItem",(function(){return Kp}));n.d(m,"ResourceLoader",(function(){return ng}));n.d(m,"Item",(function(){return Qp}));n.d(m,"Scenegraph",(function(){return Pb}));n.d(m,"Handler",(function(){return Yb}));n.d(m,"Renderer",(function(){return Jb}));n.d(m,"CanvasHandler",(function(){return yv}));n.d(m,"CanvasRenderer",(function(){return Dv}));n.d(m,"SVGHandler",(function(){return $v}));n.d(m,"SVGRenderer",(function(){return yj}));n.d(m,"SVGStringRenderer",(function(){return zj}));n.d(m,"RenderType",(function(){return Uj}));n.d(m,"renderModule",(function(){return Wj}));n.d(m,"intersect",(function(){return Gj}));n.d(m,"Marks",(function(){return Cb}));n.d(m,"boundClip",(function(){return Zj}));n.d(m,"boundContext",(function(){return jg}));n.d(m,"boundStroke",(function(){return og}));n.d(m,"boundItem",(function(){return $b}));n.d(m,"boundMark",(function(){return Nb}));n.d(m,"pathCurves",(function(){return Hd}));n.d(m,"pathSymbols",(function(){return dh}));n.d(m,"pathRectangle",(function(){return Sh}));n.d(m,"pathTrail",(function(){return Mh}));n.d(m,"pathParse",(function(){return Xd}));n.d(m,"pathRender",(function(){return uh}));n.d(m,"point",(function(){return Hb}));n.d(m,"domCreate",(function(){return Lb}));n.d(m,"domFind",(function(){return Ub}));n.d(m,"domChild",(function(){return qb}));n.d(m,"domClear",(function(){return Wb}));n.d(m,"markup",(function(){return dj}));n.d(m,"serializeXML",(function(){return hj}));n.d(m,"font",(function(){return yb}));n.d(m,"fontFamily",(function(){return vb}));n.d(m,"fontSize",(function(){return lb}));n.d(m,"lineHeight",(function(){return fb}));n.d(m,"multiLineOffset",(function(){return pb}));n.d(m,"textMetrics",(function(){return rb}));n.d(m,"sceneEqual",(function(){return Kj}));n.d(m,"pathEqual",(function(){return ek}));n.d(m,"sceneToJSON",(function(){return zb}));n.d(m,"sceneFromJSON",(function(){return Rb}));n.d(m,"intersectPath",(function(){return Cg}));n.d(m,"intersectPoint",(function(){return $g}));n.d(m,"intersectRule",(function(){return Ng}));n.d(m,"intersectBoxLine",(function(){return Tg}));n.d(m,"sceneZOrder",(function(){return Gg}));n.d(m,"sceneVisit",(function(){return Hg}));n.d(m,"scenePickVisit",(function(){return Vg}));n.d(m,"resetSVGClipId",(function(){return Xp}));n.d(m,"resetSVGDefIds",(function(){return nk}));n.d(m,"Dataflow",(function(){return Ra}));n.d(m,"EventStream",(function(){return Fe}));n.d(m,"Parameters",(function(){return we}));n.d(m,"Pulse",(function(){return ba}));n.d(m,"MultiPulse",(function(){return _a}));n.d(m,"Operator",(function(){return De}));n.d(m,"Transform",(function(){return Pa}));n.d(m,"changeset",(function(){return xe}));n.d(m,"ingest",(function(){return pe}));n.d(m,"isTuple",(function(){return fe}));n.d(m,"definition",(function(){return La}));n.d(m,"transform",(function(){return Ua}));n.d(m,"transforms",(function(){return Ia}));n.d(m,"tupleid",(function(){return de}));n.d(m,"scale",(function(){return I_}));n.d(m,"scheme",(function(){return mO}));n.d(m,"interpolate",(function(){return cO}));n.d(m,"interpolateColors",(function(){return oO}));n.d(m,"interpolateRange",(function(){return rO}));n.d(m,"quantizeInterpolator",(function(){return sO}));n.d(m,"projection",(function(){return qC}));n.d(m,"View",(function(){return Qq}));n.d(m,"formatLocale",(function(){return kn}));n.d(m,"timeFormatLocale",(function(){return Is}));n.d(m,"locale",(function(){return Us}));n.d(m,"defaultLocale",(function(){return qs}));n.d(m,"resetDefaultLocale",(function(){return Ws}));n.d(m,"expressionFunction",(function(){return ZU}));n.d(m,"parse",(function(){return LX}));n.d(m,"runtimeContext",(function(){return Dq}));var b={};n.r(b);n.d(b,"invalidSpec",(function(){return w0}));n.d(b,"FIT_NON_SINGLE",(function(){return O0}));n.d(b,"containerSizeNonSingle",(function(){return j0}));n.d(b,"containerSizeNotCompatibleWithAutosize",(function(){return k0}));n.d(b,"droppingFit",(function(){return E0}));n.d(b,"unknownField",(function(){return A0}));n.d(b,"cannotProjectOnChannelWithoutField",(function(){return D0}));n.d(b,"cannotProjectAggregate",(function(){return S0}));n.d(b,"nearestNotSupportForContinuous",(function(){return M0}));n.d(b,"selectionNotSupported",(function(){return C0}));n.d(b,"selectionNotFound",(function(){return $0}));n.d(b,"SCALE_BINDINGS_CONTINUOUS",(function(){return F0}));n.d(b,"LEGEND_BINDINGS_MUST_HAVE_PROJECTION",(function(){return N0}));n.d(b,"noSameUnitLookup",(function(){return T0}));n.d(b,"NEEDS_SAME_SELECTION",(function(){return z0}));n.d(b,"INTERVAL_INITIALIZED_WITH_X_Y",(function(){return R0}));n.d(b,"noSuchRepeatedValue",(function(){return B0}));n.d(b,"columnsNotSupportByRowCol",(function(){return P0}));n.d(b,"CONCAT_CANNOT_SHARE_AXIS",(function(){return I0}));n.d(b,"unrecognizedParse",(function(){return L0}));n.d(b,"differentParse",(function(){return U0}));n.d(b,"ADD_SAME_CHILD_TWICE",(function(){return q0}));n.d(b,"invalidTransformIgnored",(function(){return W0}));n.d(b,"NO_FIELDS_NEEDS_AS",(function(){return G0}));n.d(b,"customFormatTypeNotAllowed",(function(){return H0}));n.d(b,"projectionOverridden",(function(){return V0}));n.d(b,"REPLACE_ANGLE_WITH_THETA",(function(){return Y0}));n.d(b,"primitiveChannelDef",(function(){return X0}));n.d(b,"invalidFieldType",(function(){return J0}));n.d(b,"invalidFieldTypeForCountAggregate",(function(){return Z0}));n.d(b,"invalidAggregate",(function(){return Q0}));n.d(b,"missingFieldType",(function(){return K0}));n.d(b,"droppingColor",(function(){return e1}));n.d(b,"emptyFieldDef",(function(){return t1}));n.d(b,"latLongDeprecated",(function(){return n1}));n.d(b,"LINE_WITH_VARYING_SIZE",(function(){return i1}));n.d(b,"incompatibleChannel",(function(){return r1}));n.d(b,"invalidEncodingChannel",(function(){return o1}));n.d(b,"facetChannelShouldBeDiscrete",(function(){return s1}));n.d(b,"facetChannelDropped",(function(){return a1}));n.d(b,"discreteChannelCannotEncode",(function(){return u1}));n.d(b,"lineWithRange",(function(){return c1}));n.d(b,"orientOverridden",(function(){return l1}));n.d(b,"CANNOT_UNION_CUSTOM_DOMAIN_WITH_FIELD_DOMAIN",(function(){return f1}));n.d(b,"RANGE_STEP_DEPRECATED",(function(){return d1}));n.d(b,"cannotUseScalePropertyWithNonColor",(function(){return h1}));n.d(b,"unaggregateDomainHasNoEffectForRawField",(function(){return p1}));n.d(b,"unaggregateDomainWithNonSharedDomainOp",(function(){return g1}));n.d(b,"unaggregatedDomainWithLogScale",(function(){return m1}));n.d(b,"cannotApplySizeToNonOrientedMark",(function(){return b1}));n.d(b,"scaleTypeNotWorkWithChannel",(function(){return v1}));n.d(b,"scaleTypeNotWorkWithFieldDef",(function(){return y1}));n.d(b,"scalePropertyNotWorkWithScaleType",(function(){return x1}));n.d(b,"scaleTypeNotWorkWithMark",(function(){return _1}));n.d(b,"stepDropped",(function(){return w1}));n.d(b,"mergeConflictingProperty",(function(){return O1}));n.d(b,"mergeConflictingDomainProperty",(function(){return j1}));n.d(b,"independentScaleMeansIndependentGuide",(function(){return k1}));n.d(b,"domainSortDropped",(function(){return E1}));n.d(b,"MORE_THAN_ONE_SORT",(function(){return A1}));n.d(b,"FACETED_INDEPENDENT_DIFFERENT_SOURCES",(function(){return D1}));n.d(b,"FACETED_INDEPENDENT_SAME_FIELDS_DIFFERENT_SOURCES",(function(){return S1}));n.d(b,"FACETED_INDEPENDENT_SAME_SOURCE",(function(){return M1}));n.d(b,"INVALID_CHANNEL_FOR_AXIS",(function(){return C1}));n.d(b,"cannotStackRangedMark",(function(){return $1}));n.d(b,"cannotStackNonLinearScale",(function(){return F1}));n.d(b,"stackNonSummativeAggregate",(function(){return N1}));n.d(b,"invalidTimeUnit",(function(){return T1}));n.d(b,"droppedDay",(function(){return z1}));n.d(b,"errorBarCenterAndExtentAreNotNeeded",(function(){return R1}));n.d(b,"errorBarCenterIsUsedWithWrongExtent",(function(){return B1}));n.d(b,"errorBarContinuousAxisHasCustomizedAggregate",(function(){return P1}));n.d(b,"errorBand1DNotSupport",(function(){return I1}));n.d(b,"channelRequiredForBinned",(function(){return L1}));n.d(b,"channelShouldNotBeUsedForBinned",(function(){return U1}));n.d(b,"domainRequiredForThresholdScale",(function(){return q1}));var v={};n.r(v);n.d(v,"compile",(function(){return gse}));n.d(v,"normalize",(function(){return G8}));n.d(v,"version",(function(){return UX["a"]}));var y={};n.r(y);n.d(y,"dark",(function(){return Ise}));n.d(y,"excel",(function(){return Use}));n.d(y,"fivethirtyeight",(function(){return Xse}));n.d(y,"ggplot2",(function(){return Zse}));n.d(y,"googlecharts",(function(){return Aae}));n.d(y,"latimes",(function(){return uae}));n.d(y,"quartz",(function(){return fae}));n.d(y,"urbaninstitute",(function(){return Oae}));n.d(y,"version",(function(){return Dae}));n.d(y,"vox",(function(){return hae}));var x=undefined&&undefined.__extends||function(){var e=function(t,n){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)if(t.hasOwnProperty(n))e[n]=t[n]};return e(t,n)};return function(t,n){e(t,n);function i(){this.constructor=t}t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}();var _=Object.prototype.hasOwnProperty;function w(e,t){return _.call(e,t)}function O(e){if(Array.isArray(e)){var t=new Array(e.length);for(var n=0;n=48&&i<=57){t++;continue}return false}return true}function E(e){if(e.indexOf("/")===-1&&e.indexOf("~")===-1)return e;return e.replace(/~/g,"~0").replace(/\//g,"~1")}function A(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function D(e,t){var n;for(var i in e){if(w(e,i)){if(e[i]===t){return E(i)+"/"}else if(typeof e[i]==="object"){n=D(e[i],t);if(n!=""){return E(i)+"/"+n}}}}return""}function S(e,t){if(e===t){return"/"}var n=D(e,t);if(n===""){throw new Error("Object not found in root")}return"/"+n}function M(e){if(e===undefined){return true}if(e){if(Array.isArray(e)){for(var t=0,n=e.length;t=f){if(n&&t.op==="add"&&h>c.length){throw new F("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,t,e)}var s=z[t.op].call(t,c,h,e);if(s.test===false){throw new F("Test operation failed","TEST_OPERATION_FAILED",o,t,e)}return s}}else{if(h&&h.indexOf("~")!=-1){h=A(h)}if(l>=f){var s=T[t.op].call(t,c,h,e);if(s.test===false){throw new F("Test operation failed","TEST_OPERATION_FAILED",o,t,e)}return s}}c=c[h]}}}function P(e,t,n,i,r){if(i===void 0){i=true}if(r===void 0){r=true}if(n){if(!Array.isArray(t)){throw new F("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY")}}if(!i){e=j(e)}var o=new Array(t.length);for(var s=0,a=t.length;s0){throw new F('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n)}else if((e.op==="move"||e.op==="copy")&&typeof e.from!=="string"){throw new F("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n)}else if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===undefined){throw new F("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n)}else if((e.op==="add"||e.op==="replace"||e.op==="test")&&M(e.value)){throw new F("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n)}else if(n){if(e.op=="add"){var r=e.path.split("/").length;var o=i.split("/").length;if(r!==o+1&&r!==o){throw new F("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==i){throw new F("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}}else if(e.op==="move"||e.op==="copy"){var s={op:"_get",path:e.from,value:undefined};var a=U([s],n);if(a&&a.name==="OPERATION_PATH_UNRESOLVABLE"){throw new F("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}}}function U(e,t,n){try{if(!Array.isArray(e)){throw new F("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY")}if(t){P(j(t),j(e),n||true)}else{n=n||L;for(var i=0;i0){e.patches=[];if(e.callback){e.callback(i)}}return i}function K(e,t,n,i,r){if(t===e){return}if(typeof t.toJSON==="function"){t=t.toJSON()}var o=O(t);var s=O(e);var a=false;var u=false;for(var c=s.length-1;c>=0;c--){var l=s[c];var f=e[l];if(w(t,l)&&!(t[l]===undefined&&f!==undefined&&Array.isArray(t)===false)){var d=t[l];if(typeof f=="object"&&f!=null&&typeof d=="object"&&d!=null){K(f,d,n,i+"/"+E(l),r)}else{if(f!==d){a=true;if(r){n.push({op:"test",path:i+"/"+E(l),value:j(f)})}n.push({op:"replace",path:i+"/"+E(l),value:j(d)})}}}else if(Array.isArray(e)===Array.isArray(t)){if(r){n.push({op:"test",path:i+"/"+E(l),value:j(f)})}n.push({op:"remove",path:i+"/"+E(l)});u=true}else{if(r){n.push({op:"test",path:i,value:e})}n.push({op:"replace",path:i,value:t});a=true}}if(!u&&o.length==s.length){return}for(var c=0;c{const r=t(e);if(!i[r]){i[r]=1;n.push(e)}return n};n.remove=e=>{const r=t(e);if(i[r]){i[r]=0;const t=n.indexOf(e);if(t>=0)n.splice(t,1)}return n};return n}var ae=async function(e,t){try{await t(e)}catch(n){e.error(n)}};const ue=Symbol("vega_id");let ce=1;function le(){ce=1}function fe(e){return!!(e&&de(e))}function de(e){return e[ue]}function he(e,t){e[ue]=t;return e}function pe(e){const t=e===Object(e)?e:{data:e};return de(t)?t:he(t,ce++)}function ge(e){return me(e,pe({}))}function me(e,t){for(const n in e)t[n]=e[n];return t}function be(e,t){return he(t,de(e))}function ve(e,t){return!e?null:t?(n,i)=>e(n,i)||de(t(n))-de(t(i)):(t,n)=>e(t,n)||de(t)-de(n)}function ye(e){return e&&e.constructor===xe}function xe(){const e=[],t=[],n=[],i=[],r=[];let o=null,s=false;return{constructor:xe,insert(t){const n=Object(oe["i"])(t),i=n.length;for(let r=0;r{if(p(e))c[de(e)]=-1})}for(f=0,d=e.length;f0){b(g,p,h.value);a.modifies(p)}}for(f=0,d=r.length;f{if(p(e)&&c[de(e)]>0){b(e,h.field,h.value)}});a.modifies(h.field)}if(s){a.mod=t.length||i.length?u.filter(e=>c[de(e)]>0):u.slice()}else{for(m in l)a.mod.push(l[m])}if(o||o==null&&(t.length||i.length)){a.clean(true)}return a}}}const _e="_:mod:_";function we(){Object.defineProperty(this,_e,{writable:true,value:{}})}we.prototype={set(e,t,n,i){const r=this,o=r[e],s=r[_e];if(t!=null&&t>=0){if(o[t]!==n||i){o[t]=n;s[t+":"+e]=-1;s[e]=-1}}else if(o!==n||i){r[e]=n;s[e]=Object(oe["B"])(n)?1+n.length:-1}return r},modified(e,t){const n=this[_e];if(!arguments.length){for(const e in n){if(n[e])return true}return false}else if(Object(oe["B"])(e)){for(let t=0;t=0?t+1{if(s instanceof De){if(s!==this){if(t)s.targets().add(this);o.push(s)}r.push({op:s,name:e,index:n})}else{i.set(e,n,s)}};for(s in e){a=e[s];if(s===je){Object(oe["i"])(a).forEach(e=>{if(!(e instanceof De)){Object(oe["o"])("Pulse parameters must be operator instances.")}else if(e!==this){e.targets().add(this);o.push(e)}});this.source=a}else if(Object(oe["B"])(a)){i.set(s,-1,Array(u=a.length));for(c=0;c{const n=Date.now();if(n-t>e){t=n;return 1}else{return 0}})},debounce(e){const t=Ne();this.targets().add(Ne(null,null,Object(oe["n"])(e,e=>{const n=e.dataflow;t.receive(e);if(n&&n.run)n.run()})));return t},between(e,t){let n=false;e.targets().add(Ne(null,null,()=>n=true));t.targets().add(Ne(null,null,()=>n=false));return this.filter(()=>n)},detach(){}};var Te=function(e,t,n,i){const r=this,o=Ne(n,i),s=function(e){e.dataflow=r;try{o.receive(e)}catch(t){r.error(t)}finally{r.run()}};let a;if(typeof e==="string"&&typeof document!=="undefined"){a=document.querySelectorAll(e)}else{a=Object(oe["i"])(e)}const u=a.length;for(let c=0;c({options:n||{},sanitize:Ue,load:Le,fileAccess:!!t,file:qe(t),http:Ge(e)})};async function Le(e,t){const n=await this.sanitize(e,t),i=n.href;return n.localFile?this.file(i):this.http(i,t)}async function Ue(e,t){t=Object(oe["p"])({},this.options,t);const n=this.fileAccess,i={href:null};let r,o,s;const a=Re.test(e.replace(Be,""));if(e==null||typeof e!=="string"||!a){Object(oe["o"])("Sanitize failure, invalid URI: "+Object(oe["ab"])(e))}const u=ze.test(e);if((s=t.baseURL)&&!u){if(!e.startsWith("/")&&s[s.length-1]!=="/"){e="/"+e}e=s+e}o=(r=e.startsWith(Pe))||t.mode==="file"||t.mode!=="http"&&!u&&n;if(r){e=e.slice(Pe.length)}else if(e.startsWith("//")){if(t.defaultProtocol==="file"){e=e.slice(2);o=true}else{e=(t.defaultProtocol||"http")+":"+e}}Object.defineProperty(i,"localFile",{value:!!o});i.href=e;if(t.target){i.target=t.target+""}if(t.rel){i.rel=t.rel+""}if(t.context==="image"&&t.crossOrigin){i.crossOrigin=t.crossOrigin+""}return i}function qe(e){return e?t=>new Promise((n,i)=>{e.readFile(t,(e,t)=>{if(e)i(e);else n(t)})}):We}async function We(){Object(oe["o"])("No file system access.")}function Ge(e){return e?async function(t,n){const i=Object(oe["p"])({},this.options.http,n),r=n&&n.response,o=await e(t,i);return!o.ok?Object(oe["o"])(o.status+""+o.statusText):Object(oe["E"])(o[r])?o[r]():o.text()}:He}async function He(){Object(oe["o"])("No HTTP fetch method available.")}const Ve=e=>e!=null&&e===e;const Ye=e=>e==="true"||e==="false"||e===true||e===false;const Xe=e=>!Number.isNaN(Date.parse(e));const Je=e=>!Number.isNaN(+e)&&!(e instanceof Date);const Ze=e=>Je(e)&&Number.isInteger(+e);const Qe={boolean:oe["bb"],integer:oe["db"],number:oe["db"],date:oe["cb"],string:oe["fb"],unknown:oe["y"]};const Ke=[Ye,Ze,Je,Xe];const et=["boolean","integer","number","date"];function tt(e,t){if(!e||!e.length)return"unknown";const n=e.length,i=Ke.length,r=Ke.map((e,t)=>t+1);for(let o=0,s=0,a,u;oe===0?t:e,0)-1]}function nt(e,t){return t.reduce((t,n)=>{t[n]=tt(e,n);return t},{})}var it={},rt={},ot=34,st=10,at=13;function ut(e){return new Function("d","return {"+e.map((function(e,t){return JSON.stringify(e)+": d["+t+'] || ""'})).join(",")+"}")}function ct(e,t){var n=ut(e);return function(i,r){return t(n(i),r,e)}}function lt(e){var t=Object.create(null),n=[];e.forEach((function(e){for(var i in e){if(!(i in t)){n.push(t[i]=i)}}}));return n}function ft(e,t){var n=e+"",i=n.length;return i9999?"+"+ft(e,6):ft(e,4)}function ht(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),i=e.getUTCSeconds(),r=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":dt(e.getUTCFullYear(),4)+"-"+ft(e.getUTCMonth()+1,2)+"-"+ft(e.getUTCDate(),2)+(r?"T"+ft(t,2)+":"+ft(n,2)+":"+ft(i,2)+"."+ft(r,3)+"Z":i?"T"+ft(t,2)+":"+ft(n,2)+":"+ft(i,2)+"Z":n||t?"T"+ft(t,2)+":"+ft(n,2)+"Z":"")}var pt=function(e){var t=new RegExp('["'+e+"\n\r]"),n=e.charCodeAt(0);function i(e,t){var n,i,o=r(e,(function(e,r){if(n)return n(e,r-1);i=e,n=t?ct(e,t):ut(e)}));o.columns=i||[];return o}function r(e,t){var i=[],r=e.length,o=0,s=0,a,u=r<=0,c=false;if(e.charCodeAt(r-1)===st)--r;if(e.charCodeAt(r-1)===at)--r;function l(){if(u)return rt;if(c)return c=false,it;var t,i=o,s;if(e.charCodeAt(i)===ot){while(o++=r)u=true;else if((s=e.charCodeAt(o++))===st)c=true;else if(s===at){c=true;if(e.charCodeAt(o)===st)++o}return e.slice(i+1,t-1).replace(/""/g,'"')}while(oo)o=e[0];if(e[1]s)s=e[1]}function u(e){switch(e.type){case"GeometryCollection":e.geometries.forEach(u);break;case"Point":a(e.coordinates);break;case"MultiPoint":e.coordinates.forEach(a);break}}e.arcs.forEach((function(e){var n=-1,a=e.length,u;while(++no)o=u[0];if(u[1]s)s=u[1]}}));for(n in e.objects){u(e.objects[n])}return[i,r,o,s]};var _t=function(e,t){var n,i=e.length,r=i-t;while(r<--i)n=e[r],e[r++]=e[i],e[i]=n};var wt=function(e,t){if(typeof t==="string")t=e.objects[t];return t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map((function(t){return Ot(e,t)}))}:Ot(e,t)};function Ot(e,t){var n=t.id,i=t.bbox,r=t.properties==null?{}:t.properties,o=jt(e,t);return n==null&&i==null?{type:"Feature",properties:r,geometry:o}:i==null?{type:"Feature",id:n,properties:r,geometry:o}:{type:"Feature",id:n,bbox:i,properties:r,geometry:o}}function jt(e,t){var n=yt(e.transform),i=e.arcs;function r(e,t){if(t.length)t.pop();for(var r=i[e<0?~e:e],o=0,s=r.length;o1)i=Dt(e,t,n);else for(r=0,i=new Array(o=e.arcs.length);r1){for(var o=1,s=a(i[0]),u,c;os){c=i[0],i[0]=i[o],i[o]=c,s=u}}}return i})).filter((function(e){return e.length>0}))}}var $t=function(e,t){var n=0,i=e.length;while(n>>1;if(e[r]=2))throw new Error("n must be ≥2");u=e.bbox||xt(e);var n=u[0],i=u[1],r=u[2],o=u[3],s;t={scale:[r-n?(r-n)/(s-1):1,o-i?(o-i)/(s-1):1],translate:[n,i]}}else{u=e.bbox}var a=Nt(t),u,c,l=e.objects,f={};function d(e){return a(e)}function h(e){var t;switch(e.type){case"GeometryCollection":t={type:"GeometryCollection",geometries:e.geometries.map(h)};break;case"Point":t={type:"Point",coordinates:d(e.coordinates)};break;case"MultiPoint":t={type:"MultiPoint",coordinates:e.coordinates.map(d)};break;default:return e}if(e.id!=null)t.id=e.id;if(e.bbox!=null)t.bbox=e.bbox;if(e.properties!=null)t.properties=e.properties;return t}function p(e){var t=0,n=1,i=e.length,r,o=new Array(i);o[0]=a(e[0],0);while(++te!==t,exterior:(e,t)=>e===t};function Rt(e,t){let n,i,r,o;e=Object(bt["a"])(e,t);if(t&&t.feature){n=wt;r=t.feature}else if(t&&t.mesh){n=Et;r=t.mesh;o=zt[t.filter]}else{Object(oe["o"])("Missing TopoJSON feature or mesh parameter.")}i=(i=e.objects[r])?n(e,i,o):Object(oe["o"])("Invalid TopoJSON object: "+r);return i&&i.features||[i]}Rt.responseType="json";const Bt={dsv:mt,csv:gt(","),tsv:gt("\t"),json:bt["a"],topojson:Rt};function Pt(e,t){if(arguments.length>1){Bt[e]=t;return this}else{return Object(oe["w"])(Bt,e)?Bt[e]:null}}function It(e){const t=Pt(e);return t&&t.responseType||"text"}var Lt=function(e){const t={};return n=>t[n]||(t[n]=e(n))};var Ut=Math.sqrt(50),qt=Math.sqrt(10),Wt=Math.sqrt(2);var Gt=function(e,t,n){var i,r=-1,o,s,a;t=+t,e=+e,n=+n;if(e===t&&n>0)return[e];if(i=t0){e=Math.ceil(e/a);t=Math.floor(t/a);s=new Array(o=Math.ceil(t-e+1));while(++r=0?(o>=Ut?10:o>=qt?5:o>=Wt?2:1)*Math.pow(10,r):-Math.pow(10,-r)/(o>=Ut?10:o>=qt?5:o>=Wt?2:1)}function Vt(e,t,n){var i=Math.abs(t-e)/Math.max(0,n),r=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),o=i/r;if(o>=Ut)r*=10;else if(o>=qt)r*=5;else if(o>=Wt)r*=2;return t=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Xt(e){if(!(t=Yt.exec(e)))throw new Error("invalid format: "+e);var t;return new Jt({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Xt.prototype=Jt.prototype;function Jt(e){this.fill=e.fill===undefined?" ":e.fill+"";this.align=e.align===undefined?">":e.align+"";this.sign=e.sign===undefined?"-":e.sign+"";this.symbol=e.symbol===undefined?"":e.symbol+"";this.zero=!!e.zero;this.width=e.width===undefined?undefined:+e.width;this.comma=!!e.comma;this.precision=e.precision===undefined?undefined:+e.precision;this.trim=!!e.trim;this.type=e.type===undefined?"":e.type+""}Jt.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===undefined?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===undefined?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};var Zt=function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)};function Qt(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,i=e.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+e.slice(n+1)]}var Kt=function(e){return e=Qt(Math.abs(e)),e?e[1]:NaN};var en=function(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Kt(t)/3)))*3-Kt(Math.abs(e)))};var tn=function(e,t){e=Math.abs(e),t=Math.abs(t)-e;return Math.max(0,Kt(t)-Kt(e))+1};var nn=function(e){return Math.max(0,-Kt(Math.abs(e)))};var rn=function(e,t){return function(n,i){var r=n.length,o=[],s=0,a=e[0],u=0;while(r>0&&a>0){if(u+a+1>i)a=Math.max(1,i-u);o.push(n.substring(r-=a,r+a));if((u+=a+1)>i)break;a=e[s=(s+1)%e.length]}return o.reverse().join(t)}};var on=function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}};var sn=function(e){e:for(var t=e.length,n=1,i=-1,r;n0)i=0;break}}return i>0?e.slice(0,i)+e.slice(r+1):e};var an;var un=function(e,t){var n=Qt(e,t);if(!n)return e+"";var i=n[0],r=n[1],o=r-(an=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,s=i.length;return o===s?i:o>s?i+new Array(o-s+1).join("0"):o>0?i.slice(0,o)+"."+i.slice(o):"0."+new Array(1-o).join("0")+Qt(e,Math.max(0,t+o-1))[0]};var cn=function(e,t){var n=Qt(e,t);if(!n)return e+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")};var ln={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Zt,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>cn(e*100,t),r:cn,s:un,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};var fn=function(e){return e};var dn=Array.prototype.map,hn=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];var pn=function(e){var t=e.grouping===undefined||e.thousands===undefined?fn:rn(dn.call(e.grouping,Number),e.thousands+""),n=e.currency===undefined?"":e.currency[0]+"",i=e.currency===undefined?"":e.currency[1]+"",r=e.decimal===undefined?".":e.decimal+"",o=e.numerals===undefined?fn:on(dn.call(e.numerals,String)),s=e.percent===undefined?"%":e.percent+"",a=e.minus===undefined?"−":e.minus+"",u=e.nan===undefined?"NaN":e.nan+"";function c(e){e=Xt(e);var c=e.fill,l=e.align,f=e.sign,d=e.symbol,h=e.zero,p=e.width,g=e.comma,m=e.precision,b=e.trim,v=e.type;if(v==="n")g=true,v="g";else if(!ln[v])m===undefined&&(m=12),b=true,v="g";if(h||c==="0"&&l==="=")h=true,c="0",l="=";var y=d==="$"?n:d==="#"&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x=d==="$"?i:/[%p]/.test(v)?s:"";var _=ln[v],w=/[defgprs%]/.test(v);m=m===undefined?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m));function O(e){var n=y,i=x,s,d,O;if(v==="c"){i=_(e)+i;e=""}else{e=+e;var j=e<0||1/e<0;e=isNaN(e)?u:_(Math.abs(e),m);if(b)e=sn(e);if(j&&+e===0&&f!=="+")j=false;n=(j?f==="("?f:a:f==="-"||f==="("?"":f)+n;i=(v==="s"?hn[8+an/3]:"")+i+(j&&f==="("?")":"");if(w){s=-1,d=e.length;while(++sO||O>57){i=(O===46?r+e.slice(s+1):e.slice(s))+i;e=e.slice(0,s);break}}}}if(g&&!h)e=t(e,Infinity);var k=n.length+e.length+i.length,E=k>1)+n+e+i+E.slice(k);break;default:e=E+n+e+i;break}return o(e)}O.toString=function(){return e+""};return O}function l(e,t){var n=c((e=Xt(e),e.type="f",e)),i=Math.max(-8,Math.min(8,Math.floor(Kt(t)/3)))*3,r=Math.pow(10,-i),o=hn[8+i/3];return function(e){return n(r*e)+o}}return{format:c,formatPrefix:l}};var gn;var mn;var bn;vn({thousands:",",grouping:[3],currency:["$",""]});function vn(e){gn=pn(e);mn=gn.format;bn=gn.formatPrefix;return gn}function yn(e,t){return n=>{const i=e(n),r=i.indexOf(t);if(r<0)return i;let o=xn(i,r);const s=or)if(i[o]!=="0"){++o;break}return i.slice(0,o)+s}}function xn(e,t){let n=e.lastIndexOf("e"),i;if(n>0)return n;for(n=e.length;--n>t;){i=e.charCodeAt(n);if(i>=48&&i<=57)return n+1}}function _n(e){const t=Lt(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(e){const n=Xt(e||",");if(n.precision==null){n.precision=12;switch(n.type){case"%":n.precision-=2;break;case"e":n.precision-=1;break}return yn(t(n),t(".1f")(1)[1])}else{return t(n)}},formatSpan(e,i,r,o){o=Xt(o==null?",f":o);const s=Vt(e,i,r),a=Math.max(Math.abs(e),Math.abs(i));let u;if(o.precision==null){switch(o.type){case"s":{if(!isNaN(u=en(s,a))){o.precision=u}return n(o,a)}case"":case"e":case"g":case"p":case"r":{if(!isNaN(u=tn(s,a))){o.precision=u-(o.type==="e")}break}case"f":case"%":{if(!isNaN(u=nn(s))){o.precision=u-(o.type==="%")*2}break}}}return t(o)}}}let wn;On();function On(){return wn=_n({format:mn,formatPrefix:bn})}function jn(e){return _n(pn(e))}function kn(e){return arguments.length?wn=jn(e):wn}const En="year";const An="quarter";const Dn="month";const Sn="week";const Mn="date";const Cn="day";const $n="dayofyear";const Fn="hours";const Nn="minutes";const Tn="seconds";const zn="milliseconds";const Rn=[En,An,Dn,Sn,Mn,Cn,$n,Fn,Nn,Tn,zn];const Bn=Rn.reduce((e,t,n)=>(e[t]=1+n,e),{});function Pn(e){const t=Object(oe["i"])(e).slice(),n={};if(!t.length)Object(oe["o"])("Missing time unit.");t.forEach(e=>{if(Object(oe["w"])(Bn,e)){n[e]=1}else{Object(oe["o"])(`Invalid time unit: ${e}.`)}});const i=(n[Sn]||n[Cn]?1:0)+(n[An]||n[Dn]||n[Mn]?1:0)+(n[$n]?1:0);if(i>1){Object(oe["o"])(`Incompatible time units: ${e}`)}t.sort((e,t)=>Bn[e]-Bn[t]);return t}const In={[En]:"%Y ",[An]:"Q%q ",[Dn]:"%b ",[Mn]:"%d ",[Sn]:"W%U ",[Cn]:"%a ",[$n]:"%j ",[Fn]:"%H:00",[Nn]:"00:%M",[Tn]:":%S",[zn]:".%L",[`${En}-${Dn}`]:"%Y-%m ",[`${En}-${Dn}-${Mn}`]:"%Y-%m-%d ",[`${Fn}-${Nn}`]:"%H:%M"};function Ln(e,t){const n=Object(oe["p"])({},In,t),i=Pn(e),r=i.length;let o="",s=0,a,u;for(s=0;ss;--a){u=i.slice(s,a).join("-");if(n[u]!=null){o+=n[u];s=a;break}}}return o.trim()}var Un=new Date,qn=new Date;function Wn(e,t,n,i){function r(t){return e(t=arguments.length===0?new Date:new Date(+t)),t}r.floor=function(t){return e(t=new Date(+t)),t};r.ceil=function(n){return e(n=new Date(n-1)),t(n,1),e(n),n};r.round=function(e){var t=r(e),n=r.ceil(e);return e-t0))return s;do{s.push(a=new Date(+n)),t(n,o),e(n)}while(a=t)while(e(t),!n(t))t.setTime(t-1)}),(function(e,i){if(e>=e){if(i<0)while(++i<=0){while(t(e,-1),!n(e)){}}else while(--i>=0){while(t(e,+1),!n(e)){}}}}))};if(n){r.count=function(t,i){Un.setTime(+t),qn.setTime(+i);e(Un),e(qn);return Math.floor(n(Un,qn))};r.every=function(e){e=Math.floor(e);return!isFinite(e)||!(e>0)?null:!(e>1)?r:r.filter(i?function(t){return i(t)%e===0}:function(t){return r.count(0,t)%e===0})}}return r}var Gn=1e3;var Hn=6e4;var Vn=36e5;var Yn=864e5;var Xn=6048e5;var Jn=Wn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Hn)/Yn,e=>e.getDate()-1);var Zn=Jn;var Qn=Jn.range;function Kn(e){return Wn((function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7);t.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+t*7)}),(function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Hn)/Xn}))}var ei=Kn(0);var ti=Kn(1);var ni=Kn(2);var ii=Kn(3);var ri=Kn(4);var oi=Kn(5);var si=Kn(6);var ai=ei.range;var ui=ti.range;var ci=ni.range;var li=ii.range;var fi=ri.range;var di=oi.range;var hi=si.range;var pi=Wn((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/Yn}),(function(e){return e.getUTCDate()-1}));var gi=pi;var mi=pi.range;function bi(e){return Wn((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7);t.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t*7)}),(function(e,t){return(t-e)/Xn}))}var vi=bi(0);var yi=bi(1);var xi=bi(2);var _i=bi(3);var wi=bi(4);var Oi=bi(5);var ji=bi(6);var ki=vi.range;var Ei=yi.range;var Ai=xi.range;var Di=_i.range;var Si=wi.range;var Mi=Oi.range;var Ci=ji.range;const $i=new Date;function Fi(e){$i.setFullYear(e);$i.setMonth(0);$i.setDate(1);$i.setHours(0,0,0,0);return $i}function Ni(e){return zi(new Date(e))}function Ti(e){return Ri(new Date(e))}function zi(e){return Zn.count(Fi(e.getFullYear())-1,e)}function Ri(e){return ei.count(Fi(e.getFullYear())-1,e)}function Bi(e){return Fi(e).getDay()}function Pi(e,t,n,i,r,o,s){if(0<=e&&e<100){const a=new Date(-1,t,n,i,r,o,s);a.setFullYear(e);return a}return new Date(e,t,n,i,r,o,s)}function Ii(e){return Ui(new Date(e))}function Li(e){return qi(new Date(e))}function Ui(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return gi.count(t-1,e)}function qi(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return vi.count(t-1,e)}function Wi(e){$i.setTime(Date.UTC(e,0,1));return $i.getUTCDay()}function Gi(e,t,n,i,r,o,s){if(0<=e&&e<100){const e=new Date(Date.UTC(-1,t,n,i,r,o,s));e.setUTCFullYear(n.y);return e}return new Date(Date.UTC(e,t,n,i,r,o,s))}function Hi(e,t,n,i,r){const o=t||1,s=Object(oe["V"])(e),a=(e,t,r)=>{r=r||e;return Vi(n[r],i[r],e===s&&o,t)};const u=new Date,c=Object(oe["eb"])(e),l=c[En]?a(En):Object(oe["m"])(2012),f=c[Dn]?a(Dn):c[An]?a(An):oe["lb"],d=c[Sn]&&c[Cn]?a(Cn,1,Sn+Cn):c[Sn]?a(Sn,1):c[Cn]?a(Cn,1):c[Mn]?a(Mn,1):c[$n]?a($n,1):oe["P"],h=c[Fn]?a(Fn):oe["lb"],p=c[Nn]?a(Nn):oe["lb"],g=c[Tn]?a(Tn):oe["lb"],m=c[zn]?a(zn):oe["lb"];return function(e){u.setTime(+e);const t=l(u);return r(t,f(u),d(u,t),h(u),p(u),g(u),m(u))}}function Vi(e,t,n,i){const r=n<=1?e:i?(t,r)=>i+n*Math.floor((e(t,r)-i)/n):(t,i)=>n*Math.floor(e(t,i)/n);return t?(e,n)=>t(r(e,n),n):r}function Yi(e,t,n){return t+e*7-(n+6)%7}const Xi={[En]:e=>e.getFullYear(),[An]:e=>Math.floor(e.getMonth()/3),[Dn]:e=>e.getMonth(),[Mn]:e=>e.getDate(),[Fn]:e=>e.getHours(),[Nn]:e=>e.getMinutes(),[Tn]:e=>e.getSeconds(),[zn]:e=>e.getMilliseconds(),[$n]:e=>zi(e),[Sn]:e=>Ri(e),[Sn+Cn]:(e,t)=>Yi(Ri(e),e.getDay(),Bi(t)),[Cn]:(e,t)=>Yi(1,e.getDay(),Bi(t))};const Ji={[An]:e=>3*e,[Sn]:(e,t)=>Yi(e,0,Bi(t))};function Zi(e,t){return Hi(e,t||1,Xi,Ji,Pi)}const Qi={[En]:e=>e.getUTCFullYear(),[An]:e=>Math.floor(e.getUTCMonth()/3),[Dn]:e=>e.getUTCMonth(),[Mn]:e=>e.getUTCDate(),[Fn]:e=>e.getUTCHours(),[Nn]:e=>e.getUTCMinutes(),[Tn]:e=>e.getUTCSeconds(),[zn]:e=>e.getUTCMilliseconds(),[$n]:e=>Ui(e),[Sn]:e=>qi(e),[Cn]:(e,t)=>Yi(1,e.getUTCDay(),Wi(t)),[Sn+Cn]:(e,t)=>Yi(qi(e),e.getUTCDay(),Wi(t))};const Ki={[An]:e=>3*e,[Sn]:(e,t)=>Yi(e,0,Wi(t))};function er(e,t){return Hi(e,t||1,Qi,Ki,Gi)}var tr=Wn((function(e){e.setMonth(0,1);e.setHours(0,0,0,0)}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e,t){return t.getFullYear()-e.getFullYear()}),(function(e){return e.getFullYear()}));tr.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:Wn((function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e);t.setMonth(0,1);t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n*e)}))};var nr=tr;var ir=tr.range;var rr=Wn((function(e){e.setDate(1);e.setHours(0,0,0,0)}),(function(e,t){e.setMonth(e.getMonth()+t)}),(function(e,t){return t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12}),(function(e){return e.getMonth()}));var or=rr;var sr=rr.range;var ar=Wn((function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*Gn-e.getMinutes()*Hn)}),(function(e,t){e.setTime(+e+t*Vn)}),(function(e,t){return(t-e)/Vn}),(function(e){return e.getHours()}));var ur=ar;var cr=ar.range;var lr=Wn((function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*Gn)}),(function(e,t){e.setTime(+e+t*Hn)}),(function(e,t){return(t-e)/Hn}),(function(e){return e.getMinutes()}));var fr=lr;var dr=lr.range;var hr=Wn((function(e){e.setTime(e-e.getMilliseconds())}),(function(e,t){e.setTime(+e+t*Gn)}),(function(e,t){return(t-e)/Gn}),(function(e){return e.getUTCSeconds()}));var pr=hr;var gr=hr.range;var mr=Wn((function(){}),(function(e,t){e.setTime(+e+t)}),(function(e,t){return t-e}));mr.every=function(e){e=Math.floor(e);if(!isFinite(e)||!(e>0))return null;if(!(e>1))return mr;return Wn((function(t){t.setTime(Math.floor(t/e)*e)}),(function(t,n){t.setTime(+t+n*e)}),(function(t,n){return(n-t)/e}))};var br=mr;var vr=mr.range;var yr=Wn((function(e){e.setUTCMonth(0,1);e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()}));yr.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:Wn((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e);t.setUTCMonth(0,1);t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)}))};var xr=yr;var _r=yr.range;var wr=Wn((function(e){e.setUTCDate(1);e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCMonth(e.getUTCMonth()+t)}),(function(e,t){return t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12}),(function(e){return e.getUTCMonth()}));var Or=wr;var jr=wr.range;var kr=Wn((function(e){e.setUTCMinutes(0,0,0)}),(function(e,t){e.setTime(+e+t*Vn)}),(function(e,t){return(t-e)/Vn}),(function(e){return e.getUTCHours()}));var Er=kr;var Ar=kr.range;var Dr=Wn((function(e){e.setUTCSeconds(0,0)}),(function(e,t){e.setTime(+e+t*Hn)}),(function(e,t){return(t-e)/Hn}),(function(e){return e.getUTCMinutes()}));var Sr=Dr;var Mr=Dr.range;const Cr={[En]:nr,[An]:or.every(3),[Dn]:or,[Sn]:ei,[Mn]:Zn,[Cn]:Zn,[$n]:Zn,[Fn]:ur,[Nn]:fr,[Tn]:pr,[zn]:br};const $r={[En]:xr,[An]:Or.every(3),[Dn]:Or,[Sn]:vi,[Mn]:gi,[Cn]:gi,[$n]:gi,[Fn]:Er,[Nn]:Sr,[Tn]:pr,[zn]:br};function Fr(e){return Cr[e]}function Nr(e){return $r[e]}function Tr(e,t,n){return e?e.offset(t,n):undefined}function zr(e,t,n){return Tr(Fr(e),t,n)}function Rr(e,t,n){return Tr(Nr(e),t,n)}function Br(e,t,n,i){return e?e.range(t,n,i):undefined}function Pr(e,t,n,i){return Br(Fr(e),t,n,i)}function Ir(e,t,n,i){return Br(Nr(e),t,n,i)}var Lr=function(e,t){return et?1:e>=t?0:NaN};var Ur=function(e){let t=e;let n=e;if(e.length===1){t=(t,n)=>e(t)-n;n=qr(e)}function i(e,t,i,r){if(i==null)i=0;if(r==null)r=e.length;while(i>>1;if(n(e[o],t)<0)i=o+1;else r=o}return i}function r(e,t,i,r){if(i==null)i=0;if(r==null)r=e.length;while(i>>1;if(n(e[o],t)>0)r=o;else i=o+1}return i}function o(e,n,r,o){if(r==null)r=0;if(o==null)o=e.length;const s=i(e,n,r,o-1);return s>r&&t(e[s-1],n)>-t(e[s],n)?s-1:s}return{left:i,center:o,right:r}};function qr(e){return(t,n)=>Lr(e(t),n)}const Wr=1e3,Gr=Wr*60,Hr=Gr*60,Vr=Hr*24,Yr=Vr*7,Xr=Vr*30,Jr=Vr*365;const Zr=[En,Dn,Mn,Fn,Nn,Tn,zn],Qr=Zr.slice(0,-1),Kr=Qr.slice(0,-1),eo=Kr.slice(0,-1),to=eo.slice(0,-1),no=[En,Sn],io=[En,Dn],ro=[En];const oo=[[Qr,1,Wr],[Qr,5,5*Wr],[Qr,15,15*Wr],[Qr,30,30*Wr],[Kr,1,Gr],[Kr,5,5*Gr],[Kr,15,15*Gr],[Kr,30,30*Gr],[eo,1,Hr],[eo,3,3*Hr],[eo,6,6*Hr],[eo,12,12*Hr],[to,1,Vr],[no,1,Yr],[io,1,Xr],[io,3,3*Xr],[ro,1,Jr]];var so=function(e){const t=e.extent,n=e.maxbins||40,i=Math.abs(Object(oe["Y"])(t))/n;let r=Ur(e=>e[2]).right(oo,i),o,s;if(r===oo.length){o=ro,s=Vt(t[0]/Jr,t[1]/Jr,n)}else if(r){r=oo[i/oo[r-1][2]53)return null;if(!("w"in i))i.w=1;if("Z"in i){o=uo(co(i.y,0,1)),s=o.getUTCDay();o=s>4||s===0?yi.ceil(o):yi(o);o=gi.offset(o,(i.V-1)*7);i.y=o.getUTCFullYear();i.m=o.getUTCMonth();i.d=o.getUTCDate()+(i.w+6)%7}else{o=ao(co(i.y,0,1)),s=o.getDay();o=s>4||s===0?ti.ceil(o):ti(o);o=Zn.offset(o,(i.V-1)*7);i.y=o.getFullYear();i.m=o.getMonth();i.d=o.getDate()+(i.w+6)%7}}else if("W"in i||"U"in i){if(!("w"in i))i.w="u"in i?i.u%7:"W"in i?1:0;s="Z"in i?uo(co(i.y,0,1)).getUTCDay():ao(co(i.y,0,1)).getDay();i.m=0;i.d="W"in i?(i.w+6)%7+i.W*7-(s+5)%7:i.w+i.U*7-(s+6)%7}if("Z"in i){i.H+=i.Z/100|0;i.M+=i.Z%100;return uo(i)}return ao(i)}}function j(e,t,n,i){var r=0,o=t.length,s=n.length,a,u;while(r=s)return-1;a=t.charCodeAt(r++);if(a===37){a=t.charAt(r++);u=_[a in fo?t.charAt(r++):a];if(!u||(i=u(e,n,i))<0)return-1}else if(a!=n.charCodeAt(i++)){return-1}}return i}function k(e,t,n){var i=c.exec(t.slice(n));return i?(e.p=l.get(i[0].toLowerCase()),n+i[0].length):-1}function E(e,t,n){var i=h.exec(t.slice(n));return i?(e.w=p.get(i[0].toLowerCase()),n+i[0].length):-1}function A(e,t,n){var i=f.exec(t.slice(n));return i?(e.w=d.get(i[0].toLowerCase()),n+i[0].length):-1}function D(e,t,n){var i=b.exec(t.slice(n));return i?(e.m=v.get(i[0].toLowerCase()),n+i[0].length):-1}function S(e,t,n){var i=g.exec(t.slice(n));return i?(e.m=m.get(i[0].toLowerCase()),n+i[0].length):-1}function M(e,n,i){return j(e,t,n,i)}function C(e,t,i){return j(e,n,t,i)}function $(e,t,n){return j(e,i,t,n)}function F(e){return s[e.getDay()]}function N(e){return o[e.getDay()]}function T(e){return u[e.getMonth()]}function z(e){return a[e.getMonth()]}function R(e){return r[+(e.getHours()>=12)]}function B(e){return 1+~~(e.getMonth()/3)}function P(e){return s[e.getUTCDay()]}function I(e){return o[e.getUTCDay()]}function L(e){return u[e.getUTCMonth()]}function U(e){return a[e.getUTCMonth()]}function q(e){return r[+(e.getUTCHours()>=12)]}function W(e){return 1+~~(e.getUTCMonth()/3)}return{format:function(e){var t=w(e+="",y);t.toString=function(){return e};return t},parse:function(e){var t=O(e+="",false);t.toString=function(){return e};return t},utcFormat:function(e){var t=w(e+="",x);t.toString=function(){return e};return t},utcParse:function(e){var t=O(e+="",true);t.toString=function(){return e};return t}}}var fo={"-":"",_:" ",0:"0"},ho=/^\s*\d+/,po=/^%/,go=/[\\^$*+?|[\]().{}]/g;function mo(e,t,n){var i=e<0?"-":"",r=(i?-e:e)+"",o=r.length;return i+(o[e.toLowerCase(),t]))}function xo(e,t,n){var i=ho.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function _o(e,t,n){var i=ho.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function wo(e,t,n){var i=ho.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function Oo(e,t,n){var i=ho.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function jo(e,t,n){var i=ho.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function ko(e,t,n){var i=ho.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function Eo(e,t,n){var i=ho.exec(t.slice(n,n+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function Ao(e,t,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function Do(e,t,n){var i=ho.exec(t.slice(n,n+1));return i?(e.q=i[0]*3-3,n+i[0].length):-1}function So(e,t,n){var i=ho.exec(t.slice(n,n+2));return i?(e.m=i[0]-1,n+i[0].length):-1}function Mo(e,t,n){var i=ho.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function Co(e,t,n){var i=ho.exec(t.slice(n,n+3));return i?(e.m=0,e.d=+i[0],n+i[0].length):-1}function $o(e,t,n){var i=ho.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function Fo(e,t,n){var i=ho.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function No(e,t,n){var i=ho.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function To(e,t,n){var i=ho.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function zo(e,t,n){var i=ho.exec(t.slice(n,n+6));return i?(e.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function Ro(e,t,n){var i=po.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function Bo(e,t,n){var i=ho.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function Po(e,t,n){var i=ho.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function Io(e,t){return mo(e.getDate(),t,2)}function Lo(e,t){return mo(e.getHours(),t,2)}function Uo(e,t){return mo(e.getHours()%12||12,t,2)}function qo(e,t){return mo(1+Zn.count(nr(e),e),t,3)}function Wo(e,t){return mo(e.getMilliseconds(),t,3)}function Go(e,t){return Wo(e,t)+"000"}function Ho(e,t){return mo(e.getMonth()+1,t,2)}function Vo(e,t){return mo(e.getMinutes(),t,2)}function Yo(e,t){return mo(e.getSeconds(),t,2)}function Xo(e){var t=e.getDay();return t===0?7:t}function Jo(e,t){return mo(ei.count(nr(e)-1,e),t,2)}function Zo(e){var t=e.getDay();return t>=4||t===0?ri(e):ri.ceil(e)}function Qo(e,t){e=Zo(e);return mo(ri.count(nr(e),e)+(nr(e).getDay()===4),t,2)}function Ko(e){return e.getDay()}function es(e,t){return mo(ti.count(nr(e)-1,e),t,2)}function ts(e,t){return mo(e.getFullYear()%100,t,2)}function ns(e,t){e=Zo(e);return mo(e.getFullYear()%100,t,2)}function is(e,t){return mo(e.getFullYear()%1e4,t,4)}function rs(e,t){var n=e.getDay();e=n>=4||n===0?ri(e):ri.ceil(e);return mo(e.getFullYear()%1e4,t,4)}function os(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+mo(t/60|0,"0",2)+mo(t%60,"0",2)}function ss(e,t){return mo(e.getUTCDate(),t,2)}function as(e,t){return mo(e.getUTCHours(),t,2)}function us(e,t){return mo(e.getUTCHours()%12||12,t,2)}function cs(e,t){return mo(1+gi.count(xr(e),e),t,3)}function ls(e,t){return mo(e.getUTCMilliseconds(),t,3)}function fs(e,t){return ls(e,t)+"000"}function ds(e,t){return mo(e.getUTCMonth()+1,t,2)}function hs(e,t){return mo(e.getUTCMinutes(),t,2)}function ps(e,t){return mo(e.getUTCSeconds(),t,2)}function gs(e){var t=e.getUTCDay();return t===0?7:t}function ms(e,t){return mo(vi.count(xr(e)-1,e),t,2)}function bs(e){var t=e.getUTCDay();return t>=4||t===0?wi(e):wi.ceil(e)}function vs(e,t){e=bs(e);return mo(wi.count(xr(e),e)+(xr(e).getUTCDay()===4),t,2)}function ys(e){return e.getUTCDay()}function xs(e,t){return mo(yi.count(xr(e)-1,e),t,2)}function _s(e,t){return mo(e.getUTCFullYear()%100,t,2)}function ws(e,t){e=bs(e);return mo(e.getUTCFullYear()%100,t,2)}function Os(e,t){return mo(e.getUTCFullYear()%1e4,t,4)}function js(e,t){var n=e.getUTCDay();e=n>=4||n===0?wi(e):wi.ceil(e);return mo(e.getUTCFullYear()%1e4,t,4)}function ks(){return"+0000"}function Es(){return"%"}function As(e){return+e}function Ds(e){return Math.floor(+e/1e3)}var Ss;var Ms;var Cs;var $s;var Fs;Ns({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Ns(e){Ss=lo(e);Ms=Ss.format;Cs=Ss.parse;$s=Ss.utcFormat;Fs=Ss.utcParse;return Ss}function Ts(e,t,n){n=n||{};if(!Object(oe["G"])(n)){Object(oe["o"])(`Invalid time multi-format specifier: ${n}`)}const i=t(Tn),r=t(Nn),o=t(Fn),s=t(Mn),a=t(Sn),u=t(Dn),c=t(An),l=t(En),f=e(n[zn]||".%L"),d=e(n[Tn]||":%S"),h=e(n[Nn]||"%I:%M"),p=e(n[Fn]||"%I %p"),g=e(n[Mn]||n[Cn]||"%a %d"),m=e(n[Sn]||"%b %d"),b=e(n[Dn]||"%B"),v=e(n[An]||"%B"),y=e(n[En]||"%Y");return e=>(i(e)Object(oe["I"])(e)?t(e):Ts(t,Fr,e),utcFormat:e=>Object(oe["I"])(e)?n(e):Ts(n,Nr,e),timeParse:Lt(e.parse),utcParse:Lt(e.utcParse)}}let Rs;Bs();function Bs(){return Rs=zs({format:Ms,parse:Cs,utcFormat:$s,utcParse:Fs})}function Ps(e){return zs(lo(e))}function Is(e){return arguments.length?Rs=Ps(e):Rs}const Ls=(e,t)=>Object(oe["p"])({},e,t);function Us(e,t){const n=e?jn(e):kn();const i=t?Ps(t):Is();return Ls(n,i)}function qs(e,t){const n=arguments.length;if(n&&n!==2){Object(oe["o"])("defaultLocale expects either zero or two arguments.")}return n?Ls(kn(e),Is(t)):Ls(kn(),Is())}function Ws(){On();Bs();return qs()}var Gs=function(e,t,n,i){t=t||{};const r=Pt(t.type||"json");if(!r)Object(oe["o"])("Unknown data format type: "+t.type);e=r(e,t);if(t.parse)Hs(e,t.parse,n,i);if(Object(oe["w"])(e,"columns"))delete e.columns;return e};function Hs(e,t,n,i){if(!e.length)return;const r=Is();n=n||r.timeParse;i=i||r.utcParse;let o=e.columns||Object.keys(e[0]),s,a,u,c,l,f;if(t==="auto")t=nt(e,o);o=Object.keys(t);const d=o.map(e=>{const r=t[e];let o,s;if(r&&(r.startsWith("date:")||r.startsWith("utc:"))){o=r.split(/:(.+)?/,2);s=o[1];if(s[0]==="'"&&s[s.length-1]==="'"||s[0]==='"'&&s[s.length-1]==='"'){s=s.slice(1,-1)}const e=o[0]==="utc"?i:n;return e(s)}if(!Qe[r]){throw Error("Illegal format pattern: "+e+":"+r)}return Qe[r]});for(u=0,l=e.length,f=o.length;ut=e);n.requests=0;n.done=()=>{if(--n.requests===0){e._pending=null;t(e)}};return e._pending=n}const Ks={skip:true};var ea=function(e,t,n,i,r){const o=e instanceof De?na:ta;o(this,e,t,n,i,r);return this};function ta(e,t,n,i,r,o){const s=Object(oe["p"])({},o,Ks);let a,u;if(!Object(oe["E"])(n))n=Object(oe["m"])(n);if(i===undefined){a=t=>e.touch(n(t))}else if(Object(oe["E"])(i)){u=new De(null,i,r,false);a=t=>{u.evaluate(t);const i=n(t),r=u.value;ye(r)?e.pulse(i,r,o):e.update(i,r,s)}}else{a=t=>e.update(n(t),i,s)}t.apply(a)}function na(e,t,n,i,r,o){if(i===undefined){t.targets().add(n)}else{const s=o||{},a=new De(null,ia(n,i),r,false);a.modified(s.force);a.rank=t.rank;t.targets().add(a);if(n){a.skip(true);a.value=n.value;a.targets().add(n);e.connect(n,[a])}}}function ia(e,t){t=Object(oe["E"])(t)?t:Object(oe["m"])(t);return e?function(n,i){const r=t(n,i);if(!e.skip()){e.skip(r!==this.value).value=r}return r}:t}function ra(e){e.rank=++this._rank}function oa(e){const t=[e];let n,i,r;while(t.length){this.rank(n=t.pop());if(i=n._targets){for(r=i.length;--r>=0;){t.push(n=i[r]);if(n===e)Object(oe["o"])("Cycle detected in dataflow graph.")}}}}const sa={};const aa=1<<0,ua=1<<1,ca=1<<2,la=aa|ua,fa=aa|ca,da=aa|ua|ca,ha=1<<3,pa=1<<4,ga=1<<5,ma=1<<6;function ba(e,t,n){this.dataflow=e;this.stamp=t==null?-1:t;this.add=[];this.rem=[];this.mod=[];this.fields=null;this.encode=n||null}function va(e,t){const n=[];Object(oe["jb"])(e,t,e=>n.push(e));return n}function ya(e,t){const n={};e.visit(t,e=>{n[de(e)]=1});return e=>n[de(e)]?null:e}function xa(e,t){return e?(n,i)=>e(n,i)&&t(n,i):t}ba.prototype={StopPropagation:sa,ADD:aa,REM:ua,MOD:ca,ADD_REM:la,ADD_MOD:fa,ALL:da,REFLOW:ha,SOURCE:pa,NO_SOURCE:ga,NO_FIELDS:ma,fork(e){return new ba(this.dataflow).init(this,e)},clone(){const e=this.fork(da);e.add=e.add.slice();e.rem=e.rem.slice();e.mod=e.mod.slice();if(e.source)e.source=e.source.slice();return e.materialize(da|pa)},addAll(){let e=this;const t=!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length;if(t){return e}else{e=new ba(this.dataflow).init(this);e.add=e.source;e.rem=[];return e}},init(e,t){const n=this;n.stamp=e.stamp;n.encode=e.encode;if(e.fields&&!(t&ma)){n.fields=e.fields}if(t&aa){n.addF=e.addF;n.add=e.add}else{n.addF=null;n.add=[]}if(t&ua){n.remF=e.remF;n.rem=e.rem}else{n.remF=null;n.rem=[]}if(t&ca){n.modF=e.modF;n.mod=e.mod}else{n.modF=null;n.mod=[]}if(t&ga){n.srcF=null;n.source=null}else{n.srcF=e.srcF;n.source=e.source;if(e.cleans)n.cleans=e.cleans}return n},runAfter(e){this.dataflow.runAfter(e)},changed(e){const t=e||da;return t&aa&&this.add.length||t&ua&&this.rem.length||t&ca&&this.mod.length},reflow(e){if(e)return this.fork(da).reflow();const t=this.add.length,n=this.source&&this.source.length;if(n&&n!==t){this.mod=this.source;if(t)this.filter(ca,ya(this,aa))}return this},clean(e){if(arguments.length){this.cleans=!!e;return this}else{return this.cleans}},modifies(e){const t=this.fields||(this.fields={});if(Object(oe["B"])(e)){e.forEach(e=>t[e]=true)}else{t[e]=true}return this},modified(e,t){const n=this.fields;return!((t||this.mod.length)&&n)?false:!arguments.length?!!n:Object(oe["B"])(e)?e.some(e=>n[e]):n[e]},filter(e,t){const n=this;if(e&aa)n.addF=xa(n.addF,t);if(e&ua)n.remF=xa(n.remF,t);if(e&ca)n.modF=xa(n.modF,t);if(e&pa)n.srcF=xa(n.srcF,t);return n},materialize(e){e=e||da;const t=this;if(e&aa&&t.addF){t.add=va(t.add,t.addF);t.addF=null}if(e&ua&&t.remF){t.rem=va(t.rem,t.remF);t.remF=null}if(e&ca&&t.modF){t.mod=va(t.mod,t.modF);t.modF=null}if(e&pa&&t.srcF){t.source=t.source.filter(t.srcF);t.srcF=null}return t},visit(e,t){const n=this,i=t;if(e&pa){Object(oe["jb"])(n.source,n.srcF,i);return n}if(e&aa)Object(oe["jb"])(n.add,n.addF,i);if(e&ua)Object(oe["jb"])(n.rem,n.remF,i);if(e&ca)Object(oe["jb"])(n.mod,n.modF,i);const r=n.source;if(e&ha&&r){const e=n.add.length+n.mod.length;if(e===r.length){}else if(e){Object(oe["jb"])(r,ya(n,fa),i)}else{Object(oe["jb"])(r,n.srcF,i)}}return n}};function _a(e,t,n,i){const r=this,o=n.length;let s=0;this.dataflow=e;this.stamp=t;this.fields=null;this.encode=i||null;this.pulses=n;for(let a=0;at.add.push(e));if(e&t.REM)this.visit(t.REM,e=>t.rem.push(e));if(e&t.MOD)this.visit(t.MOD,e=>t.mod.push(e))}return t},changed(e){return this.changes&e},modified(e){const t=this,n=t.fields;return!(n&&t.changes&t.MOD)?0:Object(oe["B"])(e)?e.some(e=>n[e]):n[e]},filter(){Object(oe["o"])("MultiPulse does not support filtering.")},materialize(){Object(oe["o"])("MultiPulse does not support materialization.")},visit(e,t){const n=this,i=n.pulses,r=i.length;let o=0;if(e&n.SOURCE){for(;oi._enqueue(e,true));i._touched=se(oe["x"]);let s=0,a,u,c;try{while(i._heap.size()>0){a=i._heap.pop();if(a.rank!==a.qrank){i._enqueue(a,true);continue}u=a.run(i._getPulse(a,e));if(u.then){u=await u}else if(u.async){r.push(u.async);u=sa}if(u!==sa){if(a._targets)a._targets.forEach(e=>i._enqueue(e))}++s}}catch(l){i._heap.clear();c=l}i._input={};i._pulse=null;i.debug(`Pulse ${o}: ${s} operators`);if(c){i._postrun=[];i.error(c)}if(i._postrun.length){const e=i._postrun.sort((e,t)=>t.priority-e.priority);i._postrun=[];for(let t=0;ti.runAsync(null,()=>{e.forEach(e=>{try{e(i)}catch(l){i.error(l)}})}))}return i}async function Oa(e,t,n){while(this._running)await this._running;const i=()=>this._running=null;(this._running=this.evaluate(e,t,n)).then(i,i);return this._running}function ja(e,t,n){return this._pulse?Ea(this):(this.evaluate(e,t,n),this)}function ka(e,t,n){if(this._pulse||t){this._postrun.push({priority:n||0,callback:e})}else{try{e(this)}catch(i){this.error(i)}}}function Ea(e){e.error("Dataflow already running. Use runAsync() to chain invocations.");return e}function Aa(e,t){const n=e.stampe.pulse),t):this._input[e.id]||Sa(this._pulse,n&&n.pulse)}function Sa(e,t){if(t&&t.stamp===e.stamp){return t}e=e.fork();if(t&&t!==sa){e.source=t.source}return e}const Ma={skip:false,force:false};function Ca(e,t){const n=t||Ma;if(this._pulse){this._enqueue(e)}else{this._touched.add(e)}if(n.skip)e.skip(true);return this}function $a(e,t,n){const i=n||Ma;if(e.set(t)||i.force){this.touch(e,i)}return this}function Fa(e,t,n){this.touch(e,n||Ma);const i=new ba(this,this._clock+(this._pulse?0:1)),r=e.pulse&&e.pulse.source||[];i.target=e;this._input[e.id]=t.pulse(i,r);return this}function Na(e){let t=[];return{clear:()=>t=[],size:()=>t.length,peek:()=>t[0],push:n=>{t.push(n);return Ta(t,0,t.length-1,e)},pop:()=>{const n=t.pop();let i;if(t.length){i=t[0];t[0]=n;za(t,0,e)}else{i=n}return i}}}function Ta(e,t,n,i){let r,o;const s=e[n];while(n>t){o=n-1>>1;r=e[o];if(i(s,r)<0){e[n]=r;n=o;continue}break}return e[n]=s}function za(e,t,n){const i=t,r=e.length,o=e[t];let s=(t<<1)+1,a;while(s=0){s=a}e[t]=e[s];t=s;s=(t<<1)+1}e[t]=o;return Ta(e,i,t,n)}function Ra(){this.logger(Object(oe["L"])());this.logLevel(oe["b"]);this._clock=0;this._rank=0;this._locale=qs();try{this._loader=Vs()}catch(e){}this._touched=se(oe["x"]);this._input={};this._pulse=null;this._heap=Na((e,t)=>e.qrank-t.qrank);this._postrun=[]}function Ba(e){return function(){return this._log[e].apply(this,arguments)}}Ra.prototype={stamp(){return this._clock},loader(e){if(arguments.length){this._loader=e;return this}else{return this._loader}},locale(e){if(arguments.length){this._locale=e;return this}else{return this._locale}},logger(e){if(arguments.length){this._log=e;return this}else{return this._log}},error:Ba("error"),warn:Ba("warn"),info:Ba("info"),debug:Ba("debug"),logLevel:Ba("level"),cleanThreshold:1e4,add:Me,connect:Ce,rank:ra,rerank:oa,pulse:Fa,touch:Ca,update:$a,changeset:xe,ingest:Xs,parse:Ys,preload:Zs,request:Js,events:Te,on:ea,evaluate:wa,run:ja,runAsync:Oa,runAfter:ka,_enqueue:Aa,_getPulse:Da};function Pa(e,t){De.call(this,e,null,t)}Object(oe["z"])(Pa,De,{run(e){if(e.stampthis.pulse=e)}else if(t!==e.StopPropagation){this.pulse=t}return t},evaluate(e){const t=this.marshall(e.stamp),n=this.transform(t,e);t.clear();return n},transform(){}});const Ia={};function La(e){const t=Ua(e);return t&&t.Definition||null}function Ua(e){e=e&&e.toLowerCase();return Object(oe["w"])(Ia,e)?Ia[e]:null}function qa(e){return t=>{const n=e.length;let i=1,r=String(e[0](t));for(;i{};const Va={init:Ha,add:Ha,rem:Ha,idx:0};const Ya={values:{init:e=>e.cell.store=true,value:e=>e.cell.data.values(),idx:-1},count:{value:e=>e.cell.num},__count__:{value:e=>e.missing+e.valid},missing:{value:e=>e.missing},valid:{value:e=>e.valid},sum:{init:e=>e.sum=0,value:e=>e.sum,add:(e,t)=>e.sum+=+t,rem:(e,t)=>e.sum-=t},product:{init:e=>e.product=1,value:e=>e.valid?e.product:undefined,add:(e,t)=>e.product*=t,rem:(e,t)=>e.product/=t},mean:{init:e=>e.mean=0,value:e=>e.valid?e.mean:undefined,add:(e,t)=>(e.mean_d=t-e.mean,e.mean+=e.mean_d/e.valid),rem:(e,t)=>(e.mean_d=t-e.mean,e.mean-=e.valid?e.mean_d/e.valid:e.mean)},average:{value:e=>e.valid?e.mean:undefined,req:["mean"],idx:1},variance:{init:e=>e.dev=0,value:e=>e.valid>1?e.dev/(e.valid-1):undefined,add:(e,t)=>e.dev+=e.mean_d*(t-e.mean),rem:(e,t)=>e.dev-=e.mean_d*(t-e.mean),req:["mean"],idx:1},variancep:{value:e=>e.valid>1?e.dev/e.valid:undefined,req:["variance"],idx:2},stdev:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid-1)):undefined,req:["variance"],idx:2},stdevp:{value:e=>e.valid>1?Math.sqrt(e.dev/e.valid):undefined,req:["variance"],idx:2},stderr:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid*(e.valid-1))):undefined,req:["variance"],idx:2},distinct:{value:e=>e.cell.data.distinct(e.get),req:["values"],idx:3},ci0:{value:e=>e.cell.data.ci0(e.get),req:["values"],idx:3},ci1:{value:e=>e.cell.data.ci1(e.get),req:["values"],idx:3},median:{value:e=>e.cell.data.q2(e.get),req:["values"],idx:3},q1:{value:e=>e.cell.data.q1(e.get),req:["values"],idx:3},q3:{value:e=>e.cell.data.q3(e.get),req:["values"],idx:3},min:{init:e=>e.min=undefined,value:e=>e.min=Number.isNaN(e.min)?e.cell.data.min(e.get):e.min,add:(e,t)=>{if(t{if(t<=e.min)e.min=NaN},req:["values"],idx:4},max:{init:e=>e.max=undefined,value:e=>e.max=Number.isNaN(e.max)?e.cell.data.max(e.get):e.max,add:(e,t)=>{if(t>e.max||e.max===undefined)e.max=t},rem:(e,t)=>{if(t>=e.max)e.max=NaN},req:["values"],idx:4},argmin:{init:e=>e.argmin=undefined,value:e=>e.argmin||e.cell.data.argmin(e.get),add:(e,t,n)=>{if(t{if(t<=e.min)e.argmin=undefined},req:["min","values"],idx:3},argmax:{init:e=>e.argmax=undefined,value:e=>e.argmax||e.cell.data.argmax(e.get),add:(e,t,n)=>{if(t>e.max)e.argmax=n},rem:(e,t)=>{if(t>=e.max)e.argmax=undefined},req:["max","values"],idx:3}};const Xa=Object.keys(Ya);function Ja(e,t){return n=>Object(oe["p"])({name:e,out:n||e},Va,t)}Xa.forEach(e=>{Ya[e]=Ja(e,Ya[e])});function Za(e,t){return Ya[e](t)}function Qa(e,t){return e.idx-t.idx}function Ka(e){const t={};e.forEach(e=>t[e.name]=e);const n=e=>{if(!e.req)return;e.req.forEach(e=>{if(!t[e])n(t[e]=Ya[e]())})};e.forEach(n);return Object.values(t).sort(Qa)}function eu(){this.valid=0;this.missing=0;this._ops.forEach(e=>e.init(this))}function tu(e,t){if(e==null||e===""){++this.missing;return}if(e!==e)return;++this.valid;this._ops.forEach(n=>n.add(this,e,t))}function nu(e,t){if(e==null||e===""){--this.missing;return}if(e!==e)return;--this.valid;this._ops.forEach(n=>n.rem(this,e,t))}function iu(e){this._out.forEach(t=>e[t.out]=t.value(this));return e}function ru(e,t){const n=t||oe["y"],i=Ka(e),r=e.slice().sort(Qa);function o(e){this._ops=i;this._out=r;this.cell=e;this.init()}o.prototype.init=eu;o.prototype.add=tu;o.prototype.rem=nu;o.prototype.set=iu;o.prototype.get=n;o.fields=e.map(e=>e.out);return o}var ou=function*(e,t){if(t==null){for(let t of e){if(t!=null&&t!==""&&(t=+t)>=t){yield t}}}else{let n=-1;for(let i of e){i=t(i,++n,e);if(i!=null&&i!==""&&(i=+i)>=i){yield i}}}};function su(e,t){let n;if(t===undefined){for(const t of e){if(t!=null&&(n=t)){n=t}}}else{let i=-1;for(let r of e){if((r=t(r,++i,e))!=null&&(n=r)){n=r}}}return n}function au(e,t){let n;if(t===undefined){for(const t of e){if(t!=null&&(n>t||n===undefined&&t>=t)){n=t}}}else{let i=-1;for(let r of e){if((r=t(r,++i,e))!=null&&(n>r||n===undefined&&r>=r)){n=r}}}return n}function uu(e,t,n=0,i=e.length-1,r=Lr){while(i>n){if(i-n>600){const o=i-n+1;const s=t-n+1;const a=Math.log(o);const u=.5*Math.exp(2*a/3);const c=.5*Math.sqrt(a*u*(o-u)/o)*(s-o/2<0?-1:1);const l=Math.max(n,Math.floor(t-s*u/o+c));const f=Math.min(i,Math.floor(t+(o-s)*u/o+c));uu(e,t,l,f,r)}const o=e[t];let s=n;let a=i;cu(e,n,t);if(r(e[i],o)>0)cu(e,n,i);while(s0)--a}if(r(e[n],o)===0)cu(e,n,a);else++a,cu(e,a,i);if(a<=t)n=a+1;if(t<=a)i=a-1}return e}function cu(e,t,n){const i=e[t];e[t]=e[n];e[n]=i}var lu=function(e){return e===null?NaN:+e};function*fu(e,t){if(t===undefined){for(let t of e){if(t!=null&&(t=+t)>=t){yield t}}}else{let n=-1;for(let i of e){if((i=t(i,++n,e))!=null&&(i=+i)>=i){yield i}}}}function du(e,t,n){e=Float64Array.from(fu(e,n));if(!(i=e.length))return;if((t=+t)<=0||i<2)return au(e);if(t>=1)return su(e);var i,r=(i-1)*t,o=Math.floor(r),s=su(uu(e,o).subarray(0,o+1)),a=au(e.subarray(o+1));return s+(a-s)*(r-o)}function hu(e,t,n=lu){if(!(i=e.length))return;if((t=+t)<=0||i<2)return+n(e[0],0,e);if(t>=1)return+n(e[i-1],i-1,e);var i,r=(i-1)*t,o=Math.floor(r),s=+n(e[o],o,e),a=+n(e[o+1],o+1,e);return s+(a-s)*(r-o)}var pu=function(e,t,n){const i=Float64Array.from(ou(e,n));i.sort(Lr);return t.map(e=>hu(i,e))};var gu=function(e,t){return pu(e,[.25,.5,.75],t)};function mu(e,t){let n=0;let i;let r=0;let o=0;if(t===undefined){for(let t of e){if(t!=null&&(t=+t)>=t){i=t-r;r+=i/++n;o+=i*(t-r)}}}else{let s=-1;for(let a of e){if((a=t(a,++s,e))!=null&&(a=+a)>=a){i=a-r;r+=i/++n;o+=i*(a-r)}}}if(n>1)return o/(n-1)}function bu(e,t){const n=mu(e,t);return n?Math.sqrt(n):n}var vu=function(e,t){const n=e.length,i=bu(e,t),r=gu(e,t),o=(r[2]-r[0])/1.34,s=Math.min(i,o)||i||Math.abs(r[0])||1;return 1.06*s*Math.pow(n,-.2)};var yu=function(e){const t=e.maxbins||20,n=e.base||10,i=Math.log(n),r=e.divide||[5,2];let o=e.extent[0],s=e.extent[1],a,u,c,l,f,d;const h=e.span||s-o||Math.abs(o)||1;if(e.step){a=e.step}else if(e.steps){l=h/t;for(f=0,d=e.steps.length;ft){a*=n}for(f=0,d=r.length;f=c&&h/l<=t)a=l}}l=Math.log(a);const p=l>=0?0:~~(-l/i)+1,g=Math.pow(n,-p-1);if(e.nice||e.nice===undefined){l=Math.floor(o/a+g)*a;o=oe);const r=e.length,o=new Float64Array(r);let s=0,a=1,u=i(e[0]),c=u,l=u+t,f;for(;a=l){c=(u+c)/2;for(;s>1);while(sr)e[s--]=e[i]}i=r;r=o}return e}var ku=function(e){return function(){e=(1103515245*e+12345)%2147483647;return e/2147483647}};var Eu=function(e,t){if(t==null){t=e;e=0}let n,i,r;const o={min(e){if(arguments.length){n=e||0;r=i-n;return o}else{return n}},max(e){if(arguments.length){i=e||0;r=i-n;return o}else{return i}},sample(){return n+Math.floor(r*xu())},pdf(e){return e===Math.floor(e)&&e>=n&&e=i?1:(t-n+1)/r},icdf(e){return e>=0&&e<=1?n-1+Math.floor(e*r):NaN}};return o.min(e).max(t)};const Au=Math.sqrt(2*Math.PI);const Du=Math.SQRT2;let Su=NaN;function Mu(e,t){e=e||0;t=t==null?1:t;let n=0,i=0,r,o;if(Su===Su){n=Su;Su=NaN}else{do{n=xu()*2-1;i=xu()*2-1;r=n*n+i*i}while(r===0||r>1);o=Math.sqrt(-2*Math.log(r)/r);n*=o;Su=i*o}return e+n*t}function Cu(e,t,n){n=n==null?1:n;const i=(e-(t||0))/n;return Math.exp(-.5*i*i)/(n*Au)}function $u(e,t,n){t=t||0;n=n==null?1:n;const i=(e-t)/n,r=Math.abs(i);let o;if(r>37){o=0}else{const e=Math.exp(-r*r/2);let t;if(r<7.07106781186547){t=.0352624965998911*r+.700383064443688;t=t*r+6.37396220353165;t=t*r+33.912866078383;t=t*r+112.079291497871;t=t*r+221.213596169931;t=t*r+220.206867912376;o=e*t;t=.0883883476483184*r+1.75566716318264;t=t*r+16.064177579207;t=t*r+86.7807322029461;t=t*r+296.564248779674;t=t*r+637.333633378831;t=t*r+793.826512519948;t=t*r+440.413735824752;o=o/t}else{t=r+.65;t=r+4/t;t=r+3/t;t=r+2/t;t=r+1/t;o=e/t/2.506628274631}}return i>0?1-o:o}function Fu(e,t,n){if(e<0||e>1)return NaN;return(t||0)+(n==null?1:n)*Du*Nu(2*e-1)}function Nu(e){let t=-Math.log((1-e)*(1+e)),n;if(t<6.25){t-=3.125;n=-364441206401782e-35;n=-16850591381820166e-35+n*t;n=128584807152564e-32+n*t;n=11157877678025181e-33+n*t;n=-1333171662854621e-31+n*t;n=20972767875968562e-33+n*t;n=6637638134358324e-30+n*t;n=-4054566272975207e-29+n*t;n=-8151934197605472e-29+n*t;n=26335093153082323e-28+n*t;n=-12975133253453532e-27+n*t;n=-5415412054294628e-26+n*t;n=1.0512122733215323e-9+n*t;n=-4.112633980346984e-9+n*t;n=-2.9070369957882005e-8+n*t;n=4.2347877827932404e-7+n*t;n=-13654692000834679e-22+n*t;n=-13882523362786469e-21+n*t;n=.00018673420803405714+n*t;n=-.000740702534166267+n*t;n=-.006033670871430149+n*t;n=.24015818242558962+n*t;n=1.6536545626831027+n*t}else if(t<16){t=Math.sqrt(t)-3.25;n=2.2137376921775787e-9;n=9.075656193888539e-8+n*t;n=-2.7517406297064545e-7+n*t;n=1.8239629214389228e-8+n*t;n=15027403968909828e-22+n*t;n=-4013867526981546e-21+n*t;n=29234449089955446e-22+n*t;n=12475304481671779e-21+n*t;n=-47318229009055734e-21+n*t;n=6828485145957318e-20+n*t;n=24031110387097894e-21+n*t;n=-.0003550375203628475+n*t;n=.0009532893797373805+n*t;n=-.0016882755560235047+n*t;n=.002491442096107851+n*t;n=-.003751208507569241+n*t;n=.005370914553590064+n*t;n=1.0052589676941592+n*t;n=3.0838856104922208+n*t}else if(Number.isFinite(t)){t=Math.sqrt(t)-5;n=-27109920616438573e-27;n=-2.555641816996525e-10+n*t;n=1.5076572693500548e-9+n*t;n=-3.789465440126737e-9+n*t;n=7.61570120807834e-9+n*t;n=-1.496002662714924e-8+n*t;n=2.914795345090108e-8+n*t;n=-6.771199775845234e-8+n*t;n=2.2900482228026655e-7+n*t;n=-9.9298272942317e-7+n*t;n=4526062597223154e-21+n*t;n=-1968177810553167e-20+n*t;n=7599527703001776e-20+n*t;n=-.00021503011930044477+n*t;n=-.00013871931833623122+n*t;n=1.0103004648645344+n*t;n=4.849906401408584+n*t}else{n=Infinity}return n*e}var Tu=function(e,t){let n,i;const r={mean(e){if(arguments.length){n=e||0;return r}else{return n}},stdev(e){if(arguments.length){i=e==null?1:e;return r}else{return i}},sample:()=>Mu(n,i),pdf:e=>Cu(e,n,i),cdf:e=>$u(e,n,i),icdf:e=>Fu(e,n,i)};return r.mean(e).stdev(t)};var zu=function(e,t){const n=Tu();let i=0;const r={data(n){if(arguments.length){e=n;i=n?n.length:0;return r.bandwidth(t)}else{return e}},bandwidth(n){if(!arguments.length)return t;t=n;if(!t&&e)t=vu(e);return r},sample(){return e[~~(xu()*i)]+t*n.sample()},pdf(r){let o=0,s=0;for(;sRu(n,i),pdf:e=>Bu(e,n,i),cdf:e=>Pu(e,n,i),icdf:e=>Iu(e,n,i)};return r.mean(e).stdev(t)};var Uu=function(e,t){let n=0,i;function r(e){const t=[];let i=0,r;for(r=0;r=t&&e<=n?1/(n-t):0}function Gu(e,t,n){if(n==null){n=t==null?1:t;t=0}return en?1:(e-t)/(n-t)}function Hu(e,t,n){if(n==null){n=t==null?1:t;t=0}return e>=0&&e<=1?t+e*(n-t):NaN}var Vu=function(e,t){let n,i;const r={min(e){if(arguments.length){n=e||0;return r}else{return n}},max(e){if(arguments.length){i=e==null?1:e;return r}else{return i}},sample:()=>qu(n,i),pdf:e=>Wu(e,n,i),cdf:e=>Gu(e,n,i),icdf:e=>Hu(e,n,i)};if(t==null){t=e==null?1:e;e=0}return r.min(e).max(t)};var Yu=function(e,t,n,i){const r=i-e*e,o=Math.abs(r)<1e-24?0:(n-e*t)/r,s=t-o*e;return[s,o]};function Xu(e,t,n,i){e=e.filter(e=>{let i=t(e),r=n(e);return i!=null&&(i=+i)>=i&&r!=null&&(r=+r)>=r});if(i){e.sort((e,n)=>t(e)-t(n))}const r=e.length,o=new Float64Array(r),s=new Float64Array(r);let a=0,u=0,c=0,l,f,d;for(d of e){o[a]=l=+t(d);s[a]=f=+n(d);++a;u+=(l-u)/a;c+=(f-c)/a}for(a=0;a=o&&s!=null&&(s=+s)>=s){i(o,s,++r)}}}var Zu=function(e,t,n,i,r){let o=0,s=0;Ju(e,t,n,(e,t)=>{const n=t-r(e),a=t-i;o+=n*n;s+=a*a});return 1-o/s};var Qu=function(e,t,n){let i=0,r=0,o=0,s=0,a=0;Ju(e,t,n,(e,t)=>{++a;i+=(e-i)/a;r+=(t-r)/a;o+=(e*t-o)/a;s+=(e*e-s)/a});const u=Yu(i,r,o,s),c=e=>u[0]+u[1]*e;return{coef:u,predict:c,rSquared:Zu(e,t,n,r,c)}};var Ku=function(e,t,n){let i=0,r=0,o=0,s=0,a=0;Ju(e,t,n,(e,t)=>{++a;e=Math.log(e);i+=(e-i)/a;r+=(t-r)/a;o+=(e*t-o)/a;s+=(e*e-s)/a});const u=Yu(i,r,o,s),c=e=>u[0]+u[1]*Math.log(e);return{coef:u,predict:c,rSquared:Zu(e,t,n,r,c)}};var ec=function(e,t,n){const[i,r,o,s]=Xu(e,t,n);let a=0,u=0,c=0,l=0,f=0,d,h,p;Ju(e,t,n,(e,t)=>{d=i[f++];h=Math.log(t);p=d*t;a+=(t*h-a)/f;u+=(p-u)/f;c+=(p*h-c)/f;l+=(d*p-l)/f});const[g,m]=Yu(u/s,a/s,c/s,l/s),b=e=>Math.exp(g+m*(e-o));return{coef:[Math.exp(g-m*o),m],predict:b,rSquared:Zu(e,t,n,s,b)}};var tc=function(e,t,n){let i=0,r=0,o=0,s=0,a=0,u=0;Ju(e,t,n,(e,t)=>{const n=Math.log(e),c=Math.log(t);++u;i+=(n-i)/u;r+=(c-r)/u;o+=(n*c-o)/u;s+=(n*n-s)/u;a+=(t-a)/u});const c=Yu(i,r,o,s),l=e=>c[0]*Math.pow(e,c[1]);c[0]=Math.exp(c[0]);return{coef:c,predict:l,rSquared:Zu(e,t,n,a,l)}};var nc=function(e,t,n){const[i,r,o,s]=Xu(e,t,n),a=i.length;let u=0,c=0,l=0,f=0,d=0,h,p,g,m;for(h=0;h{e=e-o;return y*e*e+x*e+_+s};return{coef:[_-x*o+y*o*o+s,x-2*y*o,y],predict:w,rSquared:Zu(e,t,n,s,w)}};var ic=function(e,t,n,i){if(i===1)return Qu(e,t,n);if(i===2)return nc(e,t,n);const[r,o,s,a]=Xu(e,t,n),u=r.length,c=[],l=[],f=i+1;let d,h,p,g,m;for(d=0;d{e-=s;let t=a+b[0]+b[1]*e+b[2]*e*e;for(d=3;d=0;--o){a=t[o];u=1;r[o]+=a;for(s=1;s<=o;++s){u*=(o+1-s)/s;r[o-s]+=a*Math.pow(n,s)*u}}r[0]+=i;return r}function oc(e){const t=e.length-1,n=[];let i,r,o,s,a;for(i=0;iMath.abs(e[i][s])){s=r}}for(o=i;o=i;o--){e[o][r]-=e[o][i]*e[i][r]/e[i][i]}}}for(r=t-1;r>=0;--r){a=0;for(o=r+1;or[s]-t?i:s;let u=0,c=0,h=0,p=0,g=0;const m=1/Math.abs(r[a]-t||1);for(let e=i;e<=s;++e){const n=r[e],i=o[e],s=lc(Math.abs(t-n)*m)*d[e],a=n*s;u+=s;c+=a;h+=i*s;p+=i*a;g+=n*a}const[b,v]=Yu(c/u,h/u,p/u,g/u);l[n]=b+v*t;f[n]=Math.abs(o[n]-l[n]);fc(r,n+1,e)}if(h===ac){break}const t=sc(f);if(Math.abs(t)=1?uc:(r=1-i*i)*r}}return dc(r,l,s,a)};function lc(e){return(e=1-e*e*e)*e*e}function fc(e,t,n){const i=e[t];let r=n[0],o=n[1]+1;if(o>=e.length)return;while(t>r&&e[o]-i<=i-e[r]){n[0]=++r;n[1]=o;++o}}function dc(e,t,n,i){const r=e.length,o=[];let s=0,a=0,u=[],c;for(;s[t,e(t)],o=t[0],s=t[1],a=s-o,u=a/i,c=[r(o)],l=[];if(n===i){for(let e=1;e0;){l.push(r(o+e/n*a))}}let f=c[0],d=l[l.length-1];while(d){const e=r((f[0]+d[0])/2);if(e[0]-f[0]>=u&&gc(f,e,d)>hc){l.push(e)}else{f=d;c.push(d);l.pop()}d=l[l.length-1]}return c};function gc(e,t,n){const i=Math.atan2(n[1]-e[1],n[0]-e[0]),r=Math.atan2(t[1]-e[1],t[0]-e[0]);return Math.abs(i-r)}function mc(e){this._key=e?Object(oe["u"])(e):de;this.reset()}const bc=mc.prototype;bc.reset=function(){this._add=[];this._rem=[];this._ext=null;this._get=null;this._q=null};bc.add=function(e){this._add.push(e)};bc.rem=function(e){this._rem.push(e)};bc.values=function(){this._get=null;if(this._rem.length===0)return this._add;const e=this._add,t=this._rem,n=this._key,i=e.length,r=t.length,o=Array(i-r),s={};let a,u,c;for(a=0;a=0){o=e(t[i])+"";if(!Object(oe["w"])(n,o)){n[o]=1;++r}}return r};bc.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=Object(oe["r"])(t,e);this._ext=[t[n[0]],t[n[1]]];this._get=e}return this._ext};bc.argmin=function(e){return this.extent(e)[0]||{}};bc.argmax=function(e){return this.extent(e)[1]||{}};bc.min=function(e){const t=this.extent(e)[0];return t!=null?e(t):undefined};bc.max=function(e){const t=this.extent(e)[1];return t!=null?e(t):undefined};bc.quartile=function(e){if(this._get!==e||!this._q){this._q=gu(this.values(),e);this._get=e}return this._q};bc.q1=function(e){return this.quartile(e)[0]};bc.q2=function(e){return this.quartile(e)[1]};bc.q3=function(e){return this.quartile(e)[2]};bc.ci=function(e){if(this._get!==e||!this._ci){this._ci=wu(this.values(),1e3,.05,e);this._get=e}return this._ci};bc.ci0=function(e){return this.ci(e)[0]};bc.ci1=function(e){return this.ci(e)[1]};function vc(e){Pa.call(this,null,e);this._adds=[];this._mods=[];this._alen=0;this._mlen=0;this._drop=true;this._cross=false;this._dims=[];this._dnames=[];this._measures=[];this._countOnly=false;this._counts=null;this._prev=null;this._inputs=null;this._outputs=null}vc.Definition={type:"Aggregate",metadata:{generates:true,changes:true},params:[{name:"groupby",type:"field",array:true},{name:"ops",type:"enum",array:true,values:Xa},{name:"fields",type:"field",null:true,array:true},{name:"as",type:"string",null:true,array:true},{name:"drop",type:"boolean",default:true},{name:"cross",type:"boolean",default:false},{name:"key",type:"field"}]};Object(oe["z"])(vc,Pa,{transform(e,t){const n=this,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.modified();n.stamp=i.stamp;if(n.value&&(r||t.modified(n._inputs,true))){n._prev=n.value;n.value=r?n.init(e):{};t.visit(t.SOURCE,e=>n.add(e))}else{n.value=n.value||n.init(e);t.visit(t.REM,e=>n.rem(e));t.visit(t.ADD,e=>n.add(e))}i.modifies(n._outputs);n._drop=e.drop!==false;if(e.cross&&n._dims.length>1){n._drop=false;n.cross()}if(t.clean()&&n._drop){i.clean(true).runAfter(()=>this.clean())}return n.changes(i)},cross(){const e=this,t=e.value,n=e._dnames,i=n.map(()=>({})),r=n.length;function o(e){let t,o,s,a;for(t in e){s=e[t].tuple;for(o=0;o{var t=Object(oe["h"])(e);r(e);n.push(t);return t});this.cellkey=e.key?e.key:Wa(this._dims);this._countOnly=true;this._counts=[];this._measures=[];const o=e.fields||[null],s=e.ops||["count"],a=e.as||[],u=o.length,c={};let l,f,d,h,p,g;if(u!==s.length){Object(oe["o"])("Unmatched number of fields and aggregate ops.")}for(g=0;gru(e,e.field));return{}},cellkey:Wa(),cell(e,t){let n=this.value[e];if(!n){n=this.value[e]=this.newcell(e,t);this._adds[this._alen++]=n}else if(n.num===0&&this._drop&&n.stamp{const t=i(e);e[a]=t;e[u]=t==null?null:r+o*(1+(t-r)/o)}:e=>e[a]=i(e));return t.modifies(n?s:a)},_bins(e){if(this.value&&!e.modified()){return this.value}const t=e.field,n=yu(e),i=n.step;let r=n.start,o=r+Math.ceil((n.stop-r)/i)*i,s,a;if((s=e.anchor)!=null){a=s-(r+i*Math.floor((s-r)/i));r+=a;o+=a}const u=function(e){let n=Object(oe["db"])(t(e));return n==null?null:no?+Infinity:(n=Math.max(r,Math.min(n,o-i)),r+i*Math.floor(yc+(n-r)/i))};u.start=r;u.stop=n.stop;u.step=i;return this.value=Object(oe["f"])(u,Object(oe["g"])(t),e.name||"bin_"+Object(oe["h"])(t))}});var _c=function(e,t,n){const i=e;let r=t||[],o=n||[],s={},a=0;return{add:e=>o.push(e),remove:e=>s[i(e)]=++a,size:()=>r.length,data:(e,t)=>{if(a){r=r.filter(e=>!s[i(e)]);s={};a=0}if(t&&e){r.sort(e)}if(o.length){r=e?Object(oe["N"])(e,r,o.sort(e)):r.concat(o);o=[]}return r}}};function wc(e){Pa.call(this,[],e)}wc.Definition={type:"Collect",metadata:{source:true},params:[{name:"sort",type:"compare"}]};Object(oe["z"])(wc,Pa,{transform(e,t){const n=t.fork(t.ALL),i=_c(de,this.value,n.materialize(n.ADD).add),r=e.sort,o=t.changed()||r&&(e.modified("sort")||t.modified(r.fields));n.visit(n.REM,i.remove);this.modified(o);this.value=n.source=i.data(ve(r),o);if(t.source&&t.source.root){this.value.root=t.source.root}return n}});function Oc(e){De.call(this,null,jc,e)}Object(oe["z"])(Oc,De);function jc(e){return this.value&&!e.modified()?this.value:Object(oe["l"])(e.fields,e.orders)}function kc(e){Pa.call(this,null,e)}kc.Definition={type:"CountPattern",metadata:{generates:true,changes:true},params:[{name:"field",type:"field",required:true},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:true,length:2,default:["text","count"]}]};function Ec(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase();break}return e.match(n)}Object(oe["z"])(kc,Pa,{transform(e,t){const n=t=>n=>{var i=Ec(a(n),e.case,o)||[],r;for(var u=0,c=i.length;ur[e]=1+(r[e]||0)),l=n(e=>r[e]-=1);if(i){t.visit(t.SOURCE,c)}else{t.visit(t.ADD,c);t.visit(t.REM,l)}return this._finish(t,u)},_parameterCheck(e,t){let n=false;if(e.modified("stopwords")||!this._stop){this._stop=new RegExp("^"+(e.stopwords||"")+"$","i");n=true}if(e.modified("pattern")||!this._match){this._match=new RegExp(e.pattern||"[\\w']+","g");n=true}if(e.modified("field")||t.modified(e.field.fields)){n=true}if(n)this._counts={};return n},_finish(e,t){const n=this._counts,i=this._tuples||(this._tuples={}),r=t[0],o=t[1],s=e.fork(e.NO_SOURCE|e.NO_FIELDS);let a,u,c;for(a in n){u=i[a];c=n[a]||0;if(!u&&c){i[a]=u=pe({});u[r]=a;u[o]=c;s.add.push(u)}else if(c===0){if(u)s.rem.push(u);n[a]=null;i[a]=null}else if(u[o]!==c){u[o]=c;s.mod.push(u)}}return s.modifies(t)}});function Ac(e){Pa.call(this,null,e)}Ac.Definition={type:"Cross",metadata:{generates:true},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:true,length:2,default:["a","b"]}]};Object(oe["z"])(Ac,Pa,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.as||["a","b"],r=i[0],o=i[1],s=!this.value||t.changed(t.ADD_REM)||e.modified("as")||e.modified("filter");let a=this.value;if(s){if(a)n.rem=a;a=t.materialize(t.SOURCE).source;n.add=this.value=Dc(a,r,o,e.filter||oe["hb"])}else{n.mod=a}n.source=this.value;return n.modifies(i)}});function Dc(e,t,n,i){var r=[],o={},s=e.length,a=0,u,c;for(;aFc(e,t)))}else if(typeof i[r]===Cc){i[r](e[r])}}return i}function Nc(e){Pa.call(this,null,e)}var Tc=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:true},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}];var zc={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:true,params:Tc},{name:"weights",type:"number",array:true}]};Nc.Definition={type:"Density",metadata:{generates:true},params:[{name:"extent",type:"number",array:true,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:Tc.concat(zc)},{name:"as",type:"string",array:true,default:["value","density"]}]};Object(oe["z"])(Nc,Pa,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=Fc(e.distribution,Rc(t)),r=e.steps||e.minsteps||25,o=e.steps||e.maxsteps||200;let s=e.method||"pdf";if(s!=="pdf"&&s!=="cdf"){Object(oe["o"])("Invalid density method: "+s)}if(!e.extent&&!i.data){Object(oe["o"])("Missing density extent parameter.")}s=i[s];const a=e.as||["value","density"],u=e.extent||Object(oe["q"])(i.data()),c=pc(s,u,r,o).map(e=>{const t={};t[a[0]]=e[0];t[a[1]]=e[1];return pe(t)});if(this.value)n.rem=this.value;this.value=n.add=n.source=c}return n}});function Rc(e){return()=>e.materialize(e.SOURCE).source}function Bc(e,t){if(!e)return null;return e.map((e,n)=>t[n]||Object(oe["h"])(e))}function Pc(e,t,n){const i=[],r=e=>e(u);let o,s,a,u,c,l;if(t==null){i.push(e.map(n))}else{for(o={},s=0,a=e.length;sObject(oe["Y"])(Object(oe["q"])(e,t))/30;Object(oe["z"])(Lc,Pa,{transform(e,t){if(this.value&&!(e.modified()||t.changed())){return t}const n=t.materialize(t.SOURCE).source,i=Pc(t.source,e.groupby,oe["y"]),r=e.smooth||false,o=e.field,s=e.step||Uc(n,o),a=ve((e,t)=>o(e)-o(t)),u=e.as||Ic,c=i.length;let l=Infinity,f=-Infinity,d=0,h;for(;df)f=t;e[++h][u]=t}}this.value={start:l,stop:f,step:s};return t.reflow(true).modifies(u)}});function qc(e){De.call(this,null,Wc,e);this.modified(true)}Object(oe["z"])(qc,De);function Wc(e){const t=e.expr;return this.value&&!e.modified("expr")?this.value:Object(oe["f"])(n=>t(n,e),Object(oe["g"])(t),Object(oe["h"])(t))}function Gc(e){Pa.call(this,[undefined,undefined],e)}Gc.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:true}]};Object(oe["z"])(Gc,Pa,{transform(e,t){const n=this.value,i=e.field,r=t.changed()||t.modified(i.fields)||e.modified("field");let o=n[0],s=n[1];if(r||o==null){o=+Infinity;s=-Infinity}t.visit(r?t.SOURCE:t.ADD,e=>{const t=Object(oe["db"])(i(e));if(t!=null){if(ts)s=t}});if(!Number.isFinite(o)||!Number.isFinite(s)){let e=Object(oe["h"])(i);if(e)e=` for field "${e}"`;t.dataflow.warn(`Infinite extent${e}: [${o}, ${s}]`);o=s=undefined}this.value=[o,s]}});function Hc(e,t){De.call(this,e);this.parent=t;this.count=0}Object(oe["z"])(Hc,De,{connect(e){this.detachSubflow=e.detachSubflow;this.targets().add(e);return e.source=this},add(e){this.count+=1;this.value.add.push(e)},rem(e){this.count-=1;this.value.rem.push(e)},mod(e){this.value.mod.push(e)},init(e){this.value.init(e,e.NO_SOURCE)},evaluate(){return this.value}});function Vc(e){Pa.call(this,{},e);this._keys=Object(oe["t"])();const t=this._targets=[];t.active=0;t.forEach=e=>{for(let n=0,i=t.active;nthis.subflow(e,r,t);this._group=e.group||{};this.initTargets();t.visit(t.REM,e=>{const t=de(e),n=o.get(t);if(n!==undefined){o.delete(t);a(n).rem(e)}});t.visit(t.ADD,e=>{const t=i(e);o.set(de(e),t);a(t).add(e)});if(s||t.modified(i.fields)){t.visit(t.MOD,e=>{const t=de(e),n=o.get(t),r=i(e);if(n===r){a(r).mod(e)}else{o.set(t,r);a(n).rem(e);a(r).add(e)}})}else if(t.changed(t.MOD)){t.visit(t.MOD,e=>{a(o.get(de(e))).mod(e)})}if(s){t.visit(t.REFLOW,e=>{const t=de(e),n=o.get(t),r=i(e);if(n!==r){o.set(t,r);a(n).rem(e);a(r).add(e)}})}if(t.clean()){n.runAfter(()=>{this.clean();o.clean()})}else if(o.empty>n.cleanThreshold){n.runAfter(o.clean)}return t}});function Yc(e){De.call(this,null,Xc,e)}Object(oe["z"])(Yc,De);function Xc(e){return this.value&&!e.modified()?this.value:Object(oe["B"])(e.name)?Object(oe["i"])(e.name).map(e=>Object(oe["u"])(e)):Object(oe["u"])(e.name,e.as)}function Jc(e){Pa.call(this,Object(oe["t"])(),e)}Jc.Definition={type:"Filter",metadata:{changes:true},params:[{name:"expr",type:"expr",required:true}]};Object(oe["z"])(Jc,Pa,{transform(e,t){const n=t.dataflow,i=this.value,r=t.fork(),o=r.add,s=r.rem,a=r.mod,u=e.expr;let c=true;t.visit(t.REM,e=>{var t=de(e);if(!i.has(t))s.push(e);else i.delete(t)});t.visit(t.ADD,t=>{if(u(t,e))o.push(t);else i.set(de(t),1)});function l(t){const n=de(t),r=u(t,e),l=i.get(n);if(r&&l){i.delete(n);o.push(t)}else if(!r&&!l){i.set(n,1);s.push(t)}else if(c&&r&&!l){a.push(t)}}t.visit(t.MOD,l);if(e.modified()){c=false;t.visit(t.REFLOW,l)}if(i.empty>n.cleanThreshold)n.runAfter(i.clean);return r}});function Zc(e){Pa.call(this,[],e)}Zc.Definition={type:"Flatten",metadata:{generates:true},params:[{name:"fields",type:"field",array:true,required:true},{name:"index",type:"string"},{name:"as",type:"string",array:true}]};Object(oe["z"])(Zc,Pa,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=Bc(i,e.as||[]),o=e.index||null,s=r.length;n.rem=this.value;t.visit(t.SOURCE,e=>{const t=i.map(t=>t(e)),a=t.reduce((e,t)=>Math.max(e,t.length),0);let u=0,c,l,f;for(;u{for(let t=0,o;tt[i]=n(t,e))}});function el(e){Pa.call(this,[],e)}Object(oe["z"])(el,Pa,{transform(e,t){const n=t.fork(t.ALL),i=e.generator;let r=this.value,o=e.size-r.length,s,a,u;if(o>0){for(s=[];--o>=0;){s.push(u=pe(i(e)));r.push(u)}n.add=n.add.length?n.materialize(n.ADD).add.concat(s):s}else{a=r.slice(0,-o);n.rem=n.rem.length?n.materialize(n.REM).rem.concat(a):a;r=r.slice(-o)}n.source=this.value=r;return n}});function tl(e,t){let n=0;let i=0;if(t===undefined){for(let t of e){if(t!=null&&(t=+t)>=t){++n,i+=t}}}else{let r=-1;for(let o of e){if((o=t(o,++r,e))!=null&&(o=+o)>=o){++n,i+=o}}}if(n)return i/n}const nl={value:"value",median:sc,mean:tl,min:au,max:su};const il=[];function rl(e){Pa.call(this,[],e)}rl.Definition={type:"Impute",metadata:{changes:true},params:[{name:"field",type:"field",required:true},{name:"key",type:"field",required:true},{name:"keyvals",array:true},{name:"groupby",type:"field",array:true},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]};function ol(e){var t=e.method||nl.value,n;if(nl[t]==null){Object(oe["o"])("Unrecognized imputation method: "+t)}else if(t===nl.value){n=e.value!==undefined?e.value:0;return()=>n}else{return nl[t]}}function sl(e){var t=e.field;return e=>e?t(e):NaN}Object(oe["z"])(rl,Pa,{transform(e,t){var n=t.fork(t.ALL),i=ol(e),r=sl(e),o=Object(oe["h"])(e.field),s=Object(oe["h"])(e.key),a=(e.groupby||[]).map(oe["h"]),u=al(t.source,e.groupby,e.key,e.keyvals),c=[],l=this.value,f=u.domain.length,d,h,p,g,m,b,v,y,x,_;for(m=0,y=u.length;me(m),o=[],s=i?i.slice():[],a={},u={},c,l,f,d,h,p,g,m;s.forEach((e,t)=>a[e]=t+1);for(d=0,g=e.length;dn.add(e))}else{r=n.value=n.value||this.init(e);t.visit(t.REM,e=>n.rem(e));t.visit(t.ADD,e=>n.add(e))}n.changes();t.visit(t.SOURCE,e=>{Object(oe["p"])(e,r[n.cellkey(e)].tuple)});return t.reflow(i).modifies(this._outputs)},changes(){const e=this._adds,t=this._mods;let n,i;for(n=0,i=this._alen;n{const n=zu(t,s)[a],i=e.counts?t.length:1,r=l||Object(oe["q"])(t);pc(n,r,f,d).forEach(e=>{const n={};for(let i=0;i{this._pending=Object(oe["i"])(e.data);return e=>e.touch(this)});return{async:t}}else{return n.request(e.url,e.format).then(e=>pl(this,t,Object(oe["i"])(e.data)))}}});function hl(e){return e.modified("async")&&!(e.modified("values")||e.modified("url")||e.modified("format"))}function pl(e,t,n){n.forEach(pe);const i=t.fork(t.NO_FIELDS&t.NO_SOURCE);i.rem=e.value;e.value=i.source=i.add=n;e._pending=null;if(i.rem.length)i.clean(true);return i}function gl(e){Pa.call(this,{},e)}gl.Definition={type:"Lookup",metadata:{modifies:true},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:true},{name:"key",type:"field",required:true}]},{name:"values",type:"field",array:true},{name:"fields",type:"field",array:true,required:true},{name:"as",type:"string",array:true},{name:"default",default:null}]};Object(oe["z"])(gl,Pa,{transform(e,t){const n=e.fields,i=e.index,r=e.values,o=e.default==null?null:e.default,s=e.modified(),a=n.length;let u=s?t.SOURCE:t.ADD,c=t,l=e.as,f,d,h;if(r){d=r.length;if(a>1&&!l){Object(oe["o"])('Multi-field lookup requires explicit "as" parameter.')}if(l&&l.length!==a*d){Object(oe["o"])('The "as" parameter has too few output field names.')}l=l||r.map(oe["h"]);f=function(e){for(var t=0,s=0,u,c;tt.modified(e.fields));u|=h?t.MOD:0}t.visit(u,f);return c.modifies(l)}});function ml(e){De.call(this,null,bl,e)}Object(oe["z"])(ml,De);function bl(e){if(this.value&&!e.modified()){return this.value}const t=e.extents,n=t.length;let i=+Infinity,r=-Infinity,o,s;for(o=0;or)r=s[1]}return[i,r]}function vl(e){De.call(this,null,yl,e)}Object(oe["z"])(vl,De);function yl(e){return this.value&&!e.modified()?this.value:e.values.reduce((e,t)=>e.concat(t),[])}function xl(e){Pa.call(this,null,e)}Object(oe["z"])(xl,Pa,{transform(e,t){this.modified(e.modified());this.value=e;return t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function _l(e){vc.call(this,e)}_l.Definition={type:"Pivot",metadata:{generates:true,changes:true},params:[{name:"groupby",type:"field",array:true},{name:"field",type:"field",required:true},{name:"value",type:"field",required:true},{name:"op",type:"enum",values:Xa,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]};Object(oe["z"])(_l,vc,{_transform:vc.prototype.transform,transform(e,t){return this._transform(wl(e,t),t)}});function wl(e,t){const n=e.field,i=e.value,r=(e.op==="count"?"__count__":e.op)||"sum",o=Object(oe["g"])(n).concat(Object(oe["g"])(i)),s=jl(n,e.limit||0,t);if(t.changed())e.set("__pivot__",null,null,true);return{key:e.key,groupby:e.groupby,ops:s.map(()=>r),fields:s.map(e=>Ol(e,n,i,o)),as:s.map(e=>e+""),modified:e.modified.bind(e)}}function Ol(e,t,n,i){return Object(oe["f"])(i=>t(i)===e?n(i):NaN,i,e+"")}function jl(e,t,n){const i={},r=[];n.visit(n.SOURCE,t=>{const n=e(t);if(!i[n]){i[n]=1;r.push(n)}});r.sort(oe["j"]);return t?r.slice(0,t):r}function kl(e){Vc.call(this,e)}Object(oe["z"])(kl,Vc,{transform(e,t){const n=e.subflow,i=e.field,r=e=>this.subflow(de(e),n,t,e);if(e.modified("field")||i&&t.modified(Object(oe["g"])(i))){Object(oe["o"])("PreFacet does not support field modification.")}this.initTargets();if(i){t.visit(t.MOD,e=>{const t=r(e);i(e).forEach(e=>t.mod(e))});t.visit(t.ADD,e=>{const t=r(e);i(e).forEach(e=>t.add(pe(e)))});t.visit(t.REM,e=>{const t=r(e);i(e).forEach(e=>t.rem(e))})}else{t.visit(t.MOD,e=>r(e).mod(e));t.visit(t.ADD,e=>r(e).add(e));t.visit(t.REM,e=>r(e).rem(e))}if(t.clean()){t.runAfter(()=>this.clean())}return t}});function El(e){Pa.call(this,null,e)}El.Definition={type:"Project",metadata:{generates:true,changes:true},params:[{name:"fields",type:"field",array:true},{name:"as",type:"string",null:true,array:true}]};Object(oe["z"])(El,Pa,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=Bc(e.fields,e.as||[]),o=i?(e,t)=>Al(e,t,i,r):me;let s;if(this.value){s=this.value}else{t=t.addAll();s=this.value={}}t.visit(t.REM,e=>{const t=de(e);n.rem.push(s[t]);s[t]=null});t.visit(t.ADD,e=>{const t=o(e,pe({}));s[de(e)]=t;n.add.push(t)});t.visit(t.MOD,e=>{n.mod.push(o(e,s[de(e)]))});return n}});function Al(e,t,n,i){for(let r=0,o=n.length;r{const t=pu(e,c);for(let n=0;n{const t=de(e);n.rem.push(i[t]);i[t]=null});t.visit(t.ADD,e=>{const t=ge(e);i[de(e)]=t;n.add.push(t)});t.visit(t.MOD,e=>{const t=i[de(e)];for(const i in e){t[i]=e[i];n.modifies(i)}n.mod.push(t)})}return n}});function Fl(e){Pa.call(this,[],e);this.count=0}Fl.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]};Object(oe["z"])(Fl,Pa,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.modified("size"),r=e.size,o=this.value.reduce((e,t)=>(e[de(t)]=1,e),{});let s=this.value,a=this.count,u=0;function c(e){let t,i;if(s.length=u){t=s[i];if(o[de(t)])n.rem.push(t);s[i]=e}}++a}if(t.rem.length){t.visit(t.REM,e=>{const t=de(e);if(o[t]){o[t]=-1;n.rem.push(e)}--a});s=s.filter(e=>o[de(e)]!==-1)}if((t.rem.length||i)&&s.length{if(!o[de(e)])c(e)});u=-1}if(i&&s.length>r){const e=s.length-r;for(let t=0;t{if(o[de(e)])n.mod.push(e)})}if(t.add.length){t.visit(t.ADD,c)}if(t.add.length||u<0){n.add=s.filter(e=>!o[de(e)])}this.count=a;this.value=n.source=s;return n}});function Nl(e){Pa.call(this,null,e)}Nl.Definition={type:"Sequence",metadata:{generates:true,changes:true},params:[{name:"start",type:"number",required:true},{name:"stop",type:"number",required:true},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]};Object(oe["z"])(Nl,Pa,{transform(e,t){if(this.value&&!e.modified())return;const n=t.materialize().fork(t.MOD),i=e.as||"data";n.rem=this.value?t.rem.concat(this.value):t.rem;this.value=Sl(e.start,e.stop,e.step||1).map(e=>{const t={};t[i]=e;return pe(t)});n.add=t.add.concat(this.value);return n}});function Tl(e){Pa.call(this,null,e);this.modified(true)}Object(oe["z"])(Tl,Pa,{transform(e,t){this.value=t.source;return t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function zl(e){Pa.call(this,null,e)}const Rl=["unit0","unit1"];zl.Definition={type:"TimeUnit",metadata:{modifies:true},params:[{name:"field",type:"field",required:true},{name:"interval",type:"boolean",default:true},{name:"units",type:"enum",values:Rn,array:true},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:true},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:true,length:2,default:Rl}]};Object(oe["z"])(zl,Pa,{transform(e,t){const n=e.field,i=e.interval!==false,r=e.timezone==="utc",o=this._floor(e,t),s=(r?Nr:Fr)(o.unit).offset,a=e.as||Rl,u=a[0],c=a[1],l=o.step;let f=o.start||Infinity,d=o.stop||-Infinity,h=t.ADD;if(e.modified()||t.modified(Object(oe["g"])(n))){t=t.reflow(true);h=t.SOURCE;f=Infinity;d=-Infinity}t.visit(h,e=>{const t=n(e);let r,a;if(t==null){e[u]=null;if(i)e[c]=null}else{e[u]=r=a=o(t);if(i)e[c]=a=s(r,l);if(rd)d=a}});o.start=f;o.stop=d;return t.modifies(i?a:u)},_floor(e,t){const n=e.timezone==="utc";const{units:i,step:r}=e.units?{units:e.units,step:e.step||1}:so({extent:e.extent||Object(oe["q"])(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins});const o=Pn(i),s=this.value||{},a=(n?er:Zi)(o,r);a.unit=Object(oe["V"])(o);a.units=o;a.step=r;a.start=s.start;a.stop=s.stop;return this.value=a}});function Bl(e){Pa.call(this,Object(oe["t"])(),e)}Object(oe["z"])(Bl,Pa,{transform(e,t){const n=t.dataflow,i=e.field,r=this.value,o=e=>r.set(i(e),e);let s=true;if(e.modified("field")||t.modified(i.fields)){r.clear();t.visit(t.SOURCE,o)}else if(t.changed()){t.visit(t.REM,e=>r.delete(i(e)));t.visit(t.ADD,o)}else{s=false}this.modified(s);if(r.empty>n.cleanThreshold)n.runAfter(r.clean);return t.fork()}});function Pl(e){Pa.call(this,null,e)}Object(oe["z"])(Pl,Pa,{transform(e,t){const n=!this.value||e.modified("field")||e.modified("sort")||t.changed()||e.sort&&t.modified(e.sort.fields);if(n){this.value=(e.sort?t.source.slice().sort(ve(e.sort)):t.source).map(e.field)}}});function Il(e,t,n,i){const r=Ll[e](t,n);return{init:r.init||oe["lb"],update:function(e,t){t[i]=r.next(e)}}}const Ll={row_number:function(){return{next:e=>e.index+1}},rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?e=n+1:e}}},dense_rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?++e:e}}},percent_rank:function(){const e=Ll.rank(),t=e.next;return{init:e.init,next:e=>(t(e)-1)/(e.data.length-1)}},cume_dist:function(){let e;return{init:()=>e=0,next:t=>{const n=t.data,i=t.compare;let r=t.index;if(e0))Object(oe["o"])("ntile num must be greater than zero.");const n=Ll.cume_dist(),i=n.next;return{init:n.init,next:e=>Math.ceil(t*i(e))}},lag:function(e,t){t=+t||1;return{next:n=>{const i=n.index-t;return i>=0?e(n.data[i]):null}}},lead:function(e,t){t=+t||1;return{next:n=>{const i=n.index+t,r=n.data;return ie(t.data[t.i0])}},last_value:function(e){return{next:t=>e(t.data[t.i1-1])}},nth_value:function(e,t){t=+t;if(!(t>0))Object(oe["o"])("nth_value nth must be greater than zero.");return{next:n=>{const i=n.i0+(t-1);return it=null,next:n=>{const i=e(n.data[n.index]);return i!=null?t=i:t}}},next_value:function(e){let t,n;return{init:()=>(t=null,n=-1),next:i=>{const r=i.data;return i.index<=n?t:(n=Ul(e,r,i.index))<0?(n=r.length,t=null):t=e(r[n])}}}};function Ul(e,t,n){for(let i=t.length;na[e]=1)}d(e.sort);t.forEach((e,t)=>{const a=n[t],h=Object(oe["h"])(a),p=Ga(e,h,r[t]);d(a);o.push(p);if(Object(oe["w"])(Ll,e)){s.push(Il(e,n[t],i[t],p))}else{if(a==null&&e!=="count"){Object(oe["o"])("Null aggregate field specified.")}if(e==="count"){c.push(p);return}f=false;let t=u[h];if(!t){t=u[h]=[];t.field=a;l.push(t)}t.push(Za(e,p))}});if(c.length||l.length){this.cell=Hl(l,c,f)}this.inputs=Object.keys(a)}const Gl=Wl.prototype;Gl.init=function(){this.windows.forEach(e=>e.init());if(this.cell)this.cell.init()};Gl.update=function(e,t){const n=this.cell,i=this.windows,r=e.data,o=i&&i.length;let s;if(n){for(s=e.p0;sru(e,e.field));const i={num:0,agg:null,store:false,count:t};if(!n){var r=e.length,o=i.agg=Array(r),s=0;for(;sthis.group(r(e));let s=this.state;if(!s||n){s=this.state=new Wl(e)}if(n||t.modified(s.inputs)){this.value={};t.visit(t.SOURCE,e=>o(e).add(e))}else{t.visit(t.REM,e=>o(e).remove(e));t.visit(t.ADD,e=>o(e).add(e))}for(let a=0,u=this._mlen;a0&&!r(o[n],o[n-1]))e.i0=t.left(o,o[n]);if(i0){var i=e[0],r=t[0],o=e[n]-i,s=t[n]-r,a=-1,u;while(++a<=n){u=a/n;this._basis.point(this._beta*e[a]+(1-this._beta)*(i+u*o),this._beta*t[a]+(1-this._beta)*(r+u*s))}}this._x=this._y=null;this._basis.lineEnd()},point:function(e,t){this._x.push(+e);this._y.push(+t)}};var Zf=function e(t){function n(e){return t===1?new qf(e):new Jf(e,t)}n.beta=function(t){return e(+t)};return n}(.85);function Qf(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function Kf(e,t){this._context=e;this._k=(1-t)/6}Kf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN;this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Qf(this,this._x1,this._y1);break}if(this._line||this._line!==0&&this._point===1)this._context.closePath();this._line=1-this._line},point:function(e,t){e=+e,t=+t;switch(this._point){case 0:this._point=1;this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;this._x1=e,this._y1=t;break;case 2:this._point=3;default:Qf(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e;this._y0=this._y1,this._y1=this._y2,this._y2=t}};var ed=function e(t){function n(e){return new Kf(e,t)}n.tension=function(t){return e(+t)};return n}(0);function td(e,t){this._context=e;this._k=(1-t)/6}td.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN;this._point=0},lineEnd:function(){if(this._line||this._line!==0&&this._point===3)this._context.closePath();this._line=1-this._line},point:function(e,t){e=+e,t=+t;switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Qf(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e;this._y0=this._y1,this._y1=this._y2,this._y2=t}};var nd=function e(t){function n(e){return new td(e,t)}n.tension=function(t){return e(+t)};return n}(0);function id(e,t){this._context=e;this._k=(1-t)/6}id.prototype={areaStart:Gf,areaEnd:Gf,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN;this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3);this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3);this._context.closePath();break}case 3:{this.point(this._x3,this._y3);this.point(this._x4,this._y4);this.point(this._x5,this._y5);break}}},point:function(e,t){e=+e,t=+t;switch(this._point){case 0:this._point=1;this._x3=e,this._y3=t;break;case 1:this._point=2;this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3;this._x5=e,this._y5=t;break;default:Qf(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e;this._y0=this._y1,this._y1=this._y2,this._y2=t}};var rd=function e(t){function n(e){return new id(e,t)}n.tension=function(t){return e(+t)};return n}(0);var od=Math.abs;var sd=Math.atan2;var ad=Math.cos;var ud=Math.max;var cd=Math.min;var ld=Math.sin;var fd=Math.sqrt;var dd=1e-12;var hd=Math.PI;var pd=hd/2;var gd=2*hd;function md(e){return e>1?0:e<-1?hd:Math.acos(e)}function bd(e){return e>=1?pd:e<=-1?-pd:Math.asin(e)}function vd(e,t,n){var i=e._x1,r=e._y1,o=e._x2,s=e._y2;if(e._l01_a>dd){var a=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,u=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*a-e._x0*e._l12_2a+e._x2*e._l01_2a)/u;r=(r*a-e._y0*e._l12_2a+e._y2*e._l01_2a)/u}if(e._l23_a>dd){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,l=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*c+e._x1*e._l23_2a-t*e._l12_2a)/l;s=(s*c+e._y1*e._l23_2a-n*e._l12_2a)/l}e._context.bezierCurveTo(i,r,o,s,e._x2,e._y2)}function yd(e,t){this._context=e;this._alpha=t}yd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN;this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}if(this._line||this._line!==0&&this._point===1)this._context.closePath();this._line=1-this._line},point:function(e,t){e=+e,t=+t;if(this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:vd(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a;this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a;this._x0=this._x1,this._x1=this._x2,this._x2=e;this._y0=this._y1,this._y1=this._y2,this._y2=t}};var xd=function e(t){function n(e){return t?new yd(e,t):new Kf(e,0)}n.alpha=function(t){return e(+t)};return n}(.5);function _d(e,t){this._context=e;this._alpha=t}_d.prototype={areaStart:Gf,areaEnd:Gf,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN;this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3);this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3);this._context.closePath();break}case 3:{this.point(this._x3,this._y3);this.point(this._x4,this._y4);this.point(this._x5,this._y5);break}}},point:function(e,t){e=+e,t=+t;if(this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;this._x3=e,this._y3=t;break;case 1:this._point=2;this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3;this._x5=e,this._y5=t;break;default:vd(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a;this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a;this._x0=this._x1,this._x1=this._x2,this._x2=e;this._y0=this._y1,this._y1=this._y2,this._y2=t}};var wd=function e(t){function n(e){return t?new _d(e,t):new id(e,0)}n.alpha=function(t){return e(+t)};return n}(.5);function Od(e,t){this._context=e;this._alpha=t}Od.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN;this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){if(this._line||this._line!==0&&this._point===3)this._context.closePath();this._line=1-this._line},point:function(e,t){e=+e,t=+t;if(this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:vd(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a;this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a;this._x0=this._x1,this._x1=this._x2,this._x2=e;this._y0=this._y1,this._y1=this._y2,this._y2=t}};var jd=function e(t){function n(e){return t?new Od(e,t):new td(e,0)}n.alpha=function(t){return e(+t)};return n}(.5);function kd(e){this._context=e}kd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){if(this._line||this._line!==0&&this._point===1)this._context.closePath();this._line=1-this._line},point:function(e,t){e=+e,t=+t;switch(this._point){case 0:this._point=1;this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};var Ed=function(e){return new kd(e)};function Ad(e){this._context=e}Ad.prototype={areaStart:Gf,areaEnd:Gf,lineStart:function(){this._point=0},lineEnd:function(){if(this._point)this._context.closePath()},point:function(e,t){e=+e,t=+t;if(this._point)this._context.lineTo(e,t);else this._point=1,this._context.moveTo(e,t)}};var Dd=function(e){return new Ad(e)};function Sd(e){return e<0?-1:1}function Md(e,t,n){var i=e._x1-e._x0,r=t-e._x1,o=(e._y1-e._y0)/(i||r<0&&-0),s=(n-e._y1)/(r||i<0&&-0),a=(o*r+s*i)/(i+r);return(Sd(o)+Sd(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function Cd(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function $d(e,t,n){var i=e._x0,r=e._y0,o=e._x1,s=e._y1,a=(o-i)/3;e._context.bezierCurveTo(i+a,r+a*t,o-a,s-a*n,o,s)}function Fd(e){this._context=e}Fd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN;this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:$d(this,this._t0,Cd(this,this._t0));break}if(this._line||this._line!==0&&this._point===1)this._context.closePath();this._line=1-this._line},point:function(e,t){var n=NaN;e=+e,t=+t;if(e===this._x1&&t===this._y1)return;switch(this._point){case 0:this._point=1;this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;$d(this,Cd(this,n=Md(this,e,t)),n);break;default:$d(this,this._t0,n=Md(this,e,t));break}this._x0=this._x1,this._x1=e;this._y0=this._y1,this._y1=t;this._t0=n}};function Nd(e){this._context=new Td(e)}(Nd.prototype=Object.create(Fd.prototype)).point=function(e,t){Fd.prototype.point.call(this,t,e)};function Td(e){this._context=e}Td.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,i,r,o){this._context.bezierCurveTo(t,e,i,n,o,r)}};function zd(e){return new Fd(e)}function Rd(e){return new Nd(e)}function Bd(e){this._context=e}Bd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[];this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n){this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]);if(n===2){this._context.lineTo(e[1],t[1])}else{var i=Pd(e),r=Pd(t);for(var o=0,s=1;s=0;--t)r[t]=(s[t]-r[t+1])/o[t];o[n-1]=(e[n]+r[n-1])/2;for(t=0;t=0)this._t=1-this._t,this._line=1-this._line},point:function(e,t){e=+e,t=+t;switch(this._point){case 0:this._point=1;this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0){this._context.lineTo(this._x,t);this._context.lineTo(e,t)}else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y);this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};var Ud=function(e){return new Ld(e,.5)};function qd(e){return new Ld(e,0)}function Wd(e){return new Ld(e,1)}const Gd={basis:{curve:Wf},"basis-closed":{curve:Vf},"basis-open":{curve:Xf},bundle:{curve:Zf,tension:"beta",value:.85},cardinal:{curve:ed,tension:"tension",value:0},"cardinal-open":{curve:nd,tension:"tension",value:0},"cardinal-closed":{curve:rd,tension:"tension",value:0},"catmull-rom":{curve:xd,tension:"alpha",value:.5},"catmull-rom-closed":{curve:wd,tension:"alpha",value:.5},"catmull-rom-open":{curve:jd,tension:"alpha",value:.5},linear:{curve:Ed},"linear-closed":{curve:Dd},monotone:{horizontal:Rd,vertical:zd},natural:{curve:Id},step:{curve:Ud},"step-after":{curve:Wd},"step-before":{curve:qd}};function Hd(e,t,n){var i=Object(oe["w"])(Gd,e)&&Gd[e],r=null;if(i){r=i.curve||i[t||"vertical"];if(i.tension&&n!=null){r=r[i.tension](n)}}return r}const Vd={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},Yd=[/([MLHVCSQTAZmlhvcsqtaz])/g,/###/,/(\.\d+)(\.\d)/g,/(\d)([-+])/g,/\s|,|###/];var Xd=function(e){const t=[];let n,i,r,o,s,a,u,c,l,f;const d=e.slice().replace(Yd[0],"###$1").split(Yd[1]).slice(1);for(u=0,l=d.length;ua){const e=r.length;c=1;t.push([s].concat(r.slice(c,c+=a)));s=s==="M"?"L":s==="m"?"l":s;for(;c1){g=Math.sqrt(g);n*=g;i*=g}var m=d/n;var b=f/n;var v=-f/i;var y=d/i;var x=m*a+b*u;var _=v*a+y*u;var w=m*e+b*t;var O=v*e+y*t;var j=(w-x)*(w-x)+(O-_)*(O-_);var k=1/j-.25;if(k<0)k=0;var E=Math.sqrt(k);if(o==r)E=-E;var A=.5*(x+w)-E*(O-_);var D=.5*(_+O)+E*(w-x);var S=Math.atan2(_-D,x-A);var M=Math.atan2(O-D,w-A);var C=M-S;if(C<0&&o===1){C+=Kd}else if(C>0&&o===0){C-=Kd}var $=Math.ceil(Math.abs(C/(Qd+.001)));var F=[];for(var N=0;N<$;++N){var T=S+N*C/$;var z=S+(N+1)*C/$;F[N]=[A,D,T,z,n,i,f,d]}return th[c]=F}function oh(e){var t=ih.call(e);if(nh[t]){return nh[t]}var n=e[0],i=e[1],r=e[2],o=e[3],s=e[4],a=e[5],u=e[6],c=e[7];var l=c*s;var f=-u*a;var d=u*s;var h=c*a;var p=Math.cos(r);var g=Math.sin(r);var m=Math.cos(o);var b=Math.sin(o);var v=.5*(o-r);var y=Math.sin(v*.5);var x=8/3*y*y/Math.sin(v);var _=n+p-x*g;var w=i+g+x*p;var O=n+m;var j=i+b;var k=O+x*b;var E=j-x*m;return nh[t]=[l*_+f*w,d*_+h*w,l*k+f*E,d*k+h*E,l*O+f*j,d*O+h*j]}var sh=["l",0,0,0,0,0,0,0];function ah(e,t,n){var i=sh[0]=e[0];if(i==="a"||i==="A"){sh[1]=t*e[1];sh[2]=n*e[2];sh[3]=e[3];sh[4]=e[4];sh[5]=e[5];sh[6]=t*e[6];sh[7]=n*e[7]}else if(i==="h"||i==="H"){sh[1]=t*e[1]}else if(i==="v"||i==="V"){sh[1]=n*e[1]}else{for(var r=1,o=e.length;rbh));else if(!(Math.abs(l*a-u*c)>bh)||!r){this._+="L"+(this._x1=e)+","+(this._y1=t)}else{var d=n-o,h=i-s,p=a*a+u*u,g=d*d+h*h,m=Math.sqrt(p),b=Math.sqrt(f),v=r*Math.tan((gh-Math.acos((p+f-g)/(2*m*b)))/2),y=v/b,x=v/m;if(Math.abs(y-1)>bh){this._+="L"+(e+y*c)+","+(t+y*l)}this._+="A"+r+","+r+",0,0,"+ +(l*d>c*h)+","+(this._x1=e+x*a)+","+(this._y1=t+x*u)}},arc:function(e,t,n,i,r,o){e=+e,t=+t,n=+n,o=!!o;var s=n*Math.cos(i),a=n*Math.sin(i),u=e+s,c=t+a,l=1^o,f=o?i-r:r-i;if(n<0)throw new Error("negative radius: "+n);if(this._x1===null){this._+="M"+u+","+c}else if(Math.abs(this._x1-u)>bh||Math.abs(this._y1-c)>bh){this._+="L"+u+","+c}if(!n)return;if(f<0)f=f%mh+mh;if(f>vh){this._+="A"+n+","+n+",0,1,"+l+","+(e-s)+","+(t-a)+"A"+n+","+n+",0,1,"+l+","+(this._x1=u)+","+(this._y1=c)}else if(f>bh){this._+="A"+n+","+n+",0,"+ +(f>=gh)+","+l+","+(this._x1=e+n*Math.cos(r))+","+(this._y1=t+n*Math.sin(r))}},rect:function(e,t,n,i){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}};var _h=xh;const wh=.448084975506;function Oh(e){return e.x}function jh(e){return e.y}function kh(e){return e.width}function Eh(e){return e.height}function Ah(e){return typeof e==="function"?e:()=>+e}function Dh(e,t,n){return Math.max(t,Math.min(e,n))}var Sh=function(){var e=Oh,t=jh,n=kh,i=Eh,r=Ah(0),o=r,s=r,a=r,u=null;function c(c,l,f){var d,h=l!=null?l:+e.call(this,c),p=f!=null?f:+t.call(this,c),g=+n.call(this,c),m=+i.call(this,c),b=Math.min(g,m)/2,v=Dh(+r.call(this,c),0,b),y=Dh(+o.call(this,c),0,b),x=Dh(+s.call(this,c),0,b),_=Dh(+a.call(this,c),0,b);if(!u)u=d=_h();if(v<=0&&y<=0&&x<=0&&_<=0){u.rect(h,p,g,m)}else{var w=h+g,O=p+m;u.moveTo(h+v,p);u.lineTo(w-y,p);u.bezierCurveTo(w-wh*y,p,w,p+wh*y,w,p+y);u.lineTo(w,O-_);u.bezierCurveTo(w,O-wh*_,w-wh*_,O,w-_,O);u.lineTo(h+x,O);u.bezierCurveTo(h+wh*x,O,h,O-wh*x,h,O-x);u.lineTo(h,p+v);u.bezierCurveTo(h,p+wh*v,h+wh*v,p,h+v,p);u.closePath()}if(d){u=null;return d+""||null}}c.x=function(t){if(arguments.length){e=Ah(t);return c}else{return e}};c.y=function(e){if(arguments.length){t=Ah(e);return c}else{return t}};c.width=function(e){if(arguments.length){n=Ah(e);return c}else{return n}};c.height=function(e){if(arguments.length){i=Ah(e);return c}else{return i}};c.cornerRadius=function(e,t,n,i){if(arguments.length){r=Ah(e);o=t!=null?Ah(t):r;a=n!=null?Ah(n):r;s=i!=null?Ah(i):o;return c}else{return r}};c.context=function(e){if(arguments.length){u=e==null?null:e;return c}else{return u}};return c};var Mh=function(){var e,t,n,i,r=null,o,s,a,u;function c(e,t,n){var i=n/2;if(o){var c=a-t,l=e-s;if(c||l){var f=Math.sqrt(c*c+l*l),d=(c/=f)*u,h=(l/=f)*u,p=Math.atan2(l,c);r.moveTo(s-d,a-h);r.lineTo(e-c*i,t-l*i);r.arc(e,t,i,p-Math.PI,p);r.lineTo(s+d,a+h);r.arc(s,a,u,p,p+Math.PI)}else{r.arc(e,t,i,0,Kd)}r.closePath()}else{o=1}s=e;a=t;u=i}function l(s){var a,u=s.length,l,f=false,d;if(r==null)r=d=_h();for(a=0;a<=u;++a){if(!(aM*M+C*C)j=E,k=A;return{cx:j,cy:k,x01:-l,y01:-f,x11:j*(r/_-1),y11:k*(r/_-1)}}var Ph=function(){var e=$h,t=Fh,n=Ch(0),i=null,r=Nh,o=Th,s=zh,a=null;function u(){var u,c,l=+e.apply(this,arguments),f=+t.apply(this,arguments),d=r.apply(this,arguments)-pd,h=o.apply(this,arguments)-pd,p=od(h-d),g=h>d;if(!a)a=u=_h();if(fdd))a.moveTo(0,0);else if(p>gd-dd){a.moveTo(f*ad(d),f*ld(d));a.arc(0,0,f,d,h,!g);if(l>dd){a.moveTo(l*ad(h),l*ld(h));a.arc(0,0,l,h,d,g)}}else{var m=d,b=h,v=d,y=h,x=p,_=p,w=s.apply(this,arguments)/2,O=w>dd&&(i?+i.apply(this,arguments):fd(l*l+f*f)),j=cd(od(f-l)/2,+n.apply(this,arguments)),k=j,E=j,A,D;if(O>dd){var S=bd(O/l*ld(w)),M=bd(O/f*ld(w));if((x-=S*2)>dd)S*=g?1:-1,v+=S,y-=S;else x=0,v=y=(d+h)/2;if((_-=M*2)>dd)M*=g?1:-1,m+=M,b-=M;else _=0,m=b=(d+h)/2}var C=f*ad(m),$=f*ld(m),F=l*ad(y),N=l*ld(y);if(j>dd){var T=f*ad(b),z=f*ld(b),R=l*ad(v),B=l*ld(v),P;if(pdd))a.moveTo(C,$);else if(E>dd){A=Bh(R,B,C,$,f,E,g);D=Bh(T,z,F,N,f,E,g);a.moveTo(A.cx+A.x01,A.cy+A.y01);if(Edd)||!(x>dd))a.lineTo(F,N);else if(k>dd){A=Bh(F,N,T,z,l,-k,g);D=Bh(C,$,R,B,l,-k,g);a.lineTo(A.cx+A.x01,A.cy+A.y01);if(k=l;--f){a.point(m[f],b[f])}a.lineEnd();a.areaEnd()}}if(p){m[c]=+e(h,c,u),b[c]=+t(h,c,u);a.point(i?+i(h,c,u):m[c],n?+n(h,c,u):b[c])}}if(g)return a=null,g+""||null}function c(){return Wh().defined(r).curve(s).context(o)}u.x=function(t){return arguments.length?(e=typeof t==="function"?t:Ch(+t),i=null,u):e};u.x0=function(t){return arguments.length?(e=typeof t==="function"?t:Ch(+t),u):e};u.x1=function(e){return arguments.length?(i=e==null?null:typeof e==="function"?e:Ch(+e),u):i};u.y=function(e){return arguments.length?(t=typeof e==="function"?e:Ch(+e),n=null,u):t};u.y0=function(e){return arguments.length?(t=typeof e==="function"?e:Ch(+e),u):t};u.y1=function(e){return arguments.length?(n=e==null?null:typeof e==="function"?e:Ch(+e),u):n};u.lineX0=u.lineY0=function(){return c().x(e).y(t)};u.lineY1=function(){return c().x(e).y(n)};u.lineX1=function(){return c().x(i).y(t)};u.defined=function(e){return arguments.length?(r=typeof e==="function"?e:Ch(!!e),u):r};u.curve=function(e){return arguments.length?(s=e,o!=null&&(a=s(o)),u):s};u.context=function(e){return arguments.length?(e==null?o=a=null:a=s(o=e),u):o};return u};var Hh={draw:function(e,t){var n=Math.sqrt(t/hd);e.moveTo(n,0);e.arc(0,0,n,0,gd)}};var Vh={draw:function(e,t){var n=Math.sqrt(t/5)/2;e.moveTo(-3*n,-n);e.lineTo(-n,-n);e.lineTo(-n,-3*n);e.lineTo(n,-3*n);e.lineTo(n,-n);e.lineTo(3*n,-n);e.lineTo(3*n,n);e.lineTo(n,n);e.lineTo(n,3*n);e.lineTo(-n,3*n);e.lineTo(-n,n);e.lineTo(-3*n,n);e.closePath()}};var Yh=Math.sqrt(1/3),Xh=Yh*2;var Jh={draw:function(e,t){var n=Math.sqrt(t/Xh),i=n*Yh;e.moveTo(0,-n);e.lineTo(i,0);e.lineTo(0,n);e.lineTo(-i,0);e.closePath()}};var Zh=.8908130915292852,Qh=Math.sin(hd/10)/Math.sin(7*hd/10),Kh=Math.sin(gd/10)*Qh,ep=-Math.cos(gd/10)*Qh;var tp={draw:function(e,t){var n=Math.sqrt(t*Zh),i=Kh*n,r=ep*n;e.moveTo(0,-n);e.lineTo(i,r);for(var o=1;o<5;++o){var s=gd*o/5,a=Math.cos(s),u=Math.sin(s);e.lineTo(u*n,-a*n);e.lineTo(a*i-u*r,u*i+a*r)}e.closePath()}};var np={draw:function(e,t){var n=Math.sqrt(t),i=-n/2;e.rect(i,i,n,n)}};var ip=Math.sqrt(3);var rp={draw:function(e,t){var n=-Math.sqrt(t/(ip*3));e.moveTo(0,n*2);e.lineTo(-ip*n,-n);e.lineTo(ip*n,-n);e.closePath()}};var op=-.5,sp=Math.sqrt(3)/2,ap=1/Math.sqrt(12),up=(ap/2+1)*3;var cp={draw:function(e,t){var n=Math.sqrt(t/up),i=n/2,r=n*ap,o=i,s=n*ap+n,a=-o,u=s;e.moveTo(i,r);e.lineTo(o,s);e.lineTo(a,u);e.lineTo(op*i-sp*r,sp*i+op*r);e.lineTo(op*o-sp*s,sp*o+op*s);e.lineTo(op*a-sp*u,sp*a+op*u);e.lineTo(op*i+sp*r,op*r-sp*i);e.lineTo(op*o+sp*s,op*s-sp*o);e.lineTo(op*a+sp*u,op*u-sp*a);e.closePath()}};var lp=[Hh,Vh,Jh,np,tp,rp,cp];var fp=function(e,t){var n=null;e=typeof e==="function"?e:Ch(e||Hh);t=typeof t==="function"?t:Ch(t===undefined?64:+t);function i(){var i;if(!n)n=i=_h();e.apply(this,arguments).draw(n,+t.apply(this,arguments));if(i)return n=null,i+""||null}i.type=function(t){return arguments.length?(e=typeof t==="function"?t:Ch(t),i):e};i.size=function(e){return arguments.length?(t=typeof e==="function"?e:Ch(+e),i):t};i.context=function(e){return arguments.length?(n=e==null?null:e,i):n};return i};function dp(e,t){return e!=null?e:t}const hp=e=>e.x||0,pp=e=>e.y||0,gp=e=>e.width||0,mp=e=>e.height||0,bp=e=>(e.x||0)+(e.width||0),vp=e=>(e.y||0)+(e.height||0),yp=e=>e.startAngle||0,xp=e=>e.endAngle||0,_p=e=>e.padAngle||0,wp=e=>e.innerRadius||0,Op=e=>e.outerRadius||0,jp=e=>e.cornerRadius||0,kp=e=>dp(e.cornerRadiusTopLeft,e.cornerRadius)||0,Ep=e=>dp(e.cornerRadiusTopRight,e.cornerRadius)||0,Ap=e=>dp(e.cornerRadiusBottomRight,e.cornerRadius)||0,Dp=e=>dp(e.cornerRadiusBottomLeft,e.cornerRadius)||0,Sp=e=>dp(e.size,64),Mp=e=>e.size||1,Cp=e=>!(e.defined===false),$p=e=>dh(e.shape||"circle");const Fp=Ph().startAngle(yp).endAngle(xp).padAngle(_p).innerRadius(wp).outerRadius(Op).cornerRadius(jp),Np=Gh().x(hp).y1(pp).y0(vp).defined(Cp),Tp=Gh().y(pp).x1(hp).x0(bp).defined(Cp),zp=Wh().x(hp).y(pp).defined(Cp),Rp=Sh().x(hp).y(pp).width(gp).height(mp).cornerRadius(kp,Ep,Ap,Dp),Bp=fp().type($p).size(Sp),Pp=Mh().x(hp).y(pp).defined(Cp).size(Mp);function Ip(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function Lp(e,t){return Fp.context(e)(t)}function Up(e,t){const n=t[0],i=n.interpolate||"linear";return(n.orient==="horizontal"?Tp:Np).curve(Hd(i,n.orient,n.tension)).context(e)(t)}function qp(e,t){const n=t[0],i=n.interpolate||"linear";return zp.curve(Hd(i,n.orient,n.tension)).context(e)(t)}function Wp(e,t,n,i){return Rp.context(e)(t,n,i)}function Gp(e,t){return(t.mark.shape||t.shape).context(e)(t)}function Hp(e,t){return Bp.context(e)(t)}function Vp(e,t){return Pp.context(e)(t)}var Yp=1;function Xp(){Yp=1}var Jp=function(e,t,n){var i=t.clip,r=e._defs,o=t.clip_id||(t.clip_id="clip"+Yp++),s=r.clipping[o]||(r.clipping[o]={id:o});if(Object(oe["E"])(i)){s.path=i(null)}else if(Ip(n)){s.path=Wp(null,n,0,0)}else{s.width=n.width||0;s.height=n.height||0}return"url(#"+o+")"};function Zp(e){this.clear();if(e)this.union(e)}Zp.prototype={clone(){return new Zp(this)},clear(){this.x1=+Number.MAX_VALUE;this.y1=+Number.MAX_VALUE;this.x2=-Number.MAX_VALUE;this.y2=-Number.MAX_VALUE;return this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2},set(e,t,n,i){if(nthis.x2)this.x2=e;if(t>this.y2)this.y2=t;return this},expand(e){this.x1-=e;this.y1-=e;this.x2+=e;this.y2+=e;return this},round(){this.x1=Math.floor(this.x1);this.y1=Math.floor(this.y1);this.x2=Math.ceil(this.x2);this.y2=Math.ceil(this.y2);return this},scale(e){this.x1*=e;this.y1*=e;this.x2*=e;this.y2*=e;return this},translate(e,t){this.x1+=e;this.x2+=e;this.y1+=t;this.y2+=t;return this},rotate(e,t,n){const i=this.rotatedPoints(e,t,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])},rotatedPoints(e,t,n){var{x1:i,y1:r,x2:o,y2:s}=this,a=Math.cos(e),u=Math.sin(e),c=t-t*a+n*u,l=n-t*u-n*a;return[a*i-u*r+c,u*i+a*r+l,a*i-u*s+c,u*i+a*s+l,a*o-u*r+c,u*o+a*r+l,a*o-u*s+c,u*o+a*s+l]},union(e){if(e.x1this.x2)this.x2=e.x2;if(e.y2>this.y2)this.y2=e.y2;return this},intersect(e){if(e.x1>this.x1)this.x1=e.x1;if(e.y1>this.y1)this.y1=e.y1;if(e.x2=e.x2&&this.y1<=e.y1&&this.y2>=e.y2)},alignsWith(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},intersects(e){return e&&!(this.x2e.x2||this.y2e.y2)},contains(e,t){return!(ethis.x2||tthis.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}};function Qp(e){this.mark=e;this.bounds=this.bounds||new Zp}function Kp(e){Qp.call(this,e);this.items=this.items||[]}Object(oe["z"])(Kp,Qp);function eg(e,t){if(typeof document!=="undefined"&&document.createElement){const n=document.createElement("canvas");if(n&&n.getContext){n.width=e;n.height=t;return n}}return null}const tg=()=>typeof Image!=="undefined"?Image:null;function ng(e){this._pending=0;this._loader=e||Vs()}function ig(e){e._pending+=1}function rg(e){e._pending-=1}ng.prototype={pending(){return this._pending},sanitizeURL(e){var t=this;ig(t);return t._loader.sanitize(e,{context:"href"}).then(e=>{rg(t);return e}).catch(()=>{rg(t);return null})},loadImage(e){const t=this,n=tg();ig(t);return t._loader.sanitize(e,{context:"image"}).then(e=>{const i=e.href;if(!i||!n)throw{url:i};const r=new n;const o=Object(oe["w"])(e,"crossOrigin")?e.crossOrigin:"anonymous";if(o!=null)r.crossOrigin=o;r.onload=()=>rg(t);r.onerror=()=>rg(t);r.src=i;return r}).catch(e=>{rg(t);return{complete:false,width:0,height:0,src:e&&e.url||""}})},ready(){var e=this;return new Promise(t=>{function n(i){if(!e.pending())t(i);else setTimeout(()=>{n(true)},10)}n(false)})}};var og=function(e,t,n){if(t.stroke&&t.opacity!==0&&t.strokeOpacity!==0){const i=t.strokeWidth!=null?+t.strokeWidth:1;e.expand(i+(n?sg(t,i):0))}return e};function sg(e,t){return e.strokeJoin&&e.strokeJoin!=="miter"?0:t}const ag=Kd-1e-8;let ug,cg,lg,fg,dg,hg,pg,gg;const mg=(e,t)=>ug.add(e,t);const bg=(e,t)=>mg(cg=e,lg=t);const vg=e=>mg(e,ug.y1);const yg=e=>mg(ug.x1,e);const xg=(e,t)=>dg*e+pg*t;const _g=(e,t)=>hg*e+gg*t;const wg=(e,t)=>mg(xg(e,t),_g(e,t));const Og=(e,t)=>bg(xg(e,t),_g(e,t));var jg=function(e,t){ug=e;if(t){fg=t*Jd;dg=gg=Math.cos(fg);hg=Math.sin(fg);pg=-hg}else{dg=gg=1;fg=hg=pg=0}return kg};const kg={beginPath(){},closePath(){},moveTo:Og,lineTo:Og,rect(e,t,n,i){if(fg){wg(e+n,t);wg(e+n,t+i);wg(e,t+i);Og(e,t)}else{mg(e+n,t+i);bg(e,t)}},quadraticCurveTo(e,t,n,i){const r=xg(e,t),o=_g(e,t),s=xg(n,i),a=_g(n,i);Eg(cg,r,s,vg);Eg(lg,o,a,yg);bg(s,a)},bezierCurveTo(e,t,n,i,r,o){const s=xg(e,t),a=_g(e,t),u=xg(n,i),c=_g(n,i),l=xg(r,o),f=_g(r,o);Ag(cg,s,u,l,vg);Ag(lg,a,c,f,yg);bg(l,f)},arc(e,t,n,i,r,o){i+=fg;r+=fg;cg=n*Math.cos(r)+e;lg=n*Math.sin(r)+t;if(Math.abs(r-i)>ag){mg(e-n,t-n);mg(e+n,t+n)}else{const s=i=>mg(n*Math.cos(i)+e,n*Math.sin(i)+t);let a,u;s(i);s(r);if(r!==i){i=i%Kd;if(i<0)i+=Kd;r=r%Kd;if(r<0)r+=Kd;if(rr;++u,a-=Qd)s(a)}else{a=i-i%Qd+Qd;for(u=0;u<4&&aZd){l=s*s+a*o;if(l>=0){l=Math.sqrt(l);u=(-s+l)/o;c=(-s-l)/o}}else{u=.5*a/s}if(0d)return false;else if(g>f)f=g}else if(h>0){if(g0){e.globalAlpha=n;e.fillStyle=Ig(e,t,t.fill);return true}else{return false}};var Ug=[];var qg=function(e,t,n){var i=(i=t.strokeWidth)!=null?i:1;if(i<=0)return false;n*=t.strokeOpacity==null?1:t.strokeOpacity;if(n>0){e.globalAlpha=n;e.strokeStyle=Ig(e,t,t.stroke);e.lineWidth=i;e.lineCap=t.strokeCap||"butt";e.lineJoin=t.strokeJoin||"miter";e.miterLimit=t.strokeMiterLimit||10;if(e.setLineDash){e.setLineDash(t.strokeDash||Ug);e.lineDashOffset=t.strokeDashOffset||0}return true}else{return false}};function Wg(e,t){return e.zindex-t.zindex||e.index-t.index}function Gg(e){if(!e.zdirty)return e.zitems;var t=e.items,n=[],i,r,o;for(r=0,o=t.length;r=0;){if(i=t(n[r]))return i}if(n===o){for(n=e.items,r=n.length;--r>=0;){if(!n[r].zindex){if(i=t(n[r]))return i}}}return null}function Yg(e){return function(t,n,i){Hg(n,n=>{if(!i||i.intersects(n.bounds)){Jg(e,t,n,n)}})}}function Xg(e){return function(t,n,i){if(n.items.length&&(!i||i.intersects(n.bounds))){Jg(e,t,n.items[0],n.items)}}}function Jg(e,t,n,i){var r=n.opacity==null?1:n.opacity;if(r===0)return;if(e(t,i))return;zg(t,n);if(n.fill&&Lg(t,n,r)){t.fill()}if(n.stroke&&qg(t,n,r)){t.stroke()}}function Zg(e){e=e||oe["hb"];return function(t,n,i,r,o,s){i*=t.pixelRatio;r*=t.pixelRatio;return Vg(n,n=>{var a=n.bounds;if(a&&!a.contains(o,s)||!a)return;if(e(t,n,i,r,o,s))return n})}}function Qg(e,t){return function(n,i,r,o){var s=Array.isArray(i)?i[0]:i,a=t==null?s.fill:t,u=s.stroke&&n.isPointInStroke,c,l;if(u){c=s.strokeWidth;l=s.strokeCap;n.lineWidth=c!=null?c:1;n.lineCap=l!=null?l:"butt"}return e(n,i)?false:a&&n.isPointInPath(r,o)||u&&n.isPointInStroke(r,o)}}function Kg(e){return Zg(Qg(e))}function em(e,t){return"translate("+e+","+t+")"}function tm(e){return"rotate("+e+")"}function nm(e,t){return"scale("+e+","+t+")"}function im(e){return em(e.x||0,e.y||0)}function rm(e){return em(e.x||0,e.y||0)+(e.angle?" "+tm(e.angle):"")}function om(e){return em(e.x||0,e.y||0)+(e.angle?" "+tm(e.angle):"")+(e.scaleX||e.scaleY?" "+nm(e.scaleX||1,e.scaleY||1):"")}var sm=function(e,t,n){function i(e,n){e("transform",rm(n));e("d",t(null,n))}function r(e,n){t(jg(e,n.angle),n);return og(e,n).translate(n.x||0,n.y||0)}function o(e,n){var i=n.x||0,r=n.y||0,o=n.angle||0;e.translate(i,r);if(o)e.rotate(o*=Jd);e.beginPath();t(e,n);if(o)e.rotate(-o);e.translate(-i,-r)}return{type:e,tag:"path",nested:false,attr:i,bound:r,draw:Yg(o),pick:Kg(o),isect:n||Cg(o)}};var am=sm("arc",Lp);function um(e,t){var n=e[0].orient==="horizontal"?t[1]:t[0],i=e[0].orient==="horizontal"?"y":"x",r=e.length,o=+Infinity,s,a;while(--r>=0){if(e[r].defined===false)continue;a=Math.abs(e[r][i]-n);if(a=0){if(e[i].defined===false)continue;r=e[i].x-t[0];o=e[i].y-t[1];s=r*r+o*o;if(s=0){if(e[n].defined===false)continue;i=e[n].x-t[0];r=e[n].y-t[1];o=i*i+r*r;i=e[n].size||1;if(o.5&&t<1.5?.5-Math.abs(t-1):0}function mm(e,t){e("transform",im(t))}function bm(e,t){const n=gm(t);e("d",Wp(null,t,n,n))}function vm(e,t){e("class","background");e("aria-hidden",true);bm(e,t)}function ym(e,t){e("class","foreground");e("aria-hidden",true);if(t.strokeForeground){bm(e,t)}else{e("d","")}}function xm(e,t,n){const i=t.clip?Jp(n,t,t):null;e("clip-path",i)}function _m(e,t){if(!t.clip&&t.items){const n=t.items,i=n.length;for(let t=0;t{const i=t.x||0,r=t.y||0,o=t.strokeForeground,s=t.opacity==null?1:t.opacity;if((t.stroke||t.fill)&&s){wm(e,t,i,r);zg(e,t);if(t.fill&&Lg(e,t,s)){e.fill()}if(t.stroke&&!o&&qg(e,t,s)){e.stroke()}}e.save();e.translate(i,r);if(t.clip)pm(e,t);if(n)n.translate(-i,-r);Hg(t,t=>{this.draw(e,t,n)});if(n)n.translate(i,r);e.restore();if(o&&t.stroke&&s){wm(e,t,i,r);zg(e,t);if(qg(e,t,s)){e.stroke()}}})}function Am(e,t,n,i,r,o){if(t.bounds&&!t.bounds.contains(r,o)||!t.items){return null}const s=n*e.pixelRatio,a=i*e.pixelRatio;return Vg(t,u=>{let c,l,f;const d=u.bounds;if(d&&!d.contains(r,o))return;l=u.x||0;f=u.y||0;const h=l+(u.width||0),p=f+(u.height||0),g=u.clip;if(g&&(rh||op))return;e.save();e.translate(l,f);l=r-l;f=o-f;if(g&&Ip(u)&&!km(e,u,s,a)){e.restore();return null}const m=u.strokeForeground,b=t.interactive!==false;if(b&&m&&u.stroke&&jm(e,u,s,a)){e.restore();return u}c=Vg(u,e=>Dm(e,l,f)?this.pick(e,n,i,l,f):null);if(!c&&b&&(u.fill||!m&&u.stroke)&&Om(e,u,s,a)){c=u}e.restore();return c||null})}function Dm(e,t,n){return(e.interactive!==false||e.marktype==="group")&&e.bounds&&e.bounds.contains(t,n)}var Sm={type:"group",tag:"g",nested:false,attr:mm,bound:_m,draw:Em,pick:Am,isect:Fg,content:xm,background:vm,foreground:ym};var Mm={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function Cm(e,t){var n=e.image;if(!n||e.url&&e.url!==n.url){n={complete:false,width:0,height:0};t.loadImage(e.url).then(t=>{e.image=t;e.image.url=e.url})}return n}function $m(e,t){return e.width!=null?e.width:!t||!t.width?0:e.aspect!==false&&e.height?e.height*t.width/t.height:t.width}function Fm(e,t){return e.height!=null?e.height:!t||!t.height?0:e.aspect!==false&&e.width?e.width*t.height/t.width:t.height}function Nm(e,t){return e==="center"?t/2:e==="right"?t:0}function Tm(e,t){return e==="middle"?t/2:e==="bottom"?t:0}function zm(e,t,n){const i=Cm(t,n),r=$m(t,i),o=Fm(t,i),s=(t.x||0)-Nm(t.align,r),a=(t.y||0)-Tm(t.baseline,o),u=!i.src&&i.toDataURL?i.toDataURL():i.src||"";e("href",u,Mm["xmlns:xlink"],"xlink:href");e("transform",em(s,a));e("width",r);e("height",o);e("preserveAspectRatio",t.aspect===false?"none":"xMidYMid")}function Rm(e,t){const n=t.image,i=$m(t,n),r=Fm(t,n),o=(t.x||0)-Nm(t.align,i),s=(t.y||0)-Tm(t.baseline,r);return e.set(o,s,o+i,s+r)}function Bm(e,t,n){Hg(t,t=>{if(n&&!n.intersects(t.bounds))return;const i=Cm(t,this);let r=$m(t,i),o=Fm(t,i),s=(t.x||0)-Nm(t.align,r),a=(t.y||0)-Tm(t.baseline,o),u,c,l,f;if(t.aspect!==false){c=i.width/i.height;l=t.width/t.height;if(c===c&&l===l&&c!==l){if(l{if(n&&!n.intersects(t.bounds))return;var i=t.opacity==null?1:t.opacity;if(i&&Zm(e,t,i)){zg(e,t);e.stroke()}})}function Km(e,t,n,i){if(!e.isPointInStroke)return false;return Zm(e,t,1)&&e.isPointInStroke(n,i)}var eb={type:"rule",tag:"line",nested:false,attr:Xm,bound:Jm,draw:Qm,pick:Zg(Km),isect:Ng};var tb=sm("shape",Gp);var nb=sm("symbol",Hp,$g);const ib=Object(oe["M"])();var rb={height:lb,measureWidth:ub,estimateWidth:sb,width:sb,canvas:ob};ob(true);function ob(e){rb.width=e&&Sg?ub:sb}function sb(e,t){return ab(gb(e,t),lb(e))}function ab(e,t){return~~(.8*e.length*t)}function ub(e,t){return lb(e)<=0||!(t=gb(e,t))?0:cb(t,yb(e))}function cb(e,t){const n=`(${t}) ${e}`;let i=ib.get(n);if(i===undefined){Sg.font=t;i=Sg.measureText(e).width;ib.set(n,i)}return i}function lb(e){return e.fontSize!=null?+e.fontSize||0:11}function fb(e){return e.lineHeight!=null?e.lineHeight:lb(e)+2}function db(e){return Object(oe["B"])(e)?e.length>1?e:e[0]:e}function hb(e){return db(e.lineBreak&&e.text&&!Object(oe["B"])(e.text)?e.text.split(e.lineBreak):e.text)}function pb(e){const t=hb(e);return(Object(oe["B"])(t)?t.length-1:0)*fb(e)}function gb(e,t){const n=t==null?"":(t+"").trim();return e.limit>0&&n.length?bb(e,n):n}function mb(e){if(rb.width===ub){const t=yb(e);return e=>cb(e,t)}else{const t=lb(e);return e=>ab(e,t)}}function bb(e,t){var n=+e.limit,i=mb(e);if(i(t)>>1;if(i(t.slice(u))>n)s=u+1;else a=u}return r+t.slice(s)}else{while(s>>1);if(i(t.slice(0,u))Math.max(e,rb.width(t,n)),0)}else{f=rb.width(t,l)}if(r==="center"){u-=f/2}else if(r==="right"){u-=f}else{}e.set(u+=s,c+=a,u+f,c+i);if(t.angle&&!n){e.rotate(t.angle*Jd,s,a)}else if(n===2){return e.rotatedPoints(t.angle*Jd,s,a)}return e}function Eb(e,t,n){Hg(t,t=>{var i=t.opacity==null?1:t.opacity,r,o,s,a,u,c,l;if(n&&!n.intersects(t.bounds)||i===0||t.fontSize<=0||t.text==null||t.text.length===0)return;e.font=yb(t);e.textAlign=t.align||"left";r=Ob(t);o=r.x1,s=r.y1;if(t.angle){e.save();e.translate(o,s);e.rotate(t.angle*Jd);o=s=0}o+=t.dx||0;s+=(t.dy||0)+xb(t);c=hb(t);zg(e,t);if(Object(oe["B"])(c)){u=fb(t);for(a=0;at)e.removeChild(n[--i]);return e}function Gb(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}var Hb=function(e,t){var n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]};var Vb=function(e,t,n,i){var r=e&&e.mark,o,s;if(r&&(o=Cb[r.marktype]).tip){s=Hb(t,n);s[0]-=i[0];s[1]-=i[1];while(e=e.mark.group){s[0]-=e.x||0;s[1]-=e.y||0}e=o.tip(r.items,s)}return e};function Yb(e,t){this._active=null;this._handlers={};this._loader=e||Vs();this._tooltip=t||Xb}function Xb(e,t,n,i){e.element().setAttribute("title",i||"")}Yb.prototype={initialize(e,t,n){this._el=e;this._obj=n||null;return this.origin(t)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},origin(e){if(arguments.length){this._origin=e||[0,0];return this}else{return this._origin.slice()}},scene(e){if(!arguments.length)return this._scene;this._scene=e;return this},on(){},off(){},_handlerIndex(e,t,n){for(let i=e?e.length:0;--i>=0;){if(e[i].type===t&&(!n||e[i].handler===n)){return i}}return-1},handlers(e){const t=this._handlers,n=[];if(e){n.push.apply(n,t[this.eventName(e)])}else{for(const e in t){n.push.apply(n,t[e])}}return n},eventName(e){const t=e.indexOf(".");return t<0?e:e.slice(0,t)},handleHref(e,t,n){this._loader.sanitize(n,{context:"href"}).then(t=>{const n=new MouseEvent(e.type,e),i=Lb(null,"a");for(const e in t)i.setAttribute(e,t[e]);i.dispatchEvent(n)}).catch(()=>{})},handleTooltip(e,t,n){if(t&&t.tooltip!=null){t=Vb(t,e,this.canvas(),this._origin);const i=n&&t&&t.tooltip||null;this._tooltip.call(this._obj,this,e,t,i)}},getItemBoundingClientRect(e){const t=this.canvas();if(!t)return;const n=t.getBoundingClientRect(),i=this._origin,r=e.bounds,o=r.width(),s=r.height();let a=r.x1+i[0]+n.left,u=r.y1+i[1]+n.top;while(e.mark&&(e=e.mark.group)){a+=e.x||0;u+=e.y||0}return{x:a,y:u,width:o,height:s,left:a,top:u,right:a+o,bottom:u+s}}};function Jb(e){this._el=null;this._bgcolor=null;this._loader=new ng(e)}Jb.prototype={initialize(e,t,n,i,r){this._el=e;return this.resize(t,n,i,r)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},background(e){if(arguments.length===0)return this._bgcolor;this._bgcolor=e;return this},resize(e,t,n,i){this._width=e;this._height=t;this._origin=n||[0,0];this._scale=i||1;return this},dirty(){},render(e){var t=this;t._call=function(){t._render(e)};t._call();t._call=null;return t},_render(){},renderAsync(e){var t=this.render(e);return this._ready?this._ready.then(()=>t):Promise.resolve(t)},_load(e,t){var n=this,i=n._loader[e](t);if(!n._ready){var r=n._call;n._ready=n._loader.ready().then(e=>{if(e)r();n._ready=null})}return i},sanitizeURL(e){return this._load("sanitizeURL",e)},loadImage(e){return this._load("loadImage",e)}};const Zb="keydown";const Qb="keypress";const Kb="keyup";const ev="dragenter";const tv="dragleave";const nv="dragover";const iv="mousedown";const rv="mouseup";const ov="mousemove";const sv="mouseout";const av="mouseover";const uv="click";const cv="dblclick";const lv="wheel";const fv="mousewheel";const dv="touchstart";const hv="touchmove";const pv="touchend";const gv=[Zb,Qb,Kb,ev,tv,nv,iv,rv,ov,sv,av,uv,cv,lv,fv,dv,hv,pv];const mv=ov;const bv=sv;const vv=uv;function yv(e,t){Yb.call(this,e,t);this._down=null;this._touch=null;this._first=true;this._events={}}const xv=e=>e===dv||e===hv||e===pv?[dv,hv,pv]:[e];function _v(e,t){xv(t).forEach(t=>wv(e,t))}function wv(e,t){const n=e.canvas();if(n&&!e._events[t]){e._events[t]=1;n.addEventListener(t,e[t]?n=>e[t](n):n=>e.fire(t,n))}}function Ov(e,t,n){return function(i){const r=this._active,o=this.pickEvent(i);if(o===r){this.fire(e,i)}else{if(!r||!r.exit){this.fire(n,i)}this._active=o;this.fire(t,i);this.fire(e,i)}}}function jv(e){return function(t){this.fire(e,t);this._active=null}}Object(oe["z"])(yv,Yb,{initialize(e,t,n){this._canvas=e&&Ub(e,"canvas");[uv,iv,ov,sv,tv].forEach(e=>_v(this,e));return Yb.prototype.initialize.call(this,e,t,n)},canvas(){return this._canvas},context(){return this._canvas.getContext("2d")},events:gv,DOMMouseScroll(e){this.fire(fv,e)},mousemove:Ov(ov,av,sv),dragover:Ov(nv,ev,tv),mouseout:jv(sv),dragleave:jv(tv),mousedown(e){this._down=this._active;this.fire(iv,e)},click(e){if(this._down===this._active){this.fire(uv,e);this._down=null}},touchstart(e){this._touch=this.pickEvent(e.changedTouches[0]);if(this._first){this._active=this._touch;this._first=false}this.fire(dv,e,true)},touchmove(e){this.fire(hv,e,true)},touchend(e){this.fire(pv,e,true);this._touch=null},fire(e,t,n){const i=n?this._touch:this._active,r=this._handlers[e];t.vegaType=e;if(e===vv&&i&&i.href){this.handleHref(t,i,i.href)}else if(e===mv||e===bv){this.handleTooltip(t,i,e!==bv)}if(r){for(let e=0,n=r.length;e=0){i.splice(r,1)}return this},pickEvent(e){const t=Hb(e,this._canvas),n=this._origin;return this.pick(this._scene,t[0],t[1],t[0]-n[0],t[1]-n[1])},pick(e,t,n,i,r){const o=this.context(),s=Cb[e.marktype];return s.pick.call(this,o,e,t,n,i,r)}});function kv(){return typeof window!=="undefined"?window.devicePixelRatio||1:1}var Ev=kv();var Av=function(e,t,n,i,r,o){const s=typeof HTMLElement!=="undefined"&&e instanceof HTMLElement&&e.parentNode!=null,a=e.getContext("2d"),u=s?Ev:r;e.width=t*u;e.height=n*u;for(const c in o){a[c]=o[c]}if(s&&u!==1){e.style.width=t+"px";e.style.height=n+"px"}a.pixelRatio=u;a.setTransform(u,0,0,u,u*i[0],u*i[1]);return e};function Dv(e){Jb.call(this,e);this._options={};this._redraw=false;this._dirty=new Zp;this._tempb=new Zp}const Sv=Jb.prototype;const Mv=(e,t,n)=>(new Zp).set(0,0,t,n).translate(-e[0],-e[1]);function Cv(e,t,n){t.expand(1).round();if(e.pixelRatio%1){t.scale(e.pixelRatio).round().scale(1/e.pixelRatio)}t.translate(-(n[0]%1),-(n[1]%1));e.beginPath();e.rect(t.x1,t.y1,t.width(),t.height());e.clip();return t}Object(oe["z"])(Dv,Jb,{initialize(e,t,n,i,r,o){this._options=o||{};this._canvas=this._options.externalContext?null:eg(1,1,this._options.type);if(e&&this._canvas){Wb(e,0).appendChild(this._canvas);this._canvas.setAttribute("class","marks")}return Sv.initialize.call(this,e,t,n,i,r)},resize(e,t,n,i){Sv.resize.call(this,e,t,n,i);if(this._canvas){Av(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context)}else{const e=this._options.externalContext;if(!e)Object(oe["o"])("CanvasRenderer is missing a valid canvas or context");e.scale(this._scale,this._scale);e.translate(this._origin[0],this._origin[1])}this._redraw=true;return this},canvas(){return this._canvas},context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)},dirty(e){const t=this._tempb.clear().union(e.bounds);let n=e.mark.group;while(n){t.translate(n.x||0,n.y||0);n=n.mark.group}this._dirty.union(t)},_render(e){const t=this.context(),n=this._origin,i=this._width,r=this._height,o=this._dirty,s=Mv(n,i,r);t.save();const a=this._redraw||o.empty()?(this._redraw=false,s.expand(1)):Cv(t,s.intersect(o),n);this.clear(-n[0],-n[1],i,r);this.draw(t,e,a);t.restore();o.clear();return this},draw(e,t,n){const i=Cb[t.marktype];if(t.clip)hm(e,t);i.draw.call(this,e,t,n);if(t.clip)e.restore()},clear(e,t,n,i){const r=this._options,o=this.context();if(r.type!=="pdf"&&!r.externalContext){o.clearRect(e,t,n,i)}if(this._bgcolor!=null){o.fillStyle=this._bgcolor;o.fillRect(e,t,n,i)}}});function $v(e,t){Yb.call(this,e,t);const n=this;n._hrefHandler=Fv(n,(e,t)=>{if(t&&t.href)n.handleHref(e,t,t.href)});n._tooltipHandler=Fv(n,(e,t)=>{n.handleTooltip(e,t,e.type!==bv)})}const Fv=(e,t)=>n=>{let i=n.target.__data__;i=Array.isArray(i)?i[0]:i;n.vegaType=n.type;t.call(e._obj,n,i)};Object(oe["z"])($v,Yb,{initialize(e,t,n){let i=this._svg;if(i){i.removeEventListener(vv,this._hrefHandler);i.removeEventListener(mv,this._tooltipHandler);i.removeEventListener(bv,this._tooltipHandler)}this._svg=i=e&&Ub(e,"svg");if(i){i.addEventListener(vv,this._hrefHandler);i.addEventListener(mv,this._tooltipHandler);i.addEventListener(bv,this._tooltipHandler)}return Yb.prototype.initialize.call(this,e,t,n)},canvas(){return this._svg},on(e,t){const n=this.eventName(e),i=this._handlers,r=this._handlerIndex(i[n],e,t);if(r<0){const r={type:e,handler:t,listener:Fv(this,t)};(i[n]||(i[n]=[])).push(r);if(this._svg){this._svg.addEventListener(n,r.listener)}}return this},off(e,t){const n=this.eventName(e),i=this._handlers[n],r=this._handlerIndex(i,e,t);if(r>=0){if(this._svg){this._svg.removeEventListener(n,i[r].listener)}i.splice(r,1)}return this}});var Nv=function(e,t,n){const i=e-t+n*2;return e?i>0?i:1:0};const Tv="identity";const zv="linear";const Rv="log";const Bv="pow";const Pv="sqrt";const Iv="symlog";const Lv="time";const Uv="utc";const qv="sequential";const Wv="diverging";const Gv="quantile";const Hv="quantize";const Vv="threshold";const Yv="ordinal";const Xv="point";const Jv="band";const Zv="bin-ordinal";const Qv="continuous";const Kv="discrete";const ey="discretizing";const ty="interpolating";const ny="temporal";var iy=function(e){return function(t){let n=t[0],i=t[1],r;if(i=i&&n[u]<=r){if(o<0)o=u;s=u}}if(o<0)return undefined;i=e.invertExtent(n[o]);r=e.invertExtent(n[s]);return[i[0]===undefined?i[1]:i[0],r[1]===undefined?r[0]:r[1]]}};const oy=Ur(Lr);const sy=oy.right;const ay=oy.left;const uy=Ur(lu).center;var cy=sy;function ly(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function fy(e,t){switch(arguments.length){case 0:break;case 1:{if(typeof e==="function")this.interpolator(e);else this.range(e);break}default:{this.domain(e);if(typeof t==="function")this.interpolator(t);else this.range(t);break}}return this}const dy=Symbol("implicit");function hy(){var e=new Map,t=[],n=[],i=dy;function r(r){var o=r+"",s=e.get(o);if(!s){if(i!==dy)return i;e.set(o,s=t.push(r))}return n[(s-1)%n.length]}r.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new Map;for(const i of n){const n=i+"";if(e.has(n))continue;e.set(n,t.push(i))}return r};r.range=function(e){return arguments.length?(n=Array.from(e),r):n.slice()};r.unknown=function(e){return arguments.length?(i=e,r):i};r.copy=function(){return hy(t,n).unknown(i)};ly.apply(r,arguments);return r}function py(){const e=hy().unknown(undefined),t=e.domain,n=e.range;let i=[0,1],r,o,s=false,a=0,u=0,c=.5;delete e.unknown;function l(){const e=t().length,l=i[1]h+r*e);return n(l?p.reverse():p)}e.domain=function(e){if(arguments.length){t(e);return l()}else{return t()}};e.range=function(e){if(arguments.length){i=[+e[0],+e[1]];return l()}else{return i.slice()}};e.rangeRound=function(e){i=[+e[0],+e[1]];s=true;return l()};e.bandwidth=function(){return o};e.step=function(){return r};e.round=function(e){if(arguments.length){s=!!e;return l()}else{return s}};e.padding=function(e){if(arguments.length){u=Math.max(0,Math.min(1,e));a=u;return l()}else{return a}};e.paddingInner=function(e){if(arguments.length){a=Math.max(0,Math.min(1,e));return l()}else{return a}};e.paddingOuter=function(e){if(arguments.length){u=Math.max(0,Math.min(1,e));return l()}else{return u}};e.align=function(e){if(arguments.length){c=Math.max(0,Math.min(1,e));return l()}else{return c}};e.invertRange=function(e){if(e[0]==null||e[1]==null)return;const r=i[1]i[1-r])return;l=Math.max(0,sy(s,u)-1);f=u===c?l:sy(s,c)-1;if(u-s[l]>o+1e-10)++l;if(r){d=l;l=a-f;f=a-d}return l>f?undefined:t().slice(l,f+1)};e.invert=function(t){const n=e.invertRange([t,t]);return n?n[0]:n};e.copy=function(){return py().domain(t()).range(i).round(s).paddingInner(a).paddingOuter(u).align(c)};return l()}function gy(e){const t=e.copy;e.padding=e.paddingOuter;delete e.paddingInner;e.copy=function(){return gy(t())};return e}function my(){return gy(py().paddingInner(1))}var by=function(e,t,n,i){var r=Vt(e,t,n),o;i=Xt(i==null?",f":i);switch(i.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));if(i.precision==null&&!isNaN(o=en(r,s)))i.precision=o;return bn(i,s)}case"":case"e":case"g":case"p":case"r":{if(i.precision==null&&!isNaN(o=tn(r,Math.max(Math.abs(e),Math.abs(t)))))i.precision=o-(i.type==="e");break}case"f":case"%":{if(i.precision==null&&!isNaN(o=nn(r)))i.precision=o-(i.type==="%")*2;break}}return mn(i)};var vy=Array.prototype.map;function yy(e){return vy.call(e,oe["db"])}const xy=Array.prototype.slice;function _y(){let e=[],t=[];function n(n){return n==null||n!==n?undefined:t[(cy(e,n)-1)%t.length]}n.domain=function(t){if(arguments.length){e=yy(t);return n}else{return e.slice()}};n.range=function(e){if(arguments.length){t=xy.call(e);return n}else{return t.slice()}};n.tickFormat=function(t,n){return by(e[0],Object(oe["V"])(e),t==null?10:t,n)};n.copy=function(){return _y().domain(n.domain()).range(n.range())};return n}var wy=function(e,t,n){e.prototype=t.prototype=n;n.constructor=e};function Oy(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function jy(){}var ky=.7;var Ey=1/ky;var Ay="\\s*([+-]?\\d+)\\s*",Dy="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Sy="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",My=/^#([0-9a-f]{3,8})$/,Cy=new RegExp("^rgb\\("+[Ay,Ay,Ay]+"\\)$"),$y=new RegExp("^rgb\\("+[Sy,Sy,Sy]+"\\)$"),Fy=new RegExp("^rgba\\("+[Ay,Ay,Ay,Dy]+"\\)$"),Ny=new RegExp("^rgba\\("+[Sy,Sy,Sy,Dy]+"\\)$"),Ty=new RegExp("^hsl\\("+[Dy,Sy,Sy]+"\\)$"),zy=new RegExp("^hsla\\("+[Dy,Sy,Sy,Dy]+"\\)$");var Ry={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};wy(jy,Ly,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:By,formatHex:By,formatHsl:Py,formatRgb:Iy,toString:Iy});function By(){return this.rgb().formatHex()}function Py(){return Zy(this).formatHsl()}function Iy(){return this.rgb().formatRgb()}function Ly(e){var t,n;e=(e+"").trim().toLowerCase();return(t=My.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Uy(t):n===3?new Hy(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?qy(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?qy(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Cy.exec(e))?new Hy(t[1],t[2],t[3],1):(t=$y.exec(e))?new Hy(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Fy.exec(e))?qy(t[1],t[2],t[3],t[4]):(t=Ny.exec(e))?qy(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Ty.exec(e))?Jy(t[1],t[2]/100,t[3]/100,1):(t=zy.exec(e))?Jy(t[1],t[2]/100,t[3]/100,t[4]):Ry.hasOwnProperty(e)?Uy(Ry[e]):e==="transparent"?new Hy(NaN,NaN,NaN,0):null}function Uy(e){return new Hy(e>>16&255,e>>8&255,e&255,1)}function qy(e,t,n,i){if(i<=0)e=t=n=NaN;return new Hy(e,t,n,i)}function Wy(e){if(!(e instanceof jy))e=Ly(e);if(!e)return new Hy;e=e.rgb();return new Hy(e.r,e.g,e.b,e.opacity)}function Gy(e,t,n,i){return arguments.length===1?Wy(e):new Hy(e,t,n,i==null?1:i)}function Hy(e,t,n,i){this.r=+e;this.g=+t;this.b=+n;this.opacity=+i}wy(Hy,Gy,Oy(jy,{brighter:function(e){e=e==null?Ey:Math.pow(Ey,e);return new Hy(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){e=e==null?ky:Math.pow(ky,e);return new Hy(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&(-.5<=this.g&&this.g<255.5)&&(-.5<=this.b&&this.b<255.5)&&(0<=this.opacity&&this.opacity<=1)},hex:Vy,formatHex:Vy,formatRgb:Yy,toString:Yy}));function Vy(){return"#"+Xy(this.r)+Xy(this.g)+Xy(this.b)}function Yy(){var e=this.opacity;e=isNaN(e)?1:Math.max(0,Math.min(1,e));return(e===1?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(e===1?")":", "+e+")")}function Xy(e){e=Math.max(0,Math.min(255,Math.round(e)||0));return(e<16?"0":"")+e.toString(16)}function Jy(e,t,n,i){if(i<=0)e=t=n=NaN;else if(n<=0||n>=1)e=t=NaN;else if(t<=0)e=NaN;return new Ky(e,t,n,i)}function Zy(e){if(e instanceof Ky)return new Ky(e.h,e.s,e.l,e.opacity);if(!(e instanceof jy))e=Ly(e);if(!e)return new Ky;if(e instanceof Ky)return e;e=e.rgb();var t=e.r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),o=Math.max(t,n,i),s=NaN,a=o-r,u=(o+r)/2;if(a){if(t===o)s=(n-i)/a+(n0&&u<1?0:s}return new Ky(s,a,u,e.opacity)}function Qy(e,t,n,i){return arguments.length===1?Zy(e):new Ky(e,t,n,i==null?1:i)}function Ky(e,t,n,i){this.h=+e;this.s=+t;this.l=+n;this.opacity=+i}wy(Ky,Qy,Oy(jy,{brighter:function(e){e=e==null?Ey:Math.pow(Ey,e);return new Ky(this.h,this.s,this.l*e,this.opacity)},darker:function(e){e=e==null?ky:Math.pow(ky,e);return new Ky(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new Hy(ex(e>=240?e-240:e+120,r,i),ex(e,r,i),ex(e<120?e+240:e-120,r,i),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&(0<=this.l&&this.l<=1)&&(0<=this.opacity&&this.opacity<=1)},formatHsl:function(){var e=this.opacity;e=isNaN(e)?1:Math.max(0,Math.min(1,e));return(e===1?"hsl(":"hsla(")+(this.h||0)+", "+(this.s||0)*100+"%, "+(this.l||0)*100+"%"+(e===1?")":", "+e+")")}}));function ex(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}function tx(e,t,n,i,r){var o=e*e,s=o*e;return((1-3*e+3*o-s)*t+(4-6*o+3*s)*n+(1+3*e+3*o-3*s)*i+s*r)/6}var nx=function(e){var t=e.length-1;return function(n){var i=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),r=e[i],o=e[i+1],s=i>0?e[i-1]:2*r-o,a=i()=>e;function ox(e,t){return function(n){return e+n*t}}function sx(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}function ax(e,t){var n=t-e;return n?ox(e,n>180||n<-180?n-360*Math.round(n/360):n):rx(isNaN(e)?t:e)}function ux(e){return(e=+e)===1?cx:function(t,n){return n-t?sx(t,n,e):rx(isNaN(t)?n:t)}}function cx(e,t){var n=t-e;return n?ox(e,n):rx(isNaN(e)?t:e)}var lx=function e(t){var n=ux(t);function i(e,t){var i=n((e=Gy(e)).r,(t=Gy(t)).r),r=n(e.g,t.g),o=n(e.b,t.b),s=cx(e.opacity,t.opacity);return function(t){e.r=i(t);e.g=r(t);e.b=o(t);e.opacity=s(t);return e+""}}i.gamma=e;return i}(1);function fx(e){return function(t){var n=t.length,i=new Array(n),r=new Array(n),o=new Array(n),s,a;for(s=0;sn){o=t.slice(n,o);if(a[s])a[s]+=o;else a[++s]=o}if((i=i[0])===(r=r[0])){if(a[s])a[s]+=r;else a[++s]=r}else{a[++s]=null;u.push({i:s,x:yx(i,r)})}n=wx.lastIndex}if(nt)n=e,e=t,t=n;return function(n){return Math.max(e,Math.min(t,n))}}function Nx(e,t,n){var i=e[0],r=e[1],o=t[0],s=t[1];if(r2?Tx:Nx;u=c=null;return f}function f(r){return isNaN(r=+r)?o:(u||(u=a(e.map(i),t,n)))(i(s(r)))}f.invert=function(n){return s(r((c||(c=a(t,e.map(i),yx)))(n)))};f.domain=function(t){return arguments.length?(e=Array.from(t,Sx),l()):e.slice()};f.range=function(e){return arguments.length?(t=Array.from(e),l()):t.slice()};f.rangeRound=function(e){return t=Array.from(e),n=Ax,l()};f.clamp=function(e){return arguments.length?(s=e?true:Cx,l()):s!==Cx};f.interpolate=function(e){return arguments.length?(n=e,l()):n};f.unknown=function(e){return arguments.length?(o=e,f):o};return function(e,t){i=e,r=t;return l()}}function Bx(){return Rx()(Cx,Cx)}function Px(e){var t=e.domain;e.ticks=function(e){var n=t();return Gt(n[0],n[n.length-1],e==null?10:e)};e.tickFormat=function(e,n){var i=t();return by(i[0],i[i.length-1],e==null?10:e,n)};e.nice=function(n){if(n==null)n=10;var i=t();var r=0;var o=i.length-1;var s=i[r];var a=i[o];var u;var c;var l=10;if(a0){c=Ht(s,a,n);if(c===u){i[r]=s;i[o]=a;return t(i)}else if(c>0){s=Math.floor(s/c)*c;a=Math.ceil(a/c)*c}else if(c<0){s=Math.ceil(s*c)/c;a=Math.floor(a*c)/c}else{break}u=c}return e};return e}function Ix(){var e=Bx();e.copy=function(){return zx(e,Ix())};ly.apply(e,arguments);return Px(e)}function Lx(e){var t;function n(e){return isNaN(e=+e)?t:e}n.invert=n;n.domain=n.range=function(t){return arguments.length?(e=Array.from(t,Sx),n):e.slice()};n.unknown=function(e){return arguments.length?(t=e,n):t};n.copy=function(){return Lx(e).unknown(t)};e=arguments.length?Array.from(e,Sx):[0,1];return Px(n)}var Ux=function(e,t){e=e.slice();var n=0,i=e.length-1,r=e[n],o=e[i],s;if(o0)for(;c<=l;++c){for(d=1,f=o(c);da)break;g.push(h)}}else for(;c<=l;++c){for(d=i-1,f=o(c);d>=1;--d){h=f*d;if(ha)break;g.push(h)}}if(g.length*20?n[r-1]:e[0],r=n?[i[n-1],t]:[i[s-1],i[s]]};s.unknown=function(e){return arguments.length?(o=e,s):s};s.thresholds=function(){return i.slice()};s.copy=function(){return z_().domain([e,t]).range(r).unknown(o)};return ly.apply(Px(s),arguments)}function R_(){var e=[.5],t=[0,1],n,i=1;function r(r){return r<=r?t[cy(e,r,0,i)]:n}r.domain=function(n){return arguments.length?(e=Array.from(n),i=Math.min(e.length,t.length-1),r):e.slice()};r.range=function(n){return arguments.length?(t=Array.from(n),i=Math.min(e.length,t.length-1),r):t.slice()};r.invertExtent=function(n){var i=t.indexOf(n);return[e[i-1],e[i]]};r.unknown=function(e){return arguments.length?(n=e,r):n};r.copy=function(){return R_().domain(e).range(t).unknown(n)};return ly.apply(r,arguments)}const B_={};function P_(e,t,n){const i=function n(){const i=t();if(!i.invertRange){i.invertRange=i.invert?iy(i):i.invertExtent?ry(i):undefined}i.type=e;return i};i.metadata=Object(oe["eb"])(Object(oe["i"])(n));return i}function I_(e,t,n){if(arguments.length>1){B_[e]=P_(e,t,n);return this}else{return L_(e)?B_[e]:undefined}}I_(Tv,Lx);I_(zv,Ix,Qv);I_(Rv,Qx,[Qv,Rv]);I_(Bv,i_,Qv);I_(Pv,r_,Qv);I_(Iv,u_,Qv);I_(Lv,y_,[Qv,ny]);I_(Uv,x_,[Qv,ny]);I_(qv,O_,[Qv,ty]);I_(`${qv}-${zv}`,O_,[Qv,ty]);I_(`${qv}-${Rv}`,j_,[Qv,ty,Rv]);I_(`${qv}-${Bv}`,E_,[Qv,ty]);I_(`${qv}-${Pv}`,A_,[Qv,ty]);I_(`${qv}-${Iv}`,k_,[Qv,ty]);I_(`${Wv}-${zv}`,M_,[Qv,ty]);I_(`${Wv}-${Rv}`,C_,[Qv,ty,Rv]);I_(`${Wv}-${Bv}`,F_,[Qv,ty]);I_(`${Wv}-${Pv}`,N_,[Qv,ty]);I_(`${Wv}-${Iv}`,$_,[Qv,ty]);I_(Gv,T_,[ey,Gv]);I_(Hv,z_,ey);I_(Vv,R_,ey);I_(Zv,_y,[Kv,ey]);I_(Yv,hy,Kv);I_(Jv,py,Kv);I_(Xv,my,Kv);function L_(e){return Object(oe["w"])(B_,e)}function U_(e,t){const n=B_[e];return n&&n.metadata[t]}function q_(e){return U_(e,Qv)}function W_(e){return U_(e,Kv)}function G_(e){return U_(e,ey)}function H_(e){return U_(e,Rv)}function V_(e){return U_(e,ny)}function Y_(e){return U_(e,ty)}function X_(e){return U_(e,Gv)}var J_=function(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}};var Z_=function(e,t){var n=ax(+e,+t);return function(e){var t=n(e);return t-360*Math.floor(t/360)}};var Q_=180/Math.PI;var K_={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};var ew=function(e,t,n,i,r,o){var s,a,u;if(s=Math.sqrt(e*e+t*t))e/=s,t/=s;if(u=e*n+t*i)n-=e*u,i-=t*u;if(a=Math.sqrt(n*n+i*i))n/=a,i/=a,u/=a;if(e*i180)t+=360;else if(t-e>180)e+=360;o.push({i:n.push(r(n)+"rotate(",null,i)-2,x:yx(e,t)})}else if(t){n.push(r(n)+"rotate("+t+i)}}function a(e,t,n,o){if(e!==t){o.push({i:n.push(r(n)+"skewX(",null,i)-2,x:yx(e,t)})}else if(t){n.push(r(n)+"skewX("+t+i)}}function u(e,t,n,i,o,s){if(e!==n||t!==i){var a=o.push(r(o)+"scale(",null,",",null,")");s.push({i:a-4,x:yx(e,n)},{i:a-2,x:yx(t,i)})}else if(n!==1||i!==1){o.push(r(o)+"scale("+n+","+i+")")}}return function(t,n){var i=[],r=[];t=e(t),n=e(n);o(t.translateX,t.translateY,n.translateX,n.translateY,i,r);s(t.rotate,n.rotate,i,r);a(t.skewX,n.skewX,i,r);u(t.scaleX,t.scaleY,n.scaleX,n.scaleY,i,r);t=n=null;return function(e){var t=-1,n=r.length,o;while(++tjw?Math.pow(e,1/3):e/Ow+_w}function Mw(e){return e>ww?e*e*e:Ow*(e-_w)}function Cw(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function $w(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Fw(e){if(e instanceof zw)return new zw(e.h,e.c,e.l,e.opacity);if(!(e instanceof Dw))e=kw(e);if(e.a===0&&e.b===0)return new zw(NaN,0e[t]?s[t](e[t]()):0);return s}}function cO(e,t){const n=s[lO(e)];return t!=null&&n&&n.gamma?n.gamma(t):n}function lO(e){return"interpolate"+e.toLowerCase().split("-").map(e=>e[0].toUpperCase()+e.slice(1)).join("")}const fO={blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"};const dO={category10:"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf",category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5",accent:"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666",dark2:"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666",paired:"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928",pastel1:"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2",pastel2:"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc",set1:"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999",set2:"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3",set3:"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"};function hO(e){const t=e.length/6|0,n=new Array(t);for(let i=0;ioO(hO(e)));function mO(e,t){e=e&&e.toLowerCase();if(arguments.length>1){gO[e]=t;return this}else{return gO[e]}}const bO="symbol";const vO="discrete";const yO="gradient";const xO=e=>Object(oe["B"])(e)?e.map(e=>String(e)):String(e);const _O=(e,t)=>e[1]-t[1];const wO=(e,t)=>t[1]-e[1];function OO(e,t,n){let i;if(Object(oe["F"])(t)){if(e.bins){t=Math.max(t,e.bins.length)}if(n!=null){t=Math.min(t,Math.floor(Object(oe["Y"])(e.domain())/n||1))}}if(Object(oe["G"])(t)){i=t.step;t=t.interval}if(Object(oe["I"])(t)){t=e.type===Lv?Fr(t):e.type==Uv?Nr(t):Object(oe["o"])("Only time and utc scales accept interval strings.");if(i)t=t.every(i)}return t}function jO(e,t,n){let i=e.range(),r=i[0],o=Object(oe["V"])(i),s=_O;if(r>o){i=o;o=r;r=i;s=wO}r=Math.floor(r);o=Math.ceil(o);t=t.map(t=>[t,e(t)]).filter(e=>r<=e[1]&&e[1]<=o).sort(s).map(e=>e[0]);if(n>0&&t.length>1){const e=[t[0],Object(oe["V"])(t)];while(t.length>n&&t.length>=3){t=t.filter((e,t)=>!(t%2))}if(t.length<3){t=e}}return t}function kO(e,t){return e.bins?jO(e,e.bins):e.ticks?e.ticks(t):e.domain()}function EO(e,t,n,i,r,o){const s=t.type;let a=xO;if(s===Lv||r===Lv){a=e.timeFormat(i)}else if(s===Uv||r===Uv){a=e.utcFormat(i)}else if(H_(s)){const r=e.formatFloat(i);if(o||t.bins){a=r}else{const e=AO(t,n,false);a=t=>e(t)?r(t):""}}else if(t.tickFormat){const r=t.domain();a=e.formatSpan(r[0],r[r.length-1],n,i)}else if(i){a=e.format(i)}return a}function AO(e,t,n){const i=kO(e,t),r=e.base(),o=Math.log(r),s=Math.max(1,r*t/i.length);const a=e=>{let t=e/Math.pow(r,Math.round(Math.log(e)/o));if(t*r1?i[1]-i[0]:i[0],s;for(s=1;sDO[e.type]||e.bins;function TO(e,t,n,i,r,o,s){const a=SO[t.type]&&o!==Lv&&o!==Uv?CO(e,t,r):EO(e,t,n,r,o,s);return i===bO&&NO(t)?zO(a):i===vO?BO(a):PO(a)}const zO=e=>(t,n,i)=>{const r=RO(i[n+1],RO(i.max,+Infinity)),o=IO(t,e),s=IO(r,e);return o&&s?o+" – "+s:s?"< "+s:"≥ "+o};const RO=(e,t)=>e!=null?e:t;const BO=e=>(t,n)=>n?e(t):null;const PO=e=>t=>e(t);const IO=(e,t)=>Number.isFinite(e)?t(e):null;function LO(e){const t=e.domain(),n=t.length-1;let i=+t[0],r=+Object(oe["V"])(t),o=r-i;if(e.type===Vv){const e=n?o/n:.1;i-=e;r+=e;o=r-i}return e=>(e-i)/o}function UO(e,t,n,i){const r=i||t.type;if(Object(oe["I"])(n)&&V_(r)){n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")}return!n&&r===Lv?e.timeFormat("%A, %d %B %Y, %X"):!n&&r===Uv?e.utcFormat("%A, %d %B %Y, %X UTC"):TO(e,t,5,null,n,i,true)}function qO(e,t,n){n=n||{};const i=Math.max(3,n.maxlen||7),r=UO(e,t,n.format,n.formatType);if(G_(t.type)){const e=MO(t).slice(1).map(r),n=e.length;return`${n} boundar${n===1?"y":"ies"}: ${e.join(", ")}`}else if(W_(t.type)){const e=t.domain(),n=e.length,o=n>i?e.slice(0,i-2).map(r).join(", ")+", ending with "+e.slice(-1).map(r):e.map(r).join(", ");return`${n} value${n===1?"":"s"}: ${o}`}else{const e=t.domain();return`values from ${r(e[0])} to ${r(Object(oe["V"])(e))}`}}const WO="aria-hidden";const GO="aria-label";const HO="role";const VO="aria-roledescription";const YO="graphics-object";const XO="graphics-symbol";const JO=(e,t,n)=>({[HO]:e,[VO]:t,[GO]:n||undefined});const ZO=Object(oe["eb"])(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]);const QO={axis:{desc:"axis",caption:oj},legend:{desc:"legend",caption:sj},"title-text":{desc:"title",caption:e=>`Title text '${rj(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${rj(e)}'`}};const KO={ariaRole:HO,ariaRoleDescription:VO,description:GO};function ej(e,t){const n=t.aria===false;e(WO,n||undefined);if(n||t.description==null){for(const t in KO){e(KO[t],undefined)}}else{const n=t.mark.marktype;e(GO,t.description);e(HO,t.ariaRole||(n==="group"?YO:XO));e(VO,t.ariaRoleDescription||`${n} mark`)}}function tj(e){return e.aria===false?{[WO]:true}:ZO[e.role]?null:QO[e.role]?ij(e,QO[e.role]):nj(e)}function nj(e){const t=e.marktype;const n=t==="group"||t==="text"||e.items.some(e=>e.description!=null&&e.aria!==false);return JO(n?YO:XO,`${t} mark container`,e.description)}function ij(e,t){try{const n=e.items[0],i=t.caption||(()=>"");return JO(t.role||XO,t.desc,n.description||i(n))}catch(n){return null}}function rj(e){return Object(oe["i"])(e.text).join(" ")}function oj(e){const t=e.datum,n=e.orient,i=t.title?aj(e):null,r=e.context,o=r.scales[t.scale].value,s=r.dataflow.locale(),a=o.type,u=n==="left"||n==="right"?"Y":"X";return`${u}-axis`+(i?` titled '${i}'`:"")+` for a ${W_(a)?"discrete":a} scale`+` with ${qO(s,o,e)}`}function sj(e){const t=e.datum,n=t.title?aj(e):null,i=`${t.type||""} legend`.trim(),r=t.scales,o=Object.keys(r),s=e.context,a=s.scales[r[o[0]]].value,u=s.dataflow.locale();return cj(i)+(n?` titled '${n}'`:"")+` for ${uj(o)}`+` with ${qO(u,a,e)}`}function aj(e){try{return Object(oe["i"])(Object(oe["V"])(e.items).items[0].text).join(" ")}catch(t){return null}}function uj(e){e=e.map(e=>e+(e==="fill"||e==="stroke"?" color":""));return e.length<2?e[0]:e.slice(0,-1).join(", ")+" and "+Object(oe["V"])(e)}function cj(e){return e.length?e[0].toUpperCase()+e.slice(1):e}const lj=e=>(e+"").replace(/&/g,"&").replace(//g,">");const fj=e=>lj(e).replace(/"/g,""").replace(/\t/g," ").replace(/\n/g," ").replace(/\r/g," ");function dj(){let e="",t="",n="";const i=[],r=()=>t=n="",o=o=>{if(t){e+=`${t}>${n}`;r()}i.push(o)},s=(e,n)=>{if(n!=null)t+=` ${e}="${fj(n)}"`;return a},a={open(e,...n){o(e);t="<"+e;for(const t of n){for(const e in t)s(e,t[e])}return a},close(){const o=i.pop();if(t){e+=t+(n?`>${n}`:"/>")}else{e+=``}r();return a},attr:s,text:e=>(n+=lj(e),a),toString:()=>e};return a}const hj=e=>pj(dj(),e)+"";function pj(e,t){e.open(t.tagName);if(t.hasAttributes()){const n=t.attributes,i=n.length;for(let t=0;t{e.dirty=t})}if(i.zdirty)continue;if(n.exit){if(o.nested&&i.items.length){u=i.items[0];if(u._svg)this._update(o,u._svg,u)}else if(n._svg){u=n._svg.parentNode;if(u)u.removeChild(n._svg)}n._svg=null;continue}n=o.nested?i.items[0]:n;if(n._update===t)continue;if(!n._svg||!n._svg.ownerSVGElement){this._dirtyAll=false;_j(n,t)}else{this._update(o,n._svg,n)}n._update=t}return!this._dirtyAll},mark(e,t,n){if(!this.isDirty(t))return t._svg;const i=this._svg,r=Cb[t.marktype],o=t.interactive===false?"none":null,s=r.tag==="g";let a=null,u=0;const c=kj(t,e,n,"g",i);c.setAttribute("class",Gb(t));const l=tj(t);for(const d in l)Fj(c,d,l[d]);if(!s){Fj(c,"pointer-events",o)}Fj(c,"clip-path",t.clip?Jp(this,t,t.group):null);const f=e=>{const t=this.isDirty(e),n=kj(e,c,a,r.tag,i);if(t){this._update(r,n,e);if(s)jj(this,n,e)}a=n;++u};if(r.nested){if(t.items.length)f(t.items[0])}else{Hg(t,f)}Wb(c,u);return c},_update(e,t,n){Aj=t;Dj=t.__values__;ej(Mj,n);e.attr(Mj,n,this);const i=Sj[e.type];if(i)i.call(this,e,t,n);if(Aj)this.style(Aj,n)},style(e,t){if(t==null)return;for(const n in gj){let i=n==="font"?vb(t):t[n];if(i===Dj[n])continue;const r=gj[n];if(i==null){e.removeAttribute(r)}else{if(Bf(i)){i=Pf(i,this._defs.gradient,Tj())}e.setAttribute(r,i+"")}Dj[n]=i}},defs(){const e=this._svg,t=this._defs;let n=t.el,i=0;for(const r in t.gradient){if(!n)t.el=n=qb(e,bj+1,"defs",vj);i=wj(n,t.gradient[r],i)}for(const r in t.clipping){if(!n)t.el=n=qb(e,bj+1,"defs",vj);i=Oj(n,t.clipping[r],i)}if(n){i===0?(e.removeChild(n),t.el=null):Wb(n,i)}},_clearDefs(){const e=this._defs;e.gradient={};e.clipping={}}});function _j(e,t){for(;e&&e.dirty!==t;e=e.mark.group){e.dirty=t;if(e.mark&&e.mark.dirty!==t){e.mark.dirty=t}else return}}function wj(e,t,n){let i,r,o;if(t.gradient==="radial"){let i=qb(e,n++,"pattern",vj);$j(i,{id:Rf+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"});i=qb(i,0,"rect",vj);$j(i,{width:1,height:1,fill:`url(${Tj()}#${t.id})`});e=qb(e,n++,"radialGradient",vj);$j(e,{id:t.id,fx:t.x1,fy:t.y1,fr:t.r1,cx:t.x2,cy:t.y2,r:t.r2})}else{e=qb(e,n++,"linearGradient",vj);$j(e,{id:t.id,x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2})}for(i=0,r=t.stops.length;i{i=e.mark(t,n,i);++r});Wb(t,1+r)}function kj(e,t,n,i,r){let o=e._svg,s;if(!o){s=t.ownerDocument;o=Lb(s,i,vj);e._svg=o;if(e.mark){o.__data__=e;o.__values__={fill:"default"};if(i==="g"){const t=Lb(s,"path",vj);o.appendChild(t);t.__data__=e;const n=Lb(s,"g",vj);o.appendChild(n);n.__data__=e;const i=Lb(s,"path",vj);o.appendChild(i);i.__data__=e;i.__values__={fill:"default"}}}}if(o.ownerSVGElement!==r||Ej(o,n)){t.insertBefore(o,n?n.nextSibling:t.firstChild)}return o}function Ej(e,t){return e.parentNode&&e.parentNode.childNodes.length>1&&e.previousSibling!=t}let Aj=null,Dj=null;const Sj={group(e,t,n){const i=Aj=t.childNodes[2];Dj=i.__values__;e.foreground(Mj,n,this);Dj=t.__values__;Aj=t.childNodes[1];e.content(Mj,n,this);const r=Aj=t.childNodes[0];e.background(Mj,n,this);const o=n.mark.interactive===false?"none":null;if(o!==Dj.events){Fj(i,"pointer-events",o);Fj(r,"pointer-events",o);Dj.events=o}if(n.strokeForeground&&n.stroke){const e=n.fill;Fj(i,"display",null);this.style(r,n);Fj(r,"stroke",null);if(e)n.fill=null;Dj=i.__values__;this.style(i,n);if(e)n.fill=e;Aj=null}else{Fj(i,"display","none")}},image(e,t,n){if(n.smooth===false){Cj(t,"image-rendering","optimizeSpeed");Cj(t,"image-rendering","pixelated")}else{Cj(t,"image-rendering",null)}},text(e,t,n){const i=hb(n);let r,o,s,a;if(Object(oe["B"])(i)){o=i.map(e=>gb(n,e));r=o.join("\n");if(r!==Dj.text){Wb(t,0);s=t.ownerDocument;a=fb(n);o.forEach((e,i)=>{const r=Lb(s,"tspan",vj);r.__data__=n;r.textContent=e;if(i){r.setAttribute("x",0);r.setAttribute("dy",a)}t.appendChild(r)});Dj.text=r}}else{o=gb(n,i);if(o!==Dj.text){t.textContent=o;Dj.text=o}}Fj(t,"font-family",vb(n));Fj(t,"font-size",lb(n)+"px");Fj(t,"font-style",n.fontStyle);Fj(t,"font-variant",n.fontVariant);Fj(t,"font-weight",n.fontWeight)}};function Mj(e,t,n){if(t===Dj[e])return;if(n){Nj(Aj,e,t,n)}else{Fj(Aj,e,t)}Dj[e]=t}function Cj(e,t,n){if(n!==Dj[t]){if(n==null){e.style.removeProperty(t)}else{e.style.setProperty(t,n+"")}Dj[t]=n}}function $j(e,t){for(const n in t){Fj(e,n,t[n])}}function Fj(e,t,n){if(n!=null){e.setAttribute(t,n)}else{e.removeAttribute(t)}}function Nj(e,t,n,i){if(n!=null){e.setAttributeNS(i,t,n)}else{e.removeAttributeNS(i,t)}}function Tj(){let e;return typeof window==="undefined"?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}function zj(e){Jb.call(this,e);this._text=null;this._defs={gradient:{},clipping:{}}}Object(oe["z"])(zj,Jb,{svg(){return this._text},_render(e){const t=dj();t.open("svg",Object(oe["p"])({},Mm,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const n=this._bgcolor;if(n&&n!=="transparent"&&n!=="none"){t.open("rect",{width:this._width,height:this._height,fill:n}).close()}t.open("g",mj,{transform:"translate("+this._origin+")"});this.mark(t,e);t.close();this.defs(t);this._text=t.close()+"";return this},mark(e,t){const n=Cb[t.marktype],i=n.tag,r=[ej,n.attr];e.open("g",{class:Gb(t),"clip-path":t.clip?Jp(this,t,t.group):null},tj(t),{"pointer-events":i!=="g"&&t.interactive===false?"none":null});const o=o=>{const s=this.href(o);if(s)e.open("a",s);e.open(i,this.attr(t,o,r,i!=="g"?i:null));if(i==="text"){const t=hb(o);if(Object(oe["B"])(t)){const n={x:0,dy:fb(o)};for(let i=0;ithis.mark(e,t));e.close();if(i&&s){if(r)o.fill=null;o.stroke=s;e.open("path",this.attr(t,o,n.foreground,"bgrect")).close();if(r)o.fill=r}else{e.open("path",this.attr(t,o,n.foreground,"bgfore")).close()}}e.close();if(s)e.close()};if(n.nested){if(t.items&&t.items.length)o(t.items[0])}else{Hg(t,o)}return e.close()},href(e){const t=e.href;let n;if(t){if(n=this._hrefs&&this._hrefs[t]){return n}else{this.sanitizeURL(t).then(e=>{e["xlink:href"]=e.href;e.href=null;(this._hrefs||(this._hrefs={}))[t]=e})}}return null},attr(e,t,n,i){const r={},o=(e,t,n,i)=>{r[i||e]=t};if(Array.isArray(n)){n.forEach(e=>e(o,t,this))}else{n(o,t,this)}if(i){Rj(r,t,e,i,this._defs)}return r},defs(e){const t=this._defs.gradient,n=this._defs.clipping,i=Object.keys(t).length+Object.keys(n).length;if(i===0)return;e.open("defs");for(const r in t){const n=t[r],i=n.stops;if(n.gradient==="radial"){e.open("pattern",{id:Rf+r,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"});e.open("rect",{width:"1",height:"1",fill:"url(#"+r+")"}).close();e.close();e.open("radialGradient",{id:r,fx:n.x1,fy:n.y1,fr:n.r1,cx:n.x2,cy:n.y2,r:n.r2})}else{e.open("linearGradient",{id:r,x1:n.x1,x2:n.x2,y1:n.y1,y2:n.y2})}for(let t=0;t1){qj[e]=t;return this}else{return qj[e]}}function Gj(e,t,n){const i=[],r=(new Zp).union(t),o=e.marktype;return o?Hj(e,r,n,i):o==="group"?Yj(e,r,n,i):Object(oe["o"])("Intersect scene must be mark node or group item.")}function Hj(e,t,n,i){if(Vj(e,t,n)){const r=e.items,o=e.marktype,s=r.length;let a=0;if(o==="group"){for(;a=0;o--){if(n[o]!=i[o])return false}for(o=n.length-1;o>=0;o--){r=n[o];if(!Kj(e[r],t[r],r))return false}return typeof e===typeof t}function nk(){Xp();zf()}function ik(e){Pa.call(this,null,e)}Object(oe["z"])(ik,Pa,{transform(e,t){const n=t.dataflow,i=e.mark,r=i.marktype,o=Cb[r],s=o.bound;let a=i.bounds,u;if(o.nested){if(i.items.length)n.dirty(i.items[0]);a=rk(i,s);i.items.forEach(e=>{e.bounds.clear().union(a)})}else if(r===ff||e.modified()){t.visit(t.MOD,e=>n.dirty(e));a.clear();i.items.forEach(e=>a.union(rk(e,s)));switch(i.role){case df:case mf:case hf:t.reflow()}}else{u=t.changed(t.REM);t.visit(t.ADD,e=>{a.union(rk(e,s))});t.visit(t.MOD,e=>{u=u||a.alignsWith(e.bounds);n.dirty(e);a.union(rk(e,s))});if(u){a.clear();i.items.forEach(e=>a.union(e.bounds))}}Zj(i);return t.modifies("bounds")}});function rk(e,t,n){return t(e.bounds.clear(),e,n)}const ok=":vega_identifier:";function sk(e){Pa.call(this,0,e)}sk.Definition={type:"Identifier",metadata:{modifies:true},params:[{name:"as",type:"string",required:true}]};Object(oe["z"])(sk,Pa,{transform(e,t){const n=ak(t.dataflow),i=e.as;let r=n.value;t.visit(t.ADD,e=>e[i]=e[i]||++r);n.set(this.value=r);return t}});function ak(e){return e._signals[ok]||(e._signals[ok]=e.add(0))}function uk(e){Pa.call(this,null,e)}Object(oe["z"])(uk,Pa,{transform(e,t){let n=this.value;if(!n){n=t.dataflow.scenegraph().mark(e.markdef,ck(e),e.index);n.group.context=e.context;if(!e.context.group)e.context.group=n.group;n.source=this.source;n.clip=e.clip;n.interactive=e.interactive;this.value=n}const i=n.marktype===ff?Kp:Qp;t.visit(t.ADD,e=>i.call(e,n));if(e.modified("clip")||e.modified("interactive")){n.clip=e.clip;n.interactive=!!e.interactive;n.zdirty=true;t.reflow()}n.items=t.source;return t}});function ck(e){const t=e.groups,n=e.parent;return t&&t.size===1?t.get(Object.keys(t.object)[0]):t&&n?t.lookup(n):null}function lk(e){Pa.call(this,null,e)}const fk={parity:e=>e.filter((e,t)=>t%2?e.opacity=0:1),greedy:(e,t)=>{let n;return e.filter((e,i)=>!i||!dk(n.bounds,e.bounds,t)?(n=e,1):e.opacity=0)}};const dk=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2);const hk=(e,t)=>{for(var n=1,i=e.length,r=e[0].bounds,o;n{var t=e.bounds;return t.width()>1&&t.height()>1};const gk=(e,t,n)=>{var i=e.range(),r=new Zp;if(t===Zl||t===ef){r.set(i[0],-Infinity,i[1],+Infinity)}else{r.set(-Infinity,i[0],+Infinity,i[1])}r.expand(n||1);return e=>r.encloses(e.bounds)};const mk=e=>{e.forEach(e=>e.opacity=1);return e};const bk=(e,t)=>e.reflow(t.modified()).modifies("opacity");Object(oe["z"])(lk,Pa,{transform(e,t){const n=fk[e.method]||fk.parity,i=e.separation||0;let r=t.materialize(t.SOURCE).source,o,s;if(!r||!r.length)return;if(!e.method){if(e.modified("method")){mk(r);t=bk(t,e)}return t}r=r.filter(pk);if(!r.length)return;if(e.sort){r=r.slice().sort(e.sort)}o=mk(r);t=bk(t,e);if(o.length>=3&&hk(o,i)){do{o=n(o,i)}while(o.length>=3&&hk(o,i));if(o.length<3&&!Object(oe["V"])(r).opacity){if(o.length>1)Object(oe["V"])(o).opacity=0;Object(oe["V"])(r).opacity=1}}if(e.boundScale&&e.boundTolerance>=0){s=gk(e.boundScale,e.boundOrient,+e.boundTolerance);r.forEach(e=>{if(!s(e))e.opacity=0})}const a=o[0].mark.bounds.clear();r.forEach(e=>{if(e.opacity)a.union(e.bounds)});return t}});function vk(e){Pa.call(this,null,e)}Object(oe["z"])(vk,Pa,{transform(e,t){const n=t.dataflow;t.visit(t.ALL,e=>n.dirty(e));if(t.fields&&t.fields["zindex"]){var i=t.source&&t.source[0];if(i)i.mark.zdirty=true}}});const yk=new Zp;function xk(e,t,n){return e[t]===n?0:(e[t]=n,1)}function _k(e){var t=e.items[0].orient;return t===Ql||t===Kl}function wk(e){var t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}function Ok(e,t,n,i){var r=t.items[0],o=r.datum,s=r.translate!=null?r.translate:.5,a=r.orient,u=wk(o),c=r.range,l=r.offset,f=r.position,d=r.minExtent,h=r.maxExtent,p=o.title&&r.items[u[2]].items[0],g=r.titlePadding,m=r.bounds,b=p&&pb(p),v=0,y=0,x,_;yk.clear().union(m);m.clear();if((x=u[0])>-1)m.union(r.items[x].bounds);if((x=u[1])>-1)m.union(r.items[x].bounds);switch(a){case Zl:v=f||0;y=-l;_=Math.max(d,Math.min(h,-m.y1));m.add(0,-_).add(c,0);if(p)jk(e,p,_,g,b,0,-1,m);break;case Ql:v=-l;y=f||0;_=Math.max(d,Math.min(h,-m.x1));m.add(-_,0).add(0,c);if(p)jk(e,p,_,g,b,1,-1,m);break;case Kl:v=n+l;y=f||0;_=Math.max(d,Math.min(h,m.x2));m.add(0,0).add(_,c);if(p)jk(e,p,_,g,b,1,1,m);break;case ef:v=f||0;y=i+l;_=Math.max(d,Math.min(h,m.y2));m.add(0,0).add(c,_);if(p)jk(e,p,_,g,0,0,1,m);break;default:v=r.x;y=r.y}og(m.translate(v,y),r);if(xk(r,"x",v+s)|xk(r,"y",y+s)){r.bounds=yk;e.dirty(r);r.bounds=m;e.dirty(r)}return r.mark.bounds.clear().union(m)}function jk(e,t,n,i,r,o,s,a){const u=t.bounds;if(t.auto){const a=s*(n+r+i);let c=0,l=0;e.dirty(t);o?c=(t.x||0)-(t.x=a):l=(t.y||0)-(t.y=a);t.mark.bounds.clear().union(u.translate(-c,-l));e.dirty(t)}a.union(u)}const kk=(e,t)=>Math.floor(Math.min(e,t));const Ek=(e,t)=>Math.ceil(Math.max(e,t));function Ak(e){var t=e.items,n=t.length,i=0,r,o;var s={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;i1){for(O=0;O0)y[O]+=M/2}}if(a&&Mk(n.center,Nf)&&l!==1){for(O=0;O0)x[O]+=C/2}}for(O=0;Or){e.warn("Grid headers exceed limit: "+r);t=t.slice(0,r)}g+=o;for(v=0,x=t.length;v=0&&(O=n[y])==null;y-=d);if(a){j=h==null?O.x:Math.round(O.bounds.x1+h*O.bounds.width());k=g}else{j=g;k=h==null?O.y:Math.round(O.bounds.y1+h*O.bounds.height())}_.union(w.bounds.translate(j-(w.x||0),k-(w.y||0)));w.x=j;w.y=k;e.dirty(w);m=s(m,_[c])}return m}function Rk(e,t,n,i,r,o){if(!t)return;e.dirty(t);var s=n,a=n;i?s=Math.round(r.x1+o*r.width()):a=Math.round(r.y1+o*r.height());t.bounds.translate(s-(t.x||0),a-(t.y||0));t.mark.bounds.clear().union(t.bounds);t.x=s;t.y=a;e.dirty(t)}function Bk(e,t){const n=e[t]||{};return(t,i)=>n[t]!=null?n[t]:e[t]!=null?e[t]:i}function Pk(e,t){var n=-Infinity;e.forEach(e=>{if(e.offset!=null)n=Math.max(n,e.offset)});return n>-Infinity?n:t}function Ik(e,t,n,i,r,o,s){const a=Bk(n,t),u=Pk(e,a("offset",0)),c=a("anchor",sf),l=c===uf?1:c===af?.5:0;const f={align:Cf,bounds:a("bounds",$f),columns:a("direction")==="vertical"?1:e.length,padding:a("margin",8),center:a("center"),nodirty:true};switch(t){case Ql:f.anchor={x:Math.floor(i.x1)-u,column:uf,y:l*(s||i.height()+2*i.y1),row:c};break;case Kl:f.anchor={x:Math.ceil(i.x2)+u,y:l*(s||i.height()+2*i.y1),row:c};break;case Zl:f.anchor={y:Math.floor(r.y1)-u,row:uf,x:l*(o||r.width()+2*r.x1),column:c};break;case ef:f.anchor={y:Math.ceil(r.y2)+u,x:l*(o||r.width()+2*r.x1),column:c};break;case tf:f.anchor={x:u,y:u};break;case nf:f.anchor={x:o-u,y:u,column:uf};break;case rf:f.anchor={x:u,y:s-u,row:uf};break;case of:f.anchor={x:o-u,y:s-u,column:uf,row:uf};break}return f}function Lk(e,t){var n=t.items[0],i=n.datum,r=n.orient,o=n.bounds,s=n.x,a=n.y,u,c;n._bounds?n._bounds.clear().union(o):n._bounds=o.clone();o.clear();qk(e,n,n.items[0].items[0]);o=Uk(n,o);u=2*n.padding;c=2*n.padding;if(!o.empty()){u=Math.ceil(o.width()+u);c=Math.ceil(o.height()+c)}if(i.type===jf){Hk(n.items[0].items[0].items[0].items)}if(r!==Sf){n.x=s=0;n.y=a=0}n.width=u;n.height=c;og(o.set(s,a,s+u,a+c),n);n.mark.bounds.clear().union(o);return n}function Uk(e,t){e.items.forEach(e=>t.union(e.bounds));t.x1=e.padding;t.y1=e.padding;return t}function qk(e,t,n){var i=t.padding,r=i-n.x,o=i-n.y;if(!t.datum.title){if(r||o)Gk(e,n,r,o)}else{var s=t.items[1].items[0],a=s.anchor,u=t.titlePadding||0,c=i-s.x,l=i-s.y;switch(s.orient){case Ql:r+=Math.ceil(s.bounds.width())+u;break;case Kl:case ef:break;default:o+=s.bounds.height()+u}if(r||o)Gk(e,n,r,o);switch(s.orient){case Ql:l+=Wk(t,n,s,a,1,1);break;case Kl:c+=Wk(t,n,s,uf,0,0)+u;l+=Wk(t,n,s,a,1,1);break;case ef:c+=Wk(t,n,s,a,0,0);l+=Wk(t,n,s,uf,-1,0,1)+u;break;default:c+=Wk(t,n,s,a,0,0)}if(c||l)Gk(e,s,c,l);if((c=Math.round(s.bounds.x1-i))<0){Gk(e,n,-c,0);Gk(e,s,-c,0)}}}function Wk(e,t,n,i,r,o,s){const a=e.datum.type!=="symbol",u=n.datum.vgrad,c=a&&(o||!u)&&!s?t.items[0]:t,l=c.bounds[r?"y2":"x2"]-e.padding,f=u&&o?l:0,d=u&&o?0:l,h=r<=0?0:pb(n);return Math.round(i===sf?f:i===uf?d-h:.5*(l-h))}function Gk(e,t,n,i){t.x+=n;t.y+=i;t.bounds.translate(n,i);t.mark.bounds.translate(n,i);e.dirty(t)}function Hk(e){var t=e.reduce((e,t)=>{e[t.column]=Math.max(t.bounds.x2-t.x,e[t.column]||0);return e},{});e.forEach(e=>{e.width=t[e.column];e.height=e.bounds.y2-e.y})}function Vk(e,t,n,i,r){var o=t.items[0],s=o.frame,a=o.orient,u=o.anchor,c=o.offset,l=o.padding,f=o.items[0].items[0],d=o.items[1]&&o.items[1].items[0],h=a===Ql||a===Kl?i:n,p=0,g=0,m=0,b=0,v=0,y;if(s!==ff){a===Ql?(p=r.y2,h=r.y1):a===Kl?(p=r.y1,h=r.y2):(p=r.x1,h=r.x2)}else if(a===Ql){p=i,h=0}y=u===sf?p:u===uf?h:(p+h)/2;if(d&&d.text){switch(a){case Zl:case ef:v=f.bounds.height()+l;break;case Ql:b=f.bounds.width()+l;break;case Kl:b=-f.bounds.width()-l;break}yk.clear().union(d.bounds);yk.translate(b-(d.x||0),v-(d.y||0));if(xk(d,"x",b)|xk(d,"y",v)){e.dirty(d);d.bounds.clear().union(yk);d.mark.bounds.clear().union(yk);e.dirty(d)}yk.clear().union(d.bounds)}else{yk.clear()}yk.union(f.bounds);switch(a){case Zl:g=y;m=r.y1-yk.height()-c;break;case Ql:g=r.x1-yk.width()-c;m=y;break;case Kl:g=r.x2+yk.width()+c;m=y;break;case ef:g=y;m=r.y2+c;break;default:g=o.x;m=o.y}if(xk(o,"x",g)|xk(o,"y",m)){yk.translate(g,m);e.dirty(o);o.bounds.clear().union(yk);t.bounds.clear().union(yk);e.dirty(o)}return o.bounds}function Yk(e){Pa.call(this,null,e)}Object(oe["z"])(Yk,Pa,{transform(e,t){const n=t.dataflow;e.mark.items.forEach(t=>{if(e.layout)Fk(n,t,e.layout);Jk(n,t,e)});return Xk(e.mark.group)?t.reflow():t}});function Xk(e){return e&&e.mark.role!=="legend-entry"}function Jk(e,t,n){var i=t.items,r=Math.max(0,t.width||0),o=Math.max(0,t.height||0),s=(new Zp).set(0,0,r,o),a=s.clone(),u=s.clone(),c=[],l,f,d,h,p,g;for(p=0,g=i.length;p{d=e.orient||Kl;if(d!==Sf)(t[d]||(t[d]=[])).push(e)});for(const i in t){const s=t[i];$k(e,s,Ik(s,i,n.legends,a,u,r,o))}c.forEach(t=>{const i=t.bounds;if(!i.equals(t._bounds)){t.bounds=t._bounds;e.dirty(t);t.bounds=i;e.dirty(t)}if(n.autosize&&n.autosize.type===kf){switch(t.orient){case Ql:case Kl:s.add(i.x1,0).add(i.x2,0);break;case Zl:case ef:s.add(0,i.y1).add(0,i.y2)}}else{s.union(i)}})}s.union(a).union(u);if(l){s.union(Vk(e,l,r,o,s))}if(t.clip){s.set(0,0,t.width||0,t.height||0)}Zk(e,t,s,n)}function Zk(e,t,n,i){const r=i.autosize||{},o=r.type;if(e._autosize<1||!o)return;let s=e._width,a=e._height,u=Math.max(0,t.width||0),c=Math.max(0,Math.ceil(-n.x1)),l=Math.max(0,t.height||0),f=Math.max(0,Math.ceil(-n.y1));const d=Math.max(0,Math.ceil(n.x2-u)),h=Math.max(0,Math.ceil(n.y2-l));if(r.contains===Of){const t=e.padding();s-=t.left+t.right;a-=t.top+t.bottom}if(o===Sf){c=0;f=0;u=s;l=a}else if(o===kf){u=Math.max(0,s-c-d);l=Math.max(0,a-f-h)}else if(o===Ef){u=Math.max(0,s-c-d);a=l+f+h}else if(o===Af){s=u+c+d;l=Math.max(0,a-f-h)}else if(o===Df){s=u+c+d;a=l+f+h}e._resizeView(s,a,u,l,[c,f],r.resize)}function Qk(e){Pa.call(this,null,e)}Object(oe["z"])(Qk,Pa,{transform(e,t){if(this.value&&!e.modified()){return t.StopPropagation}var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,o=e.scale,s=e.count==null?e.values?e.values.length:10:e.count,a=OO(o,s,e.minstep),u=e.format||EO(n,o,a,e.formatSpecifier,e.formatType,!!e.values),c=e.values?jO(o,e.values,a):kO(o,a);if(r)i.rem=r;r=c.map((e,t)=>pe({index:t/(c.length-1||1),value:e,label:u(e)}));if(e.extra&&r.length){r.push(pe({index:-1,extra:{value:r[0].value},label:""}))}i.source=r;i.add=r;this.value=r;return i}});function Kk(e){Pa.call(this,null,e)}function eE(){return pe({})}function tE(e){const t=Object(oe["t"])().test(e=>e.exit);t.lookup=n=>t.get(e(n));return t}Object(oe["z"])(Kk,Pa,{transform(e,t){var n=t.dataflow,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.item||eE,o=e.key||de,s=this.value;if(Object(oe["B"])(i.encode)){i.encode=null}if(s&&(e.modified("key")||t.modified(o))){Object(oe["o"])("DataJoin does not support modified key function or fields.")}if(!s){t=t.addAll();this.value=s=tE(o)}t.visit(t.ADD,e=>{const t=o(e);let n=s.get(t);if(n){if(n.exit){s.empty--;i.add.push(n)}else{i.mod.push(n)}}else{n=r(e);s.set(t,n);i.add.push(n)}n.datum=e;n.exit=false});t.visit(t.MOD,e=>{const t=o(e),n=s.get(t);if(n){n.datum=e;i.mod.push(n)}});t.visit(t.REM,e=>{const t=o(e),n=s.get(t);if(e===n.datum&&!n.exit){i.rem.push(n);n.exit=true;++s.empty}});if(t.changed(t.ADD_MOD))i.modifies("datum");if(t.clean()||e.clean&&s.empty>n.cleanThreshold){n.runAfter(s.clean)}return i}});function nE(e){Pa.call(this,null,e)}Object(oe["z"])(nE,Pa,{transform(e,t){var n=t.fork(t.ADD_REM),i=e.mod||false,r=e.encoders,o=t.encode;if(Object(oe["B"])(o)){if(n.changed()||o.every(e=>r[e])){o=o[0];n.encode=null}else{return t.StopPropagation}}var s=o==="enter",a=r.update||oe["s"],u=r.enter||oe["s"],c=r.exit||oe["s"],l=(o&&!s?r[o]:a)||oe["s"];if(t.changed(t.ADD)){t.visit(t.ADD,t=>{u(t,e);a(t,e)});n.modifies(u.output);n.modifies(a.output);if(l!==oe["s"]&&l!==a){t.visit(t.ADD,t=>{l(t,e)});n.modifies(l.output)}}if(t.changed(t.REM)&&c!==oe["s"]){t.visit(t.REM,t=>{c(t,e)});n.modifies(c.output)}if(s||l!==oe["s"]){var f=t.MOD|(e.modified()?t.REFLOW:0);if(s){t.visit(f,t=>{var r=u(t,e)||i;if(l(t,e)||r)n.mod.push(t)});if(n.mod.length)n.modifies(u.output)}else{t.visit(f,t=>{if(l(t,e)||i)n.mod.push(t)})}if(n.mod.length)n.modifies(l.output)}return n.changed()?n:t.StopPropagation}});function iE(e){Pa.call(this,[],e)}Object(oe["z"])(iE,Pa,{transform(e,t){if(this.value!=null&&!e.modified()){return t.StopPropagation}var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,o=e.type||bO,s=e.scale,a=+e.limit,u=OO(s,e.count==null?5:e.count,e.minstep),c=!!e.values||o===bO,l=e.format||TO(n,s,u,o,e.formatSpecifier,e.formatType,c),f=e.values||MO(s,u),d,h,p,g,m;if(r)i.rem=r;if(o===bO){if(a&&f.length>a){t.dataflow.warn("Symbol legend count exceeds limit, filtering items.");r=f.slice(0,a-1);m=true}else{r=f}if(Object(oe["E"])(p=e.size)){if(!e.values&&s(r[0])===0){r=r.slice(1)}g=r.reduce((t,n)=>Math.max(t,p(n,e)),0)}else{p=Object(oe["m"])(g=p||8)}r=r.map((t,n)=>pe({index:n,label:l(t,n,r),value:t,offset:g,size:p(t,e)}));if(m){m=f[r.length];r.push(pe({index:r.length,label:`…${f.length-r.length} entries`,value:m,offset:g,size:p(m,e)}))}}else if(o===yO){d=s.domain(),h=uO(s,d[0],Object(oe["V"])(d));if(f.length<3&&!e.values&&d[0]!==Object(oe["V"])(d)){f=[d[0],Object(oe["V"])(d)]}r=f.map((e,t)=>pe({index:t,label:l(e,t,f),value:e,perc:h(e)}))}else{p=f.length-1;h=LO(s);r=f.map((e,t)=>pe({index:t,label:l(e,t,f),value:e,perc:t?h(e):0,perc2:t===p?1:h(f[t+1])}))}i.source=r;i.add=r;this.value=r;return i}});const rE=e=>e.source.x;const oE=e=>e.source.y;const sE=e=>e.target.x;const aE=e=>e.target.y;function uE(e){Pa.call(this,{},e)}uE.Definition={type:"LinkPath",metadata:{modifies:true},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]};Object(oe["z"])(uE,Pa,{transform(e,t){var n=e.sourceX||rE,i=e.sourceY||oE,r=e.targetX||sE,o=e.targetY||aE,s=e.as||"path",a=e.orient||"vertical",u=e.shape||"line",c=_E.get(u+"-"+a)||_E.get(u);if(!c){Object(oe["o"])("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:""))}t.visit(t.SOURCE,e=>{e[s]=c(n(e),i(e),r(e),o(e))});return t.reflow(e.modified()).modifies(s)}});const cE=(e,t,n,i)=>"M"+e+","+t+"L"+n+","+i;const lE=(e,t,n,i)=>cE(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n));const fE=(e,t,n,i)=>{var r=n-e,o=i-t,s=Math.sqrt(r*r+o*o)/2,a=180*Math.atan2(o,r)/Math.PI;return"M"+e+","+t+"A"+s+","+s+" "+a+" 0 1"+" "+n+","+i};const dE=(e,t,n,i)=>fE(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n));const hE=(e,t,n,i)=>{const r=n-e,o=i-t,s=.2*(r+o),a=.2*(o-r);return"M"+e+","+t+"C"+(e+s)+","+(t+a)+" "+(n+a)+","+(i-s)+" "+n+","+i};const pE=(e,t,n,i)=>hE(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n));const gE=(e,t,n,i)=>"M"+e+","+t+"V"+i+"H"+n;const mE=(e,t,n,i)=>"M"+e+","+t+"H"+n+"V"+i;const bE=(e,t,n,i)=>{const r=Math.cos(e),o=Math.sin(e),s=Math.cos(n),a=Math.sin(n),u=Math.abs(n-e)>Math.PI?n<=e:n>e;return"M"+t*r+","+t*o+"A"+t+","+t+" 0 0,"+(u?1:0)+" "+t*s+","+t*a+"L"+i*s+","+i*a};const vE=(e,t,n,i)=>{const r=(e+n)/2;return"M"+e+","+t+"C"+r+","+t+" "+r+","+i+" "+n+","+i};const yE=(e,t,n,i)=>{const r=(t+i)/2;return"M"+e+","+t+"C"+e+","+r+" "+n+","+r+" "+n+","+i};const xE=(e,t,n,i)=>{const r=Math.cos(e),o=Math.sin(e),s=Math.cos(n),a=Math.sin(n),u=(t+i)/2;return"M"+t*r+","+t*o+"C"+u*r+","+u*o+" "+u*s+","+u*a+" "+i*s+","+i*a};const _E=Object(oe["t"])({line:cE,"line-radial":lE,arc:fE,"arc-radial":dE,curve:hE,"curve-radial":pE,"orthogonal-horizontal":gE,"orthogonal-vertical":mE,"orthogonal-radial":bE,"diagonal-horizontal":vE,"diagonal-vertical":yE,"diagonal-radial":xE});function wE(e,t){let n=0;if(t===undefined){for(let t of e){if(t=+t){n+=t}}}else{let i=-1;for(let r of e){if(r=+t(r,++i,e)){n+=r}}}return n}function OE(e){Pa.call(this,null,e)}OE.Definition={type:"Pie",metadata:{modifies:true},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:false},{name:"as",type:"string",array:true,length:2,default:["startAngle","endAngle"]}]};Object(oe["z"])(OE,Pa,{transform(e,t){var n=e.as||["startAngle","endAngle"],i=n[0],r=n[1],o=e.field||oe["P"],s=e.startAngle||0,a=e.endAngle!=null?e.endAngle:2*Math.PI,u=t.source,c=u.map(o),l=c.length,f=s,d=(a-s)/wE(c),h=Sl(l),p,g,m;if(e.sort){h.sort((e,t)=>c[e]-c[t])}for(p=0;p-1)return i;var r=t.domain,o=e.type,s=t.zero||t.zero===undefined&&kE(e),a,u;if(!r)return 0;if(EE(o)&&t.padding&&r[0]!==Object(oe["V"])(r)){r=FE(o,r,t.range,t.padding,t.exponent,t.constant)}if(s||t.domainMin!=null||t.domainMax!=null||t.domainMid!=null){a=(r=r.slice()).length-1||1;if(s){if(r[0]>0)r[0]=0;if(r[a]<0)r[a]=0}if(t.domainMin!=null)r[0]=t.domainMin;if(t.domainMax!=null)r[a]=t.domainMax;if(t.domainMid!=null){u=t.domainMid;const e=u>r[a]?a+1:ue+(t<0?-1:t>0?1:0),0));if(i!==t.length){n.warn("Log scale domain includes zero: "+Object(oe["ab"])(t))}}return t}function TE(e,t,n){let i=t.bins;if(i&&!Object(oe["B"])(i)){const t=e.domain(),n=t[0],r=Object(oe["V"])(t),o=i.step;let s=i.start==null?n:i.start,a=i.stop==null?r:i.stop;if(!o)Object(oe["o"])("Scale bins parameter missing step property.");if(sr)a=o*Math.floor(r/o);i=Sl(s,a+o/2,o)}if(i){e.bins=i}else if(e.bins){delete e.bins}if(e.type===Zv){if(!i){e.bins=e.domain()}else if(!t.domain&&!t.domainRaw){e.domain(i);n=i.length}}return n}function zE(e,t,n){var i=e.type,r=t.round||false,o=t.range;if(t.rangeStep!=null){o=RE(i,t,n)}else if(t.scheme){o=BE(i,t,n);if(Object(oe["E"])(o)){if(e.interpolator){return e.interpolator(o)}else{Object(oe["o"])(`Scale type ${i} does not support interpolating color schemes.`)}}}if(o&&Y_(i)){return e.interpolator(oO(IE(o,t.reverse),t.interpolate,t.interpolateGamma))}if(o&&t.interpolate&&e.interpolate){e.interpolate(cO(t.interpolate,t.interpolateGamma))}else if(Object(oe["E"])(e.round)){e.round(r)}else if(Object(oe["E"])(e.rangeRound)){e.interpolate(r?Ax:Ex)}if(o)e.range(IE(o,t.reverse))}function RE(e,t,n){if(e!==Jv&&e!==Xv){Object(oe["o"])("Only band and point scales support rangeStep.")}var i=(t.paddingOuter!=null?t.paddingOuter:t.padding)||0,r=e===Xv?1:(t.paddingInner!=null?t.paddingInner:t.padding)||0;return[0,t.rangeStep*Nv(n,r,i)]}function BE(e,t,n){var i=t.schemeExtent,r,o;if(Object(oe["B"])(t.scheme)){o=oO(t.scheme,t.interpolate,t.interpolateGamma)}else{r=t.scheme.toLowerCase();o=mO(r);if(!o)Object(oe["o"])(`Unrecognized scheme name: ${t.scheme}`)}n=e===Vv?n+1:e===Zv?n-1:e===Gv||e===Hv?+t.schemeCount||jE:n;return Y_(e)?PE(o,i,t.reverse):Object(oe["E"])(o)?sO(PE(o,i),n):e===Yv?o:o.slice(0,n)}function PE(e,t,n){return Object(oe["E"])(e)&&(t||n)?rO(e,IE(t||[0,1],n)):e}function IE(e,t){return t?e.slice().reverse():e}function LE(e){Pa.call(this,null,e)}Object(oe["z"])(LE,Pa,{transform(e,t){const n=e.modified("sort")||t.changed(t.ADD)||t.modified(e.sort.fields)||t.modified("datum");if(n)t.source.sort(ve(e.sort));this.modified(n);return t}});const UE="zero",qE="center",WE="normalize",GE=["y0","y1"];function HE(e){Pa.call(this,null,e)}HE.Definition={type:"Stack",metadata:{modifies:true},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:true},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:UE,values:[UE,qE,WE]},{name:"as",type:"string",array:true,length:2,default:GE}]};Object(oe["z"])(HE,Pa,{transform(e,t){var n=e.as||GE,i=n[0],r=n[1],o=ve(e.sort),s=e.field||oe["P"],a=e.offset===qE?VE:e.offset===WE?YE:XE,u,c,l,f;u=JE(t.source,e.groupby,o,s);for(c=0,l=u.length,f=u.max;ce(l),s,a,u,c,l,f,d,h,p;if(t==null){r.push(e.slice())}else{for(s={},a=0,u=e.length;ap)p=h;if(n)d.sort(n)}r.max=p;return r}function ZE(){}const QE=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];var KE=function(){var e=1,t=1,n=a;function i(e,t){return t.map(t=>r(e,t))}function r(e,t){var i=[],r=[];o(e,t,o=>{n(o,e,t);if(eA(o)>0)i.push([o]);else r.push(o)});r.forEach(e=>{for(var t=0,n=i.length,r;t=i;QE[f<<1].forEach(p);while(++u=i;QE[l|f<<1].forEach(p)}QE[f<<0].forEach(p);while(++c=i;d=n[c*e]>=i;QE[f<<1|d<<2].forEach(p);while(++u=i;h=d,d=n[c*e+u+1]>=i;QE[l|f<<1|d<<2|h<<3].forEach(p)}QE[f|d<<3].forEach(p)}u=-1;d=n[c*e]>=i;QE[d<<2].forEach(p);while(++u=i;QE[d<<2|h<<3].forEach(p)}QE[d<<3].forEach(p);function p(e){var t=[e[0][0]+u,e[0][1]+c],n=[e[1][0]+u,e[1][1]+c],i=s(t),l=s(n),f,d;if(f=a[i]){if(d=o[l]){delete a[f.end];delete o[d.start];if(f===d){f.ring.push(n);r(f.ring)}else{o[f.start]=a[d.end]={start:f.start,end:d.end,ring:f.ring.concat(d.ring)}}}else{delete a[f.end];f.ring.push(n);a[f.end=l]=f}}else if(f=o[l]){if(d=a[i]){delete o[f.start];delete a[d.end];if(f===d){f.ring.push(n);r(f.ring)}else{o[d.start]=a[f.end]={start:d.start,end:f.end,ring:d.ring.concat(f.ring)}}}else{delete o[f.start];f.ring.unshift(t);o[f.start=i]=f}}else{o[i]=a[l]={start:i,end:l,ring:[t,n]}}}}function s(t){return t[0]*2+t[1]*(e+1)*4}function a(n,i,r){n.forEach(n=>{var o=n[0],s=n[1],a=o|0,u=s|0,c,l=i[u*e+a];if(o>0&&o0&&s=0&&o>=0))Object(oe["o"])("invalid size");return e=r,t=o,i};i.smooth=function(e){return arguments.length?(n=e?a:ZE,i):n===a};return i};function eA(e){var t=0,n=e.length,i=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];while(++ti!==h>i&&n<(d-c)*(i-l)/(h-l)+c)r=-r}return r}function iA(e,t,n){var i;return rA(e,t,n)&&oA(e[i=+(e[0]===t[0])],n[i],t[i])}function rA(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function oA(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}var sA=function(e,t,n){return function(i){var r=Object(oe["q"])(i),o=n?Math.min(r[0],0):r[0],s=r[1],a=s-o,u=t?Vt(o,s,e):a/(e+1);return Sl(u,s,u)}};function aA(e){Pa.call(this,null,e)}aA.Definition={type:"Isocontour",metadata:{generates:true},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:true},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:false},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:true},{name:"smooth",type:"boolean",default:true},{name:"scale",type:"number",expr:true},{name:"translate",type:"number",array:true,expr:true},{name:"as",type:"string",null:true,default:"contour"}]};Object(oe["z"])(aA,Pa,{transform(e,t){if(this.value&&!t.changed()&&!e.modified()){return t.StopPropagation}var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=e.field||oe["y"],o=KE().smooth(e.smooth!==false),s=e.thresholds||uA(i,r,e),a=e.as===null?null:e.as||"contour",u=[];i.forEach(t=>{const n=r(t);const i=o.size([n.width,n.height])(n.values,Object(oe["B"])(s)?s:s(n.values));cA(i,n,t,e);i.forEach(e=>{u.push(me(t,pe(a!=null?{[a]:e}:e)))})});if(this.value)n.rem=this.value;this.value=n.source=n.add=u;return n}});function uA(e,t,n){const i=sA(n.levels||10,n.nice,n.zero!==false);return n.resolve!=="shared"?i:i(e.map(e=>su(t(e).values)))}function cA(e,t,n,i){let r=i.scale||t.scale,o=i.translate||t.translate;if(Object(oe["E"])(r))r=r(n,i);if(Object(oe["E"])(o))o=o(n,i);if((r===1||r==null)&&!o)return;const s=(Object(oe["F"])(r)?r:r[0])||1,a=(Object(oe["F"])(r)?r:r[1])||1,u=o&&o[0]||0,c=o&&o[1]||0;e.forEach(lA(t,s,a,u,c))}function lA(e,t,n,i,r){const o=e.x1||0,s=e.y1||0,a=t*n<0;function u(e){e.forEach(c)}function c(e){if(a)e.reverse();e.forEach(l)}function l(e){e[0]=(e[0]-o)*t+i;e[1]=(e[1]-s)*n+r}return function(e){e.coordinates.forEach(u);return e}}function fA(e,t,n){const i=e>=0?e:vu(t,n);return Math.round((Math.sqrt(4*i*i+1)-1)/2)}function dA(e){return Object(oe["E"])(e)?e:Object(oe["m"])(+e)}var hA=function(){var e=e=>e[0],t=e=>e[1],n=oe["P"],i=[-1,-1],r=960,o=500,s=2;function a(a,u){const c=fA(i[0],a,e)>>s,l=fA(i[1],a,t)>>s,f=c?c+2:0,d=l?l+2:0,h=2*f+(r>>s),p=2*d+(o>>s),g=new Float32Array(h*p),m=new Float32Array(h*p);let b=g;a.forEach(i=>{const r=f+(+e(i)>>s),o=d+(+t(i)>>s);if(r>=0&&r=0&&o0&&l>0){pA(h,p,g,m,c);gA(h,p,m,g,l);pA(h,p,g,m,c);gA(h,p,m,g,l);pA(h,p,g,m,c);gA(h,p,m,g,l)}else if(c>0){pA(h,p,g,m,c);pA(h,p,m,g,c);pA(h,p,g,m,c);b=m}else if(l>0){gA(h,p,g,m,l);gA(h,p,m,g,l);gA(h,p,g,m,l);b=m}const v=u?Math.pow(2,-2*s):1/wE(b);for(let e=0,t=h*p;e>s),y2:d+(o>>s)}}a.x=function(t){return arguments.length?(e=dA(t),a):e};a.y=function(e){return arguments.length?(t=dA(e),a):t};a.weight=function(e){return arguments.length?(n=dA(e),a):n};a.size=function(e){if(!arguments.length)return[r,o];var t=+e[0],n=+e[1];if(!(t>=0&&n>=0))Object(oe["o"])("invalid size");return r=t,o=n,a};a.cellSize=function(e){if(!arguments.length)return 1<=1))Object(oe["o"])("invalid cell size");s=Math.floor(Math.log(e)/Math.LN2);return a};a.bandwidth=function(e){if(!arguments.length)return i;e=Object(oe["i"])(e);if(e.length===1)e=[+e[0],+e[0]];if(e.length!==2)Object(oe["o"])("invalid bandwidth");return i=e,a};return a};function pA(e,t,n,i,r){const o=(r<<1)+1;for(let s=0;s=r){if(t>=o){a-=n[t-o+s*e]}i[t-r+s*e]=a/Math.min(t+1,e-1+o-t,o)}}}}function gA(e,t,n,i,r){const o=(r<<1)+1;for(let s=0;s=r){if(a>=o){u-=n[s+(a-o)*e]}i[s+(a-r)*e]=u/Math.min(a+1,t-1+o-a,o)}}}}function mA(e){Pa.call(this,null,e)}mA.Definition={type:"KDE2D",metadata:{generates:true},params:[{name:"size",type:"number",array:true,length:2,required:true},{name:"x",type:"field",required:true},{name:"y",type:"field",required:true},{name:"weight",type:"field"},{name:"groupby",type:"field",array:true},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:true,length:2},{name:"counts",type:"boolean",default:false},{name:"as",type:"string",default:"grid"}]};const bA=["x","y","weight","size","cellSize","bandwidth"];function vA(e,t){bA.forEach(n=>t[n]!=null?e[n](t[n]):0);return e}Object(oe["z"])(mA,Pa,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=yA(i,e.groupby),o=(e.groupby||[]).map(oe["h"]),s=vA(hA(),e),a=e.as||"grid",u=[];function c(e,t){for(let n=0;npe(c({[a]:s(t,e.counts)},t.dims)));if(this.value)n.rem=this.value;this.value=n.source=n.add=u;return n}});function yA(e,t){var n=[],i=e=>e(a),r,o,s,a,u,c;if(t==null){n.push(e)}else{for(r={},o=0,s=e.length;on.push(a(e)))}if(o&&s){t.visit(u,e=>{var t=o(e),n=s(e);if(t!=null&&n!=null&&(t=+t)===t&&(n=+n)===n){i.push([t,n])}});n=n.concat({type:_A,geometry:{type:OA,coordinates:i}})}this.value={type:wA,features:n}}});var kA=e=>e;function EA(e,t){if(e&&DA.hasOwnProperty(e.type)){DA[e.type](e,t)}}var AA={Feature:function(e,t){EA(e.geometry,t)},FeatureCollection:function(e,t){var n=e.features,i=-1,r=n.length;while(++i0){o=e[--t];while(t>0){n=o;i=e[--t];o=n+i;r=i-(o-n);if(r)break}if(t>0&&(r<0&&e[t-1]<0||r>0&&e[t-1]>0)){i=r*2;n=o+i;if(i==n-o)o=n}}return o}}var FA=function(e,t){const n=new $A;if(t===undefined){for(let t of e){if(t=+t){n.add(t)}}}else{let i=-1;for(let r of e){if(r=+t(r,++i,e)){n.add(r)}}}return+n};var NA=1e-6;var TA=1e-12;var zA=Math.PI;var RA=zA/2;var BA=zA/4;var PA=zA*2;var IA=180/zA;var LA=zA/180;var UA=Math.abs;var qA=Math.atan;var WA=Math.atan2;var GA=Math.cos;var HA=Math.ceil;var VA=Math.exp;var YA=Math.floor;var XA=Math.hypot;var JA=Math.log;var ZA=Math.pow;var QA=Math.sin;var KA=Math.sign||function(e){return e>0?1:e<0?-1:0};var eD=Math.sqrt;var tD=Math.tan;function nD(e){return e>1?0:e<-1?zA:Math.acos(e)}function iD(e){return e>1?RA:e<-1?-RA:Math.asin(e)}function rD(e){return(e=QA(e/2))*e}function oD(){}var sD=new $A,aD=new $A,uD,cD,lD,fD;var dD={point:oD,lineStart:oD,lineEnd:oD,polygonStart:function(){dD.lineStart=hD;dD.lineEnd=mD},polygonEnd:function(){dD.lineStart=dD.lineEnd=dD.point=oD;sD.add(UA(aD));aD=new $A},result:function(){var e=sD/2;sD=new $A;return e}};function hD(){dD.point=pD}function pD(e,t){dD.point=gD;uD=lD=e,cD=fD=t}function gD(e,t){aD.add(fD*e-lD*t);lD=e,fD=t}function mD(){gD(uD,cD)}var bD=dD;var vD=Infinity,yD=vD,xD=-vD,_D=xD;var wD={point:OD,lineStart:oD,lineEnd:oD,polygonStart:oD,polygonEnd:oD,result:function(){var e=[[vD,yD],[xD,_D]];xD=_D=-(yD=vD=Infinity);return e}};function OD(e,t){if(exD)xD=e;if(t_D)_D=t}var jD=wD;var kD=0,ED=0,AD=0,DD=0,SD=0,MD=0,CD=0,$D=0,FD=0,ND,TD,zD,RD;var BD={point:PD,lineStart:ID,lineEnd:qD,polygonStart:function(){BD.lineStart=WD;BD.lineEnd=GD},polygonEnd:function(){BD.point=PD;BD.lineStart=ID;BD.lineEnd=qD},result:function(){var e=FD?[CD/FD,$D/FD]:MD?[DD/MD,SD/MD]:AD?[kD/AD,ED/AD]:[NaN,NaN];kD=ED=AD=DD=SD=MD=CD=$D=FD=0;return e}};function PD(e,t){kD+=e;ED+=t;++AD}function ID(){BD.point=LD}function LD(e,t){BD.point=UD;PD(zD=e,RD=t)}function UD(e,t){var n=e-zD,i=t-RD,r=eD(n*n+i*i);DD+=r*(zD+e)/2;SD+=r*(RD+t)/2;MD+=r;PD(zD=e,RD=t)}function qD(){BD.point=PD}function WD(){BD.point=HD}function GD(){VD(ND,TD)}function HD(e,t){BD.point=VD;PD(ND=zD=e,TD=RD=t)}function VD(e,t){var n=e-zD,i=t-RD,r=eD(n*n+i*i);DD+=r*(zD+e)/2;SD+=r*(RD+t)/2;MD+=r;r=RD*e-zD*t;CD+=r*(zD+e);$D+=r*(RD+t);FD+=r*3;PD(zD=e,RD=t)}var YD=BD;function XD(e){this._context=e}XD.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){if(this._line===0)this._context.closePath();this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t);this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t);this._context.arc(e,t,this._radius,0,PA);break}}},result:oD};var JD=new $A,ZD,QD,KD,eS,tS;var nS={point:oD,lineStart:function(){nS.point=iS},lineEnd:function(){if(ZD)rS(QD,KD);nS.point=oD},polygonStart:function(){ZD=true},polygonEnd:function(){ZD=null},result:function(){var e=+JD;JD=new $A;return e}};function iS(e,t){nS.point=rS;QD=eS=e,KD=tS=t}function rS(e,t){eS-=e,tS-=t;JD.add(eD(eS*eS+tS*tS));eS=e,tS=t}var oS=nS;function sS(){this._string=[]}sS.prototype={_radius:4.5,_circle:aS(4.5),pointRadius:function(e){if((e=+e)!==this._radius)this._radius=e,this._circle=null;return this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){if(this._line===0)this._string.push("Z");this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._string.push("M",e,",",t);this._point=1;break}case 1:{this._string.push("L",e,",",t);break}default:{if(this._circle==null)this._circle=aS(this._radius);this._string.push("M",e,",",t,this._circle);break}}},result:function(){if(this._string.length){var e=this._string.join("");this._string=[];return e}else{return null}}};function aS(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+-2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}var uS=function(e,t){var n=4.5,i,r;function o(e){if(e){if(typeof n==="function")r.pointRadius(+n.apply(this,arguments));CA(e,i(r))}return r.result()}o.area=function(e){CA(e,i(bD));return bD.result()};o.measure=function(e){CA(e,i(oS));return oS.result()};o.bounds=function(e){CA(e,i(jD));return jD.result()};o.centroid=function(e){CA(e,i(YD));return YD.result()};o.projection=function(t){return arguments.length?(i=t==null?(e=null,kA):(e=t).stream,o):e};o.context=function(e){if(!arguments.length)return t;r=e==null?(t=null,new sS):new XD(t=e);if(typeof n!=="function")r.pointRadius(n);return o};o.pointRadius=function(e){if(!arguments.length)return n;n=typeof e==="function"?e:(r.pointRadius(+e),+e);return o};return o.projection(e).context(t)};var cS=function(){var e=[],t;return{point:function(e,n,i){t.push([e,n,i])},lineStart:function(){e.push(t=[])},lineEnd:oD,rejoin:function(){if(e.length>1)e.push(e.pop().concat(e.shift()))},result:function(){var n=e;e=[];t=null;return n}}};var lS=function(e,t){return UA(e[0]-t[0])=0;--a)r.point((f=l[a])[0],f[1])}else{i(d.x,d.p.x,-1,r)}d=d.p}d=d.o;l=d.z;h=!h}while(!d.v);r.lineEnd()}};function hS(e){if(!(t=e.length))return;var t,n=0,i=e[0],r;while(++n=0?1:-1,E=k*j,A=E>zA,D=m*w;u.add(WA(D*k*QA(E),b*O+D*GA(E)));s+=A?j+k*PA:j;if(A^p>=n^x>=n){var S=bS(gS(h),gS(y));xS(S);var M=bS(o,S);xS(M);var C=(A^j>=0?-1:1)*iD(M[2]);if(i>C||i===C&&(S[0]||S[1])){a+=A^j>=0?1:-1}}}}return(s<-NA||s0){if(!u)r.polygonStart(),u=true;r.lineStart();for(n=0;n1&&e&2)t.push(t.pop().concat(t.shift()));l.push(t.filter(ES))}return d}};function ES(e){return e.length>1}function AS(e,t){return((e=e.x)[0]<0?e[1]-RA-NA:RA-e[1])-((t=t.x)[0]<0?t[1]-RA-NA:RA-t[1])}var DS=kS((function(){return true}),SS,CS,[-zA,-RA]);function SS(e){var t=NaN,n=NaN,i=NaN,r;return{lineStart:function(){e.lineStart();r=1},point:function(o,s){var a=o>0?zA:-zA,u=UA(o-t);if(UA(u-zA)0?RA:-RA);e.point(i,n);e.lineEnd();e.lineStart();e.point(a,n);e.point(o,n);r=0}else if(i!==a&&u>=zA){if(UA(t-i)NA?qA((QA(t)*(o=GA(i))*QA(n)-QA(i)*(r=GA(t))*QA(e))/(r*o*s)):(t+i)/2}function CS(e,t,n,i){var r;if(e==null){r=n*RA;i.point(-zA,r);i.point(0,r);i.point(zA,r);i.point(zA,0);i.point(zA,-r);i.point(0,-r);i.point(-zA,-r);i.point(-zA,0);i.point(-zA,r)}else if(UA(e[0]-t[0])>NA){var o=e[0]zA?e+Math.round(-e/PA)*PA:e,t]}NS.invert=NS;function TS(e,t,n){return(e%=PA)?t||n?FS(RS(e),BS(t,n)):RS(e):t||n?BS(t,n):NS}function zS(e){return function(t,n){return t+=e,[t>zA?t-PA:t<-zA?t+PA:t,n]}}function RS(e){var t=zS(e);t.invert=zS(-e);return t}function BS(e,t){var n=GA(e),i=QA(e),r=GA(t),o=QA(t);function s(e,t){var s=GA(t),a=GA(e)*s,u=QA(e)*s,c=QA(t),l=c*n+a*i;return[WA(u*r-l*o,a*n-c*i),iD(l*r+u*o)]}s.invert=function(e,t){var s=GA(t),a=GA(e)*s,u=QA(e)*s,c=QA(t),l=c*r-u*o;return[WA(u*r+c*o,a*n+l*i),iD(l*n-a*i)]};return s}var PS=function(e){e=TS(e[0]*LA,e[1]*LA,e.length>2?e[2]*LA:0);function t(t){t=e(t[0]*LA,t[1]*LA);return t[0]*=IA,t[1]*=IA,t}t.invert=function(t){t=e.invert(t[0]*LA,t[1]*LA);return t[0]*=IA,t[1]*=IA,t};return t};function IS(e,t,n,i,r,o){if(!n)return;var s=GA(t),a=QA(t),u=i*n;if(r==null){r=t+i*PA;o=t-u/2}else{r=LS(s,r);o=LS(s,o);if(i>0?ro)r+=i*PA}for(var c,l=r;i>0?l>o:l0,r=UA(t)>NA;function o(t,i,r,o){IS(o,e,n,r,t,i)}function s(e,n){return GA(e)*GA(n)>t}function a(e){var t,n,o,a,l;return{lineStart:function(){a=o=false;l=1},point:function(f,d){var h=[f,d],p,g=s(f,d),m=i?g?0:c(f,d):g?c(f+(f<0?zA:-zA),d):0;if(!t&&(a=o=g))e.lineStart();if(g!==o){p=u(t,h);if(!p||lS(t,p)||lS(h,p))h[2]=1}if(g!==o){l=0;if(g){e.lineStart();p=u(h,t);e.point(p[0],p[1])}else{p=u(t,h);e.point(p[0],p[1],2);e.lineEnd()}t=p}else if(r&&t&&i^g){var b;if(!(m&n)&&(b=u(h,t,true))){l=0;if(i){e.lineStart();e.point(b[0][0],b[0][1]);e.point(b[1][0],b[1][1]);e.lineEnd()}else{e.point(b[1][0],b[1][1]);e.lineEnd();e.lineStart();e.point(b[0][0],b[0][1],3)}}}if(g&&(!t||!lS(t,h))){e.point(h[0],h[1])}t=h,o=g,n=m},lineEnd:function(){if(o)e.lineEnd();t=null},clean:function(){return l|(a&&o)<<1}}}function u(e,n,i){var r=gS(e),o=gS(n);var s=[1,0,0],a=bS(r,o),u=mS(a,a),c=a[0],l=u-c*c;if(!l)return!i&&e;var f=t*u/l,d=-t*c/l,h=bS(s,a),p=yS(s,f),g=yS(a,d);vS(p,g);var m=h,b=mS(p,m),v=mS(m,m),y=b*b-v*(mS(p,p)-1);if(y<0)return;var x=eD(y),_=yS(m,(-b-x)/v);vS(_,p);_=pS(_);if(!i)return _;var w=e[0],O=n[0],j=e[1],k=n[1],E;if(O0^_[1]<(UA(_[0]-w)zA^(w<=_[0]&&_[0]<=O)){var M=yS(m,(-b+x)/v);vS(M,p);return[_,pS(M)]}}function c(t,n){var r=i?e:zA-e,o=0;if(t<-r)o|=1;else if(t>r)o|=2;if(n<-r)o|=4;else if(n>r)o|=8;return o}return kS(s,a,o,i?[0,-e]:[-zA,e-zA])};var WS=function(e,t,n,i,r,o){var s=e[0],a=e[1],u=t[0],c=t[1],l=0,f=1,d=u-s,h=c-a,p;p=n-s;if(!d&&p>0)return;p/=d;if(d<0){if(p0){if(p>f)return;if(p>l)l=p}p=r-s;if(!d&&p<0)return;p/=d;if(d<0){if(p>f)return;if(p>l)l=p}else if(d>0){if(p0)return;p/=h;if(h<0){if(p0){if(p>f)return;if(p>l)l=p}p=o-a;if(!h&&p<0)return;p/=h;if(h<0){if(p>f)return;if(p>l)l=p}else if(h>0){if(p0)e[0]=s+l*d,e[1]=a+l*h;if(f<1)t[0]=s+f*d,t[1]=a+f*h;return true};var GS=1e9,HS=-GS;function VS(e,t,n,i){function r(r,o){return e<=r&&r<=n&&t<=o&&o<=i}function o(r,o,a,c){var l=0,f=0;if(r==null||(l=s(r,a))!==(f=s(o,a))||u(r,o)<0^a>0){do{c.point(l===0||l===3?e:n,l>1?i:t)}while((l=(l+a+4)%4)!==f)}else{c.point(o[0],o[1])}}function s(i,r){return UA(i[0]-e)0?0:3:UA(i[0]-n)0?2:1:UA(i[1]-t)0?1:0:r>0?3:2}function a(e,t){return u(e.x,t.x)}function u(e,t){var n=s(e,1),i=s(t,1);return n!==i?n-i:n===0?t[1]-e[1]:n===1?e[0]-t[0]:n===2?e[1]-t[1]:t[0]-e[0]}return function(s){var u=s,c=cS(),l,f,d,h,p,g,m,b,v,y,x;var _={point:w,lineStart:E,lineEnd:A,polygonStart:j,polygonEnd:k};function w(e,t){if(r(e,t))u.point(e,t)}function O(){var t=0;for(var n=0,r=f.length;ni&&(d-c)*(i-l)>(h-l)*(e-c))++t}else{if(h<=i&&(d-c)*(i-l)<(h-l)*(e-c))--t}}}return t}function j(){u=c,l=[],f=[],x=true}function k(){var e=O(),t=x&&e,n=(l=jS(l)).length;if(t||n){s.polygonStart();if(t){s.lineStart();o(null,null,1,s);s.lineEnd()}if(n){dS(l,a,e,o,s)}s.polygonEnd()}u=s,l=f=d=null}function E(){_.point=D;if(f)f.push(d=[]);y=true;v=false;m=b=NaN}function A(){if(l){D(h,p);if(g&&v)c.rejoin();l.push(c.result())}_.point=w;if(v)u.lineEnd()}function D(o,s){var a=r(o,s);if(f)d.push([o,s]);if(y){h=o,p=s,g=a;y=false;if(a){u.lineStart();u.point(o,s)}}else{if(a&&v)u.point(o,s);else{var c=[m=Math.max(HS,Math.min(GS,m)),b=Math.max(HS,Math.min(GS,b))],l=[o=Math.max(HS,Math.min(GS,o)),s=Math.max(HS,Math.min(GS,s))];if(WS(c,l,e,t,n,i)){if(!v){u.lineStart();u.point(c[0],c[1])}u.point(l[0],l[1]);if(!a)u.lineEnd();x=false}else if(a){u.lineStart();u.point(o,s);x=false}}}m=o,b=s,v=a}return _}}var YS=function(e){return{stream:XS(e)}};function XS(e){return function(t){var n=new JS;for(var i in e)n[i]=e[i];n.stream=t;return n}}function JS(){}JS.prototype={constructor:JS,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function ZS(e,t,n){var i=e.clipExtent&&e.clipExtent();e.scale(150).translate([0,0]);if(i!=null)e.clipExtent(null);CA(n,e.stream(jD));t(jD.result());if(i!=null)e.clipExtent(i);return e}function QS(e,t,n){return ZS(e,(function(n){var i=t[1][0]-t[0][0],r=t[1][1]-t[0][1],o=Math.min(i/(n[1][0]-n[0][0]),r/(n[1][1]-n[0][1])),s=+t[0][0]+(i-o*(n[1][0]+n[0][0]))/2,a=+t[0][1]+(r-o*(n[1][1]+n[0][1]))/2;e.scale(150*o).translate([s,a])}),n)}function KS(e,t,n){return QS(e,[[0,0],t],n)}function eM(e,t,n){return ZS(e,(function(n){var i=+t,r=i/(n[1][0]-n[0][0]),o=(i-r*(n[1][0]+n[0][0]))/2,s=-r*n[0][1];e.scale(150*r).translate([o,s])}),n)}function tM(e,t,n){return ZS(e,(function(n){var i=+t,r=i/(n[1][1]-n[0][1]),o=-r*n[0][0],s=(i-r*(n[1][1]+n[0][1]))/2;e.scale(150*r).translate([o,s])}),n)}var nM=16,iM=GA(30*LA);var rM=function(e,t){return+t?sM(e,t):oM(e)};function oM(e){return XS({point:function(t,n){t=e(t,n);this.stream.point(t[0],t[1])}})}function sM(e,t){function n(i,r,o,s,a,u,c,l,f,d,h,p,g,m){var b=c-i,v=l-r,y=b*b+v*v;if(y>4*t&&g--){var x=s+d,_=a+h,w=u+p,O=eD(x*x+_*_+w*w),j=iD(w/=O),k=UA(UA(w)-1)t||UA((b*S+v*M)/y-.5)>.3||s*d+a*h+u*p2?e[2]%360*LA:0,S()):[a*IA,u*IA,c*IA]};A.angle=function(e){return arguments.length?(f=e%360*LA,S()):f*IA};A.reflectX=function(e){return arguments.length?(d=e?-1:1,S()):d<0};A.reflectY=function(e){return arguments.length?(h=e?-1:1,S()):h<0};A.precision=function(e){return arguments.length?(w=rM(O,_=e*e),M()):eD(_)};A.fitExtent=function(e,t){return QS(A,e,t)};A.fitSize=function(e,t){return KS(A,e,t)};A.fitWidth=function(e,t){return eM(A,e,t)};A.fitHeight=function(e,t){return tM(A,e,t)};function S(){var e=lM(n,0,0,d,h,f).apply(null,t(o,s)),p=lM(n,i-e[0],r-e[1],d,h,f);l=TS(a,u,c);O=FS(t,p);j=FS(l,O);w=rM(O,_);return M()}function M(){k=E=null;return A}return function(){t=e.apply(this,arguments);A.invert=t.invert&&D;return S()}}function hM(e){var t=0,n=zA/3,i=dM(e),r=i(t,n);r.parallels=function(e){return arguments.length?i(t=e[0]*LA,n=e[1]*LA):[t*IA,n*IA]};return r}function pM(e){var t=GA(e);function n(e,n){return[e*t,QA(n)/t]}n.invert=function(e,n){return[e/t,iD(n*t)]};return n}function gM(e,t){var n=QA(e),i=(n+QA(t))/2;if(UA(i)=.12&&a<.234&&o>=-.425&&o<-.214?r:a>=.166&&a<.234&&o>=-.214&&o<-.115?s:n).invert(e)};l.stream=function(i){return e&&t===i?e:e=vM([n.stream(t=i),r.stream(i),s.stream(i)])};l.precision=function(e){if(!arguments.length)return n.precision();n.precision(e),r.precision(e),s.precision(e);return f()};l.scale=function(e){if(!arguments.length)return n.scale();n.scale(e),r.scale(e*.35),s.scale(e);return l.translate(n.translate())};l.translate=function(e){if(!arguments.length)return n.translate();var t=n.scale(),u=+e[0],l=+e[1];i=n.translate(e).clipExtent([[u-.455*t,l-.238*t],[u+.455*t,l+.238*t]]).stream(c);o=r.translate([u-.307*t,l+.201*t]).clipExtent([[u-.425*t+NA,l+.12*t+NA],[u-.214*t-NA,l+.234*t-NA]]).stream(c);a=s.translate([u-.205*t,l+.212*t]).clipExtent([[u-.214*t+NA,l+.166*t+NA],[u-.115*t-NA,l+.234*t-NA]]).stream(c);return f()};l.fitExtent=function(e,t){return QS(l,e,t)};l.fitSize=function(e,t){return KS(l,e,t)};l.fitWidth=function(e,t){return eM(l,e,t)};l.fitHeight=function(e,t){return tM(l,e,t)};function f(){e=t=null;return l}return l.scale(1070)};function xM(e){return function(t,n){var i=GA(t),r=GA(n),o=e(i*r);if(o===Infinity)return[2,0];return[o*r*QA(t),o*QA(n)]}}function _M(e){return function(t,n){var i=eD(t*t+n*n),r=e(i),o=QA(r),s=GA(r);return[WA(t*o,i*s),iD(i&&n*o/i)]}}var wM=xM((function(e){return eD(2/(1+e))}));wM.invert=_M((function(e){return 2*iD(e/2)}));var OM=function(){return fM(wM).scale(124.75).clipAngle(180-.001)};var jM=xM((function(e){return(e=nD(e))&&e/QA(e)}));jM.invert=_M((function(e){return e}));var kM=function(){return fM(jM).scale(79.4188).clipAngle(180-.001)};function EM(e,t){return[e,JA(tD((RA+t)/2))]}EM.invert=function(e,t){return[e,2*qA(VA(t))-RA]};var AM=function(){return DM(EM).scale(961/PA)};function DM(e){var t=fM(e),n=t.center,i=t.scale,r=t.translate,o=t.clipExtent,s=null,a,u,c;t.scale=function(e){return arguments.length?(i(e),l()):i()};t.translate=function(e){return arguments.length?(r(e),l()):r()};t.center=function(e){return arguments.length?(n(e),l()):n()};t.clipExtent=function(e){return arguments.length?(e==null?s=a=u=c=null:(s=+e[0][0],a=+e[0][1],u=+e[1][0],c=+e[1][1]),l()):s==null?null:[[s,a],[u,c]]};function l(){var n=zA*i(),r=t(PS(t.rotate()).invert([0,0]));return o(s==null?[[r[0]-n,r[1]-n],[r[0]+n,r[1]+n]]:e===EM?[[Math.max(r[0]-n,s),a],[Math.min(r[0]+n,u),c]]:[[s,Math.max(r[1]-n,a)],[u,Math.min(r[1]+n,c)]])}return l()}function SM(e){return tD((RA+e)/2)}function MM(e,t){var n=GA(e),i=e===t?QA(e):JA(n/GA(t))/JA(SM(t)/SM(e)),r=n*ZA(SM(e),i)/i;if(!i)return EM;function o(e,t){if(r>0){if(t<-RA+NA)t=-RA+NA}else{if(t>RA-NA)t=RA-NA}var n=r/ZA(SM(t),i);return[n*QA(i*e),r-n*GA(i*e)]}o.invert=function(e,t){var n=r-t,o=KA(i)*eD(e*e+n*n),s=WA(e,UA(n))*KA(n);if(n*i<0)s-=zA*KA(e)*KA(n);return[s/i,2*qA(ZA(r/o,1/i))-RA]};return o}var CM=function(){return hM(MM).scale(109.5).parallels([30,30])};function $M(e,t){return[e,t]}$M.invert=$M;var FM=function(){return fM($M).scale(152.63)};function NM(e,t){var n=GA(e),i=e===t?QA(e):(n-GA(t))/(t-e),r=n/i+e;if(UA(i)NA&&--i>0);return[e/(.8707+(o=n*n)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),n]};var YM=function(){return fM(VM).scale(175.295)};function XM(e,t){return[GA(t)*QA(e),QA(t)]}XM.invert=_M(iD);var JM=function(){return fM(XM).scale(249.5).clipAngle(90+NA)};function ZM(e,t){var n=GA(t),i=1+GA(e)*n;return[n*QA(e)/i,QA(t)/i]}ZM.invert=_M((function(e){return 2*qA(e)}));var QM=function(){return fM(ZM).scale(250).clipAngle(142)};function KM(e,t){return[JA(tD((RA+t)/2)),-e]}KM.invert=function(e,t){return[-t,2*qA(VA(e))-RA]};var eC=function(){var e=DM(KM),t=e.center,n=e.rotate;e.center=function(e){return arguments.length?t([-e[1],e[0]]):(e=t(),[e[1],-e[0]])};e.rotate=function(e){return arguments.length?n([e[0],e[1],e.length>2?e[2]+90:90]):(e=n(),[e[0],e[1],e[2]-90])};return n([0,0,90]).scale(159.155)};var tC=Math.abs;var nC=Math.atan;var iC=Math.atan2;var rC=Math.ceil;var oC=Math.cos;var sC=Math.exp;var aC=Math.floor;var uC=Math.log;var cC=Math.max;var lC=Math.min;var fC=Math.pow;var dC=Math.round;var hC=Math.sign||function(e){return e>0?1:e<0?-1:0};var pC=Math.sin;var gC=Math.tan;var mC=1e-6;var bC=1e-12;var vC=Math.PI;var yC=vC/2;var xC=vC/4;var _C=Math.SQRT1_2;var wC=MC(2);var OC=MC(vC);var jC=vC*2;var kC=180/vC;var EC=vC/180;function AC(e){return e?e/Math.sin(e):1}function DC(e){return e>1?yC:e<-1?-yC:Math.asin(e)}function SC(e){return e>1?0:e<-1?vC:Math.acos(e)}function MC(e){return e>0?Math.sqrt(e):0}function CC(e){e=sC(2*e);return(e-1)/(e+1)}function $C(e){return(sC(e)-sC(-e))/2}function FC(e){return(sC(e)+sC(-e))/2}function NC(e){return uC(e+MC(e*e+1))}function TC(e){return uC(e+MC(e*e-1))}function zC(e,t){var n=e*pC(t),i=30,r;do{t-=r=(t+pC(t)-n)/(1+oC(t))}while(tC(r)>mC&&--i>0);return t/2}function RC(e,t,n){function i(i,r){return[e*i*oC(r=zC(n,r)),t*pC(r)]}i.invert=function(i,r){return r=DC(r/t),[i/(e*oC(r)),DC((2*r+pC(2*r))/n)]};return i}var BC=RC(wC/yC,wC,vC);var PC=function(){return fM(BC).scale(169.529)};const IC=uS();const LC=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function UC(e,t){return function n(){const i=t();i.type=e;i.path=uS().projection(i);i.copy=i.copy||function(){const e=n();LC.forEach(t=>{if(i[t])e[t](i[t]())});e.path.pointRadius(i.path.pointRadius());return e};return i}}function qC(e,t){if(!e||typeof e!=="string"){throw new Error("Projection type must be a name string.")}e=e.toLowerCase();if(arguments.length>1){GC[e]=UC(e,t);return this}else{return GC[e]||null}}function WC(e){return e&&e.path||IC}const GC={albers:bM,albersusa:yM,azimuthalequalarea:OM,azimuthalequidistant:kM,conicconformal:CM,conicequalarea:mM,conicequidistant:TM,equalEarth:qM,equirectangular:FM,gnomonic:GM,identity:HM,mercator:AM,mollweide:PC,naturalEarth1:YM,orthographic:JM,stereographic:QM,transversemercator:eC};for(const Tue in GC){qC(Tue,GC[Tue])}function HC(e){Pa.call(this,null,e)}HC.Definition={type:"GeoPath",metadata:{modifies:true},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:true},{name:"as",type:"string",default:"path"}]};Object(oe["z"])(HC,Pa,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.field||oe["y"],o=e.as||"path",s=n.SOURCE;if(!i||e.modified()){this.value=i=WC(e.projection);n.materialize().reflow()}else{s=r===oe["y"]||t.modified(r.fields)?n.ADD_MOD:n.ADD}var a=VC(i,e.pointRadius);n.visit(s,e=>e[o]=i(r(e)));i.pointRadius(a);return n.modifies(o)}});function VC(e,t){var n=e.pointRadius();e.context(null);if(t!=null){e.pointRadius(t)}return n}function YC(e){Pa.call(this,null,e)}YC.Definition={type:"GeoPoint",metadata:{modifies:true},params:[{name:"projection",type:"projection",required:true},{name:"fields",type:"field",array:true,required:true,length:2},{name:"as",type:"string",array:true,length:2,default:["x","y"]}]};Object(oe["z"])(YC,Pa,{transform(e,t){var n=e.projection,i=e.fields[0],r=e.fields[1],o=e.as||["x","y"],s=o[0],a=o[1],u;function c(e){var t=n([i(e),r(e)]);if(t){e[s]=t[0];e[a]=t[1]}else{e[s]=undefined;e[a]=undefined}}if(e.modified()){t=t.materialize().reflow(true).visit(t.SOURCE,c)}else{u=t.modified(i.fields)||t.modified(r.fields);t.visit(u?t.ADD_MOD:t.ADD,c)}return t.modifies(o)}});function XC(e){Pa.call(this,null,e)}XC.Definition={type:"GeoShape",metadata:{modifies:true,nomod:true},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:true},{name:"as",type:"string",default:"shape"}]};Object(oe["z"])(XC,Pa,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.as||"shape",o=n.ADD;if(!i||e.modified()){this.value=i=JC(WC(e.projection),e.field||Object(oe["u"])("datum"),e.pointRadius);n.materialize().reflow();o=n.SOURCE}n.visit(o,e=>e[r]=i);return n.modifies(r)}});function JC(e,t,n){var i=n==null?n=>e(t(n)):i=>{var r=e.pointRadius(),o=e.pointRadius(n)(t(i));e.pointRadius(r);return o};i.context=t=>{e.context(t);return i};return i}function ZC(e,t,n){var i=Sl(e,t-NA,n).concat(t);return function(e){return i.map((function(t){return[e,t]}))}}function QC(e,t,n){var i=Sl(e,t-NA,n).concat(t);return function(e){return i.map((function(t){return[t,e]}))}}function KC(){var e,t,n,i,r,o,s,a,u=10,c=u,l=90,f=360,d,h,p,g,m=2.5;function b(){return{type:"MultiLineString",coordinates:v()}}function v(){return Sl(HA(i/l)*l,n,l).map(p).concat(Sl(HA(a/f)*f,s,f).map(g)).concat(Sl(HA(t/u)*u,e,u).filter((function(e){return UA(e%l)>NA})).map(d)).concat(Sl(HA(o/c)*c,r,c).filter((function(e){return UA(e%f)>NA})).map(h))}b.lines=function(){return v().map((function(e){return{type:"LineString",coordinates:e}}))};b.outline=function(){return{type:"Polygon",coordinates:[p(i).concat(g(s).slice(1),p(n).reverse().slice(1),g(a).reverse().slice(1))]}};b.extent=function(e){if(!arguments.length)return b.extentMinor();return b.extentMajor(e).extentMinor(e)};b.extentMajor=function(e){if(!arguments.length)return[[i,a],[n,s]];i=+e[0][0],n=+e[1][0];a=+e[0][1],s=+e[1][1];if(i>n)e=i,i=n,n=e;if(a>s)e=a,a=s,s=e;return b.precision(m)};b.extentMinor=function(n){if(!arguments.length)return[[t,o],[e,r]];t=+n[0][0],e=+n[1][0];o=+n[0][1],r=+n[1][1];if(t>e)n=t,t=e,e=n;if(o>r)n=o,o=r,r=n;return b.precision(m)};b.step=function(e){if(!arguments.length)return b.stepMinor();return b.stepMajor(e).stepMinor(e)};b.stepMajor=function(e){if(!arguments.length)return[l,f];l=+e[0],f=+e[1];return b};b.stepMinor=function(e){if(!arguments.length)return[u,c];u=+e[0],c=+e[1];return b};b.precision=function(u){if(!arguments.length)return m;m=+u;d=ZC(o,r,90);h=QC(t,e,m);p=ZC(a,s,90);g=QC(i,n,m);return b};return b.extentMajor([[-180,-90+NA],[180,90-NA]]).extentMinor([[-180,-80-NA],[180,80+NA]])}function e$(){return KC()()}function t$(e){Pa.call(this,[],e);this.generator=KC()}t$.Definition={type:"Graticule",metadata:{changes:true,generates:true},params:[{name:"extent",type:"array",array:true,length:2,content:{type:"number",array:true,length:2}},{name:"extentMajor",type:"array",array:true,length:2,content:{type:"number",array:true,length:2}},{name:"extentMinor",type:"array",array:true,length:2,content:{type:"number",array:true,length:2}},{name:"step",type:"number",array:true,length:2},{name:"stepMajor",type:"number",array:true,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:true,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]};Object(oe["z"])(t$,Pa,{transform(e,t){var n=this.value,i=this.generator,r;if(!n.length||e.modified()){for(var o in e){if(Object(oe["E"])(i[o])){i[o](e[o])}}}r=i();if(n.length){t.mod.push(be(n[0],r))}else{t.add.push(pe(r))}n[0]=r;return t}});function n$(e){Pa.call(this,null,e)}n$.Definition={type:"heatmap",metadata:{modifies:true},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:true},{name:"opacity",type:"number",expr:true},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]};Object(oe["z"])(n$,Pa,{transform(e,t){if(!t.changed()&&!e.modified()){return t.StopPropagation}var n=t.materialize(t.SOURCE).source,i=e.resolve==="shared",r=e.field||oe["y"],o=r$(e.opacity,e),s=i$(e.color,e),a=e.as||"image",u={$x:0,$y:0,$value:0,$max:i?su(n.map(e=>su(r(e).values))):0};n.forEach(e=>{const t=r(e);const n=Object(oe["p"])({},e,u);if(!i)n.$max=su(t.values||[]);e[a]=s$(t,n,s.dep?s:Object(oe["m"])(s(n)),o.dep?o:Object(oe["m"])(o(n)))});return t.reflow(true).modifies(a)}});function i$(e,t){let n;if(Object(oe["E"])(e)){n=n=>Gy(e(n,t));n.dep=o$(e)}else{n=Object(oe["m"])(Gy(e||"#888"))}return n}function r$(e,t){let n;if(Object(oe["E"])(e)){n=n=>e(n,t);n.dep=o$(e)}else if(e){n=Object(oe["m"])(e)}else{n=e=>e.$value/e.$max||0;n.dep=true}return n}function o$(e){if(!Object(oe["E"])(e))return false;const t=Object(oe["eb"])(Object(oe["g"])(e));return t.$x||t.$y||t.$value||t.$max}function s$(e,t,n,i){const r=e.width,o=e.height,s=e.x1||0,a=e.y1||0,u=e.x2||r,c=e.y2||o,l=e.values,f=l?e=>l[e]:oe["lb"],d=eg(u-s,c-a),h=d.getContext("2d"),p=h.getImageData(0,0,u-s,c-a),g=p.data;for(let m=a,b=0;m{if(e[t]!=null)l$(n,t,e[t])})}else{LC.forEach(t=>{if(e.modified(t))l$(n,t,e[t])})}if(e.pointRadius!=null)n.path.pointRadius(e.pointRadius);if(e.fit)u$(n,e);return t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function u$(e,t){var n=f$(t.fit);t.extent?e.fitExtent(t.extent,n):t.size?e.fitSize(t.size,n):0}function c$(e){var t=qC((e||"mercator").toLowerCase());if(!t)Object(oe["o"])("Unrecognized projection type: "+e);return t()}function l$(e,t,n){if(Object(oe["E"])(e[t]))e[t](n)}function f$(e){e=Object(oe["i"])(e);return e.length===1?e[0]:{type:wA,features:e.reduce((e,t)=>e.concat(d$(t)),[])}}function d$(e){return e.type===wA?e.features:Object(oe["i"])(e).filter(e=>e!=null).map(e=>e.type===_A?e:{type:_A,geometry:e})}var h$=function(e,t){var n,i=1;if(e==null)e=0;if(t==null)t=0;function r(){var r,o=n.length,s,a=0,u=0;for(r=0;r=(f=(a+c)/2))a=f;else c=f;if(m=n>=(d=(u+l)/2))u=d;else l=d;if(r=o,!(o=o[b=m<<1|g]))return r[b]=s,e}h=+e._x.call(null,o.data);p=+e._y.call(null,o.data);if(t===h&&n===p)return s.next=o,r?r[b]=s:e._root=s,e;do{r=r?r[b]=new Array(4):e._root=new Array(4);if(g=t>=(f=(a+c)/2))a=f;else c=f;if(m=n>=(d=(u+l)/2))u=d;else l=d}while((b=m<<1|g)===(v=(p>=d)<<1|h>=f));return r[v]=o,r[b]=s,e}function m$(e){var t,n,i=e.length,r,o,s=new Array(i),a=new Array(i),u=Infinity,c=Infinity,l=-Infinity,f=-Infinity;for(n=0;nl)l=r;if(of)f=o}if(u>l||c>f)return this;this.cover(u,c).cover(l,f);for(n=0;ne||e>=r||i>t||t>=o){c=(tl||(a=p.y0)>f||(u=p.x1)=b)<<1|e>=m){p=d[d.length-1];d[d.length-1]=d[d.length-1-g];d[d.length-1-g]=p}}else{var v=e-+this._x.call(null,h.data),y=t-+this._y.call(null,h.data),x=v*v+y*y;if(x=(d=(s+u)/2))s=d;else u=d;if(g=f>=(h=(a+c)/2))a=h;else c=h;if(!(t=n,n=n[m=g<<1|p]))return this;if(!n.length)break;if(t[m+1&3]||t[m+2&3]||t[m+3&3])i=t,b=m}while(n.data!==e)if(!(r=n,n=n.next))return this;if(o=n.next)delete n.next;if(r)return o?r.next=o:delete r.next,this;if(!t)return this._root=o,this;o?t[m]=o:delete t[m];if((n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length){if(i)i[b]=n;else this._root=n}return this};function O$(e){for(var t=0,n=e.length;tc.index){var g=l-a.x-a.vx,m=f-a.y-a.vy,b=g*g+m*m;if(bl+p||of+p||se.r){e.r=e[t].r}}}function u(){if(!t)return;var i,r=t.length,o;n=new Array(r);for(i=0;i{}};function U$(){for(var e=0,t=arguments.length,n={},i;e=0)n=e.slice(i+1),e=e.slice(0,i);if(e&&!t.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:n}}))}q$.prototype=U$.prototype={constructor:q$,on:function(e,t){var n=this._,i=W$(e+"",n),r,o=-1,s=i.length;if(arguments.length<2){while(++o0)for(var n=new Array(r),i=0,r,o;i=0)e._call.call(null,t);e=e._next}--Y$}function lF(){tF=(eF=iF.now())+nF;Y$=X$=0;try{cF()}finally{Y$=0;dF();tF=0}}function fF(){var e=iF.now(),t=e-eF;if(t>Z$)nF-=t,eF=e}function dF(){var e,t=Q$,n,i=Infinity;while(t){if(t._call){if(i>t._time)i=t._time;e=t,t=t._next}else{n=t._next,t._next=null;t=e?e._next=n:Q$=n}}K$=e;hF(i)}function hF(e){if(Y$)return;if(X$)X$=clearTimeout(X$);var t=e-tF;if(t>24){if(e(e=(pF*e+gF)%mF)/mF};function vF(e){return e.x}function yF(e){return e.y}var xF=10,_F=Math.PI*(3-Math.sqrt(5));var wF=function(e){var t,n=1,i=.001,r=1-Math.pow(i,1/300),o=0,s=.6,a=new Map,u=uF(f),c=V$("tick","end"),l=bF();if(e==null)e=[];function f(){d();c.call("tick",t);if(n1?(n==null?a.delete(e):a.set(e,p(n)),t):a.get(e)},find:function(t,n,i){var r=0,o=e.length,s,a,u,c,l;if(i==null)i=Infinity;else i*=i;for(r=0;r1?(c.on(e,n),t):c.on(e)}}};var OF=function(){var e,t,n,i,r=z$(-30),o,s=1,a=Infinity,u=.81;function c(n){var r,o=e.length,s=$$(e,vF,yF).visitAfter(f);for(i=n,r=0;r=a)return;if(e.data!==t||e.next){if(f===0)f=R$(n),p+=f*f;if(d===0)d=R$(n),p+=d*d;if(p[t(e,n,s),e])),f;for(n=0,a=new Array(r);n=0;)n.tick()}else{if(n.stopped())n.restart();if(!i)return t.StopPropagation}}return this.finish(e,t)},finish(e,t){const n=t.dataflow;for(let a=this._argops,u=0,c=a.length,l;ue.touch(t).run()}function zF(e,t){const n=wF(e),i=n.stop,r=n.restart;let o=false;n.stopped=()=>o;n.restart=()=>(o=false,r());n.stop=()=>(o=true,i());return RF(n,t,true).on("end",()=>o=true)}function RF(e,t,n,i){var r=Object(oe["i"])(t.forces),o,s,a,u;for(o=0,s=CF.length;ot(e,n):t)}var LF=function(e,t,n){var i={};e.each(e=>{var r=e.data;if(n(r))i[t(r)]=e});e.lookup=i;return e};function UF(e){var t=0,n=e.children,i=n&&n.length;if(!i)t=1;else while(--i>=0)t+=n[i].value;e.value=t}var qF=function(){return this.eachAfter(UF)};var WF=function(e,t){let n=-1;for(const i of this){e.call(t,i,++n,this)}return this};var GF=function(e,t){var n=this,i=[n],r,o,s=-1;while(n=i.pop()){e.call(t,n,++s,this);if(r=n.children){for(o=r.length-1;o>=0;--o){i.push(r[o])}}}return this};var HF=function(e,t){var n=this,i=[n],r=[],o,s,a,u=-1;while(n=i.pop()){r.push(n);if(o=n.children){for(s=0,a=o.length;s=0)n+=i[r].value;t.value=n}))};var XF=function(e){return this.eachBefore((function(t){if(t.children){t.children.sort(e)}}))};var JF=function(e){var t=this,n=ZF(t,e),i=[t];while(t!==n){t=t.parent;i.push(t)}var r=i.length;while(e!==n){i.splice(r,0,e);e=e.parent}return i};function ZF(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;e=n.pop();t=i.pop();while(e===t){r=e;e=n.pop();t=i.pop()}return r}var QF=function(){var e=this,t=[e];while(e=e.parent){t.push(e)}return t};var KF=function(){return Array.from(this)};var eN=function(){var e=[];this.eachBefore((function(t){if(!t.children){e.push(t)}}));return e};var tN=function(){var e=this,t=[];e.each((function(n){if(n!==e){t.push({source:n.parent,target:n})}}));return t};var nN=function*(){var e=this,t,n=[e],i,r,o;do{t=n.reverse(),n=[];while(e=t.pop()){yield e;if(i=e.children){for(r=0,o=i.length;r=0;--a){r.push(o=s[a]=new cN(s[a]));o.parent=i;o.depth=i.depth+1}}}return n.eachBefore(uN)}function rN(){return iN(this).eachBefore(aN)}function oN(e){return e.children}function sN(e){return Array.isArray(e)?e[1]:null}function aN(e){if(e.data.value!==undefined)e.value=e.data.value;e.data=e.data.data}function uN(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function cN(e){this.data=e;this.depth=this.height=0;this.parent=null}cN.prototype=iN.prototype={constructor:cN,count:qF,each:WF,eachAfter:HF,eachBefore:GF,find:VF,sum:YF,sort:XF,path:JF,ancestors:QF,descendants:KF,leaves:eN,links:tN,copy:rN,[Symbol.iterator]:nN};function lN(e){Pa.call(this,null,e)}lN.Definition={type:"Nest",metadata:{treesource:true,changes:true},params:[{name:"keys",type:"field",array:true},{name:"generate",type:"boolean"}]};const fN=e=>e.values;Object(oe["z"])(lN,Pa,{transform(e,t){if(!t.source){Object(oe["o"])("Nest transform requires an upstream data source.")}var n=e.generate,i=e.modified(),r=t.clone(),o=this.value;if(!o||i||t.changed()){if(o){o.each(e=>{if(e.children&&fe(e.data)){r.rem.push(e.data)}})}this.value=o=iN({values:Object(oe["i"])(e.keys).reduce((e,t)=>{e.key(t);return e},dN()).entries(r.source)},fN);if(n){o.each(e=>{if(e.children){e=pe(e.data);r.add.push(e);r.source.push(e)}})}LF(o,de,de)}r.source.root=o;return r}});function dN(){const e=[],t={entries:e=>i(n(e,0),0),key:n=>(e.push(n),t)};function n(t,i){if(i>=e.length){return t}const r=t.length,o=e[i++],s={},a={};let u=-1,c,l,f;while(++ue.length)return t;const r=[];for(const e in t){r.push({key:e,values:i(t[e],n)})}return r}return t}function hN(e){Pa.call(this,null,e)}const pN=(e,t)=>e.parent===t.parent?1:2;Object(oe["z"])(hN,Pa,{transform(e,t){if(!t.source||!t.source.root){Object(oe["o"])(this.constructor.name+" transform requires a backing tree data source.")}const n=this.layout(e.method),i=this.fields,r=t.source.root,o=e.as||i;if(e.field)r.sum(e.field);else r.count();if(e.sort)r.sort(ve(e.sort,e=>e.data));gN(n,this.params,e);if(n.separation){n.separation(e.separation!==false?pN:oe["P"])}try{this.value=n(r)}catch(s){Object(oe["o"])(s)}r.each(e=>mN(e,i,o));return t.reflow(e.modified()).modifies(o).modifies("leaf")}});function gN(e,t,n){for(let i,r=0,o=t.length;r0&&n*n>i*i+r*r}function ON(e,t){for(var n=0;nu){r=(c+u-o)/(2*c);a=Math.sqrt(Math.max(0,u/c-r*r));n.x=e.x-r*i-a*s;n.y=e.y-r*s+a*i}else{r=(c+o-u)/(2*c);a=Math.sqrt(Math.max(0,o/c-r*r));n.x=t.x+r*i-a*s;n.y=t.y+r*s+a*i}}else{n.x=t.x+n.r;n.y=t.y}}function SN(e,t){var n=e.r+t.r-1e-6,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function MN(e){var t=e._,n=e.next._,i=t.r+n.r,r=(t.x*n.r+n.x*t.r)/i,o=(t.y*n.r+n.y*t.r)/i;return r*r+o*o}function CN(e){this._=e;this.next=null;this.previous=null}function $N(e){if(!(r=(e=bN(e)).length))return 0;var t,n,i,r,o,s,a,u,c,l,f;t=e[0],t.x=0,t.y=0;if(!(r>1))return t.r;n=e[1],t.x=-n.r,n.x=t.r,n.y=0;if(!(r>2))return t.r+n.r;DN(n,t,i=e[2]);t=new CN(t),n=new CN(n),i=new CN(i);t.next=i.previous=n;n.next=t.previous=i;i.next=n.previous=t;e:for(a=3;a0)throw new Error("cycle");return a}n.id=function(t){return arguments.length?(e=TN(t),n):e};n.parentId=function(e){return arguments.length?(t=TN(e),n):t};return n};function tT(e){Pa.call(this,null,e)}tT.Definition={type:"Stratify",metadata:{treesource:true},params:[{name:"key",type:"field",required:true},{name:"parentKey",type:"field",required:true}]};Object(oe["z"])(tT,Pa,{transform(e,t){if(!t.source){Object(oe["o"])("Stratify transform requires an upstream data source.")}let n=this.value;const i=e.modified(),r=t.fork(t.ALL).materialize(t.SOURCE),o=!n||i||t.changed(t.ADD_REM)||t.modified(e.key.fields)||t.modified(e.parentKey.fields);r.source=r.source.slice();if(o){n=r.source.length?LF(eT().id(e.key).parentId(e.parentKey)(r.source),e.key,oe["hb"]):LF(eT()([{}]),e.key,e.key)}r.source.root=this.value=n;return r}});function nT(e,t){return e.parent===t.parent?1:2}function iT(e){var t=e.children;return t?t[0]:e.t}function rT(e){var t=e.children;return t?t[t.length-1]:e.t}function oT(e,t,n){var i=n/(t.i-e.i);t.c-=i;t.s+=n;e.c+=i;t.z+=n;t.m+=n}function sT(e){var t=0,n=0,i=e.children,r=i.length,o;while(--r>=0){o=i[r];o.z+=t;o.m+=t;t+=o.s+(n+=o.c)}}function aT(e,t,n){return e.a.parent===t.parent?e.a:n}function uT(e,t){this._=e;this.parent=null;this.children=null;this.A=null;this.a=this;this.z=0;this.m=0;this.c=0;this.s=0;this.t=null;this.i=t}uT.prototype=Object.create(cN.prototype);function cT(e){var t=new uT(e,0),n,i=[t],r,o,s,a;while(n=i.pop()){if(o=n._.children){n.children=new Array(a=o.length);for(s=a-1;s>=0;--s){i.push(r=n.children[s]=new uT(o[s],s));r.parent=n}}}(t.parent=new uT(null,0)).children=[t];return t}var lT=function(){var e=nT,t=1,n=1,i=null;function r(r){var a=cT(r);a.eachAfter(o),a.parent.m=-a.z;a.eachBefore(s);if(i)r.eachBefore(u);else{var c=r,l=r,f=r;r.eachBefore((function(e){if(e.xl.x)l=e;if(e.depth>f.depth)f=e}));var d=c===l?1:e(c,l)/2,h=d-c.x,p=t/(l.x+d+h),g=n/(f.depth||1);r.eachBefore((function(e){e.x=(e.x+h)*p;e.y=e.depth*g}))}return r}function o(t){var n=t.children,i=t.parent.children,r=t.i?i[t.i-1]:null;if(n){sT(t);var o=(n[0].z+n[n.length-1].z)/2;if(r){t.z=r.z+e(t._,r._);t.m=t.z-o}else{t.z=o}}else if(r){t.z=r.z+e(t._,r._)}t.parent.A=a(t,r,t.parent.A||i[0])}function s(e){e._.x=e.z+e.parent.m;e.m+=e.parent.m}function a(t,n,i){if(n){var r=t,o=t,s=n,a=r.parent.children[0],u=r.m,c=o.m,l=s.m,f=a.m,d;while(s=rT(s),r=iT(r),s&&r){a=iT(a);o=rT(o);o.a=t;d=s.z+l-r.z-u+e(s._,r._);if(d>0){oT(aT(s,t,i),t,d);u+=d;c+=d}l+=s.m;u+=r.m;f+=a.m;c+=o.m}if(s&&!rT(o)){o.t=s;o.m+=l-c}if(r&&!iT(a)){a.t=r;a.m+=u-f;i=t}}return i}function u(e){e.x*=t;e.y=e.depth*n}r.separation=function(t){return arguments.length?(e=t,r):e};r.size=function(e){return arguments.length?(i=false,t=+e[0],n=+e[1],r):i?null:[t,n]};r.nodeSize=function(e){return arguments.length?(i=true,t=+e[0],n=+e[1],r):i?[t,n]:null};return r};function fT(e,t){return e.parent===t.parent?1:2}function dT(e){return e.reduce(hT,0)/e.length}function hT(e,t){return e+t.x}function pT(e){return 1+e.reduce(gT,0)}function gT(e,t){return Math.max(e,t.y)}function mT(e){var t;while(t=e.children)e=t[0];return e}function bT(e){var t;while(t=e.children)e=t[t.length-1];return e}var vT=function(){var e=fT,t=1,n=1,i=false;function r(r){var o,s=0;r.eachAfter((function(t){var n=t.children;if(n){t.x=dT(n);t.y=pT(n)}else{t.x=o?s+=e(t,o):0;t.y=0;o=t}}));var a=mT(r),u=bT(r),c=a.x-e(a,u)/2,l=u.x+e(u,a)/2;return r.eachAfter(i?function(e){e.x=(e.x-r.x)*t;e.y=(r.y-e.y)*n}:function(e){e.x=(e.x-c)/(l-c)*t;e.y=(1-(r.y?e.y/r.y:1))*n})}r.separation=function(t){return arguments.length?(e=t,r):e};r.size=function(e){return arguments.length?(i=false,t=+e[0],n=+e[1],r):i?null:[t,n]};r.nodeSize=function(e){return arguments.length?(i=true,t=+e[0],n=+e[1],r):i?[t,n]:null};return r};var yT={tidy:lT,cluster:vT};const xT=["x","y","depth","children"];function _T(e){hN.call(this,e)}_T.Definition={type:"Tree",metadata:{tree:true,modifies:true},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:true,length:2},{name:"nodeSize",type:"number",array:true,length:2},{name:"separation",type:"boolean",default:true},{name:"as",type:"string",array:true,length:xT.length,default:xT}]};Object(oe["z"])(_T,hN,{layout(e){var t=e||"tidy";if(Object(oe["w"])(yT,t))return yT[t]();else Object(oe["o"])("Unrecognized Tree layout method: "+t)},params:["size","nodeSize"],fields:xT});function wT(e){Pa.call(this,[],e)}wT.Definition={type:"TreeLinks",metadata:{tree:true,generates:true,changes:true},params:[]};Object(oe["z"])(wT,Pa,{transform(e,t){const n=this.value,i=t.source&&t.source.root,r=t.fork(t.NO_SOURCE),o={};if(!i)Object(oe["o"])("TreeLinks transform requires a tree data source.");if(t.changed(t.ADD_REM)){r.rem=n;t.visit(t.SOURCE,e=>o[de(e)]=1);i.each(e=>{const t=e.data,n=e.parent&&e.parent.data;if(n&&o[de(t)]&&o[de(n)]){r.add.push(pe({source:n,target:t}))}});this.value=r.add}else if(t.changed(t.MOD)){t.visit(t.MOD,e=>o[de(e)]=1);n.forEach(e=>{if(o[de(e.source)]||o[de(e.target)]){r.mod.push(e)}})}return r}});var OT=function(e,t,n,i,r){var o=e.children,s,a=o.length,u,c=new Array(a+1);for(c[0]=u=s=0;s=t-1){var u=o[e];u.x0=i,u.y0=r;u.x1=s,u.y1=a;return}var f=c[e],d=n/2+f,h=e+1,p=t-1;while(h>>1;if(c[g]a-r){var v=n?(i*b+s*m)/n:s;l(e,h,m,i,r,v,a);l(h,t,b,v,r,s,a)}else{var y=n?(r*b+a*m)/n:a;l(e,h,m,i,r,s,y);l(h,t,b,i,y,s,a)}}};var jT=function(e,t,n,i,r){var o=e.children,s,a=-1,u=o.length,c=e.value&&(r-n)/e.value;while(++av)v=c;w=m*m*_;y=Math.max(v/w,w/b);if(y>x){m-=c;break}x=y}s.push(u={value:m,dice:h1?t:1)};return n}(ET);var ST=function e(t){function n(e,n,i,r,o){if((s=e._squarify)&&s.ratio===t){var s,a,u,c,l=-1,f,d=s.length,h=e.value;while(++l1?t:1)};return n}(ET);var MT=function(){var e=DT,t=false,n=1,i=1,r=[0],o=zN,s=zN,a=zN,u=zN,c=zN;function l(e){e.x0=e.y0=0;e.x1=n;e.y1=i;e.eachBefore(f);r=[0];if(t)e.eachBefore(GN);return e}function f(t){var n=r[t.depth],i=t.x0+n,l=t.y0+n,f=t.x1-n,d=t.y1-n;if(f{const n=e.tile();if(n.ratio)e.tile(n.ratio(t))};e.method=t=>{if(Object(oe["w"])(CT,t))e.tile(CT[t]);else Object(oe["o"])("Unrecognized Treemap layout method: "+t)};return e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:$T});var NT=function(e,t){var n=[],i=function(e){return e(a)},r,o,s,a,u,c;if(t==null){n.push(e)}else{for(r={},o=0,s=e.length;o{cc(t,e.x,e.y,e.bandwidth||.3).forEach(e=>{const n={};for(let i=0;ie==="poly"?t:e==="quad"?2:1;function BT(e){Pa.call(this,null,e)}BT.Definition={type:"Regression",metadata:{generates:true},params:[{name:"x",type:"field",required:true},{name:"y",type:"field",required:true},{name:"groupby",type:"field",array:true},{name:"method",type:"string",default:"linear",values:Object.keys(zT)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:true,length:2},{name:"params",type:"boolean",default:false},{name:"as",type:"string",array:true}]};Object(oe["z"])(BT,Pa,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=NT(i,e.groupby),o=(e.groupby||[]).map(oe["h"]),s=e.method||"linear",a=e.order||3,u=RT(s,a),c=e.as||[Object(oe["h"])(e.x),Object(oe["h"])(e.y)],l=zT[s],f=[];let d=e.extent;if(!Object(oe["w"])(zT,s)){Object(oe["o"])("Invalid regression method: "+s)}if(d!=null){if(s==="log"&&d[0]<=0){t.dataflow.warn("Ignoring extent with values <= 0 for log regression.");d=null}}r.forEach(n=>{const i=n.length;if(i<=u){t.dataflow.warn("Skipping regression with more parameters than data points.");return}const r=l(n,e.x,e.y,a);if(e.params){f.push(pe({keys:n.dims,coef:r.coef,rSquared:r.rSquared}));return}const h=d||Object(oe["q"])(n,e.x),p=e=>{const t={};for(let i=0;ip([e,r.predict(e)]))}else{pc(r.predict,h,25,200).forEach(p)}});if(this.value)n.rem=this.value;this.value=n.add=n.source=f}return n}});const PT=Math.pow(2,-52);const IT=new Uint32Array(512);class LT{static from(e,t=ZT,n=QT){const i=e.length;const r=new Float64Array(i*2);for(let o=0;o>1;if(t>0&&typeof e[0]!=="number")throw new Error("Expected coords to contain numbers.");this.coords=e;const n=Math.max(2*t-5,0);this._triangles=new Uint32Array(n*3);this._halfedges=new Int32Array(n*3);this._hashSize=Math.ceil(Math.sqrt(t));this._hullPrev=new Uint32Array(t);this._hullNext=new Uint32Array(t);this._hullTri=new Uint32Array(t);this._hullHash=new Int32Array(this._hashSize).fill(-1);this._ids=new Uint32Array(t);this._dists=new Float64Array(t);this.update()}update(){const{coords:e,_hullPrev:t,_hullNext:n,_hullTri:i,_hullHash:r}=this;const o=e.length>>1;let s=Infinity;let a=Infinity;let u=-Infinity;let c=-Infinity;for(let k=0;ku)u=t;if(n>c)c=n;this._ids[k]=k}const l=(s+u)/2;const f=(a+c)/2;let d=Infinity;let h,p,g;for(let k=0;k0){p=k;d=t}}let v=e[2*p];let y=e[2*p+1];let x=Infinity;for(let k=0;ki){t[n++]=r;i=this._dists[r]}}this.hull=t.subarray(0,n);this.triangles=new Uint32Array(0);this.halfedges=new Uint32Array(0);return}if(GT(m,b,v,y,_,w)){const e=p;const t=v;const n=y;p=g;v=_;y=w;g=e;_=t;w=n}const O=YT(m,b,v,y,_,w);this._cx=O.x;this._cy=O.y;for(let k=0;k0&&Math.abs(s-E)<=PT&&Math.abs(a-A)<=PT)continue;E=s;A=a;if(o===h||o===p||o===g)continue;let u=0;for(let e=0,t=this._hashKey(s,a);e0?3-n:1+n)/4}function qT(e,t,n,i){const r=e-n;const o=t-i;return r*r+o*o}function WT(e,t,n,i,r,o){const s=(i-t)*(r-e);const a=(n-e)*(o-t);return Math.abs(s-a)>=33306690738754716e-32*Math.abs(s+a)?s-a:0}function GT(e,t,n,i,r,o){const s=WT(r,o,e,t,n,i)||WT(e,t,n,i,r,o)||WT(n,i,r,o,e,t);return s<0}function HT(e,t,n,i,r,o,s,a){const u=e-s;const c=t-a;const l=n-s;const f=i-a;const d=r-s;const h=o-a;const p=u*u+c*c;const g=l*l+f*f;const m=d*d+h*h;return u*(f*m-g*h)-c*(l*m-g*d)+p*(l*h-f*d)<0}function VT(e,t,n,i,r,o){const s=n-e;const a=i-t;const u=r-e;const c=o-t;const l=s*s+a*a;const f=u*u+c*c;const d=.5/(s*c-a*u);const h=(c*l-a*f)*d;const p=(s*f-u*l)*d;return h*h+p*p}function YT(e,t,n,i,r,o){const s=n-e;const a=i-t;const u=r-e;const c=o-t;const l=s*s+a*a;const f=u*u+c*c;const d=.5/(s*c-a*u);const h=e+(c*l-a*f)*d;const p=t+(s*f-u*l)*d;return{x:h,y:p}}function XT(e,t,n,i){if(i-n<=20){for(let r=n+1;r<=i;r++){const i=e[r];const o=t[i];let s=r-1;while(s>=n&&t[e[s]]>o)e[s+1]=e[s--];e[s+1]=i}}else{const r=n+i>>1;let o=n+1;let s=i;JT(e,r,o);if(t[e[n]]>t[e[i]])JT(e,n,i);if(t[e[o]]>t[e[i]])JT(e,o,i);if(t[e[n]]>t[e[o]])JT(e,n,o);const a=e[o];const u=t[a];while(true){do{o++}while(t[e[o]]u);if(s=s-n){XT(e,t,o,i);XT(e,t,n,s-1)}else{XT(e,t,n,s-1);XT(e,t,o,i)}}}function JT(e,t,n){const i=e[t];e[t]=e[n];e[n]=i}function ZT(e){return e[0]}function QT(e){return e[1]}const KT=1e-6;class ez{constructor(){this._x0=this._y0=this._x1=this._y1=null;this._=""}moveTo(e,t){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){if(this._x1!==null){this._x1=this._x0,this._y1=this._y0;this._+="Z"}}lineTo(e,t){this._+=`L${this._x1=+e},${this._y1=+t}`}arc(e,t,n){e=+e,t=+t,n=+n;const i=e+n;const r=t;if(n<0)throw new Error("negative radius");if(this._x1===null)this._+=`M${i},${r}`;else if(Math.abs(this._x1-i)>KT||Math.abs(this._y1-r)>KT)this._+="L"+i+","+r;if(!n)return;this._+=`A${n},${n},0,1,1,${e-n},${t}A${n},${n},0,1,1,${this._x1=i},${this._y1=r}`}rect(e,t,n,i){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${+n}v${+i}h${-n}Z`}value(){return this._||null}}class tz{constructor(){this._=[]}moveTo(e,t){this._.push([e,t])}closePath(){this._.push(this._[0].slice())}lineTo(e,t){this._.push([e,t])}value(){return this._.length?this._:null}}class nz{constructor(e,[t,n,i,r]=[0,0,960,500]){if(!((i=+i)>=(t=+t))||!((r=+r)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=e;this._circumcenters=new Float64Array(e.points.length*2);this.vectors=new Float64Array(e.points.length*2);this.xmax=i,this.xmin=t;this.ymax=r,this.ymin=n;this._init()}update(){this.delaunay.update();this._init();return this}_init(){const{delaunay:{points:e,hull:t,triangles:n},vectors:i}=this;const r=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let d=0,h=0,p=n.length,g,m;d1)r-=2;for(let o=2;o4){for(let e=0;e0){if(t>=this.ymax)return null;if((o=(this.ymax-t)/i)0){if(e>=this.xmax)return null;if((o=(this.xmax-e)/n)this.xmax?2:0)|(tthis.ymax?8:0)}}const iz=2*Math.PI,rz=Math.pow;function oz(e){return e[0]}function sz(e){return e[1]}function az(e){const{triangles:t,coords:n}=e;for(let i=0;i1e-10)return false}return true}function uz(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class cz{static from(e,t=oz,n=sz,i){return new cz("length"in e?lz(e,t,n,i):Float64Array.from(fz(e,t,n,i)))}constructor(e){this._delaunator=new LT(e);this.inedges=new Int32Array(e.length/2);this._hullIndex=new Int32Array(e.length/2);this.points=this._delaunator.coords;this._init()}update(){this._delaunator.update();this._init();return this}_init(){const e=this._delaunator,t=this.points;if(e.hull&&e.hull.length>2&&az(e)){this.collinear=Int32Array.from({length:t.length/2},(e,t)=>t).sort((e,n)=>t[2*e]-t[2*n]||t[2*e+1]-t[2*n+1]);const e=this.collinear[0],n=this.collinear[this.collinear.length-1],i=[t[2*e],t[2*e+1],t[2*n],t[2*n+1]],r=1e-8*Math.hypot(i[3]-i[1],i[2]-i[0]);for(let o=0,s=t.length/2;o0){this.triangles=new Int32Array(3).fill(-1);this.halfedges=new Int32Array(3).fill(-1);this.triangles[0]=i[0];this.triangles[1]=i[1];this.triangles[2]=i[1];o[i[0]]=1;if(i.length===2)o[i[1]]=0}}voronoi(e){return new nz(this,e)}*neighbors(e){const{inedges:t,hull:n,_hullIndex:i,halfedges:r,triangles:o,collinear:s}=this;if(s){const t=s.indexOf(e);if(t>0)yield s[t-1];if(t=0&&r!==n&&r!==i)n=r;return r}_step(e,t,n){const{inedges:i,hull:r,_hullIndex:o,halfedges:s,triangles:a,points:u}=this;if(i[e]===-1||!u.length)return(e+1)%(u.length>>1);let c=e;let l=rz(t-u[e*2],2)+rz(n-u[e*2+1],2);const f=i[e];let d=f;do{let i=a[d];const f=rz(t-u[i*2],2)+rz(n-u[i*2+1],2);if(f>5,bz=1<<11;var vz=function(){var e=[256,256],t,n,i,r,o,s,a,u=Oz,c=[],l=Math.random,f={};f.layout=function(){var u=d(eg()),f=kz((e[0]>>5)*e[1]),p=null,g=c.length,m=-1,b=[],v=c.map(e=>({text:t(e),font:n(e),style:r(e),weight:o(e),rotate:s(e),size:~~(i(e)+1e-14),padding:a(e),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:false,sprite:null,datum:e})).sort((e,t)=>t.size-e.size);while(++m>1;y.y=e[1]*(l()+.5)>>1;yz(u,y,v,m);if(y.hasText&&h(f,y,p)){b.push(y);if(p)_z(p,y);else p=[{x:y.x+y.x0,y:y.y+y.y0},{x:y.x+y.x1,y:y.y+y.y1}];y.x-=e[0]>>1;y.y-=e[1]>>1}}return b};function d(e){e.width=e.height=1;var t=Math.sqrt(e.getContext("2d").getImageData(0,0,1,1).data.length>>2);e.width=(mz<<5)/t;e.height=bz/t;var n=e.getContext("2d");n.fillStyle=n.strokeStyle="red";n.textAlign="center";return{context:n,ratio:t}}function h(t,n,i){var r=n.x,o=n.y,s=Math.sqrt(e[0]*e[0]+e[1]*e[1]),a=u(e),c=l()<.5?1:-1,f=-c,d,h,p;while(d=a(f+=c)){h=~~d[0];p=~~d[1];if(Math.min(Math.abs(h),Math.abs(p))>=s)break;n.x=r+h;n.y=o+p;if(n.x+n.x0<0||n.y+n.y0<0||n.x+n.x1>e[0]||n.y+n.y1>e[1])continue;if(!i||!xz(n,t,e[0])){if(!i||wz(n,i)){var g=n.sprite,m=n.width>>5,b=e[0]>>5,v=n.x-(m<<4),y=v&127,x=32-y,_=n.y1-n.y0,w=(n.y+n.y0)*b+(v>>5),O;for(var j=0;j<_;j++){O=0;for(var k=0;k<=m;k++){t[w+k]|=O<>>y:0)}w+=b}n.sprite=null;return true}}}return false}f.words=function(e){if(arguments.length){c=e;return f}else{return c}};f.size=function(t){if(arguments.length){e=[+t[0],+t[1]];return f}else{return e}};f.font=function(e){if(arguments.length){n=Ez(e);return f}else{return n}};f.fontStyle=function(e){if(arguments.length){r=Ez(e);return f}else{return r}};f.fontWeight=function(e){if(arguments.length){o=Ez(e);return f}else{return o}};f.rotate=function(e){if(arguments.length){s=Ez(e);return f}else{return s}};f.text=function(e){if(arguments.length){t=Ez(e);return f}else{return t}};f.spiral=function(e){if(arguments.length){u=Az[e]||e;return f}else{return u}};f.fontSize=function(e){if(arguments.length){i=Ez(e);return f}else{return i}};f.padding=function(e){if(arguments.length){a=Ez(e);return f}else{return a}};f.random=function(e){if(arguments.length){l=e;return f}else{return l}};return f};function yz(e,t,n,i){if(t.sprite)return;var r=e.context,o=e.ratio;r.clearRect(0,0,(mz<<5)/o,bz/o);var s=0,a=0,u=0,c=n.length,l,f,d,h,p;--i;while(++i>5<<5;d=~~Math.max(Math.abs(v+y),Math.abs(v-y))}else{l=l+31>>5<<5}if(d>u)u=d;if(s+l>=mz<<5){s=0;a+=u;u=0}if(a+d>=bz)break;r.translate((s+(l>>1))/o,(a+(d>>1))/o);if(t.rotate)r.rotate(t.rotate*gz);r.fillText(t.text,0,0);if(t.padding){r.lineWidth=2*t.padding;r.strokeText(t.text,0,0)}r.restore();t.width=l;t.height=d;t.xoff=s;t.yoff=a;t.x1=l>>1;t.y1=d>>1;t.x0=-t.x1;t.y0=-t.y1;t.hasText=true;s+=l}var _=r.getImageData(0,0,(mz<<5)/o,bz/o).data,w=[];while(--i>=0){t=n[i];if(!t.hasText)continue;l=t.width;f=l>>5;d=t.y1-t.y0;for(h=0;h>5),E=_[(a+p)*(mz<<5)+(s+h)<<2]?1<<31-h%32:0;w[k]|=E;O|=E}if(O)j=p;else{t.y0++;d--;p--;a++}}t.y1=t.y0+j;t.sprite=w.slice(0,(t.y1-t.y0)*f)}}function xz(e,t,n){n>>=5;var i=e.sprite,r=e.width>>5,o=e.x-(r<<4),s=o&127,a=32-s,u=e.y1-e.y0,c=(e.y+e.y0)*n+(o>>5),l;for(var f=0;f>>s:0))&t[c+d])return true}c+=n}return false}function _z(e,t){var n=e[0],i=e[1];if(t.x+t.x0i.x)i.x=t.x+t.x1;if(t.y+t.y1>i.y)i.y=t.y+t.y1}function wz(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0t[0].y&&e.y+e.y0t(e(n))}r.forEach(e=>{e[s[0]]=NaN;e[s[1]]=NaN;e[s[3]]=0});const c=o.words(r).text(e.text).size(e.size||[500,500]).padding(e.padding||1).spiral(e.spiral||"archimedean").rotate(e.rotate||0).font(e.font||"sans-serif").fontStyle(e.fontStyle||"normal").fontWeight(e.fontWeight||"normal").fontSize(a).random(xu).layout();const l=o.size(),f=l[0]>>1,d=l[1]>>1,h=c.length;for(let p=0,g,m;pnew Uint8Array(e);const $z=e=>new Uint16Array(e);const Fz=e=>new Uint32Array(e);function Nz(){let e=8,t=[],n=Fz(0),i=zz(0,e),r=zz(0,e);return{data:()=>t,seen:()=>n=Tz(n,t.length),add(e){for(let n=0,i=t.length,r=e.length,o;nt.length,curr:()=>i,prev:()=>r,reset:e=>r[e]=i[e],all:()=>e<257?255:e<65537?65535:4294967295,set(e,t){i[e]|=t},clear(e,t){i[e]&=~t},resize(t,n){const o=i.length;if(t>o||n>e){e=Math.max(n,e);i=zz(t,e,i);r=zz(t,e)}}}}function Tz(e,t,n){if(e.length>=t)return e;n=n||new e.constructor(t);n.set(e);return n}function zz(e,t,n){const i=(t<257?Cz:t<65537?$z:Fz)(e);if(n)i.set(n);return i}var Rz=function(e,t,n){const i=1<e[t])};function Pz(){let e=Fz(0),t=[],n=0;function i(i,r,o){if(!r.length)return[];const s=n,a=r.length,u=Fz(a);let c=Array(a),l,f,d;for(d=0;d0)for(d=0;de,size:()=>n}}function Iz(e,t){e.sort.call(t,(t,n)=>{const i=e[t],r=e[n];return ir?1:0});return Bz(e,t)}function Lz(e,t,n,i,r,o,s,a,u){let c=0,l=0,f;for(f=0;ct.modified(e.fields));return n?this.reinit(e,t):this.eval(e,t)}},init(e,t){const n=e.fields,i=e.query,r=this._indices={},o=this._dims=[],s=i.length;let a=0,u,c;for(;a{const e=r.remove(t,n);for(const t in i)i[t].reindex(e)})},update(e,t,n){const i=this._dims,r=e.query,o=t.stamp,s=i.length;let a=0,u,c;n.filters=0;for(c=0;ch){for(m=h,b=Math.min(f,p);mp){for(m=Math.max(f,p),b=d;mf){for(p=f,g=Math.min(c,d);pd){for(p=Math.max(c,d),g=l;p!(a[e]&n)?s[e]:null;o.filter(o.MOD,c);if(!(r&r-1)){o.filter(o.ADD,c);o.filter(o.REM,e=>(a[e]&n)===r?s[e]:null)}else{o.filter(o.ADD,e=>{const t=a[e]&n,i=!t&&t^u[e]&n;return i?s[e]:null});o.filter(o.REM,e=>{const t=a[e]&n,i=t&&!(t^(t^u[e]&n));return i?s[e]:null})}return o.filter(o.SOURCE,e=>c(e._index))}});var Wz=n("8WEG");function Gz(e){const t=e.container();if(t){t.setAttribute("role","graphics-document");t.setAttribute("aria-roleDescription","visualization");Hz(t,e.description())}}function Hz(e,t){if(e)t==null?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t)}var Vz=function(e){e.add(null,t=>{e._background=t.bg;e._resize=1;return t.bg},{bg:e._signals.background})};const Yz="default";var Xz=function(e){const t=e._signals.cursor||(e._signals.cursor=e.add({user:Yz,item:null}));e.on(e.events("view","mousemove"),t,(e,n)=>{const i=t.value,r=i?Object(oe["I"])(i)?i:i.user:Yz,o=n.item&&n.item.cursor||null;return i&&r===i.user&&o==i.item?i:{user:r,item:o}});e.add(null,(function(t){let n=t.cursor,i=this.value;if(!Object(oe["I"])(n)){i=n.item;n=n.user}Jz(e,n&&n!==Yz?n:i||n);return i}),{cursor:t})};function Jz(e,t){const n=e.globalCursor()?typeof document!=="undefined"&&document.body:e.container();if(n){return t==null?n.style.removeProperty("cursor"):n.style.cursor=t}}function Zz(e,t){var n=e._runtime.data;if(!Object(oe["w"])(n,t)){Object(oe["o"])("Unrecognized data set: "+t)}return n[t]}function Qz(e,t){return arguments.length<2?Zz(this,e).values.value:Kz.call(this,e,xe().remove(oe["hb"]).insert(t))}function Kz(e,t){if(!ye(t)){Object(oe["o"])("Second argument to changes must be a changeset.")}var n=Zz(this,e);n.modified=true;return this.pulse(n.input,t)}function eR(e,t){return Kz.call(this,e,xe().insert(t))}function tR(e,t){return Kz.call(this,e,xe().remove(t))}function nR(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function iR(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function rR(e){var t=e.padding(),n=e._origin;return[t.left+n[0],t.top+n[1]]}function oR(e){var t=rR(e),n=nR(e),i=iR(e);e._renderer.background(e.background());e._renderer.resize(n,i,t);e._handler.origin(t);e._resizeListeners.forEach(t=>{try{t(n,i)}catch(r){e.error(r)}})}var sR=function(e,t,n){var i=e._renderer,r=i&&i.canvas(),o,s,a;if(r){a=rR(e);s=t.changedTouches?t.changedTouches[0]:t;o=Hb(s,r);o[0]-=a[0];o[1]-=a[1]}t.dataflow=e;t.item=n;t.vega=aR(e,n,o);return t};function aR(e,t,n){var i=t?t.mark.marktype==="group"?t:t.mark.group:null;function r(e){var n=i,r;if(e)for(r=t;r;r=r.mark.group){if(r.mark.name===e){n=r;break}}return n&&n.mark&&n.mark.interactive?n:{}}function o(e){if(!e)return n;if(Object(oe["I"])(e))e=r(e);var t=n.slice();while(e){t[0]-=e.x||0;t[1]-=e.y||0;e=e.mark&&e.mark.group}return t}return{view:Object(oe["m"])(e),item:Object(oe["m"])(t||{}),group:r,xy:o,x:function(e){return o(e)[0]},y:function(e){return o(e)[1]}}}const uR="view",cR="timer",lR="window",fR={trap:false};function dR(e){const t=Object(oe["p"])({defaults:{}},e);const n=(e,t)=>{t.forEach(t=>{if(Object(oe["B"])(e[t]))e[t]=Object(oe["eb"])(e[t])})};n(t.defaults,["prevent","allow"]);n(t,["view","window","selector"]);return t}function hR(e,t){var n=e._eventConfig.defaults,i=n.prevent,r=n.allow;return i===false||r===true?false:i===true||r===false?true:i?i[t]:r?!r[t]:e.preventDefault()}function pR(e,t,n){const i=e._eventConfig&&e._eventConfig[t];if(i===false||Object(oe["G"])(i)&&!i[n]){e.warn(`Blocked ${t} ${n} event listener.`);return false}return true}function gR(e,t,n){var i=this,r=new Fe(n),o=function(n,o){i.runAsync(null,()=>{if(e===uR&&hR(i,t)){n.preventDefault()}r.receive(sR(i,n,o))})},s;if(e===cR){if(pR(i,"timer",t)){i.timer(o,t)}}else if(e===uR){if(pR(i,"view",t)){i.addEventListener(t,o,fR)}}else{if(e===lR){if(pR(i,"window",t)&&typeof window!=="undefined"){s=[window]}}else if(typeof document!=="undefined"){if(pR(i,"selector",t)){s=document.querySelectorAll(e)}}if(!s){i.warn("Can not resolve event source: "+e)}else{for(var a=0,u=s.length;a=0){t[i].stop()}i=n.length;while(--i>=0){o=n[i];r=o.sources.length;while(--r>=0){o.sources[r].removeEventListener(o.type,o.handler)}}if(e){e.call(this,this._handler,null,null,null)}return this};var _R=function(e,t,n){var i=document.createElement(e);for(var r in t)i.setAttribute(r,t[r]);if(n!=null)i.textContent=n;return i};const wR="vega-bind",OR="vega-bind-name",jR="vega-bind-radio";var kR=function(e,t,n){if(!t)return;const i=n.param;let r=n.state;if(!r){r=n.state={elements:null,active:false,set:null,update:t=>{if(t!==e.signal(i.signal)){e.runAsync(null,()=>{r.source=true;e.signal(i.signal,t)})}}};if(i.debounce){r.update=Object(oe["n"])(i.debounce,r.update)}}ER(r,t,i,e.signal(i.signal));if(!r.active){e.on(e._signals[i.signal],null,()=>{r.source?r.source=false:r.set(e.signal(i.signal))});r.active=true}return r};function ER(e,t,n,i){const r=_R("div",{class:wR});const o=n.input==="radio"?r:r.appendChild(_R("label"));o.appendChild(_R("span",{class:OR},n.name||n.signal));t.appendChild(r);let s=AR;switch(n.input){case"checkbox":s=DR;break;case"select":s=SR;break;case"radio":s=MR;break;case"range":s=CR;break}s(e,o,n,i)}function AR(e,t,n,i){const r=_R("input");for(const o in n){if(o!=="signal"&&o!=="element"){r.setAttribute(o==="input"?"type":o,n[o])}}r.setAttribute("name",n.signal);r.value=i;t.appendChild(r);r.addEventListener("input",()=>e.update(r.value));e.elements=[r];e.set=e=>r.value=e}function DR(e,t,n,i){const r={type:"checkbox",name:n.signal};if(i)r.checked=true;const o=_R("input",r);t.appendChild(o);o.addEventListener("change",()=>e.update(o.checked));e.elements=[o];e.set=e=>o.checked=!!e||null}function SR(e,t,n,i){const r=_R("select",{name:n.signal}),o=n.labels||[];n.options.forEach((e,t)=>{const n={value:e};if($R(e,i))n.selected=true;r.appendChild(_R("option",n,(o[t]||e)+""))});t.appendChild(r);r.addEventListener("change",()=>{e.update(n.options[r.selectedIndex])});e.elements=[r];e.set=e=>{for(let t=0,i=n.options.length;t{const a={type:"radio",name:n.signal,value:t};if($R(t,i))a.checked=true;const u=_R("input",a);u.addEventListener("change",()=>e.update(t));const c=_R("label",{},(o[s]||t)+"");c.prepend(u);r.appendChild(c);return u});e.set=t=>{const n=e.elements,i=n.length;for(let e=0;e{u.textContent=a.value;e.update(+a.value)};a.addEventListener("input",c);a.addEventListener("change",c);e.elements=[a];e.set=e=>{a.value=e;u.textContent=e}}function $R(e,t){return e===t||e+""===t+""}var FR=function(e,t,n,i,r,o){t=t||new i(e.loader());return t.initialize(n,nR(e),iR(e),rR(e),r,o).background(e.background())};var NR=function(e,t){return!t?null:function(){try{t.apply(this,arguments)}catch(n){e.error(n)}}};var TR=function(e,t,n,i){var r=new i(e.loader(),NR(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,rR(e),e);if(t){t.handlers().forEach(e=>{r.on(e.type,e.handler)})}return r};var zR=function(e,t){const n=this,i=n._renderType,r=n._eventConfig.bind,o=Wj(i);e=n._el=e?RR(n,e):null;Gz(n);if(!o)n.error("Unrecognized renderer type: "+i);const s=o.handler||yv,a=e?o.renderer:o.headless;n._renderer=!a?null:FR(n,n._renderer,e,a);n._handler=TR(n,n._handler,e,s);n._redraw=true;if(e&&r!=="none"){t=t?n._elBind=RR(n,t):e.appendChild(_R("form",{class:"vega-bindings"}));n._bind.forEach(e=>{if(e.param.element&&r!=="container"){e.element=RR(n,e.param.element)}});n._bind.forEach(e=>{kR(n,e.element||t,e)})}return n};function RR(e,t){if(typeof t==="string"){if(typeof document!=="undefined"){t=document.querySelector(t);if(!t){e.error("Signal bind element not found: "+t);return null}}else{e.error("DOM document instance not found.");return null}}if(t){try{t.innerHTML=""}catch(n){t=null;e.error(n)}}return t}const BR=e=>+e||0;const PR=e=>({top:e,bottom:e,left:e,right:e});var IR=function(e){return Object(oe["G"])(e)?{top:BR(e.top),bottom:BR(e.bottom),left:BR(e.left),right:BR(e.right)}:PR(BR(e))};var LR=async function(e,t,n,i){const r=Wj(t),o=r&&r.headless;if(!o)Object(oe["o"])("Unrecognized renderer type: "+t);await e.runAsync();return FR(e,null,null,o,n,i).renderAsync(e._scenegraph.root)};var UR=async function(e,t){if(e!==Uj.Canvas&&e!==Uj.SVG&&e!==Uj.PNG){Object(oe["o"])("Unrecognized image type: "+e)}const n=await LR(this,e,t);return e===Uj.SVG?qR(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")};function qR(e,t){var n=new Blob([e],{type:t});return window.URL.createObjectURL(n)}var WR=async function(e,t){const n=await LR(this,Uj.Canvas,e,t);return n.canvas()};var GR=async function(e){const t=await LR(this,Uj.SVG,e);return t.svg()};function HR(e){const t=this.context.data[e];return t?t.values.value:[]}function VR(e,t,n){const i=this.context.data[e]["index:"+t],r=i?i.value.get(n):undefined;return r?r.count:r}function YR(e,t){const n=this.context.dataflow,i=this.context.data[e],r=i.input;n.pulse(r,n.changeset().remove(oe["hb"]).insert(t));return 1}var XR=function(e,t,n){if(e){const n=this.context.dataflow,i=e.mark.source;n.pulse(i,n.changeset().encode(e,t))}return n!==undefined?n:e};const JR=e=>function(t,n){const i=this.context.dataflow.locale();return i[e](n)(t)};const ZR=JR("format");const QR=JR("timeFormat");const KR=JR("utcFormat");const eB=JR("timeParse");const tB=JR("utcParse");const nB=new Date(2e3,0,1);function iB(e,t,n){if(!Number.isInteger(e)||!Number.isInteger(t))return"";nB.setYear(2e3);nB.setMonth(e);nB.setDate(t);return QR.call(this,nB,n)}function rB(e){return iB.call(this,e,1,"%B")}function oB(e){return iB.call(this,e,1,"%b")}function sB(e){return iB.call(this,0,2+e,"%A")}function aB(e){return iB.call(this,0,2+e,"%a")}const uB=":";const cB="@";const lB="%";const fB="$";const dB="RawCode";const hB="Literal";const pB="Property";const gB="Identifier";const mB="ArrayExpression";const bB="BinaryExpression";const vB="CallExpression";const yB="ConditionalExpression";const xB="LogicalExpression";const _B="MemberExpression";const wB="ObjectExpression";const OB="UnaryExpression";function jB(e){this.type=e}jB.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=kB(this),n=0,i=t.length;n";EB[FB]="Identifier";EB[NB]="Keyword";EB[TB]="Null";EB[zB]="Numeric";EB[RB]="Punctuator";EB[BB]="String";EB[PB]="RegularExpression";var IB="ArrayExpression",LB="BinaryExpression",UB="CallExpression",qB="ConditionalExpression",WB="Identifier",GB="Literal",HB="LogicalExpression",VB="MemberExpression",YB="ObjectExpression",XB="Property",JB="UnaryExpression";var ZB="Unexpected token %0",QB="Unexpected number",KB="Unexpected string",eP="Unexpected identifier",tP="Unexpected reserved word",nP="Unexpected end of input",iP="Invalid regular expression",rP="Invalid regular expression: missing /",oP="Octal literals are not allowed in strict mode.",sP="Duplicate data property in object literal not allowed in strict mode";var aP="ILLEGAL",uP="Disabled.";var cP=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),lP=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function fP(e,t){if(!e){throw new Error("ASSERT: "+t)}}function dP(e){return e>=48&&e<=57}function hP(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function pP(e){return"01234567".indexOf(e)>=0}function gP(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0}function mP(e){return e===10||e===13||e===8232||e===8233}function bP(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&cP.test(String.fromCharCode(e))}function vP(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&lP.test(String.fromCharCode(e))}var yP={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function xP(){var e;while(DB1114111||e!=="}"){XP({},ZB,aP)}if(t<=65535){return String.fromCharCode(t)}n=(t-65536>>10)+55296;i=(t-65536&1023)+56320;return String.fromCharCode(n,i)}function OP(){var e,t;e=AB.charCodeAt(DB++);t=String.fromCharCode(e);if(e===92){if(AB.charCodeAt(DB)!==117){XP({},ZB,aP)}++DB;e=_P("u");if(!e||e==="\\"||!bP(e.charCodeAt(0))){XP({},ZB,aP)}t=e}while(DB>>="){DB+=4;return{type:RB,value:s,start:e,end:DB}}o=s.substr(0,3);if(o===">>>"||o==="<<="||o===">>="){DB+=3;return{type:RB,value:o,start:e,end:DB}}r=o.substr(0,2);if(i===r[1]&&"+-<>&|".indexOf(i)>=0||r==="=>"){DB+=2;return{type:RB,value:r,start:e,end:DB}}if("<>=!+-*%&|^/".indexOf(i)>=0){++DB;return{type:RB,value:i,start:e,end:DB}}XP({},ZB,aP)}function AP(e){var t="";while(DB=0&&DB=0){n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,(e,t)=>{if(parseInt(t,16)<=1114111){return"x"}XP({},iP)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x")}try{new RegExp(n)}catch(i){XP({},iP)}try{return new RegExp(e,t)}catch(r){return null}}function $P(){var e,t,n,i,r;e=AB[DB];fP(e==="/","Regular expression literal must start with a slash");t=AB[DB++];n=false;i=false;while(DB=0){XP({},iP,n)}return{value:n,literal:t}}function NP(){var e,t,n,i;MB=null;xP();e=DB;t=$P();n=FP();i=CP(t.value,n.value);return{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:DB}}function TP(e){return e.type===FB||e.type===NB||e.type===CB||e.type===TB}function zP(){var e;xP();if(DB>=SB){return{type:$B,start:DB,end:DB}}e=AB.charCodeAt(DB);if(bP(e)){return kP()}if(e===40||e===41||e===59){return EP()}if(e===39||e===34){return MP()}if(e===46){if(dP(AB.charCodeAt(DB+1))){return SP()}return EP()}if(dP(e)){return SP()}return EP()}function RP(){var e;e=MB;DB=e.end;MB=zP();DB=e.end;return e}function BP(){var e;e=DB;MB=zP();DB=e}function PP(e){var t=new jB(IB);t.elements=e;return t}function IP(e,t,n){var i=new jB(e==="||"||e==="&&"?HB:LB);i.operator=e;i.left=t;i.right=n;return i}function LP(e,t){var n=new jB(UB);n.callee=e;n.arguments=t;return n}function UP(e,t,n){var i=new jB(qB);i.test=e;i.consequent=t;i.alternate=n;return i}function qP(e){var t=new jB(WB);t.name=e;return t}function WP(e){var t=new jB(GB);t.value=e.value;t.raw=AB.slice(e.start,e.end);if(e.regex){if(t.raw==="//"){t.raw="/(?:)/"}t.regex=e.regex}return t}function GP(e,t,n){var i=new jB(VB);i.computed=e==="[";i.object=t;i.property=n;if(!i.computed)n.member=true;return i}function HP(e){var t=new jB(YB);t.properties=e;return t}function VP(e,t,n){var i=new jB(XB);i.key=t;i.value=n;i.kind=e;return i}function YP(e,t){var n=new jB(JB);n.operator=e;n.argument=t;n.prefix=true;return n}function XP(e,t){var n,i=Array.prototype.slice.call(arguments,2),r=t.replace(/%(\d)/g,(e,t)=>{fP(t":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11;break;default:break}return t}function gI(){var e,t,n,i,r,o,s,a,u,c;e=MB;u=hI();i=MB;r=pI(i);if(r===0){return u}i.prec=r;RP();t=[e,MB];s=hI();o=[u,i,s];while((r=pI(MB))>0){while(o.length>2&&r<=o[o.length-2].prec){s=o.pop();a=o.pop().value;u=o.pop();t.pop();n=IP(a,u,s);o.push(n)}i=RP();i.prec=r;o.push(i);t.push(MB);n=hI();o.push(n)}c=o.length-1;n=o[c];t.pop();while(c>1){t.pop();n=IP(o[c-1].value,o[c-2],n);c-=2}return n}function mI(){var e,t,n;e=gI();if(QP("?")){RP();t=mI();ZP(":");n=mI();e=UP(e,t,n)}return e}function bI(){var e=mI();if(QP(",")){throw new Error(uP)}return e}var vI=function(e){AB=e;DB=0;SB=AB.length;MB=null;BP();var t=bI();if(MB.type!==$B){throw new Error("Unexpect token after expression.")}return t};var yI={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};var xI=function(e){function t(t,n,i,r){let o=e(n[0]);if(i){o=i+"("+o+")";if(i.lastIndexOf("new ",0)===0)o="("+o+")"}return o+"."+t+(r<0?"":r===0?"()":"("+n.slice(1).map(e).join(",")+")")}function n(e,n,i){return r=>t(e,r,n,i)}const i="new Date",r="String",o="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(t){if(t.length<3)Object(oe["o"])("Missing arguments to clamp function.");if(t.length>3)Object(oe["o"])("Too many arguments to clamp function.");const n=t.map(e);return"Math.max("+n[1]+", Math.min("+n[2]+","+n[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:i,date:n("getDate",i,0),day:n("getDay",i,0),year:n("getFullYear",i,0),month:n("getMonth",i,0),hours:n("getHours",i,0),minutes:n("getMinutes",i,0),seconds:n("getSeconds",i,0),milliseconds:n("getMilliseconds",i,0),time:n("getTime",i,0),timezoneoffset:n("getTimezoneOffset",i,0),utcdate:n("getUTCDate",i,0),utcday:n("getUTCDay",i,0),utcyear:n("getUTCFullYear",i,0),utcmonth:n("getUTCMonth",i,0),utchours:n("getUTCHours",i,0),utcminutes:n("getUTCMinutes",i,0),utcseconds:n("getUTCSeconds",i,0),utcmilliseconds:n("getUTCMilliseconds",i,0),length:n("length",null,-1),join:n("join",null),indexof:n("indexOf",null),lastindexof:n("lastIndexOf",null),slice:n("slice",null),reverse:function(t){return"("+e(t[0])+").slice().reverse()"},parseFloat:"parseFloat",parseInt:"parseInt",upper:n("toUpperCase",r,0),lower:n("toLowerCase",r,0),substring:n("substring",r),split:n("split",r),replace:n("replace",r),trim:n("trim",r,0),regexp:o,test:n("test",o),if:function(t){if(t.length<3)Object(oe["o"])("Missing arguments to if function.");if(t.length>3)Object(oe["o"])("Too many arguments to if function.");const n=t.map(e);return"("+n[0]+"?"+n[1]+":"+n[2]+")"}}};function _I(e){const t=e&&e.length-1;return t&&(e[0]==='"'&&e[t]==='"'||e[0]==="'"&&e[t]==="'")?e.slice(1,-1):e}var wI=function(e){e=e||{};const t=e.whitelist?Object(oe["eb"])(e.whitelist):{},n=e.blacklist?Object(oe["eb"])(e.blacklist):{},i=e.constants||yI,r=(e.functions||xI)(f),o=e.globalvar,s=e.fieldvar,a=Object(oe["E"])(o)?o:e=>`${o}["${e}"]`;let u={},c={},l=0;function f(e){if(Object(oe["I"])(e))return e;const t=d[e.type];if(t==null)Object(oe["o"])("Unsupported type: "+e.type);return t(e)}const d={Literal:e=>e.raw,Identifier:e=>{const r=e.name;if(l>0){return r}else if(Object(oe["w"])(n,r)){return Object(oe["o"])("Illegal identifier: "+r)}else if(Object(oe["w"])(i,r)){return i[r]}else if(Object(oe["w"])(t,r)){return r}else{u[r]=1;return a(r)}},MemberExpression:e=>{const t=!e.computed,n=f(e.object);if(t)l+=1;const i=f(e.property);if(n===s){c[_I(i)]=1}if(t)l-=1;return n+(t?"."+i:"["+i+"]")},CallExpression:e=>{if(e.callee.type!=="Identifier"){Object(oe["o"])("Illegal callee type: "+e.callee.type)}const t=e.callee.name,n=e.arguments,i=Object(oe["w"])(r,t)&&r[t];if(!i)Object(oe["o"])("Unrecognized function: "+t);return Object(oe["E"])(i)?i(n):i+"("+n.map(f).join(",")+")"},ArrayExpression:e=>"["+e.elements.map(f).join(",")+"]",BinaryExpression:e=>"("+f(e.left)+e.operator+f(e.right)+")",UnaryExpression:e=>"("+e.operator+f(e.argument)+")",ConditionalExpression:e=>"("+f(e.test)+"?"+f(e.consequent)+":"+f(e.alternate)+")",LogicalExpression:e=>"("+f(e.left)+e.operator+f(e.right)+")",ObjectExpression:e=>"{"+e.properties.map(f).join(",")+"}",Property:e=>{l+=1;const t=f(e.key);l-=1;return t+":"+f(e.value)}};function h(e){const t={code:f(e),globals:Object.keys(u),fields:Object.keys(c)};u={};c={};return t}h.functions=r;h.constants=i;return h};function OI(e,t,n,i){if(t[0].type!==hB){Object(oe["o"])("First argument to data functions must be a string literal.")}const r=t[0].value,o=uB+r;if(!Object(oe["w"])(o,i)){try{i[o]=n.getData(r).tuplesRef()}catch(s){}}}function jI(e,t,n,i){if(t[0].type!==hB)Object(oe["o"])("First argument to indata must be a string literal.");if(t[1].type!==hB)Object(oe["o"])("Second argument to indata must be a string literal.");const r=t[0].value,o=t[1].value,s=cB+o;if(!Object(oe["w"])(s,i)){i[s]=n.getData(r).indataRef(n,o)}}function kI(e,t,n,i){if(t[0].type===hB){EI(n,i,t[0].value)}else{for(e in n.scales){EI(n,i,e)}}}function EI(e,t,n){const i=lB+n;if(!Object(oe["w"])(t,i)){try{t[i]=e.scaleRef(n)}catch(r){}}}function AI(e,t){let n;return Object(oe["E"])(e)?e:Object(oe["I"])(e)?(n=t.scales[e])&&n.value:undefined}function DI(e,t,n){t.__bandwidth=e=>e&&e.bandwidth?e.bandwidth():0;n._bandwidth=kI;n._range=kI;n._scale=kI;const i=t=>"_["+(t.type===hB?Object(oe["ab"])(lB+t.value):Object(oe["ab"])(lB)+"+"+e(t))+"]";return{_bandwidth:e=>`this.__bandwidth(${i(e[0])})`,_range:e=>`${i(e[0])}.range()`,_scale:t=>`${i(t[0])}(${e(t[1])})`}}var SI=new $A;var MI=new $A,CI,$I,FI,NI,TI;var zI={point:oD,lineStart:oD,lineEnd:oD,polygonStart:function(){SI=new $A;zI.lineStart=RI;zI.lineEnd=BI},polygonEnd:function(){var e=+SI;MI.add(e<0?PA+e:e);this.lineStart=this.lineEnd=this.point=oD},sphere:function(){MI.add(PA)}};function RI(){zI.point=PI}function BI(){II(CI,$I)}function PI(e,t){zI.point=II;CI=e,$I=t;e*=LA,t*=LA;FI=e,NI=GA(t=t/2+BA),TI=QA(t)}function II(e,t){e*=LA,t*=LA;t=t/2+BA;var n=e-FI,i=n>=0?1:-1,r=i*n,o=GA(t),s=QA(t),a=TI*s,u=NI*o+a*GA(r),c=a*i*QA(r);SI.add(WA(c,u));FI=e,NI=o,TI=s}var LI=function(e){MI=new $A;CA(e,zI);return MI*2};var UI,qI,WI,GI,HI,VI,YI,XI,JI,ZI,QI;var KI={point:eL,lineStart:nL,lineEnd:iL,polygonStart:function(){KI.point=rL;KI.lineStart=oL;KI.lineEnd=sL;JI=new $A;zI.polygonStart()},polygonEnd:function(){zI.polygonEnd();KI.point=eL;KI.lineStart=nL;KI.lineEnd=iL;if(SI<0)UI=-(WI=180),qI=-(GI=90);else if(JI>NA)GI=90;else if(JI<-NA)qI=-90;QI[0]=UI,QI[1]=WI},sphere:function(){UI=-(WI=180),qI=-(GI=90)}};function eL(e,t){ZI.push(QI=[UI=e,WI=e]);if(tGI)GI=t}function tL(e,t){var n=gS([e*LA,t*LA]);if(XI){var i=bS(XI,n),r=[i[1],-i[0],0],o=bS(r,i);xS(o);o=pS(o);var s=e-HI,a=s>0?1:-1,u=o[0]*IA*a,c,l=UA(s)>180;if(l^(a*HIGI)GI=c}else if(u=(u+360)%360-180,l^(a*HIGI)GI=t}if(l){if(eaL(UI,WI))WI=e}else{if(aL(e,WI)>aL(UI,WI))UI=e}}else{if(WI>=UI){if(eWI)WI=e}else{if(e>HI){if(aL(UI,e)>aL(UI,WI))WI=e}else{if(aL(e,WI)>aL(UI,WI))UI=e}}}}else{ZI.push(QI=[UI=e,WI=e])}if(tGI)GI=t;XI=n,HI=e}function nL(){KI.point=tL}function iL(){QI[0]=UI,QI[1]=WI;KI.point=eL;XI=null}function rL(e,t){if(XI){var n=e-HI;JI.add(UA(n)>180?n+(n>0?360:-360):n)}else{VI=e,YI=t}zI.point(e,t);tL(e,t)}function oL(){zI.lineStart()}function sL(){rL(VI,YI);zI.lineEnd();if(UA(JI)>NA)UI=-(WI=180);QI[0]=UI,QI[1]=WI;XI=null}function aL(e,t){return(t-=e)<0?t+360:t}function uL(e,t){return e[0]-t[0]}function cL(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:taL(i[0],i[1]))i[1]=r[1];if(aL(r[0],i[1])>aL(i[0],i[1]))i[0]=r[0]}else{o.push(i=r)}}for(s=-Infinity,n=o.length-1,t=0,i=o[n];t<=n;i=r,++t){r=o[t];if((a=aL(i[1],r[0]))>s)s=a,UI=r[0],WI=i[1]}}ZI=QI=null;return UI===Infinity||qI===Infinity?[[NaN,NaN],[NaN,NaN]]:[[UI,qI],[WI,GI]]};var fL,dL,hL,pL,gL,mL,bL,vL,yL,xL,_L,wL,OL,jL,kL,EL;var AL={sphere:oD,point:DL,lineStart:ML,lineEnd:FL,polygonStart:function(){AL.lineStart=NL;AL.lineEnd=TL},polygonEnd:function(){AL.lineStart=ML;AL.lineEnd=FL}};function DL(e,t){e*=LA,t*=LA;var n=GA(t);SL(n*GA(e),n*QA(e),QA(t))}function SL(e,t,n){++fL;hL+=(e-hL)/fL;pL+=(t-pL)/fL;gL+=(n-gL)/fL}function ML(){AL.point=CL}function CL(e,t){e*=LA,t*=LA;var n=GA(t);jL=n*GA(e);kL=n*QA(e);EL=QA(t);AL.point=$L;SL(jL,kL,EL)}function $L(e,t){e*=LA,t*=LA;var n=GA(t),i=n*GA(e),r=n*QA(e),o=QA(t),s=WA(eD((s=kL*o-EL*r)*s+(s=EL*i-jL*o)*s+(s=jL*r-kL*i)*s),jL*i+kL*r+EL*o);dL+=s;mL+=s*(jL+(jL=i));bL+=s*(kL+(kL=r));vL+=s*(EL+(EL=o));SL(jL,kL,EL)}function FL(){AL.point=DL}function NL(){AL.point=zL}function TL(){RL(wL,OL);AL.point=DL}function zL(e,t){wL=e,OL=t;e*=LA,t*=LA;AL.point=RL;var n=GA(t);jL=n*GA(e);kL=n*QA(e);EL=QA(t);SL(jL,kL,EL)}function RL(e,t){e*=LA,t*=LA;var n=GA(t),i=n*GA(e),r=n*QA(e),o=QA(t),s=kL*o-EL*r,a=EL*i-jL*o,u=jL*r-kL*i,c=XA(s,a,u),l=iD(c),f=c&&-l/c;yL.add(f*s);xL.add(f*a);_L.add(f*u);dL+=l;mL+=l*(jL+(jL=i));bL+=l*(kL+(kL=r));vL+=l*(EL+(EL=o));SL(jL,kL,EL)}var BL=function(e){fL=dL=hL=pL=gL=mL=bL=vL=0;yL=new $A;xL=new $A;_L=new $A;CA(e,AL);var t=+yL,n=+xL,i=+_L,r=XA(t,n,i);if(reU(e,t)}var nU=function(e,t,n,i,r,o){const s=this.context.dataflow,a=this.context.data[e],u=a.input,c=s.stamp();let l=a.changes,f,d;if(s._trigger===false||!(u.value.length||t||i)){return 0}if(!l||l.stamp{a.modified=true;s.pulse(u,l).run()},true,1)}if(n){f=n===true?oe["hb"]:Object(oe["B"])(n)||fe(n)?n:tU(n);l.remove(f)}if(t){l.insert(t)}if(i){f=tU(i);if(u.value.some(f)){l.remove(f)}else{l.insert(i)}}if(r){for(d in o){l.modify(r,d,o[d])}}return 1};function iU(e){const t=e.touches,n=t[0].clientX-t[1].clientX,i=t[0].clientY-t[1].clientY;return Math.sqrt(n*n+i*i)}function rU(e){const t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)}function oU(e,t,n){return Nv(e||0,t||0,n||0)}function sU(e,t){const n=AI(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0}function aU(e,t){const n=AI(e,(t||this).context);return n?n.copy():undefined}function uU(e,t){const n=AI(e,(t||this).context);return n?n.domain():[]}function cU(e,t,n){const i=AI(e,(n||this).context);return!i?undefined:Object(oe["B"])(t)?(i.invertRange||i.invert)(t):(i.invert||i.invertExtent)(t)}function lU(e,t){const n=AI(e,(t||this).context);return n&&n.range?n.range():[]}function fU(e,t,n){const i=AI(e,(n||this).context);return i?i(t):undefined}var dU=function(e,t,n,i,r){e=AI(e,(r||this).context);const o=Lf(t,n);let s=e.domain(),a=s[0],u=Object(oe["V"])(s),c=oe["y"];if(!(u-a)){e=(e.interpolator?I_("sequential")().interpolator(e.interpolator()):I_("linear")().interpolate(e.interpolate()).range(e.range())).domain([a=0,u=1])}else{c=uO(e,a,u)}if(e.ticks){s=e.ticks(+i||15);if(a!==s[0])s.unshift(a);if(u!==Object(oe["V"])(s))s.push(u)}s.forEach(t=>o.stop(c(t),e(t)));return o};function hU(e,t,n){const i=AI(e,(n||this).context);return function(e){return i?i.path.context(e)(t):""}}function pU(e){let t=null;return function(n){return n?uh(n,t=t||Xd(e)):e}}const gU=e=>e.data;function mU(e,t){const n=HR.call(t,e);return n.root&&n.root.lookup||{}}function bU(e,t,n){const i=mU(e,this),r=i[t],o=i[n];return r&&o?r.path(o).map(gU):undefined}function vU(e,t){const n=mU(e,this)[t];return n?n.ancestors().map(gU):undefined}const yU=()=>typeof window!=="undefined"&&window||null;function xU(){const e=yU();return e?e.screen:{}}function _U(){const e=yU();return e?[e.innerWidth,e.innerHeight]:[undefined,undefined]}function wU(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[undefined,undefined]}const OU="intersect";const jU="union";const kU="vlMulti";const EU="or";const AU="and";var DU="E",SU="R",MU="R-E",CU="R-LE",$U="R-RE",FU="index:unit";function NU(e,t){var n=t.fields,i=t.values,r=n.length,o=0,s,a;for(;o(e[c[n].field]=t,e),{}))}}t=t||jU;Object.keys(o).forEach(e=>{o[e]=Object.keys(o[e]).map(t=>o[e][t]).reduce((n,i)=>n===undefined?i:RU[a[e]+"_"+t](n,i))});r=Object.keys(s);if(n&&r.length){o[kU]=t===jU?{[EU]:r.reduce((e,t)=>(e.push.apply(e,s[t]),e),[])}:{[AU]:r.map(e=>({[EU]:s[e]}))}}return o}var RU={E_union:function(e,t){if(!e.length)return t;var n=0,i=t.length;for(;nt.indexOf(e)>=0)},R_union:function(e,t){var n=Object(oe["db"])(t[0]),i=Object(oe["db"])(t[1]);if(n>i){n=t[1];i=t[0]}if(!e.length)return[n,i];if(e[0]>n)e[0]=n;if(e[1]i){n=t[1];i=t[0]}if(!e.length)return[n,i];if(ii)e[1]=i}return e}};const BU=":",PU="@";function IU(e,t,n,i){if(t[0].type!==hB)Object(oe["o"])("First argument to selection functions must be a string literal.");const r=t[0].value,o=t.length>=2&&Object(oe["V"])(t).value,s="unit",a=PU+s,u=BU+r;if(o===OU&&!Object(oe["w"])(i,a)){i[a]=n.getData(r).indataRef(n,s)}if(!Object(oe["w"])(i,u)){i[u]=n.getData(r).tuplesRef()}}var LU=function(e,t,n){if(!e)return[];const[i,r]=e,o=(new Zp).set(i[0],i[1],r[0],r[1]),s=n||this.context.dataflow.scenegraph().root;return Gj(s,o,UU(t))};function UU(e){let t=null;if(e){const n=Object(oe["i"])(e.marktype),i=Object(oe["i"])(e.markname);t=e=>(!n.length||n.some(t=>e.marktype===t))&&(!i.length||i.some(t=>e.name===t))}return t}const qU={random(){return xu()},cumulativeNormal:$u,cumulativeLogNormal:Pu,cumulativeUniform:Gu,densityNormal:Cu,densityLogNormal:Bu,densityUniform:Wu,quantileNormal:Fu,quantileLogNormal:Iu,quantileUniform:Hu,sampleNormal:Mu,sampleLogNormal:Ru,sampleUniform:qu,isArray:oe["B"],isBoolean:oe["C"],isDate:oe["D"],isDefined(e){return e!==undefined},isNumber:oe["F"],isObject:oe["G"],isRegExp:oe["H"],isString:oe["I"],isTuple:fe,isValid(e){return e!=null&&e===e},toBoolean:oe["bb"],toDate:oe["cb"],toNumber:oe["db"],toString:oe["fb"],flush:oe["v"],lerp:oe["K"],merge:ZL,pad:oe["Q"],peek:oe["V"],span:oe["Y"],inrange:oe["A"],truncate:oe["gb"],rgb:Gy,lab:Aw,hcl:Tw,hsl:Qy,luminance:XL,contrast:JL,sequence:Sl,format:ZR,utcFormat:KR,utcParse:tB,utcOffset:Rr,utcSequence:Ir,timeFormat:QR,timeParse:eB,timeOffset:zr,timeSequence:Pr,timeUnitSpecifier:Ln,monthFormat:rB,monthAbbrevFormat:oB,dayFormat:sB,dayAbbrevFormat:aB,quarter:oe["W"],utcquarter:oe["ib"],week:Ti,utcweek:Li,dayofyear:Ni,utcdayofyear:Ii,warn:GL,info:HL,debug:VL,extent:oe["q"],inScope:qL,intersect:LU,clampRange:oe["k"],pinchDistance:iU,pinchAngle:rU,screen:xU,containerSize:wU,windowSize:_U,bandspace:oU,setdata:YR,pathShape:pU,panLinear:oe["R"],panLog:oe["S"],panPow:oe["T"],panSymlog:oe["U"],zoomLinear:oe["mb"],zoomLog:oe["nb"],zoomPow:oe["ob"],zoomSymlog:oe["pb"],encode:XR,modify:nU};const WU=["view","item","group","xy","x","y"],GU="event.vega.",HU="this.",VU={};const YU={blacklist:["_"],whitelist:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${Object(oe["ab"])(fB+e)}]`,functions:JU,constants:yI,visitors:VU};const XU=wI(YU);function JU(e){const t=xI(e);WU.forEach(e=>t[e]=GU+e);for(const n in qU){t[n]=HU+n}Object(oe["p"])(t,DI(e,qU,VU));return t}function ZU(e,t,n){if(arguments.length===1){return qU[e]}qU[e]=t;if(n)VU[e]=n;if(XU)XU.functions[e]=HU+e;return this}ZU("bandwidth",sU,kI);ZU("copy",aU,kI);ZU("domain",uU,kI);ZU("range",lU,kI);ZU("invert",cU,kI);ZU("scale",fU,kI);ZU("gradient",dU,kI);ZU("geoArea",IL,kI);ZU("geoBounds",LL,kI);ZU("geoCentroid",UL,kI);ZU("geoShape",hU,kI);ZU("indata",VR,jI);ZU("data",HR,OI);ZU("treePath",bU,OI);ZU("treeAncestors",vU,OI);ZU("vlSelectionTest",TU,IU);ZU("vlSelectionResolve",zU,IU);var QU=function(e,t){const n={};let i;try{e=Object(oe["I"])(e)?e:Object(oe["ab"])(e)+"";i=vI(e)}catch(o){Object(oe["o"])("Expression parse error: "+e)}i.visit(e=>{if(e.type!==vB)return;const i=e.callee.name,r=YU.visitors[i];if(r)r(i,e.arguments,t,n)});const r=XU(i);r.globals.forEach(e=>{const i=fB+e;if(!Object(oe["w"])(n,i)&&t.getSignal(e)){n[i]=t.signalRef(e)}});return{$expr:Object(oe["p"])({code:r.code},t.options.ast?{ast:i}:null),$fields:r.fields,$params:n}};var KU=function(e){const t=this,n=e.operators||[];if(e.background){t.background=e.background}if(e.eventConfig){t.eventConfig=e.eventConfig}if(e.locale){t.locale=e.locale}n.forEach(e=>t.parseOperator(e));n.forEach(e=>t.parseOperatorParameters(e));(e.streams||[]).forEach(e=>t.parseStream(e));(e.updates||[]).forEach(e=>t.parseUpdate(e));return t.resolve()};const eq=Object(oe["eb"])(["rule"]),tq=Object(oe["eb"])(["group","image","rect"]);function nq(e,t){let n="";if(eq[t])return n;if(e.x2){if(e.x){if(tq[t]){n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"}n+="o.width=o.x2-o.x;"}else{n+="o.x=o.x2-(o.width||0);"}}if(e.xc){n+="o.x=o.xc-(o.width||0)/2;"}if(e.y2){if(e.y){if(tq[t]){n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"}n+="o.height=o.y2-o.y;"}else{n+="o.y=o.y2-(o.height||0);"}}if(e.yc){n+="o.y=o.yc-(o.height||0)/2;"}return n}function iq(e){return(e+"").toLowerCase()}function rq(e){return iq(e)==="operator"}function oq(e){return iq(e)==="collect"}function sq(e,t,n){if(n[n.length-1]!==";"){n="return("+n+");"}var i=Function.apply(null,t.concat(n));return e&&e.functions?i.bind(e.functions):i}function aq(e,t,n,i){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n}\n : (u > v || v == null) && u != null ? ${i}\n : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${n}\n : v !== v && u === u ? ${i} : `}var uq={operator:(e,t)=>sq(e,["_"],t.code),parameter:(e,t)=>sq(e,["datum","_"],t.code),event:(e,t)=>sq(e,["event"],t.code),handler:(e,t)=>{const n=`var datum=event.item&&event.item.datum;return ${t.code};`;return sq(e,["_","event"],n)},encode:(e,t)=>{const{marktype:n,channels:i}=t;let r="var o=item,datum=o.datum,m=0,$;";for(const o in i){const e="o["+Object(oe["ab"])(o)+"]";r+=`$=${i[o].code};if(${e}!==$)${e}=$,m=1;`}r+=nq(i,n);r+="return m;";return sq(e,["item","_"],r)},codegen:{get(e){const t=`[${e.map(oe["ab"]).join("][")}]`;const n=Function("_",`return _${t};`);n.path=t;return n},comparator(e,t){let n;const i=(e,i)=>{const r=t[i];let o,s;if(e.path){o=`a${e.path}`;s=`b${e.path}`}else{(n=n||{})["f"+i]=e;o=`this.f${i}(a)`;s=`this.f${i}(b)`}return aq(o,s,-r,r)};const r=Function("a","b","var u, v; return "+e.map(i).join("")+"0;");return n?r.bind(n):r}}};function cq(e){const t=this;if(rq(e.type)||!e.type){t.operator(e,e.update?t.operatorExpression(e.update):null)}else{t.transform(e,e.type)}}function lq(e){const t=this;if(e.params){const n=t.get(e.id);if(!n)Object(oe["o"])("Invalid operator id: "+e.id);t.dataflow.connect(n,n.parameters(t.parseParameters(e.params),e.react,e.initonly))}}function fq(e,t){t=t||{};const n=this;for(const i in e){const r=e[i];t[i]=Object(oe["B"])(r)?r.map(e=>dq(e,n,t)):dq(r,n,t)}return t}function dq(e,t,n){if(!e||!Object(oe["G"])(e))return e;for(let i=0,r=hq.length,o;ie&&e.$tupleid?de:e);return t.fn[n]||(t.fn[n]=Object(oe["l"])(i,e.$order,t.expr.codegen))}function yq(e,t){const n=e.$encode,i={};for(const r in n){const e=n[r];i[r]=Object(oe["f"])(t.encodeExpression(e.$expr),e.$fields);i[r].output=e.$output}return i}function xq(e,t){return t}function _q(e,t){const n=e.$subflow;return function(e,i,r){const o=t.fork().parse(n),s=o.get(n.operators[0].id),a=o.signals.parent;if(a)a.set(r);s.detachSubflow=()=>t.detach(o);return s}}function wq(){return de}var Oq=function(e){var t=this,n=e.filter!=null?t.eventExpression(e.filter):undefined,i=e.stream!=null?t.get(e.stream):undefined,r;if(e.source){i=t.events(e.source,e.type,n)}else if(e.merge){r=e.merge.map(e=>t.get(e));i=r[0].merge.apply(r[0],r.slice(1))}if(e.between){r=e.between.map(e=>t.get(e));i=i.between(r[0],r[1])}if(e.filter){i=i.filter(n)}if(e.throttle!=null){i=i.throttle(+e.throttle)}if(e.debounce!=null){i=i.debounce(+e.debounce)}if(i==null){Object(oe["o"])("Invalid stream definition: "+JSON.stringify(e))}if(e.consume)i.consume(true);t.stream(e,i)};var jq=function(e){var t=this,n=Object(oe["G"])(n=e.source)?n.$ref:n,i=t.get(n),r=null,o=e.update,s=undefined;if(!i)Object(oe["o"])("Source not defined: "+e.source);r=e.target&&e.target.$expr?t.eventExpression(e.target.$expr):t.get(e.target);if(o&&o.$expr){if(o.$params){s=t.parseParameters(o.$params)}o=t.handlerExpression(o.$expr)}t.update(e,i,r,o,s)};var kq={skip:true};function Eq(e){var t=this,n={};if(e.signals){var i=n.signals={};Object.keys(t.signals).forEach(n=>{var r=t.signals[n];if(e.signals(n,r)){i[n]=r.value}})}if(e.data){var r=n.data={};Object.keys(t.data).forEach(n=>{var i=t.data[n];if(e.data(n,i)){r[n]=i.input.value}})}if(t.subcontext&&e.recurse!==false){n.subcontext=t.subcontext.map(t=>t.getState(e))}return n}function Aq(e){var t=this,n=t.dataflow,i=e.data,r=e.signals;Object.keys(r||{}).forEach(e=>{n.update(t.signals[e],r[e],kq)});Object.keys(i||{}).forEach(e=>{n.pulse(t.data[e].input,n.changeset().remove(oe["hb"]).insert(i[e]))});(e.subcontext||[]).forEach((e,n)=>{var i=t.subcontext[n];if(i)i.setState(e)})}var Dq=function(e,t,n,i){return new Sq(e,t,n,i)};function Sq(e,t,n,i){this.dataflow=e;this.transforms=t;this.events=e.events.bind(e);this.expr=i||uq,this.signals={};this.scales={};this.nodes={};this.data={};this.fn={};if(n){this.functions=Object.create(n);this.functions.context=this}}function Mq(e){this.dataflow=e.dataflow;this.transforms=e.transforms;this.events=e.events;this.expr=e.expr;this.signals=Object.create(e.signals);this.scales=Object.create(e.scales);this.nodes=Object.create(e.nodes);this.data=Object.create(e.data);this.fn=Object.create(e.fn);if(e.functions){this.functions=Object.create(e.functions);this.functions.context=this}}Sq.prototype=Mq.prototype={fork(){const e=new Mq(this);(this.subcontext||(this.subcontext=[])).push(e);return e},detach(e){this.subcontext=this.subcontext.filter(t=>t!==e);const t=Object.keys(e.nodes);for(const n of t)e.nodes[n]._targets=null;for(const n of t)e.nodes[n].detach();e.nodes=null},get(e){return this.nodes[e]},set(e,t){return this.nodes[e]=t},add(e,t){const n=this,i=n.dataflow,r=e.value;n.set(e.id,t);if(oq(e.type)&&r){if(r.$ingest){i.ingest(t,r.$ingest,r.$format)}else if(r.$request){i.preload(t,r.$request,r.$format)}else{i.pulse(t,i.changeset().insert(r))}}if(e.root){n.root=t}if(e.parent){var o=n.get(e.parent.$ref);if(o){i.connect(o,[t]);t.targets().add(o)}else{(n.unresolved=n.unresolved||[]).push(()=>{o=n.get(e.parent.$ref);i.connect(o,[t]);t.targets().add(o)})}}if(e.signal){n.signals[e.signal]=t}if(e.scale){n.scales[e.scale]=t}if(e.data){for(const i in e.data){const r=n.data[i]||(n.data[i]={});e.data[i].forEach(e=>r[e]=t)}}},resolve(){(this.unresolved||[]).forEach(e=>e());delete this.unresolved;return this},operator(e,t){this.add(e,this.dataflow.add(e.value,t))},transform(e,t){this.add(e,this.dataflow.add(this.transforms[iq(t)]))},stream(e,t){this.set(e.id,t)},update(e,t,n,i,r){this.dataflow.on(t,n,i,r,e.options)},operatorExpression(e){return this.expr.operator(this,e)},parameterExpression(e){return this.expr.parameter(this,e)},eventExpression(e){return this.expr.event(this,e)},handlerExpression(e){return this.expr.handler(this,e)},encodeExpression(e){return this.expr.encode(this,e)},parse:KU,parseOperator:cq,parseOperatorParameters:lq,parseParameters:fq,parseStream:Oq,parseUpdate:jq,getState:Eq,setState:Aq};var Cq=function(e,t,n){return Dq(e,Ia,qU,n).parse(t)};function $q(e){var t=this._runtime.scales;if(!Object(oe["w"])(t,e)){Object(oe["o"])("Unrecognized scale or projection: "+e)}return t[e].value}var Fq="width",Nq="height",Tq="padding",zq={skip:true};function Rq(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===Tq?i.left+i.right:0)}function Bq(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===Tq?i.top+i.bottom:0)}function Pq(e){var t=e._signals,n=t[Fq],i=t[Nq],r=t[Tq];function o(){e._autosize=e._resize=1}e._resizeWidth=e.add(null,t=>{e._width=t.size;e._viewWidth=Rq(e,t.size);o()},{size:n});e._resizeHeight=e.add(null,t=>{e._height=t.size;e._viewHeight=Bq(e,t.size);o()},{size:i});var s=e.add(null,o,{pad:r});e._resizeWidth.rank=n.rank+1;e._resizeHeight.rank=i.rank+1;s.rank=r.rank+1}function Iq(e,t,n,i,r,o){this.runAfter(s=>{var a=0;s._autosize=0;if(s.width()!==n){a=1;s.signal(Fq,n,zq);s._resizeWidth.skip(true)}if(s.height()!==i){a=1;s.signal(Nq,i,zq);s._resizeHeight.skip(true)}if(s._viewWidth!==e){s._resize=1;s._viewWidth=e}if(s._viewHeight!==t){s._resize=1;s._viewHeight=t}if(s._origin[0]!==r[0]||s._origin[1]!==r[1]){s._resize=1;s._origin=r}if(a)s.run("enter");if(o)s.runAfter(e=>e.resize())},false,1)}function Lq(e){return this._runtime.getState(e||{data:Uq,signals:qq,recurse:true})}function Uq(e,t){return t.modified&&Object(oe["B"])(t.input.value)&&e.indexOf("_:vega:_")}function qq(e,t){return!(e==="parent"||t instanceof Ia.proxy)}function Wq(e){this.runAsync(null,t=>{t._trigger=false;t._runtime.setState(e)},e=>{e._trigger=true});return this}var Gq=function(e,t,n){var i=new aF,r=t;if(t==null)return i.restart(e,t,n),i;i._restart=i.restart;i.restart=function(e,t,n){t=+t,n=n==null?oF():+n;i._restart((function o(s){s+=r;i._restart(o,r+=t,n);e(s)}),t,n)};i.restart(e,t,n);return i};var Hq=function(e,t){function n(t){e({timestamp:Date.now(),elapsed:t})}this._timers.push(Gq(n,t))};var Vq=function(e,t,n,i){var r=e.element();if(r)r.setAttribute("title",Yq(i))};function Yq(e){return e==null?"":Object(oe["B"])(e)?Jq(e):Object(oe["G"])(e)&&!Object(oe["D"])(e)?Xq(e):e+""}function Xq(e){return Object.keys(e).map(t=>{var n=e[t];return t+": "+(Object(oe["B"])(n)?Jq(n):Zq(n))}).join("\n")}function Jq(e){return"["+e.map(Zq).join(", ")+"]"}function Zq(e){return Object(oe["B"])(e)?"[…]":Object(oe["G"])(e)&&!Object(oe["D"])(e)?"{…}":e}function Qq(e,t){const n=this;t=t||{};Ra.call(n);if(t.loader)n.loader(t.loader);if(t.logger)n.logger(t.logger);if(t.logLevel!=null)n.logLevel(t.logLevel);if(t.locale||e.locale){const i=Object(oe["p"])({},e.locale,t.locale);n.locale(Us(i.number,i.time))}n._el=null;n._elBind=null;n._renderType=t.renderer||Uj.Canvas;n._scenegraph=new Pb;const i=n._scenegraph.root;n._renderer=null;n._tooltip=t.tooltip||Vq,n._redraw=true;n._handler=(new yv).scene(i);n._globalCursor=false;n._preventDefault=false;n._timers=[];n._eventListeners=[];n._resizeListeners=[];n._eventConfig=dR(e.eventConfig);n.globalCursor(n._eventConfig.globalCursor);const r=Cq(n,e,t.expr);n._runtime=r;n._signals=r.signals;n._bind=(e.bindings||[]).map(e=>({state:null,param:Object(oe["p"])({},e)}));if(r.root)r.root.set(i);i.source=r.data.root.input;n.pulse(r.data.root.input,n.changeset().insert(i.items));n._width=n.width();n._height=n.height();n._viewWidth=Rq(n,n._width);n._viewHeight=Bq(n,n._height);n._origin=[0,0];n._resize=0;n._autosize=1;Pq(n);Vz(n);Xz(n);n.description(e.description);if(t.hover)n.hover();if(t.container)n.initialize(t.container,t.bind)}function Kq(e,t){return Object(oe["w"])(e._signals,t)?e._signals[t]:Object(oe["o"])("Unrecognized signal name: "+Object(oe["ab"])(t))}function eW(e,t){const n=(e._targets||[]).filter(e=>e._update&&e._update.handler===t);return n.length?n[0]:null}function tW(e,t,n,i){var r=eW(n,i);if(!r){r=NR(e,()=>i(t,n.value));r.handler=i;e.on(n,null,r)}return e}function nW(e,t,n){var i=eW(t,n);if(i)t._targets.remove(i);return e}Object(oe["z"])(Qq,Ra,{async evaluate(e,t,n){await Ra.prototype.evaluate.call(this,e,t);if(this._redraw||this._resize){try{if(this._renderer){if(this._resize){this._resize=0;oR(this)}await this._renderer.renderAsync(this._scenegraph.root)}this._redraw=false}catch(i){this.error(i)}}if(n)ae(this,n);return this},dirty(e){this._redraw=true;this._renderer&&this._renderer.dirty(e)},description(e){if(arguments.length){const t=e!=null?e+"":null;if(t!==this._desc)Hz(this._el,this._desc=t);return this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(e,t,n){var i=Kq(this,e);return arguments.length===1?i.value:this.update(i,t,n)},width(e){return arguments.length?this.signal("width",e):this.signal("width")},height(e){return arguments.length?this.signal("height",e):this.signal("height")},padding(e){return arguments.length?this.signal("padding",IR(e)):IR(this.signal("padding"))},autosize(e){return arguments.length?this.signal("autosize",e):this.signal("autosize")},background(e){return arguments.length?this.signal("background",e):this.signal("background")},renderer(e){if(!arguments.length)return this._renderType;if(!Wj(e))Object(oe["o"])("Unrecognized renderer type: "+e);if(e!==this._renderType){this._renderType=e;this._resetRenderer()}return this},tooltip(e){if(!arguments.length)return this._tooltip;if(e!==this._tooltip){this._tooltip=e;this._resetRenderer()}return this},loader(e){if(!arguments.length)return this._loader;if(e!==this._loader){Ra.prototype.loader.call(this,e);this._resetRenderer()}return this},resize(){this._autosize=1;return this.touch(Kq(this,"autosize"))},_resetRenderer(){if(this._renderer){this._renderer=null;this.initialize(this._el,this._elBind)}},_resizeView:Iq,addEventListener(e,t,n){var i=t;if(!(n&&n.trap===false)){i=NR(this,t);i.raw=t}this._handler.on(e,i);return this},removeEventListener(e,t){var n=this._handler.handlers(e),i=n.length,r,o;while(--i>=0){o=n[i].type;r=n[i].handler;if(e===o&&(t===r||t===r.raw)){this._handler.off(o,r);break}}return this},addResizeListener(e){var t=this._resizeListeners;if(t.indexOf(e)<0){t.push(e)}return this},removeResizeListener(e){var t=this._resizeListeners,n=t.indexOf(e);if(n>=0){t.splice(n,1)}return this},addSignalListener(e,t){return tW(this,e,Kq(this,e),t)},removeSignalListener(e,t){return nW(this,Kq(this,e),t)},addDataListener(e,t){return tW(this,e,Zz(this,e).values,t)},removeDataListener(e,t){return nW(this,Zz(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){const t=Jz(this,null);this._globalCursor=!!e;if(t)Jz(this,t)}return this}else{return this._globalCursor}},preventDefault(e){if(arguments.length){this._preventDefault=e;return this}else{return this._preventDefault}},timer:Hq,events:gR,finalize:xR,hover:yR,data:Qz,change:Kz,insert:eR,remove:tR,scale:$q,initialize:zR,toImageURL:UR,toCanvas:WR,toSVG:GR,getState:Lq,setState:Wq});var iW=function(e){return Object(oe["G"])(e)?e:{type:e||"pad"}};const rW=e=>+e||0;const oW=e=>({top:e,bottom:e,left:e,right:e});var sW=function(e){return!Object(oe["G"])(e)?oW(rW(e)):e.signal?e:{top:rW(e.top),bottom:rW(e.bottom),left:rW(e.left),right:rW(e.right)}};const aW=e=>Object(oe["G"])(e)&&!Object(oe["B"])(e)?Object(oe["p"])({},e):{value:e};function uW(e,t,n,i){if(n!=null){const r=Object(oe["G"])(n)&&!Object(oe["B"])(n)||Object(oe["B"])(n)&&n.length&&Object(oe["G"])(n[0]);if(r){e.update[t]=n}else{e[i||"enter"][t]={value:n}}return 1}else{return 0}}function cW(e,t,n){for(const i in t){uW(e,i,t[i])}for(const i in n){uW(e,i,n[i],"update")}}function lW(e,t,n){for(const i in t){if(n&&Object(oe["w"])(n,i))continue;e[i]=Object(oe["p"])(e[i]||{},t[i])}return e}function fW(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}const dW="mark";const hW="frame";const pW="scope";const gW="axis";const mW="axis-domain";const bW="axis-grid";const vW="axis-label";const yW="axis-tick";const xW="axis-title";const _W="legend";const wW="legend-band";const OW="legend-entry";const jW="legend-gradient";const kW="legend-label";const EW="legend-symbol";const AW="legend-title";const DW="title";const SW="title-text";const MW="title-subtitle";var CW=function(e,t,n,i,r){const o={},s={};let a,u,c,l;u="lineBreak";if(t==="text"&&r[u]!=null&&!fW(u,e)){$W(o,u,r[u])}if(n=="legend"||String(n).startsWith("axis")){n=null}l=n===hW?r.group:n===dW?Object(oe["p"])({},r.mark,r[t]):null;for(u in l){c=fW(u,e)||(u==="fill"||u==="stroke")&&(fW("fill",e)||fW("stroke",e));if(!c)$W(o,u,l[u])}Object(oe["i"])(i).forEach(t=>{const n=r.style&&r.style[t];for(const i in n){if(!fW(i,e)){$W(o,i,n[i])}}});e=Object(oe["p"])({},e);for(u in o){l=o[u];if(l.signal){(a=a||{})[u]=l}else{s[u]=l}}e.enter=Object(oe["p"])(s,e.enter);if(a)e.update=Object(oe["p"])(a,e.update);return e};function $W(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const FW=e=>Object(oe["I"])(e)?Object(oe["ab"])(e):e.signal?`(${e.signal})`:PW(e);function NW(e){if(e.gradient!=null){return RW(e)}let t=e.signal?`(${e.signal})`:e.color?zW(e.color):e.field!=null?PW(e.field):e.value!==undefined?Object(oe["ab"])(e.value):undefined;if(e.scale!=null){t=LW(e,t)}if(t===undefined){t=null}if(e.exponent!=null){t=`pow(${t},${BW(e.exponent)})`}if(e.mult!=null){t+=`*${BW(e.mult)}`}if(e.offset!=null){t+=`+${BW(e.offset)}`}if(e.round){t=`round(${t})`}return t}const TW=(e,t,n,i)=>`(${e}(${[t,n,i].map(NW).join(",")})+'')`;function zW(e){return e.c?TW("hcl",e.h,e.c,e.l):e.h||e.s?TW("hsl",e.h,e.s,e.l):e.l||e.a?TW("lab",e.l,e.a,e.b):e.r||e.g||e.b?TW("rgb",e.r,e.g,e.b):null}function RW(e){const t=[e.start,e.stop,e.count].map(e=>e==null?null:Object(oe["ab"])(e));while(t.length&&Object(oe["V"])(t)==null)t.pop();t.unshift(FW(e.gradient));return`gradient(${t.join(",")})`}function BW(e){return Object(oe["G"])(e)?"("+NW(e)+")":e}function PW(e){return IW(Object(oe["G"])(e)?e:{datum:e})}function IW(e){let t,n,i;if(e.signal){t="datum";i=e.signal}else if(e.group||e.parent){n=Math.max(1,e.level||1);t="item";while(n-- >0){t+=".mark.group"}if(e.parent){i=e.parent;t+=".datum"}else{i=e.group}}else if(e.datum){t="datum";i=e.datum}else{Object(oe["o"])("Invalid field reference: "+Object(oe["ab"])(e))}if(!e.signal){i=Object(oe["I"])(i)?Object(oe["Z"])(i).map(oe["ab"]).join("]["):IW(i)}return t+"["+i+"]"}function LW(e,t){const n=FW(e.scale);if(e.range!=null){t=`lerp(_range(${n}), ${+e.range})`}else{if(t!==undefined)t=`_scale(${n}, ${t})`;if(e.band){t=(t?t+"+":"")+`_bandwidth(${n})`+(+e.band===1?"":"*"+BW(e.band));if(e.extra){t=`(datum.extra ? _scale(${n}, datum.extra.value) : ${t})`}}if(t==null)t="0"}return t}var UW=function(e){let t="";e.forEach(e=>{const n=NW(e);t+=e.test?`(${e.test})?${n}:`:n});if(Object(oe["V"])(t)===":"){t+="null"}return t};var qW=function(e,t,n,i,r,o){const s={};o=o||{};o.encoders={$encode:s};e=CW(e,t,n,i,r.config);for(const a in e){s[a]=WW(e[a],t,o,r)}return o};function WW(e,t,n,i){const r={},o={};for(const s in e){if(e[s]!=null){r[s]=HW(GW(e[s]),i,n,o)}}return{$expr:{marktype:t,channels:r},$fields:Object.keys(o),$output:Object.keys(e)}}function GW(e){return Object(oe["B"])(e)?UW(e):NW(e)}function HW(e,t,n,i){const r=QU(e,t);r.$fields.forEach(e=>i[e]=1);Object(oe["p"])(n,r.$params);return r.$expr}const VW="outer",YW=["value","update","init","react","bind"];function XW(e,t){Object(oe["o"])(e+' for "outer" push: '+Object(oe["ab"])(t))}var JW=function(e,t){const n=e.name;if(e.push===VW){if(!t.signals[n])XW("No prior signal definition",n);YW.forEach(t=>{if(e[t]!==undefined)XW("Invalid property ",t)})}else{const i=t.addSignal(n,e.value);if(e.react===false)i.react=false;if(e.bind)t.addBinding(n,e.bind)}};function ZW(e,t,n,i){this.id=-1;this.type=e;this.value=t;this.params=n;if(i)this.parent=i}function QW(e,t,n,i){return new ZW(e,t,n,i)}function KW(e,t){return QW("operator",e,t)}function eG(e){const t={$ref:e.id};if(e.id<0)(e.refs=e.refs||[]).push(t);return t}const tG={$tupleid:1,toString:function(){return":_tupleid_:"}};function nG(e,t){return t?{$field:e,$name:t}:{$field:e}}const iG=nG("key");function rG(e,t){return{$compare:e,$order:t}}function oG(e,t){const n={$key:e};if(t)n.$flat=true;return n}const sG="ascending";const aG="descending";function uG(e){return!Object(oe["G"])(e)?"":(e.order===aG?"-":"+")+cG(e.op,e.field)}function cG(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}const lG="scope";const fG="view";function dG(e){return e&&e.signal}function hG(e){return e&&e.expr}function pG(e){if(dG(e))return true;if(Object(oe["G"])(e))for(const t in e){if(pG(e[t]))return true}return false}function gG(e,t){return e!=null?e:t}function mG(e){return e&&e.signal||e}const bG="timer";function vG(e,t){const n=e.merge?xG:e.stream?_G:e.type?wG:Object(oe["o"])("Invalid stream specification: "+Object(oe["ab"])(e));return n(e,t)}function yG(e){return e===lG?fG:e||fG}function xG(e,t){const n=e.merge.map(e=>vG(e,t)),i=OG({merge:n},e,t);return t.addStream(i).id}function _G(e,t){const n=vG(e.stream,t),i=OG({stream:n},e,t);return t.addStream(i).id}function wG(e,t){let n;if(e.type===bG){n=t.event(bG,e.throttle);e={between:e.between,filter:e.filter}}else{n=t.event(yG(e.source),e.type)}const i=OG({stream:n},e,t);return Object.keys(i).length===1?n:t.addStream(i).id}function OG(e,t,n){let i=t.between;if(i){if(i.length!==2){Object(oe["o"])('Stream "between" parameter must have 2 entries: '+Object(oe["ab"])(t))}e.between=[vG(i[0],n),vG(i[1],n)]}i=t.filter?[].concat(t.filter):[];if(t.marktype||t.markname||t.markrole){i.push(jG(t.marktype,t.markname,t.markrole))}if(t.source===lG){i.push("inScope(event.item)")}if(i.length){e.filter=QU("("+i.join(")&&(")+")",n).$expr}if((i=t.throttle)!=null){e.throttle=+i}if((i=t.debounce)!=null){e.debounce=+i}if(t.consume){e.consume=true}return e}function jG(e,t,n){const i="event.item";return i+(e&&e!=="*"?"&&"+i+".mark.marktype==='"+e+"'":"")+(n?"&&"+i+".mark.role==='"+n+"'":"")+(t?"&&"+i+".mark.name==='"+t+"'":"")}const kG="view",EG="[",AG="]",DG="{",SG="}",MG=":",CG=",",$G="@",FG=">",NG=/[[\]{}]/,TG={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let zG,RG;var BG=function(e,t,n){zG=t||kG;RG=n||TG;return LG(e.trim()).map(UG)};function PG(e){return RG[e]}function IG(e,t,n,i,r){const o=e.length;let s=0,a;for(;t=0)--s;else if(i&&i.indexOf(a)>=0)++s}return t}function LG(e){const t=[],n=e.length;let i=0,r=0;while(r' after between selector: "+e}i=i.map(UG);const r=UG(e.slice(1).trim());if(r.between){return{between:i,stream:r}}else{r.between=i}return r}function WG(e){const t={source:zG},n=[];let i=[0,0],r=0,o=0,s=e.length,a=0,u,c;if(e[s-1]===SG){a=e.lastIndexOf(DG);if(a>=0){try{i=GG(e.substring(a+1,s-1))}catch(l){throw"Invalid throttle specification: "+e}e=e.slice(0,a).trim();s=e.length}else throw"Unmatched right brace: "+e;a=0}if(!s)throw e;if(e[0]===$G)r=++a;u=IG(e,a,MG);if(u1){t.type=n[1];if(r){t.markname=n[0].slice(1)}else if(PG(n[0])){t.marktype=n[0]}else{t.source=n[0]}}else{t.type=n[0]}if(t.type.slice(-1)==="!"){t.consume=true;t.type=t.type.slice(0,-1)}if(c!=null)t.filter=c;if(i[0])t.throttle=i[0];if(i[1])t.debounce=i[1];return t}function GG(e){const t=e.split(CG);if(!e.length||t.length>2)throw e;return t.map(t=>{const n=+t;if(n!==n)throw e;return n})}const HG={code:"_.$value",ast:{type:"Identifier",value:"value"}};var VG=function(e,t,n){const i=e.encode,r={target:n};let o=e.events,s=e.update,a=[];if(!o){Object(oe["o"])("Signal update missing events specification.")}if(Object(oe["I"])(o)){o=BG(o,t.isSubscope()?lG:fG)}o=Object(oe["i"])(o).filter(e=>e.signal||e.scale?(a.push(e),0):1);if(a.length>1){a=[XG(a)]}if(o.length){a.push(o.length>1?{merge:o}:o[0])}if(i!=null){if(s)Object(oe["o"])("Signal encode and update are mutually exclusive.");s="encode(item(),"+Object(oe["ab"])(i)+")"}r.update=Object(oe["I"])(s)?QU(s,t):s.expr!=null?QU(s.expr,t):s.value!=null?s.value:s.signal!=null?{$expr:HG,$params:{$value:t.signalRef(s.signal)}}:Object(oe["o"])("Invalid signal update specification.");if(e.force){r.options={force:true}}a.forEach(e=>t.addUpdate(Object(oe["p"])(YG(e,t),r)))};function YG(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):vG(e,t)}}function XG(e){return{signal:"["+e.map(e=>e.scale?'scale("'+e.scale+'")':e.signal)+"]"}}var JG=function(e,t){const n=t.getSignal(e.name);let i=e.update;if(e.init){if(i){Object(oe["o"])("Signals can not include both init and update expressions.")}else{i=e.init;n.initonly=true}}if(i){i=QU(i,t);n.update=i.$expr;n.params=i.$params}if(e.on){e.on.forEach(e=>VG(e,t,n.id))}};const ZG=e=>(t,n,i)=>QW(e,n,t||undefined,i);const QG=ZG("aggregate");const KG=ZG("axisticks");const eH=ZG("bound");const tH=ZG("collect");const nH=ZG("compare");const iH=ZG("datajoin");const rH=ZG("encode");const oH=ZG("expression");const sH=ZG("extent");const aH=ZG("facet");const uH=ZG("field");const cH=ZG("key");const lH=ZG("legendentries");const fH=ZG("load");const dH=ZG("mark");const hH=ZG("multiextent");const pH=ZG("multivalues");const gH=ZG("overlap");const mH=ZG("params");const bH=ZG("prefacet");const vH=ZG("projection");const yH=ZG("proxy");const xH=ZG("relay");const _H=ZG("render");const wH=ZG("scale");const OH=ZG("sieve");const jH=ZG("sortitems");const kH=ZG("viewlayout");const EH=ZG("values");let AH=0;const DH={min:"min",max:"max",count:"sum"};function SH(e,t){const n=e.type||"linear";if(!L_(n)){Object(oe["o"])("Unrecognized scale type: "+Object(oe["ab"])(n))}t.addScale(e.name,{type:n,domain:undefined})}function MH(e,t){const n=t.getScale(e.name).params;let i;n.domain=NH(e.domain,e,t);if(e.range!=null){n.range=HH(e,t,n)}if(e.interpolate!=null){GH(e.interpolate,n)}if(e.nice!=null){n.nice=WH(e.nice)}if(e.bins!=null){n.bins=qH(e.bins,t)}for(i in e){if(Object(oe["w"])(n,i)||i==="name")continue;n[i]=CH(e[i],t)}}function CH(e,t){return!Object(oe["G"])(e)?e:e.signal?t.signalRef(e.signal):Object(oe["o"])("Unsupported object: "+Object(oe["ab"])(e))}function $H(e,t){return e.signal?t.signalRef(e.signal):e.map(e=>CH(e,t))}function FH(e){Object(oe["o"])("Can not find data set: "+Object(oe["ab"])(e))}function NH(e,t,n){if(!e){if(t.domainMin!=null||t.domainMax!=null){Object(oe["o"])("No scale domain defined for domainMin/domainMax to override.")}return}return e.signal?n.signalRef(e.signal):(Object(oe["B"])(e)?TH:e.fields?RH:zH)(e,t,n)}function TH(e,t,n){return e.map(e=>CH(e,n))}function zH(e,t,n){const i=n.getData(e.data);if(!i)FH(e.data);return W_(t.type)?i.valuesRef(n,e.field,IH(e.sort,false)):X_(t.type)?i.domainRef(n,e.field):i.extentRef(n,e.field)}function RH(e,t,n){const i=e.data,r=e.fields.reduce((e,t)=>{t=Object(oe["I"])(t)?{data:i,field:t}:Object(oe["B"])(t)||t.signal?BH(t,n):t;e.push(t);return e},[]);return(W_(t.type)?PH:X_(t.type)?LH:UH)(e,n,r)}function BH(e,t){const n="_:vega:_"+AH++,i=tH({});if(Object(oe["B"])(e)){i.value={$ingest:e}}else if(e.signal){const r="setdata("+Object(oe["ab"])(n)+","+e.signal+")";i.params.input=t.signalRef(r)}t.addDataPipeline(n,[i,OH({})]);return{data:n,field:"data"}}function PH(e,t,n){const i=IH(e.sort,true);let r,o;const s=n.map(e=>{const n=t.getData(e.data);if(!n)FH(e.data);return n.countsRef(t,e.field,i)});const a={groupby:iG,pulse:s};if(i){r=i.op||"count";o=i.field?cG(r,i.field):"count";a.ops=[DH[r]];a.fields=[t.fieldRef(o)];a.as=[o]}r=t.add(QG(a));const u=t.add(tH({pulse:eG(r)}));o=t.add(EH({field:iG,sort:t.sortRef(i),pulse:eG(u)}));return eG(o)}function IH(e,t){if(e){if(!e.field&&!e.op){if(Object(oe["G"])(e))e.field="key";else e={field:"key"}}else if(!e.field&&e.op!=="count"){Object(oe["o"])("No field provided for sort aggregate op: "+e.op)}else if(t&&e.field){if(e.op&&!DH[e.op]){Object(oe["o"])("Multiple domain scales can not be sorted using "+e.op)}}}return e}function LH(e,t,n){const i=n.map(e=>{const n=t.getData(e.data);if(!n)FH(e.data);return n.domainRef(t,e.field)});return eG(t.add(pH({values:i})))}function UH(e,t,n){const i=n.map(e=>{const n=t.getData(e.data);if(!n)FH(e.data);return n.extentRef(t,e.field)});return eG(t.add(hH({extents:i})))}function qH(e,t){return e.signal||Object(oe["B"])(e)?$H(e,t):t.objectProperty(e)}function WH(e){return Object(oe["G"])(e)?{interval:CH(e.interval),step:CH(e.step)}:CH(e)}function GH(e,t){t.interpolate=CH(e.type||e);if(e.gamma!=null){t.interpolateGamma=CH(e.gamma)}}function HH(e,t,n){const i=t.config.range;let r=e.range;if(r.signal){return t.signalRef(r.signal)}else if(Object(oe["I"])(r)){if(i&&Object(oe["w"])(i,r)){e=Object(oe["p"])({},e,{range:i[r]});return HH(e,t,n)}else if(r==="width"){r=[0,{signal:"width"}]}else if(r==="height"){r=W_(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]}else{Object(oe["o"])("Unrecognized scale range value: "+Object(oe["ab"])(r))}}else if(r.scheme){n.scheme=Object(oe["B"])(r.scheme)?$H(r.scheme,t):CH(r.scheme,t);if(r.extent)n.schemeExtent=$H(r.extent,t);if(r.count)n.schemeCount=CH(r.count,t);return}else if(r.step){n.rangeStep=CH(r.step,t);return}else if(W_(e.type)&&!Object(oe["B"])(r)){return NH(r,e,t)}else if(!Object(oe["B"])(r)){Object(oe["o"])("Unsupported range type: "+Object(oe["ab"])(r))}return r.map(e=>(Object(oe["B"])(e)?$H:CH)(e,t))}var VH=function(e,t){const n=t.config.projection||{},i={};for(const r in e){if(r==="name")continue;i[r]=YH(e[r],r,t)}for(const r in n){if(i[r]==null){i[r]=YH(n[r],r,t)}}t.addProjection(e.name,i)};function YH(e,t,n){return Object(oe["B"])(e)?e.map(e=>YH(e,t,n)):!Object(oe["G"])(e)?e:e.signal?n.signalRef(e.signal):t==="fit"?e:Object(oe["o"])("Unsupported parameter object: "+Object(oe["ab"])(e))}const XH="top";const JH="left";const ZH="right";const QH="bottom";const KH="center";const eV="vertical";const tV="start";const nV="middle";const iV="end";const rV="index";const oV="label";const sV="offset";const aV="perc";const uV="perc2";const cV="value";const lV="guide-label";const fV="guide-title";const dV="group-title";const hV="group-subtitle";const pV="symbol";const gV="gradient";const mV="discrete";const bV="size";const vV="shape";const yV="fill";const xV="stroke";const _V="strokeWidth";const wV="strokeDash";const OV="opacity";const jV=[bV,vV,yV,xV,_V,wV,OV];const kV={name:1,style:1,interactive:1};const EV={value:0};const AV={value:1};const DV="group";const SV="rect";const MV="rule";const CV="symbol";const $V="text";var FV=function(e){e.type=DV;e.interactive=e.interactive||false;return e};function NV(e,t){const n=(n,i)=>gG(e[n],gG(t[n],i));n.isVertical=n=>eV===gG(e.direction,t.direction||(n?t.symbolDirection:t.gradientDirection));n.gradientLength=()=>gG(e.gradientLength,t.gradientLength||t.gradientWidth);n.gradientThickness=()=>gG(e.gradientThickness,t.gradientThickness||t.gradientHeight);n.entryColumns=()=>gG(e.columns,gG(t.columns,+n.isVertical(true)));return n}function TV(e,t){const n=t&&(t.update&&t.update[e]||t.enter&&t.enter[e]);return n&&n.signal?n:n?n.value:null}function zV(e,t,n){const i=t.config.style[n];return i&&i[e]}function RV(e,t,n){return`item.anchor === '${tV}' ? ${e} : item.anchor === '${iV}' ? ${t} : ${n}`}const BV=RV(Object(oe["ab"])(JH),Object(oe["ab"])(ZH),Object(oe["ab"])(KH));function PV(e){const t=e("tickBand");let n=e("tickOffset"),i,r;if(!t){i=e("bandPosition");r=e("tickExtra")}else if(t.signal){i={signal:`(${t.signal}) === 'extent' ? 1 : 0.5`};r={signal:`(${t.signal}) === 'extent'`};if(!Object(oe["G"])(n)){n={signal:`(${t.signal}) === 'extent' ? 0 : ${n}`}}}else if(t==="extent"){i=1;r=true;n=0}else{i=.5;r=false}return{extra:r,band:i,offset:n}}function IV(e,t){return!t?e:!e?t:!Object(oe["G"])(e)?{value:e,offset:t}:Object.assign({},e,{offset:IV(e.offset,t)})}var LV=function(e,t){if(t){e.name=t.name;e.style=t.style||e.style;e.interactive=!!t.interactive;e.encode=lW(e.encode,t,kV)}else{e.interactive=false}return e};var UV=function(e,t,n,i){const r=NV(e,n),o=r.isVertical(),s=r.gradientThickness(),a=r.gradientLength();let u,c,l,f,d;if(o){c=[0,1];l=[0,0];f=s;d=a}else{c=[0,0];l=[1,0];f=a;d=s}const h={enter:u={opacity:EV,x:EV,y:EV,width:aW(f),height:aW(d)},update:Object(oe["p"])({},u,{opacity:AV,fill:{gradient:t,start:c,stop:l}}),exit:{opacity:EV}};cW(h,{stroke:r("gradientStrokeColor"),strokeWidth:r("gradientStrokeWidth")},{opacity:r("gradientOpacity")});return LV({type:SV,role:jW,encode:h},i)};var qV=function(e,t,n,i,r){const o=NV(e,n),s=o.isVertical(),a=o.gradientThickness(),u=o.gradientLength();let c,l,f,d,h="";s?(c="y",f="y2",l="x",d="width",h="1-"):(c="x",f="x2",l="y",d="height");const p={opacity:EV,fill:{scale:t,field:cV}};p[c]={signal:h+"datum."+aV,mult:u};p[l]=EV;p[f]={signal:h+"datum."+uV,mult:u};p[d]=aW(a);const g={enter:p,update:Object(oe["p"])({},p,{opacity:AV}),exit:{opacity:EV}};cW(g,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")});return LV({type:SV,role:wW,key:cV,from:r,encode:g},i)};const WV=`datum.${aV}<=0?"${JH}":datum.${aV}>=1?"${ZH}":"${KH}"`,GV=`datum.${aV}<=0?"${QH}":datum.${aV}>=1?"${XH}":"${nV}"`;var HV=function(e,t,n,i){const r=NV(e,t),o=r.isVertical(),s=aW(r.gradientThickness()),a=r.gradientLength();let u=r("labelOverlap"),c,l,f,d,h="";const p={enter:c={opacity:EV},update:l={opacity:AV,text:{field:oV}},exit:{opacity:EV}};cW(p,{fill:r("labelColor"),fillOpacity:r("labelOpacity"),font:r("labelFont"),fontSize:r("labelFontSize"),fontStyle:r("labelFontStyle"),fontWeight:r("labelFontWeight"),limit:gG(e.labelLimit,t.gradientLabelLimit)});if(o){c.align={value:"left"};c.baseline=l.baseline={signal:GV};f="y";d="x";h="1-"}else{c.align=l.align={signal:WV};c.baseline={value:"top"};f="x";d="y"}c[f]=l[f]={signal:h+"datum."+aV,mult:a};c[d]=l[d]=s;s.offset=gG(e.labelOffset,t.gradientLabelOffset)||0;u=u?{separation:r("labelSeparation"),method:u,order:"datum."+rV}:undefined;return LV({type:$V,role:kW,style:lV,key:cV,from:i,encode:p,overlap:u},n)};var VV=function(e,t,n,i,r){const o=NV(e,t),s=n.entries,a=!!(s&&s.interactive),u=s?s.name:undefined,c=o("clipHeight"),l=o("symbolOffset"),f={data:"value"},d=`(${r}) ? datum.${sV} : datum.${bV}`,h=c?aW(c):{field:bV},p=`datum.${rV}`,g=`max(1, ${r})`;let m,b,v,y,x;h.mult=.5;m={enter:b={opacity:EV,x:{signal:d,mult:.5,offset:l},y:h},update:v={opacity:AV,x:b.x,y:b.y},exit:{opacity:EV}};let _=null,w=null;if(!e.fill){_=t.symbolBaseFillColor;w=t.symbolBaseStrokeColor}cW(m,{fill:o("symbolFillColor",_),shape:o("symbolType"),size:o("symbolSize"),stroke:o("symbolStrokeColor",w),strokeDash:o("symbolDash"),strokeDashOffset:o("symbolDashOffset"),strokeWidth:o("symbolStrokeWidth")},{opacity:o("symbolOpacity")});jV.forEach(t=>{if(e[t]){v[t]=b[t]={scale:e[t],field:cV}}});const O=LV({type:CV,role:EW,key:cV,from:f,clip:c?true:undefined,encode:m},n.symbols);const j=aW(l);j.offset=o("labelOffset");m={enter:b={opacity:EV,x:{signal:d,offset:j},y:h},update:v={opacity:AV,text:{field:oV},x:b.x,y:b.y},exit:{opacity:EV}};cW(m,{align:o("labelAlign"),baseline:o("labelBaseline"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontStyle:o("labelFontStyle"),fontWeight:o("labelFontWeight"),limit:o("labelLimit")});const k=LV({type:$V,role:kW,style:lV,key:cV,from:f,encode:m},n.labels);m={enter:{noBound:{value:!c},width:EV,height:c?aW(c):EV,opacity:EV},exit:{opacity:EV},update:v={opacity:AV,row:{signal:null},column:{signal:null}}};if(o.isVertical(true)){y=`ceil(item.mark.items.length / ${g})`;v.row.signal=`${p}%${y}`;v.column.signal=`floor(${p} / ${y})`;x={field:["row",p]}}else{v.row.signal=`floor(${p} / ${g})`;v.column.signal=`${p} % ${g}`;x={field:p}}v.column.signal=`(${r})?${v.column.signal}:${p}`;i={facet:{data:i,name:"value",groupby:rV}};return FV({role:pW,from:i,encode:lW(m,s,kV),marks:[O,k],name:u,interactive:a,sort:x})};function YV(e,t){const n=NV(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:true,column:false},padding:{row:n("rowPadding"),column:n("columnPadding")}}}const XV='item.orient === "left"',JV='item.orient === "right"',ZV=`(${XV} || ${JV})`,QV=`datum.vgrad && ${ZV}`,KV=RV('"top"','"bottom"','"middle"'),eY=RV('"right"','"left"','"center"'),tY=`datum.vgrad && ${JV} ? (${eY}) : (${ZV} && !(datum.vgrad && ${XV})) ? "left" : ${BV}`,nY=`item._anchor || (${ZV} ? "middle" : "start")`,iY=`${QV} ? (${XV} ? -90 : 90) : 0`,rY=`${ZV} ? (datum.vgrad ? (${JV} ? "bottom" : "top") : ${KV}) : "top"`;var oY=function(e,t,n,i){const r=NV(e,t);const o={enter:{opacity:EV},update:{opacity:AV,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:EV}};cW(o,{orient:r("titleOrient"),_anchor:r("titleAnchor"),anchor:{signal:nY},angle:{signal:iY},align:{signal:tY},baseline:{signal:rY},text:e.title,fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit"),lineHeight:r("titleLineHeight")},{align:r("titleAlign"),baseline:r("titleBaseline")});return LV({type:$V,role:AW,style:fV,from:i,encode:o},n)};var sY=function(e,t){let n;if(Object(oe["G"])(e)){if(e.signal){n=e.signal}else if(e.path){n="pathShape("+aY(e.path)+")"}else if(e.sphere){n="geoShape("+aY(e.sphere)+', {type: "Sphere"})'}}return n?t.signalRef(n):!!e};function aY(e){return Object(oe["G"])(e)&&e.signal?e.signal:Object(oe["ab"])(e)}var uY=function(e){const t=e.role||"";return!t.indexOf("axis")||!t.indexOf("legend")||!t.indexOf("title")?t:e.type===DV?pW:t||dW};var cY=function(e){return{marktype:e.type,name:e.name||undefined,role:e.role||uY(e),zindex:+e.zindex||undefined,aria:e.aria,description:e.description}};var lY=function(e,t){return e&&e.signal?t.signalRef(e.signal):e===false?false:true};var fY=function(e,t){const n=La(e.type);if(!n)Object(oe["o"])("Unrecognized transform type: "+Object(oe["ab"])(e.type));const i=QW(n.type.toLowerCase(),null,dY(n,e,t));if(e.signal)t.addSignal(e.signal,t.proxy(i));i.metadata=n.metadata||{};return i};function dY(e,t,n){const i={},r=e.params.length;for(let o=0;opY(e,t,n)):pY(e,r,n)}function pY(e,t,n){const i=e.type;if(dG(t)){return _Y(i)?Object(oe["o"])("Expression references can not be signals."):wY(i)?n.fieldRef(t):OY(i)?n.compareRef(t):n.signalRef(t.signal)}else{const r=e.expr||wY(i);return r&&vY(t)?n.exprRef(t.expr,t.as):r&&yY(t)?nG(t.field,t.as):_Y(i)?QU(t,n):xY(i)?eG(n.getData(t).values):wY(i)?nG(t):OY(i)?n.compareRef(t):t}}function gY(e,t,n){if(!Object(oe["I"])(t.from)){Object(oe["o"])('Lookup "from" parameter must be a string literal.')}return n.getData(t.from).lookupRef(n,t.key)}function mY(e,t,n){const i=t[e.name];if(e.array){if(!Object(oe["B"])(i)){Object(oe["o"])("Expected an array of sub-parameters. Instead: "+Object(oe["ab"])(i))}return i.map(t=>bY(e,t,n))}else{return bY(e,i,n)}}function bY(e,t,n){const i=e.params.length;let r;for(let s=0;se&&e.expr;const yY=e=>e&&e.field;const xY=e=>e==="data";const _Y=e=>e==="expr";const wY=e=>e==="field";const OY=e=>e==="compare";var jY=function(e,t,n){let i,r,o,s,a;if(!e){s=eG(n.add(tH(null,[{}])))}else if(i=e.facet){if(!t)Object(oe["o"])("Only group marks can be faceted.");if(i.field!=null){s=a=kY(i,n)}else{if(!e.data){o=fY(Object(oe["p"])({type:"aggregate",groupby:Object(oe["i"])(i.groupby)},i.aggregate),n);o.params.key=n.keyRef(i.groupby);o.params.pulse=kY(i,n);s=a=eG(n.add(o))}else{a=eG(n.getData(e.data).aggregate)}r=n.keyRef(i.groupby,true)}}if(!s){s=kY(e,n)}return{key:r,pulse:s,parent:a}};function kY(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:eG(t.getData(e.data).output)}function EY(e,t,n,i,r){this.scope=e;this.input=t;this.output=n;this.values=i;this.aggregate=r;this.index={}}EY.fromEntries=function(e,t){const n=t.length,i=t[n-1],r=t[n-2];let o=t[0],s=null,a=1;if(o&&o.type==="load"){o=t[1]}e.add(t[0]);for(;ae==null?"null":e).join(",")+"),0)";const l=QU(c,t);u.update=l.$expr;u.params=l.$params};var FY=function(e,t){const n=uY(e),i=e.type===DV,r=e.from&&e.from.facet,o=e.overlap;let s=e.layout||n===pW||n===hW,a,u,c,l,f,d,h;const p=n===dW||s||r;const g=jY(e.from,i,t);u=t.add(iH({key:g.key||(e.key?nG(e.key):undefined),pulse:g.pulse,clean:!i}));const m=eG(u);u=c=t.add(tH({pulse:m}));u=t.add(dH({markdef:cY(e),interactive:lY(e.interactive,t),clip:sY(e.clip,t),context:{$context:true},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:eG(u)}));const b=eG(u);u=l=t.add(rH(qW(e.encode,e.type,n,e.style,t,{mod:false,pulse:b})));u.params.parent=t.encode();if(e.transform){e.transform.forEach(e=>{const n=fY(e,t),i=n.metadata;if(i.generates||i.changes){Object(oe["o"])("Mark transforms should not generate new data.")}if(!i.nomod)l.params.mod=true;n.params.pulse=eG(u);t.add(u=n)})}if(e.sort){u=t.add(jH({sort:t.compareRef(e.sort),pulse:eG(u)}))}const v=eG(u);if(r||s){s=t.add(kH({layout:t.objectProperty(e.layout),legends:t.legends,mark:b,pulse:v}));d=eG(s)}const y=t.add(eH({mark:b,pulse:d||v}));h=eG(y);if(i){if(p){a=t.operators;a.pop();if(s)a.pop()}t.pushState(v,d||h,m);r?MY(e,t,g):p?CY(e,t,g):t.parse(e);t.popState();if(p){if(s)a.push(s);a.push(y)}}if(o){h=NY(o,h,t)}const x=t.add(_H({pulse:h})),_=t.add(OH({pulse:eG(x)},undefined,t.parent()));if(e.name!=null){f=e.name;t.addData(f,new EY(t,c,x,_));if(e.on)e.on.forEach(e=>{if(e.insert||e.remove||e.toggle){Object(oe["o"])("Marks only support modify triggers.")}$Y(e,t,f)})}};function NY(e,t,n){const i=e.method,r=e.bound,o=e.separation;const s={separation:dG(o)?n.signalRef(o.signal):o,method:dG(i)?n.signalRef(i.signal):i,pulse:t};if(e.order){s.sort=n.compareRef({field:e.order})}if(r){const e=r.tolerance;s.boundTolerance=dG(e)?n.signalRef(e.signal):+e;s.boundScale=n.scaleRef(r.scale);s.boundOrient=r.orient}return eG(n.add(gH(s)))}var TY=function(e,t){const n=t.config.legend,i=e.encode||{},r=NV(e,n),o=i.legend||{},s=o.name||undefined,a=o.interactive,u=o.style,c={};let l=0,f,d,h;jV.forEach(t=>e[t]?(c[t]=e[t],l=l||e[t]):0);if(!l)Object(oe["o"])("Missing valid scale for legend.");const p=zY(e,t.scaleType(l));const g={title:e.title!=null,scales:c,type:p,vgrad:p!=="symbol"&&r.isVertical()};const m=eG(t.add(tH(null,[g])));const b={enter:{x:{value:0},y:{value:0}}};const v=eG(t.add(lH(d={type:p,scale:t.scaleRef(l),count:t.objectProperty(r("tickCount")),limit:t.property(r("symbolLimit")),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)})));if(p===gV){h=[UV(e,l,n,i.gradient),HV(e,n,i.labels,v)];d.count=d.count||t.signalRef(`max(2,2*floor((${mG(r.gradientLength())})/100))`)}else if(p===mV){h=[qV(e,l,n,i.gradient,v),HV(e,n,i.labels,v)]}else{f=YV(e,n);h=[VV(e,n,i,v,mG(f.columns))];d.size=PY(e,t,h[0].marks)}h=[FV({role:OW,from:m,encode:b,marks:h,layout:f,interactive:a})];if(g.title){h.push(oY(e,n,i.title,m))}return FY(FV({role:_W,from:m,encode:lW(BY(r,e,n),o,kV),marks:h,aria:r("aria"),description:r("description"),zindex:r("zindex"),name:s,interactive:a,style:u}),t)};function zY(e,t){let n=e.type||pV;if(!e.type&&RY(e)===1&&(e.fill||e.stroke)){n=q_(t)?gV:G_(t)?mV:pV}return n!==gV?n:G_(t)?mV:gV}function RY(e){return jV.reduce((t,n)=>t+(e[n]?1:0),0)}function BY(e,t,n){const i={enter:{},update:{}};cW(i,{orient:e("orient"),offset:e("offset"),padding:e("padding"),titlePadding:e("titlePadding"),cornerRadius:e("cornerRadius"),fill:e("fillColor"),stroke:e("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:e("legendX"),y:e("legendY"),format:t.format,formatType:t.formatType});return i}function PY(e,t,n){const i=mG(IY("size",e,n)),r=mG(IY("strokeWidth",e,n)),o=mG(LY(n[1].encode,t,lV));return QU(`max(ceil(sqrt(${i})+${r}),${o})`,t)}function IY(e,t,n){return t[e]?`scale("${t[e]}",datum)`:TV(e,n[0].encode)}function LY(e,t,n){return TV("fontSize",e)||zV("fontSize",t,n)}const UY=`item.orient==="${JH}"?-90:item.orient==="${ZH}"?90:0`;var qY=function(e,t){e=Object(oe["I"])(e)?{text:e}:e;const n=NV(e,t.config.title),i=e.encode||{},r=i.group||{},o=r.name||undefined,s=r.interactive,a=r.style,u=[];const c={},l=eG(t.add(tH(null,[c])));u.push(HY(e,n,WY(e),l));if(e.subtitle){u.push(VY(e,n,i.subtitle,l))}return FY(FV({role:DW,from:l,encode:GY(n,r),marks:u,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:o,interactive:s,style:a}),t)};function WY(e){const t=e.encode;return t&&t.title||Object(oe["p"])({name:e.name,interactive:e.interactive,style:e.style},t)}function GY(e,t){const n={enter:{},update:{}};cW(n,{orient:e("orient"),anchor:e("anchor"),align:{signal:BV},angle:{signal:UY},limit:e("limit"),frame:e("frame"),offset:e("offset")||0,padding:e("subtitlePadding")});return lW(n,t,kV)}function HY(e,t,n,i){const r={value:0},o=e.text,s={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};cW(s,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("color"),font:t("font"),fontSize:t("fontSize"),fontStyle:t("fontStyle"),fontWeight:t("fontWeight"),lineHeight:t("lineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")});return LV({type:$V,role:SW,style:dV,from:i,encode:s},n)}function VY(e,t,n,i){const r={value:0},o=e.subtitle,s={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};cW(s,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("subtitleColor"),font:t("subtitleFont"),fontSize:t("subtitleFontSize"),fontStyle:t("subtitleFontStyle"),fontWeight:t("subtitleFontWeight"),lineHeight:t("subtitleLineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")});return LV({type:$V,role:MW,style:hV,from:i,encode:s},n)}function YY(e,t){const n=[];if(e.transform){e.transform.forEach(e=>{n.push(fY(e,t))})}if(e.on){e.on.forEach(n=>{$Y(n,t,e.name)})}t.addDataPipeline(e.name,XY(e,t,n))}function XY(e,t,n){const i=[];let r=null,o=false,s=false,a,u,c,l,f;if(e.values){if(pG(e.values)||pG(e.format)){i.push(ZY(t,e));i.push(r=JY())}else{i.push(r=JY({$ingest:e.values,$format:e.format}))}}else if(e.url){if(pG(e.url)||pG(e.format)){i.push(ZY(t,e));i.push(r=JY())}else{i.push(r=JY({$request:e.url,$format:e.format}))}}else if(e.source){r=a=Object(oe["i"])(e.source).map(e=>eG(t.getData(e).output));i.push(null)}for(u=0,c=n.length;ue===QH||e===XH;const KY=(e,t,n)=>dG(e)?sX(e.signal,t,n):e===JH||e===XH?t:n;const eX=(e,t,n)=>dG(e)?rX(e.signal,t,n):QY(e)?t:n;const tX=(e,t,n)=>dG(e)?oX(e.signal,t,n):QY(e)?n:t;const nX=(e,t,n)=>dG(e)?aX(e.signal,t,n):e===XH?{value:t}:{value:n};const iX=(e,t,n)=>dG(e)?uX(e.signal,t,n):e===ZH?{value:t}:{value:n};const rX=(e,t,n)=>cX(`${e} === '${XH}' || ${e} === '${QH}'`,t,n);const oX=(e,t,n)=>cX(`${e} !== '${XH}' && ${e} !== '${QH}'`,t,n);const sX=(e,t,n)=>fX(`${e} === '${JH}' || ${e} === '${XH}'`,t,n);const aX=(e,t,n)=>fX(`${e} === '${XH}'`,t,n);const uX=(e,t,n)=>fX(`${e} === '${ZH}'`,t,n);const cX=(e,t,n)=>{t=t!=null?aW(t):t;n=n!=null?aW(n):n;if(lX(t)&&lX(n)){t=t?t.signal||Object(oe["ab"])(t.value):null;n=n?n.signal||Object(oe["ab"])(n.value):null;return{signal:`${e} ? (${t}) : (${n})`}}else{return[Object(oe["p"])({test:e},t)].concat(n||[])}};const lX=e=>e==null||Object.keys(e).length===1;const fX=(e,t,n)=>({signal:`${e} ? (${hX(t)}) : (${hX(n)})`});const dX=(e,t,n,i,r)=>({signal:(i!=null?`${e} === '${JH}' ? (${hX(i)}) : `:"")+(n!=null?`${e} === '${QH}' ? (${hX(n)}) : `:"")+(r!=null?`${e} === '${ZH}' ? (${hX(r)}) : `:"")+(t!=null?`${e} === '${XH}' ? (${hX(t)}) : `:"")+"(null)"});const hX=e=>dG(e)?e.signal:e==null?null:Object(oe["ab"])(e);const pX=(e,t)=>t===0?0:dG(e)?{signal:`(${e.signal}) * ${t}`}:{value:e*t};const gX=(e,t)=>{const n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function mX(e,t,n,i){let r;if(t&&Object(oe["w"])(t,e)){return t[e]}else if(Object(oe["w"])(n,e)){return n[e]}else if(e.startsWith("title")){switch(e){case"titleColor":r="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":r=e[5].toLowerCase()+e.slice(6)}return i[fV][r]}else if(e.startsWith("label")){switch(e){case"labelColor":r="fill";break;case"labelFont":case"labelFontSize":r=e[5].toLowerCase()+e.slice(6)}return i[lV][r]}return null}function bX(e){const t={};for(const n of e){if(!n)continue;for(const e in n)t[e]=1}return Object.keys(t)}var vX=function(e,t){var n=t.config,i=n.style,r=n.axis,o=t.scaleType(e.scale)==="band"&&n.axisBand,s=e.orient,a,u,c;if(dG(s)){const e=bX([n.axisX,n.axisY]),t=bX([n.axisTop,n.axisBottom,n.axisLeft,n.axisRight]);a={};for(c of e){a[c]=eX(s,mX(c,n.axisX,r,i),mX(c,n.axisY,r,i))}u={};for(c of t){u[c]=dX(s.signal,mX(c,n.axisTop,r,i),mX(c,n.axisBottom,r,i),mX(c,n.axisLeft,r,i),mX(c,n.axisRight,r,i))}}else{a=s===XH||s===QH?n.axisX:n.axisY;u=n["axis"+s[0].toUpperCase()+s.slice(1)]}var l=a||u||o?Object(oe["p"])({},r,a,u,o):r;return l};var yX=function(e,t,n,i){const r=NV(e,t),o=e.orient;let s,a;const u={enter:s={opacity:EV},update:a={opacity:AV},exit:{opacity:EV}};cW(u,{stroke:r("domainColor"),strokeCap:r("domainCap"),strokeDash:r("domainDash"),strokeDashOffset:r("domainDashOffset"),strokeWidth:r("domainWidth"),strokeOpacity:r("domainOpacity")});const c=xX(e,0);const l=xX(e,1);s.x=a.x=eX(o,c,EV);s.x2=a.x2=eX(o,l);s.y=a.y=tX(o,c,EV);s.y2=a.y2=tX(o,l);return LV({type:MV,role:mW,from:i,encode:u},n)};function xX(e,t){return{scale:e.scale,range:t}}var _X=function(e,t,n,i,r){const o=NV(e,t),s=e.orient,a=e.gridScale,u=KY(s,1,-1),c=wX(e.offset,u);let l,f,d;const h={enter:l={opacity:EV},update:d={opacity:AV},exit:f={opacity:EV}};cW(h,{stroke:o("gridColor"),strokeCap:o("gridCap"),strokeDash:o("gridDash"),strokeDashOffset:o("gridDashOffset"),strokeOpacity:o("gridOpacity"),strokeWidth:o("gridWidth")});const p={scale:e.scale,field:cV,band:r.band,extra:r.extra,offset:r.offset,round:o("tickRound")};const g=eX(s,{signal:"height"},{signal:"width"});const m=a?{scale:a,range:0,mult:u,offset:c}:{value:0,offset:c};const b=a?{scale:a,range:1,mult:u,offset:c}:Object(oe["p"])(g,{mult:u,offset:c});l.x=d.x=eX(s,p,m);l.y=d.y=tX(s,p,m);l.x2=d.x2=tX(s,b);l.y2=d.y2=eX(s,b);f.x=eX(s,p);f.y=tX(s,p);return LV({type:MV,role:bW,key:cV,from:i,encode:h},n)};function wX(e,t){if(t===1){}else if(!Object(oe["G"])(e)){e=dG(t)?{signal:`(${t.signal}) * (${e||0})`}:t*(e||0)}else{let n=e=Object(oe["p"])({},e);while(n.mult!=null){if(!Object(oe["G"])(n.mult)){n.mult=dG(t)?{signal:`(${n.mult}) * (${t.signal})`}:n.mult*t;return e}else{n=n.mult=Object(oe["p"])({},n.mult)}}n.mult=t}return e}var OX=function(e,t,n,i,r,o){const s=NV(e,t),a=e.orient,u=KY(a,-1,1);let c,l,f;const d={enter:c={opacity:EV},update:f={opacity:AV},exit:l={opacity:EV}};cW(d,{stroke:s("tickColor"),strokeCap:s("tickCap"),strokeDash:s("tickDash"),strokeDashOffset:s("tickDashOffset"),strokeOpacity:s("tickOpacity"),strokeWidth:s("tickWidth")});const h=aW(r);h.mult=u;const p={scale:e.scale,field:cV,band:o.band,extra:o.extra,offset:o.offset,round:s("tickRound")};f.y=c.y=eX(a,EV,p);f.y2=c.y2=eX(a,h);l.x=eX(a,p);f.x=c.x=tX(a,EV,p);f.x2=c.x2=tX(a,h);l.y=tX(a,p);return LV({type:MV,role:yW,key:cV,from:i,encode:d},n)};function jX(e,t,n,i,r){return{signal:'flush(range("'+e+'"), '+'scale("'+e+'", datum.value), '+t+","+n+","+i+","+r+")"}}var kX=function(e,t,n,i,r,o){const s=NV(e,t),a=e.orient,u=e.scale,c=KY(a,-1,1),l=mG(s("labelFlush")),f=mG(s("labelFlushOffset")),d=s("labelAlign"),h=s("labelBaseline");let p=l===0||!!l,g;const m=aW(r);m.mult=c;m.offset=aW(s("labelPadding")||0);m.offset.mult=c;const b={scale:u,field:cV,band:.5,offset:IV(o.offset,s("labelOffset"))};const v=eX(a,p?jX(u,l,'"left"','"right"','"center"'):{value:"center"},iX(a,"left","right"));const y=eX(a,nX(a,"bottom","top"),p?jX(u,l,'"top"','"bottom"','"middle"'):{value:"middle"});const x=jX(u,l,`-(${f})`,f,0);p=p&&f;const _={opacity:EV,x:eX(a,b,m),y:tX(a,b,m)};const w={enter:_,update:g={opacity:AV,text:{field:oV},x:_.x,y:_.y,align:v,baseline:y},exit:{opacity:EV,x:_.x,y:_.y}};cW(w,{dx:!d&&p?eX(a,x):null,dy:!h&&p?tX(a,x):null});cW(w,{angle:s("labelAngle"),fill:s("labelColor"),fillOpacity:s("labelOpacity"),font:s("labelFont"),fontSize:s("labelFontSize"),fontWeight:s("labelFontWeight"),fontStyle:s("labelFontStyle"),limit:s("labelLimit"),lineHeight:s("labelLineHeight")},{align:d,baseline:h});const O=s("labelBound");let j=s("labelOverlap");j=j||O?{separation:s("labelSeparation"),method:j,order:"datum.index",bound:O?{scale:u,orient:a,tolerance:O}:null}:undefined;if(g.align!==v){g.align=gX(g.align,v)}if(g.baseline!==y){g.baseline=gX(g.baseline,y)}return LV({type:$V,role:vW,style:lV,key:cV,from:i,encode:w,overlap:j},n)};var EX=function(e,t,n,i){const r=NV(e,t),o=e.orient,s=KY(o,-1,1);let a,u;const c={enter:a={opacity:EV,anchor:aW(r("titleAnchor",null)),align:{signal:BV}},update:u=Object(oe["p"])({},a,{opacity:AV,text:aW(e.title)}),exit:{opacity:EV}};const l={signal:`lerp(range("${e.scale}"), ${RV(0,1,.5)})`};u.x=eX(o,l);u.y=tX(o,l);a.angle=eX(o,EV,pX(s,90));a.baseline=eX(o,nX(o,QH,XH),{value:QH});u.angle=a.angle;u.baseline=a.baseline;cW(c,{fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit"),lineHeight:r("titleLineHeight")},{align:r("titleAlign"),angle:r("titleAngle"),baseline:r("titleBaseline")});AX(r,o,c,n);c.update.align=gX(c.update.align,a.align);c.update.angle=gX(c.update.angle,a.angle);c.update.baseline=gX(c.update.baseline,a.baseline);return LV({type:$V,role:xW,style:fV,from:i,encode:c},n)};function AX(e,t,n,i){const r=(e,t)=>e!=null?(n.update[t]=gX(aW(e),n.update[t]),false):!fW(t,i)?true:false;const o=r(e("titleX"),"x"),s=r(e("titleY"),"y");n.enter.auto=s===o?aW(s):eX(t,aW(s),aW(o))}var DX=function(e,t){const n=vX(e,t),i=e.encode||{},r=i.axis||{},o=r.name||undefined,s=r.interactive,a=r.style,u=NV(e,n),c=PV(u);const l={scale:e.scale,ticks:!!u("ticks"),labels:!!u("labels"),grid:!!u("grid"),domain:!!u("domain"),title:e.title!=null};const f=eG(t.add(tH({},[l])));const d=eG(t.add(KG({scale:t.scaleRef(e.scale),extra:t.property(c.extra),count:t.objectProperty(e.tickCount),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)})));const h=[];let p;if(l.grid){h.push(_X(e,n,i.grid,d,c))}if(l.ticks){p=u("tickSize");h.push(OX(e,n,i.ticks,d,p,c))}if(l.labels){p=l.ticks?p:0;h.push(kX(e,n,i.labels,d,p,c))}if(l.domain){h.push(yX(e,n,i.domain,f))}if(l.title){h.push(EX(e,n,i.title,f))}return FY(FV({role:gW,from:f,encode:lW(SX(u,e),r,kV),marks:h,aria:u("aria"),description:u("description"),zindex:u("zindex"),name:o,interactive:s,style:a}),t)};function SX(e,t){const n={enter:{},update:{}};cW(n,{orient:e("orient"),offset:e("offset")||0,position:gG(t.position,0),titlePadding:e("titlePadding"),minExtent:e("minExtent"),maxExtent:e("maxExtent"),range:{signal:`abs(span(range("${t.scale}")))`},translate:e("translate"),format:t.format,formatType:t.formatType});return n}var MX=function(e,t,n){const i=Object(oe["i"])(e.signals),r=Object(oe["i"])(e.scales);if(!n)i.forEach(e=>JW(e,t));Object(oe["i"])(e.projections).forEach(e=>VH(e,t));r.forEach(e=>SH(e,t));Object(oe["i"])(e.data).forEach(e=>YY(e,t));r.forEach(e=>MH(e,t));(n||i).forEach(e=>JG(e,t));Object(oe["i"])(e.axes).forEach(e=>DX(e,t));Object(oe["i"])(e.marks).forEach(e=>FY(e,t));Object(oe["i"])(e.legends).forEach(e=>TY(e,t));if(e.title)qY(e.title,t);t.parseLambdas();return t};const CX=e=>lW({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e);function $X(e,t){const n=t.config;const i=eG(t.root=t.add(KW()));const r=NX(e,n);r.forEach(e=>JW(e,t));t.description=e.description||n.description;t.eventConfig=n.events;t.legends=t.objectProperty(n.legend&&n.legend.layout);t.locale=n.locale;const o=t.add(tH());const s=t.add(rH(qW(CX(e.encode),DV,hW,e.style,t,{pulse:eG(o)})));const a=t.add(kH({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:i,pulse:eG(s)}));t.operators.pop();t.pushState(eG(s),eG(a),null);MX(e,t,r);t.operators.push(a);let u=t.add(eH({mark:i,pulse:eG(a)}));u=t.add(_H({pulse:eG(u)}));u=t.add(OH({pulse:eG(u)}));t.addData("root",new EY(t,o,o,u));return t}function FX(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function NX(e,t){const n=n=>gG(e[n],t[n]),i=[FX("background",n("background")),FX("autosize",iW(n("autosize"))),FX("padding",sW(n("padding"))),FX("width",n("width")||0),FX("height",n("height")||0)],r=i.reduce((e,t)=>(e[t.name]=t,e),{}),o={};Object(oe["i"])(e.signals).forEach(e=>{if(Object(oe["w"])(r,e.name)){e=Object(oe["p"])(r[e.name],e)}else{i.push(e)}o[e.name]=e});Object(oe["i"])(t.signals).forEach(e=>{if(!Object(oe["w"])(o,e.name)&&!Object(oe["w"])(r,e.name)){i.push(e)}});return i}function TX(e,t){this.config=e||{};this.options=t||{};this.bindings=[];this.field={};this.signals={};this.lambdas={};this.scales={};this.events={};this.data={};this.streams=[];this.updates=[];this.operators=[];this.eventConfig=null;this.locale=null;this._id=0;this._subid=0;this._nextsub=[0];this._parent=[];this._encode=[];this._lookup=[];this._markpath=[]}function zX(e){this.config=e.config;this.options=e.options;this.legends=e.legends;this.field=Object.create(e.field);this.signals=Object.create(e.signals);this.lambdas=Object.create(e.lambdas);this.scales=Object.create(e.scales);this.events=Object.create(e.events);this.data=Object.create(e.data);this.streams=[];this.updates=[];this.operators=[];this._id=0;this._subid=++e._nextsub[0];this._nextsub=e._nextsub;this._parent=e._parent.slice();this._encode=e._encode.slice();this._lookup=e._lookup.slice();this._markpath=e._markpath}TX.prototype=zX.prototype={parse(e){return MX(e,this)},fork(){return new zX(this)},isSubscope(){return this._subid>0},toRuntime(){this.finish();return{description:this.description,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig,locale:this.locale}},id(){return(this._subid?this._subid+":":0)+this._id++},add(e){this.operators.push(e);e.id=this.id();if(e.refs){e.refs.forEach(t=>{t.$ref=e.id});e.refs=null}return e},proxy(e){const t=e instanceof ZW?eG(e):e;return this.add(yH({value:t}))},addStream(e){this.streams.push(e);e.id=this.id();return e},addUpdate(e){this.updates.push(e);return e},finish(){let e,t;if(this.root)this.root.root=true;for(e in this.signals){this.signals[e].signal=e}for(e in this.scales){this.scales[e].scale=e}function n(e,t,n){let i,r;if(e){i=e.data||(e.data={});r=i[t]||(i[t]=[]);r.push(n)}}for(e in this.data){t=this.data[e];n(t.input,e,"input");n(t.output,e,"output");n(t.values,e,"values");for(const i in t.index){n(t.index[i],e,"index:"+i)}}return this},pushState(e,t,n){this._encode.push(eG(this.add(OH({pulse:e}))));this._parent.push(t);this._lookup.push(n?eG(this.proxy(n)):null);this._markpath.push(-1)},popState(){this._encode.pop();this._parent.pop();this._lookup.pop();this._markpath.pop()},parent(){return Object(oe["V"])(this._parent)},encode(){return Object(oe["V"])(this._encode)},lookup(){return Object(oe["V"])(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if(Object(oe["I"])(e))return nG(e,t);if(!e.signal){Object(oe["o"])("Unsupported field reference: "+Object(oe["ab"])(e))}const n=e.signal;let i=this.field[n];if(!i){const e={name:this.signalRef(n)};if(t)e.as=t;this.field[n]=i=eG(this.add(uH(e)))}return i},compareRef(e){let t=false;const n=e=>dG(e)?(t=true,this.signalRef(e.signal)):hG(e)?(t=true,this.exprRef(e.expr)):e;const i=Object(oe["i"])(e.field).map(n),r=Object(oe["i"])(e.order).map(n);return t?eG(this.add(nH({fields:i,orders:r}))):rG(i,r)},keyRef(e,t){let n=false;const i=e=>dG(e)?(n=true,eG(r[e.signal])):e;const r=this.signals;e=Object(oe["i"])(e).map(i);return n?eG(this.add(cH({fields:e,flat:t}))):oG(e,t)},sortRef(e){if(!e)return e;const t=cG(e.op,e.field),n=e.order||sG;return n.signal?eG(this.add(nH({fields:t,orders:this.signalRef(n.signal)}))):rG(t,n)},event(e,t){const n=e+":"+t;if(!this.events[n]){const i=this.id();this.streams.push({id:i,source:e,type:t});this.events[n]=i}return this.events[n]},hasOwnSignal(e){return Object(oe["w"])(this.signals,e)},addSignal(e,t){if(this.hasOwnSignal(e)){Object(oe["o"])("Duplicate signal name: "+Object(oe["ab"])(e))}const n=t instanceof ZW?t:this.add(KW(t));return this.signals[e]=n},getSignal(e){if(!this.signals[e]){Object(oe["o"])("Unrecognized signal name: "+Object(oe["ab"])(e))}return this.signals[e]},signalRef(e){if(this.signals[e]){return eG(this.signals[e])}else if(!Object(oe["w"])(this.lambdas,e)){this.lambdas[e]=this.add(KW(null))}return eG(this.lambdas[e])},parseLambdas(){const e=Object.keys(this.lambdas);for(let t=0,n=e.length;t0?",":"")+(Object(oe["G"])(t)?t.signal||RX(t):Object(oe["ab"])(t))}return n+"]"}function PX(e){let t="{",n=0,i,r;for(i in e){r=e[i];t+=(++n>1?",":"")+Object(oe["ab"])(i)+":"+(Object(oe["G"])(r)?r.signal||RX(r):Object(oe["ab"])(r))}return t+"}"}var IX=function(){const e="sans-serif",t=30,n=2,i="#4c78a8",r="#000",o="#888",s="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:i},area:{fill:i},image:null,line:{stroke:i,strokeWidth:n},path:{stroke:i},rect:{fill:i},rule:{stroke:r},shape:{stroke:i},symbol:{fill:i,size:64},text:{fill:r,font:e,fontSize:11},trail:{fill:i,size:n},style:{"guide-label":{fill:r,font:e,fontSize:10},"guide-title":{fill:r,font:e,fontSize:11,fontWeight:"bold"},"group-title":{fill:r,font:e,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:r,font:e,fontSize:12},point:{size:t,strokeWidth:n,shape:"circle"},circle:{size:t,strokeWidth:n},square:{size:t,strokeWidth:n,shape:"square"},cell:{fill:"transparent",stroke:s}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:true,domainWidth:1,domainColor:o,grid:false,gridWidth:1,gridColor:s,labels:true,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:true,tickColor:o,tickOffset:0,tickRound:true,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:s,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:true,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:o,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}}};var LX=function(e,t,n){if(!Object(oe["G"])(e)){Object(oe["o"])("Input Vega specification must be an object.")}t=Object(oe["O"])(IX(),t,e.config);return $X(e,new TX(t,n)).toRuntime()};Object(oe["p"])(Ia,o,a,u,c,l,f,d,h,p,g);var UX=n("qHvB");var qX=function(e,t){qX=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]};return qX(e,t)};function WX(e,t){qX(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var GX=function(){GX=Object.assign||function e(t){for(var n,i=1,r=arguments.length;i=0;a--)if(s=e[a])o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o;return r>3&&o&&Object.defineProperty(t,n,o),o}function YX(e,t){return function(n,i){t(n,i,e)}}function XX(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)}function JX(e,t,n,i){function r(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function s(e){try{u(i.next(e))}catch(t){o(t)}}function a(e){try{u(i["throw"](e))}catch(t){o(t)}}function u(e){e.done?n(e.value):r(e.value).then(s,a)}u((i=i.apply(e,t||[])).next())}))}function ZX(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(t){return u([e,t])}}function u(s){if(i)throw new TypeError("Generator is already executing.");while(n)try{if(i=1,r&&(o=s[0]&2?r["return"]:s[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;if(r=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;r=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]=e.length)e=void 0;return{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function tJ(e,t){var n=typeof Symbol==="function"&&e[Symbol.iterator];if(!n)return e;var i=n.call(e),r,o=[],s;try{while((t===void 0||t-- >0)&&!(r=i.next()).done)o.push(r.value)}catch(a){s={error:a}}finally{try{if(r&&!r.done&&(n=i["return"]))n.call(i)}finally{if(s)throw s.error}}return o}function nJ(){for(var e=[],t=0;t1||a(e,t)}))}}function a(e,t){try{u(i[e](t))}catch(n){f(o[0][3],n)}}function u(e){e.value instanceof rJ?Promise.resolve(e.value.v).then(c,l):f(o[0][2],e)}function c(e){a("next",e)}function l(e){a("throw",e)}function f(e,t){if(e(t),o.shift(),o.length)a(o[0][0],o[0][1])}}function sJ(e){var t,n;return t={},i("next"),i("throw",(function(e){throw e})),i("return"),t[Symbol.iterator]=function(){return this},t;function i(i,r){t[i]=e[i]?function(t){return(n=!n)?{value:rJ(e[i](t)),done:i==="return"}:r?r(t):t}:r}}function aJ(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof eJ==="function"?eJ(e):e[Symbol.iterator](),n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n);function i(t){n[t]=e[t]&&function(n){return new Promise((function(i,o){n=e[t](n),r(i,o,n.done,n.value)}))}}function r(e,t,n,i){Promise.resolve(i).then((function(t){e({value:t,done:n})}),t)}}function uJ(e,t){if(Object.defineProperty){Object.defineProperty(e,"raw",{value:t})}else{e.raw=t}return e}var cJ=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t};function lJ(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)if(n!=="default"&&Object.prototype.hasOwnProperty.call(e,n))QX(t,e,n);cJ(t,e);return t}function fJ(e){return e&&e.__esModule?e:{default:e}}function dJ(e,t){if(!t.has(e)){throw new TypeError("attempted to get private field on non-instance")}return t.get(e)}function hJ(e,t,n){if(!t.has(e)){throw new TypeError("attempted to set private field on non-instance")}t.set(e,n);return n}Array.prototype.flat||Object.defineProperty(Array.prototype,"flat",{configurable:!0,value:function e(){var t=isNaN(arguments[0])?1:Number(arguments[0]);return t?Array.prototype.reduce.call(this,(function(n,i){return Array.isArray(i)?n.push.apply(n,e.call(i,t-1)):n.push(i),n}),[]):Array.prototype.slice.call(this)},writable:!0}),Array.prototype.flatMap||Object.defineProperty(Array.prototype,"flatMap",{configurable:!0,value:function(e){return Array.prototype.map.apply(this,arguments).flat()},writable:!0});var pJ=n("JBAE");var gJ=n.n(pJ);var mJ=n("aUsF");var bJ=n.n(mJ);var vJ=n("9x6x");var yJ=n.n(vJ);function xJ(e){return!!e.or}function _J(e){return!!e.and}function wJ(e){return!!e.not}function OJ(e,t){if(wJ(e)){OJ(e.not,t)}else if(_J(e)){for(const n of e.and){OJ(n,t)}}else if(xJ(e)){for(const n of e.or){OJ(n,t)}}else{t(e)}}function jJ(e,t){if(wJ(e)){return{not:jJ(e.not,t)}}else if(_J(e)){return{and:e.and.map(e=>jJ(e,t))}}else if(xJ(e)){return{or:e.or.map(e=>jJ(e,t))}}else{return t(e)}}const kJ=bJ.a;const EJ=gJ.a;function AJ(e,t){const n={};for(const i of t){if(Object(oe["w"])(e,i)){n[i]=e[i]}}return n}function DJ(e,t){const n=Object.assign({},e);for(const i of t){delete n[i]}return n}Set.prototype["toJSON"]=function(){return`Set(${[...this].map(e=>yJ()(e)).join(",")})`};const SJ=yJ.a;function MJ(e){if(Object(oe["F"])(e)){return e}const t=Object(oe["I"])(e)?e:yJ()(e);if(t.length<250){return t}let n=0;for(let i=0;i-1}function FJ(e,t){let n=0;for(const[i,r]of e.entries()){if(t(r,i,n++)){return true}}return false}function NJ(e,t){let n=0;for(const[i,r]of e.entries()){if(!t(r,i,n++)){return false}}return true}function TJ(e,...t){for(const n of t){zJ(e,n!==null&&n!==void 0?n:{})}return e}function zJ(e,t){for(const n of WJ(t)){Object(oe["kb"])(e,n,t[n],true)}}function RJ(e,t){const n=[];const i={};let r;for(const o of e){r=t(o);if(r in i){continue}i[r]=1;n.push(o)}return n}function BJ(e,t){const n=WJ(e);const i=WJ(t);if(n.length!==i.length){return false}for(const r of n){if(e[r]!==t[r]){return false}}return true}function PJ(e,t){if(e.size!==t.size){return false}for(const n of e){if(!t.has(n)){return false}}return true}function IJ(e,t){for(const n of e){if(t.has(n)){return true}}return false}function LJ(e){const t=new Set;for(const n of e){const e=Object(oe["Z"])(n);const i=e.map((e,t)=>t===0?e:`[${e}]`);const r=i.map((e,t)=>i.slice(0,t+1).join(""));for(const n of r){t.add(n)}}return t}function UJ(e,t){if(e===undefined||t===undefined){return true}return IJ(LJ(e),LJ(t))}function qJ(e){return WJ(e).length===0}const WJ=Object.keys;const GJ=Object.values;const HJ=Object.entries;function VJ(e){return e===true||e===false}function YJ(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function XJ(e,t){if(wJ(e)){return"!("+XJ(e.not,t)+")"}else if(_J(e)){return"("+e.and.map(e=>XJ(e,t)).join(") && (")+")"}else if(xJ(e)){return"("+e.or.map(e=>XJ(e,t)).join(") || (")+")"}else{return t(e)}}function JJ(e,t){if(t.length===0){return true}const n=t.shift();if(n in e&&JJ(e[n],t)){delete e[n]}return qJ(e)}function ZJ(e){return e.charAt(0).toUpperCase()+e.substr(1)}function QJ(e,t="datum"){const n=Object(oe["Z"])(e);const i=[];for(let r=1;r<=n.length;r++){const e=`[${n.slice(0,r).map(oe["ab"]).join("][")}]`;i.push(`${t}${e}`)}return i.join(" && ")}function KJ(e,t="datum"){return`${t}[${Object(oe["ab"])(Object(oe["Z"])(e).join("."))}]`}function eZ(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function tZ(e){return`${Object(oe["Z"])(e).map(eZ).join("\\.")}`}function nZ(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function iZ(e){return`${Object(oe["Z"])(e).join(".")}`}function rZ(e){if(!e){return 0}return Object(oe["Z"])(e).length}function oZ(...e){for(const t of e){if(t!==undefined){return t}}return undefined}let sZ=42;function aZ(e){const t=++sZ;return e?String(e)+t:t}function uZ(){sZ=42}function cZ(e){return lZ(e)?e:`__${e}`}function lZ(e){return e.indexOf("__")===0}function fZ(e){if(e===undefined){return undefined}return(e%360+360)%360}function dZ(e){if(Object(oe["F"])(e)){return true}return!isNaN(e)&&!isNaN(parseFloat(e))}const hZ={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function pZ(e){return e&&e["condition"]}const gZ=["domain","grid","labels","ticks","title"];const mZ={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"main",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"};const bZ={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1};const vZ=Object.assign(Object.assign({},bZ),{style:1,labelExpr:1,encoding:1});function yZ(e){return!!vZ[e]}const xZ=WJ(vZ);const _Z={arc:"arc",area:"area",bar:"bar",image:"image",line:"line",point:"point",rect:"rect",rule:"rule",text:"text",tick:"tick",trail:"trail",circle:"circle",square:"square",geoshape:"geoshape"};const wZ=_Z.arc;const OZ=_Z.area;const jZ=_Z.bar;const kZ=_Z.image;const EZ=_Z.line;const AZ=_Z.point;const DZ=_Z.rect;const SZ=_Z.rule;const MZ=_Z.text;const CZ=_Z.tick;const $Z=_Z.trail;const FZ=_Z.circle;const NZ=_Z.square;const TZ=_Z.geoshape;function zZ(e){return e in _Z}function RZ(e){return $J(["line","area","trail"],e)}function BZ(e){return $J(["rect","bar","image","arc"],e)}const PZ=WJ(_Z);function IZ(e){return e["type"]}const LZ=Object(oe["eb"])(PZ);function UZ(e){const t=IZ(e)?e.type:e;return t in LZ}const qZ=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit"];const WZ=["fill","fillOpacity"];const GZ=[...qZ,...WZ];const HZ={color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBand:1,timeUnitBandPosition:1};const VZ=WJ(HZ);const YZ={area:["line","point"],bar:["binSpacing","continuousBandSize","discreteBandSize"],rect:["binSpacing","continuousBandSize","discreteBandSize"],line:["point"],tick:["bandSize","thickness"]};const XZ={color:"#4c78a8",invalid:"filter",timeUnitBand:1};const JZ={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]};const ZZ=5;const QZ={binSpacing:1,continuousBandSize:ZZ,timeUnitBandPosition:.5};const KZ={binSpacing:0,continuousBandSize:ZZ,timeUnitBandPosition:.5};const eQ={thickness:1};function tQ(e){return IZ(e)?e.type:e}function nQ(e){return"mark"in e}class iQ{constructor(e,t){this.name=e;this.run=t}hasMatchingType(e){if(nQ(e)){return tQ(e.mark)===this.name}return false}}const rQ={argmax:1,argmin:1,average:1,count:1,distinct:1,product:1,max:1,mean:1,median:1,min:1,missing:1,q1:1,q3:1,ci0:1,ci1:1,stderr:1,stdev:1,stdevp:1,sum:1,valid:1,values:1,variance:1,variancep:1};const oQ={count:1,min:1,max:1};function sQ(e){return!!e&&!!e["argmin"]}function aQ(e){return!!e&&!!e["argmax"]}const uQ=WJ(rQ);function cQ(e){return Object(oe["I"])(e)&&!!rQ[e]}const lQ=["count","valid","missing","distinct"];function fQ(e){return Object(oe["I"])(e)&&$J(lQ,e)}function dQ(e){return Object(oe["I"])(e)&&$J(["min","max"],e)}const hQ=["count","sum","distinct","valid","missing"];const pQ=["mean","average","median","q1","q3","min","max"];const gQ=Object(oe["eb"])(pQ);const mQ="row";const bQ="column";const vQ="facet";const yQ="x";const xQ="y";const _Q="x2";const wQ="y2";const OQ="radius";const jQ="radius2";const kQ="theta";const EQ="theta2";const AQ="latitude";const DQ="longitude";const SQ="latitude2";const MQ="longitude2";const CQ="color";const $Q="fill";const FQ="stroke";const NQ="shape";const TQ="size";const zQ="angle";const RQ="opacity";const BQ="fillOpacity";const PQ="strokeOpacity";const IQ="strokeWidth";const LQ="strokeDash";const UQ="text";const qQ="order";const WQ="detail";const GQ="key";const HQ="tooltip";const VQ="href";const YQ="url";const XQ="description";const JQ={x:1,y:1,x2:1,y2:1};const ZQ={theta:1,theta2:1,radius:1,radius2:1};function QQ(e){return e in ZQ}const KQ={longitude:1,longitude2:1,latitude:1,latitude2:1};function eK(e){switch(e){case AQ:return"y";case SQ:return"y2";case DQ:return"x";case MQ:return"x2"}}function tK(e){return e in KQ}const nK=WJ(KQ);const iK=Object.assign(Object.assign(Object.assign(Object.assign({},JQ),ZQ),KQ),{color:1,fill:1,stroke:1,opacity:1,fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeDash:1,size:1,angle:1,shape:1,order:1,text:1,detail:1,key:1,tooltip:1,href:1,url:1,description:1});function rK(e){return e===CQ||e===$Q||e===FQ}const oK={row:1,column:1,facet:1};const sK=WJ(oK);const aK=Object.assign(Object.assign({},iK),oK);const uK=WJ(aK);const{order:cK,detail:lK,tooltip:fK}=aK,dK=HX(aK,["order","detail","tooltip"]);const{row:hK,column:pK,facet:gK}=dK,mK=HX(dK,["row","column","facet"]);const bK=WJ(dK);const vK=WJ(mK);function yK(e){return!!mK[e]}function xK(e){return!!aK[e]}const _K=[_Q,wQ,SQ,MQ,EQ,jQ];function wK(e){const t=OK(e);return t!==e}function OK(e){switch(e){case _Q:return yQ;case wQ:return xQ;case SQ:return AQ;case MQ:return DQ;case EQ:return kQ;case jQ:return OQ}return e}function jK(e){if(QQ(e)){switch(e){case kQ:return"startAngle";case EQ:return"endAngle";case OQ:return"outerRadius";case jQ:return"innerRadius"}}return e}function kK(e){switch(e){case yQ:return _Q;case xQ:return wQ;case AQ:return SQ;case DQ:return MQ;case kQ:return EQ;case OQ:return jQ}return undefined}function EK(e){switch(e){case yQ:case _Q:return"width";case xQ:case wQ:return"height"}return undefined}function AK(e){switch(e){case yQ:return"xOffset";case xQ:return"yOffset";case _Q:return"x2Offset";case wQ:return"y2Offset";case kQ:return"thetaOffset";case OQ:return"radiusOffset";case EQ:return"theta2Offset";case jQ:return"radius2Offset"}return undefined}const DK=WJ(iK);const{x:SK,y:MK,x2:CK,y2:$K,latitude:FK,longitude:NK,latitude2:TK,longitude2:zK,theta:RK,theta2:BK,radius:PK,radius2:IK}=iK,LK=HX(iK,["x","y","x2","y2","latitude","longitude","latitude2","longitude2","theta","theta2","radius","radius2"]);const UK=WJ(LK);const qK={x:1,y:1};const WK=WJ(qK);function GK(e){return e in qK}const HK={theta:1,radius:1};const VK=WJ(HK);function YK(e){return e==="width"?yQ:xQ}const{text:XK,tooltip:JK,href:ZK,url:QK,description:KK,detail:e0,key:t0,order:n0}=LK,i0=HX(LK,["text","tooltip","href","url","description","detail","key","order"]);const r0=WJ(i0);function o0(e){return!!LK[e]}function s0(e){switch(e){case CQ:case $Q:case FQ:case TQ:case NQ:case RQ:case IQ:case LQ:return true;case BQ:case PQ:case zQ:return false}}const a0=Object.assign(Object.assign(Object.assign({},qK),HK),i0);const u0=WJ(a0);function c0(e){return!!a0[e]}function l0(e,t){return p0(e)[t]}const f0={arc:"always",area:"always",bar:"always",circle:"always",geoshape:"always",image:"always",line:"always",rule:"always",point:"always",rect:"always",square:"always",trail:"always",text:"always",tick:"always"};const{geoshape:d0}=f0,h0=HX(f0,["geoshape"]);function p0(e){switch(e){case CQ:case $Q:case FQ:case XQ:case WQ:case GQ:case HQ:case VQ:case qQ:case RQ:case BQ:case PQ:case IQ:case vQ:case mQ:case bQ:return f0;case yQ:case xQ:case AQ:case DQ:return h0;case _Q:case wQ:case SQ:case MQ:return{area:"always",bar:"always",image:"always",rect:"always",rule:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case TQ:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case LQ:return{line:"always",point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",geoshape:"always"};case NQ:return{point:"always",geoshape:"always"};case UQ:return{text:"always"};case zQ:return{point:"always",square:"always",text:"always"};case YQ:return{image:"always"};case kQ:return{text:"always",arc:"always"};case OQ:return{text:"always",arc:"always"};case EQ:case jQ:return{arc:"always"}}}function g0(e){switch(e){case yQ:case xQ:case kQ:case OQ:case TQ:case zQ:case IQ:case RQ:case BQ:case PQ:case _Q:case wQ:case EQ:case jQ:return undefined;case vQ:case mQ:case bQ:case NQ:case LQ:case UQ:case HQ:case VQ:case YQ:case XQ:return"discrete";case CQ:case $Q:case FQ:return"flexible";case AQ:case DQ:case SQ:case MQ:case WQ:case GQ:case qQ:return undefined}}function m0(e){if(Object(oe["C"])(e)){e=v6(e,undefined)}return"bin"+WJ(e).map(t=>x0(e[t])?YJ(`_${t}_${HJ(e[t])}`):YJ(`_${t}_${e[t]}`)).join("")}function b0(e){return e===true||y0(e)&&!e.binned}function v0(e){return e==="binned"||y0(e)&&e.binned===true}function y0(e){return Object(oe["G"])(e)}function x0(e){return e===null||e===void 0?void 0:e["selection"]}function _0(e){switch(e){case mQ:case bQ:case TQ:case CQ:case $Q:case FQ:case IQ:case RQ:case BQ:case PQ:case NQ:return 6;case LQ:return 4;default:return 10}}function w0(e){return`Invalid specification ${JSON.stringify(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const O0='Autosize "fit" only works for single views and layered views.';function j0(e){const t=e=="width"?"Width":"Height";return`${t} "container" only works for single views and layered views.`}function k0(e){const t=e=="width"?"Width":"Height";const n=e=="width"?"x":"y";return`${t} "container" only works well with autosize "fit" or "fit-${n}".`}function E0(e){return e?`Dropping "fit-${e}" because spec has discrete ${EK(e)}.`:`Dropping "fit" because spec has discrete size.`}function A0(e){return`Unknown field for ${e}. Cannot calculate view size.`}function D0(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function S0(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function M0(e){return`The "nearest" transform is not supported for ${e} marks.`}function C0(e){return`Selection not supported for ${e} yet.`}function $0(e){return`Cannot find a selection named "${e}".`}const F0="Scale bindings are currently only supported for scales with unbinned, continuous domains.";const N0="Legend bindings are only supported for selections over an individual field or encoding channel.";function T0(e){return`Cannot define and lookup the "${e}" selection in the same view. `+`Try moving the lookup into a second, layered view?`}const z0="The same selection must be used to override scale domains in a layered view.";const R0='Interval selections should be initialized using "x" and/or "y" keys.';function B0(e){return`Unknown repeated value "${e}".`}function P0(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}const I0="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function L0(e){return`Unrecognized parse "${e}".`}function U0(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}const q0="Attempt to add the same child twice.";function W0(e){return`Ignoring an invalid transform: ${SJ(e)}.`}const G0='If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.';function H0(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function V0(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${SJ(t)} is overridden by a child projection ${SJ(n)}.`}const Y0="Arc marks uses theta channel rather than angle, replacing angle with theta.";function X0(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${SJ(n)}}.`}function J0(e){return`Invalid field type "${e}".`}function Z0(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}function Q0(e){return`Invalid aggregation operator "${e}".`}function K0(e,t){return`Missing type for channel "${e}", using "${t}" instead.`}function e1(e,t){const{fill:n,stroke:i}=t;return`Dropping color ${e} as the plot also has ${n&&i?"fill and stroke":n?"fill":"stroke"}.`}function t1(e,t){return`Dropping ${SJ(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}function n1(e,t,n){return`${e}-encoding with type ${t} is deprecated. Replacing with ${n}-encoding.`}const i1="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function r1(e,t,n){return`${e} dropped as it is incompatible with "${t}"${n?` when ${n}`:""}.`}function o1(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}function s1(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function a1(e){return`Facet encoding dropped as ${e.join(" and ")} ${e.length>1?"are":"is"} also specified.`}function u1(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${t==="ordinal"?"order":"magnitude"}.`}function c1(e,t){const n=e&&t?"x2 and y2":e?"x2":"y2";return`Line mark is for continuous lines and thus cannot be used with ${n}. We will use the rule mark (line segments) instead.`}function l1(e,t){return`Specified orient "${e}" overridden with "${t}".`}const f1="Custom domain scale cannot be unioned with default field-based domain.";const d1=`Scale's "rangeStep" is deprecated and will be removed in Vega-Lite 5.0. Please use "width"/"height": {"step": ...} instead. See https://vega.github.io/vega-lite/docs/size.html.`;function h1(e){return`Cannot use the scale property "${e}" with non-color channel.`}function p1(e){return`Using unaggregated domain with raw field has no effect (${SJ(e)}).`}function g1(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function m1(e){return`Unaggregated domain is currently unsupported for log scale (${SJ(e)}).`}function b1(e){return`Cannot apply size to non-oriented mark "${e}".`}function v1(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}function y1(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}function x1(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function _1(e,t){return`Scale type "${t}" does not work with mark "${e}".`}function w1(e){return`The step for "${e}" is dropped because the ${e==="width"?"x":"y"} is continuous.`}function O1(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${SJ(n)} and ${SJ(i)}). Using ${SJ(n)}.`}function j1(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${SJ(n)} and ${SJ(i)}). Using the union of the two domains.`}function k1(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`}function E1(e){return`Dropping sort property ${SJ(e)} as unioned domains only support boolean or op "count", "min", and "max".`}const A1="Domains that should be unioned has conflicting sort properties. Sort will be set to true.";const D1="Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect.";const S1="Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect.";const M1="Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.";const C1="Invalid channel for axis.";function $1(e){return`Cannot stack "${e}" if there is already "${e}2".`}function F1(e){return`Cannot stack non-linear scale (${e}).`}function N1(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}").`}function T1(e,t){return`Invalid ${e}: ${SJ(t)}.`}function z1(e){return`Dropping day from datetime ${SJ(e)} as day cannot be combined with other units.`}function R1(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`}function B1(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}function P1(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}function I1(e){return`1D error band does not support ${e}.`}function L1(e){return`Channel ${e} is required for "binned" bin.`}function U1(e){return`Channel ${e} should not be used with "binned" bin.`}function q1(e){return`Domain for ${e} is required for threshold scale.`}var W1;const G1=Object(oe["L"])(oe["e"]);let H1=G1;class V1{constructor(){this.warns=[];this.infos=[];this.debugs=[];W1.set(this,oe["e"])}level(e){if(e){hJ(this,W1,e);return this}return dJ(this,W1)}warn(...e){if(dJ(this,W1)>=oe["e"])this.warns.push(...e);return this}info(...e){if(dJ(this,W1)>=oe["c"])this.infos.push(...e);return this}debug(...e){if(dJ(this,W1)>=oe["a"])this.debugs.push(...e);return this}error(...e){if(dJ(this,W1)>=oe["b"])throw Error(...e);return this}}W1=new WeakMap;function Y1(e){return()=>{H1=new V1;e(H1);J1()}}function X1(e){H1=e;return H1}function J1(){H1=G1;return H1}function Z1(...e){H1.error(...e)}function Q1(...e){H1.warn(...e)}function K1(...e){H1.info(...e)}function e2(...e){H1.debug(...e)}function t2(e){if(e&&Object(oe["G"])(e)){for(const t of p2){if(t in e){return true}}}return false}const n2=["january","february","march","april","may","june","july","august","september","october","november","december"];const i2=n2.map(e=>e.substr(0,3));const r2=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];const o2=r2.map(e=>e.substr(0,3));function s2(e){if(dZ(e)){e=+e}if(Object(oe["F"])(e)){if(e>4){Q1(b.invalidTimeUnit("quarter",e))}return e-1}else{throw new Error(b.invalidTimeUnit("quarter",e))}}function a2(e){if(dZ(e)){e=+e}if(Object(oe["F"])(e)){return e-1}else{const t=e.toLowerCase();const n=n2.indexOf(t);if(n!==-1){return n}const i=t.substr(0,3);const r=i2.indexOf(i);if(r!==-1){return r}throw new Error(b.invalidTimeUnit("month",e))}}function u2(e){if(dZ(e)){e=+e}if(Object(oe["F"])(e)){return e%7}else{const t=e.toLowerCase();const n=r2.indexOf(t);if(n!==-1){return n}const i=t.substr(0,3);const r=o2.indexOf(i);if(r!==-1){return r}throw new Error(b.invalidTimeUnit("day",e))}}function c2(e,t){const n=[];if(t&&e.day!==undefined){if(WJ(e).length>1){Q1(b.droppedDay(e));e=EJ(e);delete e.day}}if(e.year!==undefined){n.push(e.year)}else{n.push(2012)}if(e.month!==undefined){const i=t?a2(e.month):e.month;n.push(i)}else if(e.quarter!==undefined){const i=t?s2(e.quarter):e.quarter;n.push(Object(oe["F"])(i)?i*3:i+"*3")}else{n.push(0)}if(e.date!==undefined){n.push(e.date)}else if(e.day!==undefined){const i=t?u2(e.day):e.day;n.push(Object(oe["F"])(i)?i+1:i+"+1")}else{n.push(1)}for(const i of["hours","minutes","seconds","milliseconds"]){const t=e[i];n.push(typeof t==="undefined"?0:t)}return n}function l2(e){const t=c2(e,true);const n=t.join(", ");if(e.utc){return`utc(${n})`}else{return`datetime(${n})`}}function f2(e){const t=c2(e,false);const n=t.join(", ");if(e.utc){return`utc(${n})`}else{return`datetime(${n})`}}function d2(e){const t=c2(e,true);if(e.utc){return+new Date(Date.UTC(...t))}else{return+new Date(...t)}}const h2={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};const p2=WJ(h2);function g2(e){return!!h2[e]}const m2={utcyear:1,utcquarter:1,utcmonth:1,utcweek:1,utcday:1,utcdayofyear:1,utcdate:1,utchours:1,utcminutes:1,utcseconds:1,utcmilliseconds:1};const b2={yearquarter:1,yearquartermonth:1,yearmonth:1,yearmonthdate:1,yearmonthdatehours:1,yearmonthdatehoursminutes:1,yearmonthdatehoursminutesseconds:1,yearweek:1,yearweekday:1,yearweekdayhours:1,yearweekdayhoursminutes:1,yearweekdayhoursminutesseconds:1,yeardayofyear:1,quartermonth:1,monthdate:1,monthdatehours:1,monthdatehoursminutes:1,monthdatehoursminutesseconds:1,weekday:1,weeksdayhours:1,weekdayhoursminutes:1,weekdayhoursminutesseconds:1,dayhours:1,dayhoursminutes:1,dayhoursminutesseconds:1,hoursminutes:1,hoursminutesseconds:1,minutesseconds:1,secondsmilliseconds:1};const v2={utcyearquarter:1,utcyearquartermonth:1,utcyearmonth:1,utcyearmonthdate:1,utcyearmonthdatehours:1,utcyearmonthdatehoursminutes:1,utcyearmonthdatehoursminutesseconds:1,utcyearweek:1,utcyearweekday:1,utcyearweekdayhours:1,utcyearweekdayhoursminutes:1,utcyearweekdayhoursminutesseconds:1,utcyeardayofyear:1,utcquartermonth:1,utcmonthdate:1,utcmonthdatehours:1,utcmonthdatehoursminutes:1,utcmonthdatehoursminutesseconds:1,utcweekday:1,utcweeksdayhours:1,utcweekdayhoursminutes:1,utcweekdayhoursminutesseconds:1,utcdayhours:1,utcdayhoursminutes:1,utcdayhoursminutesseconds:1,utchoursminutes:1,utchoursminutesseconds:1,utcminutesseconds:1,utcsecondsmilliseconds:1};function y2(e){return e.startsWith("utc")}function x2(e){return e.substr(3)}const _2={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function w2(e){const t=[];for(const n of p2){if(O2(e,n)){t.push(n)}}return t}function O2(e,t){const n=e.indexOf(t);if(n<0){return false}if(n>0&&t==="seconds"&&e.charAt(n-1)==="i"){return false}if(e.length>n+3&&t==="day"&&e.charAt(n+3)==="o"){return false}if(n>0&&t==="year"&&e.charAt(n-1)==="f"){return false}return true}function j2(e,t,{end:n}={end:false}){const i=QJ(t);const r=y2(e)?"utc":"";function o(e){if(e==="quarter"){return`(${r}quarter(${i})-1)`}else{return`${r}${e}(${i})`}}let s;const a={};for(const u of p2){if(O2(e,u)){a[u]=o(u);s=u}}if(n){a[s]+="+1"}return f2(a)}function k2(e){if(!e){return undefined}const t=w2(e);return`timeUnitSpecifier(${yJ()(t)}, ${yJ()(_2)})`}function E2(e,t,n){if(!e){return undefined}const i=k2(e);const r=n||y2(e);return`${r?"utc":"time"}Format(${t}, ${i})`}function A2(e){if(!e){return undefined}let t;if(Object(oe["I"])(e)){t={unit:e}}else if(Object(oe["G"])(e)){t=Object.assign(Object.assign({},e),e.unit?{unit:e.unit}:{})}if(y2(t.unit)){t.utc=true;t.unit=x2(t.unit)}return t}function D2(e){const t=A2(e),{utc:n}=t,i=HX(t,["utc"]);if(i.unit){return(n?"utc":"")+WJ(i).map(e=>YJ(`${e==="unit"?"":`_${e}_`}${i[e]}`)).join("")}else{return(n?"utc":"")+"timeunit"+WJ(i).map(e=>YJ(`_${e}_${i[e]}`)).join("")}}function S2(e){return e&&!!e["signal"]}function M2(e){return!!e["step"]}function C2(e){if(!Object(oe["B"])(e)){return"fields"in e&&!("data"in e)}return false}function $2(e){if(!Object(oe["B"])(e)){return"fields"in e&&"data"in e}return false}function F2(e){if(!Object(oe["B"])(e)){return"field"in e&&"data"in e}return false}const N2={aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1};const T2=WJ(N2);const z2={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};const R2=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function B2(e){return e===null||e===void 0?void 0:e["selection"]}function P2(e){return e&&!!e.field&&e.equal!==undefined}function I2(e){return e&&!!e.field&&e.lt!==undefined}function L2(e){return e&&!!e.field&&e.lte!==undefined}function U2(e){return e&&!!e.field&&e.gt!==undefined}function q2(e){return e&&!!e.field&&e.gte!==undefined}function W2(e){if(e&&e.field){if(Object(oe["B"])(e.range)&&e.range.length===2){return true}else if(S2(e.range)){return true}}return false}function G2(e){return e&&!!e.field&&(Object(oe["B"])(e.oneOf)||Object(oe["B"])(e.in))}function H2(e){return e&&!!e.field&&e.valid!==undefined}function V2(e){return G2(e)||P2(e)||W2(e)||I2(e)||U2(e)||L2(e)||q2(e)}function Y2(e,t){return O6(e,{timeUnit:t,wrapTime:true})}function X2(e,t){return e.map(e=>Y2(e,t))}function J2(e,t=true){var n;const{field:i}=e;const r=(n=A2(e.timeUnit))===null||n===void 0?void 0:n.unit;const o=r?"time("+j2(r,i)+")":Z5(e,{expr:"datum"});if(P2(e)){return o+"==="+Y2(e.equal,r)}else if(I2(e)){const t=e.lt;return`${o}<${Y2(t,r)}`}else if(U2(e)){const t=e.gt;return`${o}>${Y2(t,r)}`}else if(L2(e)){const t=e.lte;return`${o}<=${Y2(t,r)}`}else if(q2(e)){const t=e.gte;return`${o}>=${Y2(t,r)}`}else if(G2(e)){return`indexof([${X2(e.oneOf,r).join(",")}], ${o}) !== -1`}else if(H2(e)){return Z2(o,e.valid)}else if(W2(e)){const{range:n}=e;const i=S2(n)?{signal:`${n.signal}[0]`}:n[0];const s=S2(n)?{signal:`${n.signal}[1]`}:n[1];if(i!==null&&s!==null&&t){return"inrange("+o+", ["+Y2(i,r)+", "+Y2(s,r)+"])"}const a=[];if(i!==null){a.push(`${o} >= ${Y2(i,r)}`)}if(s!==null){a.push(`${o} <= ${Y2(s,r)}`)}return a.length>0?a.join(" && "):"true"}throw new Error(`Invalid field predicate: ${JSON.stringify(e)}`)}function Z2(e,t=true){if(t){return`isValid(${e}) && isFinite(+${e})`}else{return`!isValid(${e}) || !isFinite(+${e})`}}function Q2(e){var t;if(V2(e)&&e.timeUnit){return Object.assign(Object.assign({},e),{timeUnit:(t=A2(e.timeUnit))===null||t===void 0?void 0:t.unit})}return e}const K2={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function e3(e){return e in K2}const t3=K2.quantitative;const n3=K2.ordinal;const i3=K2.temporal;const r3=K2.nominal;const o3=K2.geojson;const s3=WJ(K2);function a3(e){if(e){e=e.toLowerCase();switch(e){case"q":case t3:return"quantitative";case"t":case i3:return"temporal";case"o":case n3:return"ordinal";case"n":case r3:return"nominal";case o3:return"geojson"}}return undefined}const u3={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",SYMLOG:"symlog",IDENTITY:"identity",SEQUENTIAL:"sequential",TIME:"time",UTC:"utc",QUANTILE:"quantile",QUANTIZE:"quantize",THRESHOLD:"threshold",BIN_ORDINAL:"bin-ordinal",ORDINAL:"ordinal",POINT:"point",BAND:"band"};const c3={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"};const l3=WJ(c3);function f3(e,t){const n=c3[e];const i=c3[t];return n===i||n==="ordinal-position"&&i==="time"||i==="ordinal-position"&&n==="time"}const d3={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function h3(e){return d3[e]}const p3=["linear","log","pow","sqrt","symlog","time","utc"];const g3=Object(oe["eb"])(p3);const m3=["linear","log","pow","sqrt","symlog"];const b3=Object(oe["eb"])(m3);function v3(e){return e in b3}const y3=["quantile","quantize","threshold"];const x3=Object(oe["eb"])(y3);const _3=p3.concat(["quantile","quantize","threshold","sequential","identity"]);const w3=Object(oe["eb"])(_3);const O3=["ordinal","bin-ordinal","point","band"];const j3=Object(oe["eb"])(O3);const k3=["time","utc"];function E3(e){return e in j3}function A3(e){return e in w3}function D3(e){return e in g3}function S3(e){return e in x3}const M3={pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:9,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4};function C3(e){return!Object(oe["I"])(e)&&!!e["name"]}function $3(e){return e===null||e===void 0?void 0:e["selection"]}function F3(e){return e&&e["unionWith"]}const N3={type:1,domain:1,domainMax:1,domainMin:1,domainMid:1,align:1,range:1,rangeMax:1,rangeMin:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1};const T3=WJ(N3);const{type:z3,domain:R3,range:B3,rangeMax:P3,rangeMin:I3,scheme:L3}=N3,U3=HX(N3,["type","domain","range","rangeMax","rangeMin","scheme"]);const q3=WJ(U3);function W3(e,t){switch(t){case"type":case"domain":case"reverse":case"range":return true;case"scheme":case"interpolate":return!$J(["point","band","identity"],e);case"bins":return!$J(["point","band","identity","ordinal"],e);case"round":return D3(e)||e==="band"||e==="point";case"padding":case"rangeMin":case"rangeMax":return D3(e)||$J(["point","band"],e);case"paddingOuter":case"align":return $J(["point","band"],e);case"paddingInner":return e==="band";case"domainMax":case"domainMid":case"domainMin":case"clamp":return D3(e);case"nice":return D3(e)||e==="quantize"||e==="threshold";case"exponent":return e==="pow";case"base":return e==="log";case"constant":return e==="symlog";case"zero":return A3(e)&&!$J(["log","time","utc","threshold","quantile"],e)}}function G3(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":if(!rK(e)){return b.cannotUseScalePropertyWithNonColor(e)}return undefined;case"align":case"type":case"bins":case"domain":case"domainMax":case"domainMin":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeMax":case"rangeMin":case"reverse":case"round":case"clamp":case"zero":return undefined}}function H3(e,t){if($J([n3,r3],t)){return e===undefined||E3(e)}else if(t===i3){return $J([u3.TIME,u3.UTC,undefined],e)}else if(t===t3){return $J([u3.LOG,u3.POW,u3.SQRT,u3.SYMLOG,u3.QUANTILE,u3.QUANTIZE,u3.THRESHOLD,u3.LINEAR,undefined],e)}return true}function V3(e,t){if(!c0(e)){return false}switch(e){case yQ:case xQ:case kQ:case OQ:return D3(t)||$J(["band","point"],t);case TQ:case IQ:case RQ:case BQ:case PQ:case zQ:return D3(t)||S3(t)||$J(["band","point","ordinal"],t);case CQ:case $Q:case FQ:return t!=="band";case LQ:return t==="ordinal"||S3(t);case NQ:return t==="ordinal"}}function Y3(e){const{channel:t,channelDef:n,markDef:i,scale:r,config:o}=e;const s=t5(e);if(z5(n)&&!fQ(n.aggregate)&&r&&D3(r.get("type"))&&r.get("zero")===false){return X3({fieldDef:n,channel:t,markDef:i,ref:s,config:o})}return s}function X3({fieldDef:e,channel:t,markDef:n,ref:i,config:r}){if(RZ(n.type)){return i}const o=N6("invalid",n,r);if(o===null){return i}return[J3(e,t),i]}function J3(e,t){const n=Z3(e,true);const i=OK(t);const r=i==="y"?{field:{group:"height"}}:{value:0};return Object.assign({test:n},r)}function Z3(e,t=true){return Z2(Object(oe["I"])(e)?e:Z5(e,{expr:"datum"}),!t)}function Q3(e){const{datum:t}=e;if(t2(t)){return l2(t)}return`${JSON.stringify(t)}`}function K3(e,t,n,i){const r={};if(t){r.scale=t}if(B5(e)){const{datum:t}=e;if(t2(t)){r.signal=l2(t)}else if(S2(t)){r.signal=t.signal}else{r.value=t}}else{r.field=Z5(e,n)}if(i){const{offset:e,band:t}=i;if(e){r.offset=e}if(t){r.band=t}}return r}function e5({scaleName:e,fieldOrDatumDef:t,fieldOrDatumDef2:n,offset:i,startSuffix:r,band:o=.5}){const s=0{switch(t.fieldTitle){case"plain":return e.field;case"functional":return n6(e);default:return t6(e,t)}};let r6=i6;function o6(e){r6=e}function s6(){o6(i6)}function a6(e,t,{allowDisabling:n,includeDefault:i=true}){var r,o;const s=(r=u6(e))===null||r===void 0?void 0:r.title;if(!z5(e)){return s}const a=e;const u=i?c6(a,t):undefined;if(n){return oZ(s,a.title,u)}else{return(o=s!==null&&s!==void 0?s:a.title)!==null&&o!==void 0?o:u}}function u6(e){if(H5(e)&&e.axis){return e.axis}else if(V5(e)&&e.legend){return e.legend}else if(j5(e)&&e.header){return e.header}return undefined}function c6(e,t){return r6(e,t)}function l6(e){var t;if(Y5(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}else{const n=(t=u6(e))!==null&&t!==void 0?t:{};const{format:i,formatType:r}=n;return{format:i,formatType:r}}}function f6(e,t){var n;switch(t){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(S5(e)&&Object(oe["B"])(e.sort)){return"ordinal"}const{aggregate:i,bin:r,timeUnit:o}=e;if(o){return"temporal"}if(r||i&&!aQ(i)&&!sQ(i)){return"quantitative"}if(G5(e)&&((n=e.scale)===null||n===void 0?void 0:n.type)){switch(c3[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}}return"nominal"}function d6(e){if(z5(e)){return e}else if(F5(e)){return e.condition}return undefined}function h6(e){if(U5(e)){return e}else if(N5(e)){return e.condition}return undefined}function p6(e,t,n,i={}){if(Object(oe["I"])(e)||Object(oe["F"])(e)||Object(oe["C"])(e)){const n=Object(oe["I"])(e)?"string":Object(oe["F"])(e)?"number":"boolean";Q1(b.primitiveChannelDef(t,n,e));return{value:e}}if(U5(e)){return g6(e,t,n,i)}else if(N5(e)){return Object.assign(Object.assign({},e),{condition:g6(e.condition,t,n,i)})}return e}function g6(e,t,n,i){if(Y5(e)){const{format:r,formatType:o}=e,s=HX(e,["format","formatType"]);if(i5(o)&&!n.customFormatTypes){Q1(b.customFormatTypeNotAllowed(t));return g6(s,t,n,i)}}else{const r=H5(e)?"axis":V5(e)?"legend":j5(e)?"header":null;if(r&&e[r]){const o=e[r],{format:s,formatType:a}=o,u=HX(o,["format","formatType"]);if(i5(a)&&!n.customFormatTypes){Q1(b.customFormatTypeNotAllowed(t));return g6(Object.assign(Object.assign({},e),{[r]:u}),t,n,i)}}}if(z5(e)){return b6(e,t,i)}return m6(e)}function m6(e){let t=e["type"];if(t){return e}const{datum:n}=e;t=Object(oe["F"])(n)?"quantitative":Object(oe["I"])(n)?"nominal":t2(n)?"temporal":undefined;return Object.assign(Object.assign({},e),{type:t})}function b6(e,t,{compositeMark:n=false}={}){const{aggregate:i,timeUnit:r,bin:o,field:s}=e;const a=Object.assign({},e);if(!n&&i&&!cQ(i)&&!aQ(i)&&!sQ(i)){Q1(b.invalidAggregate(i));delete a.aggregate}if(r){a.timeUnit=A2(r)}if(s){a.field=`${s}`}if(b0(o)){a.bin=v6(o,t)}if(v0(o)&&!GK(t)){Q1(b.channelShouldNotBeUsedForBinned(t))}if(q5(a)){const{type:e}=a;const t=a3(e);if(e!==t){a.type=t}if(e!=="quantitative"){if(fQ(i)){Q1(b.invalidFieldTypeForCountAggregate(e,i));a.type="quantitative"}}}else if(!wK(t)){const e=f6(a,t);a["type"]=e}if(q5(a)){const{compatible:e,warning:n}=x6(a,t)||{};if(e===false){Q1(n)}}if(S5(a)&&Object(oe["I"])(a.sort)){const{sort:e}=a;if(y5(e)){return Object.assign(Object.assign({},a),{sort:{encoding:e}})}const t=e.substr(1);if(e.charAt(0)==="-"&&y5(t)){return Object.assign(Object.assign({},a),{sort:{encoding:t,order:"descending"}})}}if(j5(a)){const{header:e}=a;const{orient:t}=e,n=HX(e,["orient"]);if(t){return Object.assign(Object.assign({},a),{header:Object.assign(Object.assign({},n),{labelOrient:e.labelOrient||t,titleOrient:e.titleOrient||t})})}}return a}function v6(e,t){if(Object(oe["C"])(e)){return{maxbins:_0(t)}}else if(e==="binned"){return{binned:true}}else if(!e.maxbins&&!e.step){return Object.assign(Object.assign({},e),{maxbins:_0(t)})}else{return e}}const y6={compatible:true};function x6(e,t){const n=e.type;if(n==="geojson"&&t!=="shape"){return{compatible:false,warning:`Channel ${t} should not be used with a geojson data.`}}switch(t){case mQ:case bQ:case vQ:if(K5(e)){return{compatible:false,warning:b.facetChannelShouldBeDiscrete(t)}}return y6;case yQ:case xQ:case CQ:case $Q:case FQ:case UQ:case WQ:case GQ:case HQ:case VQ:case YQ:case zQ:case kQ:case OQ:case XQ:return y6;case DQ:case MQ:case AQ:case SQ:if(n!==t3){return{compatible:false,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}}return y6;case RQ:case BQ:case PQ:case IQ:case TQ:case EQ:case jQ:case _Q:case wQ:if(n==="nominal"&&!e["sort"]){return{compatible:false,warning:`Channel ${t} should not be used with an unsorted discrete field.`}}return y6;case LQ:if(!$J(["ordinal","nominal"],e.type)){return{compatible:false,warning:"StrokeDash channel should be used with only discrete data."}}return y6;case NQ:if(!$J(["ordinal","nominal","geojson"],e.type)){return{compatible:false,warning:"Shape channel should be used with only either discrete or geojson data."}}return y6;case qQ:if(e.type==="nominal"&&!("sort"in e)){return{compatible:false,warning:`Channel order is inappropriate for nominal field, which has no inherent order.`}}return y6}}function _6(e){const{formatType:t}=l6(e);return t==="time"||!t&&w6(e)}function w6(e){return e&&(e["type"]==="temporal"||z5(e)&&!!e.timeUnit)}function O6(e,{timeUnit:t,type:n,wrapTime:i,undefinedIfExprNotRequired:r}){var o;const s=t&&((o=A2(t))===null||o===void 0?void 0:o.unit);let a=s||n==="temporal";let u;if(S2(e)){u=e.signal}else if(t2(e)){a=true;u=l2(e)}else if(Object(oe["I"])(e)||Object(oe["F"])(e)){if(a){u=`datetime(${JSON.stringify(e)})`;if(g2(s)){if(Object(oe["F"])(e)&&e<1e4||Object(oe["I"])(e)&&isNaN(Date.parse(e))){u=l2({[s]:e})}}}}if(u){return i&&a?`time(${u})`:u}return r?undefined:JSON.stringify(e)}function j6(e,t){const{type:n}=e;return t.map(t=>{const i=O6(t,{timeUnit:z5(e)?e.timeUnit:undefined,type:n,undefinedIfExprNotRequired:true});if(i!==undefined){return{signal:i}}return t})}function k6(e,t){if(!b0(e.bin)){console.warn("Only call this method for binned field defs.");return false}return c0(t)&&$J(["ordinal","nominal"],e.type)}function E6(e){const{anchor:t,frame:n,offset:i,orient:r,color:o,subtitleColor:s,subtitleFont:a,subtitleFontSize:u,subtitleFontStyle:c,subtitleFontWeight:l,subtitleLineHeight:f,subtitlePadding:d}=e,h=HX(e,["anchor","frame","offset","orient","color","subtitleColor","subtitleFont","subtitleFontSize","subtitleFontStyle","subtitleFontWeight","subtitleLineHeight","subtitlePadding"]);const p=Object.assign(Object.assign({},h),o?{fill:o}:{});const g=Object.assign(Object.assign(Object.assign(Object.assign({},t?{anchor:t}:{}),n?{frame:n}:{}),i?{offset:i}:{}),r?{orient:r}:{});const m=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},s?{subtitleColor:s}:{}),a?{subtitleFont:a}:{}),u?{subtitleFontSize:u}:{}),c?{subtitleFontStyle:c}:{}),l?{subtitleFontWeight:l}:{}),f?{subtitleLineHeight:f}:{}),d?{subtitlePadding:d}:{});const b=AJ(p,["align","baseline","dx","dy","limit"]);return{titleMarkConfig:p,subtitleMarkConfig:b,nonMark:g,subtitle:m}}function A6(e){return Object(oe["I"])(e)||Object(oe["B"])(e)&&Object(oe["I"])(e[0])}const D6=" – ";function S6(e){if(S2(e)){return e}return e!==undefined?{value:e}:undefined}function M6(e){if(S2(e)){return e.signal}return Object(oe["ab"])(e.value)}function C6(e){if(S2(e)){return e.signal}return e==null?null:Object(oe["ab"])(e)}function $6(e,t,n){for(const i of n){const n=T6(i,t.markDef,t.config);if(n!==undefined){e[i]=S6(n)}}return e}function F6(e){var t;return[].concat(e.type,(t=e.style)!==null&&t!==void 0?t:[])}function N6(e,t,n,i={}){const{vgChannel:r,ignoreVgConfig:o}=i;if(r&&t[r]!==undefined){return t[r]}else if(t[e]!==undefined){return t[e]}else if(o&&(!r||r===e)){return undefined}return T6(e,t,n,i)}function T6(e,t,n,{vgChannel:i}={}){return oZ(i?z6(e,t,n.style):undefined,z6(e,t,n.style),i?n[t.type][i]:undefined,n[t.type][e],i?n.mark[i]:n.mark[e])}function z6(e,t,n){return R6(e,F6(t),n)}function R6(e,t,n){t=Object(oe["i"])(t);let i;for(const r of t){const t=n[r];if(t&&t[e]!==undefined){i=t[e]}}return i}function B6(e,t){return Object(oe["i"])(e).reduce((e,n)=>{var i;e.field.push(Z5(n,t));e.order.push((i=n.sort)!==null&&i!==void 0?i:"ascending");return e},{field:[],order:[]})}function P6(e,t){const n=[...e];t.forEach(e=>{for(const t of n){if(kJ(t,e)){return}}n.push(e)});return n}function I6(e,t){if(kJ(e,t)||!t){return e}else if(!e){return t}else{return[...Object(oe["i"])(e),...Object(oe["i"])(t)].join(", ")}}function L6(e,t){const n=e.value;const i=t.value;if(n==null||i===null){return{explicit:e.explicit,value:null}}else if((A6(n)||S2(n))&&(A6(i)||S2(i))){return{explicit:e.explicit,value:I6(n,i)}}else if(A6(n)||S2(n)){return{explicit:e.explicit,value:n}}else if(A6(i)||S2(i)){return{explicit:e.explicit,value:i}}else if(!A6(n)&&!S2(n)&&!A6(i)&&!S2(i)){return{explicit:e.explicit,value:P6(n,i)}}throw new Error("It should never reach here")}function U6(e,t){const n=e&&e[t];if(n){if(Object(oe["B"])(n)){return FJ(n,e=>!!e.field)}else{return z5(n)||F5(n)}}return false}function q6(e){return FJ(uK,t=>{if(U6(e,t)){const n=e[t];if(Object(oe["B"])(n)){return FJ(n,e=>!!e.aggregate)}else{const e=d6(n);return e&&!!e.aggregate}}return false})}function W6(e,t){const n=[];const i=[];const r=[];const o=[];const s={};X6(e,(a,u)=>{if(z5(a)){const{field:c,aggregate:l,bin:f,timeUnit:d}=a,h=HX(a,["field","aggregate","bin","timeUnit"]);if(l||d||f){const e=u6(a);const p=e&&e.title;let g=Z5(a,{forAs:true});const m=Object.assign(Object.assign(Object.assign({},p?[]:{title:a6(a,t,{allowDisabling:true})}),h),{field:g});if(l){let e;if(aQ(l)){e="argmax";g=Z5({op:"argmax",field:l.argmax},{forAs:true});m.field=`${g}.${c}`}else if(sQ(l)){e="argmin";g=Z5({op:"argmin",field:l.argmin},{forAs:true});m.field=`${g}.${c}`}else if(l!=="boxplot"&&l!=="errorbar"&&l!=="errorband"){e=l}if(e){const t={op:e,as:g};if(c){t.field=c}o.push(t)}}else{n.push(g);if(q5(a)&&b0(f)){i.push({bin:f,field:c,as:g});n.push(Z5(a,{binSuffix:"end"}));if(k6(a,u)){n.push(Z5(a,{binSuffix:"range"}))}if(GK(u)){const e={field:g+"_end"};s[u+"2"]=e}m.bin="binned";if(!wK(u)){m["type"]=t3}}else if(d){r.push({timeUnit:d,field:c,as:g});const e=q5(a)&&a.type!==i3&&"time";if(e){if(u===UQ||u===HQ){m["formatType"]=e}else if(o0(u)){m["legend"]=Object.assign({formatType:e},m["legend"])}else if(GK(u)){m["axis"]=Object.assign({formatType:e},m["axis"])}}}}s[u]=m}else{n.push(c);s[u]=e[u]}}else{s[u]=e[u]}});return{bins:i,timeUnits:r,aggregate:o,groupby:n,encoding:s}}function G6(e,t,n){const i=l0(t,n);if(!i){return false}else if(i==="binned"){const n=e[t===_Q?yQ:xQ];if(z5(n)&&z5(e[t])&&v0(n.bin)){return true}else{return false}}return true}function H6(e,t,n,i){return WJ(e).reduce((r,o)=>{if(!xK(o)){Q1(b.invalidEncodingChannel(o));return r}const s=e[o];if(o==="angle"&&t==="arc"&&!e.theta){Q1(b.REPLACE_ANGLE_WITH_THETA);o=kQ}if(!G6(e,o,t)){Q1(b.incompatibleChannel(o,t));return r}if(o===TQ&&t==="line"){const t=d6(e[o]);if(t===null||t===void 0?void 0:t.aggregate){Q1(b.LINE_WITH_VARYING_SIZE);return r}}if(o===CQ&&(n?"fill"in e:"stroke"in e)){Q1(b.droppingColor("encoding",{fill:"fill"in e,stroke:"stroke"in e}));return r}if(o===WQ||o===qQ&&!Object(oe["B"])(s)&&!W5(s)||o===HQ&&Object(oe["B"])(s)){if(s){r[o]=Object(oe["i"])(s).reduce((e,t)=>{if(!z5(t)){Q1(b.emptyFieldDef(t,o))}else{e.push(b6(t,o))}return e},[])}}else{if(o===HQ&&s===null){r[o]=null}else if(!z5(s)&&!B5(s)&&!W5(s)&&!$5(s)&&!S2(s)){Q1(b.emptyFieldDef(s,o));return r}r[o]=p6(s,o,i)}return r},{})}function V6(e,t){const n={};for(const i of WJ(e)){const r=p6(e[i],i,t,{compositeMark:true});n[i]=r}return n}function Y6(e){const t=[];for(const n of WJ(e)){if(U6(e,n)){const i=e[n];const r=Object(oe["i"])(i);for(const e of r){if(z5(e)){t.push(e)}else if(F5(e)){t.push(e.condition)}}}}return t}function X6(e,t,n){if(!e){return}for(const i of WJ(e)){const r=e[i];if(Object(oe["B"])(r)){for(const e of r){t.call(n,e,i)}}else{t.call(n,r,i)}}}function J6(e,t,n,i){if(!e){return n}return WJ(e).reduce((n,r)=>{const o=e[r];if(Object(oe["B"])(o)){return o.reduce((e,n)=>t.call(i,e,n,r),n)}else{return t.call(i,n,o,r)}},n)}function Z6(e,t){return WJ(t).reduce((n,i)=>{switch(i){case yQ:case xQ:case VQ:case XQ:case YQ:case _Q:case wQ:case kQ:case EQ:case OQ:case jQ:case AQ:case DQ:case SQ:case MQ:case UQ:case NQ:case zQ:case HQ:return n;case qQ:if(e==="line"||e==="trail"){return n}case WQ:case GQ:{const e=t[i];if(Object(oe["B"])(e)||z5(e)){for(const t of Object(oe["i"])(e)){if(!t.aggregate){n.push(Z5(t,{}))}}}return n}case TQ:if(e==="trail"){return n}case CQ:case $Q:case FQ:case RQ:case BQ:case PQ:case LQ:case IQ:{const e=d6(t[i]);if(e&&!e.aggregate){n.push(Z5(e,{}))}return n}}},[])}function Q6(e){const{tooltip:t}=e,n=HX(e,["tooltip"]);if(!t){return{filteredEncoding:n}}let i;let r;if(Object(oe["B"])(t)){for(const e of t){if(e.aggregate){if(!i){i=[]}i.push(e)}else{if(!r){r=[]}r.push(e)}}if(i){n.tooltip=i}}else{if(t["aggregate"]){n.tooltip=t}else{r=t}}if(Object(oe["B"])(r)&&r.length===1){r=r[0]}return{customTooltipWithoutAggregatedField:r,filteredEncoding:n}}function K6(e,t,n,i=true){if("tooltip"in n){return{tooltip:n.tooltip}}const r=e.map(({fieldPrefix:e,titlePrefix:n})=>{const r=i?` of ${e4(t)}`:"";return{field:e+t.field,type:t.type,title:S2(n)?{signal:n+`"${escape(r)}"`}:n+r}});const o=Y6(n).map(X5);return{tooltip:[...r,...RJ(o,MJ)]}}function e4(e){const{title:t,field:n}=e;return oZ(t,n)}function t4(e,t,n,i,r){const{scale:o,axis:s}=n;return({partName:a,mark:u,positionPrefix:c,endPositionPrefix:l=undefined,extraEncoding:f={}})=>{const d=e4(n);return n4(e,a,r,{mark:u,encoding:Object.assign(Object.assign(Object.assign({[t]:Object.assign(Object.assign(Object.assign({field:c+"_"+n.field,type:n.type},d!==undefined?{title:d}:{}),o!==undefined?{scale:o}:{}),s!==undefined?{axis:s}:{})},Object(oe["I"])(l)?{[t+"2"]:{field:l+"_"+n.field}}:{}),i),f)})}}function n4(e,t,n,i){const{clip:r,color:o,opacity:s}=e;const a=e.type;if(e[t]||e[t]===undefined&&n[t]){return[Object.assign(Object.assign({},i),{mark:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n[t]),r?{clip:r}:{}),o?{color:o}:{}),s?{opacity:s}:{}),IZ(i.mark)?i.mark:{type:i.mark}),{style:`${a}-${t}`}),Object(oe["C"])(e[t])?{}:e[t])})]}return[]}function i4(e,t,n){const{encoding:i}=e;const r=t==="vertical"?"y":"x";const o=i[r];const s=i[r+"2"];const a=i[r+"Error"];const u=i[r+"Error2"];return{continuousAxisChannelDef:r4(o,n),continuousAxisChannelDef2:r4(s,n),continuousAxisChannelDefError:r4(a,n),continuousAxisChannelDefError2:r4(u,n),continuousAxis:r}}function r4(e,t){if(e&&e.aggregate){const{aggregate:n}=e,i=HX(e,["aggregate"]);if(n!==t){Q1(b.errorBarContinuousAxisHasCustomizedAggregate(n,t))}return i}else{return e}}function o4(e,t){const{mark:n,encoding:i}=e;const{x:r,y:o}=i;if(IZ(n)&&n.orient){return n.orient}if(P5(r)){if(P5(o)){const e=z5(r)&&r.aggregate;const n=z5(o)&&o.aggregate;if(!e&&n===t){return"vertical"}else if(!n&&e===t){return"horizontal"}else if(e===t&&n===t){throw new Error("Both x and y cannot have aggregate")}else{if(_6(o)&&!_6(r)){return"horizontal"}return"vertical"}}return"horizontal"}else if(P5(o)){return"vertical"}else{throw new Error(`Need a valid continuous axis for ${t}s`)}}const s4="boxplot";const a4=["box","median","outliers","rule","ticks"];const u4=new iQ(s4,l4);function c4(e){if(Object(oe["F"])(e)){return"tukey"}return e}function l4(e,{config:t}){var n,i;e=Object.assign(Object.assign({},e),{encoding:V6(e.encoding,t)});const{mark:r,encoding:o,selection:s,projection:a}=e,u=HX(e,["mark","encoding","selection","projection"]);const c=IZ(r)?r:{type:r};if(s){Q1(b.selectionNotSupported("boxplot"))}const l=(n=c.extent)!==null&&n!==void 0?n:t.boxplot.extent;const f=N6("size",c,t);const d=c4(l);const{bins:h,timeUnits:p,transform:g,continuousAxisChannelDef:m,continuousAxis:v,groupby:y,aggregate:x,encodingWithoutContinuousAxis:_,ticksOrient:w,boxOrient:O,customTooltipWithoutAggregatedField:j}=d4(e,l,t);const{color:k,size:E}=_,A=HX(_,["color","size"]);const D=e=>t4(c,v,m,e,t.boxplot);const S=D(A);const M=D(_);const C=D(Object.assign(Object.assign({},A),E?{size:E}:{}));const $=K6([{fieldPrefix:d==="min-max"?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:d==="min-max"?"lower_whisker_":"min_",titlePrefix:"Min"}],m,_);const F={type:"tick",color:"black",opacity:1,orient:w,invalid:null,aria:false};const N=d==="min-max"?$:K6([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],m,_);const T=[...S({partName:"rule",mark:{type:"rule",invalid:null,aria:false},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:N}),...S({partName:"rule",mark:{type:"rule",invalid:null,aria:false},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:N}),...S({partName:"ticks",mark:F,positionPrefix:"lower_whisker",extraEncoding:N}),...S({partName:"ticks",mark:F,positionPrefix:"upper_whisker",extraEncoding:N})];const z=[...d!=="tukey"?T:[],...M({partName:"box",mark:Object.assign(Object.assign({type:"bar"},f?{size:f}:{}),{orient:O,invalid:null,ariaRoleDescription:"box"}),positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:$}),...C({partName:"median",mark:Object.assign(Object.assign(Object.assign({type:"tick",invalid:null},Object(oe["G"])(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{}),f?{size:f}:{}),{orient:w,aria:false}),positionPrefix:"mid_box",extraEncoding:$})];if(d==="min-max"){return Object.assign(Object.assign({},u),{transform:((i=u.transform)!==null&&i!==void 0?i:[]).concat(g),layer:z})}const R=`datum["lower_box_${m.field}"]`;const B=`datum["upper_box_${m.field}"]`;const P=`(${B} - ${R})`;const I=`${R} - ${l} * ${P}`;const L=`${B} + ${l} * ${P}`;const U=`datum["${m.field}"]`;const q={joinaggregate:f4(m.field),groupby:y};const W={transform:[{filter:`(${I} <= ${U}) && (${U} <= ${L})`},{aggregate:[{op:"min",field:m.field,as:"lower_whisker_"+m.field},{op:"max",field:m.field,as:"upper_whisker_"+m.field},{op:"min",field:"lower_box_"+m.field,as:"lower_box_"+m.field},{op:"max",field:"upper_box_"+m.field,as:"upper_box_"+m.field},...x],groupby:y}],layer:T};const{tooltip:G}=A,H=HX(A,["tooltip"]);const{scale:V,axis:Y}=m;const X=e4(m);const J=DJ(Y,["title"]);const Z=n4(c,"outliers",t.boxplot,{transform:[{filter:`(${U} < ${I}) || (${U} > ${L})`}],mark:"point",encoding:Object.assign(Object.assign(Object.assign({[v]:Object.assign(Object.assign(Object.assign({field:m.field,type:m.type},X!==undefined?{title:X}:{}),V!==undefined?{scale:V}:{}),qJ(J)?{}:{axis:J})},H),k?{color:k}:{}),j?{tooltip:j}:{})})[0];let Q;const K=[...h,...p,q];if(Z){Q={transform:K,layer:[Z,W]}}else{Q=W;Q.transform.unshift(...K)}return Object.assign(Object.assign({},u),{layer:[Q,{transform:g,layer:z}]})}function f4(e){return[{op:"q1",field:e,as:"lower_box_"+e},{op:"q3",field:e,as:"upper_box_"+e}]}function d4(e,t,n){const i=o4(e,s4);const{continuousAxisChannelDef:r,continuousAxis:o}=i4(e,i,s4);const s=r.field;const a=c4(t);const u=[...f4(s),{op:"median",field:s,as:"mid_box_"+s},{op:"min",field:s,as:(a==="min-max"?"lower_whisker_":"min_")+s},{op:"max",field:s,as:(a==="min-max"?"upper_whisker_":"max_")+s}];const c=a==="min-max"||a==="tukey"?[]:[{calculate:`datum["upper_box_${s}"] - datum["lower_box_${s}"]`,as:"iqr_"+s},{calculate:`min(datum["upper_box_${s}"] + datum["iqr_${s}"] * ${t}, datum["max_${s}"])`,as:"upper_whisker_"+s},{calculate:`max(datum["lower_box_${s}"] - datum["iqr_${s}"] * ${t}, datum["min_${s}"])`,as:"lower_whisker_"+s}];const l=e.encoding,f=o,d=l[f],h=HX(l,[typeof f==="symbol"?f:f+""]);const{customTooltipWithoutAggregatedField:p,filteredEncoding:g}=Q6(h);const{bins:m,timeUnits:b,aggregate:v,groupby:y,encoding:x}=W6(g,n);const _=i==="vertical"?"horizontal":"vertical";const w=i;const O=[...m,...b,{aggregate:[...v,...u],groupby:y},...c];return{bins:m,timeUnits:b,transform:O,groupby:y,aggregate:v,continuousAxisChannelDef:r,continuousAxis:o,encodingWithoutContinuousAxis:x,ticksOrient:_,boxOrient:w,customTooltipWithoutAggregatedField:p}}const h4="errorbar";const p4=["ticks","rule"];const g4=new iQ(h4,m4);function m4(e,{config:t}){e=Object.assign(Object.assign({},e),{encoding:V6(e.encoding,t)});const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:o,ticksOrient:s,markDef:a,outerSpec:u,tooltipEncoding:c}=_4(e,h4,t);delete o["size"];const l=t4(a,r,i,o,t.errorbar);const f=a.thickness;const d=a.size;const h=Object.assign(Object.assign({type:"tick",orient:s,aria:false},f!==undefined?{thickness:f}:{}),d!==undefined?{size:d}:{});const p=[...l({partName:"ticks",mark:h,positionPrefix:"lower",extraEncoding:c}),...l({partName:"ticks",mark:h,positionPrefix:"upper",extraEncoding:c}),...l({partName:"rule",mark:Object.assign({type:"rule",ariaRoleDescription:"errorbar"},f!==undefined?{size:f}:{}),positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:c})];return Object.assign(Object.assign(Object.assign({},u),{transform:n}),p.length>1?{layer:p}:Object.assign({},p[0]))}function b4(e,t){const{encoding:n}=e;if(v4(n)){return{orient:o4(e,t),inputType:"raw"}}const i=y4(n);const r=x4(n);const o=n.x;const s=n.y;if(i){if(r){throw new Error(`${t} cannot be both type aggregated-upper-lower and aggregated-error`)}const e=n.x2;const i=n.y2;if(U5(e)&&U5(i)){throw new Error(`${t} cannot have both x2 and y2`)}else if(U5(e)){if(P5(o)){return{orient:"horizontal",inputType:"aggregated-upper-lower"}}else{throw new Error(`Both x and x2 have to be quantitative in ${t}`)}}else if(U5(i)){if(P5(s)){return{orient:"vertical",inputType:"aggregated-upper-lower"}}else{throw new Error(`Both y and y2 have to be quantitative in ${t}`)}}throw new Error("No ranged axis")}else{const e=n.xError;const i=n.xError2;const r=n.yError;const a=n.yError2;if(U5(i)&&!U5(e)){throw new Error(`${t} cannot have xError2 without xError`)}if(U5(a)&&!U5(r)){throw new Error(`${t} cannot have yError2 without yError`)}if(U5(e)&&U5(r)){throw new Error(`${t} cannot have both xError and yError with both are quantiative`)}else if(U5(e)){if(P5(o)){return{orient:"horizontal",inputType:"aggregated-error"}}else{throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}}else if(U5(r)){if(P5(s)){return{orient:"vertical",inputType:"aggregated-error"}}else{throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}}throw new Error("No ranged axis")}}function v4(e){return(U5(e.x)||U5(e.y))&&!U5(e.x2)&&!U5(e.y2)&&!U5(e.xError)&&!U5(e.xError2)&&!U5(e.yError)&&!U5(e.yError2)}function y4(e){return U5(e.x2)||U5(e.y2)}function x4(e){return U5(e.xError)||U5(e.xError2)||U5(e.yError)||U5(e.yError2)}function _4(e,t,n){var i;const{mark:r,encoding:o,selection:s,projection:a}=e,u=HX(e,["mark","encoding","selection","projection"]);const c=IZ(r)?r:{type:r};if(s){Q1(b.selectionNotSupported(t))}const{orient:l,inputType:f}=b4(e,t);const{continuousAxisChannelDef:d,continuousAxisChannelDef2:h,continuousAxisChannelDefError:p,continuousAxisChannelDefError2:g,continuousAxis:m}=i4(e,l,t);const{errorBarSpecificAggregate:v,postAggregateCalculates:y,tooltipSummary:x,tooltipTitleWithFieldName:_}=w4(c,d,h,p,g,f,t,n);const w=o,O=m,j=w[O],k=m==="x"?"x2":"y2",E=w[k],A=m==="x"?"xError":"yError",D=w[A],S=m==="x"?"xError2":"yError2",M=w[S],C=HX(w,[typeof O==="symbol"?O:O+"",typeof k==="symbol"?k:k+"",typeof A==="symbol"?A:A+"",typeof S==="symbol"?S:S+""]);const{bins:$,timeUnits:F,aggregate:N,groupby:T,encoding:z}=W6(C,n);const R=[...N,...v];const B=f!=="raw"?[]:T;const P=K6(x,d,z,_);return{transform:[...(i=u.transform)!==null&&i!==void 0?i:[],...$,...F,...R.length===0?[]:[{aggregate:R,groupby:B}],...y],groupby:B,continuousAxisChannelDef:d,continuousAxis:m,encodingWithoutContinuousAxis:z,ticksOrient:l==="vertical"?"horizontal":"vertical",markDef:c,outerSpec:u,tooltipEncoding:P}}function w4(e,t,n,i,r,o,s,a){let u=[];let c=[];const l=t.field;let f;let d=false;if(o==="raw"){const t=e.center?e.center:e.extent?e.extent==="iqr"?"median":"mean":a.errorbar.center;const n=e.extent?e.extent:t==="mean"?"stderr":"iqr";if(t==="median"!==(n==="iqr")){Q1(b.errorBarCenterIsUsedWithWrongExtent(t,n,s))}if(n==="stderr"||n==="stdev"){u=[{op:n,field:l,as:"extent_"+l},{op:t,field:l,as:"center_"+l}];c=[{calculate:`datum["center_${l}"] + datum["extent_${l}"]`,as:"upper_"+l},{calculate:`datum["center_${l}"] - datum["extent_${l}"]`,as:"lower_"+l}];f=[{fieldPrefix:"center_",titlePrefix:ZJ(t)},{fieldPrefix:"upper_",titlePrefix:O4(t,n,"+")},{fieldPrefix:"lower_",titlePrefix:O4(t,n,"-")}];d=true}else{let e;let t;let i;if(n==="ci"){e="mean";t="ci0";i="ci1"}else{e="median";t="q1";i="q3"}u=[{op:t,field:l,as:"lower_"+l},{op:i,field:l,as:"upper_"+l},{op:e,field:l,as:"center_"+l}];f=[{fieldPrefix:"upper_",titlePrefix:a6({field:l,aggregate:i,type:"quantitative"},a,{allowDisabling:false})},{fieldPrefix:"lower_",titlePrefix:a6({field:l,aggregate:t,type:"quantitative"},a,{allowDisabling:false})},{fieldPrefix:"center_",titlePrefix:a6({field:l,aggregate:e,type:"quantitative"},a,{allowDisabling:false})}]}}else{if(e.center||e.extent){Q1(b.errorBarCenterAndExtentAreNotNeeded(e.center,e.extent))}if(o==="aggregated-upper-lower"){f=[];c=[{calculate:`datum["${n.field}"]`,as:"upper_"+l},{calculate:`datum["${l}"]`,as:"lower_"+l}]}else if(o==="aggregated-error"){f=[{fieldPrefix:"",titlePrefix:l}];c=[{calculate:`datum["${l}"] + datum["${i.field}"]`,as:"upper_"+l}];if(r){c.push({calculate:`datum["${l}"] + datum["${r.field}"]`,as:"lower_"+l})}else{c.push({calculate:`datum["${l}"] - datum["${i.field}"]`,as:"lower_"+l})}}for(const e of c){f.push({fieldPrefix:e.as.substring(0,6),titlePrefix:nZ(nZ(e.calculate,'datum["',""),'"]',"")})}}return{postAggregateCalculates:c,errorBarSpecificAggregate:u,tooltipSummary:f,tooltipTitleWithFieldName:d}}function O4(e,t,n){return ZJ(e)+" "+n+" "+t}const j4="errorband";const k4=["band","borders"];const E4=new iQ(j4,A4);function A4(e,{config:t}){e=Object.assign(Object.assign({},e),{encoding:V6(e.encoding,t)});const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:o,markDef:s,outerSpec:a,tooltipEncoding:u}=_4(e,j4,t);const c=s;const l=t4(c,r,i,o,t.errorband);const f=e.encoding.x!==undefined&&e.encoding.y!==undefined;let d={type:f?"area":"rect"};let h={type:f?"line":"rule"};const p=Object.assign(Object.assign({},c.interpolate?{interpolate:c.interpolate}:{}),c.tension&&c.interpolate?{tension:c.tension}:{});if(f){d=Object.assign(Object.assign(Object.assign({},d),p),{ariaRoleDescription:"errorband"});h=Object.assign(Object.assign(Object.assign({},h),p),{aria:false})}else if(c.interpolate){Q1(b.errorBand1DNotSupport("interpolate"))}else if(c.tension){Q1(b.errorBand1DNotSupport("tension"))}return Object.assign(Object.assign({},a),{transform:n,layer:[...l({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u}),...l({partName:"borders",mark:h,positionPrefix:"lower",extraEncoding:u}),...l({partName:"borders",mark:h,positionPrefix:"upper",extraEncoding:u})]})}const D4={};function S4(e,t,n){const i=new iQ(e,t);D4[e]={normalizer:i,parts:n}}function M4(e){delete D4[e]}function C4(){return WJ(D4)}S4(s4,l4,a4);S4(h4,m4,p4);S4(j4,A4,k4);const $4=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"];const F4=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"];const N4={gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35};const T4={aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1};const z4=WJ(T4);const R4="_vgsid_";const B4={single:{on:"click",fields:[R4],resolve:"global",empty:"all",clear:"dblclick"},multi:{on:"click",fields:[R4],toggle:"event.shiftKey",resolve:"global",empty:"all",clear:"dblclick"},interval:{on:"[mousedown, window:mouseup] > window:mousemove!",encodings:["x","y"],translate:"[mousedown, window:mouseup] > window:mousemove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function P4(e){return!!e&&(e==="legend"||!!e.legend)}function I4(e){return P4(e)&&Object(oe["G"])(e)}function L4(e){return q4(e)||W4(e)||U4(e)}function U4(e){return"concat"in e}function q4(e){return"vconcat"in e}function W4(e){return"hconcat"in e}function G4(e){return Object(oe["G"])(e)&&e["step"]!==undefined}function H4(e){return e["view"]||e["width"]||e["height"]}const V4=20;const Y4={align:1,bounds:1,center:1,columns:1,spacing:1};const X4=WJ(Y4);function J4(e,t,n){var i,r;const o=n[t];const s={};const{spacing:a,columns:u}=o;if(a!==undefined){s.spacing=a}if(u!==undefined){if(k5(e)&&!O5(e.facet)||U4(e)){s.columns=u}}if(q4(e)){s.columns=1}for(const c of X4){if(e[c]!==undefined){if(c==="spacing"){const t=e[c];s[c]=Object(oe["F"])(t)?t:{row:(i=t.row)!==null&&i!==void 0?i:a,column:(r=t.column)!==null&&r!==void 0?r:a}}else{s[c]=e[c]}}}return s}function Z4(e,t){var n;return(n=e[t])!==null&&n!==void 0?n:e[t==="width"?"continuousWidth":"continuousHeight"]}function Q4(e,t){const n=K4(e,t);return G4(n)?n.step:e8}function K4(e,t){var n;const i=(n=e[t])!==null&&n!==void 0?n:e[t==="width"?"discreteWidth":"discreteHeight"];return oZ(i,{step:e.step})}const e8=20;const t8={continuousWidth:200,continuousHeight:200,step:e8};function n8(e){return e&&!!e["scheme"]}const i8={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:t8,mark:XZ,arc:{},area:{},bar:QZ,circle:{},geoshape:{},image:{},line:{},point:{},rect:KZ,rule:{color:"black"},square:{},text:{color:"black"},tick:eQ,trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:true,ticks:false},errorband:{band:{opacity:.3},borders:false},scale:M3,projection:{},legend:N4,header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:B4,style:{},title:{},facet:{spacing:V4},concat:{spacing:V4}};const r8=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"];const o8={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12};const s8={blue:r8[0],orange:r8[1],red:r8[2],teal:r8[3],green:r8[4],yellow:r8[5],purple:r8[6],pink:r8[7],brown:r8[8],gray0:"#000",gray1:"#111",gray2:"#222",gray3:"#333",gray4:"#444",gray5:"#555",gray6:"#666",gray7:"#777",gray8:"#888",gray9:"#999",gray10:"#aaa",gray11:"#bbb",gray12:"#ccc",gray13:"#ddd",gray14:"#eee",gray15:"#fff"};function a8(e={}){return{signals:[{name:"color",value:Object(oe["G"])(e)?Object.assign(Object.assign({},s8),e):s8}],mark:{color:{signal:"color.blue"}},rule:{color:{signal:"color.gray0"}},text:{color:{signal:"color.gray0"}},style:{"guide-label":{fill:{signal:"color.gray0"}},"guide-title":{fill:{signal:"color.gray0"}},"group-title":{fill:{signal:"color.gray0"}},"group-subtitle":{fill:{signal:"color.gray0"}},cell:{stroke:{signal:"color.gray8"}}},axis:{domainColor:{signal:"color.gray13"},gridColor:{signal:"color.gray8"},tickColor:{signal:"color.gray13"}},range:{category:[{signal:"color.blue"},{signal:"color.orange"},{signal:"color.red"},{signal:"color.teal"},{signal:"color.green"},{signal:"color.yellow"},{signal:"color.purple"},{signal:"color.pink"},{signal:"color.brown"},{signal:"color.grey8"}]}}}function u8(e){return{signals:[{name:"fontSize",value:Object(oe["G"])(e)?Object.assign(Object.assign({},o8),e):o8}],text:{fontSize:{signal:"fontSize.text"}},style:{"guide-label":{fontSize:{signal:"fontSize.guideLabel"}},"guide-title":{fontSize:{signal:"fontSize.guideTitle"}},"group-title":{fontSize:{signal:"fontSize.groupTitle"}},"group-subtitle":{fontSize:{signal:"fontSize.groupSubtitle"}}}}}function c8(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}function l8(e={}){const{color:t,font:n,fontSize:i}=e,r=HX(e,["color","font","fontSize"]);return Object(oe["O"])({},i8,n?c8(n):{},t?a8(t):{},i?u8(i):{},r||{})}const f8=["view",...PZ];const d8=["color","fontSize","background","padding","facet","concat","numberFormat","timeFormat","countTitle","header","axisQuantitative","axisTemporal","axisDiscrete","axisPoint","axisXBand","axisXPoint","axisXDiscrete","axisXQuantitative","axisXTemporal","axisYBand","axisYPoint","axisYDiscrete","axisYQuantitative","axisYTemporal","scale","selection","overlay"];const h8=Object.assign({view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"]},YZ);function p8(e){e=EJ(e);for(const t of d8){delete e[t]}if(e.axis){for(const t in e.axis){if(pZ(e.axis[t])){delete e.axis[t]}}}if(e.legend){for(const t of $4){delete e.legend[t]}}if(e.mark){for(const t of VZ){delete e.mark[t]}if(e.mark.tooltip&&Object(oe["G"])(e.mark.tooltip)){delete e.mark.tooltip}}for(const t of f8){for(const i of VZ){delete e[t][i]}const n=h8[t];if(n){for(const i of n){delete e[t][i]}}m8(e,t)}for(const t of C4()){delete e[t]}g8(e);for(const t in e){if(Object(oe["G"])(e[t])&&qJ(e[t])){delete e[t]}}return qJ(e)?undefined:e}function g8(e){const{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:i}=E6(e.title);if(!qJ(t)){e.style["group-title"]=Object.assign(Object.assign({},e.style["group-title"]),t)}if(!qJ(n)){e.style["group-subtitle"]=Object.assign(Object.assign({},e.style["group-subtitle"]),n)}if(!qJ(i)){e.title=i}else{delete e.title}}function m8(e,t,n,i){const r=i?e[t][i]:e[t];if(t==="view"){n="cell"}const o=Object.assign(Object.assign({},r),e.style[n!==null&&n!==void 0?n:t]);if(!qJ(o)){e.style[n!==null&&n!==void 0?n:t]=o}if(!i){delete e[t]}}function b8(e){return"layer"in e}function v8(e){return"repeat"in e}function y8(e){return!Object(oe["B"])(e.repeat)&&e.repeat["layer"]}class x8{map(e,t){if(k5(e)){return this.mapFacet(e,t)}else if(v8(e)){return this.mapRepeat(e,t)}else if(W4(e)){return this.mapHConcat(e,t)}else if(q4(e)){return this.mapVConcat(e,t)}else if(U4(e)){return this.mapConcat(e,t)}else{return this.mapLayerOrUnit(e,t)}}mapLayerOrUnit(e,t){if(b8(e)){return this.mapLayer(e,t)}else if(nQ(e)){return this.mapUnit(e,t)}throw new Error(b.invalidSpec(e))}mapLayer(e,t){return Object.assign(Object.assign({},e),{layer:e.layer.map(e=>this.mapLayerOrUnit(e,t))})}mapHConcat(e,t){return Object.assign(Object.assign({},e),{hconcat:e.hconcat.map(e=>this.map(e,t))})}mapVConcat(e,t){return Object.assign(Object.assign({},e),{vconcat:e.vconcat.map(e=>this.map(e,t))})}mapConcat(e,t){const{concat:n}=e,i=HX(e,["concat"]);return Object.assign(Object.assign({},i),{concat:n.map(e=>this.map(e,t))})}mapFacet(e,t){return Object.assign(Object.assign({},e),{spec:this.map(e.spec,t)})}mapRepeat(e,t){return Object.assign(Object.assign({},e),{spec:this.map(e.spec,t)})}}const _8={zero:1,center:1,normalize:1};function w8(e){return e in _8}const O8=new Set([wZ,jZ,OZ,SZ,AZ,FZ,NZ,EZ,MZ,CZ]);const j8=new Set([jZ,OZ,wZ]);function k8(e,t){var n,i;const r=t==="x"?"y":"radius";const o=e[t];const s=e[r];if(z5(o)&&z5(s)){if(R5(o)==="quantitative"&&R5(s)==="quantitative"){if(o.stack){return t}else if(s.stack){return r}const e=z5(o)&&!!o.aggregate;const a=z5(s)&&!!s.aggregate;if(e!==a){return e?t:r}else{const e=(n=o.scale)===null||n===void 0?void 0:n.type;const a=(i=s.scale)===null||i===void 0?void 0:i.type;if(e&&e!=="linear"){return r}else if(a&&a!=="linear"){return t}}}else if(R5(o)==="quantitative"){return t}else if(R5(s)==="quantitative"){return r}}else if(R5(o)==="quantitative"){return t}else if(R5(s)==="quantitative"){return r}return undefined}function E8(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}function A8(e,t,n={}){const i=IZ(e)?e.type:e;if(!O8.has(i)){return null}const r=k8(t,"x")||k8(t,"theta");if(!r){return null}const o=t[r];const s=z5(o)?Z5(o,{}):undefined;let a=E8(r);let u=t[a];let c=z5(u)?Z5(u,{}):undefined;if(c===s){c=undefined;u=undefined;a=undefined}const l=UK.reduce((e,n)=>{if(n!=="tooltip"&&U6(t,n)){const i=t[n];for(const t of Object(oe["i"])(i)){const i=d6(t);if(i.aggregate){continue}const r=Z5(i,{});if(!r||r!==c){e.push({channel:n,fieldDef:i})}}}return e},[]);let f;if(o.stack!==undefined){if(Object(oe["C"])(o.stack)){f=o.stack?"zero":null}else{f=o.stack}}else if(l.length>0&&j8.has(i)){f="zero"}if(!f||!w8(f)){return null}if(q6(t)&&l.length===0){return null}if(o.scale&&o.scale.type&&o.scale.type!==u3.LINEAR){if(n.disallowNonLinearStack){return null}else{Q1(b.cannotStackNonLinearScale(o.scale.type))}}if(U5(t[kK(r)])){if(o.stack!==undefined){Q1(b.cannotStackRangedMark(r))}return null}if(z5(o)&&o.aggregate&&!$J(hQ,o.aggregate)){Q1(b.stackNonSummativeAggregate(o.aggregate))}return{groupbyChannel:u?a:undefined,groupbyField:c,fieldChannel:r,impute:o.impute===null?false:RZ(i),stackBy:l,offset:f}}function D8(e){const{point:t,line:n}=e,i=HX(e,["point","line"]);return WJ(i).length>1?i:i.type}function S8(e){for(const t of["line","area","rule","trail"]){if(e[t]){e=Object.assign(Object.assign({},e),{[t]:DJ(e[t],["point","line"])})}}return e}function M8(e,t={},n){if(e.point==="transparent"){return{opacity:0}}else if(e.point){return Object(oe["G"])(e.point)?e.point:{}}else if(e.point!==undefined){return null}else{if(t.point||n.shape){return Object(oe["G"])(t.point)?t.point:{}}return undefined}}function C8(e,t={}){if(e.line){return e.line===true?{}:e.line}else if(e.line!==undefined){return null}else{if(t.line){return t.line===true?{}:t.line}return undefined}}class $8{constructor(){this.name="path-overlay"}hasMatchingType(e,t){if(nQ(e)){const{mark:n,encoding:i}=e;const r=IZ(n)?n:{type:n};switch(r.type){case"line":case"rule":case"trail":return!!M8(r,t[r.type],i);case"area":return!!M8(r,t[r.type],i)||!!C8(r,t[r.type])}}return false}run(e,t,n){const{config:i}=t;const{selection:r,projection:o,mark:s,encoding:a}=e,u=HX(e,["selection","projection","mark","encoding"]);const c=V6(a,i);const l=IZ(s)?s:{type:s};const f=M8(l,i[l.type],c);const d=l.type==="area"&&C8(l,i[l.type]);const h=[Object.assign(Object.assign({},r?{selection:r}:{}),{mark:D8(Object.assign(Object.assign({},l.type==="area"&&l.opacity===undefined&&l.fillOpacity===undefined?{opacity:.7}:{}),l)),encoding:DJ(c,["shape"])})];const p=A8(l,c);let g=c;if(p){const{fieldChannel:e,offset:t}=p;g=Object.assign(Object.assign({},c),{[e]:Object.assign(Object.assign({},c[e]),t?{stack:t}:{})})}if(d){h.push(Object.assign(Object.assign({},o?{projection:o}:{}),{mark:Object.assign(Object.assign({type:"line"},AJ(l,["clip","interpolate","tension","tooltip"])),d),encoding:g}))}if(f){h.push(Object.assign(Object.assign({},o?{projection:o}:{}),{mark:Object.assign(Object.assign({type:"point",opacity:1,filled:true},AJ(l,["clip","tooltip"])),f),encoding:g}))}return n(Object.assign(Object.assign({},u),{layer:h}),Object.assign(Object.assign({},t),{config:S8(i)}))}}class F8{constructor(){this.name="RangeStep"}hasMatchingType(e){var t;if(nQ(e)&&e.encoding){for(const n of WK){const i=e.encoding[n];if(i&&U5(i)){if((t=i===null||i===void 0?void 0:i.scale)===null||t===void 0?void 0:t["rangeStep"]){return true}}}}return false}run(e){var t;const n={};let i=Object.assign({},e.encoding);for(const r of WK){const e=EK(r);const o=i[r];if(o&&U5(o)){if((t=o===null||o===void 0?void 0:o.scale)===null||t===void 0?void 0:t["rangeStep"]){const{scale:t}=o,s=HX(o,["scale"]);const a=t,{rangeStep:u}=a,c=HX(a,["rangeStep"]);n[e]={step:t["rangeStep"]};Q1(b.RANGE_STEP_DEPRECATED);i=Object.assign(Object.assign({},i),{[r]:Object.assign(Object.assign({},s),qJ(c)?{}:{scale:c})})}}}return Object.assign(Object.assign(Object.assign({},n),e),{encoding:i})}}function N8(e,t){if(!t){return e}if(O5(e)){return I8(e,t)}return R8(e,t)}function T8(e,t){if(!t){return e}return I8(e,t)}function z8(e,t,n){const i=t[e];if(A5(i)){if(i.repeat in n){return Object.assign(Object.assign({},t),{[e]:n[i.repeat]})}else{Q1(b.noSuchRepeatedValue(i.repeat));return undefined}}return t}function R8(e,t){e=z8("field",e,t);if(e===undefined){return undefined}else if(e===null){return null}if(S5(e)&&_5(e.sort)){const n=z8("field",e.sort,t);e=Object.assign(Object.assign({},e),n?{sort:n}:{})}return e}function B8(e,t){if(z5(e)){return R8(e,t)}else{const n=z8("datum",e,t);if(n!==e&&!n.type){n.type="nominal"}return n}}function P8(e,t){if(U5(e)){const n=B8(e,t);if(n){return n}else if($5(e)){return{condition:e.condition}}}else{if(N5(e)){const n=B8(e.condition,t);if(n){return Object.assign(Object.assign({},e),{condition:n})}else{const{condition:t}=e,n=HX(e,["condition"]);return n}}return e}return undefined}function I8(e,t){const n={};for(const i in e){if(Object(oe["w"])(e,i)){const r=e[i];if(Object(oe["B"])(r)){n[i]=r.map(e=>P8(e,t)).filter(e=>e)}else{const e=P8(r,t);if(e!==undefined){n[i]=e}}}}return n}class L8{constructor(){this.name="RuleForRangedLine"}hasMatchingType(e){if(nQ(e)){const{encoding:t,mark:n}=e;if(n==="line"){for(const e of _K){const n=OK(e);const i=t[n];if(t[e]){if(z5(i)&&!v0(i.bin)||B5(i)){return true}}}}}return false}run(e,t,n){const{encoding:i}=e;Q1(b.lineWithRange(!!i.x2,!!i.y2));return n(Object.assign(Object.assign({},e),{mark:"rule"}),t)}}class U8 extends x8{constructor(){super(...arguments);this.nonFacetUnitNormalizers=[u4,g4,E4,new $8,new L8,new F8]}map(e,t){if(nQ(e)){const n=U6(e.encoding,mQ);const i=U6(e.encoding,bQ);const r=U6(e.encoding,vQ);if(n||i||r){return this.mapFacetedUnit(e,t)}}return super.map(e,t)}mapUnit(e,t){const{parentEncoding:n,parentProjection:i}=t;const r=T8(e.encoding,t.repeater);const o=Object.assign(Object.assign({},e),r?{encoding:r}:{});if(n||i){return this.mapUnitWithParentEncodingOrProjection(o,t)}const s=this.mapLayerOrUnit.bind(this);for(const a of this.nonFacetUnitNormalizers){if(a.hasMatchingType(o,t.config)){return a.run(o,t,s)}}return o}mapRepeat(e,t){if(y8(e)){return this.mapLayerRepeat(e,t)}else{return this.mapNonLayerRepeat(e,t)}}mapLayerRepeat(e,t){const{repeat:n,spec:i}=e,r=HX(e,["repeat","spec"]);const{row:o,column:s,layer:a}=n;const{repeater:u={},repeaterPrefix:c=""}=t;if(o||s){return this.mapRepeat(Object.assign(Object.assign({},e),{repeat:Object.assign(Object.assign({},o?{row:o}:{}),s?{column:s}:{}),spec:{repeat:{layer:a},spec:i}}),t)}else{return Object.assign(Object.assign({},r),{layer:a.map(e=>{const n=Object.assign(Object.assign({},u),{layer:e});const r=(i.name||"")+c+`child__layer_${YJ(e)}`;const o=this.mapLayerOrUnit(i,Object.assign(Object.assign({},t),{repeater:n,repeaterPrefix:r}));o.name=r;return o})})}}mapNonLayerRepeat(e,t){var n;const{repeat:i,spec:r,data:o}=e,s=HX(e,["repeat","spec","data"]);if(!Object(oe["B"])(i)&&e.columns){e=DJ(e,["columns"]);Q1(b.columnsNotSupportByRowCol("repeat"))}const a=[];const{repeater:u={},repeaterPrefix:c=""}=t;const l=!Object(oe["B"])(i)&&i.row||[u?u.row:null];const f=!Object(oe["B"])(i)&&i.column||[u?u.column:null];const d=Object(oe["B"])(i)&&i||[u?u.repeat:null];for(const p of d){for(const e of l){for(const n of f){const o={repeat:p,row:e,column:n,layer:u.layer};const s=(r.name||"")+c+"child__"+(Object(oe["B"])(i)?`${YJ(p)}`:(i.row?`row_${YJ(e)}`:"")+(i.column?`column_${YJ(n)}`:""));const l=this.map(r,Object.assign(Object.assign({},t),{repeater:o,repeaterPrefix:s}));l.name=s;a.push(DJ(l,["data"]))}}}const h=Object(oe["B"])(i)?e.columns:i.column?i.column.length:1;return Object.assign(Object.assign({data:(n=r.data)!==null&&n!==void 0?n:o,align:"all"},s),{columns:h,concat:a})}mapFacet(e,t){const{facet:n}=e;if(O5(n)&&e.columns){e=DJ(e,["columns"]);Q1(b.columnsNotSupportByRowCol("facet"))}return super.mapFacet(e,t)}mapUnitWithParentEncodingOrProjection(e,t){const{encoding:n,projection:i}=e;const{parentEncoding:r,parentProjection:o,config:s}=t;const a=W8({parentProjection:o,projection:i});const u=q8({parentEncoding:r,encoding:T8(n,t.repeater)});return this.mapUnit(Object.assign(Object.assign(Object.assign({},e),a?{projection:a}:{}),u?{encoding:u}:{}),{config:s})}mapFacetedUnit(e,t){const n=e.encoding,{row:i,column:r,facet:o}=n,s=HX(n,["row","column","facet"]);const{mark:a,width:u,projection:c,height:l,view:f,selection:d,encoding:h}=e,p=HX(e,["mark","width","projection","height","view","selection","encoding"]);const{facetMapping:g,layout:m}=this.getFacetMappingAndLayout({row:i,column:r,facet:o},t);const b=T8(s,t.repeater);return this.mapFacet(Object.assign(Object.assign(Object.assign({},p),m),{facet:g,spec:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},u?{width:u}:{}),l?{height:l}:{}),f?{view:f}:{}),c?{projection:c}:{}),{mark:a,encoding:b}),d?{selection:d}:{})}),t)}getFacetMappingAndLayout(e,t){var n;const{row:i,column:r,facet:o}=e;if(i||r){if(o){Q1(b.facetChannelDropped([...i?[mQ]:[],...r?[bQ]:[]]))}const t={};const s={};for(const i of[mQ,bQ]){const r=e[i];if(r){const{align:e,center:o,spacing:a,columns:u}=r,c=HX(r,["align","center","spacing","columns"]);t[i]=c;for(const t of["align","center","spacing"]){if(r[t]!==undefined){s[t]=(n=s[t])!==null&&n!==void 0?n:{};s[t][i]=r[t]}}}}return{facetMapping:t,layout:s}}else{const{align:e,center:n,spacing:i,columns:r}=o,s=HX(o,["align","center","spacing","columns"]);return{facetMapping:N8(s,t.repeater),layout:Object.assign(Object.assign(Object.assign(Object.assign({},e?{align:e}:{}),n?{center:n}:{}),i?{spacing:i}:{}),r?{columns:r}:{})}}}mapLayer(e,t){var{parentEncoding:n,parentProjection:i}=t,r=HX(t,["parentEncoding","parentProjection"]);const{encoding:o,projection:s}=e,a=HX(e,["encoding","projection"]);const u=Object.assign(Object.assign({},r),{parentEncoding:q8({parentEncoding:n,encoding:o,layer:true}),parentProjection:W8({parentProjection:i,projection:s})});return super.mapLayer(a,u)}}function q8({parentEncoding:e,encoding:t={},layer:n}){let i={};if(e){const r=new Set([...WJ(e),...WJ(t)]);for(const o of r){const r=t[o];const s=e[o];if(U5(r)){const e=Object.assign(Object.assign({},s),r);i[o]=e}else if(N5(r)){i[o]=Object.assign(Object.assign({},r),{condition:Object.assign(Object.assign({},s),r.condition)})}else if(r||r===null){i[o]=r}else if(n||W5(s)||S2(s)||U5(s)||Object(oe["B"])(s)){i[o]=s}}}else{i=t}return!i||qJ(i)?undefined:i}function W8(e){const{parentProjection:t,projection:n}=e;if(t&&n){Q1(b.projectionOverridden({parentProjection:t,projection:n}))}return n!==null&&n!==void 0?n:t}function G8(e,t){if(t===undefined){t=l8(e.config)}const n=V8(e,t);const{width:i,height:r}=e;const o=X8(n,{width:i,height:r,autosize:e.autosize},t);return Object.assign(Object.assign({},n),o?{autosize:o}:{})}const H8=new U8;function V8(e,t={}){return H8.map(e,{config:t})}function Y8(e){return Object(oe["I"])(e)?{type:e}:e!==null&&e!==void 0?e:{}}function X8(e,t,n){let{width:i,height:r}=t;const o=nQ(e)||b8(e);const s={};if(!o){if(i=="container"){Q1(b.containerSizeNonSingle("width"));i=undefined}if(r=="container"){Q1(b.containerSizeNonSingle("height"));r=undefined}}else{if(i=="container"&&r=="container"){s.type="fit";s.contains="padding"}else if(i=="container"){s.type="fit-x";s.contains="padding"}else if(r=="container"){s.type="fit-y";s.contains="padding"}}const a=Object.assign(Object.assign(Object.assign({type:"pad"},s),n?Y8(n.autosize):{}),Y8(e.autosize));if(a.type==="fit"&&!o){Q1(b.FIT_NON_SINGLE);a.type="pad"}if(i=="container"&&!(a.type=="fit"||a.type=="fit-x")){Q1(b.containerSizeNotCompatibleWithAutosize("width"))}if(r=="container"&&!(a.type=="fit"||a.type=="fit-y")){Q1(b.containerSizeNotCompatibleWithAutosize("height"))}if(kJ(a,{type:"pad"})){return undefined}return a}function J8(e){return e==="fit"||e==="fit-x"||e==="fit-y"}function Z8(e){return e?`fit-${YK(e)}`:"fit"}const Q8=["background","padding"];function K8(e){return Q8.reduce((t,n)=>{if(e&&e[n]!==undefined){t[n]=e[n]}return t},{})}class e9{constructor(e={},t={}){this.explicit=e;this.implicit=t}clone(){return new e9(EJ(this.explicit),EJ(this.implicit))}combine(){return Object.assign(Object.assign({},this.explicit),this.implicit)}get(e){return oZ(this.explicit[e],this.implicit[e])}getWithExplicit(e){if(this.explicit[e]!==undefined){return{explicit:true,value:this.explicit[e]}}else if(this.implicit[e]!==undefined){return{explicit:false,value:this.implicit[e]}}return{explicit:false,value:undefined}}setWithExplicit(e,t){if(t.value!==undefined){this.set(e,t.value,t.explicit)}}set(e,t,n){delete this[n?"implicit":"explicit"][e];this[n?"explicit":"implicit"][e]=t;return this}copyKeyFromSplit(e,t){if(t.explicit[e]!==undefined){this.set(e,t.explicit[e],true)}else if(t.implicit[e]!==undefined){this.set(e,t.implicit[e],false)}}copyKeyFromObject(e,t){if(t[e]!==undefined){this.set(e,t[e],true)}}copyAll(e){for(const t of WJ(e.combine())){const n=e.getWithExplicit(t);this.setWithExplicit(t,n)}}}function t9(e){return{explicit:true,value:e}}function n9(e){return{explicit:false,value:e}}function i9(e){return(t,n,i,r)=>{const o=e(t.value,n.value);if(o>0){return t}else if(o<0){return n}return r9(t,n,i,r)}}function r9(e,t,n,i){if(e.explicit&&t.explicit){Q1(b.mergeConflictingProperty(n,i,e.value,t.value))}return e}function o9(e,t,n,i,r=r9){if(e===undefined||e.value===undefined){return t}if(e.explicit&&!t.explicit){return e}else if(t.explicit&&!e.explicit){return t}else if(kJ(e.value,t.value)){return e}else{return r(e,t,n,i)}}class s9 extends e9{constructor(e={},t={},n=false){super(e,t);this.explicit=e;this.implicit=t;this.parseNothing=n}clone(){const e=super.clone();e.parseNothing=this.parseNothing;return e}}function a9(e){return"url"in e}function u9(e){return"values"in e}function c9(e){return"name"in e&&!a9(e)&&!u9(e)&&!l9(e)}function l9(e){return e&&(f9(e)||d9(e)||h9(e))}function f9(e){return"sequence"in e}function d9(e){return"sphere"in e}function h9(e){return"graticule"in e}var p9;(function(e){e[e["Raw"]=0]="Raw";e[e["Main"]=1]="Main";e[e["Row"]=2]="Row";e[e["Column"]=3]="Column";e[e["Lookup"]=4]="Lookup"})(p9||(p9={}));function g9(e){return"filter"in e}function m9(e){return(e===null||e===void 0?void 0:e["stop"])!==undefined}function b9(e){return"lookup"in e}function v9(e){return"data"in e}function y9(e){return"selection"in e}function x9(e){return"pivot"in e}function _9(e){return"density"in e}function w9(e){return"quantile"in e}function O9(e){return"regression"in e}function j9(e){return"loess"in e}function k9(e){return"sample"in e}function E9(e){return"window"in e}function A9(e){return"joinaggregate"in e}function D9(e){return"flatten"in e}function S9(e){return"calculate"in e}function M9(e){return"bin"in e}function C9(e){return"impute"in e}function $9(e){return"timeUnit"in e}function F9(e){return"aggregate"in e}function N9(e){return"stack"in e}function T9(e){return"fold"in e}function z9(e){return e.map(e=>{if(g9(e)){return{filter:jJ(e.filter,Q2)}}return e})}function R9(e,t,n,i){const r=$5(t)&&t.condition;const o=i(t);if(r){const t=Object(oe["i"])(r);const s=t.map(t=>{const n=i(t);const r=E5(t)?Bee(e,t.selection):Lee(e,t.test);return Object.assign({test:r},n)});return{[n]:[...s,...o!==undefined?[o]:[]]}}else{return o!==undefined?{[n]:o}:{}}}function B9(e,t="text"){const n=e.encoding[t];return R9(e,n,t,t=>P9(t,e.config))}function P9(e,t,n="datum"){if(e){if(W5(e)){return S6(e.value)}if(U5(e)){const{format:i,formatType:r}=l6(e);return s5({fieldOrDatumDef:e,format:i,formatType:r,expr:n,config:t})}}return undefined}function I9(e,t={}){const{encoding:n,markDef:i,config:r,stack:o}=e;const s=n.tooltip;if(Object(oe["B"])(s)){return{tooltip:U9({tooltip:s},o,r,t)}}else{const a=t.reactiveGeom?"datum.datum":"datum";return R9(e,s,"tooltip",e=>{const s=P9(e,r,a);if(s){return s}if(e===null){return undefined}let u=N6("tooltip",i,r);if(u===true){u={content:"encoding"}}if(Object(oe["I"])(u)){return{value:u}}else if(Object(oe["G"])(u)){if(S2(u)){return u}else if(u.content==="encoding"){return U9(n,o,r,t)}else{return{signal:a}}}return undefined})}}function L9(e,t,n,{reactiveGeom:i}={}){const r={};const o=i?"datum.datum":"datum";const s=[];function a(i,a){const u=OK(a);const c=q5(i)?i:Object.assign(Object.assign({},i),{type:e[u].type});const l=c.title||c6(c,n);const f=Object(oe["i"])(l).join(", ");let d;if(GK(a)){const i=a==="x"?"x2":"y2";const s=d6(e[i]);if(v0(c.bin)&&s){const e=Z5(c,{expr:o});const t=Z5(s,{expr:o});const{format:a,formatType:u}=l6(c);d=g5(e,t,a,u,n);r[i]=true}else if(t&&t.fieldChannel===a&&t.offset==="normalize"){const{format:e,formatType:t}=l6(c);d=s5({fieldOrDatumDef:c,format:e,formatType:t,expr:o,config:n,normalizeStack:true}).signal}}d=d!==null&&d!==void 0?d:P9(c,n,o).signal;s.push({channel:a,key:f,value:d})}X6(e,(e,t)=>{if(z5(e)){a(e,t)}else if(F5(e)){a(e.condition,t)}});const u={};for(const{channel:c,key:l,value:f}of s){if(!r[c]&&!u[l]){u[l]=f}}return u}function U9(e,t,n,{reactiveGeom:i}={}){const r=L9(e,t,n,{reactiveGeom:i});const o=HJ(r).map(([e,t])=>`"${e}": ${t}`);return o.length>0?{signal:`{${o.join(", ")}}`}:undefined}function q9(e){const{markDef:t,config:n}=e;const i=N6("aria",t,n);if(i===false){return{}}return Object.assign(Object.assign(Object.assign({},i?{aria:i}:{}),W9(e)),G9(e))}function W9(e){const{mark:t,markDef:n,config:i}=e;if(i.aria===false){return{}}const r=N6("ariaRoleDescription",n,i);if(r!=null){return{ariaRoleDescription:{value:r}}}return t in z2?{}:{ariaRoleDescription:{value:t}}}function G9(e){const{encoding:t,markDef:n,config:i,stack:r}=e;const o=t.description;if(o){return R9(e,o,"description",t=>P9(t,e.config))}const s=N6("description",n,i);if(s!=null){return{description:S6(s)}}if(i.aria===false){return{}}const a=L9(t,r,i);if(qJ(a)){return undefined}return{description:{signal:HJ(a).map(([e,t],n)=>`"${n>0?"; ":""}${e}: " + (${t})`).join(" + ")}}}function H9(e,t,n={}){const{markDef:i,encoding:r,config:o}=t;const{vgChannel:s}=n;let{defaultRef:a,defaultValue:u}=n;if(a===undefined){u=u!==null&&u!==void 0?u:N6(e,i,o,{vgChannel:s,ignoreVgConfig:true});if(u!==undefined){a=S6(u)}}const c=r[e];return R9(t,c,s!==null&&s!==void 0?s:e,n=>t5({channel:e,channelDef:n,markDef:i,config:o,scaleName:t.scaleName(e),scale:t.getScaleComponent(e),stack:null,defaultRef:a}))}function V9(e,t={filled:undefined}){var n,i,r,o;const{markDef:s,encoding:a,config:u}=e;const{type:c}=s;const l=(n=t.filled)!==null&&n!==void 0?n:N6("filled",s,u);const f=$J(["bar","point","circle","square","geoshape"],c)?"transparent":undefined;const d=(r=(i=N6(l===true?"color":undefined,s,u,{vgChannel:"fill"}))!==null&&i!==void 0?i:u.mark[l===true&&"color"])!==null&&r!==void 0?r:f;const h=(o=N6(l===false?"color":undefined,s,u,{vgChannel:"stroke"}))!==null&&o!==void 0?o:u.mark[l===false&&"color"];const p=l?"fill":"stroke";const g=Object.assign(Object.assign({},d?{fill:S6(d)}:{}),h?{stroke:S6(h)}:{});if(s.color&&(l?s.fill:s.stroke)){Q1(b.droppingColor("property",{fill:"fill"in s,stroke:"stroke"in s}))}return Object.assign(Object.assign(Object.assign(Object.assign({},g),H9("color",e,{vgChannel:p,defaultValue:l?d:h})),H9("fill",e,{defaultValue:a.fill?d:undefined})),H9("stroke",e,{defaultValue:a.stroke?h:undefined}))}function Y9(e){const{encoding:t,mark:n}=e;const i=t.order;if(!RZ(n)&&W5(i)){return R9(e,i,"zindex",e=>e)}return{}}function X9(e,t){const n=AK(e);const i=t[n];if(i){return i}return undefined}function J9(e,t,{defaultPos:n,vgChannel:i,isMidPoint:r}){const{encoding:o,markDef:s,config:a,stack:u}=t;const c=o[e];const l=o[kK(e)];const f=t.scaleName(e);const d=t.getScaleComponent(e);const h=X9(e,s);const p=Q9({model:t,defaultPos:n,channel:e,scaleName:f,scale:d});const g=!c&&GK(e)&&(o.latitude||o.longitude)?{field:t.getName(e)}:Z9({channel:e,channelDef:c,channel2Def:l,markDef:s,config:a,isMidPoint:r,scaleName:f,scale:d,stack:u,offset:h,defaultRef:p});return g?{[i||e]:g}:undefined}function Z9(e){const{channel:t,channelDef:n,isMidPoint:i,scaleName:r,stack:o,offset:s,markDef:a,config:u}=e;if(U5(n)&&o&&t===o.fieldChannel){if(z5(n)){const e=M5({channel:t,fieldDef:n,isMidPoint:i,markDef:a,stack:o,config:u});if(e!==undefined){return e5({scaleName:r,fieldOrDatumDef:n,startSuffix:"start",band:e,offset:s})}}return K3(n,r,{suffix:"end"},{offset:s})}return Y3(e)}function Q9({model:e,defaultPos:t,channel:n,scaleName:i,scale:r}){const{markDef:o,config:s}=e;return()=>{const a=OK(n);const u=jK(n);const c=N6(n,o,s,{vgChannel:u});if(c!==undefined){return n5(n,c)}switch(t){case"zeroOrMin":case"zeroOrMax":if(i){const e=r.get("type");if($J([u3.LOG,u3.TIME,u3.UTC],e)){}else{if(r.domainDefinitelyIncludesZero()){return{scale:i,value:0}}}}if(t==="zeroOrMin"){return a==="y"?{field:{group:"height"}}:{value:0}}else{switch(a){case"radius":return{signal:`min(${e.width.signal},${e.height.signal})/2`};case"theta":return{signal:"2*PI"};case"x":return{field:{group:"width"}};case"y":return{value:0}}}break;case"mid":{const t=e[EK(n)];return Object.assign(Object.assign({},t),{mult:.5})}}return undefined}}const K9={left:"x",center:"xc",right:"x2"};const e7={top:"y",middle:"yc",bottom:"y2"};function t7(e,t,n,i="middle"){if(e==="radius"||e==="theta"){return jK(e)}const r=e==="x"?"align":"baseline";const o=N6(r,t,n);if(e==="x"){return K9[o||(i==="top"?"left":"center")]}else{return e7[o||i]}}function n7(e,t,{defaultPos:n,defaultPos2:i,range:r}){if(r){return i7(e,t,{defaultPos:n,defaultPos2:i})}return J9(e,t,{defaultPos:n})}function i7(e,t,{defaultPos:n,defaultPos2:i}){const{markDef:r,config:o}=t;const s=kK(e);const a=EK(e);const u=r7(t,i,s);const c=u[a]?t7(e,r,o):jK(e);return Object.assign(Object.assign({},J9(e,t,{defaultPos:n,vgChannel:c})),u)}function r7(e,t,n){const{encoding:i,mark:r,markDef:o,stack:s,config:a}=e;const u=OK(n);const c=EK(n);const l=jK(n);const f=i[u];const d=e.scaleName(u);const h=e.getScaleComponent(u);const p=n in i||n in o?X9(n,e.markDef):X9(u,e.markDef);if(!f&&(n==="x2"||n==="y2")&&(i.latitude||i.longitude)){return{[l]:{field:e.getName(n)}}}const g=o7({channel:n,channelDef:f,channel2Def:i[n],markDef:o,config:a,scaleName:d,scale:h,stack:s,offset:p,defaultRef:undefined});if(g!==undefined){return{[l]:g}}return s7(n,o)||s7(n,{[n]:z6(n,o,a.style),[c]:z6(c,o,a.style)})||s7(n,a[r])||s7(n,a.mark)||{[l]:Q9({model:e,defaultPos:t,channel:n,scaleName:d,scale:h})()}}function o7({channel:e,channelDef:t,channel2Def:n,markDef:i,config:r,scaleName:o,scale:s,stack:a,offset:u,defaultRef:c}){if(U5(t)&&a&&e.charAt(0)===a.fieldChannel.charAt(0)){return K3(t,o,{suffix:"start"},{offset:u})}return Y3({channel:e,channelDef:n,scaleName:o,scale:s,stack:a,markDef:i,config:r,offset:u,defaultRef:c})}function s7(e,t){const n=EK(e);const i=jK(e);if(t[i]!==undefined){return{[i]:n5(e,t[i])}}else if(t[e]!==undefined){return{[i]:n5(e,t[e])}}else if(t[n]){return{[n]:n5(e,t[n])}}return undefined}function a7(e,t,n){var i,r,o,s;const{config:a,encoding:u,markDef:c,stack:l}=e;const f=kK(t);const d=EK(t);const h=u[t];const p=u[f];const g=e.getScaleComponent(t);const m=g?g.get("type"):undefined;const b=e.scaleName(t);const v=c.orient;const y=(r=(i=u[d])!==null&&i!==void 0?i:u.size)!==null&&r!==void 0?r:N6("size",c,a,{vgChannel:d});const x=n==="bar"&&(t==="x"?v==="vertical":v==="horizontal");if(z5(h)&&(b0(h.bin)||v0(h.bin)||h.timeUnit&&!p)&&!y&&!E3(m)){const n=M5({channel:t,fieldDef:h,stack:l,markDef:c,config:a});const i=(o=e.component.axes[t])===null||o===void 0?void 0:o[0];const r=(s=i===null||i===void 0?void 0:i.get("translate"))!==null&&s!==void 0?s:.5;return f7({fieldDef:h,fieldDef2:p,channel:t,markDef:c,scaleName:b,band:n,axisTranslate:r,spacing:GK(t)?N6("binSpacing",c,a):undefined,reverse:g.get("reverse"),config:a})}else if((U5(h)&&E3(m)||x)&&!p){return c7(n,h,t,e)}else{return i7(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}}function u7(e,t,n,i,r,o){if(i){const t=i.get("type");if(t==="point"||t==="band"){if(r[e].discreteBandSize!==undefined){return{value:r[e].discreteBandSize}}if(t===u3.POINT){const e=i.get("range");if(M2(e)&&Object(oe["F"])(e.step)){return{value:e.step-2}}return{value:e8-2}}else{return{scale:n,band:o}}}else{return{value:r[e].continuousBandSize}}}const s=Q4(r.view,t);const a=oZ(r[e].discreteBandSize,s-2);return a!==undefined?{value:a}:undefined}function c7(e,t,n,i){var r;const{markDef:o,encoding:s,config:a,stack:u}=i;const c=o.orient;const l=i.scaleName(n);const f=i.getScaleComponent(n);const d=EK(n);const h=kK(n);const p=c==="horizontal"&&n==="y"||c==="vertical"&&n==="x";const g=N6(p?"size":d,o,a,{vgChannel:d});let m;if(s.size||g!==undefined){if(p){m=H9("size",i,{vgChannel:d,defaultValue:g})}else{Q1(b.cannotApplySizeToNonOrientedMark(o.type))}}const v=(r=U5(t)?M5({channel:n,fieldDef:t,markDef:o,stack:u,config:a}):undefined)!==null&&r!==void 0?r:1;m=m||{[d]:u7(e,d,l,f,a,v)};const y=(f===null||f===void 0?void 0:f.get("type"))!=="band"||!("band"in m[d]);const x=t7(n,o,a,y?"middle":"top");const _=X9(n,o);const w=Y3({channel:n,channelDef:t,markDef:o,config:a,scaleName:l,scale:f,stack:u,offset:_,defaultRef:Q9({model:i,defaultPos:"mid",channel:n,scaleName:l,scale:f}),band:y?.5:(1-v)/2});if(d){return Object.assign({[x]:w},m)}else{const e=jK(h);const t=m[d];const n=_?Object.assign(Object.assign({},t),{offset:_}):t;return{[x]:w,[e]:Object(oe["B"])(w)?[w[0],Object.assign(Object.assign({},w[1]),{offset:n})]:Object.assign(Object.assign({},w),{offset:n})}}}function l7(e,t,n,i,r){if(QQ(e)){return 0}const o=e==="x"||e==="y2"?-t/2:t/2;if(S2(n)||S2(r)||S2(i)){const e=C6(n);const t=C6(r);const s=C6(i);const a=s?`${s} + `:"";const u=e?`(${e} ? -1 : 1) * `:"";const c=t?`(${t} + ${o})`:o;return{signal:a+u+c}}else{r=r||0;return i+(n?-r-o:+r+o)}}function f7({fieldDef:e,fieldDef2:t,channel:n,band:i,scaleName:r,markDef:o,spacing:s=0,axisTranslate:a,reverse:u,config:c}){const l=kK(n);const f=jK(n);const d=jK(l);const h=X9(n,o);if(b0(e.bin)||e.timeUnit){return{[d]:d7({channel:n,fieldDef:e,scaleName:r,markDef:o,band:(1-i)/2,offset:l7(l,s,u,a,h),config:c}),[f]:d7({channel:n,fieldDef:e,scaleName:r,markDef:o,band:1-(1-i)/2,offset:l7(n,s,u,a,h),config:c})}}else if(v0(e.bin)){const i=K3(e,r,{},{offset:l7(l,s,u,a,h)});if(z5(t)){return{[d]:i,[f]:K3(t,r,{},{offset:l7(n,s,u,a,h)})}}else if(y0(e.bin)&&e.bin.step){return{[d]:i,[f]:{signal:`scale("${r}", ${Z5(e,{expr:"datum"})} + ${e.bin.step})`,offset:l7(n,s,u,a,h)}}}}Q1(b.channelRequiredForBinned(l));return undefined}function d7({channel:e,fieldDef:t,scaleName:n,markDef:i,band:r,offset:o,config:s}){const a=e5({scaleName:n,fieldOrDatumDef:t,band:r,offset:o});return X3({fieldDef:t,channel:e,markDef:i,ref:a,config:s})}const h7=new Set(["aria"]);function p7(e,t){const{fill:n=undefined,stroke:i=undefined}=t.color==="include"?V9(e):{};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},m7(e.markDef,t)),g7(e,"fill",n)),g7(e,"stroke",i)),H9("opacity",e)),H9("fillOpacity",e)),H9("strokeOpacity",e)),H9("strokeWidth",e)),H9("strokeDash",e)),Y9(e)),I9(e)),B9(e,"href")),q9(e))}function g7(e,t,n){const{config:i,mark:r,markDef:o}=e;const s=N6("invalid",o,i);if(s==="hide"&&n&&!RZ(r)){const i=b7(e,{invalid:true,channels:u0});if(i){return{[t]:[{test:i,value:null},...Object(oe["i"])(n)]}}}return n?{[t]:n}:{}}function m7(e,t){return T2.reduce((n,i)=>{if(!h7.has(i)&&e[i]!==undefined&&t[i]!=="ignore"){n[i]=S6(e[i])}return n},{})}function b7(e,{invalid:t=false,channels:n}){const i=n.reduce((t,n)=>{const i=e.getScaleComponent(n);if(i){const r=i.get("type");const o=e.vgField(n,{expr:"datum"});if(o&&A3(r)){t[o]=true}}return t},{});const r=WJ(i);if(r.length>0){const e=t?"||":"&&";return r.map(e=>Z3(e,t)).join(` ${e} `)}return undefined}function v7(e){const{config:t,markDef:n}=e;const i=N6("invalid",n,t);if(i){const t=y7(e,{channels:WK});if(t){return{defined:{signal:t}}}}return{}}function y7(e,{invalid:t=false,channels:n}){const i=n.reduce((t,n)=>{const i=e.getScaleComponent(n);if(i){const r=i.get("type");const o=e.vgField(n,{expr:"datum"});if(o&&A3(r)){t[o]=true}}return t},{});const r=WJ(i);if(r.length>0){const e=t?"||":"&&";return r.map(e=>Z3(e,t)).join(` ${e} `)}return undefined}function x7(e,t){if(t!==undefined){return{[e]:S6(t)}}return undefined}const _7="voronoi";const w7={has:e=>e.type!=="interval"&&e.nearest,parse:(e,t)=>{if(t.events){for(const n of t.events){n.markname=e.getName(_7)}}},marks:(e,t,n)=>{const{x:i,y:r}=t.project.hasChannel;const o=e.mark;if(RZ(o)){Q1(b.nearestNotSupportForContinuous(o));return n}const s={name:e.getName(_7),type:"path",interactive:true,from:{data:e.getName("marks")},encode:{update:Object.assign({fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:true}},I9(e,{reactiveGeom:true}))},transform:[{type:"voronoi",x:{expr:i||!r?"datum.datum.x || 0":"0"},y:{expr:r||!i?"datum.datum.y || 0":"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]};let a=0;let u=false;n.forEach((t,n)=>{var i;const r=(i=t.name)!==null&&i!==void 0?i:"";if(r===e.component.mark[0].name){a=n}else if(r.indexOf(_7)>=0){u=true}});if(!u){n.splice(a+1,0,s)}return n}};var O7=w7;class j7{constructor(e,t){this.debugName=t;this._children=[];this._parent=null;if(e){this.parent=e}}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(e){this._parent=e;if(e){e.addChild(this)}}get children(){return this._children}numChildren(){return this._children.length}addChild(e,t){if(this._children.indexOf(e)>-1){Q1(b.ADD_SAME_CHILD_TWICE);return}if(t!==undefined){this._children.splice(t,0,e)}else{this._children.push(e)}}removeChild(e){const t=this._children.indexOf(e);this._children.splice(t,1);return t}remove(){let e=this._parent.removeChild(this);for(const t of this._children){t._parent=this._parent;this._parent.addChild(t,e++)}}insertAsParentOf(e){const t=e.parent;t.removeChild(this);this.parent=t;e.parent=this}swapWithParent(){const e=this._parent;const t=e.parent;for(const n of this._children){n.parent=e}this._children=[];e.removeChild(this);e.parent.removeChild(e);this.parent=t;e.parent=this}}class k7 extends j7{constructor(e,t,n,i){super(e,t);this.type=n;this.refCounts=i;this._source=this._name=t;if(this.refCounts&&!(this._name in this.refCounts)){this.refCounts[this._name]=0}}clone(){const e=new this.constructor;e.debugName="clone_"+this.debugName;e._source=this._source;e._name="clone_"+this._name;e.type=this.type;e.refCounts=this.refCounts;e.refCounts[e._name]=0;return e}dependentFields(){return new Set}producedFields(){return new Set}hash(){if(this._hash===undefined){this._hash=`Output ${aZ()}`}return this._hash}getSource(){this.refCounts[this._name]++;return this._source}isRequired(){return!!this.refCounts[this._name]}setSource(e){this._source=e}}class E7 extends j7{constructor(e,t){super(e);this.formula=t}clone(){return new E7(null,EJ(this.formula))}static makeFromEncoding(e,t){const n=t.reduceFieldDef((e,n,i)=>{const{field:r,timeUnit:o}=n;const s=Sre(t)?t.encoding[kK(i)]:undefined;const a=Sre(t)&&C5(i,n,s,t.stack,t.markDef,t.config);if(o){const t=Z5(n,{forAs:true});e[MJ({as:t,field:r,timeUnit:o})]=Object.assign({as:t,field:r,timeUnit:o},a?{band:true}:{})}return e},{});if(qJ(n)){return null}return new E7(e,n)}static makeFromTransform(e,t){const n=Object.assign({},t),{timeUnit:i}=n,r=HX(n,["timeUnit"]);const o=A2(i);const s=Object.assign(Object.assign({},r),{timeUnit:o});return new E7(e,{[MJ(s)]:s})}merge(e){this.formula=Object.assign({},this.formula);for(const t in e.formula){if(!this.formula[t]||e.formula[t].band){this.formula[t]=e.formula[t]}}for(const t of e.children){e.removeChild(t);t.parent=this}e.remove()}removeFormulas(e){const t={};for(const[n,i]of HJ(this.formula)){if(!e.has(i.as)){t[n]=i}}this.formula=t}producedFields(){return new Set(GJ(this.formula).map(e=>e.as))}dependentFields(){return new Set(GJ(this.formula).map(e=>e.field))}hash(){return`TimeUnit ${MJ(this.formula)}`}assemble(){const e=[];for(const t of GJ(this.formula)){const{field:n,as:i,timeUnit:r}=t;const o=A2(r),{unit:s,utc:a}=o,u=HX(o,["unit","utc"]);e.push(Object.assign(Object.assign(Object.assign(Object.assign({field:tZ(n),type:"timeunit"},s?{units:w2(s)}:{}),a?{timezone:"utc"}:{}),u),{as:[i,`${i}_end`]}))}return e}}const A7="_tuple_fields";class D7{constructor(...e){this.items=e;this.hasChannel={};this.hasField={}}}const S7={has:()=>true,parse:(e,t,n)=>{var i,r,o;const s=t.name;const a=(i=t.project)!==null&&i!==void 0?i:t.project=new D7;const u={};const c={};const l=new Set;const f=(e,t)=>{const n=t==="visual"?e.channel:e.field;let i=YJ(`${s}_${n}`);for(let r=1;l.has(i);r++){i=YJ(`${s}_${n}_${r}`)}l.add(i);return{[t]:i}};if(!n.fields&&!n.encodings){const t=e.config.selection[n.type];if(n.init){for(const e of Object(oe["i"])(n.init)){for(const i of WJ(e)){if(yK(i)){(n.encodings||(n.encodings=[])).push(i)}else{if(n.type==="interval"){Q1(b.INTERVAL_INITIALIZED_WITH_X_Y);n.encodings=t.encodings}else{(n.fields||(n.fields=[])).push(i)}}}}}else{n.encodings=t.encodings;n.fields=t.fields}}for(const d of(r=n.fields)!==null&&r!==void 0?r:[]){const e={type:"E",field:d};e.signals=Object.assign({},f(e,"data"));a.items.push(e);a.hasField[d]=e}for(const d of(o=n.encodings)!==null&&o!==void 0?o:[]){const n=e.fieldDef(d);if(n){let i=n.field;if(n.aggregate){Q1(b.cannotProjectAggregate(d,n.aggregate));continue}else if(!i){Q1(b.cannotProjectOnChannelWithoutField(d));continue}if(n.timeUnit){i=e.vgField(d);const t={timeUnit:n.timeUnit,as:i,field:n.field};c[MJ(t)]=t}if(!u[i]){let r="E";if(t.type==="interval"){const t=e.getScaleComponent(d).get("type");if(A3(t)){r="R"}}else if(n.bin){r="R-RE"}const o={field:i,channel:d,type:r};o.signals=Object.assign(Object.assign({},f(o,"data")),f(o,"visual"));a.items.push(u[i]=o);a.hasField[i]=a.hasChannel[d]=u[i]}}else{Q1(b.cannotProjectOnChannelWithoutField(d))}}if(n.init){const e=e=>a.items.map(t=>e[t.channel]!==undefined?e[t.channel]:e[t.field]);if(n.type==="interval"){t.init=e(n.init)}else{const i=Object(oe["i"])(n.init);t.init=i.map(e)}}if(!qJ(c)){a.timeUnit=new E7(null,c)}},signals:(e,t,n)=>{const i=t.name+A7;const r=n.filter(e=>e.name===i);return r.length>0?n:n.concat({name:i,value:t.project.items.map(e=>{const{signals:t,hasLegend:n}=e,i=HX(e,["signals","hasLegend"]);i.field=tZ(i.field);return i})})}};var M7=S7;const C7={has:e=>e.type==="single"&&e.resolve==="global"&&e.bind&&e.bind!=="scales"&&!P4(e.bind),parse:(e,t,n,i)=>{if(!i.on)delete t.events;if(!i.clear)delete t.clear},topLevelSignals:(e,t,n)=>{const i=t.name;const r=t.project;const o=t.bind;const s=t.init&&t.init[0];const a=O7.has(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";r.items.forEach((e,r)=>{var u,c;const l=YJ(`${i}_${e.field}`);const f=n.filter(e=>e.name===l);if(!f.length){n.unshift(Object.assign(Object.assign({name:l},s?{init:iee(s[r])}:{value:null}),{on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${a}[${Object(oe["ab"])(e.field)}] : null`}]:[],bind:(c=(u=o[e.field])!==null&&u!==void 0?u:o[e.channel])!==null&&c!==void 0?c:o}))}});return n},signals:(e,t,n)=>{const i=t.name;const r=t.project;const o=n.filter(e=>e.name===i+jee)[0];const s=i+A7;const a=r.items.map(e=>YJ(`${i}_${e.field}`));const u=a.map(e=>`${e} !== null`).join(" && ");if(a.length){o.update=`${u} ? {fields: ${s}, values: [${a.join(", ")}]} : null`}delete o.value;delete o.on;return n}};var $7=C7;const F7="_toggle";const N7={has:e=>e.type==="multi"&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+F7,value:false,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+jee;const i=t.name+F7;return`${i} ? null : ${n}, `+(t.resolve==="global"?`${i} ? null : true, `:`${i} ? null : {unit: ${Cee(e)}}, `)+`${i} ? ${n} : null`}};var T7=N7;const z7={has:e=>e.clear!==undefined&&e.clear!==false,parse:(e,t,n)=>{if(n.clear){t.clear=Object(oe["I"])(n.clear)?BG(n.clear,"scope"):n.clear}},topLevelSignals:(e,t,n)=>{if($7.has(t)){for(const e of t.project.items){const i=n.findIndex(n=>n.name===YJ(`${t.name}_${e.field}`));if(i!==-1){n[i].on.push({events:t.clear,update:"null"})}}}return n},signals:(e,t,n)=>{function i(e,i){if(e!==-1&&n[e].on){n[e].on.push({events:t.clear,update:i})}}if(t.type==="interval"){for(const e of t.project.items){const t=n.findIndex(t=>t.name===e.signals.visual);i(t,"[0, 0]");if(t===-1){const t=n.findIndex(t=>t.name===e.signals.data);i(t,"null")}}}else{let e=n.findIndex(e=>e.name===t.name+jee);i(e,"null");if(T7.has(t)){e=n.findIndex(e=>e.name===t.name+F7);i(e,"false")}}return n}};var R7=z7;const B7={has:e=>e.type==="interval"&&e.resolve==="global"&&e.bind&&e.bind==="scales",parse:(e,t)=>{const n=t.scales=[];for(const i of t.project.items){const r=i.channel;if(!c0(r)){continue}const o=e.getScaleComponent(r);const s=o?o.get("type"):undefined;if(!o||!A3(s)){Q1(b.SCALE_BINDINGS_CONTINUOUS);continue}const a={selection:t.name,field:i.field};o.set("selectionExtent",a,true);n.push(i)}},topLevelSignals:(e,t,n)=>{const i=t.scales.filter(e=>n.filter(t=>t.name===e.signals.data).length===0);if(!e.parent||L7(e)||i.length===0){return n}const r=n.filter(e=>e.name===t.name)[0];let o=r.update;if(o.indexOf(Aee)>=0){r.update=`{${i.map(e=>`${Object(oe["ab"])(e.field)}: ${e.signals.data}`).join(", ")}}`}else{for(const e of i){const t=`${Object(oe["ab"])(e.field)}: ${e.signals.data}`;if(o.indexOf(t)<0){o=`${o.substring(0,o.length-1)}, ${t}}`}}r.update=o}return n.concat(i.map(e=>({name:e.signals.data})))},signals:(e,t,n)=>{if(e.parent&&!L7(e)){for(const e of t.scales){const t=n.filter(t=>t.name===e.signals.data)[0];t.push="outer";delete t.value;delete t.update}}return n}};var P7=B7;function I7(e,t){const n=Object(oe["ab"])(e.scaleName(t));return`domain(${n})`}function L7(e){var t;return e.parent&&$re(e.parent)&&((t=!e.parent.parent)!==null&&t!==void 0?t:L7(e.parent.parent))}const U7={has:e=>{const t=e.resolve==="global"&&e.bind&&P4(e.bind);const n=e.project.items.length===1&&e.project.items[0].field!==R4;if(t&&!n){Q1(b.LEGEND_BINDINGS_MUST_HAVE_PROJECTION)}return t&&n},parse:(e,t,n,i)=>{var r;if(!i.on)delete t.events;if(!i.clear)delete t.clear;if(i.on||i.clear){const e='event.item && indexof(event.item.mark.role, "legend") < 0';for(const n of t.events){n.filter=Object(oe["i"])((r=n.filter)!==null&&r!==void 0?r:[]);if(n.filter.indexOf(e)<0){n.filter.push(e)}}}const o=I4(t.bind)?t.bind.legend:"click";const s=Object(oe["I"])(o)?BG(o,"view"):Object(oe["i"])(o);t.bind={legend:{merge:s}}},topLevelSignals:(e,t,n)=>{const i=t.name;const r=I4(t.bind)&&t.bind.legend;const o=e=>t=>{const n=EJ(t);n.markname=e;return n};for(const s of t.project.items){if(!s.hasLegend)continue;const e=`${YJ(s.field)}_legend`;const a=`${i}_${e}`;const u=n.filter(e=>e.name===a);if(u.length===0){const i=r.merge.map(o(`${e}_symbols`)).concat(r.merge.map(o(`${e}_labels`))).concat(r.merge.map(o(`${e}_entries`)));n.unshift(Object.assign(Object.assign({name:a},!t.init?{value:null}:{}),{on:[{events:i,update:"datum.value || item().items[0].items[0].datum.value",force:true},{events:r.merge,update:`!event.item || !datum ? null : ${a}`,force:true}]}))}}return n},signals:(e,t,n)=>{const i=t.name;const r=t.project;const o=n.find(e=>e.name===i+jee);const s=i+A7;const a=r.items.filter(e=>e.hasLegend).map(e=>YJ(`${i}_${YJ(e.field)}_legend`));const u=a.map(e=>`${e} !== null`).join(" && ");const c=`${u} ? {fields: ${s}, values: [${a.join(", ")}]} : null`;if(t.events&&a.length>0){o.on.push({events:a.map(e=>({signal:e})),update:c})}else if(a.length>0){o.update=c;delete o.value;delete o.on}const l=n.find(e=>e.name===i+F7);const f=I4(t.bind)&&t.bind.legend;if(l){if(!t.events)l.on[0].events=f;else l.on.push(Object.assign(Object.assign({},l.on[0]),{events:f}))}return n}};var q7=U7;function W7(e,t,n){var i;const r=(i=e.fieldDef(t))===null||i===void 0?void 0:i.field;See(e,e=>{var i,o;const s=(i=e.project.hasField[r])!==null&&i!==void 0?i:e.project.hasChannel[t];if(s&&U7.has(e)){const t=(o=n.get("selections"))!==null&&o!==void 0?o:[];t.push(e.name);n.set("selections",t,false);s.hasLegend=true}})}const G7="_translate_anchor";const H7="_translate_delta";const V7={has:e=>e.type==="interval"&&e.translate,signals:(e,t,n)=>{const i=t.name;const r=P7.has(t);const o=i+G7;const{x:s,y:a}=t.project.hasChannel;let u=BG(t.translate,"scope");if(!r){u=u.map(e=>(e.between[0].markname=i+dee,e))}n.push({name:o,value:{},on:[{events:u.map(e=>e.between[0]),update:"{x: x(unit), y: y(unit)"+(s!==undefined?", extent_x: "+(r?I7(e,yQ):`slice(${s.signals.visual})`):"")+(a!==undefined?", extent_y: "+(r?I7(e,xQ):`slice(${a.signals.visual})`):"")+"}"}]},{name:i+H7,value:{},on:[{events:u,update:`{x: ${o}.x - x(unit), y: ${o}.y - y(unit)}`}]});if(s!==undefined){X7(e,t,s,"width",n)}if(a!==undefined){X7(e,t,a,"height",n)}return n}};var Y7=V7;function X7(e,t,n,i,r){var o;const s=t.name;const a=s+G7;const u=s+H7;const c=n.channel;const l=P7.has(t);const f=r.filter(e=>e.name===n.signals[l?"data":"visual"])[0];const d=e.getSizeSignalRef(i).signal;const h=e.getScaleComponent(c);const p=h.get("type");const g=l&&c===yQ?"-":"";const m=`${a}.extent_${c}`;const b=`${g}${u}.${c} / `+(l?`${d}`:`span(${m})`);const v=!l?"panLinear":p==="log"?"panLog":p==="pow"?"panPow":"panLinear";const y=`${v}(${m}, ${b}`+(l&&p==="pow"?`, ${(o=h.get("exponent"))!==null&&o!==void 0?o:1}`:"")+")";f.on.push({events:{signal:u},update:l?y:`clampRange(${y}, 0, ${d})`})}const J7="_zoom_anchor";const Z7="_zoom_delta";const Q7={has:e=>e.type==="interval"&&e.zoom,signals:(e,t,n)=>{const i=t.name;const r=P7.has(t);const o=i+Z7;const{x:s,y:a}=t.project.hasChannel;const u=Object(oe["ab"])(e.scaleName(yQ));const c=Object(oe["ab"])(e.scaleName(xQ));let l=BG(t.zoom,"scope");if(!r){l=l.map(e=>(e.markname=i+dee,e))}n.push({name:i+J7,on:[{events:l,update:!r?`{x: x(unit), y: y(unit)}`:"{"+[u?`x: invert(${u}, x(unit))`:"",c?`y: invert(${c}, y(unit))`:""].filter(e=>!!e).join(", ")+"}"}]},{name:o,on:[{events:l,force:true,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]});if(s!==undefined){eee(e,t,s,"width",n)}if(a!==undefined){eee(e,t,a,"height",n)}return n}};var K7=Q7;function eee(e,t,n,i,r){var o;const s=t.name;const a=n.channel;const u=P7.has(t);const c=r.filter(e=>e.name===n.signals[u?"data":"visual"])[0];const l=e.getSizeSignalRef(i).signal;const f=e.getScaleComponent(a);const d=f.get("type");const h=u?I7(e,a):c.name;const p=s+Z7;const g=`${s}${J7}.${a}`;const m=!u?"zoomLinear":d==="log"?"zoomLog":d==="pow"?"zoomPow":"zoomLinear";const b=`${m}(${h}, ${g}, ${p}`+(u&&d==="pow"?`, ${(o=f.get("exponent"))!==null&&o!==void 0?o:1}`:"")+")";c.on.push({events:{signal:p},update:u?b:`clampRange(${b}, 0, ${l})`})}const tee=[M7,T7,P7,q7,Y7,K7,$7,O7,R7];function nee(e,t){for(const n of tee){if(n.has(e)){t(n)}}}function iee(e,t=true,n=oe["y"]){if(Object(oe["B"])(e)){const i=e.map(e=>iee(e,t,n));return t?`[${i.join(", ")}]`:i}else if(t2(e)){if(t){return n(l2(e))}else{return n(d2(e))}}return t?n(JSON.stringify(e)):e}function ree(e,t){See(e,(n,i)=>{const r=n.name;let o=i.modifyExpr(e,n);t.push(...i.signals(e,n));nee(n,i=>{if(i.signals){t=i.signals(e,n,t)}if(i.modifyExpr){o=i.modifyExpr(e,n,o)}});t.push({name:r+kee,on:[{events:{signal:n.name+jee},update:`modify(${Object(oe["ab"])(n.name+Oee)}, ${o})`}]})});return fee(t)}function oee(e,t){if(e.component.selection&&WJ(e.component.selection).length){const n=Object(oe["ab"])(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:BG("mousemove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return fee(t)}function see(e,t){let n=false;See(e,(i,r)=>{const o=i.name;const s=Object(oe["ab"])(o+Oee);const a=t.filter(e=>e.name===o);if(a.length===0){const e=i.resolve==="global"?"union":i.resolve;const n=i.type==="multi"?", true)":")";t.push({name:i.name,update:`${Aee}(${s}, ${Object(oe["ab"])(e)}${n}`})}n=true;if(r.topLevelSignals){t=r.topLevelSignals(e,i,t)}nee(i,n=>{if(n.topLevelSignals){t=n.topLevelSignals(e,i,t)}})});if(n){const e=t.filter(e=>e.name==="unit");if(e.length===0){t.unshift({name:"unit",value:{},on:[{events:"mousemove",update:"isTuple(group()) ? group() : unit"}]})}}return fee(t)}function aee(e,t){const n=[...t];See(e,t=>{const i={name:t.name+Oee};if(t.init){const n=t.project.items.map(e=>{const{signals:t}=e,n=HX(e,["signals"]);return n});const r=t.init.map(e=>iee(e,false));i.values=t.type==="interval"?[{unit:Cee(e,{escape:false}),fields:n,values:r}]:r.map(t=>({unit:Cee(e,{escape:false}),fields:n,values:t}))}const r=n.filter(e=>e.name===t.name+Oee);if(!r.length){n.push(i)}});return n}function uee(e,t){See(e,(n,i)=>{t=i.marks?i.marks(e,n,t):t;nee(n,i=>{if(i.marks){t=i.marks(e,n,t)}})});return t}function cee(e,t){for(const n of e.children){if(Sre(n)){t=uee(n,t)}}return t}function lee(e,t){const n=t.selection;const i=e.getSelectionComponent(n,YJ(n));return{signal:Pee(i,t)}}function fee(e){return e.map(e=>{if(e.on&&!e.on.length)delete e.on;return e})}const dee="_brush";const hee="_scale_trigger";const pee={signals:(e,t)=>{const n=t.name;const i=n+A7;const r=P7.has(t);const o=[];const s=[];const a=[];if(t.translate&&!r){const e=`!event.item || event.item.mark.name !== ${Object(oe["ab"])(n+dee)}`;bee(t,(t,n)=>{var i;const r=Object(oe["i"])((i=n.between[0].filter)!==null&&i!==void 0?i:n.between[0].filter=[]);if(r.indexOf(e)<0){r.push(e)}return t})}t.project.items.forEach((n,i)=>{const r=n.channel;if(r!==yQ&&r!==xQ){Q1("Interval selections only support x and y encoding channels.");return}const u=t.init?t.init[i]:null;const c=mee(e,t,n,u);const l=n.signals.data;const f=n.signals.visual;const d=Object(oe["ab"])(e.scaleName(r));const h=e.getScaleComponent(r).get("type");const p=A3(h)?"+":"";o.push(...c);s.push(l);a.push({scaleName:e.scaleName(r),expr:`(!isArray(${l}) || `+`(${p}invert(${d}, ${f})[0] === ${p}${l}[0] && `+`${p}invert(${d}, ${f})[1] === ${p}${l}[1]))`})});if(!r){o.push({name:n+hee,value:{},on:[{events:a.map(e=>({scale:e.scaleName})),update:a.map(e=>e.expr).join(" && ")+` ? ${n+hee} : {}`}]})}const u=t.init;const c=`unit: ${Cee(e)}, fields: ${i}, values`;return o.concat(Object.assign(Object.assign({name:n+jee},u?{init:`{${c}: ${iee(u)}}`}:{}),{on:[{events:[{signal:s.join(" || ")}],update:s.join(" && ")+` ? {${c}: [${s}]} : null`}]}))},modifyExpr:(e,t)=>{const n=t.name+jee;return n+", "+(t.resolve==="global"?"true":`{unit: ${Cee(e)}}`)},marks:(e,t,n)=>{const i=t.name;const{x:r,y:o}=t.project.hasChannel;const s=r&&r.signals.visual;const a=o&&o.signals.visual;const u=`data(${Object(oe["ab"])(t.name+Oee)})`;if(P7.has(t)){return n}const c={x:r!==undefined?{signal:`${s}[0]`}:{value:0},y:o!==undefined?{signal:`${a}[0]`}:{value:0},x2:r!==undefined?{signal:`${s}[1]`}:{field:{group:"width"}},y2:o!==undefined?{signal:`${a}[1]`}:{field:{group:"height"}}};if(t.resolve==="global"){for(const t of WJ(c)){c[t]=[Object.assign({test:`${u}.length && ${u}[0].unit === ${Cee(e)}`},c[t]),{value:0}]}}const l=t.mark,{fill:f,fillOpacity:d,cursor:h}=l,p=HX(l,["fill","fillOpacity","cursor"]);const g=WJ(p).reduce((e,t)=>{e[t]=[{test:[r!==undefined&&`${s}[0] !== ${s}[1]`,o!==undefined&&`${a}[0] !== ${a}[1]`].filter(e=>e).join(" && "),value:p[t]},{value:null}];return e},{});return[{name:i+dee+"_bg",type:"rect",clip:true,encode:{enter:{fill:{value:f},fillOpacity:{value:d}},update:c}},...n,{name:i+dee,type:"rect",clip:true,encode:{enter:Object.assign(Object.assign({},h?{cursor:{value:h}}:{}),{fill:{value:"transparent"}}),update:Object.assign(Object.assign({},c),g)}}]}};var gee=pee;function mee(e,t,n,i){const r=n.channel;const o=n.signals.visual;const s=n.signals.data;const a=P7.has(t);const u=Object(oe["ab"])(e.scaleName(r));const c=e.getScaleComponent(r);const l=c?c.get("type"):undefined;const f=e=>`scale(${u}, ${e})`;const d=e.getSizeSignalRef(r===yQ?"width":"height").signal;const h=`${r}(unit)`;const p=bee(t,(e,t)=>[...e,{events:t.between[0],update:`[${h}, ${h}]`},{events:t,update:`[${o}[0], clamp(${h}, 0, ${d})]`}]);p.push({events:{signal:t.name+hee},update:A3(l)?`[${f(`${s}[0]`)}, ${f(`${s}[1]`)}]`:`[0, 0]`});return a?[{name:s,on:[]}]:[Object.assign(Object.assign({name:o},i?{init:iee(i,true,f)}:{value:[]}),{on:p}),Object.assign(Object.assign({name:s},i?{init:iee(i)}:{}),{on:[{events:{signal:o},update:`${o}[0] === ${o}[1] ? null : invert(${u}, ${o})`}]})]}function bee(e,t){return e.events.reduce((e,n)=>{if(!n.between){Q1(`${n} is not an ordered event stream for interval selections.`);return e}return t(e,n)},[])}function vee(e,t){const n=t.name;const i=n+A7;const r=t.project;const o="(item().isVoronoi ? datum.datum : datum)";const s=r.items.map(t=>{const n=e.fieldDef(t.channel);return n&&n.bin?`[${o}[${Object(oe["ab"])(e.vgField(t.channel,{}))}], `+`${o}[${Object(oe["ab"])(e.vgField(t.channel,{binSuffix:"end"}))}]]`:`${o}[${Object(oe["ab"])(t.field)}]`}).join(", ");const a=`unit: ${Cee(e)}, fields: ${i}, values`;const u=t.events;return[{name:n+jee,on:u?[{events:u,update:`datum && item().mark.marktype !== 'group' ? {${a}: [${s}]} : null`,force:true}]:[]}]}const yee={signals:vee,modifyExpr:(e,t)=>{const n=t.name+jee;return n+", "+(t.resolve==="global"?"null":`{unit: ${Cee(e)}}`)}};var xee=yee;const _ee={signals:vee,modifyExpr:(e,t)=>{const n=t.name+jee;return n+", "+(t.resolve==="global"?"true":`{unit: ${Cee(e)}}`)}};var wee=_ee;const Oee="_store";const jee="_tuple";const kee="_modify";const Eee="_selection_domain_";const Aee="vlSelectionResolve";const Dee={single:wee,multi:xee,interval:gee};function See(e,t){const n=e.component.selection;if(n){for(const e of GJ(n)){const n=t(e,Dee[e.type]);if(n===true)break}}}function Mee(e){let t=e.parent;while(t){if(Mre(t)){break}t=t.parent}return t}function Cee(e,{escape:t}={escape:true}){let n=t?Object(oe["ab"])(e.name):e.name;const i=Mee(e);if(i){const{facet:e}=i;for(const t of sK){if(e[t]){n+=` + '__facet_${t}_' + (facet[${Object(oe["ab"])(i.vgField(t))}])`}}}return n}function $ee(e){let t=false;See(e,e=>{t=t||e.project.items.some(e=>e.field===R4)});return t}function Fee(e){const t=[];if(e.type==="Identifier"){return[e.name]}if(e.type==="Literal"){return[e.value]}if(e.type==="MemberExpression"){t.push(...Fee(e.object));t.push(...Fee(e.property))}return t}function Nee(e){if(e.object.type==="MemberExpression"){return Nee(e.object)}return e.object.name==="datum"}function Tee(e){const t=vI(e);const n=new Set;t.visit(e=>{if(e.type==="MemberExpression"&&Nee(e)){n.add(Fee(e).slice(1).join("."))}});return n}class zee extends j7{constructor(e,t,n){super(e);this.model=t;this.filter=n;this.expr=Lee(this.model,this.filter,this);this._dependentFields=Tee(this.expr)}clone(){return new zee(null,this.model,EJ(this.filter))}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function Ree(e,t){var n;const i={};const r=e.config.selection;for(const o of WJ(t!==null&&t!==void 0?t:{})){const s=EJ(t[o]);const a=r[s.type],{fields:u,encodings:c}=a,l=HX(a,["fields","encodings"]);for(const e in l){if(e==="encodings"&&s.fields||e==="fields"&&s.encodings){continue}if(e==="mark"){s[e]=Object.assign(Object.assign({},l[e]),s[e])}if(s[e]===undefined||s[e]===true){s[e]=(n=l[e])!==null&&n!==void 0?n:s[e]}}const f=YJ(o);const d=i[f]=Object.assign(Object.assign({},s),{name:f,events:Object(oe["I"])(s.on)?BG(s.on,"scope"):EJ(s.on)});nee(d,n=>{if(n.has(d)&&n.parse){n.parse(e,d,s,t[o])}})}return i}function Bee(e,t,n,i="datum"){const r=[];function o(t){const o=YJ(t);const s=e.getSelectionComponent(o,t);const a=Object(oe["ab"])(o+Oee);if(s.project.timeUnit){const t=n!==null&&n!==void 0?n:e.component.data.raw;const i=s.project.timeUnit.clone();if(t.parent){i.insertAsParentOf(t)}else{t.parent=i}}if(s.empty!=="none"){r.push(a)}return`vlSelectionTest(${a}, ${i}`+(s.resolve==="global"?")":`, ${Object(oe["ab"])(s.resolve)})`)}const s=XJ(t,o);return(r.length?"!("+r.map(e=>`length(data(${e}))`).join(" || ")+") || ":"")+`(${s})`}function Pee(e,t){const n=t["encoding"];let i=t["field"];if(!n&&!i){i=e.project.items[0].field;if(e.project.items.length>1){Q1('A "field" or "encoding" must be specified when using a selection as a scale domain. '+`Using "field": ${Object(oe["ab"])(i)}.`)}}else if(n&&!i){const r=e.project.items.filter(e=>e.channel===n);if(!r.length||r.length>1){i=e.project.items[0].field;Q1((!r.length?"No ":"Multiple ")+`matching ${Object(oe["ab"])(n)} encoding found for selection ${Object(oe["ab"])(t.selection)}. `+`Using "field": ${Object(oe["ab"])(i)}.`)}else{i=r[0].field}}return`${e.name}[${Object(oe["ab"])(i)}]`}function Iee(e,t){See(e,n=>{const i=n.name;const r=e.getName(`lookup_${i}`);e.component.data.outputNodes[r]=n.materialized=new k7(new zee(t,e,{selection:i}),r,p9.Lookup,e.component.data.outputNodeRefCounts)})}function Lee(e,t,n){return XJ(t,t=>{if(Object(oe["I"])(t)){return t}else if(B2(t)){return Bee(e,t.selection,n)}else{return J2(t)}})}function Uee(e,t){if(!e){return undefined}if(Object(oe["B"])(e)&&!A6(e)){return e.map(e=>c6(e,t)).join(", ")}return e}function qee(e,t,n,i){var r,o,s;e.encode=(r=e.encode)!==null&&r!==void 0?r:{};e.encode[t]=(o=e.encode[t])!==null&&o!==void 0?o:{};e.encode[t].update=(s=e.encode[t].update)!==null&&s!==void 0?s:{};e.encode[t].update[n]=i}function Wee(e,t,n,i={header:false}){var r,o;const s=e.combine(),{disable:a,orient:u,scale:c,labelExpr:l,title:f,zindex:d}=s,h=HX(s,["disable","orient","scale","labelExpr","title","zindex"]);if(a){return undefined}for(const p in h){const e=mZ[p];const n=h[p];if(e&&e!==t&&e!=="both"){delete h[p]}else if(pZ(n)){const{condition:e}=n,t=HX(n,["condition"]);const i=Object(oe["i"])(e);const r=hZ[p];if(r){const{vgProp:e,part:n}=r;const o=[...i.map(e=>{const{test:t}=e,n=HX(e,["test"]);return Object.assign({test:Lee(null,t)},n)}),t];qee(h,n,e,o);delete h[p]}else if(r===null){const e={signal:i.map(e=>{const{test:t}=e,n=HX(e,["test"]);return`${Lee(null,t)} ? ${M6(n)} : `}).join("")+M6(t)};h[p]=e}}else if(S2(n)){const e=hZ[p];if(e){const{vgProp:t,part:i}=e;qee(h,i,t,n);delete h[p]}}}if(t==="grid"){if(!h.grid){return undefined}if(h.encode){const{grid:e}=h.encode;h.encode=Object.assign({},e?{grid:e}:{});if(qJ(h.encode)){delete h.encode}}return Object.assign(Object.assign({scale:c,orient:u},h),{domain:false,labels:false,aria:false,maxExtent:0,minExtent:0,ticks:false,zindex:oZ(d,0)})}else{if(!i.header&&e.mainExtracted){return undefined}if(l!==undefined){let e=l;if(((o=(r=h.encode)===null||r===void 0?void 0:r.labels)===null||o===void 0?void 0:o.update)&&S2(h.encode.labels.update.text)){e=nZ(l,"datum.label",h.encode.labels.update.text.signal)}qee(h,"labels","text",{signal:e})}if(h.labelAlign===null){delete h.labelAlign}if(h.encode){for(const t of gZ){if(!e.hasAxisPart(t)){delete h.encode[t]}}if(qJ(h.encode)){delete h.encode}}const t=Uee(f,n);return Object.assign(Object.assign(Object.assign(Object.assign({scale:c,orient:u,grid:false},t?{title:t}:{}),h),n.aria===false?{aria:false}:{}),{zindex:oZ(d,0)})}}function Gee(e){const{axes:t}=e.component;const n=[];for(const i of WK){if(t[i]){for(const r of t[i]){if(!r.get("disable")&&!r.get("gridScale")){const t=i==="x"?"height":"width";const r=e.getSizeSignalRef(t).signal;if(t!==r){n.push({name:t,update:r})}}}}}return n}function Hee(e,t){const{x:n=[],y:i=[]}=e;return[...n.map(e=>Wee(e,"grid",t)),...i.map(e=>Wee(e,"grid",t)),...n.map(e=>Wee(e,"main",t)),...i.map(e=>Wee(e,"main",t))].filter(e=>e)}const Vee={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"};const Yee={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"};const Xee=WJ(Vee);const Jee=WJ(Yee);function Zee(e,t,n,i){return Object.assign.apply(null,[{},...e.map(e=>{if(e==="axisOrient"){const e=n==="x"?"bottom":"left";const r=t[n==="x"?"axisBottom":"axisLeft"]||{};const o=t[n==="x"?"axisTop":"axisRight"]||{};const s=new Set([...WJ(r),...WJ(o)]);const a={};for(const t of s.values()){a[t]={signal:`${i["signal"]} === "${e}" ? ${C6(r[t])} : ${C6(o[t])}`}}return a}return t[e]})])}function Qee(e,t,n,i){const r=t==="band"?["axisDiscrete","axisBand"]:t==="point"?["axisDiscrete","axisPoint"]:v3(t)?["axisQuantitative"]:t==="time"||t==="utc"?["axisTemporal"]:[];const o=e==="x"?"axisX":"axisY";const s=S2(n)?"axisOrient":"axis"+ZJ(n);const a=[...r,...r.map(e=>o+e.substr(4))];const u=["axis",s,o];return{vlOnlyAxisConfig:Zee(a,i,e,n),vgAxisConfig:Zee(u,i,e,n),axisConfigStyle:Kee([...u,...a],i)}}function Kee(e,t){var n;const i=[{}];for(const r of e){let e=(n=t[r])===null||n===void 0?void 0:n.style;if(e){e=Object(oe["i"])(e);for(const n of e){i.push(t.style[n])}}}return Object.assign.apply(null,i)}function ete(e,t,n,i={}){var r;const o=R6(e,n,t);if(o!==undefined){return{configFrom:"style",configValue:o}}for(const s of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"]){if(((r=i[s])===null||r===void 0?void 0:r[e])!==undefined){return{configFrom:s,configValue:i[s][e]}}}return{}}const tte={scale:({model:e,channel:t})=>e.scaleName(t),format:({fieldOrDatumDef:e,config:t,axis:n})=>{const{format:i,formatType:r}=n;return c5(e,e.type,i,r,t,true)},formatType:({axis:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:i}=e;return l5(i,t,n)},grid:({fieldOrDatumDef:e,axis:t,scaleType:n})=>{var i;if(z5(e)&&v0(e.bin)){return false}else{return(i=t.grid)!==null&&i!==void 0?i:nte(n,e)}},gridScale:({model:e,channel:t})=>ite(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelAlign||ate(t,n,i),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelBaseline||ste(t,n,i),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>{var i;return(i=e.labelFlush)!==null&&i!==void 0?i:ute(t.type,n)},labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>{var i;return(i=e.labelOverlap)!==null&&i!==void 0?i:cte(t.type,n,z5(t)&&!!t.timeUnit,z5(t)?t.sort:undefined)},orient:({orient:e})=>e,tickCount:({channel:e,model:t,axis:n,fieldOrDatumDef:i,scaleType:r})=>{var o;const s=e==="x"?"width":e==="y"?"height":undefined;const a=s?t.getSizeSignalRef(s):undefined;return(o=n.tickCount)!==null&&o!==void 0?o:fte({fieldOrDatumDef:i,scaleType:r,size:a,values:n.values})},title:({axis:e,model:t,channel:n})=>{if(e.title!==undefined){return e.title}const i=dte(t,n);if(i!==undefined){return i}const r=t.typedFieldDef(n);const o=n==="x"?"x2":"y2";const s=t.fieldDef(o);return P6(r?[D5(r)]:[],z5(s)?[D5(s)]:[])},values:({axis:e,fieldOrDatumDef:t})=>hte(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>{var i;return(i=e.zindex)!==null&&i!==void 0?i:pte(n,t)}};function nte(e,t){return!E3(e)&&z5(t)&&!b0(t===null||t===void 0?void 0:t.bin)}function ite(e,t){const n=t==="x"?"y":"x";if(e.getScaleComponent(n)){return e.scaleName(n)}return undefined}function rte(e,t,n,i,r){const o=t===null||t===void 0?void 0:t.labelAngle;if(o!==undefined){return S2(o)?o:fZ(o)}else{const{configValue:o}=ete("labelAngle",i,t===null||t===void 0?void 0:t.style,r);if(o!==undefined){return fZ(o)}else{if(n===yQ&&$J([r3,n3],e.type)&&!(z5(e)&&e.timeUnit)){return 270}return undefined}}}function ote(e){return`(((${e.signal} % 360) + 360) % 360)`}function ste(e,t,n,i){if(e!==undefined){if(n==="x"){if(S2(e)){const n=ote(e);const i=S2(t)?`(${t.signal} === "top")`:t==="top";return{signal:`(45 < ${n} && ${n} < 135) || (225 < ${n} && ${n} < 315) ? "middle" :`+`(${n} <= 45 || 315 <= ${n}) === ${i} ? "bottom" : "top"`}}if(45{if(!G5(t)){return}if(w5(t.sort)){const{field:i,timeUnit:r}=t;const o=t.sort;const s=o.map((e,t)=>`${J2({field:i,timeUnit:r,equal:e})} ? ${t} : `).join("")+o.length;e=new gte(e,{calculate:s,as:mte(t,n,{forAs:true})})}});return e}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return`Calculate ${MJ(this.transform)}`}}function mte(e,t,n){return Z5(e,Object.assign({prefix:t,suffix:"sort_index"},n!==null&&n!==void 0?n:{}))}function bte(e,t){if($J(["top","bottom"],t)){return"column"}else if($J(["left","right"],t)){return"row"}return e==="row"?"row":"column"}function vte(e,t,n,i){const r=i==="row"?n.headerRow:i==="column"?n.headerColumn:n.headerFacet;return oZ(((t===null||t===void 0?void 0:t.header)||{})[e],r[e],n.header[e])}function yte(e,t,n,i){const r={};for(const o of e){const e=vte(o,t,n,i);if(e!==undefined){r[o]=e}}return r}const xte=["row","column"];const _te=["header","footer"];function wte(e,t){const n=e.component.layoutHeaders[t].title;const i=e.config?e.config:undefined;const r=e.component.layoutHeaders[t].facetFieldDef?e.component.layoutHeaders[t].facetFieldDef:undefined;const{titleAnchor:o,titleAngle:s,titleOrient:a}=yte(["titleAnchor","titleAngle","titleOrient"],r,i,t);const u=bte(t,a);const c=fZ(s);return{name:`${t}-title`,type:"group",role:`${u}-title`,title:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({text:n},t==="row"?{orient:"left"}:{}),{style:"guide-title"}),jte(c,u)),Ote(u,c,o)),$te(i,r,t,Xee,Vee))}}function Ote(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const i=ate(t,e==="row"?"left":"top",e==="row"?"y":"x");return i?{align:i}:{}}function jte(e,t){const n=ste(e,t==="row"?"left":"top",t==="row"?"y":"x",true);return n?{baseline:n}:{}}function kte(e,t){const n=e.component.layoutHeaders[t];const i=[];for(const r of _te){if(n[r]){for(const o of n[r]){const s=Dte(e,t,r,n,o);if(s!=null){i.push(s)}}}}return i}function Ete(e,t){var n;const{sort:i}=e;if(_5(i)){return{field:Z5(i,{expr:"datum"}),order:(n=i.order)!==null&&n!==void 0?n:"ascending"}}else if(Object(oe["B"])(i)){return{field:mte(e,t,{expr:"datum"}),order:"ascending"}}else{return{field:Z5(e,{expr:"datum"}),order:i!==null&&i!==void 0?i:"ascending"}}}function Ate(e,t,n){const{format:i,formatType:r,labelAngle:o,labelAnchor:s,labelOrient:a,labelExpr:u}=yte(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e,n,t);const c=s5({fieldOrDatumDef:e,format:i,formatType:r,expr:"parent",config:n}).signal;const l=bte(t,a);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({text:{signal:u?nZ(nZ(u,"datum.label",c),"datum.value",Z5(e,{expr:"parent"})):c}},t==="row"?{orient:"left"}:{}),{style:"guide-label",frame:"group"}),jte(o,l)),Ote(l,o,s)),$te(n,e,t,Jee,Yee))}function Dte(e,t,n,i,r){if(r){let o=null;const{facetFieldDef:s}=i;const a=e.config?e.config:undefined;if(s&&r.labels){const{labelOrient:e}=yte(["labelOrient"],s,a,t);if(t==="row"&&!$J(["top","bottom"],e)||t==="column"&&!$J(["left","right"],e)){o=Ate(s,t,a)}}const u=Mre(e)&&!O5(e.facet);const c=r.axes;const l=(c===null||c===void 0?void 0:c.length)>0;if(o||l){const a=t==="row"?"height":"width";return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:e.getName(`${t}_${n}`),type:"group",role:`${t}-${n}`},i.facetFieldDef?{from:{data:e.getName(t+"_domain")},sort:Ete(s,t)}:{}),l&&u?{from:{data:e.getName(`facet_domain_${t}`)}}:{}),o?{title:o}:{}),r.sizeSignal?{encode:{update:{[a]:r.sizeSignal}}}:{}),l?{axes:c}:{})}}return null}const Ste={column:{start:0,end:1},row:{start:1,end:0}};function Mte(e,t){return Ste[t][e]}function Cte(e,t){const n={};for(const i of sK){const r=e[i];if(r===null||r===void 0?void 0:r.facetFieldDef){const{titleAnchor:e,titleOrient:o}=yte(["titleAnchor","titleOrient"],r.facetFieldDef,t,i);const s=bte(i,o);const a=Mte(e,s);if(a!==undefined){n[s]=a}}}return qJ(n)?undefined:n}function $te(e,t,n,i,r){const o={};for(const s of i){if(!r[s]){continue}const i=vte(s,t,e,n);if(i!==undefined){o[r[s]]=i}}return o}function Fte(e){return[...Nte(e,"width"),...Nte(e,"height"),...Nte(e,"childWidth"),...Nte(e,"childHeight")]}function Nte(e,t){const n=t==="width"?"x":"y";const i=e.component.layoutSize.get(t);if(!i||i==="merged"){return[]}const r=e.getSizeSignalRef(t).signal;if(i==="step"){const t=e.getScaleComponent(n);if(t){const i=t.get("type");const o=t.get("range");if(E3(i)&&M2(o)){const i=e.scaleName(n);if(Mre(e.parent)){const t=e.parent.component.resolve;if(t.scale[n]==="independent"){return[Tte(i,o)]}}return[Tte(i,o),{name:r,update:zte(i,t,`domain('${i}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}else if(i=="container"){const t=r.endsWith("width");const n=t?"containerSize()[0]":"containerSize()[1]";const i=Z4(e.config.view,t?"width":"height");const o=`isFinite(${n}) ? ${n} : ${i}`;return[{name:r,init:o,on:[{update:o,events:"window:resize"}]}]}else{return[{name:r,value:i}]}}function Tte(e,t){return{name:e+"_step",value:t.step}}function zte(e,t,n){const i=t.get("type");const r=t.get("padding");const o=oZ(t.get("paddingOuter"),r);let s=t.get("paddingInner");s=i==="band"?s!==undefined?s:r:1;return`bandspace(${n}, ${s}, ${o}) * ${e}_step`}function Rte(e){return e==="childWidth"?"width":e==="childHeight"?"height":e}function Bte(e,t){return WJ(e).reduce((n,i)=>{const r=e[i];return Object.assign(Object.assign({},n),R9(t,r,i,e=>S2(e)?e:{value:e.value}))},{})}function Pte(e,t){if($re(t)||Mre(t)){return"shared"}else if(Cre(t)){return GK(e)?"independent":"shared"}throw new Error("invalid model type for resolve")}function Ite(e,t){const n=e.scale[t];const i=GK(t)?"axis":"legend";if(n==="independent"){if(e[i][t]==="shared"){Q1(b.independentScaleMeansIndependentGuide(t))}return"independent"}return e[i][t]||"shared"}const Lte=Object.assign(Object.assign({},T4),{disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1});const Ute=WJ(Lte);class qte extends e9{}const Wte={symbols:Gte,gradient:Hte,labels:Vte,entries:Yte};function Gte(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r,legendType:o}){var s,a,u,c,l,f,d,h;if(o!=="symbol"){return undefined}const{markDef:p,encoding:g,config:m,mark:b}=n;const v=p.filled&&b!=="trail";let y=Object.assign(Object.assign({},$6({},n,GZ)),V9(n,{filled:v}));const x=(s=r.get("symbolOpacity"))!==null&&s!==void 0?s:m.legend.symbolOpacity;const _=(a=r.get("symbolFillColor"))!==null&&a!==void 0?a:m.legend.symbolFillColor;const w=(u=r.get("symbolStrokeColor"))!==null&&u!==void 0?u:m.legend.symbolStrokeColor;const O=x===undefined?(c=Xte(g.opacity))!==null&&c!==void 0?c:p.opacity:undefined;if(y.fill){if(i==="fill"||v&&i===CQ){delete y.fill}else{if(y.fill["field"]){if(_){delete y.fill}else{y.fill=S6((l=m.legend.symbolBaseFillColor)!==null&&l!==void 0?l:"black");y.fillOpacity=S6(O!==null&&O!==void 0?O:1)}}else if(Object(oe["B"])(y.fill)){const e=(h=(d=Jte((f=g.fill)!==null&&f!==void 0?f:g.color))!==null&&d!==void 0?d:p.fill)!==null&&h!==void 0?h:v&&p.color;if(e){y.fill=S6(e)}}}}if(y.stroke){if(i==="stroke"||!v&&i===CQ){delete y.stroke}else{if(y.stroke["field"]||w){delete y.stroke}else if(Object(oe["B"])(y.stroke)){const e=oZ(Jte(g.stroke||g.color),p.stroke,v?p.color:undefined);if(e){y.stroke={value:e}}}}}if(i!==RQ){const e=z5(t)&&Qte(n,r,t);if(e){y.opacity=[Object.assign({test:e},S6(O!==null&&O!==void 0?O:1)),S6(m.legend.unselectedOpacity)]}else if(O){y.opacity=S6(O)}}y=Object.assign(Object.assign({},y),e);return qJ(y)?undefined:y}function Hte(e,{model:t,legendType:n,legendCmpt:i}){var r;if(n!=="gradient"){return undefined}const{config:o,markDef:s,encoding:a}=t;let u={};const c=(r=i.get("gradientOpacity"))!==null&&r!==void 0?r:o.legend.gradientOpacity;const l=c===undefined?Xte(a.opacity)||s.opacity:undefined;if(l){u.opacity=S6(l)}u=Object.assign(Object.assign({},u),e);return qJ(u)?undefined:u}function Vte(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r}){const o=n.legend(i)||{};const s=n.config;const a=z5(t)?Qte(n,r,t):undefined;const u=a?[{test:a,value:1},{value:s.legend.unselectedOpacity}]:undefined;const{format:c,formatType:l}=o;const f=i5(l)?u5({fieldOrDatumDef:t,field:"datum.value",format:c,formatType:l,config:s}):undefined;const d=Object.assign(Object.assign(Object.assign({},u?{opacity:u}:{}),f?{text:f}:{}),e);return qJ(d)?undefined:d}function Yte(e,{legendCmpt:t}){const n=t.get("selections");return(n===null||n===void 0?void 0:n.length)?Object.assign(Object.assign({},e),{fill:{value:"transparent"}}):e}function Xte(e){return Zte(e,(e,t)=>Math.max(e,t.value))}function Jte(e){return Zte(e,(e,t)=>oZ(e,t.value))}function Zte(e,t){if(T5(e)){return Object(oe["i"])(e.condition).reduce(t,e.value)}else if(W5(e)){return e.value}return undefined}function Qte(e,t,n){const i=t.get("selections");if(!(i===null||i===void 0?void 0:i.length))return undefined;const r=Object(oe["ab"])(n.field);return i.map(e=>{const t=Object(oe["ab"])(YJ(e)+Oee);return`(!length(data(${t})) || (${e}[${r}] && indexof(${e}[${r}], datum.value) >= 0))`}).join(" || ")}const Kte={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{const{format:i,formatType:r}=t;return c5(e,e.type,i,r,n,false)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:i}=e;return l5(i,t,n)},gradientLength:e=>{var t,n;const{legend:i,legendConfig:r}=e;return(n=(t=i.gradientLength)!==null&&t!==void 0?t:r.gradientLength)!==null&&n!==void 0?n:ane(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>{var i,r;return(r=(i=e.labelOverlap)!==null&&i!==void 0?i:t.labelOverlap)!==null&&r!==void 0?r:cne(n)},symbolType:({legend:e,markDef:t,channel:n,encoding:i})=>{var r;return(r=e.symbolType)!==null&&r!==void 0?r:tne(t.type,n,i.shape,t.shape)},title:({fieldOrDatumDef:e,config:t})=>a6(e,t,{allowDisabling:true}),type:({legendType:e,scaleType:t,channel:n})=>{if(rK(n)&&D3(t)){if(e==="gradient"){return undefined}}else if(e==="symbol"){return undefined}return e},values:({fieldOrDatumDef:e,legend:t})=>ene(t,e)};function ene(e,t){const n=e.values;if(Object(oe["B"])(n)){return j6(t,n)}else if(S2(n)){return n}return undefined}function tne(e,t,n,i){var r;if(t!=="shape"){const e=(r=Jte(n))!==null&&r!==void 0?r:i;if(e){return e}}switch(e){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}function nne(e){if(e==="gradient"){return 20}return undefined}function ine(e){const{legend:t}=e;return oZ(t.type,rne(e))}function rne({channel:e,timeUnit:t,scaleType:n}){if(rK(e)){if($J(["quarter","month","day"],t)){return"symbol"}if(D3(n)){return"gradient"}}return"symbol"}function one({legendConfig:e,legendType:t,orient:n,legend:i}){var r,o;return(o=(r=i.direction)!==null&&r!==void 0?r:e[t?"gradientDirection":"symbolDirection"])!==null&&o!==void 0?o:sne(n,t)}function sne(e,t){switch(e){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case undefined:return undefined;default:return t==="gradient"?"horizontal":undefined}}function ane({legendConfig:e,model:t,direction:n,orient:i,scaleType:r}){const{gradientHorizontalMaxLength:o,gradientHorizontalMinLength:s,gradientVerticalMaxLength:a,gradientVerticalMinLength:u}=e;if(D3(r)){if(n==="horizontal"){if(i==="top"||i==="bottom"){return une(t,"width",s,o)}else{return s}}else{return une(t,"height",u,a)}}return undefined}function une(e,t,n,i){const r=e.getSizeSignalRef(t).signal;return{signal:`clamp(${r}, ${n}, ${i})`}}function cne(e){if($J(["quantile","threshold","log"],e)){return"greedy"}return undefined}function lne(e){const t=Sre(e)?fne(e):gne(e);e.component.legends=t;return t}function fne(e){const{encoding:t}=e;const n={};for(const i of[CQ,...F4]){const r=h6(t[i]);if(!r||!e.getScaleComponent(i)){continue}if(i===NQ&&z5(r)&&r.type===o3){continue}n[i]=pne(e,i)}return n}function dne(e,t){const n=e.scaleName(t);if(e.mark==="trail"){if(t==="color"){return{stroke:n}}else if(t==="size"){return{strokeWidth:n}}}if(t==="color"){return e.markDef.filled?{fill:n}:{stroke:n}}return{[t]:n}}function hne(e,t,n,i){switch(t){case"disable":return n!==undefined;case"values":return!!(n===null||n===void 0?void 0:n.values);case"title":if(t==="title"&&e===(i===null||i===void 0?void 0:i.title)){return true}}return e===(n||{})[t]}function pne(e,t){var n,i,r;let o=e.legend(t);const{markDef:s,encoding:a,config:u}=e;const c=u.legend;const l=new qte({},dne(e,t));W7(e,t,l);const f=o!==undefined?!o:c.disable;l.set("disable",f,o!==undefined);if(f){return l}o=o||{};const d=e.getScaleComponent(t).get("type");const h=h6(a[t]);const p=z5(h)?(n=A2(h.timeUnit))===null||n===void 0?void 0:n.unit:undefined;const g=o.orient||u.legend.orient||"right";const m=ine({legend:o,channel:t,timeUnit:p,scaleType:d});const b=one({legend:o,legendType:m,orient:g,legendConfig:c});const v={legend:o,channel:t,model:e,markDef:s,encoding:a,fieldOrDatumDef:h,legendConfig:c,config:u,scaleType:d,orient:g,legendType:m,direction:b};for(const O of Ute){if(m==="gradient"&&O.startsWith("symbol")||m==="symbol"&&O.startsWith("gradient")){continue}const n=O in Kte?Kte[O](v):o[O];if(n!==undefined){const i=hne(n,O,o,e.fieldDef(t));if(i||u.legend[O]===undefined){l.set(O,n,i)}}}const y=(i=o===null||o===void 0?void 0:o.encoding)!==null&&i!==void 0?i:{};const x=l.get("selections");const _={};const w={fieldOrDatumDef:h,model:e,channel:t,legendCmpt:l,legendType:m};for(const O of["labels","legend","title","symbols","gradient","entries"]){const t=Bte((r=y[O])!==null&&r!==void 0?r:{},e);const n=O in Wte?Wte[O](t,w):t;if(n!==undefined&&!qJ(n)){_[O]=Object.assign(Object.assign(Object.assign({},(x===null||x===void 0?void 0:x.length)&&z5(h)?{name:`${YJ(h.field)}_legend_${O}`}:{}),(x===null||x===void 0?void 0:x.length)?{interactive:!!x}:{}),{update:n})}}if(!qJ(_)){l.set("encode",_,!!(o===null||o===void 0?void 0:o.encoding))}return l}function gne(e){const{legends:t,resolve:n}=e.component;for(const i of e.children){lne(i);for(const r of WJ(i.component.legends)){n.legend[r]=Ite(e.component.resolve,r);if(n.legend[r]==="shared"){t[r]=mne(t[r],i.component.legends[r]);if(!t[r]){n.legend[r]="independent";delete t[r]}}}}for(const i of WJ(t)){for(const t of e.children){if(!t.component.legends[i]){continue}if(n.legend[i]==="shared"){delete t.component.legends[i]}}}return t}function mne(e,t){var n,i,r,o;if(!e){return t.clone()}const s=e.getWithExplicit("orient");const a=t.getWithExplicit("orient");if(s.explicit&&a.explicit&&s.value!==a.value){return undefined}let u=false;for(const c of Ute){const n=o9(e.getWithExplicit(c),t.getWithExplicit(c),c,"legend",(e,t)=>{switch(c){case"symbolType":return bne(e,t);case"title":return L6(e,t);case"type":u=true;return n9("symbol")}return r9(e,t,c,"legend")});e.setWithExplicit(c,n)}if(u){if((i=(n=e.implicit)===null||n===void 0?void 0:n.encode)===null||i===void 0?void 0:i.gradient){JJ(e.implicit,["encode","gradient"])}if((o=(r=e.explicit)===null||r===void 0?void 0:r.encode)===null||o===void 0?void 0:o.gradient){JJ(e.explicit,["encode","gradient"])}}return e}function bne(e,t){if(t.value==="circle"){return t}return e}function vne(e,t,n,i){var r,o,s;e.encode=(r=e.encode)!==null&&r!==void 0?r:{};e.encode[t]=(o=e.encode[t])!==null&&o!==void 0?o:{};e.encode[t].update=(s=e.encode[t].update)!==null&&s!==void 0?s:{};e.encode[t].update[n]=i}function yne(e){const t=e.component.legends;const n={};for(const r of WJ(t)){const i=e.getScaleComponent(r);const o=SJ(i.get("domains"));if(n[o]){for(const e of n[o]){const i=mne(e,t[r]);if(!i){n[o].push(t[r])}}}else{n[o]=[t[r].clone()]}}const i=GJ(n).flat().map(t=>xne(t,e.config)).filter(e=>e!==undefined);return i}function xne(e,t){var n,i,r;const o=e.combine(),{disable:s,labelExpr:a,selections:u}=o,c=HX(o,["disable","labelExpr","selections"]);if(s){return undefined}if(t.aria===false&&c.aria==undefined){c.aria=false}if((n=c.encode)===null||n===void 0?void 0:n.symbols){const e=c.encode.symbols.update;if(e.fill&&e.fill["value"]!=="transparent"&&!e.stroke&&!c.stroke){e.stroke={value:"transparent"}}for(const t of F4){if(c[t]){delete e[t]}}}if(!c.title){delete c.title}if(a!==undefined){let e=a;if(((r=(i=c.encode)===null||i===void 0?void 0:i.labels)===null||r===void 0?void 0:r.update)&&S2(c.encode.labels.update.text)){e=nZ(a,"datum.label",c.encode.labels.update.text.signal)}vne(c,"labels","text",{signal:e})}return c}function _ne(e){if($re(e)||Cre(e)){return wne(e)}else{return One(e)}}function wne(e){return e.children.reduce((e,t)=>e.concat(t.assembleProjections()),One(e))}function One(e){const t=e.component.projection;if(!t||t.merged){return[]}const n=t.combine();const{name:i}=n;if(!t.data){return[Object.assign(Object.assign({name:i},{translate:{signal:"[width / 2, height / 2]"}}),n)]}else{const r={signal:`[${t.size.map(e=>e.signal).join(", ")}]`};const o=t.data.reduce((t,n)=>{const i=S2(n)?n.signal:`data('${e.lookupDataSource(n)}')`;if(!$J(t,i)){t.push(i)}return t},[]);if(o.length<=0){throw new Error("Projection's fit didn't find any data sources")}return[Object.assign({name:i,size:r,fit:{signal:o.length>1?`[${o.join(", ")}]`:o[0]}},n)]}}const jne=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class kne extends e9{constructor(e,t,n,i){super(Object.assign({},t),{name:e});this.specifiedProjection=t;this.size=n;this.data=i;this.merged=false}get isFit(){return!!this.data}}function Ene(e){e.component.projection=Sre(e)?Ane(e):Mne(e)}function Ane(e){var t;if(e.hasProjection){const n=e.specifiedProjection;const i=!(n&&(n.scale!=null||n.translate!=null));const r=i?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:undefined;const o=i?Dne(e):undefined;return new kne(e.projectionName(true),Object.assign(Object.assign({},(t=e.config.projection)!==null&&t!==void 0?t:{}),n!==null&&n!==void 0?n:{}),r,o)}return undefined}function Dne(e){const t=[];const{encoding:n}=e;for(const i of[[DQ,AQ],[MQ,SQ]]){if(h6(n[i[0]])||h6(n[i[1]])){t.push({signal:e.getName(`geojson_${t.length}`)})}}if(e.channelHasField(NQ)&&e.typedFieldDef(NQ).type===o3){t.push({signal:e.getName(`geojson_${t.length}`)})}if(t.length===0){t.push(e.requestDataName(p9.Main))}return t}function Sne(e,t){const n=NJ(jne,n=>{if(!Object(oe["w"])(e.explicit,n)&&!Object(oe["w"])(t.explicit,n)){return true}if(Object(oe["w"])(e.explicit,n)&&Object(oe["w"])(t.explicit,n)&&SJ(e.get(n))===SJ(t.get(n))){return true}return false});const i=SJ(e.size)===SJ(t.size);if(i){if(n){return e}else if(SJ(e.explicit)===SJ({})){return t}else if(SJ(t.explicit)===SJ({})){return e}}return null}function Mne(e){if(e.children.length===0){return undefined}let t;for(const i of e.children){Ene(i)}const n=NJ(e.children,e=>{const n=e.component.projection;if(!n){return true}else if(!t){t=n;return true}else{const e=Sne(t,n);if(e){t=e}return!!e}});if(t&&n){const n=e.projectionName(true);const i=new kne(n,t.specifiedProjection,t.size,EJ(t.data));for(const t of e.children){const e=t.component.projection;if(e){if(e.isFit){i.data.push(...t.component.projection.data)}t.renameProjection(e.get("name"),n);e.merged=true}}return i}return undefined}function Cne(e,t,n,i){var r,o;if(k6(t,n)){const s=Sre(e)?(o=(r=e.axis(n))!==null&&r!==void 0?r:e.legend(n))!==null&&o!==void 0?o:{}:{};const a=Z5(t,{expr:"datum"});const u=Z5(t,{expr:"datum",binSuffix:"end"});return{formulaAs:Z5(t,{binSuffix:"range",forAs:true}),formula:g5(a,u,s.format,s.formatType,i)}}return{}}function $ne(e,t){return`${m0(e)}_${t}`}function Fne(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}function Nne(e,t,n){var i;const r=(i=v6(n,undefined))!==null&&i!==void 0?i:{};const o=$ne(r,t);return e.getName(`${o}_bins`)}function Tne(e){return"as"in e}function zne(e,t,n){let i;let r;if(Tne(e)){i=Object(oe["I"])(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]}else{i=[Z5(e,{forAs:true}),Z5(e,{binSuffix:"end",forAs:true})]}const o=Object.assign({},v6(t,undefined));const s=$ne(o,e.field);const{signal:a,extentSignal:u}=Fne(n,s);if(x0(o.extent)){const e=o.extent;const t=e.selection;r=Pee(n.getSelectionComponent(YJ(t),t),e);delete o.extent}const c=Object.assign(Object.assign(Object.assign({bin:o,field:e.field,as:[i]},a?{signal:a}:{}),u?{extentSignal:u}:{}),r?{span:r}:{});return{key:s,binComponent:c}}class Rne extends j7{constructor(e,t){super(e);this.bins=t}clone(){return new Rne(null,EJ(this.bins))}static makeFromEncoding(e,t){const n=t.reduceFieldDef((e,n,i)=>{if(q5(n)&&b0(n.bin)){const{key:r,binComponent:o}=zne(n,n.bin,t);e[r]=Object.assign(Object.assign(Object.assign({},o),e[r]),Cne(t,n,i,t.config))}return e},{});if(qJ(n)){return null}return new Rne(e,n)}static makeFromTransform(e,t,n){const{key:i,binComponent:r}=zne(t,t.bin,n);return new Rne(e,{[i]:r})}merge(e,t){for(const n of WJ(e.bins)){if(n in this.bins){t(e.bins[n].signal,this.bins[n].signal);this.bins[n].as=RJ([...this.bins[n].as,...e.bins[n].as],MJ)}else{this.bins[n]=e.bins[n]}}for(const n of e.children){e.removeChild(n);n.parent=this}e.remove()}producedFields(){return new Set(GJ(this.bins).map(e=>e.as).flat(2))}dependentFields(){return new Set(GJ(this.bins).map(e=>e.field))}hash(){return`Bin ${MJ(this.bins)}`}assemble(){return GJ(this.bins).flatMap(e=>{const t=[];const[n,...i]=e.as;const r=e.bin,{extent:o}=r,s=HX(r,["extent"]);const a=Object.assign(Object.assign(Object.assign({type:"bin",field:tZ(e.field),as:n,signal:e.signal},!x0(o)?{extent:o}:{extent:null}),e.span?{span:{signal:`span(${e.span})`}}:{}),s);if(!o&&e.extentSignal){t.push({type:"extent",field:tZ(e.field),signal:e.extentSignal});a.extent={signal:e.extentSignal}}t.push(a);for(const u of i){for(let e=0;e<2;e++){t.push({type:"formula",expr:Z5({field:n[e]},{expr:"datum"}),as:u[e]})}}if(e.formula){t.push({type:"formula",expr:e.formula,as:e.formulaAs})}return t})}}function Bne(e,t,n,i){const r=Sre(i)?i.encoding[kK(t)]:undefined;if(q5(n)&&Sre(i)&&C5(t,n,r,i.stack,i.markDef,i.config)){e.add(Z5(n,{}));e.add(Z5(n,{suffix:"end"}));if(n.bin&&k6(n,t)){e.add(Z5(n,{binSuffix:"range"}))}}else if(tK(t)){const n=eK(t);e.add(i.getName(n))}else{e.add(Z5(n))}return e}function Pne(e,t){var n;for(const i of WJ(t)){const r=t[i];for(const t of WJ(r)){if(i in e){e[i][t]=new Set([...(n=e[i][t])!==null&&n!==void 0?n:[],...r[t]])}else{e[i]={[t]:r[t]}}}}}class Ine extends j7{constructor(e,t,n){super(e);this.dimensions=t;this.measures=n}clone(){return new Ine(null,new Set(this.dimensions),EJ(this.measures))}get groupBy(){return this.dimensions}static makeFromEncoding(e,t){let n=false;t.forEachFieldDef(e=>{if(e.aggregate){n=true}});const i={};const r=new Set;if(!n){return null}t.forEachFieldDef((e,n)=>{var o,s,a,u;const{aggregate:c,field:l}=e;if(c){if(c==="count"){i["*"]=(o=i["*"])!==null&&o!==void 0?o:{};i["*"]["count"]=new Set([Z5(e,{forAs:true})])}else{if(sQ(c)||aQ(c)){const e=sQ(c)?"argmin":"argmax";const t=c[e];i[t]=(s=i[t])!==null&&s!==void 0?s:{};i[t][e]=new Set([Z5({op:e,field:t},{forAs:true})])}else{i[l]=(a=i[l])!==null&&a!==void 0?a:{};i[l][c]=new Set([Z5(e,{forAs:true})])}if(c0(n)&&t.scaleDomain(n)==="unaggregated"){i[l]=(u=i[l])!==null&&u!==void 0?u:{};i[l]["min"]=new Set([Z5({field:l,aggregate:"min"},{forAs:true})]);i[l]["max"]=new Set([Z5({field:l,aggregate:"max"},{forAs:true})])}}}else{Bne(r,n,e,t)}});if(r.size+WJ(i).length===0){return null}return new Ine(e,r,i)}static makeFromTransform(e,t){var n,i,r;const o=new Set;const s={};for(const a of t.aggregate){const{op:e,field:t,as:r}=a;if(e){if(e==="count"){s["*"]=(n=s["*"])!==null&&n!==void 0?n:{};s["*"]["count"]=new Set([r?r:Z5(a,{forAs:true})])}else{s[t]=(i=s[t])!==null&&i!==void 0?i:{};s[t][e]=new Set([r?r:Z5(a,{forAs:true})])}}}for(const a of(r=t.groupby)!==null&&r!==void 0?r:[]){o.add(a)}if(o.size+WJ(s).length===0){return null}return new Ine(e,o,s)}merge(e){if(PJ(this.dimensions,e.dimensions)){Pne(this.measures,e.measures);return true}else{e2("different dimensions, cannot merge");return false}}addDimensions(e){e.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...WJ(this.measures)])}producedFields(){const e=new Set;for(const t of WJ(this.measures)){for(const n of WJ(this.measures[t])){const i=this.measures[t][n];if(i.size===0){e.add(`${n}_${t}`)}else{i.forEach(e.add,e)}}}return e}hash(){return`Aggregate ${MJ({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const e=[];const t=[];const n=[];for(const r of WJ(this.measures)){for(const i of WJ(this.measures[r])){for(const o of this.measures[r][i]){n.push(o);e.push(i);t.push(r==="*"?null:tZ(r))}}}const i={type:"aggregate",groupby:[...this.dimensions].map(tZ),ops:e,fields:t,as:n};return i}}class Lne extends j7{constructor(e,t,n,i){super(e);this.model=t;this.name=n;this.data=i;for(const r of sK){const e=t.facet[r];if(e){const{bin:n,sort:i}=e;this[r]=Object.assign({name:t.getName(`${r}_domain`),fields:[Z5(e),...b0(n)?[Z5(e,{binSuffix:"end"})]:[]]},_5(i)?{sortField:i}:Object(oe["B"])(i)?{sortIndexField:mte(e,r)}:{})}}this.childModel=t.child}hash(){let e=`Facet`;for(const t of sK){if(this[t]){e+=` ${t.charAt(0)}:${MJ(this[t])}`}}return e}get fields(){var e;const t=[];for(const n of sK){if((e=this[n])===null||e===void 0?void 0:e.fields){t.push(...this[n].fields)}}return t}dependentFields(){const e=new Set(this.fields);for(const t of sK){if(this[t]){if(this[t].sortField){e.add(this[t].sortField.field)}if(this[t].sortIndexField){e.add(this[t].sortIndexField)}}}return e}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const e={};for(const t of WK){const n=this.childModel.component.scales[t];if(n&&!n.merged){const i=n.get("type");const r=n.get("range");if(E3(i)&&M2(r)){const n=Wie(this.childModel,t);const i=qie(n);if(i){e[t]=i}else{Q1(b.unknownField(t))}}}}return e}assembleRowColumnHeaderData(e,t,n){const i={row:"y",column:"x"}[e];const r=[];const o=[];const s=[];if(n&&n[i]){if(t){r.push(`distinct_${n[i]}`);o.push("max")}else{r.push(n[i]);o.push("distinct")}s.push(`distinct_${n[i]}`)}const{sortField:a,sortIndexField:u}=this[e];if(a){const{op:e=b5,field:t}=a;r.push(t);o.push(e);s.push(Z5(a,{forAs:true}))}else if(u){r.push(u);o.push("max");s.push(u)}return{name:this[e].name,source:t!==null&&t!==void 0?t:this.data,transform:[Object.assign({type:"aggregate",groupby:this[e].fields},r.length?{fields:r,ops:o,as:s}:{})]}}assembleFacetHeaderData(e){var t,n;const{columns:i}=this.model.layout;const{layoutHeaders:r}=this.model.component;const o=[];const s={};for(const c of xte){for(const e of _te){const i=(t=r[c]&&r[c][e])!==null&&t!==void 0?t:[];for(const e of i){if(((n=e.axes)===null||n===void 0?void 0:n.length)>0){s[c]=true;break}}}if(s[c]){const e=`length(data("${this.facet.name}"))`;const t=c==="row"?i?{signal:`ceil(${e} / ${i})`}:1:i?{signal:`min(${e}, ${i})`}:{signal:e};o.push({name:`${this.facet.name}_${c}`,transform:[{type:"sequence",start:0,stop:t}]})}}const{row:a,column:u}=s;if(a||u){o.unshift(this.assembleRowColumnHeaderData("facet",null,e))}return o}assemble(){var e,t;const n=[];let i=null;const r=this.getChildIndependentFieldsWithStep();const{column:o,row:s,facet:a}=this;if(o&&s&&(r.x||r.y)){i=`cross_${this.column.name}_${this.row.name}`;const o=[].concat((e=r.x)!==null&&e!==void 0?e:[],(t=r.y)!==null&&t!==void 0?t:[]);const s=o.map(()=>"distinct");n.push({name:i,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:o,ops:s}]})}for(const u of[bQ,mQ]){if(this[u]){n.push(this.assembleRowColumnHeaderData(u,i,r))}}if(a){const e=this.assembleFacetHeaderData(r);if(e){n.push(...e)}}return n}}function Une(e){if(e[0]==="'"&&e[e.length-1]==="'"||e[0]==='"'&&e[e.length-1]==='"'){return e.slice(1,-1)}return e}function qne(e,t){const n=QJ(e);if(t==="number"){return`toNumber(${n})`}else if(t==="boolean"){return`toBoolean(${n})`}else if(t==="string"){return`toString(${n})`}else if(t==="date"){return`toDate(${n})`}else if(t==="flatten"){return n}else if(t.indexOf("date:")===0){const e=Une(t.slice(5,t.length));return`timeParse(${n},'${e}')`}else if(t.indexOf("utc:")===0){const e=Une(t.slice(4,t.length));return`utcParse(${n},'${e}')`}else{Q1(b.unrecognizedParse(t));return null}}function Wne(e){const t={};OJ(e.filter,e=>{var n;if(V2(e)){let i=null;if(P2(e)){i=e.equal}else if(L2(e)){i=e.lte}else if(I2(e)){i=e.lt}else if(U2(e)){i=e.gt}else if(q2(e)){i=e.gte}else if(W2(e)){i=e.range[0]}else if(G2(e)){i=((n=e.oneOf)!==null&&n!==void 0?n:e["in"])[0]}if(i){if(t2(i)){t[e.field]="date"}else if(Object(oe["F"])(i)){t[e.field]="number"}else if(Object(oe["I"])(i)){t[e.field]="string"}}if(e.timeUnit){t[e.field]="date"}}});return t}function Gne(e){const t={};function n(e){if(_6(e)){t[e.field]="date"}else if(e.type==="quantitative"&&dQ(e.aggregate)){t[e.field]="number"}else if(rZ(e.field)>1){if(!(e.field in t)){t[e.field]="flatten"}}else if(G5(e)&&_5(e.sort)&&rZ(e.sort.field)>1){if(!(e.sort.field in t)){t[e.sort.field]="flatten"}}}if(Sre(e)||Mre(e)){e.forEachFieldDef((t,i)=>{if(q5(t)){n(t)}else{const r=OK(i);const o=e.fieldDef(r);n(Object.assign(Object.assign({},t),{type:o.type}))}})}if(Sre(e)){const{mark:n,markDef:i,encoding:r}=e;if(RZ(n)&&!e.encoding.order){const e=i.orient==="horizontal"?"y":"x";const n=r[e];if(z5(n)&&n.type==="quantitative"&&!(n.field in t)){t[n.field]="number"}}}return t}function Hne(e){const t={};if(Sre(e)&&e.component.selection){for(const n of WJ(e.component.selection)){const i=e.component.selection[n];for(const e of i.project.items){if(!e.channel&&rZ(e.field)>1){t[e.field]="flatten"}}}}return t}class Vne extends j7{constructor(e,t){super(e);this._parse=t}clone(){return new Vne(null,EJ(this._parse))}hash(){return`Parse ${MJ(this._parse)}`}static makeExplicit(e,t,n){let i={};const r=t.data;if(!l9(r)&&r&&r.format&&r.format.parse){i=r.format.parse}return this.makeWithAncestors(e,i,{},n)}static makeWithAncestors(e,t,n,i){for(const s of WJ(n)){const e=i.getWithExplicit(s);if(e.value!==undefined){if(e.explicit||e.value===n[s]||e.value==="derived"||n[s]==="flatten"){delete n[s]}else{Q1(b.differentParse(s,n[s],e.value))}}}for(const s of WJ(t)){const e=i.get(s);if(e!==undefined){if(e===t[s]){delete t[s]}else{Q1(b.differentParse(s,t[s],e))}}}const r=new e9(t,n);i.copyAll(r);const o={};for(const s of WJ(r.combine())){const e=r.get(s);if(e!==null){o[s]=e}}if(WJ(o).length===0||i.parseNothing){return null}return new Vne(e,o)}get parse(){return this._parse}merge(e){this._parse=Object.assign(Object.assign({},this._parse),e.parse);e.remove()}assembleFormatParse(){const e={};for(const t of WJ(this._parse)){const n=this._parse[t];if(rZ(t)===1){e[t]=n}}return e}producedFields(){return new Set(WJ(this._parse))}dependentFields(){return new Set(WJ(this._parse))}assembleTransforms(e=false){return WJ(this._parse).filter(t=>e?rZ(t)>1:true).map(e=>{const t=qne(e,this._parse[e]);if(!t){return null}const n={type:"formula",expr:t,as:iZ(e)};return n}).filter(e=>e!==null)}}class Yne extends j7{clone(){return new Yne(null)}constructor(e){super(e)}dependentFields(){return new Set}producedFields(){return new Set([R4])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:R4}}}class Xne extends j7{constructor(e,t){super(e);this.params=t}clone(){return new Xne(null,this.params)}dependentFields(){return new Set}producedFields(){return undefined}hash(){return`Graticule ${MJ(this.params)}`}assemble(){return Object.assign({type:"graticule"},this.params===true?{}:this.params)}}class Jne extends j7{constructor(e,t){super(e);this.params=t}clone(){return new Jne(null,this.params)}dependentFields(){return new Set}producedFields(){var e;return new Set([(e=this.params.as)!==null&&e!==void 0?e:"data"])}hash(){return`Hash ${MJ(this.params)}`}assemble(){return Object.assign({type:"sequence"},this.params)}}class Zne extends j7{constructor(e){super(null);e=e!==null&&e!==void 0?e:{name:"source"};let t;if(!l9(e)){t=e.format?Object.assign({},DJ(e.format,["parse"])):{}}if(u9(e)){this._data={values:e.values}}else if(a9(e)){this._data={url:e.url};if(!t.type){let n=/(?:\.([^.]+))?$/.exec(e.url)[1];if(!$J(["json","csv","tsv","dsv","topojson"],n)){n="json"}t.type=n}}else if(d9(e)){this._data={values:[{type:"Sphere"}]}}else if(c9(e)||l9(e)){this._data={}}this._generator=l9(e);if(e.name){this._name=e.name}if(t&&!qJ(t)){this._data.format=t}}dependentFields(){return new Set}producedFields(){return undefined}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(e){this._name=e}set parent(e){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return Object.assign(Object.assign({name:this._name},this._data),{transform:[]})}}var Qne;function Kne(e){return e instanceof Zne||e instanceof Xne||e instanceof Jne}class eie{constructor(){Qne.set(this,void 0);hJ(this,Qne,false)}setModified(){hJ(this,Qne,true)}get modifiedFlag(){return dJ(this,Qne)}}Qne=new WeakMap;class tie extends eie{getNodeDepths(e,t,n){n.set(e,t);for(const i of e.children){this.getNodeDepths(i,t+1,n)}return n}optimize(e){const t=this.getNodeDepths(e,0,new Map);const n=[...t.entries()].sort((e,t)=>t[1]-e[1]);for(const i of n){this.run(i[0])}return this.modifiedFlag}}class nie extends eie{optimize(e){this.run(e);for(const t of e.children){this.optimize(t)}return this.modifiedFlag}}class iie extends nie{mergeNodes(e,t){const n=t.shift();for(const i of t){e.removeChild(i);i.parent=n;i.remove()}}run(e){const t=e.children.map(e=>e.hash());const n={};for(let i=0;i1){this.setModified();this.mergeNodes(e,n[i])}}}}class rie extends nie{constructor(e){super();this.requiresSelectionId=e&&$ee(e)}run(e){if(e instanceof Yne){if(!(this.requiresSelectionId&&(Kne(e.parent)||e.parent instanceof Ine||e.parent instanceof Vne))){this.setModified();e.remove()}}}}class oie extends eie{optimize(e){this.run(e,new Set);return this.modifiedFlag}run(e,t){let n=new Set;if(e instanceof E7){n=e.producedFields();if(IJ(n,t)){this.setModified();e.removeFormulas(t);if(e.producedFields.length===0){e.remove()}}}for(const i of e.children){this.run(i,new Set([...t,...n]))}}}class sie extends nie{constructor(){super()}run(e){if(e instanceof k7&&!e.isRequired()){this.setModified();e.remove()}}}class aie extends tie{run(e){if(Kne(e)){return}if(e.numChildren()>1){return}for(const t of e.children){if(t instanceof Vne){if(e instanceof Vne){this.setModified();e.merge(t)}else{if(UJ(e.producedFields(),t.dependentFields())){continue}this.setModified();t.swapWithParent()}}}return}}class uie extends tie{run(e){const t=[...e.children];const n=e.children.filter(e=>e instanceof Vne);if(e.numChildren()>1&&n.length>=1){const i={};const r=new Set;for(const e of n){const t=e.parse;for(const e of WJ(t)){if(!(e in i)){i[e]=t[e]}else if(i[e]!==t[e]){r.add(e)}}}for(const e of r){delete i[e]}if(!qJ(i)){this.setModified();const n=new Vne(e,i);for(const r of t){if(r instanceof Vne){for(const e of WJ(i)){delete r.parse[e]}}e.removeChild(r);r.parent=n;if(r instanceof Vne&&WJ(r.parse).length===0){r.remove()}}}}}}class cie extends tie{run(e){if(e instanceof k7||e.numChildren()>0||e instanceof Lne){}else{this.setModified();e.remove()}}}class lie extends tie{run(e){const t=e.children.filter(e=>e instanceof E7);const n=t.pop();for(const i of t){this.setModified();n.merge(i)}}}class fie extends tie{run(e){const t=e.children.filter(e=>e instanceof Ine);const n={};for(const i of t){const e=MJ(i.groupBy);if(!(e in n)){n[e]=[]}n[e].push(i)}for(const i of WJ(n)){const t=n[i];if(t.length>1){const n=t.pop();for(const i of t){if(n.merge(i)){e.removeChild(i);i.parent=n;i.remove();this.setModified()}}}}}}class die extends tie{constructor(e){super();this.model=e}run(e){const t=!(Kne(e)||e instanceof zee||e instanceof Vne||e instanceof Yne);const n=[];const i=[];for(const r of e.children){if(r instanceof Rne){if(t&&!UJ(e.producedFields(),r.dependentFields())){n.push(r)}else{i.push(r)}}}if(n.length>0){const t=n.pop();for(const e of n){t.merge(e,this.model.renameSignal.bind(this.model))}this.setModified();if(e instanceof Rne){e.merge(t,this.model.renameSignal.bind(this.model))}else{t.swapWithParent()}}if(i.length>1){const e=i.pop();for(const t of i){e.merge(t,this.model.renameSignal.bind(this.model))}this.setModified()}}}class hie extends tie{run(e){const t=[...e.children];const n=FJ(t,e=>e instanceof k7);if(!n||e.numChildren()<=1){return}const i=[];let r;for(const o of t){if(o instanceof k7){let t=o;while(t.numChildren()===1){const[e]=t.children;if(e instanceof k7){t=e}else{break}}i.push(...t.children);if(r){e.removeChild(o);o.parent=r.parent;r.parent.removeChild(r);r.parent=t;this.setModified()}else{r=t}}else{i.push(o)}}if(i.length){this.setModified();for(const e of i){e.parent.removeChild(e);e.parent=r}}}}class pie extends j7{constructor(e,t){super(e);this.transform=t}clone(){return new pie(null,EJ(this.transform))}addDimensions(e){this.transform.groupby=RJ(this.transform.groupby.concat(e),e=>e)}dependentFields(){const e=new Set;if(this.transform.groupby){this.transform.groupby.forEach(e.add,e)}this.transform.joinaggregate.map(e=>e.field).filter(e=>e!==undefined).forEach(e.add,e);return e}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(e){var t;return(t=e.as)!==null&&t!==void 0?t:Z5(e)}hash(){return`JoinAggregateTransform ${MJ(this.transform)}`}assemble(){const e=[];const t=[];const n=[];for(const r of this.transform.joinaggregate){t.push(r.op);n.push(this.getDefaultName(r));e.push(r.field===undefined?null:r.field)}const i=this.transform.groupby;return Object.assign({type:"joinaggregate",as:n,ops:t,fields:e},i!==undefined?{groupby:i}:{})}}function gie(e){return e.stack.stackBy.reduce((e,t)=>{const n=t.fieldDef;const i=Z5(n);if(i){e.push(i)}return e},[])}function mie(e){return Object(oe["B"])(e)&&e.every(e=>Object(oe["I"])(e))&&e.length>1}class bie extends j7{constructor(e,t){super(e);this._stack=t}clone(){return new bie(null,EJ(this._stack))}static makeFromTransform(e,t){const{stack:n,groupby:i,as:r,offset:o="zero"}=t;const s=[];const a=[];if(t.sort!==undefined){for(const e of t.sort){s.push(e.field);a.push(oZ(e.order,"ascending"))}}const u={field:s,order:a};let c;if(mie(r)){c=r}else if(Object(oe["I"])(r)){c=[r,r+"_end"]}else{c=[t.stack+"_start",t.stack+"_end"]}return new bie(e,{stackField:n,groupby:i,offset:o,sort:u,facetby:[],as:c})}static makeFromEncoding(e,t){const n=t.stack;const{encoding:i}=t;if(!n){return null}const{groupbyChannel:r,fieldChannel:o,offset:s,impute:a}=n;let u;if(r){const e=i[r];u=d6(e)}const c=gie(t);const l=t.encoding.order;let f;if(Object(oe["B"])(l)||z5(l)){f=B6(l)}else{f=c.reduce((e,t)=>{e.field.push(t);e.order.push(o==="y"?"descending":"ascending");return e},{field:[],order:[]})}return new bie(e,{dimensionFieldDef:u,stackField:t.vgField(o),facetby:[],stackby:c,sort:f,offset:s,impute:a,as:[t.vgField(o,{suffix:"start",forAs:true}),t.vgField(o,{suffix:"end",forAs:true})]})}get stack(){return this._stack}addDimensions(e){this._stack.facetby.push(...e)}dependentFields(){const e=new Set;e.add(this._stack.stackField);this.getGroupbyFields().forEach(e.add,e);this._stack.facetby.forEach(e.add,e);this._stack.sort.field.forEach(e.add,e);return e}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${MJ(this._stack)}`}getGroupbyFields(){const{dimensionFieldDef:e,impute:t,groupby:n}=this._stack;if(e){if(e.bin){if(t){return[Z5(e,{binSuffix:"mid"})]}return[Z5(e,{}),Z5(e,{binSuffix:"end"})]}return[Z5(e)]}return n!==null&&n!==void 0?n:[]}assemble(){const e=[];const{facetby:t,dimensionFieldDef:n,stackField:i,stackby:r,sort:o,offset:s,impute:a,as:u}=this._stack;if(a&&n){const{band:o=.5,bin:s}=n;if(s){e.push({type:"formula",expr:`${o}*`+Z5(n,{expr:"datum"})+`+${1-o}*`+Z5(n,{expr:"datum",binSuffix:"end"}),as:Z5(n,{binSuffix:"mid",forAs:true})})}e.push({type:"impute",field:i,groupby:[...r,...t],key:Z5(n,{binSuffix:"mid"}),method:"value",value:0})}e.push({type:"stack",groupby:[...this.getGroupbyFields(),...t],field:i,sort:o,as:u,offset:s});return e}}class vie extends j7{constructor(e,t){super(e);this.transform=t}clone(){return new vie(null,EJ(this.transform))}addDimensions(e){this.transform.groupby=RJ(this.transform.groupby.concat(e),e=>e)}dependentFields(){var e,t;const n=new Set;((e=this.transform.groupby)!==null&&e!==void 0?e:[]).forEach(n.add,n);((t=this.transform.sort)!==null&&t!==void 0?t:[]).forEach(e=>n.add(e.field));this.transform.window.map(e=>e.field).filter(e=>e!==undefined).forEach(n.add,n);return n}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(e){var t;return(t=e.as)!==null&&t!==void 0?t:Z5(e)}hash(){return`WindowTransform ${MJ(this.transform)}`}assemble(){var e;const t=[];const n=[];const i=[];const r=[];for(const f of this.transform.window){n.push(f.op);i.push(this.getDefaultName(f));r.push(f.param===undefined?null:f.param);t.push(f.field===undefined?null:f.field)}const o=this.transform.frame;const s=this.transform.groupby;if(o&&o[0]===null&&o[1]===null&&n.every(e=>cQ(e))){return Object.assign({type:"joinaggregate",as:i,ops:n,fields:t},s!==undefined?{groupby:s}:{})}const a=[];const u=[];if(this.transform.sort!==undefined){for(const t of this.transform.sort){a.push(t.field);u.push((e=t.order)!==null&&e!==void 0?e:"ascending")}}const c={field:a,order:u};const l=this.transform.ignorePeers;return Object.assign(Object.assign(Object.assign({type:"window",params:r,as:i,ops:n,fields:t,sort:c},l!==undefined?{ignorePeers:l}:{}),s!==undefined?{groupby:s}:{}),o!==undefined?{frame:o}:{})}}function yie(e){function t(n){if(!(n instanceof Lne)){const i=n.clone();if(i instanceof k7){const t=wie+i.getSource();i.setSource(t);e.model.component.data.outputNodes[t]=i}else if(i instanceof Ine||i instanceof bie||i instanceof vie||i instanceof pie){i.addDimensions(e.fields)}for(const e of n.children.flatMap(t)){e.parent=i}return[i]}return n.children.flatMap(t)}return t}function xie(e){if(e instanceof Lne){if(e.numChildren()===1&&!(e.children[0]instanceof k7)){const t=e.children[0];if(t instanceof Ine||t instanceof bie||t instanceof vie||t instanceof pie){t.addDimensions(e.fields)}t.swapWithParent();xie(e)}else{const t=e.model.component.data.main;_ie(t);const n=yie(e);const i=e.children.map(n).flat();for(const e of i){e.parent=t}}}else{e.children.map(xie)}}function _ie(e){if(e instanceof k7&&e.type===p9.Main){if(e.numChildren()===1){const t=e.children[0];if(!(t instanceof Lne)){t.swapWithParent();_ie(e)}}}}const wie="scale_";const Oie=5;function jie(e){for(const t of e){for(const e of t.children){if(e.parent!==t){return false}}if(!jie(t.children)){return false}}return true}function kie(e,t){let n=false;for(const i of t){n=e.optimize(i)||n}return n}function Eie(e,t,n){let i=e.sources;let r=false;r=kie(new sie,i)||r;r=kie(new rie(t),i)||r;i=i.filter(e=>e.numChildren()>0);r=kie(new cie,i)||r;i=i.filter(e=>e.numChildren()>0);if(!n){r=kie(new aie,i)||r;r=kie(new die(t),i)||r;r=kie(new oie,i)||r;r=kie(new uie,i)||r;r=kie(new fie,i)||r;r=kie(new lie,i)||r;r=kie(new iie,i)||r;r=kie(new hie,i)||r}e.sources=i;return r}function Aie(e,t){jie(e.sources);let n=0;let i=0;for(let r=0;re(t))}}function Sie(e){if(Sre(e)){Mie(e)}else{Cie(e)}}function Mie(e){const t=e.component.scales;for(const n of WJ(t)){const i=Fie(e,n);const r=t[n];r.setWithExplicit("domains",i);Bie(e,n);if(e.component.data.isFaceted){let t=e;while(!Mre(t)&&t.parent){t=t.parent}const r=t.component.resolve.scale[n];if(r==="shared"){for(const e of i.value){if(F2(e)){e.data=wie+e.data.replace(wie,"")}}}}}}function Cie(e){for(const n of e.children){Sie(n)}const t=e.component.scales;for(const n of WJ(t)){let i;let r=null;for(const t of e.children){const e=t.component.scales[n];if(e){if(i===undefined){i=e.getWithExplicit("domains")}else{i=o9(i,e.getWithExplicit("domains"),"domains","scale",Lie)}const t=e.get("selectionExtent");if(r&&t&&r.selection!==t.selection){Q1(b.NEEDS_SAME_SELECTION)}r=t}}t[n].setWithExplicit("domains",i);if(r){t[n].set("selectionExtent",r,true)}}}function $ie(e,t,n,i){if(e==="unaggregated"){const{valid:e,reason:i}=Iie(t,n);if(!e){Q1(i);return undefined}}else if(e===undefined&&i.useUnaggregatedDomain){const{valid:e}=Iie(t,n);if(e){return"unaggregated"}}return e}function Fie(e,t){const n=e.getScaleComponent(t).get("type");const{encoding:i}=e;const r=$ie(e.scaleDomain(t),e.typedFieldDef(t),n,e.config.scale);if(r!==e.scaleDomain(t)){e.specifiedScales[t]=Object.assign(Object.assign({},e.specifiedScales[t]),{domain:r})}if(t==="x"&&h6(i.x2)){if(h6(i.x)){return o9(zie(n,r,e,"x"),zie(n,r,e,"x2"),"domain","scale",Lie)}else{return zie(n,r,e,"x2")}}else if(t==="y"&&h6(i.y2)){if(h6(i.y)){return o9(zie(n,r,e,"y"),zie(n,r,e,"y2"),"domain","scale",Lie)}else{return zie(n,r,e,"y2")}}return zie(n,r,e,t)}function Nie(e,t,n){return e.map(e=>{const i=O6(e,{timeUnit:n,type:t});return{signal:`{data: ${i}}`}})}function Tie(e,t,n){var i;const r=(i=A2(n))===null||i===void 0?void 0:i.unit;if(t==="temporal"||r){return Nie(e,t,r)}return[e]}function zie(e,t,n,i){const{encoding:r}=n;const o=h6(r[i]);const{type:s}=o;const a=o["timeUnit"];if(F3(t)){const r=zie(e,undefined,n,i);const o=Tie(t.unionWith,s,a);return t9([...r.value,...o])}else if(S2(t)){return t9([t])}else if(t&&t!=="unaggregated"&&!$3(t)){return t9(Tie(t,s,a))}const u=n.stack;if(u&&i===u.fieldChannel){if(u.offset==="normalize"){return n9([[0,1]])}const e=n.requestDataName(p9.Main);return n9([{data:e,field:n.vgField(i,{suffix:"start"})},{data:e,field:n.vgField(i,{suffix:"end"})}])}const c=c0(i)&&z5(o)?Pie(n,i,e):undefined;if(B5(o)){const e=Tie([o.datum],s,a);return n9(e)}const l=o;if(t==="unaggregated"){const e=n.requestDataName(p9.Main);const{field:t}=o;return n9([{data:e,field:Z5({field:t,aggregate:"min"})},{data:e,field:Z5({field:t,aggregate:"max"})}])}else if(b0(l.bin)){if(E3(e)){if(e==="bin-ordinal"){return n9([])}return n9([{data:VJ(c)?n.requestDataName(p9.Main):n.requestDataName(p9.Raw),field:n.vgField(i,k6(l,i)?{binSuffix:"range"}:{}),sort:c===true||!Object(oe["G"])(c)?{field:n.vgField(i,{}),op:"min"}:c}])}else{const{bin:e}=l;if(b0(e)){const t=Nne(n,l.field,e);return n9([new Die(()=>{const e=n.getSignalName(t);return`[${e}.start, ${e}.stop]`})])}else{return n9([{data:n.requestDataName(p9.Main),field:n.vgField(i,{})}])}}}else if(l.timeUnit&&$J(["time","utc"],e)&&C5(i,l,Sre(n)?n.encoding[kK(i)]:undefined,n.stack,n.markDef,n.config)){const e=n.requestDataName(p9.Main);return n9([{data:e,field:n.vgField(i)},{data:e,field:n.vgField(i,{suffix:"end"})}])}else if(c){return n9([{data:VJ(c)?n.requestDataName(p9.Main):n.requestDataName(p9.Raw),field:n.vgField(i),sort:c}])}else{return n9([{data:n.requestDataName(p9.Main),field:n.vgField(i)}])}}function Rie(e,t){const{op:n,field:i,order:r}=e;return Object.assign(Object.assign({op:n!==null&&n!==void 0?n:t?"sum":b5},i?{field:tZ(i)}:{}),r?{order:r}:{})}function Bie(e,t){var n;const i=e.component.scales[t];const r=e.specifiedScales[t].domain;const o=(n=e.fieldDef(t))===null||n===void 0?void 0:n.bin;const s=$3(r)&&r;const a=y0(o)&&x0(o.extent)&&o.extent;if(s||a){i.set("selectionExtent",s!==null&&s!==void 0?s:a,true)}}function Pie(e,t,n){if(!E3(n)){return undefined}const i=e.fieldDef(t);const r=i.sort;if(w5(r)){return{op:"min",field:mte(i,t),order:"ascending"}}const{stack:o}=e;const s=o?[...o.groupbyField?[o.groupbyField]:[],...o.stackBy.map(e=>e.fieldDef.field)]:undefined;if(_5(r)){const e=o&&!$J(s,r.field);return Rie(r,e)}else if(x5(r)){const{encoding:t,order:n}=r;const i=e.fieldDef(t);const{aggregate:a,field:u}=i;const c=o&&!$J(s,u);if(sQ(a)||aQ(a)){return Rie({field:Z5(i),order:n},c)}else if(cQ(a)||!a){return Rie({op:a,field:u,order:n},c)}}else if(r==="descending"){return{op:"min",field:e.vgField(t),order:"descending"}}else if($J(["ascending",undefined],r)){return true}return undefined}function Iie(e,t){const{aggregate:n,type:i}=e;if(!n){return{valid:false,reason:b.unaggregateDomainHasNoEffectForRawField(e)}}if(Object(oe["I"])(n)&&!gQ[n]){return{valid:false,reason:b.unaggregateDomainWithNonSharedDomainOp(n)}}if(i==="quantitative"){if(t==="log"){return{valid:false,reason:b.unaggregatedDomainWithLogScale(e)}}}return{valid:true}}function Lie(e,t,n,i){if(e.explicit&&t.explicit){Q1(b.mergeConflictingDomainProperty(n,i,e.value,t.value))}return{explicit:e.explicit,value:[...e.value,...t.value]}}function Uie(e){const t=RJ(e.map(e=>{if(F2(e)){const{sort:t}=e,n=HX(e,["sort"]);return n}return e}),MJ);const n=RJ(e.map(e=>{if(F2(e)){const t=e.sort;if(t!==undefined&&!VJ(t)){if("op"in t&&t.op==="count"){delete t.field}if(t.order==="ascending"){delete t.order}}return t}return undefined}).filter(e=>e!==undefined),MJ);if(t.length===0){return undefined}else if(t.length===1){const t=e[0];if(F2(t)&&n.length>0){let e=n[0];if(n.length>1){Q1(b.MORE_THAN_ONE_SORT);e=true}else{if(Object(oe["G"])(e)&&"field"in e){const n=e.field;if(t.field===n){e=e.order?{order:e.order}:true}}}return Object.assign(Object.assign({},t),{sort:e})}return t}const i=RJ(n.map(e=>{if(VJ(e)||!("op"in e)||Object(oe["I"])(e.op)&&e.op in oQ){return e}Q1(b.domainSortDropped(e));return true}),MJ);let r;if(i.length===1){r=i[0]}else if(i.length>1){Q1(b.MORE_THAN_ONE_SORT);r=true}const o=RJ(e.map(e=>{if(F2(e)){return e.data}return null}),e=>e);if(o.length===1&&o[0]!==null){const e=Object.assign({data:o[0],fields:t.map(e=>e.field)},r?{sort:r}:{});return e}return Object.assign({fields:t},r?{sort:r}:{})}function qie(e){if(F2(e)&&Object(oe["I"])(e.field)){return e.field}else if(C2(e)){let t;for(const n of e.fields){if(F2(n)&&Object(oe["I"])(n.field)){if(!t){t=n.field}else if(t!==n.field){Q1(b.FACETED_INDEPENDENT_DIFFERENT_SOURCES);return t}}}Q1(b.FACETED_INDEPENDENT_SAME_FIELDS_DIFFERENT_SOURCES);return t}else if($2(e)){Q1(b.FACETED_INDEPENDENT_SAME_SOURCE);const t=e.fields[0];return Object(oe["I"])(t)?t:undefined}return undefined}function Wie(e,t){const n=e.component.scales[t];const i=n.get("domains").map(t=>{if(F2(t)){t.data=e.lookupDataSource(t.data)}return t});return Uie(i)}function Gie(e){if($re(e)||Cre(e)){return e.children.reduce((e,t)=>e.concat(Gie(t)),Hie(e))}else{return Hie(e)}}function Hie(e){return WJ(e.component.scales).reduce((t,n)=>{const i=e.component.scales[n];if(i.merged){return t}const r=i.combine();const{name:o,type:s,selectionExtent:a,domains:u,range:c,reverse:l}=r,f=HX(r,["name","type","selectionExtent","domains","range","reverse"]);const d=Vie(r.range,o,n,e);let h;if(a){h=lee(e,a)}const p=Wie(e,n);t.push(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:o,type:s},p?{domain:p}:{}),h?{domainRaw:h}:{}),{range:d}),l!==undefined?{reverse:l}:{}),f));return t},[])}function Vie(e,t,n,i){if(GK(n)){if(M2(e)){return{step:{signal:t+"_step"}}}}else if(Object(oe["G"])(e)&&F2(e)){return Object.assign(Object.assign({},e),{data:i.lookupDataSource(e.data)})}return e}class Yie extends e9{constructor(e,t){super({},{name:e});this.merged=false;this.setWithExplicit("type",t)}domainDefinitelyIncludesZero(){if(this.get("zero")!==false){return true}return FJ(this.get("domains"),e=>Object(oe["B"])(e)&&e.length===2&&e[0]<=0&&e[1]>=0)}}const Xie=["range","scheme"];function Jie(e){return e==="x"?"width":e==="y"?"height":undefined}function Zie(e){const t=e.component.scales;for(const n of u0){const i=t[n];if(!i){continue}const r=Kie(n,e);i.setWithExplicit("range",r)}}function Qie(e,t){const n=e.fieldDef(t);if(n&&n.bin&&b0(n.bin)){const i=Nne(e,n.field,n.bin);const r=Jie(t);const o=e.getName(r);return new Die(()=>{const t=e.getSignalName(i);const n=`(${t}.stop - ${t}.start) / ${t}.step`;return`${e.getSignalName(o)} / (${n})`})}return undefined}function Kie(e,t){const n=t.specifiedScales[e];const{size:i}=t;const r=t.getScaleComponent(e);const o=r.get("type");for(const c of Xie){if(n[c]!==undefined){const i=W3(o,c);const r=G3(e,c);if(!i){Q1(b.scalePropertyNotWorkWithScaleType(o,c,e))}else if(r){Q1(r)}else{switch(c){case"range":{const i=n.range;if(Object(oe["B"])(i)){if(GK(e)){return t9(i.map(e=>{if(e==="width"||e==="height"){const n=t.getName(e);const i=t.getSignalName.bind(t);return Die.fromName(i,n)}return e}))}}else if(Object(oe["G"])(i)){return t9({data:t.requestDataName(p9.Main),field:i.field,sort:{op:"min",field:t.vgField(e)}})}return t9(i)}case"scheme":return t9(ere(n[c]))}}}}if(e===yQ||e===xQ){const t=e===yQ?"width":"height";const n=i[t];if(G4(n)){if(E3(o)){return t9({step:n.step})}else{Q1(b.stepDropped(t))}}}const{rangeMin:s,rangeMax:a}=n;const u=tre(e,t);if((s!==undefined||a!==undefined)&&W3(o,"rangeMin")&&Object(oe["B"])(u)&&u.length===2){return t9([s!==null&&s!==void 0?s:u[0],a!==null&&a!==void 0?a:u[1]])}return n9(u)}function ere(e){if(C3(e)){return Object.assign({scheme:e.name},DJ(e,["name"]))}return{scheme:e}}function tre(e,t){const{size:n,config:i,mark:r,encoding:o}=t;const s=t.getSignalName.bind(t);const{type:a}=h6(o[e]);const u=t.getScaleComponent(e);const c=u.get("type");const{domain:l,domainMid:f}=t.specifiedScales[e];switch(e){case yQ:case xQ:{if($J(["point","band"],c)){if(e===yQ&&!n.width){const e=K4(i.view,"width");if(G4(e)){return e}}else if(e===xQ&&!n.height){const e=K4(i.view,"height");if(G4(e)){return e}}}const r=Jie(e);const o=t.getName(r);if(e===xQ&&A3(c)){return[Die.fromName(s,o),0]}else{return[0,Die.fromName(s,o)]}}case TQ:{const o=t.component.scales[e].get("zero");const s=rre(r,o,i);const a=sre(r,n,t,i);if(S3(c)){return ire(s,a,nre(c,i,l,e))}else{return[s,a]}}case kQ:return[0,Math.PI*2];case zQ:return[0,360];case OQ:{return[0,new Die(()=>{const e=t.getSignalName("width");const n=t.getSignalName("height");return`min(${e},${n})/2`})]}case IQ:return[i.scale.minStrokeWidth,i.scale.maxStrokeWidth];case LQ:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case NQ:return"symbol";case CQ:case $Q:case FQ:if(c==="ordinal"){return a==="nominal"?"category":"ordinal"}else{if(f!==undefined){return"diverging"}else{return r==="rect"||r==="geoshape"?"heatmap":"ramp"}}case RQ:case BQ:case PQ:return[i.scale.minOpacity,i.scale.maxOpacity]}throw new Error(`Scale range undefined for channel ${e}`)}function nre(e,t,n,i){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":if(n!==undefined&&Object(oe["B"])(n)){return n.length+1}else{Q1(b.domainRequiredForThresholdScale(i));return 3}}}function ire(e,t,n){const i=()=>{const i=C6(t);const r=C6(e);const o=`(${i} - ${r}) / (${n} - 1)`;return`sequence(${r}, ${i} + ${o}, ${o})`};if(S2(t)){return new Die(i)}else{return{signal:i()}}}function rre(e,t,n){if(t){if(S2(t)){return{signal:`${t.signal} ? 0 : ${rre(e,false,n)}`}}else{return 0}}switch(e){case"bar":case"tick":return n.scale.minBandSize;case"line":case"trail":case"rule":return n.scale.minStrokeWidth;case"text":return n.scale.minFontSize;case"point":case"square":case"circle":return n.scale.minSize}throw new Error(b.incompatibleChannel("size",e))}const ore=.95;function sre(e,t,n,i){const r={x:Qie(n,"x"),y:Qie(n,"y")};switch(e){case"bar":case"tick":{if(i.scale.maxBandSize!==undefined){return i.scale.maxBandSize}const e=are(t,r,i.view);if(Object(oe["F"])(e)){return e-1}else{return new Die(()=>`${e.signal} - 1`)}}case"line":case"trail":case"rule":return i.scale.maxStrokeWidth;case"text":return i.scale.maxFontSize;case"point":case"square":case"circle":{if(i.scale.maxSize){return i.scale.maxSize}const e=are(t,r,i.view);if(Object(oe["F"])(e)){return Math.pow(ore*e,2)}else{return new Die(()=>`pow(${ore} * ${e.signal}, 2)`)}}}throw new Error(b.incompatibleChannel("size",e))}function are(e,t,n){const i=G4(e.width)?e.width.step:Q4(n,"width");const r=G4(e.height)?e.height.step:Q4(n,"height");if(t.x||t.y){return new Die(()=>{const e=[t.x?t.x.signal:i,t.y?t.y.signal:r];return`min(${e.join(", ")})`})}return Math.min(i,r)}function ure(e,t){if(Sre(e)){cre(e,t)}else{dre(e,t)}}function cre(e,t){const n=e.component.scales;const{config:i,encoding:r,markDef:o,specifiedScales:s}=e;for(const a of WJ(n)){const u=s[a];const c=n[a];const l=e.getScaleComponent(a);const f=h6(r[a]);const d=u[t];const h=l.get("type");const p=l.get("padding");const g=l.get("paddingInner");const m=W3(h,t);const v=G3(a,t);if(d!==undefined){if(!m){Q1(b.scalePropertyNotWorkWithScaleType(h,t,a))}else if(v){Q1(v)}}if(m&&v===undefined){if(d!==undefined){const e=f["timeUnit"];const n=f.type;switch(t){case"domainMax":case"domainMin":if(t2(u[t])||n==="temporal"||e){c.set(t,{signal:O6(u[t],{type:n,timeUnit:e})},true)}else{c.set(t,u[t],true)}break;default:c.copyKeyFromObject(t,u)}}else{const n=t in lre?lre[t]({model:e,channel:a,fieldOrDatumDef:f,scaleType:h,scalePadding:p,scalePaddingInner:g,domain:u.domain,markDef:o,config:i}):i.scale[t];if(n!==undefined){c.set(t,n,false)}}}}}const lre={bins:({model:e,fieldOrDatumDef:t})=>z5(t)?hre(e,t):undefined,interpolate:({channel:e,fieldOrDatumDef:t})=>pre(e,t.type),nice:({scaleType:e,channel:t,fieldOrDatumDef:n})=>gre(e,t,n),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:i,config:r})=>mre(e,t,r.scale,n,i,r.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,config:i})=>bre(e,t,n.type,i.scale),paddingOuter:({scalePadding:e,channel:t,scaleType:n,markDef:i,scalePaddingInner:r,config:o})=>vre(e,t,n,i.type,r,o.scale),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:i})=>{const r=z5(e)?e.sort:undefined;return yre(t,r,n,i.scale)},zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:i,scaleType:r})=>xre(e,t,n,i,r)};function fre(e){if(Sre(e)){Zie(e)}else{dre(e,"range")}}function dre(e,t){const n=e.component.scales;for(const i of e.children){if(t==="range"){fre(i)}else{ure(i,t)}}for(const i of WJ(n)){let r;for(const n of e.children){const e=n.component.scales[i];if(e){const n=e.getWithExplicit(t);r=o9(r,n,t,"scale",i9((e,n)=>{switch(t){case"range":if(e.step&&n.step){return e.step-n.step}return 0}return 0}))}}n[i].setWithExplicit(t,r)}}function hre(e,t){const n=t.bin;if(b0(n)){const i=Nne(e,t.field,n);return new Die(()=>e.getSignalName(i))}else if(v0(n)&&y0(n)&&n.step!==undefined){return{step:n.step}}return undefined}function pre(e,t){if($J([CQ,$Q,FQ],e)&&t!=="nominal"){return"hcl"}return undefined}function gre(e,t,n){var i;if(((i=d6(n))===null||i===void 0?void 0:i.bin)||$J([u3.TIME,u3.UTC],e)){return undefined}return t in qK?true:undefined}function mre(e,t,n,i,r,o){if(e in qK){if(D3(t)){if(n.continuousPadding!==undefined){return n.continuousPadding}const{type:t,orient:s}=r;if(t==="bar"&&!(z5(i)&&(i.bin||i.timeUnit))){if(s==="vertical"&&e==="x"||s==="horizontal"&&e==="y"){return o.continuousBandSize}}}if(t===u3.POINT){return n.pointPadding}}return undefined}function bre(e,t,n,i){if(e!==undefined){return undefined}if(t in qK){const{bandPaddingInner:e,barBandPaddingInner:t,rectBandPaddingInner:r}=i;return oZ(e,n==="bar"?t:r)}return undefined}function vre(e,t,n,i,r,o){if(e!==undefined){return undefined}if(t in qK){if(n===u3.BAND){const{bandPaddingOuter:e}=o;return oZ(e,S2(r)?{signal:`${r.signal}/2`}:r/2)}}return undefined}function yre(e,t,n,i){if(n==="x"&&i.xReverse!==undefined){if(A3(e)&&t==="descending"){if(S2(i.xReverse)){return{signal:`!${i.xReverse.signal}`}}else{return!i.xReverse}}return i.xReverse}if(A3(e)&&t==="descending"){return true}return undefined}function xre(e,t,n,i,r){const o=!!n&&n!=="unaggregated";if(o){if(A3(r)){if(Object(oe["B"])(n)){const e=n[0];const t=n[n.length-1];if(e<=0&&t>=0){return true}}return false}}if(e==="size"&&t.type==="quantitative"&&!S3(r)){return true}if(!(z5(t)&&t.bin)&&$J([...WK,...VK],e)){const{orient:t,type:n}=i;if($J(["bar","area","line","trail"],n)){if(t==="horizontal"&&e==="y"||t==="vertical"&&e==="x"){return false}}return true}return false}function _re(e,t,n,i){const r=wre(t,n,i);const{type:o}=e;if(!c0(t)){return null}if(o!==undefined){if(!V3(t,o)){Q1(b.scaleTypeNotWorkWithChannel(t,o,r));return r}if(z5(n)&&!H3(o,n.type)){Q1(b.scaleTypeNotWorkWithFieldDef(o,r));return r}return o}return r}function wre(e,t,n){var i;switch(t.type){case"nominal":case"ordinal":if(rK(e)||g0(e)==="discrete"){if(e==="shape"&&t.type==="ordinal"){Q1(b.discreteChannelCannotEncode(e,"ordinal"))}return"ordinal"}if(e in qK){if($J(["rect","bar","image","rule"],n)){return"band"}}else if(n==="arc"&&e in HK){return"band"}if(t.band!==undefined||H5(t)&&((i=t.axis)===null||i===void 0?void 0:i.tickBand)){return"band"}return"point";case"temporal":if(rK(e)){return"time"}else if(g0(e)==="discrete"){Q1(b.discreteChannelCannotEncode(e,"temporal"));return"ordinal"}else if(z5(t)&&t.timeUnit&&A2(t.timeUnit).utc){return"utc"}return"time";case"quantitative":if(rK(e)){if(z5(t)&&b0(t.bin)){return"bin-ordinal"}return"linear"}else if(g0(e)==="discrete"){Q1(b.discreteChannelCannotEncode(e,"quantitative"));return"ordinal"}return"linear";case"geojson":return undefined}throw new Error(b.invalidFieldType(t.type))}function Ore(e,{ignoreRange:t}={}){jre(e);Sie(e);for(const n of q3){ure(e,n)}if(!t){fre(e)}}function jre(e){if(Sre(e)){e.component.scales=kre(e)}else{e.component.scales=Are(e)}}function kre(e){const{encoding:t,mark:n}=e;return u0.reduce((i,r)=>{const o=h6(t[r]);if(o&&n===TZ&&r===NQ&&o.type===o3){return i}let s=o&&o["scale"];if(o&&s!==null&&s!==false){s=s!==null&&s!==void 0?s:{};const t=_re(s,r,o,n);i[r]=new Yie(e.scaleName(r+"",true),{value:t,explicit:s.type===t})}return i},{})}const Ere=i9((e,t)=>h3(e)-h3(t));function Are(e){var t;const n=e.component.scales={};const i={};const r=e.component.resolve;for(const o of e.children){jre(o);for(const n of WJ(o.component.scales)){r.scale[n]=(t=r.scale[n])!==null&&t!==void 0?t:Pte(n,e);if(r.scale[n]==="shared"){const e=i[n];const t=o.component.scales[n].getWithExplicit("type");if(e){if(f3(e.value,t.value)){i[n]=o9(e,t,"type","scale",Ere)}else{r.scale[n]="independent";delete i[n]}}else{i[n]=t}}}}for(const o of WJ(i)){const t=e.scaleName(o,true);const r=i[o];n[o]=new Yie(t,r);for(const n of e.children){const e=n.component.scales[o];if(e){n.renameScale(e.get("name"),t);e.merged=true}}}return n}class Dre{constructor(){this.nameMap={}}rename(e,t){this.nameMap[e]=t}has(e){return this.nameMap[e]!==undefined}get(e){while(this.nameMap[e]&&e!==this.nameMap[e]){e=this.nameMap[e]}return e}}function Sre(e){return(e===null||e===void 0?void 0:e.type)==="unit"}function Mre(e){return(e===null||e===void 0?void 0:e.type)==="facet"}function Cre(e){return(e===null||e===void 0?void 0:e.type)==="concat"}function $re(e){return(e===null||e===void 0?void 0:e.type)==="layer"}class Fre{constructor(e,t,n,i,r,o,s){var a,u;this.type=t;this.parent=n;this.config=r;this.view=s;this.children=[];this.correctDataNames=e=>{if(e.from&&e.from.data){e.from.data=this.lookupDataSource(e.from.data)}if(e.from&&e.from.facet&&e.from.facet.data){e.from.facet.data=this.lookupDataSource(e.from.facet.data)}return e};this.parent=n;this.config=r;this.name=(a=e.name)!==null&&a!==void 0?a:i;this.title=A6(e.title)?{text:e.title}:e.title;this.scaleNameMap=n?n.scaleNameMap:new Dre;this.projectionNameMap=n?n.projectionNameMap:new Dre;this.signalNameMap=n?n.signalNameMap:new Dre;this.data=e.data;this.description=e.description;this.transforms=z9((u=e.transform)!==null&&u!==void 0?u:[]);this.layout=t==="layer"||t==="unit"?{}:J4(e,t,r);this.component={data:{sources:n?n.component.data.sources:[],outputNodes:n?n.component.data.outputNodes:{},outputNodeRefCounts:n?n.component.data.outputNodeRefCounts:{},isFaceted:k5(e)||n&&n.component.data.isFaceted&&e.data===undefined},layoutSize:new e9,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:Object.assign({scale:{},axis:{},legend:{}},o?EJ(o):{}),selection:null,scales:null,projection:null,axes:{},legends:{}}}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale();this.parseLayoutSize();this.renameTopLevelLayoutSizeSignal();this.parseSelections();this.parseProjection();this.parseData();this.parseAxesAndHeaders();this.parseLegends();this.parseMarkGroup()}parseScale(){Ore(this)}parseProjection(){Ene(this)}renameTopLevelLayoutSizeSignal(){if(this.getName("width")!=="width"){this.renameSignal(this.getName("width"),"width")}if(this.getName("height")!=="height"){this.renameSignal(this.getName("height"),"height")}}parseLegends(){lne(this)}assembleGroupStyle(){var e,t;if(this.type==="unit"||this.type==="layer"){return(t=(e=this.view)===null||e===void 0?void 0:e.style)!==null&&t!==void 0?t:"cell"}return undefined}assembleEncodeFromView(e){const{style:t}=e,n=HX(e,["style"]);const i={};for(const r of WJ(n)){const e=n[r];if(e!==undefined){i[r]=S6(e)}}return i}assembleGroupEncodeEntry(e){let t={};if(this.view){t=this.assembleEncodeFromView(this.view)}if(!e){if(this.description){t["description"]=S6(this.description)}if(this.type==="unit"||this.type==="layer"){return Object.assign({width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height")},t!==null&&t!==void 0?t:{})}}return qJ(t)?undefined:t}assembleLayout(){if(!this.layout){return undefined}const e=this.layout,{spacing:t}=e,n=HX(e,["spacing"]);const{component:i,config:r}=this;const o=Cte(i.layoutHeaders,r);return Object.assign(Object.assign(Object.assign({padding:t},this.assembleDefaultLayout()),n),o?{titleBand:o}:{})}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:e}=this.component;let t=[];for(const n of sK){if(e[n].title){t.push(wte(this,n))}}for(const n of xte){t=t.concat(kte(this,n))}return t}assembleAxes(){return Hee(this.component.axes,this.config)}assembleLegends(){return yne(this)}assembleProjections(){return _ne(this)}assembleTitle(){var e,t,n;const i=(e=this.title)!==null&&e!==void 0?e:{},{encoding:r}=i,o=HX(i,["encoding"]);const s=Object.assign(Object.assign(Object.assign({},E6(this.config.title).nonMark),o),r?{encode:{update:r}}:{});if(s.text){if($J(["unit","layer"],this.type)){if($J(["middle",undefined],s.anchor)){s.frame=(t=s.frame)!==null&&t!==void 0?t:"group"}}else{s.anchor=(n=s.anchor)!==null&&n!==void 0?n:"start"}return qJ(s)?undefined:s}return undefined}assembleGroup(e=[]){const t={};e=e.concat(this.assembleSignals());if(e.length>0){t.signals=e}const n=this.assembleLayout();if(n){t.layout=n}t.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const i=!this.parent||Mre(this.parent)?Gie(this):[];if(i.length>0){t.scales=i}const r=this.assembleAxes();if(r.length>0){t.axes=r}const o=this.assembleLegends();if(o.length>0){t.legends=o}return t}getName(e){return YJ((this.name?this.name+"_":"")+e)}getDataName(e){return this.getName(p9[e].toLowerCase())}requestDataName(e){const t=this.getDataName(e);const n=this.component.data.outputNodeRefCounts;n[t]=(n[t]||0)+1;return t}getSizeSignalRef(e){if(Mre(this.parent)){const t=Rte(e);const n=YK(t);const i=this.component.scales[n];if(i&&!i.merged){const e=i.get("type");const t=i.get("range");if(E3(e)&&M2(t)){const e=i.get("name");const t=Wie(this,n);const r=qie(t);if(r){const t=Z5({aggregate:"distinct",field:r},{expr:"datum"});return{signal:zte(e,i,t)}}else{Q1(b.unknownField(n));return null}}}}return{signal:this.signalNameMap.get(this.getName(e))}}lookupDataSource(e){const t=this.component.data.outputNodes[e];if(!t){return e}return t.getSource()}getSignalName(e){return this.signalNameMap.get(e)}renameSignal(e,t){this.signalNameMap.rename(e,t)}renameScale(e,t){this.scaleNameMap.rename(e,t)}renameProjection(e,t){this.projectionNameMap.rename(e,t)}scaleName(e,t){if(t){return this.getName(e)}if(xK(e)&&c0(e)&&this.component.scales[e]||this.scaleNameMap.has(this.getName(e))){return this.scaleNameMap.get(this.getName(e))}return undefined}projectionName(e){if(e){return this.getName("projection")}if(this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection"))){return this.projectionNameMap.get(this.getName("projection"))}return undefined}getScaleComponent(e){if(!this.component.scales){throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().")}const t=this.component.scales[e];if(t&&!t.merged){return t}return this.parent?this.parent.getScaleComponent(e):undefined}getSelectionComponent(e,t){let n=this.component.selection[e];if(!n&&this.parent){n=this.parent.getSelectionComponent(e,t)}if(!n){throw new Error(b.selectionNotFound(t))}return n}hasAxisOrientSignalRef(){var e,t;return((e=this.component.axes.x)===null||e===void 0?void 0:e.some(e=>e.hasOrientSignalRef()))||((t=this.component.axes.y)===null||t===void 0?void 0:t.some(e=>e.hasOrientSignalRef()))}}class Nre extends Fre{vgField(e,t={}){const n=this.fieldDef(e);if(!n){return undefined}return Z5(n,t)}reduceFieldDef(e,t){return J6(this.getMapping(),(t,n,i)=>{const r=d6(n);if(r){return e(t,r,i)}return t},t)}forEachFieldDef(e,t){X6(this.getMapping(),(t,n)=>{const i=d6(t);if(i){e(i,n)}},t)}}class Tre extends j7{constructor(e,t){var n,i,r;super(e);this.transform=t;this.transform=EJ(t);const o=(n=this.transform.as)!==null&&n!==void 0?n:[undefined,undefined];this.transform.as=[(i=o[0])!==null&&i!==void 0?i:"value",(r=o[1])!==null&&r!==void 0?r:"density"]}clone(){return new Tre(null,EJ(this.transform))}dependentFields(){var e;return new Set([this.transform.density,...(e=this.transform.groupby)!==null&&e!==void 0?e:[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${MJ(this.transform)}`}assemble(){const e=this.transform,{density:t}=e,n=HX(e,["density"]);const i=Object.assign({type:"kde",field:t},n);return i}}class zre extends j7{constructor(e,t){super(e);this.filter=t}clone(){return new zre(null,Object.assign({},this.filter))}static make(e,t){const{config:n,mark:i,markDef:r}=t;const o=N6("invalid",r,n);if(o!=="filter"){return null}const s=t.reduceFieldDef((e,n,r)=>{const o=c0(r)&&t.getScaleComponent(r);if(o){const t=o.get("type");if(A3(t)&&n.aggregate!=="count"&&!RZ(i)){e[n.field]=n}}return e},{});if(!WJ(s).length){return null}return new zre(e,s)}dependentFields(){return new Set(WJ(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${MJ(this.filter)}`}assemble(){const e=WJ(this.filter).reduce((e,t)=>{const n=this.filter[t];const i=Z5(n,{expr:"datum"});if(n!==null){if(n.type==="temporal"){e.push(`(isDate(${i}) || (isValid(${i}) && isFinite(+${i})))`)}else if(n.type==="quantitative"){e.push(`isValid(${i})`);e.push(`isFinite(+${i})`)}else{}}return e},[]);return e.length>0?{type:"filter",expr:e.join(" && ")}:null}}class Rre extends j7{constructor(e,t){super(e);this.transform=t;this.transform=EJ(t);const{flatten:n,as:i=[]}=this.transform;this.transform.as=n.map((e,t)=>{var n;return(n=i[t])!==null&&n!==void 0?n:e})}clone(){return new Rre(this.parent,EJ(this.transform))}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${MJ(this.transform)}`}assemble(){const{flatten:e,as:t}=this.transform;const n={type:"flatten",fields:e,as:t};return n}}class Bre extends j7{constructor(e,t){var n,i,r;super(e);this.transform=t;this.transform=EJ(t);const o=(n=this.transform.as)!==null&&n!==void 0?n:[undefined,undefined];this.transform.as=[(i=o[0])!==null&&i!==void 0?i:"key",(r=o[1])!==null&&r!==void 0?r:"value"]}clone(){return new Bre(null,EJ(this.transform))}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${MJ(this.transform)}`}assemble(){const{fold:e,as:t}=this.transform;const n={type:"fold",fields:e,as:t};return n}}class Pre extends j7{constructor(e,t,n,i){super(e);this.fields=t;this.geojson=n;this.signal=i}clone(){return new Pre(null,EJ(this.fields),this.geojson,this.signal)}static parseAll(e,t){if(t.component.projection&&!t.component.projection.isFit){return e}let n=0;for(const i of[[DQ,AQ],[MQ,SQ]]){const r=i.map(e=>{const n=h6(t.encoding[e]);return z5(n)?n.field:B5(n)?{expr:`${n.datum}`}:W5(n)?{expr:`${n["value"]}`}:undefined});if(r[0]||r[1]){e=new Pre(e,r,null,t.getName(`geojson_${n++}`))}}if(t.channelHasField(NQ)){const i=t.typedFieldDef(NQ);if(i.type===o3){e=new Pre(e,null,i.field,t.getName(`geojson_${n++}`))}}return e}dependentFields(){var e;const t=((e=this.fields)!==null&&e!==void 0?e:[]).filter(oe["I"]);return new Set([...this.geojson?[this.geojson]:[],...t])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${MJ(this.fields)}`}assemble(){return Object.assign(Object.assign(Object.assign({type:"geojson"},this.fields?{fields:this.fields}:{}),this.geojson?{geojson:this.geojson}:{}),{signal:this.signal})}}class Ire extends j7{constructor(e,t,n,i){super(e);this.projection=t;this.fields=n;this.as=i}clone(){return new Ire(null,this.projection,EJ(this.fields),EJ(this.as))}static parseAll(e,t){if(!t.projectionName()){return e}for(const n of[[DQ,AQ],[MQ,SQ]]){const i=n.map(e=>{const n=h6(t.encoding[e]);return z5(n)?n.field:B5(n)?{expr:`${n.datum}`}:W5(n)?{expr:`${n["value"]}`}:undefined});const r=n[0]===MQ?"2":"";if(i[0]||i[1]){e=new Ire(e,t.projectionName(),i,[t.getName("x"+r),t.getName("y"+r)])}}return e}dependentFields(){return new Set(this.fields.filter(oe["I"]))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${MJ(this.fields)} ${MJ(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class Lre extends j7{constructor(e,t){super(e);this.transform=t}clone(){return new Lre(null,EJ(this.transform))}dependentFields(){var e;return new Set([this.transform.impute,this.transform.key,...(e=this.transform.groupby)!==null&&e!==void 0?e:[]])}producedFields(){return new Set([this.transform.impute])}processSequence(e){const{start:t=0,stop:n,step:i}=e;const r=[t,n,...i?[i]:[]].join(",");return{signal:`sequence(${r})`}}static makeFromTransform(e,t){return new Lre(e,t)}static makeFromEncoding(e,t){const n=t.encoding;const i=n.x;const r=n.y;if(z5(i)&&z5(r)){const o=i.impute?i:r.impute?r:undefined;if(o===undefined){return undefined}const s=i.impute?r:r.impute?i:undefined;const{method:a,value:u,frame:c,keyvals:l}=o.impute;const f=Z6(t.mark,n);return new Lre(e,Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({impute:o.field,key:s.field},a?{method:a}:{}),u!==undefined?{value:u}:{}),c?{frame:c}:{}),l!==undefined?{keyvals:l}:{}),f.length?{groupby:f}:{}))}return null}hash(){return`Impute ${MJ(this.transform)}`}assemble(){const{impute:e,key:t,keyvals:n,method:i,groupby:r,value:o,frame:s=[null,null]}=this.transform;const a=Object.assign(Object.assign(Object.assign(Object.assign({type:"impute",field:e,key:t},n?{keyvals:m9(n)?this.processSequence(n):n}:{}),{method:"value"}),r?{groupby:r}:{}),{value:!i||i==="value"?o:null});if(i&&i!=="value"){const t=Object.assign({type:"window",as:[`imputed_${e}_value`],ops:[i],fields:[e],frame:s,ignorePeers:false},r?{groupby:r}:{});const n={type:"formula",expr:`datum.${e} === null ? datum.imputed_${e}_value : datum.${e}`,as:e};return[a,t,n]}else{return[a]}}}class Ure extends j7{constructor(e,t){var n,i,r;super(e);this.transform=t;this.transform=EJ(t);const o=(n=this.transform.as)!==null&&n!==void 0?n:[undefined,undefined];this.transform.as=[(i=o[0])!==null&&i!==void 0?i:t.on,(r=o[1])!==null&&r!==void 0?r:t.loess]}clone(){return new Ure(null,EJ(this.transform))}dependentFields(){var e;return new Set([this.transform.loess,this.transform.on,...(e=this.transform.groupby)!==null&&e!==void 0?e:[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${MJ(this.transform)}`}assemble(){const e=this.transform,{loess:t,on:n}=e,i=HX(e,["loess","on"]);const r=Object.assign({type:"loess",x:n,y:t},i);return r}}class qre extends j7{constructor(e,t,n){super(e);this.transform=t;this.secondary=n}clone(){return new qre(null,EJ(this.transform),this.secondary)}static make(e,t,n,i){const r=t.component.data.sources;const{from:o}=n;let s=null;if(v9(o)){let e=doe(o.data,r);if(!e){e=new Zne(o.data);r.push(e)}const n=t.getName(`lookup_${i}`);s=new k7(e,n,p9.Lookup,t.component.data.outputNodeRefCounts);t.component.data.outputNodes[n]=s}else if(y9(o)){const e=o.selection;n=Object.assign({as:e},n);s=t.getSelectionComponent(YJ(e),e).materialized;if(!s){throw new Error(b.noSameUnitLookup(e))}}return new qre(e,n,s.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?Object(oe["i"])(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${MJ({transform:this.transform,secondary:this.secondary})}`}assemble(){let e;if(this.transform.from.fields){e=Object.assign({values:this.transform.from.fields},this.transform.as?{as:Object(oe["i"])(this.transform.as)}:{})}else{let t=this.transform.as;if(!Object(oe["I"])(t)){Q1(b.NO_FIELDS_NEEDS_AS);t="_lookup"}e={as:[t]}}return Object.assign(Object.assign({type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup]},e),this.transform.default?{default:this.transform.default}:{})}}class Wre extends j7{constructor(e,t){var n,i,r;super(e);this.transform=t;this.transform=EJ(t);const o=(n=this.transform.as)!==null&&n!==void 0?n:[undefined,undefined];this.transform.as=[(i=o[0])!==null&&i!==void 0?i:"prob",(r=o[1])!==null&&r!==void 0?r:"value"]}clone(){return new Wre(null,EJ(this.transform))}dependentFields(){var e;return new Set([this.transform.quantile,...(e=this.transform.groupby)!==null&&e!==void 0?e:[]])}producedFields(){return new Set(this.transform.as)}hash(){return`QuantileTransform ${MJ(this.transform)}`}assemble(){const e=this.transform,{quantile:t}=e,n=HX(e,["quantile"]);const i=Object.assign({type:"quantile",field:t},n);return i}}class Gre extends j7{constructor(e,t){var n,i,r;super(e);this.transform=t;this.transform=EJ(t);const o=(n=this.transform.as)!==null&&n!==void 0?n:[undefined,undefined];this.transform.as=[(i=o[0])!==null&&i!==void 0?i:t.on,(r=o[1])!==null&&r!==void 0?r:t.regression]}clone(){return new Gre(null,EJ(this.transform))}dependentFields(){var e;return new Set([this.transform.regression,this.transform.on,...(e=this.transform.groupby)!==null&&e!==void 0?e:[]])}producedFields(){return new Set(this.transform.as)}hash(){return`RegressionTransform ${MJ(this.transform)}`}assemble(){const e=this.transform,{regression:t,on:n}=e,i=HX(e,["regression","on"]);const r=Object.assign({type:"regression",x:n,y:t},i);return r}}class Hre extends j7{constructor(e,t){super(e);this.transform=t}clone(){return new Hre(null,EJ(this.transform))}addDimensions(e){var t;this.transform.groupby=RJ(((t=this.transform.groupby)!==null&&t!==void 0?t:[]).concat(e),e=>e)}producedFields(){return undefined}dependentFields(){var e;return new Set([this.transform.pivot,this.transform.value,...(e=this.transform.groupby)!==null&&e!==void 0?e:[]])}hash(){return`PivotTransform ${MJ(this.transform)}`}assemble(){const{pivot:e,value:t,groupby:n,limit:i,op:r}=this.transform;return Object.assign(Object.assign(Object.assign({type:"pivot",field:e,value:t},i!==undefined?{limit:i}:{}),r!==undefined?{op:r}:{}),n!==undefined?{groupby:n}:{})}}class Vre extends j7{constructor(e,t){super(e);this.transform=t}clone(){return new Vre(null,EJ(this.transform))}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${MJ(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function Yre(e){let t=0;function n(i,r){var o;if(i instanceof Zne){if(!i.isGenerator&&!a9(i.data)){e.push(r);const t={name:null,source:r.name,transform:[]};r=t}}if(i instanceof Vne){if(i.parent instanceof Zne&&!r.source){r.format=Object.assign(Object.assign({},(o=r.format)!==null&&o!==void 0?o:{}),{parse:i.assembleFormatParse()});r.transform.push(...i.assembleTransforms(true))}else{r.transform.push(...i.assembleTransforms())}}if(i instanceof Lne){if(!r.name){r.name=`data_${t++}`}if(!r.source||r.transform.length>0){e.push(r);i.data=r.name}else{i.data=r.source}for(const t of i.assemble()){e.push(t)}return}if(i instanceof Xne||i instanceof Jne||i instanceof zre||i instanceof zee||i instanceof gte||i instanceof Ire||i instanceof Pre||i instanceof Ine||i instanceof qre||i instanceof vie||i instanceof pie||i instanceof Bre||i instanceof Rre||i instanceof Tre||i instanceof Ure||i instanceof Wre||i instanceof Gre||i instanceof Yne||i instanceof Vre||i instanceof Hre){r.transform.push(i.assemble())}if(i instanceof Rne||i instanceof E7||i instanceof Lre||i instanceof bie){r.transform.push(...i.assemble())}if(i instanceof k7){if(r.source&&r.transform.length===0){i.setSource(r.source)}else if(i.parent instanceof k7){i.setSource(r.name)}else{if(!r.name){r.name=`data_${t++}`}i.setSource(r.name);if(i.numChildren()===1){e.push(r);const t={name:null,source:r.name,transform:[]};r=t}}}switch(i.numChildren()){case 0:if(i instanceof k7&&(!r.source||r.transform.length>0)){e.push(r)}break;case 1:n(i.children[0],r);break;default:{if(!r.name){r.name=`data_${t++}`}let o=r.name;if(!r.source||r.transform.length>0){e.push(r)}else{o=r.source}for(const e of i.children){const t={name:null,source:o,transform:[]};n(e,t)}break}}}return n}function Xre(e){const t=[];const n=Yre(t);for(const i of e.children){n(i,{source:e.name,name:null,transform:[]})}return t}function Jre(e,t){var n,i;const r=[];const o=Yre(r);let s=0;for(const u of e.sources){if(!u.hasName()){u.dataName=`source_${s++}`}const e=u.assemble();o(u,e)}for(const u of r){if(u.transform.length===0){delete u.transform}}let a=0;for(const[u,c]of r.entries()){if(((n=c.transform)!==null&&n!==void 0?n:[]).length===0&&!c.source){r.splice(a++,0,r.splice(u,1)[0])}}for(const u of r){for(const t of(i=u.transform)!==null&&i!==void 0?i:[]){if(t.type==="lookup"){t.from=e.outputNodes[t.from].getSource()}}}for(const u of r){if(u.name in t){u.values=t[u.name]}}return r}function Zre(e){if(e==="top"||e==="left"||S2(e)){return"header"}return"footer"}function Qre(e){for(const t of sK){Kre(e,t)}toe(e,"x");toe(e,"y")}function Kre(e,t){var n;const{facet:i,config:r,child:o,component:s}=e;if(e.channelHasField(t)){const a=i[t];const u=vte("title",null,r,t);let c=a6(a,r,{allowDisabling:true,includeDefault:u===undefined||!!u});if(o.component.layoutHeaders[t].title){c=Object(oe["B"])(c)?c.join(", "):c;c+=" / "+o.component.layoutHeaders[t].title;o.component.layoutHeaders[t].title=null}const l=vte("labelOrient",a,r,t);const f=(n=a.header)!==null&&n!==void 0?n:{};const d=oZ(f.labels,r.header.labels,true);const h=$J(["bottom","right"],l)?"footer":"header";s.layoutHeaders[t]={title:c,facetFieldDef:a,[h]:t==="facet"?[]:[eoe(e,t,d)]}}}function eoe(e,t,n){const i=t==="row"?"height":"width";return{labels:n,sizeSignal:e.child.component.layoutSize.get(i)?e.child.getSizeSignalRef(i):undefined,axes:[]}}function toe(e,t){var n;const{child:i}=e;if(i.component.axes[t]){const{layoutHeaders:r,resolve:o}=e.component;o.axis[t]=Ite(o,t);if(o.axis[t]==="shared"){const o=t==="x"?"column":"row";const s=r[o];for(const r of i.component.axes[t]){const t=Zre(r.get("orient"));s[t]=(n=s[t])!==null&&n!==void 0?n:[eoe(e,o,false)];const i=Wee(r,"main",e.config,{header:true});if(i){s[t][0].axes.push(i)}r.mainExtracted=true}}else{}}}function noe(e){ooe(e);soe(e,"width");soe(e,"height")}const ioe=roe;function roe(e){ooe(e);const t=e.layout.columns===1?"width":"childWidth";const n=e.layout.columns===undefined?"height":"childHeight";soe(e,t);soe(e,n)}function ooe(e){for(const t of e.children){t.parseLayoutSize()}}function soe(e,t){const n=Rte(t);const i=YK(n);const r=e.component.resolve;const o=e.component.layoutSize;let s;for(const a of e.children){const e=a.component.layoutSize.getWithExplicit(n);const t=r.scale[i];if(t==="independent"&&e.value==="step"){s=undefined;break}if(s){if(t==="independent"&&s.value!==e.value){s=undefined;break}s=o9(s,e,n,"")}else{s=e}}if(s){for(const i of e.children){e.renameSignal(i.getName(n),e.getName(t));i.component.layoutSize.set(n,"merged",false)}o.setWithExplicit(t,s)}else{o.setWithExplicit(t,{explicit:false,value:undefined})}}function aoe(e){const{size:t,component:n}=e;for(const i of WK){const r=EK(i);if(t[r]){const e=t[r];n.layoutSize.set(r,G4(e)?"step":e,true)}else{const t=uoe(e,r);n.layoutSize.set(r,t,false)}}}function uoe(e,t){const n=t==="width"?"x":"y";const i=e.config;const r=e.getScaleComponent(n);if(r){const e=r.get("type");const n=r.get("range");if(E3(e)){const e=K4(i.view,t);if(M2(n)||G4(e)){return"step"}else{return e}}else{return Z4(i.view,t)}}else if(e.hasProjection||e.mark==="arc"){return Z4(i.view,t)}else{const e=K4(i.view,t);return G4(e)?e.step:e}}function coe(e,t,n){return Z5(t,Object.assign({suffix:`by_${Z5(e)}`},n!==null&&n!==void 0?n:{}))}class loe extends Nre{constructor(e,t,n,i){super(e,"facet",t,n,i,e.resolve);this.child=pse(e.spec,this,this.getName("child"),undefined,i);this.children=[this.child];this.facet=this.initFacet(e.facet,i)}initFacet(e,t){if(!O5(e)){return{facet:p6(e,"facet",t)}}return J6(e,(e,n,i)=>{if(!$J([mQ,bQ],i)){Q1(b.incompatibleChannel(i,"facet"));return e}if(n.field===undefined){Q1(b.emptyFieldDef(n,i));return e}e[i]=p6(n,i,t);return e},{})}channelHasField(e){return!!this.facet[e]}fieldDef(e){return this.facet[e]}parseData(){this.component.data=goe(this);this.child.parseData()}parseLayoutSize(){ooe(this)}parseSelections(){this.child.parseSelections();this.component.selection=this.child.component.selection}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders();Qre(this)}assembleSelectionTopLevelSignals(e){return this.child.assembleSelectionTopLevelSignals(e)}assembleSignals(){this.child.assembleSignals();return[]}assembleSelectionData(e){return this.child.assembleSelectionData(e)}getHeaderLayoutMixins(){var e,t,n;const i={};for(const r of sK){for(const o of _te){const s=this.component.layoutHeaders[r];const a=s[o];const{facetFieldDef:u}=s;if(u){const t=vte("titleOrient",u,this.config,r);if($J(["right","bottom"],t)){const n=bte(r,t);i.titleAnchor=(e=i.titleAnchor)!==null&&e!==void 0?e:{};i.titleAnchor[n]="end"}}if(a===null||a===void 0?void 0:a[0]){const e=r==="row"?"height":"width";const a=o==="header"?"headerBand":"footerBand";if(r!=="facet"&&!this.child.component.layoutSize.get(e)){i[a]=(t=i[a])!==null&&t!==void 0?t:{};i[a][r]=.5}if(s.title){i.offset=(n=i.offset)!==null&&n!==void 0?n:{};i.offset[r==="row"?"rowTitle":"columnTitle"]=10}}}}return i}assembleDefaultLayout(){const{column:e,row:t}=this.facet;const n=e?this.columnDistinctSignal():t?1:undefined;let i="all";if(!t&&this.component.resolve.scale.x==="independent"){i="none"}else if(!e&&this.component.resolve.scale.y==="independent"){i="none"}return Object.assign(Object.assign(Object.assign({},this.getHeaderLayoutMixins()),n?{columns:n}:{}),{bounds:"full",align:i})}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(this.parent&&this.parent instanceof loe){return undefined}else{const e=this.getName("column_domain");return{signal:`length(data('${e}'))`}}}assembleGroup(e){if(this.parent&&this.parent instanceof loe){return Object.assign(Object.assign({},this.channelHasField("column")?{encode:{update:{columns:{field:Z5(this.facet.column,{prefix:"distinct"})}}}}:{}),super.assembleGroup(e))}return super.assembleGroup(e)}getCardinalityAggregateForChild(){const e=[];const t=[];const n=[];if(this.child instanceof loe){if(this.child.channelHasField("column")){const i=Z5(this.child.facet.column);e.push(i);t.push("distinct");n.push(`distinct_${i}`)}}else{for(const i of WK){const r=this.child.component.scales[i];if(r&&!r.merged){const o=r.get("type");const s=r.get("range");if(E3(o)&&M2(s)){const r=Wie(this.child,i);const o=qie(r);if(o){e.push(o);t.push("distinct");n.push(`distinct_${o}`)}else{Q1(b.unknownField(i))}}}}}return{fields:e,ops:t,as:n}}assembleFacet(){const{name:e,data:t}=this.component.data.facetRoot;const{row:n,column:i}=this.facet;const{fields:r,ops:o,as:s}=this.getCardinalityAggregateForChild();const a=[];for(const c of sK){const e=this.facet[c];if(e){a.push(Z5(e));const{bin:t,sort:u}=e;if(b0(t)){a.push(Z5(e,{binSuffix:"end"}))}if(_5(u)){const{field:t,op:a=b5}=u;const c=coe(e,u);if(n&&i){r.push(c);o.push("max");s.push(c)}else{r.push(t);o.push(a);s.push(c)}}else if(Object(oe["B"])(u)){const t=mte(e,c);r.push(t);o.push("max");s.push(t)}}}const u=!!n&&!!i;return Object.assign({name:e,data:t,groupby:a},u||r.length>0?{aggregate:Object.assign(Object.assign({},u?{cross:u}:{}),r.length?{fields:r,ops:o,as:s}:{})}:{})}facetSortFields(e){const{facet:t}=this;const n=t[e];if(n){if(_5(n.sort)){return[coe(n,n.sort,{expr:"datum"})]}else if(Object(oe["B"])(n.sort)){return[mte(n,e,{expr:"datum"})]}return[Z5(n,{expr:"datum"})]}return[]}facetSortOrder(e){const{facet:t}=this;const n=t[e];if(n){const{sort:e}=n;const t=(_5(e)?e.order:!Object(oe["B"])(e)&&e)||"ascending";return[t]}return[]}assembleLabelTitle(){const{facet:e,config:t}=this;if(e.facet){return Ate(e.facet,"facet",t)}const n={row:["top","bottom"],column:["left","right"]};for(const i of xte){if(e[i]){const r=vte("labelOrient",e[i],t,i);if($J(n[i],r)){return Ate(e[i],i,t)}}}return undefined}assembleMarks(){const{child:e}=this;const t=this.component.data.facetRoot;const n=Xre(t);const i=e.assembleGroupEncodeEntry(false);const r=this.assembleLabelTitle()||e.assembleTitle();const o=e.assembleGroupStyle();const s=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:this.getName("cell"),type:"group"},r?{title:r}:{}),o?{style:o}:{}),{from:{facet:this.assembleFacet()},sort:{field:sK.map(e=>this.facetSortFields(e)).flat(),order:sK.map(e=>this.facetSortOrder(e)).flat()}}),n.length>0?{data:n}:{}),i?{encode:{update:i}}:{}),e.assembleGroup(oee(this,[])));return[s]}getMapping(){return this.facet}}function foe(e,t){const{row:n,column:i}=t;if(n&&i){let t=null;for(const r of[n,i]){if(_5(r.sort)){const{field:n,op:i=b5}=r.sort;e=t=new pie(e,{joinaggregate:[{op:i,field:n,as:coe(r,r.sort,{forAs:true})}],groupby:[Z5(r)]})}}return t}return null}function doe(e,t){var n,i,r,o,s,a,u,c,l,f;for(const d of t){const t=d.data;if(e.name&&d.hasName()&&e.name!==d.dataName){continue}if(((n=e["format"])===null||n===void 0?void 0:n.mesh)&&((i=t.format)===null||i===void 0?void 0:i.feature)){continue}if((((r=e["format"])===null||r===void 0?void 0:r.feature)||((o=t.format)===null||o===void 0?void 0:o.feature))&&((s=e["format"])===null||s===void 0?void 0:s.feature)!==((a=t.format)===null||a===void 0?void 0:a.feature)){continue}if((((u=e["format"])===null||u===void 0?void 0:u.mesh)||((c=t.format)===null||c===void 0?void 0:c.mesh))&&((l=e["format"])===null||l===void 0?void 0:l.mesh)!==((f=t.format)===null||f===void 0?void 0:f.mesh)){continue}if(u9(e)&&u9(t)){if(kJ(e.values,t.values)){return d}}else if(a9(e)&&a9(t)){if(e.url===t.url){return d}}else if(c9(e)){if(e.name===d.dataName){return d}}}return null}function hoe(e,t){if(e.data||!e.parent){if(e.data===null){const e=new Zne({values:[]});t.push(e);return e}const n=doe(e.data,t);if(n){if(!l9(e.data)){n.data.format=TJ({},e.data.format,n.data.format)}if(!n.hasName()&&e.data.name){n.dataName=e.data.name}return n}else{const n=new Zne(e.data);t.push(n);return n}}else{return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}}function poe(e,t,n){var i,r;let o=0;for(const s of t.transforms){let a=undefined;let u;if(S9(s)){u=e=new gte(e,s);a="derived"}else if(g9(s)){const r=Wne(s);u=e=(i=Vne.makeWithAncestors(e,{},r,n))!==null&&i!==void 0?i:e;e=new zee(e,t,s.filter)}else if(M9(s)){u=e=Rne.makeFromTransform(e,s,t);a="number"}else if($9(s)){a="date";const t=n.getWithExplicit(s.field);if(t.value===undefined){e=new Vne(e,{[s.field]:a});n.set(s.field,a,false)}u=e=E7.makeFromTransform(e,s)}else if(F9(s)){u=e=Ine.makeFromTransform(e,s);a="number";if($ee(t)){e=new Yne(e)}}else if(b9(s)){u=e=qre.make(e,t,s,o++);a="derived"}else if(E9(s)){u=e=new vie(e,s);a="number"}else if(A9(s)){u=e=new pie(e,s);a="number"}else if(N9(s)){u=e=bie.makeFromTransform(e,s);a="derived"}else if(T9(s)){u=e=new Bre(e,s);a="derived"}else if(D9(s)){u=e=new Rre(e,s);a="derived"}else if(x9(s)){u=e=new Hre(e,s);a="derived"}else if(k9(s)){e=new Vre(e,s)}else if(C9(s)){u=e=Lre.makeFromTransform(e,s);a="derived"}else if(_9(s)){u=e=new Tre(e,s);a="derived"}else if(w9(s)){u=e=new Wre(e,s);a="derived"}else if(O9(s)){u=e=new Gre(e,s);a="derived"}else if(j9(s)){u=e=new Ure(e,s);a="derived"}else{Q1(b.invalidTransformIgnored(s));continue}if(u&&a!==undefined){for(const e of(r=u.producedFields())!==null&&r!==void 0?r:[]){n.set(e,a,false)}}}return e}function goe(e){var t,n,i,r,o,s,a,u,c,l;let f=hoe(e,e.component.data.sources);const{outputNodes:d,outputNodeRefCounts:h}=e.component.data;const p=e.parent?e.parent.component.data.ancestorParse.clone():new s9;const g=e.data;if(l9(g)){if(f9(g)){f=new Jne(f,g.sequence)}else if(h9(g)){f=new Xne(f,g.graticule)}p.parseNothing=true}else if(((t=g===null||g===void 0?void 0:g.format)===null||t===void 0?void 0:t.parse)===null){p.parseNothing=true}f=(n=Vne.makeExplicit(f,e,p))!==null&&n!==void 0?n:f;f=new Yne(f);const m=e.parent&&$re(e.parent);if(Sre(e)||Mre(e)){if(m){f=(i=Rne.makeFromEncoding(f,e))!==null&&i!==void 0?i:f}}if(e.transforms.length>0){f=poe(f,e,p)}const b=Hne(e);const v=Gne(e);f=(r=Vne.makeWithAncestors(f,{},Object.assign(Object.assign({},b),v),p))!==null&&r!==void 0?r:f;if(Sre(e)){f=Pre.parseAll(f,e);f=Ire.parseAll(f,e)}if(Sre(e)||Mre(e)){if(!m){f=(o=Rne.makeFromEncoding(f,e))!==null&&o!==void 0?o:f}f=(s=E7.makeFromEncoding(f,e))!==null&&s!==void 0?s:f;f=gte.parseAllForSortIndex(f,e)}const y=e.getDataName(p9.Raw);const x=new k7(f,y,p9.Raw,h);d[y]=x;f=x;if(Sre(e)){const t=Ine.makeFromEncoding(f,e);if(t){f=t;if($ee(e)){f=new Yne(f)}}f=(a=Lre.makeFromEncoding(f,e))!==null&&a!==void 0?a:f;f=(u=bie.makeFromEncoding(f,e))!==null&&u!==void 0?u:f}if(Sre(e)){f=(c=zre.make(f,e))!==null&&c!==void 0?c:f}const _=e.getDataName(p9.Main);const w=new k7(f,_,p9.Main,h);d[_]=w;f=w;if(Sre(e)){Iee(e,w)}let O=null;if(Mre(e)){const t=e.getName("facet");f=(l=foe(f,e.facet))!==null&&l!==void 0?l:f;O=new Lne(f,e,t,w.getSource());d[t]=O}return Object.assign(Object.assign({},e.component.data),{outputNodes:d,outputNodeRefCounts:h,raw:x,main:w,facetRoot:O,ancestorParse:p})}class moe extends Fre{constructor(e,t,n,i){var r,o,s,a;super(e,"concat",t,n,i,e.resolve);if(((o=(r=e.resolve)===null||r===void 0?void 0:r.axis)===null||o===void 0?void 0:o.x)==="shared"||((a=(s=e.resolve)===null||s===void 0?void 0:s.axis)===null||a===void 0?void 0:a.y)==="shared"){Q1(b.CONCAT_CANNOT_SHARE_AXIS)}this.children=this.getChildren(e).map((e,t)=>pse(e,this,this.getName("concat_"+t),undefined,i))}parseData(){this.component.data=goe(this);for(const e of this.children){e.parseData()}}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const t of WJ(e.component.selection)){this.component.selection[t]=e.component.selection[t]}}}parseMarkGroup(){for(const e of this.children){e.parseMarkGroup()}}parseAxesAndHeaders(){for(const e of this.children){e.parseAxesAndHeaders()}}getChildren(e){if(q4(e)){return e.vconcat}else if(W4(e)){return e.hconcat}return e.concat}parseLayoutSize(){roe(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(e){return this.children.reduce((e,t)=>t.assembleSelectionTopLevelSignals(e),e)}assembleSignals(){this.children.forEach(e=>e.assembleSignals());return[]}assembleLayoutSignals(){const e=Fte(this);for(const t of this.children){e.push(...t.assembleLayoutSignals())}return e}assembleSelectionData(e){return this.children.reduce((e,t)=>t.assembleSelectionData(e),e)}assembleMarks(){return this.children.map(e=>{const t=e.assembleTitle();const n=e.assembleGroupStyle();const i=e.assembleGroupEncodeEntry(false);return Object.assign(Object.assign(Object.assign(Object.assign({type:"group",name:e.getName("group")},t?{title:t}:{}),n?{style:n}:{}),i?{encode:{update:i}}:{}),e.assembleGroup())})}assembleDefaultLayout(){const e=this.layout.columns;return Object.assign(Object.assign({},e!=null?{columns:e}:{}),{bounds:"full",align:"each"})}}function boe(e){return e===false||e===null}const voe=Object.assign(Object.assign({disable:1,gridScale:1,scale:1},bZ),{labelExpr:1,encode:1});const yoe=WJ(voe);class xoe extends e9{constructor(e={},t={},n=false){super();this.explicit=e;this.implicit=t;this.mainExtracted=n}clone(){return new xoe(EJ(this.explicit),EJ(this.implicit),this.mainExtracted)}hasAxisPart(e){if(e==="axis"){return true}if(e==="grid"||e==="title"){return!!this.get(e)}return!boe(this.get(e))}hasOrientSignalRef(){return S2(this.explicit.orient)}}function _oe(e,t,n){var i;const{encoding:r,config:o}=e;const s=(i=h6(r[t]))!==null&&i!==void 0?i:h6(r[kK(t)]);const a=e.axis(t)||{};const{format:u,formatType:c}=a;if(i5(c)){return Object.assign({text:u5({fieldOrDatumDef:s,field:"datum.value",format:u,formatType:c,config:o})},n)}return n}function woe(e){return WK.reduce((t,n)=>{if(e.component.scales[n]){t[n]=[Soe(n,e)]}return t},{})}const Ooe={bottom:"top",top:"bottom",left:"right",right:"left"};function joe(e){var t;const{axes:n,resolve:i}=e.component;const r={top:0,bottom:0,right:0,left:0};for(const o of e.children){o.parseAxesAndHeaders();for(const t of WJ(o.component.axes)){i.axis[t]=Ite(e.component.resolve,t);if(i.axis[t]==="shared"){n[t]=koe(n[t],o.component.axes[t]);if(!n[t]){i.axis[t]="independent";delete n[t]}}}}for(const o of WK){for(const s of e.children){if(!s.component.axes[o]){continue}if(i.axis[o]==="independent"){n[o]=((t=n[o])!==null&&t!==void 0?t:[]).concat(s.component.axes[o]);for(const e of s.component.axes[o]){const{value:t,explicit:n}=e.getWithExplicit("orient");if(S2(t)){continue}if(r[t]>0&&!n){const n=Ooe[t];if(r[t]>r[n]){e.set("orient",n,false)}}r[t]++}}delete s.component.axes[o]}if(i.axis[o]==="independent"&&n[o]&&n[o].length>1){for(const e of n[o]){if(!!e.get("grid")&&!e.explicit.grid){e.implicit.grid=false}}}}}function koe(e,t){if(e){if(e.length!==t.length){return undefined}const n=e.length;for(let i=0;ie.clone())}return e}function Eoe(e,t){for(const n of yoe){const i=o9(e.getWithExplicit(n),t.getWithExplicit(n),n,"axis",(e,t)=>{switch(n){case"title":return L6(e,t);case"gridScale":return{explicit:e.explicit,value:oZ(e.value,t.value)}}return r9(e,t,n,"axis")});e.setWithExplicit(n,i)}return e}function Aoe(e,t,n,i,r){if(t==="disable"){return n!==undefined}n=n||{};switch(t){case"titleAngle":case"labelAngle":return e===(S2(n.labelAngle)?n.labelAngle:fZ(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===dte(i,r)){return true}}return e===n[t]}const Doe=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function Soe(e,t){var n,i,r;let o=t.axis(e);const s=new xoe;const a=h6(t.encoding[e]);const{mark:u,config:c}=t;const l=(o===null||o===void 0?void 0:o.orient)||((n=c[e==="x"?"axisX":"axisY"])===null||n===void 0?void 0:n.orient)||((i=c.axis)===null||i===void 0?void 0:i.orient)||lte(e);const f=t.getScaleComponent(e).get("type");const d=Qee(e,f,l,t.config);const h=o!==undefined?!o:ete("disable",c.style,o===null||o===void 0?void 0:o.style,d).configValue;s.set("disable",h,o!==undefined);if(h){return s}o=o||{};const p=rte(a,o,e,c.style,d);const g={fieldOrDatumDef:a,axis:o,channel:e,model:t,scaleType:f,orient:l,labelAngle:p,mark:u,config:c};for(const v of yoe){const n=v in tte?tte[v](g):yZ(v)?o[v]:undefined;const i=n!==undefined;const r=Aoe(n,v,o,t,e);if(i&&r){s.set(v,n,r)}else{const{configValue:e=undefined,configFrom:t=undefined}=yZ(v)&&v!=="values"?ete(v,c.style,o.style,d):{};const a=e!==undefined;if(i&&!a){s.set(v,n,r)}else if(!(t==="vgAxisConfig")||Doe.has(v)&&a||pZ(e)||S2(e)){s.set(v,e,false)}}}const m=(r=o.encoding)!==null&&r!==void 0?r:{};const b=gZ.reduce((n,i)=>{var r;if(!s.hasAxisPart(i)){return n}const o=Bte((r=m[i])!==null&&r!==void 0?r:{},t);const a=i==="labels"?_oe(t,e,o):o;if(a!==undefined&&!qJ(a)){n[i]={update:a}}return n},{});if(!qJ(b)){s.set("encode",b,!!o.encoding||o.labelAngle!==undefined)}return s}function Moe({encoding:e,size:t}){for(const n of WK){const i=EK(n);if(G4(t[i])){if(P5(e[n])){delete t[i];Q1(b.stepDropped(i))}}}return t}function Coe(e,t,n){const i=N6("orient",e,n);e.orient=Toe(e.type,t,i);if(i!==undefined&&i!==e.orient){Q1(b.orientOverridden(e.orient,i))}if(e.type==="bar"&&e.orient){const i=N6("cornerRadiusEnd",e,n);if(i!==undefined){const n=e.orient==="horizontal"&&t.x2||e.orient==="vertical"&&t.y2?["cornerRadius"]:JZ[e.orient];for(const t of n){e[t]=i}if(e.cornerRadiusEnd!==undefined){delete e.cornerRadiusEnd}}}const r=N6("opacity",e,n);if(r===undefined){e.opacity=Foe(e.type,t)}const o=N6("cursor",e,n);if(o===undefined){e.cursor=$oe(e,t,n)}return e}function $oe(e,t,n){if(t.href||e.href||N6("href",e,n)){return"pointer"}return e.cursor}function Foe(e,t){if($J([AZ,CZ,FZ,NZ],e)){if(!q6(t)){return.7}}return undefined}function Noe(e,t,{graticule:n}){if(n){return false}const i=T6("filled",e,t);const r=e.type;return oZ(i,r!==AZ&&r!==EZ&&r!==SZ)}function Toe(e,t,n){switch(e){case AZ:case FZ:case NZ:case MZ:case DZ:case kZ:return undefined}const{x:i,y:r,x2:o,y2:s}=t;switch(e){case jZ:if(z5(i)&&(v0(i.bin)||z5(r)&&r.aggregate&&!i.aggregate)){return"vertical"}if(z5(r)&&(v0(r.bin)||z5(i)&&i.aggregate&&!r.aggregate)){return"horizontal"}if(s||o){if(n){return n}if(!o){if(z5(i)&&i.type===t3&&!b0(i.bin)||L5(i)){return"horizontal"}}if(!s){if(z5(r)&&r.type===t3&&!b0(r.bin)||L5(r)){return"vertical"}}}case SZ:if(o&&!(z5(i)&&v0(i.bin))&&s&&!(z5(r)&&v0(r.bin))){return undefined}case OZ:if(s){if(z5(r)&&v0(r.bin)){return"horizontal"}else{return"vertical"}}else if(o){if(z5(i)&&v0(i.bin)){return"vertical"}else{return"horizontal"}}else if(e===SZ){if(i&&!r){return"vertical"}else if(r&&!i){return"horizontal"}}case EZ:case CZ:{const t=P5(i);const o=P5(r);if(t&&!o){return e!=="tick"?"horizontal":"vertical"}else if(!t&&o){return e!=="tick"?"vertical":"horizontal"}else if(t&&o){const t=i;const o=r;const s=t.type===i3;const a=o.type===i3;if(s&&!a){return e!=="tick"?"vertical":"horizontal"}else if(!s&&a){return e!=="tick"?"horizontal":"vertical"}if(!t.aggregate&&o.aggregate){return e!=="tick"?"vertical":"horizontal"}else if(t.aggregate&&!o.aggregate){return e!=="tick"?"horizontal":"vertical"}if(n){return n}return"vertical"}else{if(n){return n}return undefined}}}return"vertical"}const zoe={vgMark:"arc",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},p7(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),J9("x",e,{defaultPos:"mid"})),J9("y",e,{defaultPos:"mid"})),a7(e,"radius","arc")),a7(e,"theta","arc"))};const Roe={vgMark:"area",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign({},p7(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"})),n7("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="horizontal"})),n7("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="vertical"})),v7(e))};const Boe={vgMark:"rect",encodeEntry:e=>Object.assign(Object.assign(Object.assign({},p7(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),a7(e,"x","bar")),a7(e,"y","bar"))};const Poe={vgMark:"shape",encodeEntry:e=>Object.assign({},p7(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),postEncodingTransform:e=>{const{encoding:t}=e;const n=t.shape;const i=Object.assign({type:"geoshape",projection:e.projectionName()},n&&z5(n)&&n.type===o3?{field:Z5(n,{expr:"datum"})}:{});return[i]}};const Ioe={vgMark:"image",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign({},p7(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"})),a7(e,"x","image")),a7(e,"y","image")),B9(e,"url"))};const Loe={vgMark:"line",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},p7(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),J9("x",e,{defaultPos:"mid"})),J9("y",e,{defaultPos:"mid"})),H9("size",e,{vgChannel:"strokeWidth"})),v7(e))};const Uoe={vgMark:"trail",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},p7(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"})),J9("x",e,{defaultPos:"mid"})),J9("y",e,{defaultPos:"mid"})),H9("size",e)),v7(e))};function qoe(e,t){const{config:n}=e;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},p7(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"})),J9("x",e,{defaultPos:"mid"})),J9("y",e,{defaultPos:"mid"})),H9("size",e)),H9("angle",e)),Woe(e,n,t))}function Woe(e,t,n){if(n){return{shape:{value:n}}}return H9("shape",e)}const Goe={vgMark:"symbol",encodeEntry:e=>qoe(e)};const Hoe={vgMark:"symbol",encodeEntry:e=>qoe(e,"circle")};const Voe={vgMark:"symbol",encodeEntry:e=>qoe(e,"square")};const Yoe={vgMark:"rect",encodeEntry:e=>Object.assign(Object.assign(Object.assign({},p7(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),a7(e,"x","rect")),a7(e,"y","rect"))};const Xoe={vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e;const n=t.orient;if(!e.encoding.x&&!e.encoding.y&&!e.encoding.latitude&&!e.encoding.longitude){return{}}return Object.assign(Object.assign(Object.assign(Object.assign({},p7(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),n7("x",e,{defaultPos:n==="horizontal"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="vertical"})),n7("y",e,{defaultPos:n==="vertical"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="horizontal"})),H9("size",e,{vgChannel:"strokeWidth"}))}};const Joe={vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},p7(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"})),J9("x",e,{defaultPos:"mid"})),J9("y",e,{defaultPos:"mid"})),B9(e)),H9("size",e,{vgChannel:"fontSize"})),H9("angle",e)),x7("align",Zoe(e.markDef,n,t))),x7("baseline",Qoe(e.markDef,n,t))),J9("radius",e,{defaultPos:null,isMidPoint:true})),J9("theta",e,{defaultPos:null,isMidPoint:true}))}};function Zoe(e,t,n){const i=N6("align",e,n);if(i===undefined){return"center"}return undefined}function Qoe(e,t,n){const i=N6("baseline",e,n);if(i===undefined){return"middle"}return undefined}const Koe={vgMark:"rect",encodeEntry:e=>{const{config:t,markDef:n}=e;const i=n.orient;const r=i==="horizontal"?"width":"height";const o=i==="horizontal"?"height":"width";return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},p7(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),J9("x",e,{defaultPos:"mid",vgChannel:"xc"})),J9("y",e,{defaultPos:"mid",vgChannel:"yc"})),H9("size",e,{defaultValue:ese(e),vgChannel:r})),{[o]:S6(N6("thickness",n,t))})}};function ese(e){var t;const{config:n,markDef:i}=e;const{orient:r}=i;const o=r==="horizontal"?"width":"height";const s=e.getScaleComponent(r==="horizontal"?"x":"y");const a=(t=N6("size",i,n,{vgChannel:o}))!==null&&t!==void 0?t:n.tick.bandSize;if(a!==undefined){return a}else{const e=s?s.get("range"):undefined;if(e&&M2(e)&&Object(oe["F"])(e.step)){return e.step*3/4}const t=Q4(n.view,o);return t*3/4}}const tse={arc:zoe,area:Roe,bar:Boe,circle:Hoe,geoshape:Poe,image:Ioe,line:Loe,point:Goe,rect:Yoe,rule:Xoe,square:Voe,text:Joe,tick:Koe,trail:Uoe};function nse(e){if($J([EZ,OZ,$Z],e.mark)){const t=Z6(e.mark,e.encoding);if(t.length>0){return rse(e,t)}}else if($J([jZ],e.mark)){const t=R2.some(t=>N6(t,e.markDef,e.config));if(e.stack&&!e.fieldDef("size")&&t){return sse(e)}}return use(e)}const ise="faceted_path_";function rse(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:ise+e.requestDataName(p9.Main),data:e.requestDataName(p9.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:use(e,{fromPrefix:ise})}]}const ose="stack_group_";function sse(e){const[t]=use(e,{fromPrefix:ose});const n=e.scaleName(e.stack.fieldChannel);const i=(t={})=>e.vgField(e.stack.fieldChannel,t);const r=(e,t)=>{const r=[i({prefix:"min",suffix:"start",expr:t}),i({prefix:"max",suffix:"start",expr:t}),i({prefix:"min",suffix:"end",expr:t}),i({prefix:"max",suffix:"end",expr:t})];return`${e}(${r.map(e=>`scale('${n}',${e})`).join(",")})`};let o;let s;if(e.stack.fieldChannel==="x"){o=Object.assign(Object.assign({},AJ(t.encode.update,["y","yc","y2","height",...R2])),{x:{signal:r("min","datum")},x2:{signal:r("max","datum")},clip:{value:true}});s={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}};t.encode.update=Object.assign(Object.assign({},DJ(t.encode.update,["y","yc","y2"])),{height:{field:{group:"height"}}})}else{o=Object.assign(Object.assign({},AJ(t.encode.update,["x","xc","x2","width"])),{y:{signal:r("min","datum")},y2:{signal:r("max","datum")},clip:{value:true}});s={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}};t.encode.update=Object.assign(Object.assign({},DJ(t.encode.update,["x","xc","x2"])),{width:{field:{group:"width"}}})}for(const l of R2){const n=T6(l,e.markDef,e.config);if(t.encode.update[l]){o[l]=t.encode.update[l];delete t.encode.update[l]}else if(n){o[l]=S6(n)}if(n){t.encode.update[l]={value:0}}}const a=e.fieldDef(e.stack.groupbyChannel);const u=Z5(a)?[Z5(a)]:[];if((a===null||a===void 0?void 0:a.bin)||(a===null||a===void 0?void 0:a.timeUnit)){u.push(Z5(a,{binSuffix:"end"}))}const c=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"];o=c.reduce((n,i)=>{if(t.encode.update[i]){return Object.assign(Object.assign({},n),{[i]:t.encode.update[i]})}else{const t=T6(i,e.markDef,e.config);if(t!==undefined){return Object.assign(Object.assign({},n),{[i]:S6(t)})}else{return n}}},o);if(o.stroke){o.strokeForeground={value:true};o.strokeOffset={value:0}}return[{type:"group",from:{facet:{data:e.requestDataName(p9.Main),name:ose+e.requestDataName(p9.Main),groupby:u,aggregate:{fields:[i({suffix:"start"}),i({suffix:"start"}),i({suffix:"end"}),i({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:o},marks:[{type:"group",encode:{update:s},marks:[t]}]}]}function ase(e){const{encoding:t,stack:n,mark:i,markDef:r,config:o}=e;const s=t.order;if(!Object(oe["B"])(s)&&W5(s)&&CJ(s.value)||!s&&CJ(N6("order",r,o))){return undefined}else if((Object(oe["B"])(s)||z5(s))&&!n){return B6(s,{expr:"datum"})}else if(RZ(i)){const n=r.orient==="horizontal"?"y":"x";const i=t[n];if(z5(i)){const t=i.sort;if(Object(oe["B"])(t)){return{field:Z5(i,{prefix:n,suffix:"sort_index",expr:"datum"})}}else if(_5(t)){return{field:Z5({aggregate:q6(e.encoding)?t.op:undefined,field:t.field},{expr:"datum"})}}else if(x5(t)){const n=e.fieldDef(t.encoding);return{field:Z5(n,{expr:"datum"}),order:t.order}}else if(t===null){return undefined}else{return{field:Z5(i,{binSuffix:e.stack&&e.stack.impute?"mid":undefined,expr:"datum"})}}}return undefined}return undefined}function use(e,t={fromPrefix:""}){const{mark:n,markDef:i,encoding:r,config:o}=e;const s=oZ(i.clip,cse(e),lse(e));const a=F6(i);const u=r.key;const c=ase(e);const l=fse(e);const f=N6("aria",i,o);const d=tse[n].postEncodingTransform?tse[n].postEncodingTransform(e):null;return[Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:e.getName("marks"),type:tse[n].vgMark},s?{clip:true}:{}),a?{style:a}:{}),u?{key:u.field}:{}),c?{sort:c}:{}),l?l:{}),f===false?{aria:f}:{}),{from:{data:t.fromPrefix+e.requestDataName(p9.Main)},encode:{update:tse[n].encodeEntry(e)}}),d?{transform:d}:{})]}function cse(e){const t=e.getScaleComponent("x");const n=e.getScaleComponent("y");return t&&t.get("selectionExtent")||n&&n.get("selectionExtent")?true:undefined}function lse(e){const t=e.component.projection;return t&&!t.isFit?true:undefined}function fse(e){if(!e.component.selection)return null;const t=WJ(e.component.selection).length;let n=t;let i=e.parent;while(i&&n===0){n=WJ(i.component.selection).length;i=i.parent}return n?{interactive:t>0||!!e.encoding.tooltip}:null}class dse extends Nre{constructor(e,t,n,i={},r){super(e,"unit",t,n,r,undefined,H4(e)?e.view:undefined);this.specifiedScales={};this.specifiedAxes={};this.specifiedLegends={};this.specifiedProjection={};this.selection={};this.children=[];const o=IZ(e.mark)?Object.assign({},e.mark):{type:e.mark};const s=o.type;if(o.filled===undefined){o.filled=Noe(o,r,{graticule:e.data&&h9(e.data)})}const a=this.encoding=H6(e.encoding||{},s,o.filled,r);this.markDef=Coe(o,a,r);this.size=Moe({encoding:a,size:H4(e)?Object.assign(Object.assign(Object.assign({},i),e.width?{width:e.width}:{}),e.height?{height:e.height}:{}):i});this.stack=A8(s,a);this.specifiedScales=this.initScales(s,a);this.specifiedAxes=this.initAxes(a);this.specifiedLegends=this.initLegend(a);this.specifiedProjection=e.projection;this.selection=e.selection}get hasProjection(){const{encoding:e}=this;const t=this.mark===TZ;const n=e&&nK.some(t=>U5(e[t]));return t||n}scaleDomain(e){const t=this.specifiedScales[e];return t?t.domain:undefined}axis(e){return this.specifiedAxes[e]}legend(e){return this.specifiedLegends[e]}initScales(e,t){return u0.reduce((e,n)=>{var i;const r=h6(t[n]);if(r){e[n]=(i=r.scale)!==null&&i!==void 0?i:{}}return e},{})}initAxes(e){return WK.reduce((t,n)=>{const i=e[n];if(U5(i)||n===yQ&&U5(e.x2)||n===xQ&&U5(e.y2)){const e=U5(i)?i.axis:undefined;t[n]=e?Object.assign({},e):e}return t},{})}initLegend(e){return r0.reduce((t,n)=>{const i=h6(e[n]);if(i&&s0(n)){const e=i.legend;t[n]=e?Object.assign({},e):e}return t},{})}parseData(){this.component.data=goe(this)}parseLayoutSize(){aoe(this)}parseSelections(){this.component.selection=Ree(this,this.selection)}parseMarkGroup(){this.component.mark=nse(this)}parseAxesAndHeaders(){this.component.axes=woe(this)}assembleSelectionTopLevelSignals(e){return see(this,e)}assembleSignals(){return[...Gee(this),...ree(this,[])]}assembleSelectionData(e){return aee(this,e)}assembleLayout(){return null}assembleLayoutSignals(){return Fte(this)}assembleMarks(){var e;let t=(e=this.component.mark)!==null&&e!==void 0?e:[];if(!this.parent||!$re(this.parent)){t=uee(this,t)}return t.map(this.correctDataNames)}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(e){return U6(this.encoding,e)}fieldDef(e){const t=this.encoding[e];return d6(t)}typedFieldDef(e){const t=this.fieldDef(e);if(q5(t)){return t}return null}}class hse extends Fre{constructor(e,t,n,i,r){super(e,"layer",t,n,r,e.resolve,e.view);const o=Object.assign(Object.assign(Object.assign({},i),e.width?{width:e.width}:{}),e.height?{height:e.height}:{});this.children=e.layer.map((e,t)=>{if(b8(e)){return new hse(e,this,this.getName("layer_"+t),o,r)}else if(nQ(e)){return new dse(e,this,this.getName("layer_"+t),o,r)}throw new Error(b.invalidSpec(e))})}parseData(){this.component.data=goe(this);for(const e of this.children){e.parseData()}}parseLayoutSize(){noe(this)}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const t of WJ(e.component.selection)){this.component.selection[t]=e.component.selection[t]}}}parseMarkGroup(){for(const e of this.children){e.parseMarkGroup()}}parseAxesAndHeaders(){joe(this)}assembleSelectionTopLevelSignals(e){return this.children.reduce((e,t)=>t.assembleSelectionTopLevelSignals(e),e)}assembleSignals(){return this.children.reduce((e,t)=>e.concat(t.assembleSignals()),Gee(this))}assembleLayoutSignals(){return this.children.reduce((e,t)=>e.concat(t.assembleLayoutSignals()),Fte(this))}assembleSelectionData(e){return this.children.reduce((e,t)=>t.assembleSelectionData(e),e)}assembleTitle(){let e=super.assembleTitle();if(e){return e}for(const t of this.children){e=t.assembleTitle();if(e){return e}}return undefined}assembleLayout(){return null}assembleMarks(){return cee(this,this.children.flatMap(e=>e.assembleMarks()))}assembleLegends(){return this.children.reduce((e,t)=>e.concat(t.assembleLegends()),yne(this))}}function pse(e,t,n,i,r){if(k5(e)){return new loe(e,t,n,r)}else if(b8(e)){return new hse(e,t,n,i,r)}else if(nQ(e)){return new dse(e,t,n,i,r)}else if(L4(e)){return new moe(e,t,n,r)}throw new Error(b.invalidSpec(e))}function gse(e,t={}){if(t.logger){X1(t.logger)}if(t.fieldTitle){o6(t.fieldTitle)}try{const n=l8(Object(oe["O"])(t.config,e.config));const i=G8(e,n);const r=pse(i,null,"",undefined,n);r.parse();Aie(r.component.data,r);const o=bse(r,mse(e,i.autosize,n,r),e.datasets,e.usermeta);return{spec:o,normalized:i}}finally{if(t.logger){J1()}if(t.fieldTitle){s6()}}}function mse(e,t,n,i){const r=i.component.layoutSize.get("width");const o=i.component.layoutSize.get("height");if(t===undefined){t={type:"pad"};if(i.hasAxisOrientSignalRef()){t.resize=true}}else if(Object(oe["I"])(t)){t={type:t}}if(r&&o&&J8(t.type)){if(r==="step"&&o==="step"){Q1(b.droppingFit());t.type="pad"}else if(r==="step"||o==="step"){const e=r==="step"?"width":"height";Q1(b.droppingFit(YK(e)));const n=e==="width"?"height":"width";t.type=Z8(n)}}return Object.assign(Object.assign(Object.assign({},WJ(t).length===1&&t.type?t.type==="pad"?{}:{autosize:t.type}:{autosize:t}),K8(n)),K8(e))}function bse(e,t,n={},i){const r=e.config?p8(e.config):undefined;const o=[].concat(e.assembleSelectionData([]),Jre(e.component.data,n));const s=e.assembleProjections();const a=e.assembleTitle();const u=e.assembleGroupStyle();const c=e.assembleGroupEncodeEntry(true);let l=e.assembleLayoutSignals();l=l.filter(e=>{if((e.name==="width"||e.name==="height")&&e.value!==undefined){t[e.name]=+e.value;return false}return true});return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({$schema:"https://vega.github.io/schema/vega/v5.json"},e.description?{description:e.description}:{}),t),a?{title:a}:{}),u?{style:u}:{}),c?{encode:{update:c}}:{}),{data:o}),s.length>0?{projections:s}:{}),e.assembleGroup([...l,...e.assembleSelectionTopLevelSignals([])])),r?{config:r}:{}),i?{usermeta:i}:{})}var vse=function(e){const[t,n]=/\/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:n}};var yse="vega-themes";var xse="2.9.1";var _se="Themes for stylized Vega and Vega-Lite visualizations.";var wse=["vega","vega-lite","themes","style"];var Ose="BSD-3-Clause";var jse={name:"UW Interactive Data Lab",url:"https://idl.cs.washington.edu"};var kse=[{name:"Emily Gu",url:"https://github.com/emilygu"},{name:"Arvind Satyanarayan",url:"http://arvindsatya.com"},{name:"Jeffrey Heer",url:"https://idl.cs.washington.edu"},{name:"Dominik Moritz",url:"https://www.domoritz.de"}];var Ese="build/vega-themes.js";var Ase="build/vega-themes.module.js";var Dse="build/vega-themes.min.js";var Sse="build/vega-themes.min.js";var Mse="build/vega-themes.module.d.ts";var Cse={type:"git",url:"https://github.com/vega/vega-themes.git"};var $se=["src","build"];var Fse={prebuild:"yarn clean",build:"rollup -c",clean:"rimraf build && rimraf examples/build","copy:data":"rsync -r node_modules/vega-datasets/data/* examples/data","copy:build":"rsync -r build/* examples/build","deploy:gh":"yarn build && mkdir -p examples/build && rsync -r build/* examples/build && gh-pages -d examples",prepublishOnly:"yarn clean && yarn build",preversion:"yarn lint",serve:"browser-sync start -s -f build examples --serveStatic examples",start:"yarn build && concurrently --kill-others -n Server,Rollup 'yarn serve' 'rollup -c -w'",prepare:"beemo create-config",eslintbase:"beemo eslint .",format:"yarn eslintbase --fix",lint:"yarn eslintbase"};var Nse={"@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^9.0.0","@wessberg/rollup-plugin-ts":"^1.3.4","browser-sync":"^2.26.12",concurrently:"^5.3.0","gh-pages":"^3.1.0",rollup:"^2.26.11","rollup-plugin-bundle-size":"^1.0.3","rollup-plugin-terser":"^7.0.2",typescript:"^4.0.2",vega:"^5.10.0","vega-lite":"^4.8.1","vega-lite-dev-config":"^0.14.6"};var Tse={vega:"*","vega-lite":"*"};var zse={module:"vega-lite-dev-config",drivers:["typescript","prettier","eslint"]};var Rse={name:yse,version:xse,description:_se,keywords:wse,license:Ose,author:jse,contributors:kse,main:Ese,module:Ase,unpkg:Dse,jsdelivr:Sse,types:Mse,repository:Cse,files:$se,scripts:Fse,devDependencies:Nse,peerDependencies:Tse,beemo:zse};const Bse="#fff";const Pse="#888";const Ise={background:"#333",title:{color:Bse},style:{"guide-label":{fill:Bse},"guide-title":{fill:Bse}},axis:{domainColor:Bse,gridColor:Pse,tickColor:Bse}};const Lse="#4572a7";const Use={background:"#fff",arc:{fill:Lse},area:{fill:Lse},line:{stroke:Lse,strokeWidth:2},path:{stroke:Lse},rect:{fill:Lse},shape:{stroke:Lse},symbol:{fill:Lse,strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:true,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:false,tickExtra:true},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}};const qse="#30a2da";const Wse="#cbcbcb";const Gse="#999";const Hse="#333";const Vse="#f0f0f0";const Yse="#333";const Xse={arc:{fill:qse},area:{fill:qse},axis:{domainColor:Wse,grid:true,gridColor:Wse,gridWidth:1,labelColor:Gse,labelFontSize:10,titleColor:Hse,tickColor:Wse,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:false},background:Vse,group:{fill:Vse},legend:{labelColor:Yse,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:Yse,titleFontSize:14,titlePadding:10},line:{stroke:qse,strokeWidth:2},path:{stroke:qse,strokeWidth:.5},rect:{fill:qse},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:true,shape:"circle"},shape:{stroke:qse},bar:{binSpacing:2,fill:qse,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}};const Jse="#000";const Zse={group:{fill:"#e5e5e5"},arc:{fill:Jse},area:{fill:Jse},line:{stroke:Jse},path:{stroke:Jse},rect:{fill:Jse},shape:{stroke:Jse},symbol:{fill:Jse,size:40},axis:{domain:false,grid:true,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}};const Qse=22;const Kse="normal";const eae="Benton Gothic, sans-serif";const tae=11.5;const nae="normal";const iae="#82c6df";const rae="Benton Gothic Bold, sans-serif";const oae="normal";const sae=13;const aae={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"],"ice-7":["#edefee","#dadfe2","#c4ccd2","#a6b7c6","#849eae","#607785","#47525d"]};const uae={background:"#ffffff",title:{anchor:"start",color:"#000000",font:rae,fontSize:Qse,fontWeight:Kse},arc:{fill:iae},area:{fill:iae},line:{stroke:iae,strokeWidth:2},path:{stroke:iae},rect:{fill:iae},shape:{stroke:iae},symbol:{fill:iae,size:30},axis:{labelFont:eae,labelFontSize:tae,labelFontWeight:nae,titleFont:rae,titleFontSize:sae,titleFontWeight:oae},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:eae,labelFontSize:tae,symbolType:"square",titleFont:rae,titleFontSize:sae,titleFontWeight:oae},range:{category:aae["category-6"],diverging:aae["fireandice-6"],heatmap:aae["fire-7"],ordinal:aae["fire-7"],ramp:aae["fire-7"]}};const cae="#ab5787";const lae="#979797";const fae={background:"#f9f9f9",arc:{fill:cae},area:{fill:cae},line:{stroke:cae},path:{stroke:cae},rect:{fill:cae},shape:{stroke:cae},symbol:{fill:cae,size:30},axis:{domainColor:lae,domainWidth:.5,gridWidth:.2,labelColor:lae,tickColor:lae,tickWidth:.2,titleColor:lae},axisBand:{grid:false},axisX:{grid:true,tickSize:10},axisY:{domain:false,grid:true,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}};const dae="#3e5c69";const hae={background:"#fff",arc:{fill:dae},area:{fill:dae},line:{stroke:dae},path:{stroke:dae},rect:{fill:dae},shape:{stroke:dae},symbol:{fill:dae},axis:{domainWidth:.5,grid:true,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:false},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}};const pae="#1696d2";const gae="#000000";const mae="#FFFFFF";const bae="Lato";const vae="Lato";const yae="Lato";const xae="#DEDDDD";const _ae=18;const wae={"main-colors":["#1696d2","#d2d2d2","#000000","#fdbf11","#ec008b","#55b748","#5c5859","#db2b27"],"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"shades-gray":["#F5F5F5","#ECECEC","#E3E3E3","#DCDBDB","#D2D2D2","#9D9D9D","#696969","#353535"],"shades-yellow":["#FFF2CF","#FCE39E","#FDD870","#FCCB41","#FDBF11","#E88E2D","#CA5800","#843215"],"shades-magenta":["#F5CBDF","#EB99C2","#E46AA7","#E54096","#EC008B","#AF1F6B","#761548","#351123"],"shades-green":["#DCEDD9","#BCDEB4","#98CF90","#78C26D","#55B748","#408941","#2C5C2D","#1A2E19"],"shades-black":["#D5D5D4","#ADABAC","#848081","#5C5859","#332D2F","#262223","#1A1717","#0E0C0D"],"shades-red":["#F8D5D4","#F1AAA9","#E9807D","#E25552","#DB2B27","#A4201D","#6E1614","#370B0A"],"one-group":["#1696d2","#000000"],"two-groups-cat-1":["#1696d2","#000000"],"two-groups-cat-2":["#1696d2","#fdbf11"],"two-groups-cat-3":["#1696d2","#db2b27"],"two-groups-seq":["#a2d4ec","#1696d2"],"three-groups-cat":["#1696d2","#fdbf11","#000000"],"three-groups-seq":["#a2d4ec","#1696d2","#0a4c6a"],"four-groups-cat-1":["#000000","#d2d2d2","#fdbf11","#1696d2"],"four-groups-cat-2":["#1696d2","#ec0008b","#fdbf11","#5c5859"],"four-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a"],"five-groups-cat-1":["#1696d2","#fdbf11","#d2d2d2","#ec008b","#000000"],"five-groups-cat-2":["#1696d2","#0a4c6a","#d2d2d2","#fdbf11","#332d2f"],"five-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a","#000000"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-cat-2":["#1696d2","#d2d2d2","#ec008b","#fdbf11","#332d2f","#0a4c6a"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]};const Oae={background:mae,title:{anchor:"start",fontSize:_ae,font:bae},axisX:{domain:true,domainColor:gae,domainWidth:1,grid:false,labelFontSize:12,labelFont:vae,labelAngle:0,tickColor:gae,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:bae},axisY:{domain:false,domainWidth:1,grid:true,gridColor:xae,gridWidth:1,labelFontSize:12,labelFont:vae,labelPadding:8,ticks:false,titleFontSize:12,titlePadding:10,titleFont:bae,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:vae,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:bae,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:wae["six-groups-cat-1"],diverging:wae["diverging-colors"],heatmap:wae["diverging-colors"],ordinal:wae["six-groups-seq"],ramp:wae["shades-blue"]},area:{fill:pae},rect:{fill:pae},line:{color:pae,stroke:pae,strokeWidth:5},trail:{color:pae,stroke:pae,strokeWidth:0,size:1},path:{stroke:pae,strokeWidth:.5},point:{filled:true},text:{font:yae,color:pae,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:pae,stroke:null}},arc:{fill:pae},shape:{stroke:pae},symbol:{fill:pae,size:30}};const jae="#3366CC";const kae="#ccc";const Eae="Arial, sans-serif";const Aae={arc:{fill:jae},area:{fill:jae},path:{stroke:jae},rect:{fill:jae},shape:{stroke:jae},symbol:{stroke:jae},circle:{fill:jae},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:Eae,fontSize:12},"guide-title":{font:Eae,fontSize:12},"group-title":{font:Eae,fontSize:12}},title:{font:Eae,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:kae,tickColor:kae,domain:false,grid:true},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}};const Dae=Rse.version;var Sae="vega-tooltip";var Mae="0.24.1";var Cae="A tooltip plugin for Vega-Lite and Vega visualizations.";var $ae=["vega-lite","vega","tooltip"];var Fae={type:"git",url:"https://github.com/vega/vega-tooltip.git"};var Nae={name:"UW Interactive Data Lab",url:"https://idl.cs.washington.edu"};var Tae=["Dominik Moritz","Sira Horradarn","Zening Qu","Kanit Wongsuphasawat","Yuri Astrakhan","Jeffrey Heer"];var zae="BSD-3-Clause";var Rae={url:"https://github.com/vega/vega-tooltip/issues"};var Bae="https://github.com/vega/vega-tooltip#readme";var Pae="build/vega-tooltip.js";var Iae="build/vega-tooltip.module.js";var Lae="build/vega-tooltip.min.js";var Uae="build/vega-tooltip.min.js";var qae="build/vega-tooltip.module.d.ts";var Wae=["src","build","types"];var Gae={prebuild:"yarn clean && yarn build:style",build:"rollup -c","build:style":"./build-style.sh",clean:"rimraf build && rimraf src/style.ts","copy:data":"rsync -r node_modules/vega-datasets/data/* examples/data","copy:build":"rsync -r build/* examples/build","deploy:gh":"yarn build && yarn copy:build && gh-pages -d examples && yarn clean",prepublishOnly:"yarn clean && yarn build",preversion:"yarn lint && yarn test",serve:"browser-sync start -s -f build examples --serveStatic examples",start:"yarn build && concurrently --kill-others -n Server,Rollup 'yarn serve' 'rollup -c -w'",pretest:"yarn build:style",test:"beemo jest","test:inspect":"node --inspect-brk ./node_modules/.bin/jest --runInBand",prepare:"beemo create-config",prettierbase:"beemo prettier '*.{css,scss,html}'",eslintbase:"beemo eslint .",format:"yarn eslintbase --fix && yarn prettierbase --write",lint:"yarn eslintbase && yarn prettierbase --check"};var Hae={"@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^9.0.0","@wessberg/rollup-plugin-ts":"^1.3.4","browser-sync":"^2.26.12",concurrently:"^5.3.0","gh-pages":"^3.1.0","node-sass":"^4.14.1",path:"^0.12.7",rollup:"^2.26.11","rollup-plugin-bundle-size":"^1.0.3","rollup-plugin-terser":"^7.0.2",typescript:"~4.0.2","vega-datasets":"^2.1.0","vega-lite-dev-config":"^0.14.6","vega-typings":"^0.18.2"};var Vae={"vega-util":"^1.15.1"};var Yae={module:"vega-lite-dev-config",drivers:["typescript","prettier","eslint","babel","jest"],eslint:{ignore:["types"]},typescript:{compilerOptions:{typeRoots:["node_modules/@types","types"]}}};var Xae={name:Sae,version:Mae,description:Cae,keywords:$ae,repository:Fae,author:Nae,collaborators:Tae,license:zae,bugs:Rae,homepage:Bae,main:Pae,module:Iae,unpkg:Lae,jsdelivr:Uae,types:qae,files:Wae,scripts:Gae,devDependencies:Hae,dependencies:Vae,beemo:Yae};var Jae=`#vg-tooltip-element {\n visibility: hidden;\n padding: 8px;\n position: fixed;\n z-index: 1000;\n font-family: sans-serif;\n font-size: 11px;\n border-radius: 3px;\n box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);\n /* The default theme is the light theme. */\n background-color: rgba(255, 255, 255, 0.95);\n border: 1px solid #d9d9d9;\n color: black; }\n #vg-tooltip-element.visible {\n visibility: visible; }\n #vg-tooltip-element h2 {\n margin-top: 0;\n margin-bottom: 10px;\n font-size: 13px; }\n #vg-tooltip-element img {\n max-width: 200px;\n max-height: 200px; }\n #vg-tooltip-element table {\n border-spacing: 0; }\n #vg-tooltip-element table tr {\n border: none; }\n #vg-tooltip-element table tr td {\n overflow: hidden;\n text-overflow: ellipsis;\n padding-top: 2px;\n padding-bottom: 2px; }\n #vg-tooltip-element table tr td.key {\n color: #808080;\n max-width: 150px;\n text-align: right;\n padding-right: 4px; }\n #vg-tooltip-element table tr td.value {\n display: block;\n max-width: 300px;\n max-height: 7em;\n text-align: left; }\n #vg-tooltip-element.dark-theme {\n background-color: rgba(32, 32, 32, 0.9);\n border: 1px solid #f5f5f5;\n color: white; }\n #vg-tooltip-element.dark-theme td.key {\n color: #bfbfbf; }\n`;const Zae="vg-tooltip-element";const Qae={offsetX:10,offsetY:10,id:Zae,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:false,sanitize:Kae,maxDepth:2};function Kae(e){return String(e).replace(/&/g,"&").replace(/t(Object(oe["I"])(e)?e:rue(e,n))).join(", ")}]`}if(Object(oe["G"])(e)){let i="";const r=e,{title:o,image:s}=r,a=tue(r,["title","image"]);if(o){i+=`

${t(o)}

`}if(s){i+=``}const u=Object.keys(a);if(u.length>0){i+="";for(const e of u){let r=a[e];if(r===undefined){continue}if(Object(oe["G"])(r)){r=rue(r,n)}i+=``}i+=`
${t(e)}:${t(r)}
`}return i||"{}"}return t(e)}function iue(e){const t=[];return function(n,i){if(typeof i!=="object"||i===null){return i}const r=t.indexOf(this)+1;t.length=r;if(t.length>e){return"[Object]"}if(t.indexOf(i)>=0){return"[Circular]"}t.push(i);return i}}function rue(e,t){return JSON.stringify(e,iue(t))}function oue(e,t,n,i){let r=e.clientX+n;if(r+t.width>window.innerWidth){r=+e.clientX-n-t.width}let o=e.clientY+i;if(o+t.height>window.innerHeight){o=+e.clientY-i-t.height}return{x:r,y:o}}class sue{constructor(e){this.options=Object.assign(Object.assign({},Qae),e);const t=this.options.id;this.call=this.tooltipHandler.bind(this);if(!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const e=document.createElement("style");e.setAttribute("id",this.options.styleId);e.innerHTML=eue(t);const n=document.head;if(n.childNodes.length>0){n.insertBefore(e,n.childNodes[0])}else{n.appendChild(e)}}this.el=document.getElementById(t);if(!this.el){this.el=document.createElement("div");this.el.setAttribute("id",t);this.el.classList.add("vg-tooltip");document.body.appendChild(this.el)}}tooltipHandler(e,t,n,i){if(i==null||i===""){this.el.classList.remove("visible",`${this.options.theme}-theme`);return}this.el.innerHTML=nue(i,this.options.sanitize,this.options.maxDepth);this.el.classList.add("visible",`${this.options.theme}-theme`);const{x:r,y:o}=oue(t,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY);this.el.setAttribute("style",`top: ${o}px; left: ${r}px`)}}const aue=Xae.version;function uue(e,t){const n=new sue(t);e.tooltip(n.call).run();return n}var cue=uue;function lue(e,t,n,i){function r(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function s(e){try{u(i.next(e))}catch(t){o(t)}}function a(e){try{u(i["throw"](e))}catch(t){o(t)}}function u(e){e.done?n(e.value):r(e.value).then(s,a)}u((i=i.apply(e,t||[])).next())}))}function fue(e,t,n){const i=e.open(t);const r=1e4;const o=250;const{origin:s}=new URL(t);let a=~~(r/o);function u(t){if(t.source===i){a=0;e.removeEventListener("message",u,false)}}e.addEventListener("message",u,false);function c(){if(a<=0){return}i.postMessage(n,s);setTimeout(c,o);a-=1}setTimeout(c,o)}var due=`.vega-embed {\n position: relative;\n display: inline-block;\n box-sizing: border-box; }\n .vega-embed.has-actions {\n padding-right: 38px; }\n .vega-embed details:not([open]) > :not(summary) {\n display: none !important; }\n .vega-embed summary {\n list-style: none;\n position: absolute;\n top: 0;\n right: 0;\n padding: 6px;\n z-index: 1000;\n background: white;\n box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);\n color: #1b1e23;\n border: 1px solid #aaa;\n border-radius: 999px;\n opacity: 0.2;\n transition: opacity 0.4s ease-in;\n outline: none;\n cursor: pointer;\n line-height: 0px; }\n .vega-embed summary::-webkit-details-marker {\n display: none; }\n .vega-embed summary:active {\n box-shadow: #aaa 0px 0px 0px 1px inset; }\n .vega-embed summary svg {\n width: 14px;\n height: 14px; }\n .vega-embed details[open] summary {\n opacity: 0.7; }\n .vega-embed:hover summary,\n .vega-embed:focus summary {\n opacity: 1 !important;\n transition: opacity 0.2s ease; }\n .vega-embed .vega-actions {\n position: absolute;\n z-index: 1001;\n top: 35px;\n right: -9px;\n display: flex;\n flex-direction: column;\n padding-bottom: 8px;\n padding-top: 8px;\n border-radius: 4px;\n box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);\n border: 1px solid #d9d9d9;\n background: white;\n animation-duration: 0.15s;\n animation-name: scale-in;\n animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);\n text-align: left; }\n .vega-embed .vega-actions a {\n padding: 8px 16px;\n font-family: sans-serif;\n font-size: 14px;\n font-weight: 600;\n white-space: nowrap;\n color: #434a56;\n text-decoration: none; }\n .vega-embed .vega-actions a:hover {\n background-color: #f7f7f9;\n color: black; }\n .vega-embed .vega-actions::before, .vega-embed .vega-actions::after {\n content: "";\n display: inline-block;\n position: absolute; }\n .vega-embed .vega-actions::before {\n left: auto;\n right: 14px;\n top: -16px;\n border: 8px solid #0000;\n border-bottom-color: #d9d9d9; }\n .vega-embed .vega-actions::after {\n left: auto;\n right: 15px;\n top: -14px;\n border: 7px solid #0000;\n border-bottom-color: #fff; }\n .vega-embed .chart-wrapper {\n width: 100%;\n height: 100%; }\n\n.vega-embed-wrapper {\n max-width: 100%;\n overflow: scroll;\n padding-right: 14px; }\n\n@keyframes scale-in {\n from {\n opacity: 0;\n transform: scale(0.6); }\n to {\n opacity: 1;\n transform: scale(1); } }\n`;if(!String.prototype.startsWith){String.prototype.startsWith=function(e,t){return this.substr(!t||t<0?0:+t,e.length)===e}}function hue(e,...t){for(const n of t){pue(e,n)}return e}function pue(e,t){for(const n of Object.keys(t)){Object(oe["kb"])(e,n,t[n],true)}}var gue;const mue=m;let bue=v;const vue=typeof window!=="undefined"?window:undefined;if(bue===undefined&&((gue=vue===null||vue===void 0?void 0:vue["vl"])===null||gue===void 0?void 0:gue.compile)){bue=vue["vl"]}const yue={export:{svg:true,png:true},source:true,compiled:true,editor:true};const xue={CLICK_TO_VIEW_ACTIONS:"Click to view actions",COMPILED_ACTION:"View Compiled Vega",EDITOR_ACTION:"Open in Vega Editor",PNG_ACTION:"Save as PNG",SOURCE_ACTION:"View Source",SVG_ACTION:"Save as SVG"};const _ue={vega:"Vega","vega-lite":"Vega-Lite"};const wue={vega:mue.version,"vega-lite":bue?bue.version:"not available"};const Oue={vega:e=>e,"vega-lite":(e,t)=>bue.compile(e,{config:t}).spec};const jue=`\n\n \n \n \n`;const kue="chart-wrapper";function Eue(e){return typeof e==="function"}function Aue(e,t,n,i){const r=`${t}
`;const o=`
${n}`;const s=window.open("");s.document.write(r+e+o);s.document.title=`${_ue[i]} JSON Source`}function Due(e,t){var n;if(e.$schema){const i=vse(e.$schema);if(t&&t!==i.library){console.warn(`The given visualization spec is written in ${_ue[i.library]}, but mode argument sets ${(n=_ue[t])!==null&&n!==void 0?n:t}.`)}const r=i.library;if(!Object(re["satisfies"])(wue[r],`^${i.version.slice(1)}`)){console.warn(`The input spec uses ${_ue[r]} ${i.version}, but the current version of ${_ue[r]} is v${wue[r]}.`)}return r}if("mark"in e||"encoding"in e||"layer"in e||"hconcat"in e||"vconcat"in e||"facet"in e||"repeat"in e){return"vega-lite"}if("marks"in e||"signals"in e||"scales"in e||"axes"in e){return"vega"}return t!==null&&t!==void 0?t:"vega"}function Sue(e){return!!(e&&"load"in e)}function Mue(e,t,n={}){var i,r,o;return lue(this,void 0,void 0,(function*(){const s=Sue(n.loader)?n.loader:mue.loader(n.loader);const a=Object(oe["I"])(t)?JSON.parse(yield s.load(t)):t;const u=yield Cue((i=a.usermeta&&a.usermeta["embedOptions"])!==null&&i!==void 0?i:{},s);const c=yield Cue(n,s);const l=Object.assign(Object.assign({},hue(c,u)),{config:Object(oe["O"])((r=c.config)!==null&&r!==void 0?r:{},(o=u.config)!==null&&o!==void 0?o:{})});return yield Fue(e,a,l,s)}))}function Cue(e,t){var n;return lue(this,void 0,void 0,(function*(){const i=Object(oe["I"])(e.config)?JSON.parse(yield t.load(e.config)):(n=e.config)!==null&&n!==void 0?n:{};const r=Object(oe["I"])(e.patch)?JSON.parse(yield t.load(e.patch)):e.patch;return Object.assign(Object.assign(Object.assign({},e),r?{patch:r}:{}),i?{config:i}:{})}))}function $ue(e){var t;const n=e.getRootNode?e.getRootNode():document;if(n instanceof ShadowRoot){return{root:n,rootContainer:n}}else{return{root:document,rootContainer:(t=document.head)!==null&&t!==void 0?t:document.body}}}function Fue(e,t,n={},i){var r,o,s,a,u,c;return lue(this,void 0,void 0,(function*(){const l=n.theme?Object(oe["O"])(y[n.theme],(r=n.config)!==null&&r!==void 0?r:{}):n.config;const f=Object(oe["C"])(n.actions)?n.actions:hue({},yue,(o=n.actions)!==null&&o!==void 0?o:{});const d=Object.assign(Object.assign({},xue),n.i18n);const h=(s=n.renderer)!==null&&s!==void 0?s:"canvas";const p=(a=n.logLevel)!==null&&a!==void 0?a:mue.Warn;const g=(u=n.downloadFileName)!==null&&u!==void 0?u:"visualization";const m=typeof e==="string"?document.querySelector(e):e;if(!m){throw new Error(`${e} does not exist`)}if(n.defaultStyle!==false){const e="vega-embed-style";const{root:t,rootContainer:i}=$ue(m);if(!t.getElementById(e)){const t=document.createElement("style");t.id=e;t.innerText=n.defaultStyle===undefined||n.defaultStyle===true?due.toString():n.defaultStyle;i.appendChild(t)}}const b=Due(t,n.mode);let v=Oue[b](t,l);if(b==="vega-lite"){if(v.$schema){const e=vse(v.$schema);if(!Object(re["satisfies"])(wue.vega,`^${e.version.slice(1)}`)){console.warn(`The compiled spec uses Vega ${e.version}, but current version is v${wue.vega}.`)}}}m.classList.add("vega-embed");if(f){m.classList.add("has-actions")}m.innerHTML="";let x=m;if(f){const e=document.createElement("div");e.classList.add(kue);m.appendChild(e);x=e}const _=n.patch;if(_){if(_ instanceof Function){v=_(v)}else{v=P(v,_,true,false).newDocument}}if(n.formatLocale){mue.formatLocale(n.formatLocale)}if(n.timeFormatLocale){mue.timeFormatLocale(n.timeFormatLocale)}const{ast:w}=n;const O=mue.parse(v,b==="vega-lite"?{}:l,{ast:w});const j=new mue.View(O,Object.assign({loader:i,logLevel:p,renderer:h},w?{expr:mue.expressionInterpreter}:{}));if(n.tooltip!==false){let e;if(Eue(n.tooltip)){e=n.tooltip}else{e=new sue(n.tooltip===true?{}:n.tooltip).call}j.tooltip(e)}let{hover:k}=n;if(k===undefined){k=b==="vega"}if(k){const{hoverSet:e,updateSet:t}=typeof k==="boolean"?{}:k;j.hover(e,t)}if(n){if(n.width!=null){j.width(n.width)}if(n.height!=null){j.height(n.height)}if(n.padding!=null){j.padding(n.padding)}}yield j.initialize(x).runAsync();let E;if(f!==false){let e=m;if(n.defaultStyle!==false){const t=document.createElement("details");t.title=d.CLICK_TO_VIEW_ACTIONS;m.append(t);e=t;const n=document.createElement("summary");n.innerHTML=jue;t.append(n);E=e=>{if(!t.contains(e.target)){t.removeAttribute("open")}};document.addEventListener("click",E)}const i=document.createElement("div");e.append(i);i.classList.add("vega-actions");if(f===true||f.export!==false){for(const e of["svg","png"]){if(f===true||f.export===true||f.export[e]){const t=d[`${e.toUpperCase()}_ACTION`];const r=document.createElement("a");r.text=t;r.href="#";r.target="_blank";r.download=`${g}.${e}`;r.addEventListener("mousedown",(function(t){return lue(this,void 0,void 0,(function*(){t.preventDefault();const i=yield j.toImageURL(e,n.scaleFactor);this.href=i}))}));i.append(r)}}}if(f===true||f.source!==false){const e=document.createElement("a");e.text=d.SOURCE_ACTION;e.href="#";e.addEventListener("click",(function(e){var i,r;Aue(ie()(t),(i=n.sourceHeader)!==null&&i!==void 0?i:"",(r=n.sourceFooter)!==null&&r!==void 0?r:"",b);e.preventDefault()}));i.append(e)}if(b==="vega-lite"&&(f===true||f.compiled!==false)){const e=document.createElement("a");e.text=d.COMPILED_ACTION;e.href="#";e.addEventListener("click",(function(e){var t,i;Aue(ie()(v),(t=n.sourceHeader)!==null&&t!==void 0?t:"",(i=n.sourceFooter)!==null&&i!==void 0?i:"","vega");e.preventDefault()}));i.append(e)}if(f===true||f.editor!==false){const e=(c=n.editorUrl)!==null&&c!==void 0?c:"https://vega.github.io/editor/";const r=document.createElement("a");r.text=d.EDITOR_ACTION;r.href="#";r.addEventListener("click",(function(n){fue(window,e,{config:l,mode:b,renderer:h,spec:ie()(t)});n.preventDefault()}));i.append(r)}}function A(){if(E){document.removeEventListener("click",E)}j.finalize()}return{view:j,spec:t,vgSpec:v,finalize:A}}))}var Nue=t["default"]=Mue},htQf:function(e,t,n){const i=n("u/28");const r=n("P86V");const o=n("usTL");const s=(e,t)=>{e=new r(e,t);let n=new i("0.0.0");if(e.test(n)){return n}n=new i("0.0.0-0");if(e.test(n)){return n}n=null;for(let r=0;r{const t=new i(e.semver.version);switch(e.operator){case">":if(t.prerelease.length===0){t.patch++}else{t.prerelease.push(0)}t.raw=t.format();case"":case">=":if(!n||o(n,t)){n=t}break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})}if(n&&e.test(n)){return n}return null};e.exports=s},i9a2:function(e,t,n){const i=n("OMvs");const r=(e,t,n)=>i(e,t,">",n);e.exports=r},iXBk:function(e,t,n){const i=n("ojZj");const r=(e,t)=>{const n=i(e,t);return n&&n.prerelease.length?n.prerelease:null};e.exports=r},jLUY:function(e,t,n){const{MAX_SAFE_COMPONENT_LENGTH:i}=n("sVxN");const r=n("uAKX");t=e.exports={};const o=t.re=[];const s=t.src=[];const a=t.t={};let u=0;const c=(e,t,n)=>{const i=u++;r(i,t);a[e]=i;s[i]=t;o[i]=new RegExp(t,n?"g":undefined)};c("NUMERICIDENTIFIER","0|[1-9]\\d*");c("NUMERICIDENTIFIERLOOSE","[0-9]+");c("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*");c("MAINVERSION",`(${s[a.NUMERICIDENTIFIER]})\\.`+`(${s[a.NUMERICIDENTIFIER]})\\.`+`(${s[a.NUMERICIDENTIFIER]})`);c("MAINVERSIONLOOSE",`(${s[a.NUMERICIDENTIFIERLOOSE]})\\.`+`(${s[a.NUMERICIDENTIFIERLOOSE]})\\.`+`(${s[a.NUMERICIDENTIFIERLOOSE]})`);c("PRERELEASEIDENTIFIER",`(?:${s[a.NUMERICIDENTIFIER]}|${s[a.NONNUMERICIDENTIFIER]})`);c("PRERELEASEIDENTIFIERLOOSE",`(?:${s[a.NUMERICIDENTIFIERLOOSE]}|${s[a.NONNUMERICIDENTIFIER]})`);c("PRERELEASE",`(?:-(${s[a.PRERELEASEIDENTIFIER]}(?:\\.${s[a.PRERELEASEIDENTIFIER]})*))`);c("PRERELEASELOOSE",`(?:-?(${s[a.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${s[a.PRERELEASEIDENTIFIERLOOSE]})*))`);c("BUILDIDENTIFIER","[0-9A-Za-z-]+");c("BUILD",`(?:\\+(${s[a.BUILDIDENTIFIER]}(?:\\.${s[a.BUILDIDENTIFIER]})*))`);c("FULLPLAIN",`v?${s[a.MAINVERSION]}${s[a.PRERELEASE]}?${s[a.BUILD]}?`);c("FULL",`^${s[a.FULLPLAIN]}$`);c("LOOSEPLAIN",`[v=\\s]*${s[a.MAINVERSIONLOOSE]}${s[a.PRERELEASELOOSE]}?${s[a.BUILD]}?`);c("LOOSE",`^${s[a.LOOSEPLAIN]}$`);c("GTLT","((?:<|>)?=?)");c("XRANGEIDENTIFIERLOOSE",`${s[a.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);c("XRANGEIDENTIFIER",`${s[a.NUMERICIDENTIFIER]}|x|X|\\*`);c("XRANGEPLAIN",`[v=\\s]*(${s[a.XRANGEIDENTIFIER]})`+`(?:\\.(${s[a.XRANGEIDENTIFIER]})`+`(?:\\.(${s[a.XRANGEIDENTIFIER]})`+`(?:${s[a.PRERELEASE]})?${s[a.BUILD]}?`+`)?)?`);c("XRANGEPLAINLOOSE",`[v=\\s]*(${s[a.XRANGEIDENTIFIERLOOSE]})`+`(?:\\.(${s[a.XRANGEIDENTIFIERLOOSE]})`+`(?:\\.(${s[a.XRANGEIDENTIFIERLOOSE]})`+`(?:${s[a.PRERELEASELOOSE]})?${s[a.BUILD]}?`+`)?)?`);c("XRANGE",`^${s[a.GTLT]}\\s*${s[a.XRANGEPLAIN]}$`);c("XRANGELOOSE",`^${s[a.GTLT]}\\s*${s[a.XRANGEPLAINLOOSE]}$`);c("COERCE",`${"(^|[^\\d])"+"(\\d{1,"}${i}})`+`(?:\\.(\\d{1,${i}}))?`+`(?:\\.(\\d{1,${i}}))?`+`(?:$|[^\\d])`);c("COERCERTL",s[a.COERCE],true);c("LONETILDE","(?:~>?)");c("TILDETRIM",`(\\s*)${s[a.LONETILDE]}\\s+`,true);t.tildeTrimReplace="$1~";c("TILDE",`^${s[a.LONETILDE]}${s[a.XRANGEPLAIN]}$`);c("TILDELOOSE",`^${s[a.LONETILDE]}${s[a.XRANGEPLAINLOOSE]}$`);c("LONECARET","(?:\\^)");c("CARETTRIM",`(\\s*)${s[a.LONECARET]}\\s+`,true);t.caretTrimReplace="$1^";c("CARET",`^${s[a.LONECARET]}${s[a.XRANGEPLAIN]}$`);c("CARETLOOSE",`^${s[a.LONECARET]}${s[a.XRANGEPLAINLOOSE]}$`);c("COMPARATORLOOSE",`^${s[a.GTLT]}\\s*(${s[a.LOOSEPLAIN]})$|^$`);c("COMPARATOR",`^${s[a.GTLT]}\\s*(${s[a.FULLPLAIN]})$|^$`);c("COMPARATORTRIM",`(\\s*)${s[a.GTLT]}\\s*(${s[a.LOOSEPLAIN]}|${s[a.XRANGEPLAIN]})`,true);t.comparatorTrimReplace="$1$2$3";c("HYPHENRANGE",`^\\s*(${s[a.XRANGEPLAIN]})`+`\\s+-\\s+`+`(${s[a.XRANGEPLAIN]})`+`\\s*$`);c("HYPHENRANGELOOSE",`^\\s*(${s[a.XRANGEPLAINLOOSE]})`+`\\s+-\\s+`+`(${s[a.XRANGEPLAINLOOSE]})`+`\\s*$`);c("STAR","(<|>)?=?\\s*\\*");c("GTE0","^\\s*>=\\s*0.0.0\\s*$");c("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")},m2yQ:function(e,t,n){const i=n("OMvs");const r=(e,t,n)=>i(e,t,"<",n);e.exports=r},mw3f:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return o}));var i=n("J29t");function r(t){return typeof e==="function"&&Object(i["E"])(e.isBuffer)?e.isBuffer(t):false}function o(e,t){const n=t&&t.property?Object(i["u"])(t.property):i["y"];return Object(i["G"])(e)&&!r(e)?s(n(e)):n(JSON.parse(e))}o.responseType="json";function s(e,t){return t&&t.copy?JSON.parse(JSON.stringify(e)):e}}).call(this,n("tjlA").Buffer)},ojZj:function(e,t,n){const{MAX_LENGTH:i}=n("sVxN");const{re:r,t:o}=n("jLUY");const s=n("u/28");const a=(e,t)=>{if(!t||typeof t!=="object"){t={loose:!!t,includePrerelease:false}}if(e instanceof s){return e}if(typeof e!=="string"){return null}if(e.length>i){return null}const n=t.loose?r[o.LOOSE]:r[o.FULL];if(!n.test(e)){return null}try{return new s(e,t)}catch(a){return null}};e.exports=a},oqMh:function(e,t,n){const i=n("MDTW");const r=(e,t,n)=>i(e,t,n)>=0;e.exports=r},qHvB:function(e){e.exports=JSON.parse('{"a":"4.15.0"}')},rO9k:function(e,t,n){const i=n("ojZj");const r=(e,t)=>{const n=i(e,t);return n?n.version:null};e.exports=r},"sAu+":function(e,t,n){const i=n("MDTW");const r=(e,t)=>i(e,t,true);e.exports=r},sVxN:function(e,t){const n="2.0.0";const i=256;const r=Number.MAX_SAFE_INTEGER||9007199254740991;const o=16;e.exports={SEMVER_SPEC_VERSION:n,MAX_LENGTH:i,MAX_SAFE_INTEGER:r,MAX_SAFE_COMPONENT_LENGTH:o}},"u/28":function(e,t,n){const i=n("uAKX");const{MAX_LENGTH:r,MAX_SAFE_INTEGER:o}=n("sVxN");const{re:s,t:a}=n("jLUY");const{compareIdentifiers:u}=n("LN8h");class c{constructor(e,t){if(!t||typeof t!=="object"){t={loose:!!t,includePrerelease:false}}if(e instanceof c){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease){return e}else{e=e.version}}else if(typeof e!=="string"){throw new TypeError(`Invalid Version: ${e}`)}if(e.length>r){throw new TypeError(`version is longer than ${r} characters`)}i("SemVer",e,t);this.options=t;this.loose=!!t.loose;this.includePrerelease=!!t.includePrerelease;const n=e.trim().match(t.loose?s[a.LOOSE]:s[a.FULL]);if(!n){throw new TypeError(`Invalid Version: ${e}`)}this.raw=e;this.major=+n[1];this.minor=+n[2];this.patch=+n[3];if(this.major>o||this.major<0){throw new TypeError("Invalid major version")}if(this.minor>o||this.minor<0){throw new TypeError("Invalid minor version")}if(this.patch>o||this.patch<0){throw new TypeError("Invalid patch version")}if(!n[4]){this.prerelease=[]}else{this.prerelease=n[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t=0){if(typeof this.prerelease[e]==="number"){this.prerelease[e]++;e=-2}}if(e===-1){this.prerelease.push(0)}}if(t){if(this.prerelease[0]===t){if(isNaN(this.prerelease[1])){this.prerelease=[t,0]}}else{this.prerelease=[t,0]}}break;default:throw new Error(`invalid increment argument: ${e}`)}this.format();this.raw=this.version;return this}}e.exports=c},uAKX:function(e,t,n){(function(t){const n=typeof t==="object"&&t.env&&t.env.NODE_DEBUG&&/\bsemver\b/i.test(t.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=n}).call(this,n("8oxB"))},uAX3:function(e,t,n){const i=n("MDTW");const r=(e,t,n)=>i(t,e,n);e.exports=r},usTL:function(e,t,n){const i=n("MDTW");const r=(e,t,n)=>i(e,t,n)>0;e.exports=r},wtW1:function(e,t,n){const i=n("u/28");const r=(e,t)=>new i(e,t).minor;e.exports=r},"xL5+":function(e,t,n){const i=n("Q5Jp");const r=n("8ZXz");const o=n("usTL");const s=n("oqMh");const a=n("OPpX");const u=n("aNM5");const c=(e,t,n,c)=>{switch(t){case"===":if(typeof e==="object")e=e.version;if(typeof n==="object")n=n.version;return e===n;case"!==":if(typeof e==="object")e=e.version;if(typeof n==="object")n=n.version;return e!==n;case"":case"=":case"==":return i(e,n,c);case"!=":return r(e,n,c);case">":return o(e,n,c);case">=":return s(e,n,c);case"<":return a(e,n,c);case"<=":return u(e,n,c);default:throw new TypeError(`Invalid operator: ${t}`)}};e.exports=c},xiiv:function(e,t,n){const i=n("P86V");const{ANY:r}=n("bUMA");const o=n("KoYs");const s=n("MDTW");const a=(e,t,n)=>{e=new i(e,n);t=new i(t,n);let r=false;e:for(const i of e.set){for(const e of t.set){const t=u(i,e,n);r=r||t!==null;if(t)continue e}if(r)return false}return true};const u=(e,t,n)=>{if(e.length===1&&e[0].semver===r)return t.length===1&&t[0].semver===r;const i=new Set;let a,u;for(const r of e){if(r.operator===">"||r.operator===">=")a=c(a,r,n);else if(r.operator==="<"||r.operator==="<=")u=l(u,r,n);else i.add(r.semver)}if(i.size>1)return null;let f;if(a&&u){f=s(a.semver,u.semver,n);if(f>0)return null;else if(f===0&&(a.operator!==">="||u.operator!=="<="))return null}for(const r of i){if(a&&!o(r,String(a),n))return null;if(u&&!o(r,String(u),n))return null;for(const e of t){if(!o(r,String(e),n))return false}return true}let d,h;let p,g;for(const r of t){g=g||r.operator===">"||r.operator===">=";p=p||r.operator==="<"||r.operator==="<=";if(a){if(r.operator===">"||r.operator===">="){d=c(a,r,n);if(d===r)return false}else if(a.operator===">="&&!o(a.semver,String(r),n))return false}if(u){if(r.operator==="<"||r.operator==="<="){h=l(u,r,n);if(h===r)return false}else if(u.operator==="<="&&!o(u.semver,String(r),n))return false}if(!r.operator&&(u||a)&&f!==0)return false}if(a&&p&&!u&&f!==0)return false;if(u&&g&&!a&&f!==0)return false;return true};const c=(e,t,n)=>{if(!e)return t;const i=s(e.semver,t.semver,n);return i>0?e:i<0?t:t.operator===">"&&e.operator===">="?t:e};const l=(e,t,n)=>{if(!e)return t;const i=s(e.semver,t.semver,n);return i<0?e:i>0?t:t.operator==="<"&&e.operator==="<="?t:e};e.exports=a}}]);