-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathhistogram.js
50 lines (46 loc) · 908 KB
/
histogram.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.histogram=e():t.histogram=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=99)}([function(t,e,n){"use strict";function r(t,e,n){return t.fields=e||[],t.fname=n,t}function i(t){return null==t?null:t.fname}function o(t){return null==t?null:t.fields}function a(t){return 1===t.length?s(t[0]):u(t)}n.d(e,"a",(function(){return w})),n.d(e,"b",(function(){return x})),n.d(e,"c",(function(){return O})),n.d(e,"d",(function(){return v})),n.d(e,"e",(function(){return _})),n.d(e,"f",(function(){return r})),n.d(e,"g",(function(){return o})),n.d(e,"h",(function(){return i})),n.d(e,"i",(function(){return J})),n.d(e,"j",(function(){return tt})),n.d(e,"k",(function(){return K})),n.d(e,"l",(function(){return Q})),n.d(e,"m",(function(){return it})),n.d(e,"n",(function(){return ot})),n.d(e,"o",(function(){return l})),n.d(e,"p",(function(){return at})),n.d(e,"q",(function(){return st})),n.d(e,"r",(function(){return ut})),n.d(e,"s",(function(){return b})),n.d(e,"t",(function(){return dt})),n.d(e,"u",(function(){return f})),n.d(e,"v",(function(){return ht})),n.d(e,"w",(function(){return ct})),n.d(e,"x",(function(){return d})),n.d(e,"y",(function(){return h})),n.d(e,"z",(function(){return pt})),n.d(e,"A",(function(){return gt})),n.d(e,"B",(function(){return k})),n.d(e,"C",(function(){return mt})),n.d(e,"D",(function(){return bt})),n.d(e,"E",(function(){return Z})),n.d(e,"F",(function(){return yt})),n.d(e,"G",(function(){return E})),n.d(e,"H",(function(){return vt})),n.d(e,"I",(function(){return xt})),n.d(e,"J",(function(){return _t})),n.d(e,"K",(function(){return Ot})),n.d(e,"L",(function(){return j})),n.d(e,"M",(function(){return wt})),n.d(e,"N",(function(){return jt})),n.d(e,"O",(function(){return D})),n.d(e,"P",(function(){return g})),n.d(e,"Q",(function(){return Et})),n.d(e,"R",(function(){return B})),n.d(e,"S",(function(){return L})),n.d(e,"T",(function(){return I})),n.d(e,"U",(function(){return U})),n.d(e,"V",(function(){return C})),n.d(e,"W",(function(){return V})),n.d(e,"X",(function(){return kt})),n.d(e,"Y",(function(){return At})),n.d(e,"Z",(function(){return c})),n.d(e,"ab",(function(){return Dt})),n.d(e,"bb",(function(){return Mt})),n.d(e,"cb",(function(){return Ct})),n.d(e,"db",(function(){return F})),n.d(e,"eb",(function(){return zt})),n.d(e,"fb",(function(){return Ft})),n.d(e,"gb",(function(){return Tt})),n.d(e,"hb",(function(){return m})),n.d(e,"ib",(function(){return X})),n.d(e,"jb",(function(){return $t})),n.d(e,"kb",(function(){return M})),n.d(e,"lb",(function(){return p})),n.d(e,"mb",(function(){return W})),n.d(e,"nb",(function(){return Y})),n.d(e,"ob",(function(){return H})),n.d(e,"pb",(function(){return G}));const s=t=>function(e){return e[t]},u=t=>{const e=t.length;return function(n){for(let r=0;r<e;++r)n=n[t[r]];return n}};function l(t){throw Error(t)}function c(t){const e=[],n=t.length;let r,i,o,a=null,s=0,u="";function c(){e.push(u+t.substring(r,i)),u="",r=i+1}for(t+="",r=i=0;i<n;++i)if(o=t[i],"\\"===o)u+=t.substring(r,i),u+=t.substring(++i,++i),r=i;else if(o===a)c(),a=null,s=-1;else{if(a)continue;r===s&&'"'===o||r===s&&"'"===o?(r=i+1,a=o):"."!==o||s?"["===o?(i>r&&c(),s=r=i+1):"]"===o&&(s||l("Access path missing open bracket: "+t),s>0&&c(),s=0,r=i+1):i>r?c():r=i+1}return s&&l("Access path missing closing bracket: "+t),a&&l("Access path missing closing quote: "+t),i>r&&(i++,c()),e}function f(t,e,n){const i=c(t);return t=1===i.length?i[0]:t,r((n&&n.get||a)(i),[t],e||t)}const d=f("id"),h=r(t=>t,[],"identity"),p=r(()=>0,[],"zero"),g=r(()=>1,[],"one"),m=r(()=>!0,[],"true"),b=r(()=>!1,[],"false");function y(t,e,n){const r=[e].concat([].slice.call(n));console[t].apply(console,r)}const v=0,x=1,_=2,O=3,w=4;function j(t,e){let n=t||v;return{level(t){return arguments.length?(n=+t,this):n},error(){return n>=x&&y(e||"error","ERROR",arguments),this},warn(){return n>=_&&y(e||"warn","WARN",arguments),this},info(){return n>=O&&y(e||"log","INFO",arguments),this},debug(){return n>=w&&y(e||"log","DEBUG",arguments),this}}}var k=Array.isArray;function E(t){return t===Object(t)}const A=t=>"__proto__"!==t;function D(...t){return t.reduce((t,e)=>{for(const n in e)if("signals"===n)t.signals=S(t.signals,e.signals);else{const r="legend"===n?{layout:1}:"style"===n||null;M(t,n,e[n],r)}return t},{})}function M(t,e,n,r){if(!A(e))return;let i,o;if(E(n)&&!k(n))for(i in o=E(t[e])?t[e]:t[e]={},n)r&&(!0===r||r[i])?M(o,i,n[i]):A(i)&&(o[i]=n[i]);else t[e]=n}function S(t,e){if(null==t)return e;const n={},r=[];function i(t){n[t.name]||(n[t.name]=1,r.push(t))}return e.forEach(i),t.forEach(i),r}function C(t){return t[t.length-1]}function F(t){return null==t||""===t?null:+t}const z=t=>e=>t*Math.exp(e),T=t=>e=>Math.log(t*e),$=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),N=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t,R=t=>e=>e<0?-Math.pow(-e,t):Math.pow(e,t);function P(t,e,n,r){const i=n(t[0]),o=n(C(t)),a=(o-i)*e;return[r(i-a),r(o-a)]}function B(t,e){return P(t,e,F,h)}function L(t,e){var n=Math.sign(t[0]);return P(t,e,T(n),z(n))}function I(t,e,n){return P(t,e,R(n),R(1/n))}function U(t,e,n){return P(t,e,$(n),N(n))}function q(t,e,n,r,i){const o=r(t[0]),a=r(C(t)),s=null!=e?r(e):(o+a)/2;return[i(s+(o-s)*n),i(s+(a-s)*n)]}function W(t,e,n){return q(t,e,n,F,h)}function Y(t,e,n){const r=Math.sign(t[0]);return q(t,e,n,T(r),z(r))}function H(t,e,n,r){return q(t,e,n,R(r),R(1/r))}function G(t,e,n,r){return q(t,e,n,$(r),N(r))}function V(t){return 1+~~(new Date(t).getMonth()/3)}function X(t){return 1+~~(new Date(t).getUTCMonth()/3)}function J(t){return null!=t?k(t)?t:[t]:[]}function K(t,e,n){let r,i=t[0],o=t[1];return o<i&&(r=o,o=i,i=r),r=o-i,r>=n-e?[e,n]:[i=Math.min(Math.max(i,e),n-r),i+r]}function Z(t){return"function"==typeof t}function Q(t,e,n){n=n||{},e=J(e)||[];const i=[],a=[],s={},u=n.comparator||et;return J(t).forEach((t,r)=>{null!=t&&(i.push("descending"===e[r]?-1:1),a.push(t=Z(t)?t:f(t,null,n)),(o(t)||[]).forEach(t=>s[t]=1))}),0===a.length?null:r(u(a,i),Object.keys(s))}const tt=(t,e)=>(t<e||null==t)&&null!=e?-1:(t>e||null==e)&&null!=t?1:(e=e instanceof Date?+e:e,(t=t instanceof Date?+t:t)!==t&&e==e?-1:e!=e&&t==t?1:0),et=(t,e)=>1===t.length?nt(t[0],e[0]):rt(t,e,t.length),nt=(t,e)=>function(n,r){return tt(t(n),t(r))*e},rt=(t,e,n)=>(e.push(0),function(r,i){let o,a=0,s=-1;for(;0===a&&++s<n;)o=t[s],a=tt(o(r),o(i));return a*e[s]});function it(t){return Z(t)?t:()=>t}function ot(t,e){let n;return r=>{n&&clearTimeout(n),n=setTimeout(()=>(e(r),n=null),t)}}function at(t){for(let e,n,r=1,i=arguments.length;r<i;++r)for(n in e=arguments[r],e)t[n]=e[n];return t}function st(t,e){let n,r,i,o,a=0;if(t&&(n=t.length))if(null==e){for(r=t[a];a<n&&(null==r||r!=r);r=t[++a]);for(i=o=r;a<n;++a)r=t[a],null!=r&&(r<i&&(i=r),r>o&&(o=r))}else{for(r=e(t[a]);a<n&&(null==r||r!=r);r=e(t[++a]));for(i=o=r;a<n;++a)r=e(t[a]),null!=r&&(r<i&&(i=r),r>o&&(o=r))}return[i,o]}function ut(t,e){const n=t.length;let r,i,o,a,s,u=-1;if(null==e){for(;++u<n;)if(i=t[u],null!=i&&i>=i){r=o=i;break}if(u===n)return[-1,-1];for(a=s=u;++u<n;)i=t[u],null!=i&&(r>i&&(r=i,a=u),o<i&&(o=i,s=u))}else{for(;++u<n;)if(i=e(t[u],u,t),null!=i&&i>=i){r=o=i;break}if(u===n)return[-1,-1];for(a=s=u;++u<n;)i=e(t[u],u,t),null!=i&&(r>i&&(r=i,a=u),o<i&&(o=i,s=u))}return[a,s]}const lt=Object.prototype.hasOwnProperty;function ct(t,e){return lt.call(t,e)}const ft={};function dt(t){let e,n={};function r(t){return ct(n,t)&&n[t]!==ft}const i={size:0,empty:0,object:n,has:r,get:t=>r(t)?n[t]:void 0,set(t,e){return r(t)||(++i.size,n[t]===ft&&--i.empty),n[t]=e,this},delete(t){return r(t)&&(--i.size,++i.empty,n[t]=ft),this},clear(){i.size=i.empty=0,i.object=n={}},test(t){return arguments.length?(e=t,i):e},clean(){const t={};let r=0;for(const i in n){const o=n[i];o===ft||e&&e(o)||(t[i]=o,++r)}i.size=r,i.empty=0,i.object=n=t}};return t&&Object.keys(t).forEach(e=>{i.set(e,t[e])}),i}function ht(t,e,n,r,i,o){if(!n&&0!==n)return o;const a=+n;let s,u=t[0],l=C(t);l<u&&(s=u,u=l,l=s),s=Math.abs(e-u);const c=Math.abs(l-e);return s<c&&s<=a?r:c<=a?i:o}function pt(t,e,n){const r=t.prototype=Object.create(e.prototype);return r.constructor=t,at(r,n)}function gt(t,e,n,r){let i,o=e[0],a=e[e.length-1];return o>a&&(i=o,o=a,a=i),r=void 0===r||r,((n=void 0===n||n)?o<=t:o<t)&&(r?t<=a:t<a)}function mt(t){return"boolean"==typeof t}function bt(t){return"[object Date]"===Object.prototype.toString.call(t)}function yt(t){return"number"==typeof t}function vt(t){return"[object RegExp]"===Object.prototype.toString.call(t)}function xt(t){return"string"==typeof t}function _t(t,e,n){t&&(t=e?J(t).map(t=>t.replace(/\\(.)/g,"$1")):J(t));const i=t&&t.length,o=n&&n.get||a,s=t=>o(e?[t]:c(t));let u;if(i)if(1===i){const e=s(t[0]);u=function(t){return""+e(t)}}else{const e=t.map(s);u=function(t){let n=""+e[0](t),r=0;for(;++r<i;)n+="|"+e[r](t);return n}}else u=function(){return""};return r(u,t,"key")}function Ot(t,e){const n=t[0],r=C(t),i=+e;return i?1===i?r:n+i*(r-n):n}function wt(t){let e,n,r;t=+t||1e4;const i=()=>{e={},n={},r=0},o=(i,o)=>(++r>t&&(n=e,e={},r=1),e[i]=o);return i(),{clear:i,has:t=>ct(e,t)||ct(n,t),get:t=>ct(e,t)?e[t]:ct(n,t)?o(t,n[t]):void 0,set:(t,n)=>ct(e,t)?e[t]=n:o(t,n)}}function jt(t,e,n,r){const i=e.length,o=n.length;if(!o)return e;if(!i)return n;const a=r||new e.constructor(i+o);let s=0,u=0,l=0;for(;s<i&&u<o;++l)a[l]=t(e[s],n[u])>0?n[u++]:e[s++];for(;s<i;++s,++l)a[l]=e[s];for(;u<o;++u,++l)a[l]=n[u];return a}function kt(t,e){let n="";for(;--e>=0;)n+=t;return n}function Et(t,e,n,r){const i=n||" ",o=t+"",a=e-o.length;return a<=0?o:"left"===r?kt(i,a)+o:"center"===r?kt(i,~~(a/2))+o+kt(i,Math.ceil(a/2)):o+kt(i,a)}function At(t){return t&&C(t)-t[0]||0}function Dt(t){return k(t)?"["+t.map(Dt)+"]":E(t)||xt(t)?JSON.stringify(t).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):t}function Mt(t){return null==t||""===t?null:!(!t||"false"===t||"0"===t)&&!!t}const St=t=>yt(t)||bt(t)?t:Date.parse(t);function Ct(t,e){return e=e||St,null==t||""===t?null:e(t)}function Ft(t){return null==t||""===t?null:t+""}function zt(t){const e={},n=t.length;for(let r=0;r<n;++r)e[t[r]]=!0;return e}function Tt(t,e,n,r){const i=null!=r?r:"…",o=t+"",a=o.length,s=Math.max(0,e-i.length);return a<=e?o:"left"===n?i+o.slice(a-s):"center"===n?o.slice(0,Math.ceil(s/2))+i+o.slice(a-~~(s/2)):o.slice(0,s)+i}function $t(t,e,n){if(t)if(e){const r=t.length;for(let i=0;i<r;++i){const r=e(t[i]);r&&n(r,i,t)}}else t.forEach(n)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return j})),n.d(e,"b",(function(){return k})),n.d(e,"c",(function(){return E})),n.d(e,"d",(function(){return A})),n.d(e,"e",(function(){return S})),n.d(e,"f",(function(){return D})),n.d(e,"g",(function(){return O})),n.d(e,"h",(function(){return _})),n.d(e,"i",(function(){return M})),n.d(e,"j",(function(){return C})),n.d(e,"k",(function(){return w})),n.d(e,"l",(function(){return x})),n.d(e,"m",(function(){return P})),n.d(e,"n",(function(){return Ot})),n.d(e,"o",(function(){return tt})),n.d(e,"p",(function(){return at})),n.d(e,"q",(function(){return lt})),n.d(e,"r",(function(){return dt})),n.d(e,"s",(function(){return $})),n.d(e,"t",(function(){return z})),n.d(e,"u",(function(){return rt})),n.d(e,"v",(function(){return st})),n.d(e,"w",(function(){return ct})),n.d(e,"x",(function(){return ht})),n.d(e,"y",(function(){return W})),n.d(e,"z",(function(){return Y})),n.d(e,"A",(function(){return B}));var r=n(0),i=n(23),o=n(13),a=n(24),s=n(14),u=n(25),l=n(60),c=n(100),f=n(101),d=n(61),h=n(62),p=n(26),g=n(63),m=n(102),b=n(103),y=n(35),v=n(51);const x="year",_="quarter",O="month",w="week",j="date",k="day",E="dayofyear",A="hours",D="minutes",M="seconds",S="milliseconds",C=[x,_,O,w,j,k,E,A,D,M,S],F=C.reduce((t,e,n)=>(t[e]=1+n,t),{});function z(t){const e=Object(r.i)(t).slice(),n={};e.length||Object(r.o)("Missing time unit."),e.forEach(t=>{Object(r.w)(F,t)?n[t]=1:Object(r.o)("Invalid time unit: ".concat(t,"."))});return(n[w]||n[k]?1:0)+(n[_]||n[O]||n[j]?1:0)+(n[E]?1:0)>1&&Object(r.o)("Incompatible time units: ".concat(t)),e.sort((t,e)=>F[t]-F[e]),e}const T={[x]:"%Y ",[_]:"Q%q ",[O]:"%b ",[j]:"%d ",[w]:"W%U ",[k]:"%a ",[E]:"%j ",[A]:"%H:00",[D]:"00:%M",[M]:":%S",[S]:".%L",["".concat(x,"-").concat(O)]:"%Y-%m ",["".concat(x,"-").concat(O,"-").concat(j)]:"%Y-%m-%d ",["".concat(A,"-").concat(D)]:"%H:%M"};function $(t,e){const n=Object(r.p)({},T,e),i=z(t),o=i.length;let a,s,u="",l=0;for(l=0;l<o;)for(a=i.length;a>l;--a)if(s=i.slice(l,a).join("-"),null!=n[s]){u+=n[s],l=a;break}return u.trim()}const N=new Date;function R(t){return N.setFullYear(t),N.setMonth(0),N.setDate(1),N.setHours(0,0,0,0),N}function P(t){return L(new Date(t))}function B(t){return I(new Date(t))}function L(t){return i.a.count(R(t.getFullYear())-1,t)}function I(t){return o.b.count(R(t.getFullYear())-1,t)}function U(t){return R(t).getDay()}function q(t,e,n,r,i,o,a){if(0<=t&&t<100){const s=new Date(-1,e,n,r,i,o,a);return s.setFullYear(t),s}return new Date(t,e,n,r,i,o,a)}function W(t){return H(new Date(t))}function Y(t){return G(new Date(t))}function H(t){const e=Date.UTC(t.getUTCFullYear(),0,1);return a.a.count(e-1,t)}function G(t){const e=Date.UTC(t.getUTCFullYear(),0,1);return s.b.count(e-1,t)}function V(t){return N.setTime(Date.UTC(t,0,1)),N.getUTCDay()}function X(t,e,n,r,i,o,a){if(0<=t&&t<100){const t=new Date(Date.UTC(-1,e,n,r,i,o,a));return t.setUTCFullYear(n.y),t}return new Date(Date.UTC(t,e,n,r,i,o,a))}function J(t,e,n,i,o){const a=e||1,s=Object(r.V)(t),u=(t,e,r)=>function(t,e,n,r){const i=n<=1?t:r?(e,i)=>r+n*Math.floor((t(e,i)-r)/n):(e,r)=>n*Math.floor(t(e,r)/n);return e?(t,n)=>e(i(t,n),n):i}(n[r=r||t],i[r],t===s&&a,e),l=new Date,c=Object(r.eb)(t),f=c[x]?u(x):Object(r.m)(2012),d=c[O]?u(O):c[_]?u(_):r.lb,h=c[w]&&c[k]?u(k,1,w+k):c[w]?u(w,1):c[k]?u(k,1):c[j]?u(j,1):c[E]?u(E,1):r.P,p=c[A]?u(A):r.lb,g=c[D]?u(D):r.lb,m=c[M]?u(M):r.lb,b=c[S]?u(S):r.lb;return function(t){l.setTime(+t);const e=f(l);return o(e,d(l),h(l,e),p(l),g(l),m(l),b(l))}}function K(t,e,n){return e+7*t-(n+6)%7}const Z={[x]:t=>t.getFullYear(),[_]:t=>Math.floor(t.getMonth()/3),[O]:t=>t.getMonth(),[j]:t=>t.getDate(),[A]:t=>t.getHours(),[D]:t=>t.getMinutes(),[M]:t=>t.getSeconds(),[S]:t=>t.getMilliseconds(),[E]:t=>L(t),[w]:t=>I(t),[w+k]:(t,e)=>K(I(t),t.getDay(),U(e)),[k]:(t,e)=>K(1,t.getDay(),U(e))},Q={[_]:t=>3*t,[w]:(t,e)=>K(t,0,U(e))};function tt(t,e){return J(t,e||1,Z,Q,q)}const et={[x]:t=>t.getUTCFullYear(),[_]:t=>Math.floor(t.getUTCMonth()/3),[O]:t=>t.getUTCMonth(),[j]:t=>t.getUTCDate(),[A]:t=>t.getUTCHours(),[D]:t=>t.getUTCMinutes(),[M]:t=>t.getUTCSeconds(),[S]:t=>t.getUTCMilliseconds(),[E]:t=>H(t),[w]:t=>G(t),[k]:(t,e)=>K(1,t.getUTCDay(),V(e)),[w+k]:(t,e)=>K(G(t),t.getUTCDay(),V(e))},nt={[_]:t=>3*t,[w]:(t,e)=>K(t,0,V(e))};function rt(t,e){return J(t,e||1,et,nt,X)}const it={[x]:u.a,[_]:l.a.every(3),[O]:l.a,[w]:o.b,[j]:i.a,[k]:i.a,[E]:i.a,[A]:c.a,[D]:f.a,[M]:d.a,[S]:h.a},ot={[x]:p.a,[_]:g.a.every(3),[O]:g.a,[w]:s.b,[j]:a.a,[k]:a.a,[E]:a.a,[A]:m.a,[D]:b.a,[M]:d.a,[S]:h.a};function at(t){return it[t]}function st(t){return ot[t]}function ut(t,e,n){return t?t.offset(e,n):void 0}function lt(t,e,n){return ut(at(t),e,n)}function ct(t,e,n){return ut(st(t),e,n)}function ft(t,e,n,r){return t?t.range(e,n,r):void 0}function dt(t,e,n,r){return ft(at(t),e,n,r)}function ht(t,e,n,r){return ft(st(t),e,n,r)}const pt=[x,O,j,A,D,M,S],gt=pt.slice(0,-1),mt=gt.slice(0,-1),bt=mt.slice(0,-1),yt=bt.slice(0,-1),vt=[x,O],xt=[x],_t=[[gt,1,1e3],[gt,5,5e3],[gt,15,15e3],[gt,30,3e4],[mt,1,6e4],[mt,5,3e5],[mt,15,9e5],[mt,30,18e5],[bt,1,36e5],[bt,3,108e5],[bt,6,216e5],[bt,12,432e5],[yt,1,864e5],[[x,w],1,6048e5],[vt,1,2592e6],[vt,3,7776e6],[xt,1,31536e6]];function Ot(t){const e=t.extent,n=t.maxbins||40,i=Math.abs(Object(r.Y)(e))/n;let o,a,s=Object(y.a)(t=>t[2]).right(_t,i);return s===_t.length?(o=xt,a=Object(v.c)(e[0]/31536e6,e[1]/31536e6,n)):s?(s=_t[i/_t[s-1][2]<_t[s][2]/i?s-1:s],o=s[0],a=s[1]):(o=pt,a=Math.max(Object(v.c)(e[0],e[1],n),1)),{units:o,step:a}}},function(t,e,n){"use strict";function r(){}n.d(e,"a",(function(){return pt})),n.d(e,"b",(function(){return gt}));var i=function(t){return null==t?r:function(){return this.querySelector(t)}},o=function(t){return"object"==typeof t&&"length"in t?t:Array.from(t)};function a(){return[]}function s(t){return function(e){return e.matches(t)}}var u=Array.prototype.find;function l(){return this.firstElementChild}var c=Array.prototype.filter;function f(){return this.children}var d=function(t){return new Array(t.length)};function h(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}h.prototype={constructor:h,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var p=function(t){return function(){return t}};function g(t,e,n,r,i,o){for(var a,s=0,u=e.length,l=o.length;s<l;++s)(a=e[s])?(a.__data__=o[s],r[s]=a):n[s]=new h(t,o[s]);for(;s<u;++s)(a=e[s])&&(i[s]=a)}function m(t,e,n,r,i,o,a){var s,u,l,c=new Map,f=e.length,d=o.length,p=new Array(f);for(s=0;s<f;++s)(u=e[s])&&(p[s]=l=a.call(u,u.__data__,s,e)+"",c.has(l)?i[s]=u:c.set(l,u));for(s=0;s<d;++s)l=a.call(t,o[s],s,o)+"",(u=c.get(l))?(r[s]=u,u.__data__=o[s],c.delete(l)):n[s]=new h(t,o[s]);for(s=0;s<f;++s)(u=e[s])&&c.get(p[s])===u&&(i[s]=u)}function b(t){return t.__data__}function y(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}var v="http://www.w3.org/1999/xhtml",x={svg:"http://www.w3.org/2000/svg",xhtml:v,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},_=function(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),x.hasOwnProperty(e)?{space:x[e],local:t}:t};function O(t){return function(){this.removeAttribute(t)}}function w(t){return function(){this.removeAttributeNS(t.space,t.local)}}function j(t,e){return function(){this.setAttribute(t,e)}}function k(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function E(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function A(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}var D=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function M(t){return function(){this.style.removeProperty(t)}}function S(t,e,n){return function(){this.style.setProperty(t,e,n)}}function C(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function F(t,e){return t.style.getPropertyValue(e)||D(t).getComputedStyle(t,null).getPropertyValue(e)}function z(t){return function(){delete this[t]}}function T(t,e){return function(){this[t]=e}}function $(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function N(t){return t.trim().split(/^|\s+/)}function R(t){return t.classList||new P(t)}function P(t){this._node=t,this._names=N(t.getAttribute("class")||"")}function B(t,e){for(var n=R(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function L(t,e){for(var n=R(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function I(t){return function(){B(this,t)}}function U(t){return function(){L(this,t)}}function q(t,e){return function(){(e.apply(this,arguments)?B:L)(this,t)}}P.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function W(){this.textContent=""}function Y(t){return function(){this.textContent=t}}function H(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function G(){this.innerHTML=""}function V(t){return function(){this.innerHTML=t}}function X(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function J(){this.nextSibling&&this.parentNode.appendChild(this)}function K(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Z(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===v&&e.documentElement.namespaceURI===v?e.createElement(t):e.createElementNS(n,t)}}function Q(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}var tt=function(t){var e=_(t);return(e.local?Q:Z)(e)};function et(){return null}function nt(){var t=this.parentNode;t&&t.removeChild(this)}function rt(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function it(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function ot(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}function at(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,o=e.length;r<o;++r)n=e[r],t.type&&n.type!==t.type||n.name!==t.name?e[++i]=n:this.removeEventListener(n.type,n.listener,n.options);++i?e.length=i:delete this.__on}}}function st(t,e,n){return function(){var r,i=this.__on,o=function(t){return function(e){t.call(this,e,this.__data__)}}(e);if(i)for(var a=0,s=i.length;a<s;++a)if((r=i[a]).type===t.type&&r.name===t.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=o,r.options=n),void(r.value=e);this.addEventListener(t.type,o,n),r={type:t.type,name:t.name,value:e,listener:o,options:n},i?i.push(r):this.__on=[r]}}function ut(t,e,n){var r=D(t),i=r.CustomEvent;"function"==typeof i?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function lt(t,e){return function(){return ut(this,t,e)}}function ct(t,e){return function(){return ut(this,t,e.apply(this,arguments))}}var ft=[null];function dt(t,e){this._groups=t,this._parents=e}function ht(){return new dt([[document.documentElement]],ft)}dt.prototype=ht.prototype={constructor:dt,select:function(t){"function"!=typeof t&&(t=i(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var a,s,u=e[o],l=u.length,c=r[o]=new Array(l),f=0;f<l;++f)(a=u[f])&&(s=t.call(a,a.__data__,f,u))&&("__data__"in a&&(s.__data__=a.__data__),c[f]=s);return new dt(r,this._parents)},selectAll:function(t){var e;"function"==typeof t?t=function(t){return function(){var e=t.apply(this,arguments);return null==e?[]:o(e)}}(t):t=null==(e=t)?a:function(){return this.querySelectorAll(e)};for(var n=this._groups,r=n.length,i=[],s=[],u=0;u<r;++u)for(var l,c=n[u],f=c.length,d=0;d<f;++d)(l=c[d])&&(i.push(t.call(l,l.__data__,d,c)),s.push(l));return new dt(i,s)},selectChild:function(t){return this.select(null==t?l:function(t){return function(){return u.call(this.children,t)}}("function"==typeof t?t:s(t)))},selectChildren:function(t){return this.selectAll(null==t?f:function(t){return function(){return c.call(this.children,t)}}("function"==typeof t?t:s(t)))},filter:function(t){var e;"function"!=typeof t&&(e=t,t=function(){return this.matches(e)});for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o)for(var a,s=n[o],u=s.length,l=i[o]=[],c=0;c<u;++c)(a=s[c])&&t.call(a,a.__data__,c,s)&&l.push(a);return new dt(i,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,b);var n=e?m:g,r=this._parents,i=this._groups;"function"!=typeof t&&(t=p(t));for(var a=i.length,s=new Array(a),u=new Array(a),l=new Array(a),c=0;c<a;++c){var f=r[c],d=i[c],h=d.length,y=o(t.call(f,f&&f.__data__,c,r)),v=y.length,x=u[c]=new Array(v),_=s[c]=new Array(v),O=l[c]=new Array(h);n(f,d,x,_,O,y,e);for(var w,j,k=0,E=0;k<v;++k)if(w=x[k]){for(k>=E&&(E=k+1);!(j=_[E])&&++E<v;);w._next=j||null}}return(s=new dt(s,r))._enter=u,s._exit=l,s},enter:function(){return new dt(this._enter||this._groups.map(d),this._parents)},exit:function(){return new dt(this._exit||this._groups.map(d),this._parents)},join:function(t,e,n){var r=this.enter(),i=this,o=this.exit();return r="function"==typeof t?t(r):r.append(t+""),null!=e&&(i=e(i)),null==n?o.remove():n(o),r&&i?r.merge(i).order():i},merge:function(t){if(!(t instanceof dt))throw new Error("invalid merge");for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),a=new Array(r),s=0;s<o;++s)for(var u,l=e[s],c=n[s],f=l.length,d=a[s]=new Array(f),h=0;h<f;++h)(u=l[h]||c[h])&&(d[h]=u);for(;s<r;++s)a[s]=e[s];return new dt(a,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r,i=t[e],o=i.length-1,a=i[o];--o>=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=y);for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var a,s=n[o],u=s.length,l=i[o]=new Array(u),c=0;c<u;++c)(a=s[c])&&(l[c]=a);l.sort(e)}return new dt(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null},size:function(){let t=0;for(const e of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i,o=e[n],a=0,s=o.length;a<s;++a)(i=o[a])&&t.call(i,i.__data__,a,o);return this},attr:function(t,e){var n=_(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==e?n.local?w:O:"function"==typeof e?n.local?A:E:n.local?k:j)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?M:"function"==typeof e?C:S)(t,e,null==n?"":n)):F(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?z:"function"==typeof e?$:T)(t,e)):this.node()[t]},classed:function(t,e){var n=N(t+"");if(arguments.length<2){for(var r=R(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each(("function"==typeof e?q:e?I:U)(n,e))},text:function(t){return arguments.length?this.each(null==t?W:("function"==typeof t?H:Y)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?G:("function"==typeof t?X:V)(t)):this.node().innerHTML},raise:function(){return this.each(J)},lower:function(){return this.each(K)},append:function(t){var e="function"==typeof t?t:tt(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var n="function"==typeof t?t:tt(t),r=null==e?et:"function"==typeof e?e:i(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(nt)},clone:function(t){return this.select(t?it:rt)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var r,i,o=ot(t+""),a=o.length;if(!(arguments.length<2)){for(s=e?st:at,r=0;r<a;++r)this.each(s(o[r],e,n));return this}var s=this.node().__on;if(s)for(var u,l=0,c=s.length;l<c;++l)for(r=0,u=s[l];r<a;++r)if((i=o[r]).type===u.type&&i.name===u.name)return u.value},dispatch:function(t,e){return this.each(("function"==typeof e?ct:lt)(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r,i=t[e],o=0,a=i.length;o<a;++o)(r=i[o])&&(yield r)}};var pt=function(t){return"string"==typeof t?new dt([[document.querySelector(t)]],[document.documentElement]):new dt([[t]],ft)},gt=function(t){return"string"==typeof t?new dt([document.querySelectorAll(t)],[document.documentElement]):new dt([null==t?[]:o(t)],ft)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=new Date,i=new Date;function o(t,e,n,a){function s(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return s.floor=function(e){return t(e=new Date(+e)),e},s.ceil=function(n){return t(n=new Date(n-1)),e(n,1),t(n),n},s.round=function(t){var e=s(t),n=s.ceil(t);return t-e<n-t?e:n},s.offset=function(t,n){return e(t=new Date(+t),null==n?1:Math.floor(n)),t},s.range=function(n,r,i){var o,a=[];if(n=s.ceil(n),i=null==i?1:Math.floor(i),!(n<r&&i>0))return a;do{a.push(o=new Date(+n)),e(n,i),t(n)}while(o<n&&n<r);return a},s.filter=function(n){return o((function(e){if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););}))},n&&(s.count=function(e,o){return r.setTime(+e),i.setTime(+o),t(r),t(i),Math.floor(n(r,i))},s.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?s.filter(a?function(e){return a(e)%t==0}:function(e){return s.count(0,e)%t==0}):s:null}),s}},function(t,e,n){"use strict";n.d(e,"d",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return a})),n.d(e,"e",(function(){return s}));var r=1e3,i=6e4,o=36e5,a=864e5,s=6048e5},,function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return FONT_TYPE})),__webpack_require__.d(__webpack_exports__,"c",(function(){return positionLegend})),__webpack_require__.d(__webpack_exports__,"b",(function(){return fixChartSizing})),__webpack_require__.d(__webpack_exports__,"e",(function(){return setAxisFormatting})),__webpack_require__.d(__webpack_exports__,"d",(function(){return runFormatting}));var _d3_loader__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(2),ssf__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(7),ssf__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(ssf__WEBPACK_IMPORTED_MODULE_1__);const FONT_TYPE="'Roboto', 'Noto Sans JP', 'Noto Sans CJK KR', 'Noto Sans Arabic UI', 'Noto Sans Devanagari UI', 'Noto Sans Hebre', 'Noto Sans Thai UI', 'Helvetica', 'Arial', sans-serif";function parseTransform(t){return t.split("(")[1].split(")")[0].split(",")}function positionRefLine(t,e){let n=e.x_hist||e.y_hist?".BOUNDING_BOX_group":".mark-group.role-frame.root",r=_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(n).select("path").node().getBBox(),i=_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(`.refLine${t}_marks`).selectChildren(),o=parseTransform(i.attr("transform"));"x"===t?(o[1]=r.height,i.attr("y2",-1*r.height).attr("transform",`translate(${o[0]},${o[1]})`)):(o[0]=0,i.attr("x2",r.width).attr("transform",`translate(${o[0]},${o[1]})`))}function positionLegend(orientation){if("right"===orientation){let legends=_d3_loader__WEBPACK_IMPORTED_MODULE_0__.b(".mark-group.role-legend")._groups[0],baseLegend=legends[legends.length-2],lastLegend=legends[legends.length-1],translate=parseTransform(_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(baseLegend).select("g").attr("transform")),offset=_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(baseLegend).select("g").node().getBBox(),legendOffset=_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(lastLegend).select("g").node().getBBox();_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(lastLegend).select("g").attr("transform",`translate(${translate[0]}, ${eval(translate[1])+offset.height+legendOffset.height})`)}}function fixChartSizing(){_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a("svg").style("width","100%").style("height","100%").style("position","fixed").style("preserveAspectRatio","none").style("top",0).style("bottom",0).style("right",0).style("left",0)}function setAxisFormatting(t,e,n,r=null){if("simple"===e)_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a("g.mark-text.role-axis-label").selectAll("text").each((function(t,e){_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(this).text(ssf__WEBPACK_IMPORTED_MODULE_1___default.a.format(n,t.datum.value))}));else{let e=t.x_hist||t.y_hist?".BOUNDING_BOX_group":".mark-group.role-frame.root";_d3_loader__WEBPACK_IMPORTED_MODULE_0__.b(e).selectAll(".mark-text.role-axis-label").each((function(t,e){0==e&&_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(this).selectAll("text").each((function(t,e){_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(this).text(ssf__WEBPACK_IMPORTED_MODULE_1___default.a.format(n,t.datum.value))})),1==e&&_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(this).selectAll("text").each((function(t,e){_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(this).text(ssf__WEBPACK_IMPORTED_MODULE_1___default.a.format(r,t.datum.value))}))}))}}function formatPointLegend(t,e,n,r){let i,o=_d3_loader__WEBPACK_IMPORTED_MODULE_0__.b(".mark-group.role-legend-entry");i=r||n?!r&&n&&e?o._groups[0][0]:!n&&e||n&&!e?o._groups[0][1]:n&&e?o._groups[0][2]:o._groups[0][0]:o._groups[0][0],_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(i).selectAll("text").each((function(e,n){_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(this).text(ssf__WEBPACK_IMPORTED_MODULE_1___default.a.format(t,e.datum.value))}))}function formatCrossfilterSelection(t,e,n){_d3_loader__WEBPACK_IMPORTED_MODULE_0__.a(".SCATTERPLOT_marks").selectAll("path").attr("fill",(function(e){for(let r of t){let t=r.field.replace(".","_");return r.values.indexOf(String(e.datum[t]))>=0?n:"#DEE1E5"}}))}function runFormatting(t,e,n,r,i,o){t.crossfilterEnabled&&t.crossfilters.length&&e.layer_points&&formatCrossfilterSelection(t.crossfilters,n,e.color_col),setAxisFormatting(e,"scatter",r,i),e.size&&e.layer_points&&formatPointLegend(o,void 0!==n[1],e.heatmap_off,e.x_hist||e.y_hist),e.reference_line_x&&positionRefLine("x",e),e.reference_line_y&&positionRefLine("y",e)}},function(t,e,n){var r={};!function(t){function e(t){for(var e="",n=t.length-1;n>=0;)e+=t.charAt(n--);return e}function n(t,e){for(var n="";n.length<e;)n+=t;return n}function r(t,e){var r=""+t;return r.length>=e?r:n("0",e-r.length)+r}function i(t,e){var r=""+t;return r.length>=e?r:n(" ",e-r.length)+r}function o(t,e){var r=""+t;return r.length>=e?r:r+n(" ",e-r.length)}t.version="0.11.2";var a=Math.pow(2,32);function s(t,e){return t>a||t<-a?function(t,e){var r=""+Math.round(t);return r.length>=e?r:n("0",e-r.length)+r}(t,e):function(t,e){var r=""+t;return r.length>=e?r:n("0",e-r.length)+r}(Math.round(t),e)}function u(t,e){return e=e||0,t.length>=7+e&&103==(32|t.charCodeAt(e))&&101==(32|t.charCodeAt(e+1))&&110==(32|t.charCodeAt(e+2))&&101==(32|t.charCodeAt(e+3))&&114==(32|t.charCodeAt(e+4))&&97==(32|t.charCodeAt(e+5))&&108==(32|t.charCodeAt(e+6))}var l=[["Sun","Sunday"],["Mon","Monday"],["Tue","Tuesday"],["Wed","Wednesday"],["Thu","Thursday"],["Fri","Friday"],["Sat","Saturday"]],c=[["J","Jan","January"],["F","Feb","February"],["M","Mar","March"],["A","Apr","April"],["M","May","May"],["J","Jun","June"],["J","Jul","July"],["A","Aug","August"],["S","Sep","September"],["O","Oct","October"],["N","Nov","November"],["D","Dec","December"]];function f(t){t[0]="General",t[1]="0",t[2]="0.00",t[3]="#,##0",t[4]="#,##0.00",t[9]="0%",t[10]="0.00%",t[11]="0.00E+00",t[12]="# ?/?",t[13]="# ??/??",t[14]="m/d/yy",t[15]="d-mmm-yy",t[16]="d-mmm",t[17]="mmm-yy",t[18]="h:mm AM/PM",t[19]="h:mm:ss AM/PM",t[20]="h:mm",t[21]="h:mm:ss",t[22]="m/d/yy h:mm",t[37]="#,##0 ;(#,##0)",t[38]="#,##0 ;[Red](#,##0)",t[39]="#,##0.00;(#,##0.00)",t[40]="#,##0.00;[Red](#,##0.00)",t[45]="mm:ss",t[46]="[h]:mm:ss",t[47]="mmss.0",t[48]="##0.0E+0",t[49]="@",t[56]='"上午/下午 "hh"時"mm"分"ss"秒 "'}var d={};f(d);var h=[],p=0;for(p=5;p<=8;++p)h[p]=32+p;for(p=23;p<=26;++p)h[p]=0;for(p=27;p<=31;++p)h[p]=14;for(p=50;p<=58;++p)h[p]=14;for(p=59;p<=62;++p)h[p]=p-58;for(p=67;p<=68;++p)h[p]=p-58;for(p=72;p<=75;++p)h[p]=p-58;for(p=67;p<=68;++p)h[p]=p-57;for(p=76;p<=78;++p)h[p]=p-56;for(p=79;p<=81;++p)h[p]=p-34;var g=[];function m(t,e,n){for(var r=t<0?-1:1,i=t*r,o=0,a=1,s=0,u=1,l=0,c=0,f=Math.floor(i);l<e&&(s=(f=Math.floor(i))*a+o,c=f*l+u,!(i-f<5e-8));)i=1/(i-f),o=a,a=s,u=l,l=c;if(c>e&&(l>e?(c=u,s=o):(c=l,s=a)),!n)return[0,r*s,c];var d=Math.floor(r*s/c);return[d,r*s-d*c,c]}function b(t,e,n){if(t>2958465||t<0)return null;var r=0|t,i=Math.floor(86400*(t-r)),o=0,a=[],s={D:r,T:i,u:86400*(t-r)-i,y:0,m:0,d:0,H:0,M:0,S:0,q:0};if(Math.abs(s.u)<1e-6&&(s.u=0),e&&e.date1904&&(r+=1462),s.u>.9999&&(s.u=0,86400==++i&&(s.T=i=0,++r,++s.D)),60===r)a=n?[1317,10,29]:[1900,2,29],o=3;else if(0===r)a=n?[1317,8,29]:[1900,1,0],o=6;else{r>60&&--r;var u=new Date(1900,0,1);u.setDate(u.getDate()+r-1),a=[u.getFullYear(),u.getMonth()+1,u.getDate()],o=u.getDay(),r<60&&(o=(o+6)%7),n&&(o=function(t,e){e[0]-=581;var n=t.getDay();t<60&&(n=(n+6)%7);return n}(u,a))}return s.y=a[0],s.m=a[1],s.d=a[2],s.S=i%60,i=Math.floor(i/60),s.M=i%60,i=Math.floor(i/60),s.H=i,s.q=o,s}g[5]=g[63]='"$"#,##0_);\\("$"#,##0\\)',g[6]=g[64]='"$"#,##0_);[Red]\\("$"#,##0\\)',g[7]=g[65]='"$"#,##0.00_);\\("$"#,##0.00\\)',g[8]=g[66]='"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',g[41]='_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)',g[42]='_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)',g[43]='_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)',g[44]='_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)',t.parse_date_code=b;var y=new Date(1899,11,31,0,0,0),v=y.getTime(),x=new Date(1900,2,1,0,0,0);function _(t,e){var n=t.getTime();return e?n-=1262304e5:t>=x&&(n+=864e5),(n-(v+6e4*(t.getTimezoneOffset()-y.getTimezoneOffset())))/864e5}t._general_int=function(t){return t.toString(10)};var O=function(){var t=/(?:\.0*|(\.\d*[1-9])0+)$/;function e(e){return-1==e.indexOf(".")?e:e.replace(t,"$1")}var n=/(?:\.0*|(\.\d*[1-9])0+)[Ee]/,r=/(E[+-])(\d)$/;return function(t){var i,o=Math.floor(Math.log(Math.abs(t))*Math.LOG10E);return i=o>=-4&&o<=-1?t.toPrecision(10+o):Math.abs(o)<=9?function(t){var n=t<0?12:11,r=e(t.toFixed(12));return r.length<=n||(r=t.toPrecision(10)).length<=n?r:t.toExponential(5)}(t):10===o?t.toFixed(10).substr(0,12):function(t){var n=e(t.toFixed(11));return n.length>(t<0?12:11)||"0"===n||"-0"===n?t.toPrecision(6):n}(t),e(function(t){return-1==t.indexOf("E")?t:t.replace(n,"$1E").replace(r,"$10$2")}(i.toUpperCase()))}}();function w(t,e){switch(typeof t){case"string":return t;case"boolean":return t?"TRUE":"FALSE";case"number":return(0|t)===t?t.toString(10):O(t);case"undefined":return"";case"object":if(null==t)return"";if(t instanceof Date)return T(14,_(t,e&&e.date1904),e)}throw new Error("unsupported value in General format: "+t)}t._general_num=O,t._general=w;"๐๑๒๓๔๕๖๗๘๙".split("");function j(t,e,n,i){var o,a="",s=0,u=0,f=n.y,d=0;switch(t){case 98:f=n.y+543;case 121:switch(e.length){case 1:case 2:o=f%100,d=2;break;default:o=f%1e4,d=4}break;case 109:switch(e.length){case 1:case 2:o=n.m,d=e.length;break;case 3:return c[n.m-1][1];case 5:return c[n.m-1][0];default:return c[n.m-1][2]}break;case 100:switch(e.length){case 1:case 2:o=n.d,d=e.length;break;case 3:return l[n.q][0];default:return l[n.q][1]}break;case 104:switch(e.length){case 1:case 2:o=1+(n.H+11)%12,d=e.length;break;default:throw"bad hour format: "+e}break;case 72:switch(e.length){case 1:case 2:o=n.H,d=e.length;break;default:throw"bad hour format: "+e}break;case 77:switch(e.length){case 1:case 2:o=n.M,d=e.length;break;default:throw"bad minute format: "+e}break;case 115:if("s"!=e&&"ss"!=e&&".0"!=e&&".00"!=e&&".000"!=e)throw"bad second format: "+e;return 0!==n.u||"s"!=e&&"ss"!=e?(u=i>=2?3===i?1e3:100:1===i?10:1,(s=Math.round(u*(n.S+n.u)))>=60*u&&(s=0),"s"===e?0===s?"0":""+s/u:(a=r(s,2+i),"ss"===e?a.substr(0,2):"."+a.substr(2,e.length-1))):r(n.S,e.length);case 90:switch(e){case"[h]":case"[hh]":o=24*n.D+n.H;break;case"[m]":case"[mm]":o=60*(24*n.D+n.H)+n.M;break;case"[s]":case"[ss]":o=60*(60*(24*n.D+n.H)+n.M)+Math.round(n.S+n.u);break;default:throw"bad abstime format: "+e}d=3===e.length?1:2;break;case 101:o=f,d=1}return d>0?r(o,d):""}function k(t){if(t.length<=3)return t;for(var e=t.length%3,n=t.substr(0,e);e!=t.length;e+=3)n+=(n.length>0?",":"")+t.substr(e,3);return n}var E=function(){var t=/%/g;var a=/# (\?+)( ?)\/( ?)(\d+)/;var u=/^#*0*\.([0#]+)/,l=/\).*[0#]/,c=/\(###\) ###\\?-####/;function f(t){for(var e,n="",r=0;r!=t.length;++r)switch(e=t.charCodeAt(r)){case 35:break;case 63:n+=" ";break;case 48:n+="0";break;default:n+=String.fromCharCode(e)}return n}function d(t,e){var n=Math.pow(10,e);return""+Math.round(t*n)/n}function h(t,e){var n=t-Math.floor(t),r=Math.pow(10,e);return e<(""+Math.round(n*r)).length?0:Math.round(n*r)}function p(g,b,y){if(40===g.charCodeAt(0)&&!b.match(l)){var v=b.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return y>=0?p("n",v,y):"("+p("n",v,-y)+")"}if(44===b.charCodeAt(b.length-1))return function(t,e,n){for(var r=e.length-1;44===e.charCodeAt(r-1);)--r;return E(t,e.substr(0,r),n/Math.pow(10,3*(e.length-r)))}(g,b,y);if(-1!==b.indexOf("%"))return function(e,r,i){var o=r.replace(t,""),a=r.length-o.length;return E(e,o,i*Math.pow(10,2*a))+n("%",a)}(g,b,y);if(-1!==b.indexOf("E"))return function t(e,n){var r,i=e.indexOf("E")-e.indexOf(".")-1;if(e.match(/^#+0.0E\+0$/)){if(0==n)return"0.0E+0";if(n<0)return"-"+t(e,-n);var o=e.indexOf(".");-1===o&&(o=e.indexOf("E"));var a=Math.floor(Math.log(n)*Math.LOG10E)%o;if(a<0&&(a+=o),-1===(r=(n/Math.pow(10,a)).toPrecision(i+1+(o+a)%o)).indexOf("e")){var s=Math.floor(Math.log(n)*Math.LOG10E);for(-1===r.indexOf(".")?r=r.charAt(0)+"."+r.substr(1)+"E+"+(s-r.length+a):r+="E+"+(s-a);"0."===r.substr(0,2);)r=(r=r.charAt(0)+r.substr(2,o)+"."+r.substr(2+o)).replace(/^0+([1-9])/,"$1").replace(/^0+\./,"0.");r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,(function(t,e,n,r){return e+n+r.substr(0,(o+a)%o)+"."+r.substr(a)+"E"}))}else r=n.toExponential(i);return e.match(/E\+00$/)&&r.match(/e[+-]\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),e.match(/E\-/)&&r.match(/e\+/)&&(r=r.replace(/e\+/,"e")),r.replace("e","E")}(b,y);if(36===b.charCodeAt(0))return"$"+p(g,b.substr(" "==b.charAt(1)?2:1),y);var x,_,O,w,j=Math.abs(y),A=y<0?"-":"";if(b.match(/^00+$/))return A+s(j,b.length);if(b.match(/^[#?]+$/))return"0"===(x=s(y,0))&&(x=""),x.length>b.length?x:f(b.substr(0,b.length-x.length))+x;if(_=b.match(a))return function(t,e,o){var a=parseInt(t[4],10),s=Math.round(e*a),u=Math.floor(s/a),l=s-u*a,c=a;return o+(0===u?"":""+u)+" "+(0===l?n(" ",t[1].length+1+t[4].length):i(l,t[1].length)+t[2]+"/"+t[3]+r(c,t[4].length))}(_,j,A);if(b.match(/^#+0+$/))return A+s(j,b.length-b.indexOf("0"));if(_=b.match(u))return x=d(y,_[1].length).replace(/^([^\.]+)$/,"$1."+f(_[1])).replace(/\.$/,"."+f(_[1])).replace(/\.(\d*)$/,(function(t,e){return"."+e+n("0",f(_[1]).length-e.length)})),-1!==b.indexOf("0.")?x:x.replace(/^0\./,".");if(b=b.replace(/^#+([0.])/,"$1"),_=b.match(/^(0*)\.(#*)$/))return A+d(j,_[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,_[1].length?"0.":".");if(_=b.match(/^#{1,3},##0(\.?)$/))return A+k(s(j,0));if(_=b.match(/^#,##0\.([#0]*0)$/))return y<0?"-"+p(g,b,-y):k(""+(Math.floor(y)+function(t,e){return e<(""+Math.round((t-Math.floor(t))*Math.pow(10,e))).length?1:0}(y,_[1].length)))+"."+r(h(y,_[1].length),_[1].length);if(_=b.match(/^#,#*,#0/))return p(g,b.replace(/^#,#*,/,""),y);if(_=b.match(/^([0#]+)(\\?-([0#]+))+$/))return x=e(p(g,b.replace(/[\\-]/g,""),y)),O=0,e(e(b.replace(/\\/g,"")).replace(/[0#]/g,(function(t){return O<x.length?x.charAt(O++):"0"===t?"0":""})));if(b.match(c))return"("+(x=p(g,"##########",y)).substr(0,3)+") "+x.substr(3,3)+"-"+x.substr(6);var D="";if(_=b.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return O=Math.min(_[4].length,7),w=m(j,Math.pow(10,O)-1,!1),x=""+A," "==(D=E("n",_[1],w[1])).charAt(D.length-1)&&(D=D.substr(0,D.length-1)+"0"),x+=D+_[2]+"/"+_[3],(D=o(w[2],O)).length<_[4].length&&(D=f(_[4].substr(_[4].length-D.length))+D),x+=D;if(_=b.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return O=Math.min(Math.max(_[1].length,_[4].length),7),A+((w=m(j,Math.pow(10,O)-1,!0))[0]||(w[1]?"":"0"))+" "+(w[1]?i(w[1],O)+_[2]+"/"+_[3]+o(w[2],O):n(" ",2*O+1+_[2].length+_[3].length));if(_=b.match(/^[#0?]+$/))return x=s(y,0),b.length<=x.length?x:f(b.substr(0,b.length-x.length))+x;if(_=b.match(/^([#0?]+)\.([#0]+)$/)){x=""+y.toFixed(Math.min(_[2].length,10)).replace(/([^0])0+$/,"$1"),O=x.indexOf(".");var M=b.indexOf(".")-O,S=b.length-x.length-M;return f(b.substr(0,M)+x+b.substr(b.length-S))}if(_=b.match(/^00,000\.([#0]*0)$/))return O=h(y,_[1].length),y<0?"-"+p(g,b,-y):k(function(t){return t<2147483647&&t>-2147483648?""+(t>=0?0|t:t-1|0):""+Math.floor(t)}(y)).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,(function(t){return"00,"+(t.length<3?r(0,3-t.length):"")+t}))+"."+r(O,_[1].length);switch(b){case"###,##0.00":return p(g,"#,##0.00",y);case"###,###":case"##,###":case"#,###":var C=k(s(j,0));return"0"!==C?A+C:"";case"###,###.00":return p(g,"###,##0.00",y).replace(/^0\./,".");case"#,###.00":return p(g,"#,##0.00",y).replace(/^0\./,".")}throw new Error("unsupported format |"+b+"|")}function g(s,d,h){if(40===s.charCodeAt(0)&&!d.match(l)){var p=d.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return h>=0?g("n",p,h):"("+g("n",p,-h)+")"}if(44===d.charCodeAt(d.length-1))return function(t,e,n){for(var r=e.length-1;44===e.charCodeAt(r-1);)--r;return E(t,e.substr(0,r),n/Math.pow(10,3*(e.length-r)))}(s,d,h);if(-1!==d.indexOf("%"))return function(e,r,i){var o=r.replace(t,""),a=r.length-o.length;return E(e,o,i*Math.pow(10,2*a))+n("%",a)}(s,d,h);if(-1!==d.indexOf("E"))return function t(e,n){var r,i=e.indexOf("E")-e.indexOf(".")-1;if(e.match(/^#+0.0E\+0$/)){if(0==n)return"0.0E+0";if(n<0)return"-"+t(e,-n);var o=e.indexOf(".");-1===o&&(o=e.indexOf("E"));var a=Math.floor(Math.log(n)*Math.LOG10E)%o;if(a<0&&(a+=o),!(r=(n/Math.pow(10,a)).toPrecision(i+1+(o+a)%o)).match(/[Ee]/)){var s=Math.floor(Math.log(n)*Math.LOG10E);-1===r.indexOf(".")?r=r.charAt(0)+"."+r.substr(1)+"E+"+(s-r.length+a):r+="E+"+(s-a),r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,(function(t,e,n,r){return e+n+r.substr(0,(o+a)%o)+"."+r.substr(a)+"E"}))}else r=n.toExponential(i);return e.match(/E\+00$/)&&r.match(/e[+-]\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),e.match(/E\-/)&&r.match(/e\+/)&&(r=r.replace(/e\+/,"e")),r.replace("e","E")}(d,h);if(36===d.charCodeAt(0))return"$"+g(s,d.substr(" "==d.charAt(1)?2:1),h);var b,y,v,x,_=Math.abs(h),O=h<0?"-":"";if(d.match(/^00+$/))return O+r(_,d.length);if(d.match(/^[#?]+$/))return b=""+h,0===h&&(b=""),b.length>d.length?b:f(d.substr(0,d.length-b.length))+b;if(y=d.match(a))return function(t,e,r){return r+(0===e?"":""+e)+n(" ",t[1].length+2+t[4].length)}(y,_,O);if(d.match(/^#+0+$/))return O+r(_,d.length-d.indexOf("0"));if(y=d.match(u))return b=(b=(""+h).replace(/^([^\.]+)$/,"$1."+f(y[1])).replace(/\.$/,"."+f(y[1]))).replace(/\.(\d*)$/,(function(t,e){return"."+e+n("0",f(y[1]).length-e.length)})),-1!==d.indexOf("0.")?b:b.replace(/^0\./,".");if(d=d.replace(/^#+([0.])/,"$1"),y=d.match(/^(0*)\.(#*)$/))return O+(""+_).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,y[1].length?"0.":".");if(y=d.match(/^#{1,3},##0(\.?)$/))return O+k(""+_);if(y=d.match(/^#,##0\.([#0]*0)$/))return h<0?"-"+g(s,d,-h):k(""+h)+"."+n("0",y[1].length);if(y=d.match(/^#,#*,#0/))return g(s,d.replace(/^#,#*,/,""),h);if(y=d.match(/^([0#]+)(\\?-([0#]+))+$/))return b=e(g(s,d.replace(/[\\-]/g,""),h)),v=0,e(e(d.replace(/\\/g,"")).replace(/[0#]/g,(function(t){return v<b.length?b.charAt(v++):"0"===t?"0":""})));if(d.match(c))return"("+(b=g(s,"##########",h)).substr(0,3)+") "+b.substr(3,3)+"-"+b.substr(6);var w="";if(y=d.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return v=Math.min(y[4].length,7),x=m(_,Math.pow(10,v)-1,!1),b=""+O," "==(w=E("n",y[1],x[1])).charAt(w.length-1)&&(w=w.substr(0,w.length-1)+"0"),b+=w+y[2]+"/"+y[3],(w=o(x[2],v)).length<y[4].length&&(w=f(y[4].substr(y[4].length-w.length))+w),b+=w;if(y=d.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return v=Math.min(Math.max(y[1].length,y[4].length),7),O+((x=m(_,Math.pow(10,v)-1,!0))[0]||(x[1]?"":"0"))+" "+(x[1]?i(x[1],v)+y[2]+"/"+y[3]+o(x[2],v):n(" ",2*v+1+y[2].length+y[3].length));if(y=d.match(/^[#0?]+$/))return b=""+h,d.length<=b.length?b:f(d.substr(0,d.length-b.length))+b;if(y=d.match(/^([#0]+)\.([#0]+)$/)){b=""+h.toFixed(Math.min(y[2].length,10)).replace(/([^0])0+$/,"$1"),v=b.indexOf(".");var j=d.indexOf(".")-v,A=d.length-b.length-j;return f(d.substr(0,j)+b+d.substr(d.length-A))}if(y=d.match(/^00,000\.([#0]*0)$/))return h<0?"-"+g(s,d,-h):k(""+h).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,(function(t){return"00,"+(t.length<3?r(0,3-t.length):"")+t}))+"."+r(0,y[1].length);switch(d){case"###,###":case"##,###":case"#,###":var D=k(""+_);return"0"!==D?O+D:"";default:if(d.match(/\.[0#?]*$/))return g(s,d.slice(0,d.lastIndexOf(".")),h)+f(d.slice(d.lastIndexOf(".")))}throw new Error("unsupported format |"+d+"|")}return function(t,e,n){return(0|n)===n?g(t,e,n):p(t,e,n)}}();function A(t){for(var e=[],n=!1,r=0,i=0;r<t.length;++r)switch(t.charCodeAt(r)){case 34:n=!n;break;case 95:case 42:case 92:++r;break;case 59:e[e.length]=t.substr(i,r-i),i=r+1}if(e[e.length]=t.substr(i),!0===n)throw new Error("Format |"+t+"| unterminated string ");return e}t._split=A;var D=/\[[HhMmSs\u0E0A\u0E19\u0E17]*\]/;function M(t){for(var e=0,n="",r="";e<t.length;)switch(n=t.charAt(e)){case"G":u(t,e)&&(e+=6),e++;break;case'"':for(;34!==t.charCodeAt(++e)&&e<t.length;);++e;break;case"\\":case"_":e+=2;break;case"@":++e;break;case"B":case"b":if("1"===t.charAt(e+1)||"2"===t.charAt(e+1))return!0;case"M":case"D":case"Y":case"H":case"S":case"E":case"m":case"d":case"y":case"h":case"s":case"e":case"g":return!0;case"A":case"a":case"上":if("A/P"===t.substr(e,3).toUpperCase())return!0;if("AM/PM"===t.substr(e,5).toUpperCase())return!0;if("上午/下午"===t.substr(e,5).toUpperCase())return!0;++e;break;case"[":for(r=n;"]"!==t.charAt(e++)&&e<t.length;)r+=t.charAt(e);if(r.match(D))return!0;break;case".":case"0":case"#":for(;e<t.length&&("0#?.,E+-%".indexOf(n=t.charAt(++e))>-1||"\\"==n&&"-"==t.charAt(e+1)&&"0#".indexOf(t.charAt(e+2))>-1););break;case"?":for(;t.charAt(++e)===n;);break;case"*":++e," "!=t.charAt(e)&&"*"!=t.charAt(e)||++e;break;case"(":case")":++e;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(;e<t.length&&"0123456789".indexOf(t.charAt(++e))>-1;);break;case" ":default:++e}return!1}function S(t,e,n,r){for(var i,o,a,s=[],l="",c=0,f="",d="t",h="H";c<t.length;)switch(f=t.charAt(c)){case"G":if(!u(t,c))throw new Error("unrecognized character "+f+" in "+t);s[s.length]={t:"G",v:"General"},c+=7;break;case'"':for(l="";34!==(a=t.charCodeAt(++c))&&c<t.length;)l+=String.fromCharCode(a);s[s.length]={t:"t",v:l},++c;break;case"\\":var p=t.charAt(++c),g="("===p||")"===p?p:"t";s[s.length]={t:g,v:p},++c;break;case"_":s[s.length]={t:"t",v:" "},c+=2;break;case"@":s[s.length]={t:"T",v:e},++c;break;case"B":case"b":if("1"===t.charAt(c+1)||"2"===t.charAt(c+1)){if(null==i&&null==(i=b(e,n,"2"===t.charAt(c+1))))return"";s[s.length]={t:"X",v:t.substr(c,2)},d=f,c+=2;break}case"M":case"D":case"Y":case"H":case"S":case"E":f=f.toLowerCase();case"m":case"d":case"y":case"h":case"s":case"e":case"g":if(e<0)return"";if(null==i&&null==(i=b(e,n)))return"";for(l=f;++c<t.length&&t.charAt(c).toLowerCase()===f;)l+=f;"m"===f&&"h"===d.toLowerCase()&&(f="M"),"h"===f&&(f=h),s[s.length]={t:f,v:l},d=f;break;case"A":case"a":case"上":var m={t:f,v:f};if(null==i&&(i=b(e,n)),"A/P"===t.substr(c,3).toUpperCase()?(null!=i&&(m.v=i.H>=12?"P":"A"),m.t="T",h="h",c+=3):"AM/PM"===t.substr(c,5).toUpperCase()?(null!=i&&(m.v=i.H>=12?"PM":"AM"),m.t="T",c+=5,h="h"):"上午/下午"===t.substr(c,5).toUpperCase()?(null!=i&&(m.v=i.H>=12?"下午":"上午"),m.t="T",c+=5,h="h"):(m.t="t",++c),null==i&&"T"===m.t)return"";s[s.length]=m,d=f;break;case"[":for(l=f;"]"!==t.charAt(c++)&&c<t.length;)l+=t.charAt(c);if("]"!==l.slice(-1))throw'unterminated "[" block: |'+l+"|";if(l.match(D)){if(null==i&&null==(i=b(e,n)))return"";s[s.length]={t:"Z",v:l.toLowerCase()},d=l.charAt(1)}else l.indexOf("$")>-1&&(l=(l.match(/\$([^-\[\]]*)/)||[])[1]||"$",M(t)||(s[s.length]={t:"t",v:l}));break;case".":if(null!=i){for(l=f;++c<t.length&&"0"===(f=t.charAt(c));)l+=f;s[s.length]={t:"s",v:l};break}case"0":case"#":for(l=f;++c<t.length&&"0#?.,E+-%".indexOf(f=t.charAt(c))>-1;)l+=f;s[s.length]={t:"n",v:l};break;case"?":for(l=f;t.charAt(++c)===f;)l+=f;s[s.length]={t:f,v:l},d=f;break;case"*":++c," "!=t.charAt(c)&&"*"!=t.charAt(c)||++c;break;case"(":case")":s[s.length]={t:1===r?"t":f,v:f},++c;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(l=f;c<t.length&&"0123456789".indexOf(t.charAt(++c))>-1;)l+=t.charAt(c);s[s.length]={t:"D",v:l};break;case" ":s[s.length]={t:f,v:f},++c;break;case"$":s[s.length]={t:"t",v:"$"},++c;break;default:if(-1===",$-+/():!^&'~{}<>=€acfijklopqrtuvwxzP".indexOf(f))throw new Error("unrecognized character "+f+" in "+t);s[s.length]={t:"t",v:f},++c}var y,v=0,x=0;for(c=s.length-1,d="t";c>=0;--c)switch(s[c].t){case"h":case"H":s[c].t=h,d="h",v<1&&(v=1);break;case"s":(y=s[c].v.match(/\.0+$/))&&(x=Math.max(x,y[0].length-1)),v<3&&(v=3);case"d":case"y":case"M":case"e":d=s[c].t;break;case"m":"s"===d&&(s[c].t="M",v<2&&(v=2));break;case"X":break;case"Z":v<1&&s[c].v.match(/[Hh]/)&&(v=1),v<2&&s[c].v.match(/[Mm]/)&&(v=2),v<3&&s[c].v.match(/[Ss]/)&&(v=3)}switch(v){case 0:break;case 1:i.u>=.5&&(i.u=0,++i.S),i.S>=60&&(i.S=0,++i.M),i.M>=60&&(i.M=0,++i.H);break;case 2:i.u>=.5&&(i.u=0,++i.S),i.S>=60&&(i.S=0,++i.M)}var _,O="";for(c=0;c<s.length;++c)switch(s[c].t){case"t":case"T":case" ":case"D":break;case"X":s[c].v="",s[c].t=";";break;case"d":case"m":case"y":case"h":case"H":case"M":case"s":case"e":case"b":case"Z":s[c].v=j(s[c].t.charCodeAt(0),s[c].v,i,x),s[c].t="t";break;case"n":case"?":for(_=c+1;null!=s[_]&&("?"===(f=s[_].t)||"D"===f||(" "===f||"t"===f)&&null!=s[_+1]&&("?"===s[_+1].t||"t"===s[_+1].t&&"/"===s[_+1].v)||"("===s[c].t&&(" "===f||"n"===f||")"===f)||"t"===f&&("/"===s[_].v||" "===s[_].v&&null!=s[_+1]&&"?"==s[_+1].t));)s[c].v+=s[_].v,s[_]={v:"",t:";"},++_;O+=s[c].v,c=_-1;break;case"G":s[c].t="t",s[c].v=w(e,n)}var k,A,S="";if(O.length>0){40==O.charCodeAt(0)?(k=e<0&&45===O.charCodeAt(0)?-e:e,A=E("n",O,k)):(A=E("n",O,k=e<0&&r>1?-e:e),k<0&&s[0]&&"t"==s[0].t&&(A=A.substr(1),s[0].v="-"+s[0].v)),_=A.length-1;var C=s.length;for(c=0;c<s.length;++c)if(null!=s[c]&&"t"!=s[c].t&&s[c].v.indexOf(".")>-1){C=c;break}var F=s.length;if(C===s.length&&-1===A.indexOf("E")){for(c=s.length-1;c>=0;--c)null!=s[c]&&-1!=="n?".indexOf(s[c].t)&&(_>=s[c].v.length-1?(_-=s[c].v.length,s[c].v=A.substr(_+1,s[c].v.length)):_<0?s[c].v="":(s[c].v=A.substr(0,_+1),_=-1),s[c].t="t",F=c);_>=0&&F<s.length&&(s[F].v=A.substr(0,_+1)+s[F].v)}else if(C!==s.length&&-1===A.indexOf("E")){for(_=A.indexOf(".")-1,c=C;c>=0;--c)if(null!=s[c]&&-1!=="n?".indexOf(s[c].t)){for(o=s[c].v.indexOf(".")>-1&&c===C?s[c].v.indexOf(".")-1:s[c].v.length-1,S=s[c].v.substr(o+1);o>=0;--o)_>=0&&("0"===s[c].v.charAt(o)||"#"===s[c].v.charAt(o))&&(S=A.charAt(_--)+S);s[c].v=S,s[c].t="t",F=c}for(_>=0&&F<s.length&&(s[F].v=A.substr(0,_+1)+s[F].v),_=A.indexOf(".")+1,c=C;c<s.length;++c)if(null!=s[c]&&(-1!=="n?(".indexOf(s[c].t)||c===C)){for(o=s[c].v.indexOf(".")>-1&&c===C?s[c].v.indexOf(".")+1:0,S=s[c].v.substr(0,o);o<s[c].v.length;++o)_<A.length&&(S+=A.charAt(_++));s[c].v=S,s[c].t="t",F=c}}}for(c=0;c<s.length;++c)null!=s[c]&&"n?".indexOf(s[c].t)>-1&&(k=r>1&&e<0&&c>0&&"-"===s[c-1].v?-e:e,s[c].v=E(s[c].t,s[c].v,k),s[c].t="t");var z="";for(c=0;c!==s.length;++c)null!=s[c]&&(z+=s[c].v);return z}t.is_date=M,t._eval=S;var C=/\[[=<>]/,F=/\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;function z(t,e){if(null==e)return!1;var n=parseFloat(e[2]);switch(e[1]){case"=":if(t==n)return!0;break;case">":if(t>n)return!0;break;case"<":if(t<n)return!0;break;case"<>":if(t!=n)return!0;break;case">=":if(t>=n)return!0;break;case"<=":if(t<=n)return!0}return!1}function T(t,e,n){null==n&&(n={});var r="";switch(typeof t){case"string":r="m/d/yy"==t&&n.dateNF?n.dateNF:t;break;case"number":null==(r=14==t&&n.dateNF?n.dateNF:(null!=n.table?n.table:d)[t])&&(r=n.table&&n.table[h[t]]||d[h[t]]),null==r&&(r=g[t]||"General")}if(u(r,0))return w(e,n);e instanceof Date&&(e=_(e,n.date1904));var i=function(t,e){var n=A(t),r=n.length,i=n[r-1].indexOf("@");if(r<4&&i>-1&&--r,n.length>4)throw new Error("cannot find right format for |"+n.join("|")+"|");if("number"!=typeof e)return[4,4===n.length||i>-1?n[n.length-1]:"@"];switch(n.length){case 1:n=i>-1?["General","General","General",n[0]]:[n[0],n[0],n[0],"@"];break;case 2:n=i>-1?[n[0],n[0],n[0],n[1]]:[n[0],n[1],n[0],"@"];break;case 3:n=i>-1?[n[0],n[1],n[0],n[2]]:[n[0],n[1],n[2],"@"]}var o=e>0?n[0]:e<0?n[1]:n[2];if(-1===n[0].indexOf("[")&&-1===n[1].indexOf("["))return[r,o];if(null!=n[0].match(C)||null!=n[1].match(C)){var a=n[0].match(F),s=n[1].match(F);return z(e,a)?[r,n[0]]:z(e,s)?[r,n[1]]:[r,n[null!=a&&null!=s?2:1]]}return[r,o]}(r,e);if(u(i[1]))return w(e,n);if(!0===e)e="TRUE";else if(!1===e)e="FALSE";else if(""===e||null==e)return"";return S(i[1],e,n,i[0])}function $(t,e){if("number"!=typeof e){e=+e||-1;for(var n=0;n<392;++n)if(null!=d[n]){if(d[n]==t){e=n;break}}else e<0&&(e=n);e<0&&(e=391)}return d[e]=t,e}t.load=$,t._table=d,t.get_table=function(){return d},t.load_table=function(t){for(var e=0;392!=e;++e)void 0!==t[e]&&$(t[e],e)},t.init_table=f,t.format=T}(r),"undefined"==typeof DO_NOT_EXPORT_SSF&&(t.exports=r)},function(t,e,n){const r=n(30),{MAX_LENGTH:i,MAX_SAFE_INTEGER:o}=n(29),{re:a,t:s}=n(19),{compareIdentifiers:u}=n(39);class l{constructor(t,e){if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),t instanceof l){if(t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease)return t;t=t.version}else if("string"!=typeof t)throw new TypeError("Invalid Version: "+t);if(t.length>i)throw new TypeError(`version is longer than ${i} characters`);r("SemVer",t,e),this.options=e,this.loose=!!e.loose,this.includePrerelease=!!e.includePrerelease;const n=t.trim().match(e.loose?a[s.LOOSE]:a[s.FULL]);if(!n)throw new TypeError("Invalid Version: "+t);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],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");n[4]?this.prerelease=n[4].split(".").map(t=>{if(/^[0-9]+$/.test(t)){const e=+t;if(e>=0&&e<o)return e}return t}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version}toString(){return this.version}compare(t){if(r("SemVer.compare",this.version,this.options,t),!(t instanceof l)){if("string"==typeof t&&t===this.version)return 0;t=new l(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof l||(t=new l(t,this.options)),u(this.major,t.major)||u(this.minor,t.minor)||u(this.patch,t.patch)}comparePre(t){if(t instanceof l||(t=new l(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let e=0;do{const n=this.prerelease[e],i=t.prerelease[e];if(r("prerelease compare",e,n,i),void 0===n&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===n)return-1;if(n!==i)return u(n,i)}while(++e)}compareBuild(t){t instanceof l||(t=new l(t,this.options));let e=0;do{const n=this.build[e],i=t.build[e];if(r("prerelease compare",e,n,i),void 0===n&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===n)return-1;if(n!==i)return u(n,i)}while(++e)}inc(t,e){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",e);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",e);break;case"prepatch":this.prerelease.length=0,this.inc("patch",e),this.inc("pre",e);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",e),this.inc("pre",e);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{let t=this.prerelease.length;for(;--t>=0;)"number"==typeof this.prerelease[t]&&(this.prerelease[t]++,t=-2);-1===t&&this.prerelease.push(0)}e&&(this.prerelease[0]===e?isNaN(this.prerelease[1])&&(this.prerelease=[e,0]):this.prerelease=[e,0]);break;default:throw new Error("invalid increment argument: "+t)}return this.format(),this.raw=this.version,this}}t.exports=l},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"e",(function(){return winsorize})),__webpack_require__.d(__webpack_exports__,"b",(function(){return handleErrors})),__webpack_require__.d(__webpack_exports__,"d",(function(){return prepareData})),__webpack_require__.d(__webpack_exports__,"c",(function(){return makeBins})),__webpack_require__.d(__webpack_exports__,"a",(function(){return getPercentile}));var percentile__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(48),percentile__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(percentile__WEBPACK_IMPORTED_MODULE_0__),ssf__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(7),ssf__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(ssf__WEBPACK_IMPORTED_MODULE_1__);function winsorize(myData,field,p){if(void 0===p)return;p=p.split("_").map(e=>eval(e));let thresholds=percentile__WEBPACK_IMPORTED_MODULE_0___default()(p,myData.map(t=>t[field]));return myData.map(t=>{let e=Object.assign({},t);return e[field]<=thresholds[0]?e[field]=thresholds[0]:t[field]>=thresholds[1]&&(e[field]=thresholds[1]),e})}function handleErrors(t,e,n){const r=(e,n,r,i,o)=>!(!t.addError||!t.clearErrors)&&(r<i?(t.addError({title:`Not Enough ${n}s`,message:`This visualization requires ${i===o?"exactly":"at least"} ${i} ${n.toLowerCase()}${1===i?"":"s"}.`,group:e}),!1):r>o?(t.addError({title:`Too Many ${n}s`,message:`This visualization requires ${i===o?"exactly":"no more than"} ${o} ${n.toLowerCase()}${1===i?"":"s"}.`,group:e}),!1):(t.clearErrors(e),!0)),{pivots:i,dimension_like:o,measure_like:a}=e.fields;return r("pivot-req","Pivot",i.length,n.min_pivots,n.max_pivots)&&r("dim-req","Dimension",o.length,n.min_dimensions,n.max_dimensions)&&r("mes-req","Measure",a.length,n.min_measures,n.max_measures)}function prepareData(t,e){var n,r=[],i={},o=[],a=[];for(var s in t){var u=t[s],l={links:[]};for(var c in u){if(l[c.replace(".","_")]=u[c].value,void 0!==u[c].links){for(var f=0;f<u[c].links.length;f++){var d=u[c].links[f].label;d=d+" ("+c.substring(c.indexOf(".")+1)+")",u[c].links[f].label=d}l.links.push(u[c].links)}}l.links=l.links.flat(),r.push(l)}for(var h in e.fields.measure_like.forEach((function(t){var e=t.name.replace(".","_");a.push(e)})),e.fields.dimension_like.forEach((function(t){var e=t.name.replace(".","_");o.push(e)})),n=a.concat(o)){var p=n[h];i[n[h]]={},e.fields.measure_like.forEach((function(t){p==t.name.replace(".","_")&&(i[n[h]].lookerName=t.name,void 0!==t.label_short?i[n[h]].title=t.label_short.trim():i[n[h]].title=t.label.trim(),i[n[h]].valueFormat=t.value_format,"yesno"==t.type?i[n[h]].dtype="nominal":i[n[h]].dtype="quantitative")})),e.fields.dimension_like.forEach((function(t){p==t.name.replace(".","_")&&(i[n[h]].lookerName=t.name,void 0!==t.label_short?i[n[h]].title=t.label_short:i[n[h]].title=t.label,i[n[h]].valueFormat=t.value_format,i[n[h]].dtype="nominal")}))}return{dataProperties:i,myData:r}}function makeBins(myData,field,breakpointsArray,valFormat,axis){if(!(myData&&field&&breakpointsArray&&valFormat&&axis))return;let preBin=[],orderedArray=myData.map(t=>t[field]).sort((t,e)=>t-e),breakpoints=breakpointsArray.split(",").map(e=>{switch(e.trim()){case"min":return orderedArray[0];case"max":return orderedArray[orderedArray.length-1];default:return eval(e)}});for(let t=0;t<breakpoints.length-1;t++){let e=orderedArray.findIndex(e=>e>breakpoints[t+1]);-1===e&&(e=orderedArray.length);let n=orderedArray.splice(0,e).length;preBin.push({}),preBin[t]["bin_start_"+axis]=breakpoints[t],preBin[t]["bin_end_"+axis]=breakpoints[t+1],preBin[t]["count_"+axis]=n,preBin[t].label=`${ssf__WEBPACK_IMPORTED_MODULE_1___default.a.format(valFormat,preBin[t]["bin_start_"+axis])} - ${ssf__WEBPACK_IMPORTED_MODULE_1___default.a.format(valFormat,preBin[t]["bin_end_"+axis])}`,preBin[t].order=t+1}return preBin}function getPercentile(t,e,n){return percentile__WEBPACK_IMPORTED_MODULE_0___default()(t,n.map(t=>t[e]).filter(t=>null!==t))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return D})),n.d(e,"b",(function(){return A})),n.d(e,"c",(function(){return x})),n.d(e,"d",(function(){return M})),n.d(e,"e",(function(){return k}));var r=n(51),i=n(27),o=n(104),a=n(105),s=n(106),u=n(64),l=n(50),c=n(1),f=n(0),d=n(36),h=n(47);function p(t){const e={};return n=>e[n]||(e[n]=t(n))}function g(t){const e=p(t.format),n=t.formatPrefix;return{format:e,formatPrefix:n,formatFloat(t){const n=Object(i.a)(t||",");if(null==n.precision){switch(n.precision=12,n.type){case"%":n.precision-=2;break;case"e":n.precision-=1}return r=e(n),o=e(".1f")(1)[1],t=>{const e=r(t),n=e.indexOf(o);if(n<0)return e;let i=function(t,e){let n,r=t.lastIndexOf("e");if(r>0)return r;for(r=t.length;--r>e;)if(n=t.charCodeAt(r),n>=48&&n<=57)return r+1}(e,n);const a=i<e.length?e.slice(i):"";for(;--i>n;)if("0"!==e[i]){++i;break}return e.slice(0,i)+a}}return e(n);var r,o},formatSpan(t,u,l,c){c=Object(i.a)(null==c?",f":c);const f=Object(r.c)(t,u,l),d=Math.max(Math.abs(t),Math.abs(u));let h;if(null==c.precision)switch(c.type){case"s":return isNaN(h=Object(o.a)(f,d))||(c.precision=h),n(c,d);case"":case"e":case"g":case"p":case"r":isNaN(h=Object(a.a)(f,d))||(c.precision=h-("e"===c.type));break;case"f":case"%":isNaN(h=Object(s.a)(f))||(c.precision=h-2*("%"===c.type))}return e(c)}}}let m,b;function y(){return m=g({format:u.a,formatPrefix:u.b})}function v(t){return g(Object(l.a)(t))}function x(t){return arguments.length?m=v(t):m}function _(t,e,n){n=n||{},Object(f.G)(n)||Object(f.o)("Invalid time multi-format specifier: ".concat(n));const r=e(c.i),i=e(c.f),o=e(c.d),a=e(c.a),s=e(c.k),u=e(c.g),l=e(c.h),d=e(c.l),h=t(n[c.e]||".%L"),p=t(n[c.i]||":%S"),g=t(n[c.f]||"%I:%M"),m=t(n[c.d]||"%I %p"),b=t(n[c.a]||n[c.b]||"%a %d"),y=t(n[c.k]||"%b %d"),v=t(n[c.g]||"%B"),x=t(n[c.h]||"%B"),_=t(n[c.l]||"%Y");return t=>(r(t)<t?h:i(t)<t?p:o(t)<t?g:a(t)<t?m:u(t)<t?s(t)<t?b:y:d(t)<t?l(t)<t?v:x:_)(t)}function O(t){const e=p(t.format),n=p(t.utcFormat);return{timeFormat:t=>Object(f.I)(t)?e(t):_(e,c.p,t),utcFormat:t=>Object(f.I)(t)?n(t):_(n,c.v,t),timeParse:p(t.parse),utcParse:p(t.utcParse)}}function w(){return b=O({format:d.a,parse:d.b,utcFormat:d.c,utcParse:d.d})}function j(t){return O(Object(h.a)(t))}function k(t){return arguments.length?b=j(t):b}y(),w();const E=(t,e)=>Object(f.p)({},t,e);function A(t,e){const n=t?v(t):x(),r=e?j(e):k();return E(n,r)}function D(t,e){const n=arguments.length;return n&&2!==n&&Object(f.o)("defaultLocale expects either zero or two arguments."),n?E(x(t),k(e)):E(x(),k())}function M(){return y(),w(),D()}},function(t,e,n){const r=n(8);t.exports=(t,e,n)=>new r(t,n).compare(new r(e,n))},function(t,e,n){class r{constructor(t,e){if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),t instanceof r)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new r(t.raw,e);if(t instanceof i)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=e,this.loose=!!e.loose,this.includePrerelease=!!e.includePrerelease,this.raw=t,this.set=t.split(/\s*\|\|\s*/).map(t=>this.parseRange(t.trim())).filter(t=>t.length),!this.set.length)throw new TypeError("Invalid SemVer Range: "+t);this.format()}format(){return this.range=this.set.map(t=>t.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(t){const e=this.options.loose;t=t.trim();const n=e?s[u.HYPHENRANGELOOSE]:s[u.HYPHENRANGE];t=t.replace(n,w(this.options.includePrerelease)),o("hyphen replace",t),t=t.replace(s[u.COMPARATORTRIM],l),o("comparator trim",t,s[u.COMPARATORTRIM]),t=(t=(t=t.replace(s[u.TILDETRIM],c)).replace(s[u.CARETTRIM],f)).split(/\s+/).join(" ");const r=e?s[u.COMPARATORLOOSE]:s[u.COMPARATOR];return t.split(" ").map(t=>h(t,this.options)).join(" ").split(/\s+/).map(t=>O(t,this.options)).filter(this.options.loose?t=>!!t.match(r):()=>!0).map(t=>new i(t,this.options))}intersects(t,e){if(!(t instanceof r))throw new TypeError("a Range is required");return this.set.some(n=>d(n,e)&&t.set.some(t=>d(t,e)&&n.every(n=>t.every(t=>n.intersects(t,e)))))}test(t){if(!t)return!1;if("string"==typeof t)try{t=new a(t,this.options)}catch(t){return!1}for(let e=0;e<this.set.length;e++)if(j(this.set[e],t,this.options))return!0;return!1}}t.exports=r;const i=n(32),o=n(30),a=n(8),{re:s,t:u,comparatorTrimReplace:l,tildeTrimReplace:c,caretTrimReplace:f}=n(19),d=(t,e)=>{let n=!0;const r=t.slice();let i=r.pop();for(;n&&r.length;)n=r.every(t=>i.intersects(t,e)),i=r.pop();return n},h=(t,e)=>(o("comp",t,e),t=b(t,e),o("caret",t),t=g(t,e),o("tildes",t),t=v(t,e),o("xrange",t),t=_(t,e),o("stars",t),t),p=t=>!t||"x"===t.toLowerCase()||"*"===t,g=(t,e)=>t.trim().split(/\s+/).map(t=>m(t,e)).join(" "),m=(t,e)=>{const n=e.loose?s[u.TILDELOOSE]:s[u.TILDE];return t.replace(n,(e,n,r,i,a)=>{let s;return o("tilde",t,e,n,r,i,a),p(n)?s="":p(r)?s=`>=${n}.0.0 <${+n+1}.0.0-0`:p(i)?s=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?(o("replaceTilde pr",a),s=`>=${n}.${r}.${i}-${a} <${n}.${+r+1}.0-0`):s=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,o("tilde return",s),s})},b=(t,e)=>t.trim().split(/\s+/).map(t=>y(t,e)).join(" "),y=(t,e)=>{o("caret",t,e);const n=e.loose?s[u.CARETLOOSE]:s[u.CARET],r=e.includePrerelease?"-0":"";return t.replace(n,(e,n,i,a,s)=>{let u;return o("caret",t,e,n,i,a,s),p(n)?u="":p(i)?u=`>=${n}.0.0${r} <${+n+1}.0.0-0`:p(a)?u="0"===n?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:s?(o("replaceCaret pr",s),u="0"===n?"0"===i?`>=${n}.${i}.${a}-${s} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${s} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${s} <${+n+1}.0.0-0`):(o("no pr"),u="0"===n?"0"===i?`>=${n}.${i}.${a}${r} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),o("caret return",u),u})},v=(t,e)=>(o("replaceXRanges",t,e),t.split(/\s+/).map(t=>x(t,e)).join(" ")),x=(t,e)=>{t=t.trim();const n=e.loose?s[u.XRANGELOOSE]:s[u.XRANGE];return t.replace(n,(n,r,i,a,s,u)=>{o("xRange",t,n,r,i,a,s,u);const l=p(i),c=l||p(a),f=c||p(s),d=f;return"="===r&&d&&(r=""),u=e.includePrerelease?"-0":"",l?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&d?(c&&(a=0),s=0,">"===r?(r=">=",c?(i=+i+1,a=0,s=0):(a=+a+1,s=0)):"<="===r&&(r="<",c?i=+i+1:a=+a+1),"<"===r&&(u="-0"),n=`${r+i}.${a}.${s}${u}`):c?n=`>=${i}.0.0${u} <${+i+1}.0.0-0`:f&&(n=`>=${i}.${a}.0${u} <${i}.${+a+1}.0-0`),o("xRange return",n),n})},_=(t,e)=>(o("replaceStars",t,e),t.trim().replace(s[u.STAR],"")),O=(t,e)=>(o("replaceGTE0",t,e),t.trim().replace(s[e.includePrerelease?u.GTE0PRE:u.GTE0],"")),w=t=>(e,n,r,i,o,a,s,u,l,c,f,d,h)=>`${n=p(r)?"":p(i)?`>=${r}.0.0${t?"-0":""}`:p(o)?`>=${r}.${i}.0${t?"-0":""}`:a?">="+n:`>=${n}${t?"-0":""}`} ${u=p(l)?"":p(c)?`<${+l+1}.0.0-0`:p(f)?`<${l}.${+c+1}.0-0`:d?`<=${l}.${c}.${f}-${d}`:t?`<${l}.${c}.${+f+1}-0`:"<="+u}`.trim(),j=(t,e,n)=>{for(let n=0;n<t.length;n++)if(!t[n].test(e))return!1;if(e.prerelease.length&&!n.includePrerelease){for(let n=0;n<t.length;n++)if(o(t[n].semver),t[n].semver!==i.ANY&&t[n].semver.prerelease.length>0){const r=t[n].semver;if(r.major===e.major&&r.minor===e.minor&&r.patch===e.patch)return!0}return!1}return!0}},function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return s})),n.d(e,"c",(function(){return c}));var r=n(3),i=n(4);function o(t){return Object(r.a)((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*i.c)/i.e}))}var a=o(0),s=o(1),u=o(2),l=o(3),c=o(4),f=o(5),d=o(6);a.range,s.range,u.range,l.range,c.range,f.range,d.range},function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return s})),n.d(e,"c",(function(){return c}));var r=n(3),i=n(4);function o(t){return Object(r.a)((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/i.e}))}var a=o(0),s=o(1),u=o(2),l=o(3),c=o(4),f=o(5),d=o(6);a.range,s.range,u.range,l.range,c.range,f.range,d.range},function(t,e,n){"use strict";var r=n(17);e.a=function(t){return(t=Object(r.b)(Math.abs(t)))?t[1]:NaN}},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return A})),n.d(e,"b",(function(){return D})),n.d(e,"c",(function(){return x})),n.d(e,"d",(function(){return _})),n.d(e,"e",(function(){return C})),n.d(e,"f",(function(){return S})),n.d(e,"g",(function(){return M})),n.d(e,"h",(function(){return b}));var r=n(0),i=n(107),o=n(49),a=n(10);const s=/^([A-Za-z]+:)?\/\//,u=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,l=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g;async function c(t,e){const n=await this.sanitize(t,e),r=n.href;return n.localFile?this.file(r):this.http(r,e)}async function f(t,e){e=Object(r.p)({},this.options,e);const n=this.fileAccess,i={href:null};let o,a,c;const f=u.test(t.replace(l,""));null!=t&&"string"==typeof t&&f||Object(r.o)("Sanitize failure, invalid URI: "+Object(r.ab)(t));const d=s.test(t);return(c=e.baseURL)&&!d&&(t.startsWith("/")||"/"===c[c.length-1]||(t="/"+t),t=c+t),a=(o=t.startsWith("file://"))||"file"===e.mode||"http"!==e.mode&&!d&&n,o?t=t.slice("file://".length):t.startsWith("//")&&("file"===e.defaultProtocol?(t=t.slice(2),a=!0):t=(e.defaultProtocol||"http")+":"+t),Object.defineProperty(i,"localFile",{value:!!a}),i.href=t,e.target&&(i.target=e.target+""),e.rel&&(i.rel=e.rel+""),"image"===e.context&&e.crossOrigin&&(i.crossOrigin=e.crossOrigin+""),i}function d(t){return t?e=>new Promise((n,r)=>{t.readFile(e,(t,e)=>{t?r(t):n(e)})}):h}async function h(){Object(r.o)("No file system access.")}function p(t){return t?async function(e,n){const i=Object(r.p)({},this.options.http,n),o=n&&n.response,a=await t(e,i);return a.ok?Object(r.E)(a[o])?a[o]():a.text():Object(r.o)(a.status+""+a.statusText)}:g}async function g(){Object(r.o)("No HTTP fetch method available.")}const m=t=>!(Number.isNaN(+t)||t instanceof Date),b={boolean:r.bb,integer:r.db,number:r.db,date:r.cb,string:r.fb,unknown:r.y},y=[t=>"true"===t||"false"===t||!0===t||!1===t,t=>m(t)&&Number.isInteger(+t),m,t=>!Number.isNaN(Date.parse(t))],v=["boolean","integer","number","date"];function x(t,e){if(!t||!t.length)return"unknown";const n=t.length,r=y.length,i=y.map((t,e)=>e+1);for(let a,s,u=0,l=0;u<n;++u)for(s=e?t[u][e]:t[u],a=0;a<r;++a)if(i[a]&&(null!=(o=s)&&o==o)&&!y[a](s)&&(i[a]=0,++l,l===y.length))return"string";var o;return v[i.reduce((t,e)=>0===t?e:t,0)-1]}function _(t,e){return e.reduce((e,n)=>(e[n]=x(t,n),e),{})}function O(t){const e=function(e,n){const i={delimiter:t};return w(e,n?Object(r.p)(n,i):i)};return e.responseType="text",e}function w(t,e){return e.header&&(t=e.header.map(r.ab).join(e.delimiter)+"\n"+t),Object(i.a)(e.delimiter).parse(t+"")}function j(e,n){const i=n&&n.property?Object(r.u)(n.property):r.y;return!Object(r.G)(e)||(o=e,"function"==typeof t&&Object(r.E)(t.isBuffer)&&t.isBuffer(o))?i(JSON.parse(e)):function(t,e){return e&&e.copy?JSON.parse(JSON.stringify(t)):t}(i(e),n);var o}w.responseType="text",j.responseType="json";const k={interior:(t,e)=>t!==e,exterior:(t,e)=>t===e};function E(t,e){let n,i,a,s;return t=j(t,e),e&&e.feature?(n=o.a,a=e.feature):e&&e.mesh?(n=o.b,a=e.mesh,s=k[e.filter]):Object(r.o)("Missing TopoJSON feature or mesh parameter."),i=(i=t.objects[a])?n(t,i,s):Object(r.o)("Invalid TopoJSON object: "+a),i&&i.features||[i]}E.responseType="json";const A={dsv:w,csv:O(","),tsv:O("\t"),json:j,topojson:E};function D(t,e){return arguments.length>1?(A[t]=e,this):Object(r.w)(A,t)?A[t]:null}function M(t){const e=D(t);return e&&e.responseType||"text"}function S(t,e,n,i){const o=D((e=e||{}).type||"json");return o||Object(r.o)("Unknown data format type: "+e.type),t=o(t,e),e.parse&&function(t,e,n,r){if(!t.length)return;const i=Object(a.e)();n=n||i.timeParse,r=r||i.utcParse;let o,s,u,l,c,f,d=t.columns||Object.keys(t[0]);"auto"===e&&(e=_(t,d));d=Object.keys(e);const h=d.map(t=>{const i=e[t];let o,a;if(i&&(i.startsWith("date:")||i.startsWith("utc:"))){o=i.split(/:(.+)?/,2),a=o[1],("'"===a[0]&&"'"===a[a.length-1]||'"'===a[0]&&'"'===a[a.length-1])&&(a=a.slice(1,-1));return("utc"===o[0]?r:n)(a)}if(!b[i])throw Error("Illegal format pattern: "+t+":"+i);return b[i]});for(u=0,c=t.length,f=d.length;u<c;++u)for(o=t[u],l=0;l<f;++l)s=d[l],o[s]=h[l](o[s])}(t,e.parse,n,i),Object(r.w)(t,"columns")&&delete t.columns,t}const C=function(t,e){return n=>({options:n||{},sanitize:f,load:c,fileAccess:!!e,file:d(e),http:p(t)})}("undefined"!=typeof fetch&&fetch,null)}).call(this,n(56).Buffer)},function(t,e,n){"use strict";function r(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}n.d(e,"b",(function(){return r})),e.a=function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}},,function(t,e,n){const{MAX_SAFE_COMPONENT_LENGTH:r}=n(29),i=n(30),o=(e=t.exports={}).re=[],a=e.src=[],s=e.t={};let u=0;const l=(t,e,n)=>{const r=u++;i(r,e),s[t]=r,a[r]=e,o[r]=new RegExp(e,n?"g":void 0)};l("NUMERICIDENTIFIER","0|[1-9]\\d*"),l("NUMERICIDENTIFIERLOOSE","[0-9]+"),l("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),l("MAINVERSION",`(${a[s.NUMERICIDENTIFIER]})\\.(${a[s.NUMERICIDENTIFIER]})\\.(${a[s.NUMERICIDENTIFIER]})`),l("MAINVERSIONLOOSE",`(${a[s.NUMERICIDENTIFIERLOOSE]})\\.(${a[s.NUMERICIDENTIFIERLOOSE]})\\.(${a[s.NUMERICIDENTIFIERLOOSE]})`),l("PRERELEASEIDENTIFIER",`(?:${a[s.NUMERICIDENTIFIER]}|${a[s.NONNUMERICIDENTIFIER]})`),l("PRERELEASEIDENTIFIERLOOSE",`(?:${a[s.NUMERICIDENTIFIERLOOSE]}|${a[s.NONNUMERICIDENTIFIER]})`),l("PRERELEASE",`(?:-(${a[s.PRERELEASEIDENTIFIER]}(?:\\.${a[s.PRERELEASEIDENTIFIER]})*))`),l("PRERELEASELOOSE",`(?:-?(${a[s.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${a[s.PRERELEASEIDENTIFIERLOOSE]})*))`),l("BUILDIDENTIFIER","[0-9A-Za-z-]+"),l("BUILD",`(?:\\+(${a[s.BUILDIDENTIFIER]}(?:\\.${a[s.BUILDIDENTIFIER]})*))`),l("FULLPLAIN",`v?${a[s.MAINVERSION]}${a[s.PRERELEASE]}?${a[s.BUILD]}?`),l("FULL",`^${a[s.FULLPLAIN]}$`),l("LOOSEPLAIN",`[v=\\s]*${a[s.MAINVERSIONLOOSE]}${a[s.PRERELEASELOOSE]}?${a[s.BUILD]}?`),l("LOOSE",`^${a[s.LOOSEPLAIN]}$`),l("GTLT","((?:<|>)?=?)"),l("XRANGEIDENTIFIERLOOSE",a[s.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*"),l("XRANGEIDENTIFIER",a[s.NUMERICIDENTIFIER]+"|x|X|\\*"),l("XRANGEPLAIN",`[v=\\s]*(${a[s.XRANGEIDENTIFIER]})(?:\\.(${a[s.XRANGEIDENTIFIER]})(?:\\.(${a[s.XRANGEIDENTIFIER]})(?:${a[s.PRERELEASE]})?${a[s.BUILD]}?)?)?`),l("XRANGEPLAINLOOSE",`[v=\\s]*(${a[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[s.XRANGEIDENTIFIERLOOSE]})(?:${a[s.PRERELEASELOOSE]})?${a[s.BUILD]}?)?)?`),l("XRANGE",`^${a[s.GTLT]}\\s*${a[s.XRANGEPLAIN]}$`),l("XRANGELOOSE",`^${a[s.GTLT]}\\s*${a[s.XRANGEPLAINLOOSE]}$`),l("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),l("COERCERTL",a[s.COERCE],!0),l("LONETILDE","(?:~>?)"),l("TILDETRIM",`(\\s*)${a[s.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",l("TILDE",`^${a[s.LONETILDE]}${a[s.XRANGEPLAIN]}$`),l("TILDELOOSE",`^${a[s.LONETILDE]}${a[s.XRANGEPLAINLOOSE]}$`),l("LONECARET","(?:\\^)"),l("CARETTRIM",`(\\s*)${a[s.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",l("CARET",`^${a[s.LONECARET]}${a[s.XRANGEPLAIN]}$`),l("CARETLOOSE",`^${a[s.LONECARET]}${a[s.XRANGEPLAINLOOSE]}$`),l("COMPARATORLOOSE",`^${a[s.GTLT]}\\s*(${a[s.LOOSEPLAIN]})$|^$`),l("COMPARATOR",`^${a[s.GTLT]}\\s*(${a[s.FULLPLAIN]})$|^$`),l("COMPARATORTRIM",`(\\s*)${a[s.GTLT]}\\s*(${a[s.LOOSEPLAIN]}|${a[s.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",l("HYPHENRANGE",`^\\s*(${a[s.XRANGEPLAIN]})\\s+-\\s+(${a[s.XRANGEPLAIN]})\\s*$`),l("HYPHENRANGELOOSE",`^\\s*(${a[s.XRANGEPLAINLOOSE]})\\s+-\\s+(${a[s.XRANGEPLAINLOOSE]})\\s*$`),l("STAR","(<|>)?=?\\s*\\*"),l("GTE0","^\\s*>=\\s*0.0.0\\s*$"),l("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")},function(t,e,n){const{MAX_LENGTH:r}=n(29),{re:i,t:o}=n(19),a=n(8);t.exports=(t,e)=>{if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),t instanceof a)return t;if("string"!=typeof t)return null;if(t.length>r)return null;if(!(e.loose?i[o.LOOSE]:i[o.FULL]).test(t))return null;try{return new a(t,e)}catch(t){return null}}},function(t,e,n){"use strict";e.a=function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}},function(t,e,n){"use strict";t.exports=function(t,e){e||(e={}),"function"==typeof e&&(e={cmp:e});var n,r="boolean"==typeof e.cycles&&e.cycles,i=e.cmp&&(n=e.cmp,function(t){return function(e,r){var i={key:e,value:t[e]},o={key:r,value:t[r]};return n(i,o)}}),o=[];return function t(e){if(e&&e.toJSON&&"function"==typeof e.toJSON&&(e=e.toJSON()),void 0!==e){if("number"==typeof e)return isFinite(e)?""+e:"null";if("object"!=typeof e)return JSON.stringify(e);var n,a;if(Array.isArray(e)){for(a="[",n=0;n<e.length;n++)n&&(a+=","),a+=t(e[n])||"null";return a+"]"}if(null===e)return"null";if(-1!==o.indexOf(e)){if(r)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var s=o.push(e)-1,u=Object.keys(e).sort(i&&i(e));for(a="",n=0;n<u.length;n++){var l=u[n],c=t(e[l]);c&&(a&&(a+=","),a+=JSON.stringify(l)+":"+c)}return o.splice(s,1),"{"+a+"}"}}(t)}},function(t,e,n){"use strict";var r=n(3),i=n(4),o=Object(r.a)(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*i.c)/i.a,t=>t.getDate()-1);e.a=o;o.range},function(t,e,n){"use strict";var r=n(3),i=n(4),o=Object(r.a)((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/i.a}),(function(t){return t.getUTCDate()-1}));e.a=o;o.range},function(t,e,n){"use strict";var r=n(3),i=Object(r.a)((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));i.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Object(r.a)((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,n){e.setFullYear(e.getFullYear()+n*t)})):null},e.a=i;i.range},function(t,e,n){"use strict";var r=n(3),i=Object(r.a)((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));i.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Object(r.a)((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null},e.a=i;i.range},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function i(t){if(!(e=r.exec(t)))throw new Error("invalid format: "+t);var e;return new o({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function o(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}i.prototype=o.prototype,o.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type}},,function(t,e){const n=Number.MAX_SAFE_INTEGER||9007199254740991;t.exports={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:n,MAX_SAFE_COMPONENT_LENGTH:16}},function(t,e,n){(function(e){const n="object"==typeof e&&e.env&&e.env.NODE_DEBUG&&/\bsemver\b/i.test(e.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};t.exports=n}).call(this,n(68))},function(t,e,n){const r=n(11);t.exports=(t,e,n)=>r(t,e,n)>0},function(t,e,n){const r=Symbol("SemVer ANY");class i{static get ANY(){return r}constructor(t,e){if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),t instanceof i){if(t.loose===!!e.loose)return t;t=t.value}u("comparator",t,e),this.options=e,this.loose=!!e.loose,this.parse(t),this.semver===r?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(t){const e=this.options.loose?o[a.COMPARATORLOOSE]:o[a.COMPARATOR],n=t.match(e);if(!n)throw new TypeError("Invalid comparator: "+t);this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new l(n[2],this.options.loose):this.semver=r}toString(){return this.value}test(t){if(u("Comparator.test",t,this.options.loose),this.semver===r||t===r)return!0;if("string"==typeof t)try{t=new l(t,this.options)}catch(t){return!1}return s(t,this.operator,this.semver,this.options)}intersects(t,e){if(!(t instanceof i))throw new TypeError("a Comparator is required");if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),""===this.operator)return""===this.value||new c(t.value,e).test(this.value);if(""===t.operator)return""===t.value||new c(this.value,e).test(t.semver);const n=!(">="!==this.operator&&">"!==this.operator||">="!==t.operator&&">"!==t.operator),r=!("<="!==this.operator&&"<"!==this.operator||"<="!==t.operator&&"<"!==t.operator),o=this.semver.version===t.semver.version,a=!(">="!==this.operator&&"<="!==this.operator||">="!==t.operator&&"<="!==t.operator),u=s(this.semver,"<",t.semver,e)&&(">="===this.operator||">"===this.operator)&&("<="===t.operator||"<"===t.operator),l=s(this.semver,">",t.semver,e)&&("<="===this.operator||"<"===this.operator)&&(">="===t.operator||">"===t.operator);return n||r||o&&a||u||l}}t.exports=i;const{re:o,t:a}=n(19),s=n(55),u=n(30),l=n(8),c=n(12)},function(t,e,n){const r=n(12);t.exports=(t,e,n)=>{try{e=new r(e,n)}catch(t){return!1}return e.test(t)}},function(t,e,n){"use strict";var r=/("(?:[^\\"]|\\.)*")|[:,]/g;t.exports=function(t,e){var n,i,o;return e=e||{},n=JSON.stringify([1],void 0,void 0===e.indent?2:e.indent).slice(2,-3),i=""===n?1/0:void 0===e.maxLength?80:e.maxLength,o=e.replacer,function t(e,a,s){var u,l,c,f,d,h,p,g,m,b,y,v;if(e&&"function"==typeof e.toJSON&&(e=e.toJSON()),void 0===(y=JSON.stringify(e,o)))return y;if(p=i-a.length-s,y.length<=p&&(m=y.replace(r,(function(t,e){return e||t+" "}))).length<=p)return m;if(null!=o&&(e=JSON.parse(y),o=void 0),"object"==typeof e&&null!==e){if(g=a+n,c=[],l=0,Array.isArray(e))for(b="[",u="]",p=e.length;l<p;l++)c.push(t(e[l],g,l===p-1?0:1)||"null");else for(b="{",u="}",p=(h=Object.keys(e)).length;l<p;l++)f=h[l],d=JSON.stringify(f)+": ",void 0!==(v=t(e[f],g,d.length+(l===p-1?0:1)))&&c.push(d+v);if(c.length>0)return[b,n+c.join(",\n"+g),u].join("\n"+a)}return y}(t,"",0)}},function(t,e,n){"use strict";var r=n(21);e.a=function(t){let e=t,n=t;function i(t,e,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){const o=r+i>>>1;n(t[o],e)<0?r=o+1:i=o}return r}return 1===t.length&&(e=(e,n)=>t(e)-n,n=function(t){return(e,n)=>Object(r.a)(t(e),n)}(t)),{left:i,center:function(t,n,r,o){null==r&&(r=0),null==o&&(o=t.length);const a=i(t,n,r,o-1);return a>r&&e(t[a-1],n)>-e(t[a],n)?a-1:a},right:function(t,e,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){const o=r+i>>>1;n(t[o],e)>0?i=o:r=o+1}return r}}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return a})),n.d(e,"d",(function(){return s}));var r,i,o,a,s,u,l=n(47);u={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"]},r=Object(l.a)(u),i=r.format,o=r.parse,a=r.utcFormat,s=r.utcParse},,,function(t,e){const n=/^[0-9]+$/,r=(t,e)=>{const r=n.test(t),i=n.test(e);return r&&i&&(t=+t,e=+e),t===e?0:r&&!i?-1:i&&!r?1:t<e?-1:1};t.exports={compareIdentifiers:r,rcompareIdentifiers:(t,e)=>r(e,t)}},function(t,e,n){const r=n(11);t.exports=(t,e,n)=>0===r(t,e,n)},function(t,e,n){const r=n(8);t.exports=(t,e,n)=>{const i=new r(t,n),o=new r(e,n);return i.compare(o)||i.compareBuild(o)}},function(t,e,n){const r=n(11);t.exports=(t,e,n)=>r(t,e,n)<0},function(t,e,n){const r=n(11);t.exports=(t,e,n)=>r(t,e,n)>=0},function(t,e,n){const r=n(11);t.exports=(t,e,n)=>r(t,e,n)<=0},function(t,e,n){const r=n(8),i=n(32),{ANY:o}=i,a=n(12),s=n(33),u=n(31),l=n(42),c=n(44),f=n(43);t.exports=(t,e,n,d)=>{let h,p,g,m,b;switch(t=new r(t,d),e=new a(e,d),n){case">":h=u,p=c,g=l,m=">",b=">=";break;case"<":h=l,p=f,g=u,m="<",b="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(s(t,e,d))return!1;for(let n=0;n<e.set.length;++n){const r=e.set[n];let a=null,s=null;if(r.forEach(t=>{t.semver===o&&(t=new i(">=0.0.0")),a=a||t,s=s||t,h(t.semver,a.semver,d)?a=t:g(t.semver,s.semver,d)&&(s=t)}),a.operator===m||a.operator===b)return!1;if((!s.operator||s.operator===m)&&p(t,s.semver))return!1;if(s.operator===b&&g(t,s.semver))return!1}return!0}},function(t,e,n){const r=n(19);t.exports={re:r.re,src:r.src,tokens:r.t,SEMVER_SPEC_VERSION:n(29).SEMVER_SPEC_VERSION,SemVer:n(8),compareIdentifiers:n(39).compareIdentifiers,rcompareIdentifiers:n(39).rcompareIdentifiers,parse:n(20),valid:n(69),clean:n(70),inc:n(71),diff:n(72),major:n(73),minor:n(74),patch:n(75),prerelease:n(76),compare:n(11),rcompare:n(77),compareLoose:n(78),compareBuild:n(41),sort:n(79),rsort:n(80),gt:n(31),lt:n(42),eq:n(40),neq:n(54),gte:n(43),lte:n(44),cmp:n(55),coerce:n(81),Comparator:n(32),Range:n(12),satisfies:n(33),toComparators:n(82),maxSatisfying:n(83),minSatisfying:n(84),minVersion:n(85),validRange:n(86),outside:n(45),gtr:n(87),ltr:n(88),intersects:n(89),simplifyRange:n(90),subset:n(91)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var r=n(14),i=n(24),o=n(13),a=n(23),s=n(25),u=n(26);function l(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function c(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function f(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function d(t){var e=t.dateTime,n=t.date,s=t.time,u=t.periods,d=t.days,p=t.shortDays,g=t.months,m=t.shortMonths,b=v(u),y=x(u),Z=v(d),yt=x(d),St=v(p),Ct=x(p),Ft=v(g),zt=x(g),Tt=v(m),$t=x(m),Nt={a:function(t){return p[t.getDay()]},A:function(t){return d[t.getDay()]},b:function(t){return m[t.getMonth()]},B:function(t){return g[t.getMonth()]},c:null,d:I,e:I,f:H,g:rt,G:ot,H:U,I:q,j:W,L:Y,m:G,M:V,p:function(t){return u[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:Dt,s:Mt,S:X,u:J,U:K,V:Q,w:tt,W:et,x:null,X:null,y:nt,Y:it,Z:at,"%":At},Rt={a:function(t){return p[t.getUTCDay()]},A:function(t){return d[t.getUTCDay()]},b:function(t){return m[t.getUTCMonth()]},B:function(t){return g[t.getUTCMonth()]},c:null,d:st,e:st,f:dt,g:wt,G:kt,H:ut,I:lt,j:ct,L:ft,m:ht,M:pt,p:function(t){return u[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:Dt,s:Mt,S:gt,u:mt,U:bt,V:vt,w:xt,W:_t,x:null,X:null,y:Ot,Y:jt,Z:Et,"%":At},Pt={a:function(t,e,n){var r=St.exec(e.slice(n));return r?(t.w=Ct.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(t,e,n){var r=Z.exec(e.slice(n));return r?(t.w=yt.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(t,e,n){var r=Tt.exec(e.slice(n));return r?(t.m=$t.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(t,e,n){var r=Ft.exec(e.slice(n));return r?(t.m=zt.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(t,n,r){return It(t,e,n,r)},d:C,e:C,f:R,g:A,G:E,H:z,I:z,j:F,L:N,m:S,M:T,p:function(t,e,n){var r=b.exec(e.slice(n));return r?(t.p=y.get(r[0].toLowerCase()),n+r[0].length):-1},q:M,Q:B,s:L,S:$,u:O,U:w,V:j,w:_,W:k,x:function(t,e,r){return It(t,n,e,r)},X:function(t,e,n){return It(t,s,e,n)},y:A,Y:E,Z:D,"%":P};function Bt(t,e){return function(n){var r,i,o,a=[],s=-1,u=0,l=t.length;for(n instanceof Date||(n=new Date(+n));++s<l;)37===t.charCodeAt(s)&&(a.push(t.slice(u,s)),null!=(i=h[r=t.charAt(++s)])?r=t.charAt(++s):i="e"===r?" ":"0",(o=e[r])&&(r=o(n,i)),a.push(r),u=s+1);return a.push(t.slice(u,s)),a.join("")}}function Lt(t,e){return function(n){var s,u,d=f(1900,void 0,1);if(It(d,t,n+="",0)!=n.length)return null;if("Q"in d)return new Date(d.Q);if("s"in d)return new Date(1e3*d.s+("L"in d?d.L:0));if(e&&!("Z"in d)&&(d.Z=0),"p"in d&&(d.H=d.H%12+12*d.p),void 0===d.m&&(d.m="q"in d?d.q:0),"V"in d){if(d.V<1||d.V>53)return null;"w"in d||(d.w=1),"Z"in d?(u=(s=c(f(d.y,0,1))).getUTCDay(),s=u>4||0===u?r.a.ceil(s):Object(r.a)(s),s=i.a.offset(s,7*(d.V-1)),d.y=s.getUTCFullYear(),d.m=s.getUTCMonth(),d.d=s.getUTCDate()+(d.w+6)%7):(u=(s=l(f(d.y,0,1))).getDay(),s=u>4||0===u?o.a.ceil(s):Object(o.a)(s),s=a.a.offset(s,7*(d.V-1)),d.y=s.getFullYear(),d.m=s.getMonth(),d.d=s.getDate()+(d.w+6)%7)}else("W"in d||"U"in d)&&("w"in d||(d.w="u"in d?d.u%7:"W"in d?1:0),u="Z"in d?c(f(d.y,0,1)).getUTCDay():l(f(d.y,0,1)).getDay(),d.m=0,d.d="W"in d?(d.w+6)%7+7*d.W-(u+5)%7:d.w+7*d.U-(u+6)%7);return"Z"in d?(d.H+=d.Z/100|0,d.M+=d.Z%100,c(d)):l(d)}}function It(t,e,n,r){for(var i,o,a=0,s=e.length,u=n.length;a<s;){if(r>=u)return-1;if(37===(i=e.charCodeAt(a++))){if(i=e.charAt(a++),!(o=Pt[i in h?e.charAt(a++):i])||(r=o(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return Nt.x=Bt(n,Nt),Nt.X=Bt(s,Nt),Nt.c=Bt(e,Nt),Rt.x=Bt(n,Rt),Rt.X=Bt(s,Rt),Rt.c=Bt(e,Rt),{format:function(t){var e=Bt(t+="",Nt);return e.toString=function(){return t},e},parse:function(t){var e=Lt(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=Bt(t+="",Rt);return e.toString=function(){return t},e},utcParse:function(t){var e=Lt(t+="",!0);return e.toString=function(){return t},e}}}var h={"-":"",_:" ",0:"0"},p=/^\s*\d+/,g=/^%/,m=/[\\^$*+?|[\]().{}]/g;function b(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(e)+i:i)}function y(t){return t.replace(m,"\\$&")}function v(t){return new RegExp("^(?:"+t.map(y).join("|")+")","i")}function x(t){return new Map(t.map((t,e)=>[t.toLowerCase(),e]))}function _(t,e,n){var r=p.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function O(t,e,n){var r=p.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function w(t,e,n){var r=p.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function j(t,e,n){var r=p.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function k(t,e,n){var r=p.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function E(t,e,n){var r=p.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function A(t,e,n){var r=p.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function D(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function M(t,e,n){var r=p.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function S(t,e,n){var r=p.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function C(t,e,n){var r=p.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function F(t,e,n){var r=p.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function z(t,e,n){var r=p.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function T(t,e,n){var r=p.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function $(t,e,n){var r=p.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function N(t,e,n){var r=p.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function R(t,e,n){var r=p.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function P(t,e,n){var r=g.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function B(t,e,n){var r=p.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function L(t,e,n){var r=p.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function I(t,e){return b(t.getDate(),e,2)}function U(t,e){return b(t.getHours(),e,2)}function q(t,e){return b(t.getHours()%12||12,e,2)}function W(t,e){return b(1+a.a.count(Object(s.a)(t),t),e,3)}function Y(t,e){return b(t.getMilliseconds(),e,3)}function H(t,e){return Y(t,e)+"000"}function G(t,e){return b(t.getMonth()+1,e,2)}function V(t,e){return b(t.getMinutes(),e,2)}function X(t,e){return b(t.getSeconds(),e,2)}function J(t){var e=t.getDay();return 0===e?7:e}function K(t,e){return b(o.b.count(Object(s.a)(t)-1,t),e,2)}function Z(t){var e=t.getDay();return e>=4||0===e?Object(o.c)(t):o.c.ceil(t)}function Q(t,e){return t=Z(t),b(o.c.count(Object(s.a)(t),t)+(4===Object(s.a)(t).getDay()),e,2)}function tt(t){return t.getDay()}function et(t,e){return b(o.a.count(Object(s.a)(t)-1,t),e,2)}function nt(t,e){return b(t.getFullYear()%100,e,2)}function rt(t,e){return b((t=Z(t)).getFullYear()%100,e,2)}function it(t,e){return b(t.getFullYear()%1e4,e,4)}function ot(t,e){var n=t.getDay();return b((t=n>=4||0===n?Object(o.c)(t):o.c.ceil(t)).getFullYear()%1e4,e,4)}function at(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+b(e/60|0,"0",2)+b(e%60,"0",2)}function st(t,e){return b(t.getUTCDate(),e,2)}function ut(t,e){return b(t.getUTCHours(),e,2)}function lt(t,e){return b(t.getUTCHours()%12||12,e,2)}function ct(t,e){return b(1+i.a.count(Object(u.a)(t),t),e,3)}function ft(t,e){return b(t.getUTCMilliseconds(),e,3)}function dt(t,e){return ft(t,e)+"000"}function ht(t,e){return b(t.getUTCMonth()+1,e,2)}function pt(t,e){return b(t.getUTCMinutes(),e,2)}function gt(t,e){return b(t.getUTCSeconds(),e,2)}function mt(t){var e=t.getUTCDay();return 0===e?7:e}function bt(t,e){return b(r.b.count(Object(u.a)(t)-1,t),e,2)}function yt(t){var e=t.getUTCDay();return e>=4||0===e?Object(r.c)(t):r.c.ceil(t)}function vt(t,e){return t=yt(t),b(r.c.count(Object(u.a)(t),t)+(4===Object(u.a)(t).getUTCDay()),e,2)}function xt(t){return t.getUTCDay()}function _t(t,e){return b(r.a.count(Object(u.a)(t)-1,t),e,2)}function Ot(t,e){return b(t.getUTCFullYear()%100,e,2)}function wt(t,e){return b((t=yt(t)).getUTCFullYear()%100,e,2)}function jt(t,e){return b(t.getUTCFullYear()%1e4,e,4)}function kt(t,e){var n=t.getUTCDay();return b((t=n>=4||0===n?Object(r.c)(t):r.c.ceil(t)).getUTCFullYear()%1e4,e,4)}function Et(){return"+0000"}function At(){return"%"}function Dt(t){return+t}function Mt(t){return Math.floor(+t/1e3)}},function(t,e){function n(t,e){return 0===t?e[0]:e[Math.ceil(e.length*(t/100))-1]}t.exports=function(t,e,r){var i=Array.isArray(t)?t:[t],o=function(t){return t.reduce((function(t,e){return isNaN(Number(e))?t.push(function(t){return'Expect percentile to be a number but given "'+t+'" and its type is "'+typeof t+'".'}(e)):e<0?t.push(function(t){return'Expect percentile to be >= 0 but given "'+t+'" and its type is "'+typeof t+'".'}(e)):e>100&&t.push(function(t){return'Expect percentile to be <= 100 but given "'+t+'" and its type is "'+typeof t+'".'}(e)),t}),[])}(i);if(o.length)throw new Error(o.join(" "));return e=e.slice().sort((function(t,e){return r&&(t=r(t),e=r(e)),(t=Number.isNaN(t)?Number.NEGATIVE_INFINITY:t)>(e=Number.isNaN(e)?Number.NEGATIVE_INFINITY:e)?1:t<e?-1:0})),1===i.length?n(i[0],e):i.map((function(t){return n(t,e)}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return l}));var r=function(t){return t},i=function(t){if(null==t)return r;var e,n,i=t.scale[0],o=t.scale[1],a=t.translate[0],s=t.translate[1];return function(t,r){r||(e=n=0);var u=2,l=t.length,c=new Array(l);for(c[0]=(e+=t[0])*i+a,c[1]=(n+=t[1])*o+s;u<l;)c[u]=t[u],++u;return c}},o=function(t,e){return"string"==typeof e&&(e=t.objects[e]),"GeometryCollection"===e.type?{type:"FeatureCollection",features:e.geometries.map((function(e){return a(t,e)}))}:a(t,e)};function a(t,e){var n=e.id,r=e.bbox,i=null==e.properties?{}:e.properties,o=s(t,e);return null==n&&null==r?{type:"Feature",properties:i,geometry:o}:null==r?{type:"Feature",id:n,properties:i,geometry:o}:{type:"Feature",id:n,bbox:r,properties:i,geometry:o}}function s(t,e){var n=i(t.transform),r=t.arcs;function o(t,e){e.length&&e.pop();for(var i=r[t<0?~t:t],o=0,a=i.length;o<a;++o)e.push(n(i[o],o));t<0&&function(t,e){for(var n,r=t.length,i=r-e;i<--r;)n=t[i],t[i++]=t[r],t[r]=n}(e,a)}function a(t){return n(t)}function s(t){for(var e=[],n=0,r=t.length;n<r;++n)o(t[n],e);return e.length<2&&e.push(e[0]),e}function u(t){for(var e=s(t);e.length<4;)e.push(e[0]);return e}function l(t){return t.map(u)}return function t(e){var n,r=e.type;switch(r){case"GeometryCollection":return{type:r,geometries:e.geometries.map(t)};case"Point":n=a(e.coordinates);break;case"MultiPoint":n=e.coordinates.map(a);break;case"LineString":n=s(e.arcs);break;case"MultiLineString":n=e.arcs.map(s);break;case"Polygon":n=l(e.arcs);break;case"MultiPolygon":n=e.arcs.map(l);break;default:return null}return{type:r,coordinates:n}}(e)}var u=function(t,e){var n={},r={},i={},o=[],a=-1;function s(t,e){for(var r in t){var i=t[r];delete e[i.start],delete i.start,delete i.end,i.forEach((function(t){n[t<0?~t:t]=1})),o.push(i)}}return e.forEach((function(n,r){var i,o=t.arcs[n<0?~n:n];o.length<3&&!o[1][0]&&!o[1][1]&&(i=e[++a],e[a]=n,e[r]=i)})),e.forEach((function(e){var n,o,a=function(e){var n,r=t.arcs[e<0?~e:e],i=r[0];t.transform?(n=[0,0],r.forEach((function(t){n[0]+=t[0],n[1]+=t[1]}))):n=r[r.length-1];return e<0?[n,i]:[i,n]}(e),s=a[0],u=a[1];if(n=i[s])if(delete i[n.end],n.push(e),n.end=u,o=r[u]){delete r[o.start];var l=o===n?n:n.concat(o);r[l.start=n.start]=i[l.end=o.end]=l}else r[n.start]=i[n.end]=n;else if(n=r[u])if(delete r[n.start],n.unshift(e),n.start=s,o=i[s]){delete i[o.end];var c=o===n?n:o.concat(n);r[c.start=o.start]=i[c.end=n.end]=c}else r[n.start]=i[n.end]=n;else r[(n=[e]).start=s]=i[n.end=u]=n})),s(i,r),s(r,i),e.forEach((function(t){n[t<0?~t:t]||o.push([t])})),o},l=function(t){return s(t,c.apply(this,arguments))};function c(t,e,n){var r,i,o;if(arguments.length>1)r=f(t,e,n);else for(i=0,r=new Array(o=t.arcs.length);i<o;++i)r[i]=i;return{type:"MultiLineString",arcs:u(t,r)}}function f(t,e,n){var r,i=[],o=[];function a(t){var e=t<0?~t:t;(o[e]||(o[e]=[])).push({i:t,g:r})}function s(t){t.forEach(a)}function u(t){t.forEach(s)}return function t(e){switch(r=e,e.type){case"GeometryCollection":e.geometries.forEach(t);break;case"LineString":s(e.arcs);break;case"MultiLineString":case"Polygon":u(e.arcs);break;case"MultiPolygon":!function(t){t.forEach(u)}(e.arcs)}}(e),o.forEach(null==n?function(t){i.push(t[0].i)}:function(t){n(t[0].g,t[t.length-1].g)&&i.push(t[0].i)}),i}},function(t,e,n){"use strict";var r,i=n(15),o=n(27),a=n(17),s=function(t,e){var n=Object(a.b)(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},u={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:a.a,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>s(100*t,e),r:s,s:function(t,e){var n=Object(a.b)(t,e);if(!n)return t+"";var i=n[0],o=n[1],s=o-(r=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,u=i.length;return s===u?i:s>u?i+new Array(s-u+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+Object(a.b)(t,Math.max(0,e+s-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)},l=function(t){return t},c=Array.prototype.map,f=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];e.a=function(t){var e,n,a=void 0===t.grouping||void 0===t.thousands?l:(e=c.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,o=[],a=0,s=e[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),o.push(t.substring(i-=s,i+s)),!((u+=s+1)>r));)s=e[a=(a+1)%e.length];return o.reverse().join(n)}),s=void 0===t.currency?"":t.currency[0]+"",d=void 0===t.currency?"":t.currency[1]+"",h=void 0===t.decimal?".":t.decimal+"",p=void 0===t.numerals?l:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(c.call(t.numerals,String)),g=void 0===t.percent?"%":t.percent+"",m=void 0===t.minus?"−":t.minus+"",b=void 0===t.nan?"NaN":t.nan+"";function y(t){var e=(t=Object(o.a)(t)).fill,n=t.align,i=t.sign,l=t.symbol,c=t.zero,y=t.width,v=t.comma,x=t.precision,_=t.trim,O=t.type;"n"===O?(v=!0,O="g"):u[O]||(void 0===x&&(x=12),_=!0,O="g"),(c||"0"===e&&"="===n)&&(c=!0,e="0",n="=");var w="$"===l?s:"#"===l&&/[boxX]/.test(O)?"0"+O.toLowerCase():"",j="$"===l?d:/[%p]/.test(O)?g:"",k=u[O],E=/[defgprs%]/.test(O);function A(t){var o,s,u,l=w,d=j;if("c"===O)d=k(t)+d,t="";else{var g=(t=+t)<0||1/t<0;if(t=isNaN(t)?b:k(Math.abs(t),x),_&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),g&&0==+t&&"+"!==i&&(g=!1),l=(g?"("===i?i:m:"-"===i||"("===i?"":i)+l,d=("s"===O?f[8+r/3]:"")+d+(g&&"("===i?")":""),E)for(o=-1,s=t.length;++o<s;)if(48>(u=t.charCodeAt(o))||u>57){d=(46===u?h+t.slice(o+1):t.slice(o))+d,t=t.slice(0,o);break}}v&&!c&&(t=a(t,1/0));var A=l.length+t.length+d.length,D=A<y?new Array(y-A+1).join(e):"";switch(v&&c&&(t=a(D+t,D.length?y-d.length:1/0),D=""),n){case"<":t=l+t+d+D;break;case"=":t=l+D+t+d;break;case"^":t=D.slice(0,A=D.length>>1)+l+t+d+D.slice(A);break;default:t=D+l+t+d}return p(t)}return x=void 0===x?6:/[gprs]/.test(O)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x)),A.toString=function(){return t+""},A}return{format:y,formatPrefix:function(t,e){var n=y(((t=Object(o.a)(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(Object(i.a)(e)/3))),a=Math.pow(10,-r),s=f[8+r/3];return function(t){return n(a*t)+s}}}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return s}));var r=Math.sqrt(50),i=Math.sqrt(10),o=Math.sqrt(2);function a(t,e,n){var a=(e-t)/Math.max(0,n),s=Math.floor(Math.log(a)/Math.LN10),u=a/Math.pow(10,s);return s>=0?(u>=r?10:u>=i?5:u>=o?2:1)*Math.pow(10,s):-Math.pow(10,-s)/(u>=r?10:u>=i?5:u>=o?2:1)}function s(t,e,n){var a=Math.abs(e-t)/Math.max(0,n),s=Math.pow(10,Math.floor(Math.log(a)/Math.LN10)),u=a/s;return u>=r?s*=10:u>=i?s*=5:u>=o&&(s*=2),e<t?-s:s}e.a=function(t,e,n){var r,i,o,s,u=-1;if(n=+n,(t=+t)===(e=+e)&&n>0)return[t];if((r=e<t)&&(i=t,t=e,e=i),0===(s=a(t,e,n))||!isFinite(s))return[];if(s>0)for(t=Math.ceil(t/s),e=Math.floor(e/s),o=new Array(i=Math.ceil(e-t+1));++u<i;)o[u]=(t+u)*s;else for(s=-s,t=Math.ceil(t*s),e=Math.floor(e*s),o=new Array(i=Math.ceil(e-t+1));++u<i;)o[u]=(t+u)/s;return r&&o.reverse(),o}},,,function(t,e,n){const r=n(11);t.exports=(t,e,n)=>0!==r(t,e,n)},function(t,e,n){const r=n(40),i=n(54),o=n(31),a=n(43),s=n(42),u=n(44);t.exports=(t,e,n,l)=>{switch(e){case"===":return"object"==typeof t&&(t=t.version),"object"==typeof n&&(n=n.version),t===n;case"!==":return"object"==typeof t&&(t=t.version),"object"==typeof n&&(n=n.version),t!==n;case"":case"=":case"==":return r(t,n,l);case"!=":return i(t,n,l);case">":return o(t,n,l);case">=":return a(t,n,l);case"<":return s(t,n,l);case"<=":return u(t,n,l);default:throw new TypeError("Invalid operator: "+e)}}},function(t,e,n){"use strict";(function(t){
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <http://feross.org>
* @license MIT
*/
var r=n(93),i=n(94),o=n(95);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=u.prototype:(null===t&&(t=new u(e)),t.length=e),t}function u(t,e,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return f(this,t)}return l(this,t,e,n)}function l(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);u.TYPED_ARRAY_SUPPORT?(t=e).__proto__=u.prototype:t=d(t,e);return t}(t,e,n,r):"string"==typeof e?function(t,e,n){"string"==typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|p(e,n),i=(t=s(t,r)).write(e,n);i!==r&&(t=t.slice(0,i));return t}(t,e,n):function(t,e){if(u.isBuffer(e)){var n=0|h(e.length);return 0===(t=s(t,n)).length||e.copy(t,0,0,n),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(r=e.length)!=r?s(t,0):d(t,e);if("Buffer"===e.type&&o(e.data))return d(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t,e){if(c(e),t=s(t,e<0?0:0|h(e)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function d(t,e){var n=e.length<0?0:0|h(e.length);t=s(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function h(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function p(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return L(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return I(t).length;default:if(r)return L(t).length;e=(""+e).toLowerCase(),r=!0}}function g(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return M(this,e,n);case"utf8":case"utf-8":return E(this,e,n);case"ascii":return A(this,e,n);case"latin1":case"binary":return D(this,e,n);case"base64":return k(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function m(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function b(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=u.from(e,r)),u.isBuffer(e))return 0===e.length?-1:y(t,e,n,r,i);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):y(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(t,e,n,r,i){var o,a=1,s=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,n/=2}function l(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var c=-1;for(o=n;o<s;o++)if(l(t,o)===l(e,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===u)return c*a}else-1!==c&&(o-=o-c),c=-1}else for(n+u>s&&(n=s-u),o=n;o>=0;o--){for(var f=!0,d=0;d<u;d++)if(l(t,o+d)!==l(e,d)){f=!1;break}if(f)return o}return-1}function v(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a<r;++a){var s=parseInt(e.substr(2*a,2),16);if(isNaN(s))return a;t[n+a]=s}return a}function x(t,e,n,r){return U(L(e,t.length-n),t,n,r)}function _(t,e,n,r){return U(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function O(t,e,n,r){return _(t,e,n,r)}function w(t,e,n,r){return U(I(e),t,n,r)}function j(t,e,n,r){return U(function(t,e){for(var n,r,i,o=[],a=0;a<t.length&&!((e-=2)<0);++a)n=t.charCodeAt(a),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function k(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function E(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var o,a,s,u,l=t[i],c=null,f=l>239?4:l>223?3:l>191?2:1;if(i+f<=n)switch(f){case 1:l<128&&(c=l);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&l)<<6|63&o)>127&&(c=u);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(u=(15&l)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,f=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=4096));return n}(r)}e.Buffer=u,e.SlowBuffer=function(t){+t!=t&&(t=0);return u.alloc(+t)},e.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=a(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,e,n){return l(null,t,e,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(t,e,n){return function(t,e,n,r){return c(e),e<=0?s(t,e):void 0!==n?"string"==typeof r?s(t,e).fill(n,r):s(t,e).fill(n):s(t,e)}(null,t,e,n)},u.allocUnsafe=function(t){return f(null,t)},u.allocUnsafeSlow=function(t){return f(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,e){if(!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=u.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var a=t[n];if(!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,i),i+=a.length}return r},u.byteLength=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)m(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},u.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?E(this,0,t):g.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},u.prototype.compare=function(t,e,n,r,i){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(e>>>=0),s=Math.min(o,a),l=this.slice(r,i),c=t.slice(e,n),f=0;f<s;++f)if(l[f]!==c[f]){o=l[f],a=c[f];break}return o<a?-1:a<o?1:0},u.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},u.prototype.indexOf=function(t,e,n){return b(this,t,e,n,!0)},u.prototype.lastIndexOf=function(t,e,n){return b(this,t,e,n,!1)},u.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return v(this,t,e,n);case"utf8":case"utf-8":return x(this,t,e,n);case"ascii":return _(this,t,e,n);case"latin1":case"binary":return O(this,t,e,n);case"base64":return w(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function A(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function D(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function M(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=e;o<n;++o)i+=B(t[o]);return i}function S(t,e,n){for(var r=t.slice(e,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function C(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function F(t,e,n,r,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function z(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i<o;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function T(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i<o;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function $(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function N(t,e,n,r,o){return o||$(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function R(t,e,n,r,o){return o||$(t,0,n,8),i.write(t,e,n,r,52,8),n+8}u.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=u.prototype;else{var i=e-t;n=new u(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+t]}return n},u.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||C(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r},u.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||C(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},u.prototype.readUInt8=function(t,e){return e||C(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||C(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||C(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||C(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*e)),r},u.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||C(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||C(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(t,e){e||C(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(t,e){return e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||C(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||C(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||C(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||C(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||F(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o<n&&(i*=256);)this[e+o]=t/i&255;return e+n},u.prototype.writeUIntBE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||F(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},u.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):z(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):z(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):T(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):T(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);F(this,t,e,n,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o<n&&(a*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+n},u.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);F(this,t,e,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+n},u.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):z(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):z(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):T(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):T(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,n){return N(this,t,e,!0,n)},u.prototype.writeFloatBE=function(t,e,n){return N(this,t,e,!1,n)},u.prototype.writeDoubleLE=function(t,e,n){return R(this,t,e,!0,n)},u.prototype.writeDoubleBE=function(t,e,n){return R(this,t,e,!1,n)},u.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var i,o=r-n;if(this===t&&n<e&&e<r)for(i=o-1;i>=0;--i)t[i+e]=this[i+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o},u.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var o;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o<n;++o)this[o]=t;else{var a=u.isBuffer(t)?t:L(new u(t,r).toString()),s=a.length;for(o=0;o<n-e;++o)this[o+e]=a[o%s]}return this};var P=/[^+\/0-9A-Za-z-_]/g;function B(t){return t<16?"0"+t.toString(16):t.toString(16)}function L(t,e){var n;e=e||1/0;for(var r=t.length,i=null,o=[],a=0;a<r;++a){if((n=t.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function I(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(P,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function U(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}}).call(this,n(92))},function(t,e,n){(function(e){var n=function(){"use strict";function t(t,e){return null!=e&&t instanceof e}var n,r,i;try{n=Map}catch(t){n=function(){}}try{r=Set}catch(t){r=function(){}}try{i=Promise}catch(t){i=function(){}}function o(a,u,l,c,f){"object"==typeof u&&(l=u.depth,c=u.prototype,f=u.includeNonEnumerable,u=u.circular);var d=[],h=[],p=void 0!==e;return void 0===u&&(u=!0),void 0===l&&(l=1/0),function a(l,g){if(null===l)return null;if(0===g)return l;var m,b;if("object"!=typeof l)return l;if(t(l,n))m=new n;else if(t(l,r))m=new r;else if(t(l,i))m=new i((function(t,e){l.then((function(e){t(a(e,g-1))}),(function(t){e(a(t,g-1))}))}));else if(o.__isArray(l))m=[];else if(o.__isRegExp(l))m=new RegExp(l.source,s(l)),l.lastIndex&&(m.lastIndex=l.lastIndex);else if(o.__isDate(l))m=new Date(l.getTime());else{if(p&&e.isBuffer(l))return m=e.allocUnsafe?e.allocUnsafe(l.length):new e(l.length),l.copy(m),m;t(l,Error)?m=Object.create(l):void 0===c?(b=Object.getPrototypeOf(l),m=Object.create(b)):(m=Object.create(c),b=c)}if(u){var y=d.indexOf(l);if(-1!=y)return h[y];d.push(l),h.push(m)}for(var v in t(l,n)&&l.forEach((function(t,e){var n=a(e,g-1),r=a(t,g-1);m.set(n,r)})),t(l,r)&&l.forEach((function(t){var e=a(t,g-1);m.add(e)})),l){var x;b&&(x=Object.getOwnPropertyDescriptor(b,v)),x&&null==x.set||(m[v]=a(l[v],g-1))}if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(l);for(v=0;v<_.length;v++){var O=_[v];(!(j=Object.getOwnPropertyDescriptor(l,O))||j.enumerable||f)&&(m[O]=a(l[O],g-1),j.enumerable||Object.defineProperty(m,O,{enumerable:!1}))}}if(f){var w=Object.getOwnPropertyNames(l);for(v=0;v<w.length;v++){var j,k=w[v];(j=Object.getOwnPropertyDescriptor(l,k))&&j.enumerable||(m[k]=a(l[k],g-1),Object.defineProperty(m,k,{enumerable:!1}))}}return m}(a,l)}function a(t){return Object.prototype.toString.call(t)}function s(t){var e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),e}return o.clonePrototype=function(t){if(null===t)return null;var e=function(){};return e.prototype=t,new e},o.__objToStr=a,o.__isDate=function(t){return"object"==typeof t&&"[object Date]"===a(t)},o.__isArray=function(t){return"object"==typeof t&&"[object Array]"===a(t)},o.__isRegExp=function(t){return"object"==typeof t&&"[object RegExp]"===a(t)},o.__getRegExpFlags=s,o}();t.exports&&(t.exports=n)}).call(this,n(56).Buffer)},function(t,e,n){"use strict";t.exports=function t(e,n){if(e===n)return!0;if(e&&n&&"object"==typeof e&&"object"==typeof n){if(e.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(e)){if((r=e.length)!=n.length)return!1;for(i=r;0!=i--;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if((r=(o=Object.keys(e)).length)!==Object.keys(n).length)return!1;for(i=r;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;0!=i--;){var a=o[i];if(!t(e[a],n[a]))return!1}return!0}return e!=e&&n!=n}},function(t,e,n){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=function(t,e){var n=t[1]||"",r=t[3];if(!r)return n;if(e&&"function"==typeof btoa){var i=(a=r,s=btoa(unescape(encodeURIComponent(JSON.stringify(a)))),u="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(s),"/*# ".concat(u," */")),o=r.sources.map((function(t){return"/*# sourceURL=".concat(r.sourceRoot||"").concat(t," */")}));return[n].concat(o).concat([i]).join("\n")}var a,s,u;return[n].join("\n")}(e,t);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,r){"string"==typeof t&&(t=[[null,t,""]]);var i={};if(r)for(var o=0;o<this.length;o++){var a=this[o][0];null!=a&&(i[a]=!0)}for(var s=0;s<t.length;s++){var u=[].concat(t[s]);r&&i[u[0]]||(n&&(u[2]?u[2]="".concat(n," and ").concat(u[2]):u[2]=n),e.push(u))}},e}},function(t,e,n){"use strict";var r=n(3),i=Object(r.a)((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()}));e.a=i;i.range},function(t,e,n){"use strict";var r=n(3),i=n(4),o=Object(r.a)((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+e*i.d)}),(function(t,e){return(e-t)/i.d}),(function(t){return t.getUTCSeconds()}));e.a=o;o.range},function(t,e,n){"use strict";var r=n(3),i=Object(r.a)((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?Object(r.a)((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,n){e.setTime(+e+n*t)}),(function(e,n){return(n-e)/t})):i:null},e.a=i;i.range},function(t,e,n){"use strict";var r=n(3),i=Object(r.a)((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()}));e.a=i;i.range},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o}));var r,i,o,a,s=n(50);a={thousands:",",grouping:[3],currency:["$",""]},r=Object(s.a)(a),i=r.format,o=r.formatPrefix},,,,function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var u,l=[],c=!1,f=-1;function d(){c&&u&&(c=!1,u.length?l=u.concat(l):f=-1,l.length&&h())}function h(){if(!c){var t=s(d);c=!0;for(var e=l.length;e;){for(u=l,l=[];++f<e;)u&&u[f].run();f=-1,e=l.length}u=null,c=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function g(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new p(t,e)),1!==l.length||c||s(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,n){const r=n(20);t.exports=(t,e)=>{const n=r(t,e);return n?n.version:null}},function(t,e,n){const r=n(20);t.exports=(t,e)=>{const n=r(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null}},function(t,e,n){const r=n(8);t.exports=(t,e,n,i)=>{"string"==typeof n&&(i=n,n=void 0);try{return new r(t,n).inc(e,i).version}catch(t){return null}}},function(t,e,n){const r=n(20),i=n(40);t.exports=(t,e)=>{if(i(t,e))return null;{const n=r(t),i=r(e),o=n.prerelease.length||i.prerelease.length,a=o?"pre":"",s=o?"prerelease":"";for(const t in n)if(("major"===t||"minor"===t||"patch"===t)&&n[t]!==i[t])return a+t;return s}}},function(t,e,n){const r=n(8);t.exports=(t,e)=>new r(t,e).major},function(t,e,n){const r=n(8);t.exports=(t,e)=>new r(t,e).minor},function(t,e,n){const r=n(8);t.exports=(t,e)=>new r(t,e).patch},function(t,e,n){const r=n(20);t.exports=(t,e)=>{const n=r(t,e);return n&&n.prerelease.length?n.prerelease:null}},function(t,e,n){const r=n(11);t.exports=(t,e,n)=>r(e,t,n)},function(t,e,n){const r=n(11);t.exports=(t,e)=>r(t,e,!0)},function(t,e,n){const r=n(41);t.exports=(t,e)=>t.sort((t,n)=>r(t,n,e))},function(t,e,n){const r=n(41);t.exports=(t,e)=>t.sort((t,n)=>r(n,t,e))},function(t,e,n){const r=n(8),i=n(20),{re:o,t:a}=n(19);t.exports=(t,e)=>{if(t instanceof r)return t;if("number"==typeof t&&(t=String(t)),"string"!=typeof t)return null;let n=null;if((e=e||{}).rtl){let e;for(;(e=o[a.COERCERTL].exec(t))&&(!n||n.index+n[0].length!==t.length);)n&&e.index+e[0].length===n.index+n[0].length||(n=e),o[a.COERCERTL].lastIndex=e.index+e[1].length+e[2].length;o[a.COERCERTL].lastIndex=-1}else n=t.match(o[a.COERCE]);return null===n?null:i(`${n[2]}.${n[3]||"0"}.${n[4]||"0"}`,e)}},function(t,e,n){const r=n(12);t.exports=(t,e)=>new r(t,e).set.map(t=>t.map(t=>t.value).join(" ").trim().split(" "))},function(t,e,n){const r=n(8),i=n(12);t.exports=(t,e,n)=>{let o=null,a=null,s=null;try{s=new i(e,n)}catch(t){return null}return t.forEach(t=>{s.test(t)&&(o&&-1!==a.compare(t)||(o=t,a=new r(o,n)))}),o}},function(t,e,n){const r=n(8),i=n(12);t.exports=(t,e,n)=>{let o=null,a=null,s=null;try{s=new i(e,n)}catch(t){return null}return t.forEach(t=>{s.test(t)&&(o&&1!==a.compare(t)||(o=t,a=new r(o,n)))}),o}},function(t,e,n){const r=n(8),i=n(12),o=n(31);t.exports=(t,e)=>{t=new i(t,e);let n=new r("0.0.0");if(t.test(n))return n;if(n=new r("0.0.0-0"),t.test(n))return n;n=null;for(let e=0;e<t.set.length;++e){t.set[e].forEach(t=>{const e=new r(t.semver.version);switch(t.operator){case">":0===e.prerelease.length?e.patch++:e.prerelease.push(0),e.raw=e.format();case"":case">=":n&&!o(n,e)||(n=e);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+t.operator)}})}return n&&t.test(n)?n:null}},function(t,e,n){const r=n(12);t.exports=(t,e)=>{try{return new r(t,e).range||"*"}catch(t){return null}}},function(t,e,n){const r=n(45);t.exports=(t,e,n)=>r(t,e,">",n)},function(t,e,n){const r=n(45);t.exports=(t,e,n)=>r(t,e,"<",n)},function(t,e,n){const r=n(12);t.exports=(t,e,n)=>(t=new r(t,n),e=new r(e,n),t.intersects(e))},function(t,e,n){const r=n(33),i=n(11);t.exports=(t,e,n)=>{const o=[];let a=null,s=null;const u=t.sort((t,e)=>i(t,e,n));for(const t of u){r(t,e,n)?(s=t,a||(a=t)):(s&&o.push([a,s]),s=null,a=null)}a&&o.push([a,null]);const l=[];for(const[t,e]of o)t===e?l.push(t):e||t!==u[0]?e?t===u[0]?l.push("<="+e):l.push(`${t} - ${e}`):l.push(">="+t):l.push("*");const c=l.join(" || "),f="string"==typeof e.raw?e.raw:String(e);return c.length<f.length?c:e}},function(t,e,n){const r=n(12),{ANY:i}=n(32),o=n(33),a=n(11),s=(t,e,n)=>{if(1===t.length&&t[0].semver===i)return 1===e.length&&e[0].semver===i;const r=new Set;let s,c,f,d,h,p,g;for(const e of t)">"===e.operator||">="===e.operator?s=u(s,e,n):"<"===e.operator||"<="===e.operator?c=l(c,e,n):r.add(e.semver);if(r.size>1)return null;if(s&&c){if(f=a(s.semver,c.semver,n),f>0)return null;if(0===f&&(">="!==s.operator||"<="!==c.operator))return null}for(const t of r){if(s&&!o(t,String(s),n))return null;if(c&&!o(t,String(c),n))return null;for(const r of e)if(!o(t,String(r),n))return!1;return!0}for(const t of e){if(g=g||">"===t.operator||">="===t.operator,p=p||"<"===t.operator||"<="===t.operator,s)if(">"===t.operator||">="===t.operator){if(d=u(s,t,n),d===t)return!1}else if(">="===s.operator&&!o(s.semver,String(t),n))return!1;if(c)if("<"===t.operator||"<="===t.operator){if(h=l(c,t,n),h===t)return!1}else if("<="===c.operator&&!o(c.semver,String(t),n))return!1;if(!t.operator&&(c||s)&&0!==f)return!1}return!(s&&p&&!c&&0!==f)&&!(c&&g&&!s&&0!==f)},u=(t,e,n)=>{if(!t)return e;const r=a(t.semver,e.semver,n);return r>0?t:r<0||">"===e.operator&&">="===t.operator?e:t},l=(t,e,n)=>{if(!t)return e;const r=a(t.semver,e.semver,n);return r<0?t:r>0||"<"===e.operator&&"<="===t.operator?e:t};t.exports=(t,e,n)=>{t=new r(t,n),e=new r(e,n);let i=!1;t:for(const r of t.set){for(const t of e.set){const e=s(r,t,n);if(i=i||null!==e,e)continue t}if(i)return!1}return!0}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";e.byteLength=function(t){var e=l(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){var e,n,r=l(t),a=r[0],s=r[1],u=new o(function(t,e,n){return 3*(e+n)/4-n}(0,a,s)),c=0,f=s>0?a-4:a;for(n=0;n<f;n+=4)e=i[t.charCodeAt(n)]<<18|i[t.charCodeAt(n+1)]<<12|i[t.charCodeAt(n+2)]<<6|i[t.charCodeAt(n+3)],u[c++]=e>>16&255,u[c++]=e>>8&255,u[c++]=255&e;2===s&&(e=i[t.charCodeAt(n)]<<2|i[t.charCodeAt(n+1)]>>4,u[c++]=255&e);1===s&&(e=i[t.charCodeAt(n)]<<10|i[t.charCodeAt(n+1)]<<4|i[t.charCodeAt(n+2)]>>2,u[c++]=e>>8&255,u[c++]=255&e);return u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],a=0,s=n-i;a<s;a+=16383)o.push(c(t,a,a+16383>s?s:a+16383));1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s<u;++s)r[s]=a[s],i[a.charCodeAt(s)]=s;function l(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function c(t,e,n){for(var i,o,a=[],s=e;s<n;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),a.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,l=u>>1,c=-7,f=n?i-1:0,d=n?-1:1,h=t[e+f];for(f+=d,o=h&(1<<-c)-1,h>>=-c,c+=s;c>0;o=256*o+t[e+f],f+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+t[e+f],f+=d,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),o-=l}return(h?-1:1)*a*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var a,s,u,l=8*o-i-1,c=(1<<l)-1,f=c>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,p=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=c?(s=0,a=c):a+f>=1?(s=(e*u-1)*Math.pow(2,i),a+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;t[n+h]=255&s,h+=p,s/=256,i-=8);for(a=a<<i|s,l+=i;l>0;t[n+h]=255&a,h+=p,a/=256,l-=8);t[n+h-p]|=128*g}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){var r=n(97),i=n(98);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[t.i,i,""]]);var o={insert:"head",singleton:!1};r(i,o);t.exports=i.locals||{}},function(t,e,n){"use strict";var r,i=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},o=function(){var t={};return function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}t[e]=n}return t[e]}}(),a=[];function s(t){for(var e=-1,n=0;n<a.length;n++)if(a[n].identifier===t){e=n;break}return e}function u(t,e){for(var n={},r=[],i=0;i<t.length;i++){var o=t[i],u=e.base?o[0]+e.base:o[0],l=n[u]||0,c="".concat(u," ").concat(l);n[u]=l+1;var f=s(c),d={css:o[1],media:o[2],sourceMap:o[3]};-1!==f?(a[f].references++,a[f].updater(d)):a.push({identifier:c,updater:m(d,e),references:1}),r.push(c)}return r}function l(t){var e=document.createElement("style"),r=t.attributes||{};if(void 0===r.nonce){var i=n.nc;i&&(r.nonce=i)}if(Object.keys(r).forEach((function(t){e.setAttribute(t,r[t])})),"function"==typeof t.insert)t.insert(e);else{var a=o(t.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(e)}return e}var c,f=(c=[],function(t,e){return c[t]=e,c.filter(Boolean).join("\n")});function d(t,e,n,r){var i=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(t.styleSheet)t.styleSheet.cssText=f(e,i);else{var o=document.createTextNode(i),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(o,a[e]):t.appendChild(o)}}function h(t,e,n){var r=n.css,i=n.media,o=n.sourceMap;if(i?t.setAttribute("media",i):t.removeAttribute("media"),o&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),t.styleSheet)t.styleSheet.cssText=r;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(r))}}var p=null,g=0;function m(t,e){var n,r,i;if(e.singleton){var o=g++;n=p||(p=l(e)),r=d.bind(null,n,o,!1),i=d.bind(null,n,o,!0)}else n=l(e),r=h.bind(null,n,e),i=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(n)};return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else i()}}t.exports=function(t,e){(e=e||{}).singleton||"boolean"==typeof e.singleton||(e.singleton=i());var n=u(t=t||[],e);return function(t){if(t=t||[],"[object Array]"===Object.prototype.toString.call(t)){for(var r=0;r<n.length;r++){var i=s(n[r]);a[i].references--}for(var o=u(t,e),l=0;l<n.length;l++){var c=s(n[l]);0===a[c].references&&(a[c].updater(),a.splice(c,1))}n=o}}}},function(t,e,n){"use strict";n.r(e);var r=n(59),i=n.n(r)()(!1);i.push([t.i,"#vg-tooltip-element.vg-tooltip.custom-theme {\n background-color: rgba(0, 0, 0, 0.75);\n border-color: rgba(0, 0, 0, 0.7);\n border-radius: 5px;\n width: auto;\n}\n\n#vg-tooltip-element > table tr td.key {\n text-align: left;\n color: #ffffff;\n}\n\n#vg-tooltip-element > table tr td.value {\n text-align: right;\n color: #ffffff;\n}\n",""]),e.default=i},function(t,e,n){"use strict";n.r(e);var r={};n.r(r),n.d(r,"JsonPatchError",(function(){return S})),n.d(r,"deepClone",(function(){return C})),n.d(r,"getValueByPointer",(function(){return T})),n.d(r,"applyOperation",(function(){return $})),n.d(r,"applyPatch",(function(){return N})),n.d(r,"applyReducer",(function(){return R})),n.d(r,"validator",(function(){return P})),n.d(r,"validate",(function(){return B})),n.d(r,"_areEquals",(function(){return L}));var i={};n.r(i),n.d(i,"unobserve",(function(){return W})),n.d(i,"observe",(function(){return Y})),n.d(i,"generate",(function(){return H})),n.d(i,"compare",(function(){return V}));var o={};n.r(o),n.d(o,"aggregate",(function(){return ln})),n.d(o,"bin",(function(){return cn})),n.d(o,"collect",(function(){return dn})),n.d(o,"compare",(function(){return hn})),n.d(o,"countpattern",(function(){return gn})),n.d(o,"cross",(function(){return mn})),n.d(o,"density",(function(){return yn})),n.d(o,"dotbin",(function(){return wn})),n.d(o,"expression",(function(){return jn})),n.d(o,"extent",(function(){return En})),n.d(o,"facet",(function(){return Dn})),n.d(o,"field",(function(){return Mn})),n.d(o,"filter",(function(){return Cn})),n.d(o,"flatten",(function(){return Fn})),n.d(o,"fold",(function(){return zn})),n.d(o,"formula",(function(){return Tn})),n.d(o,"generate",(function(){return $n})),n.d(o,"impute",(function(){return Pn})),n.d(o,"joinaggregate",(function(){return Bn})),n.d(o,"kde",(function(){return Ln})),n.d(o,"key",(function(){return In})),n.d(o,"load",(function(){return qn})),n.d(o,"lookup",(function(){return Yn})),n.d(o,"multiextent",(function(){return Hn})),n.d(o,"multivalues",(function(){return Vn})),n.d(o,"params",(function(){return Jn})),n.d(o,"pivot",(function(){return Kn})),n.d(o,"prefacet",(function(){return Zn})),n.d(o,"project",(function(){return Qn})),n.d(o,"proxy",(function(){return tr})),n.d(o,"quantile",(function(){return er})),n.d(o,"relay",(function(){return nr})),n.d(o,"sample",(function(){return rr})),n.d(o,"sequence",(function(){return ir})),n.d(o,"sieve",(function(){return or})),n.d(o,"subflow",(function(){return An})),n.d(o,"timeunit",(function(){return ar})),n.d(o,"tupleindex",(function(){return ur})),n.d(o,"values",(function(){return lr})),n.d(o,"window",(function(){return pr}));var a={};n.r(a),n.d(a,"interpolate",(function(){return Go})),n.d(a,"interpolateArray",(function(){return Bo})),n.d(a,"interpolateBasis",(function(){return Eo})),n.d(a,"interpolateBasisClosed",(function(){return Ao})),n.d(a,"interpolateDate",(function(){return Io})),n.d(a,"interpolateDiscrete",(function(){return Ga})),n.d(a,"interpolateHue",(function(){return Va})),n.d(a,"interpolateNumber",(function(){return Uo})),n.d(a,"interpolateNumberArray",(function(){return Ro})),n.d(a,"interpolateObject",(function(){return qo})),n.d(a,"interpolateRound",(function(){return Vo})),n.d(a,"interpolateString",(function(){return Ho})),n.d(a,"interpolateTransformCss",(function(){return Qa})),n.d(a,"interpolateTransformSvg",(function(){return ts})),n.d(a,"interpolateZoom",(function(){return ns})),n.d(a,"interpolateRgb",(function(){return zo})),n.d(a,"interpolateRgbBasis",(function(){return $o})),n.d(a,"interpolateRgbBasisClosed",(function(){return No})),n.d(a,"interpolateHsl",(function(){return is})),n.d(a,"interpolateHslLong",(function(){return os})),n.d(a,"interpolateLab",(function(){return vs})),n.d(a,"interpolateHcl",(function(){return _s})),n.d(a,"interpolateHclLong",(function(){return Os})),n.d(a,"interpolateCubehelix",(function(){return Fs})),n.d(a,"interpolateCubehelixLong",(function(){return zs})),n.d(a,"piecewise",(function(){return qa})),n.d(a,"quantize",(function(){return Ts}));var s={};n.r(s),n.d(s,"bound",(function(){return Xd})),n.d(s,"identifier",(function(){return Kd})),n.d(s,"mark",(function(){return Zd})),n.d(s,"overlap",(function(){return Qd})),n.d(s,"render",(function(){return ah})),n.d(s,"viewlayout",(function(){return Ah}));var u={};n.r(u),n.d(u,"axisticks",(function(){return Mh})),n.d(u,"datajoin",(function(){return Sh})),n.d(u,"encode",(function(){return Fh})),n.d(u,"legendentries",(function(){return zh})),n.d(u,"linkpath",(function(){return Ph})),n.d(u,"pie",(function(){return qh})),n.d(u,"scale",(function(){return Hh})),n.d(u,"sortitems",(function(){return Jh})),n.d(u,"stack",(function(){return Zh}));var l={};n.r(l),n.d(l,"contour",(function(){return Ab})),n.d(l,"geojson",(function(){return Db})),n.d(l,"geopath",(function(){return Mb})),n.d(l,"geopoint",(function(){return Sb})),n.d(l,"geoshape",(function(){return Cb})),n.d(l,"graticule",(function(){return Fb})),n.d(l,"heatmap",(function(){return zb})),n.d(l,"isocontour",(function(){return bb})),n.d(l,"kde2d",(function(){return jb})),n.d(l,"projection",(function(){return $b}));var c={};n.r(c),n.d(c,"force",(function(){return Dy}));var f={};n.r(f),n.d(f,"nest",(function(){return Mv})),n.d(f,"pack",(function(){return $v})),n.d(f,"partition",(function(){return Rv})),n.d(f,"stratify",(function(){return Pv})),n.d(f,"tree",(function(){return Iv})),n.d(f,"treelinks",(function(){return Uv})),n.d(f,"treemap",(function(){return Yv}));var d={};n.r(d),n.d(d,"label",(function(){return lx}));var h={};n.r(h),n.d(h,"loess",(function(){return fx})),n.d(h,"regression",(function(){return hx}));var p={};n.r(p),n.d(p,"voronoi",(function(){return $x}));var g={};n.r(g),n.d(g,"wordcloud",(function(){return Vx}));var m={};n.r(m),n.d(m,"crossfilter",(function(){return e_})),n.d(m,"resolvefilter",(function(){return n_}));var b={};n.r(b),n.d(b,"Debug",(function(){return Z.a})),n.d(b,"Error",(function(){return Z.b})),n.d(b,"Info",(function(){return Z.c})),n.d(b,"None",(function(){return Z.d})),n.d(b,"Warn",(function(){return Z.e})),n.d(b,"accessor",(function(){return Z.f})),n.d(b,"accessorFields",(function(){return Z.g})),n.d(b,"accessorName",(function(){return Z.h})),n.d(b,"array",(function(){return Z.i})),n.d(b,"ascending",(function(){return Z.j})),n.d(b,"clampRange",(function(){return Z.k})),n.d(b,"compare",(function(){return Z.l})),n.d(b,"constant",(function(){return Z.m})),n.d(b,"debounce",(function(){return Z.n})),n.d(b,"error",(function(){return Z.o})),n.d(b,"extend",(function(){return Z.p})),n.d(b,"extent",(function(){return Z.q})),n.d(b,"extentIndex",(function(){return Z.r})),n.d(b,"falsy",(function(){return Z.s})),n.d(b,"fastmap",(function(){return Z.t})),n.d(b,"field",(function(){return Z.u})),n.d(b,"flush",(function(){return Z.v})),n.d(b,"hasOwnProperty",(function(){return Z.w})),n.d(b,"id",(function(){return Z.x})),n.d(b,"identity",(function(){return Z.y})),n.d(b,"inherits",(function(){return Z.z})),n.d(b,"inrange",(function(){return Z.A})),n.d(b,"isArray",(function(){return Z.B})),n.d(b,"isBoolean",(function(){return Z.C})),n.d(b,"isDate",(function(){return Z.D})),n.d(b,"isFunction",(function(){return Z.E})),n.d(b,"isNumber",(function(){return Z.F})),n.d(b,"isObject",(function(){return Z.G})),n.d(b,"isRegExp",(function(){return Z.H})),n.d(b,"isString",(function(){return Z.I})),n.d(b,"key",(function(){return Z.J})),n.d(b,"lerp",(function(){return Z.K})),n.d(b,"logger",(function(){return Z.L})),n.d(b,"lruCache",(function(){return Z.M})),n.d(b,"merge",(function(){return Z.N})),n.d(b,"mergeConfig",(function(){return Z.O})),n.d(b,"one",(function(){return Z.P})),n.d(b,"pad",(function(){return Z.Q})),n.d(b,"panLinear",(function(){return Z.R})),n.d(b,"panLog",(function(){return Z.S})),n.d(b,"panPow",(function(){return Z.T})),n.d(b,"panSymlog",(function(){return Z.U})),n.d(b,"peek",(function(){return Z.V})),n.d(b,"quarter",(function(){return Z.W})),n.d(b,"repeat",(function(){return Z.X})),n.d(b,"span",(function(){return Z.Y})),n.d(b,"splitAccessPath",(function(){return Z.Z})),n.d(b,"stringValue",(function(){return Z.ab})),n.d(b,"toBoolean",(function(){return Z.bb})),n.d(b,"toDate",(function(){return Z.cb})),n.d(b,"toNumber",(function(){return Z.db})),n.d(b,"toSet",(function(){return Z.eb})),n.d(b,"toString",(function(){return Z.fb})),n.d(b,"truncate",(function(){return Z.gb})),n.d(b,"truthy",(function(){return Z.hb})),n.d(b,"utcquarter",(function(){return Z.ib})),n.d(b,"visitArray",(function(){return Z.jb})),n.d(b,"writeConfig",(function(){return Z.kb})),n.d(b,"zero",(function(){return Z.lb})),n.d(b,"zoomLinear",(function(){return Z.mb})),n.d(b,"zoomLog",(function(){return Z.nb})),n.d(b,"zoomPow",(function(){return Z.ob})),n.d(b,"zoomSymlog",(function(){return Z.pb})),n.d(b,"Dataflow",(function(){return Nt})),n.d(b,"EventStream",(function(){return _t})),n.d(b,"MultiPulse",(function(){return Ct})),n.d(b,"Operator",(function(){return yt})),n.d(b,"Parameters",(function(){return gt})),n.d(b,"Pulse",(function(){return At})),n.d(b,"Transform",(function(){return Pt})),n.d(b,"changeset",(function(){return pt})),n.d(b,"definition",(function(){return Lt})),n.d(b,"ingest",(function(){return ut})),n.d(b,"isTuple",(function(){return ot})),n.d(b,"transform",(function(){return It})),n.d(b,"transforms",(function(){return Bt})),n.d(b,"tupleid",(function(){return at})),n.d(b,"bandwidthNRD",(function(){return Qt})),n.d(b,"bin",(function(){return te})),n.d(b,"bootstrapCI",(function(){return re})),n.d(b,"cumulativeLogNormal",(function(){return ye})),n.d(b,"cumulativeNormal",(function(){return de})),n.d(b,"cumulativeUniform",(function(){return je})),n.d(b,"densityLogNormal",(function(){return be})),n.d(b,"densityNormal",(function(){return fe})),n.d(b,"densityUniform",(function(){return we})),n.d(b,"dotbin",(function(){return ie})),n.d(b,"quantileLogNormal",(function(){return ve})),n.d(b,"quantileNormal",(function(){return he})),n.d(b,"quantileUniform",(function(){return ke})),n.d(b,"quantiles",(function(){return Kt})),n.d(b,"quartiles",(function(){return Zt})),n.d(b,"random",(function(){return ee})),n.d(b,"randomInteger",(function(){return ae})),n.d(b,"randomKDE",(function(){return ge})),n.d(b,"randomLCG",(function(){return oe})),n.d(b,"randomLogNormal",(function(){return xe})),n.d(b,"randomMixture",(function(){return _e})),n.d(b,"randomNormal",(function(){return pe})),n.d(b,"randomUniform",(function(){return Ee})),n.d(b,"regressionExp",(function(){return ze})),n.d(b,"regressionLinear",(function(){return Ce})),n.d(b,"regressionLoess",(function(){return Pe})),n.d(b,"regressionLog",(function(){return Fe})),n.d(b,"regressionPoly",(function(){return Ne})),n.d(b,"regressionPow",(function(){return Te})),n.d(b,"regressionQuad",(function(){return $e})),n.d(b,"sampleCurve",(function(){return Ue})),n.d(b,"sampleLogNormal",(function(){return me})),n.d(b,"sampleNormal",(function(){return ce})),n.d(b,"sampleUniform",(function(){return Oe})),n.d(b,"setRandom",(function(){return ne})),n.d(b,"DATE",(function(){return He.a})),n.d(b,"DAY",(function(){return He.b})),n.d(b,"DAYOFYEAR",(function(){return He.c})),n.d(b,"HOURS",(function(){return He.d})),n.d(b,"MILLISECONDS",(function(){return He.e})),n.d(b,"MINUTES",(function(){return He.f})),n.d(b,"MONTH",(function(){return He.g})),n.d(b,"QUARTER",(function(){return He.h})),n.d(b,"SECONDS",(function(){return He.i})),n.d(b,"TIME_UNITS",(function(){return He.j})),n.d(b,"WEEK",(function(){return He.k})),n.d(b,"YEAR",(function(){return He.l})),n.d(b,"dayofyear",(function(){return He.m})),n.d(b,"timeBin",(function(){return He.n})),n.d(b,"timeFloor",(function(){return He.o})),n.d(b,"timeInterval",(function(){return He.p})),n.d(b,"timeOffset",(function(){return He.q})),n.d(b,"timeSequence",(function(){return He.r})),n.d(b,"timeUnitSpecifier",(function(){return He.s})),n.d(b,"timeUnits",(function(){return He.t})),n.d(b,"utcFloor",(function(){return He.u})),n.d(b,"utcInterval",(function(){return He.v})),n.d(b,"utcOffset",(function(){return He.w})),n.d(b,"utcSequence",(function(){return He.x})),n.d(b,"utcdayofyear",(function(){return He.y})),n.d(b,"utcweek",(function(){return He.z})),n.d(b,"week",(function(){return He.A})),n.d(b,"format",(function(){return Q.a})),n.d(b,"formats",(function(){return Q.b})),n.d(b,"inferType",(function(){return Q.c})),n.d(b,"inferTypes",(function(){return Q.d})),n.d(b,"loader",(function(){return Q.e})),n.d(b,"read",(function(){return Q.f})),n.d(b,"responseType",(function(){return Q.g})),n.d(b,"typeParsers",(function(){return Q.h})),n.d(b,"Bounds",(function(){return El})),n.d(b,"CanvasHandler",(function(){return Vf})),n.d(b,"CanvasRenderer",(function(){return Qf})),n.d(b,"Gradient",(function(){return Tu})),n.d(b,"GroupItem",(function(){return Dl})),n.d(b,"Handler",(function(){return Nf})),n.d(b,"Item",(function(){return Al})),n.d(b,"Marks",(function(){return _f})),n.d(b,"RenderType",(function(){return Fd})),n.d(b,"Renderer",(function(){return Pf})),n.d(b,"ResourceLoader",(function(){return Ml})),n.d(b,"SVGHandler",(function(){return ed})),n.d(b,"SVGRenderer",(function(){return bd})),n.d(b,"SVGStringRenderer",(function(){return Cd})),n.d(b,"Scenegraph",(function(){return Df})),n.d(b,"boundClip",(function(){return Ld})),n.d(b,"boundContext",(function(){return Jl})),n.d(b,"boundItem",(function(){return Of})),n.d(b,"boundMark",(function(){return jf})),n.d(b,"boundStroke",(function(){return Fl})),n.d(b,"domChild",(function(){return Ff})),n.d(b,"domClear",(function(){return zf})),n.d(b,"domCreate",(function(){return Sf})),n.d(b,"domFind",(function(){return Cf})),n.d(b,"font",(function(){return gf})),n.d(b,"fontFamily",(function(){return pf})),n.d(b,"fontSize",(function(){return lf})),n.d(b,"intersect",(function(){return $d})),n.d(b,"intersectBoxLine",(function(){return sc})),n.d(b,"intersectPath",(function(){return rc})),n.d(b,"intersectPoint",(function(){return ic})),n.d(b,"intersectRule",(function(){return ac})),n.d(b,"lineHeight",(function(){return cf})),n.d(b,"markup",(function(){return dd})),n.d(b,"multiLineOffset",(function(){return df})),n.d(b,"pathCurves",(function(){return Nu})),n.d(b,"pathEqual",(function(){return Ud})),n.d(b,"pathParse",(function(){return Bu})),n.d(b,"pathRectangle",(function(){return ul})),n.d(b,"pathRender",(function(){return Ju})),n.d(b,"pathSymbols",(function(){return tl})),n.d(b,"pathTrail",(function(){return ll})),n.d(b,"point",(function(){return $f})),n.d(b,"renderModule",(function(){return Td})),n.d(b,"resetSVGClipId",(function(){return jl})),n.d(b,"resetSVGDefIds",(function(){return qd})),n.d(b,"sceneEqual",(function(){return Id})),n.d(b,"sceneFromJSON",(function(){return Af})),n.d(b,"scenePickVisit",(function(){return yc})),n.d(b,"sceneToJSON",(function(){return Ef})),n.d(b,"sceneVisit",(function(){return bc})),n.d(b,"sceneZOrder",(function(){return mc})),n.d(b,"serializeXML",(function(){return hd})),n.d(b,"textMetrics",(function(){return nf})),n.d(b,"interpolate",(function(){return au})),n.d(b,"interpolateColors",(function(){return ru})),n.d(b,"interpolateRange",(function(){return nu})),n.d(b,"quantizeInterpolator",(function(){return iu})),n.d(b,"scale",(function(){return Hs})),n.d(b,"scheme",(function(){return cu})),n.d(b,"projection",(function(){return ib})),n.d(b,"View",(function(){return Uj})),n.d(b,"defaultLocale",(function(){return tt.a})),n.d(b,"formatLocale",(function(){return tt.c})),n.d(b,"locale",(function(){return tt.b})),n.d(b,"resetDefaultLocale",(function(){return tt.d})),n.d(b,"timeFormatLocale",(function(){return tt.e})),n.d(b,"expressionFunction",(function(){return Vw})),n.d(b,"parse",(function(){return gD})),n.d(b,"runtimeContext",(function(){return ij})),n.d(b,"version",(function(){return mD}));var y={};n.r(y),n.d(y,"accessPathDepth",(function(){return lM})),n.d(y,"accessPathWithDatum",(function(){return rM})),n.d(y,"compile",(function(){return bI})),n.d(y,"contains",(function(){return RD})),n.d(y,"deepEqual",(function(){return SD})),n.d(y,"deleteNestedProperty",(function(){return eM})),n.d(y,"duplicate",(function(){return CD})),n.d(y,"entries",(function(){return KD})),n.d(y,"every",(function(){return BD})),n.d(y,"fieldIntersection",(function(){return GD})),n.d(y,"flatAccessWithDatum",(function(){return iM})),n.d(y,"getFirstDefined",(function(){return cM})),n.d(y,"hasIntersection",(function(){return YD})),n.d(y,"hash",(function(){return $D})),n.d(y,"internalField",(function(){return pM})),n.d(y,"isBoolean",(function(){return ZD})),n.d(y,"isEmpty",(function(){return VD})),n.d(y,"isEqual",(function(){return qD})),n.d(y,"isInternalField",(function(){return gM})),n.d(y,"isNullOrFalse",(function(){return ND})),n.d(y,"isNumeric",(function(){return bM})),n.d(y,"keys",(function(){return XD})),n.d(y,"logicalExpr",(function(){return tM})),n.d(y,"mergeDeep",(function(){return LD})),n.d(y,"normalize",(function(){return oN})),n.d(y,"normalizeAngle",(function(){return mM})),n.d(y,"omit",(function(){return zD})),n.d(y,"pick",(function(){return FD})),n.d(y,"prefixGenerator",(function(){return HD})),n.d(y,"removePathFromField",(function(){return uM})),n.d(y,"replaceAll",(function(){return sM})),n.d(y,"replacePathInField",(function(){return aM})),n.d(y,"resetIdCounter",(function(){return hM})),n.d(y,"setEqual",(function(){return WD})),n.d(y,"some",(function(){return PD})),n.d(y,"stringify",(function(){return TD})),n.d(y,"titleCase",(function(){return nM})),n.d(y,"unique",(function(){return UD})),n.d(y,"uniqueId",(function(){return dM})),n.d(y,"vals",(function(){return JD})),n.d(y,"varName",(function(){return QD})),n.d(y,"version",(function(){return kD}));var v={};n.r(v),n.d(v,"dark",(function(){return vI})),n.d(v,"excel",(function(){return xI})),n.d(v,"fivethirtyeight",(function(){return _I})),n.d(v,"ggplot2",(function(){return OI})),n.d(v,"googlecharts",(function(){return SI})),n.d(v,"latimes",(function(){return kI})),n.d(v,"quartz",(function(){return EI})),n.d(v,"urbaninstitute",(function(){return MI})),n.d(v,"version",(function(){return CI})),n.d(v,"vox",(function(){return AI}));
/*!
* https://github.com/Starcounter-Jack/JSON-Patch
* (c) 2017 Joachim Wester
* MIT license
*/
var x=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_=Object.prototype.hasOwnProperty;function O(t,e){return _.call(t,e)}function w(t){if(Array.isArray(t)){for(var e=new Array(t.length),n=0;n<e.length;n++)e[n]=""+n;return e}if(Object.keys)return Object.keys(t);e=[];for(var r in t)O(t,r)&&e.push(r);return e}function j(t){switch(typeof t){case"object":return JSON.parse(JSON.stringify(t));case"undefined":return null;default:return t}}function k(t){for(var e,n=0,r=t.length;n<r;){if(!((e=t.charCodeAt(n))>=48&&e<=57))return!1;n++}return!0}function E(t){return-1===t.indexOf("/")&&-1===t.indexOf("~")?t:t.replace(/~/g,"~0").replace(/\//g,"~1")}function A(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function D(t,e){var n=[t];for(var r in e){var i="object"==typeof e[r]?JSON.stringify(e[r],null,2):e[r];void 0!==i&&n.push(r+": "+i)}return n.join("\n")}var M=function(t){function e(e,n,r,i,o){var a=this.constructor,s=t.call(this,D(e,{name:n,index:r,operation:i,tree:o}))||this;return s.name=n,s.index=r,s.operation=i,s.tree=o,Object.setPrototypeOf(s,a.prototype),s.message=D(e,{name:n,index:r,operation:i,tree:o}),s}return x(e,t),e}(Error),S=M,C=j,F={add:function(t,e,n){return t[e]=this.value,{newDocument:n}},remove:function(t,e,n){var r=t[e];return delete t[e],{newDocument:n,removed:r}},replace:function(t,e,n){var r=t[e];return t[e]=this.value,{newDocument:n,removed:r}},move:function(t,e,n){var r=T(n,this.path);r&&(r=j(r));var i=$(n,{op:"remove",path:this.from}).removed;return $(n,{op:"add",path:this.path,value:i}),{newDocument:n,removed:r}},copy:function(t,e,n){var r=T(n,this.from);return $(n,{op:"add",path:this.path,value:j(r)}),{newDocument:n}},test:function(t,e,n){return{newDocument:n,test:L(t[e],this.value)}},_get:function(t,e,n){return this.value=t[e],{newDocument:n}}},z={add:function(t,e,n){return k(e)?t.splice(e,0,this.value):t[e]=this.value,{newDocument:n,index:e}},remove:function(t,e,n){return{newDocument:n,removed:t.splice(e,1)[0]}},replace:function(t,e,n){var r=t[e];return t[e]=this.value,{newDocument:n,removed:r}},move:F.move,copy:F.copy,test:F.test,_get:F._get};function T(t,e){if(""==e)return t;var n={op:"_get",path:e};return $(t,n),n.value}function $(t,e,n,r,i,o){if(void 0===n&&(n=!1),void 0===r&&(r=!0),void 0===i&&(i=!0),void 0===o&&(o=0),n&&("function"==typeof n?n(e,0,t,e.path):P(e,0)),""===e.path){var a={newDocument:t};if("add"===e.op)return a.newDocument=e.value,a;if("replace"===e.op)return a.newDocument=e.value,a.removed=t,a;if("move"===e.op||"copy"===e.op)return a.newDocument=T(t,e.from),"move"===e.op&&(a.removed=t),a;if("test"===e.op){if(a.test=L(t,e.value),!1===a.test)throw new S("Test operation failed","TEST_OPERATION_FAILED",o,e,t);return a.newDocument=t,a}if("remove"===e.op)return a.removed=t,a.newDocument=null,a;if("_get"===e.op)return e.value=t,a;if(n)throw new S("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",o,e,t);return a}r||(t=j(t));var s=(e.path||"").split("/"),u=t,l=1,c=s.length,f=void 0,d=void 0,h=void 0;for(h="function"==typeof n?n:P;;){if(d=s[l],i&&"__proto__"==d)throw new TypeError("JSON-Patch: modifying `__proto__` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&void 0===f&&(void 0===u[d]?f=s.slice(0,l).join("/"):l==c-1&&(f=e.path),void 0!==f&&h(e,0,t,f)),l++,Array.isArray(u)){if("-"===d)d=u.length;else{if(n&&!k(d))throw new S("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",o,e,t);k(d)&&(d=~~d)}if(l>=c){if(n&&"add"===e.op&&d>u.length)throw new S("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,e,t);if(!1===(a=z[e.op].call(e,u,d,t)).test)throw new S("Test operation failed","TEST_OPERATION_FAILED",o,e,t);return a}}else if(d&&-1!=d.indexOf("~")&&(d=A(d)),l>=c){if(!1===(a=F[e.op].call(e,u,d,t)).test)throw new S("Test operation failed","TEST_OPERATION_FAILED",o,e,t);return a}u=u[d]}}function N(t,e,n,r,i){if(void 0===r&&(r=!0),void 0===i&&(i=!0),n&&!Array.isArray(e))throw new S("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");r||(t=j(t));for(var o=new Array(e.length),a=0,s=e.length;a<s;a++)o[a]=$(t,e[a],n,!0,i,a),t=o[a].newDocument;return o.newDocument=t,o}function R(t,e,n){var r=$(t,e);if(!1===r.test)throw new S("Test operation failed","TEST_OPERATION_FAILED",n,e,t);return r.newDocument}function P(t,e,n,r){if("object"!=typeof t||null===t||Array.isArray(t))throw new S("Operation is not an object","OPERATION_NOT_AN_OBJECT",e,t,n);if(!F[t.op])throw new S("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",e,t,n);if("string"!=typeof t.path)throw new S("Operation `path` property is not a string","OPERATION_PATH_INVALID",e,t,n);if(0!==t.path.indexOf("/")&&t.path.length>0)throw new S('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",e,t,n);if(("move"===t.op||"copy"===t.op)&&"string"!=typeof t.from)throw new S("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",e,t,n);if(("add"===t.op||"replace"===t.op||"test"===t.op)&&void 0===t.value)throw new S("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",e,t,n);if(("add"===t.op||"replace"===t.op||"test"===t.op)&&function t(e){if(void 0===e)return!0;if(e)if(Array.isArray(e)){for(var n=0,r=e.length;n<r;n++)if(t(e[n]))return!0}else if("object"==typeof e){var i=w(e),o=i.length;for(n=0;n<o;n++)if(t(e[i[n]]))return!0}return!1}(t.value))throw new S("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",e,t,n);if(n)if("add"==t.op){var i=t.path.split("/").length,o=r.split("/").length;if(i!==o+1&&i!==o)throw new S("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",e,t,n)}else if("replace"===t.op||"remove"===t.op||"_get"===t.op){if(t.path!==r)throw new S("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",e,t,n)}else if("move"===t.op||"copy"===t.op){var a=B([{op:"_get",path:t.from,value:void 0}],n);if(a&&"OPERATION_PATH_UNRESOLVABLE"===a.name)throw new S("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",e,t,n)}}function B(t,e,n){try{if(!Array.isArray(t))throw new S("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(e)N(j(e),j(t),n||!0);else{n=n||P;for(var r=0;r<t.length;r++)n(t[r],r,e,void 0)}}catch(t){if(t instanceof S)return t;throw t}}function L(t,e){if(t===e)return!0;if(t&&e&&"object"==typeof t&&"object"==typeof e){var n,r,i,o=Array.isArray(t),a=Array.isArray(e);if(o&&a){if((r=t.length)!=e.length)return!1;for(n=r;0!=n--;)if(!L(t[n],e[n]))return!1;return!0}if(o!=a)return!1;var s=Object.keys(t);if((r=s.length)!==Object.keys(e).length)return!1;for(n=r;0!=n--;)if(!e.hasOwnProperty(s[n]))return!1;for(n=r;0!=n--;)if(!L(t[i=s[n]],e[i]))return!1;return!0}return t!=t&&e!=e}
/*!
* https://github.com/Starcounter-Jack/JSON-Patch
* (c) 2017 Joachim Wester
* MIT license
*/
var I=new WeakMap,U=function(t){this.observers=new Map,this.obj=t},q=function(t,e){this.callback=t,this.observer=e};function W(t,e){e.unobserve()}function Y(t,e){var n,r=function(t){return I.get(t)}(t);if(r){var i=function(t,e){return t.observers.get(e)}(r,e);n=i&&i.observer}else r=new U(t),I.set(t,r);if(n)return n;if(n={},r.value=j(t),e){n.callback=e,n.next=null;var o=function(){H(n)},a=function(){clearTimeout(n.next),n.next=setTimeout(o)};"undefined"!=typeof window&&(window.addEventListener("mouseup",a),window.addEventListener("keyup",a),window.addEventListener("mousedown",a),window.addEventListener("keydown",a),window.addEventListener("change",a))}return n.patches=[],n.object=t,n.unobserve=function(){H(n),clearTimeout(n.next),function(t,e){t.observers.delete(e.callback)}(r,n),"undefined"!=typeof window&&(window.removeEventListener("mouseup",a),window.removeEventListener("keyup",a),window.removeEventListener("mousedown",a),window.removeEventListener("keydown",a),window.removeEventListener("change",a))},r.observers.set(e,new q(e,n)),n}function H(t,e){void 0===e&&(e=!1);var n=I.get(t.object);G(n.value,t.object,t.patches,"",e),t.patches.length&&N(n.value,t.patches);var r=t.patches;return r.length>0&&(t.patches=[],t.callback&&t.callback(r)),r}function G(t,e,n,r,i){if(e!==t){"function"==typeof e.toJSON&&(e=e.toJSON());for(var o=w(e),a=w(t),s=!1,u=a.length-1;u>=0;u--){var l=t[f=a[u]];if(!O(e,f)||void 0===e[f]&&void 0!==l&&!1===Array.isArray(e))Array.isArray(t)===Array.isArray(e)?(i&&n.push({op:"test",path:r+"/"+E(f),value:j(l)}),n.push({op:"remove",path:r+"/"+E(f)}),s=!0):(i&&n.push({op:"test",path:r,value:t}),n.push({op:"replace",path:r,value:e}),!0);else{var c=e[f];"object"==typeof l&&null!=l&&"object"==typeof c&&null!=c?G(l,c,n,r+"/"+E(f),i):l!==c&&(!0,i&&n.push({op:"test",path:r+"/"+E(f),value:j(l)}),n.push({op:"replace",path:r+"/"+E(f),value:j(c)}))}}if(s||o.length!=a.length)for(u=0;u<o.length;u++){var f;O(t,f=o[u])||void 0===e[f]||n.push({op:"add",path:r+"/"+E(f),value:j(e[f])})}}}function V(t,e,n){void 0===n&&(n=!1);var r=[];return G(t,e,r,"",n),r}Object.assign({},r,i,{JsonPatchError:M,deepClone:j,escapePathComponent:E,unescapePathComponent:A});var X=n(34),J=n.n(X),K=n(46),Z=n(0),Q=n(16),tt=n(10);function et(t){const e=t||Z.y,n=[],r={};return n.add=t=>{const i=e(t);return r[i]||(r[i]=1,n.push(t)),n},n.remove=t=>{const i=e(t);if(r[i]){r[i]=0;const e=n.indexOf(t);e>=0&&n.splice(e,1)}return n},n}async function nt(t,e){try{await e(t)}catch(e){t.error(e)}}const rt=Symbol("vega_id");let it=1;function ot(t){return!(!t||!at(t))}function at(t){return t[rt]}function st(t,e){return t[rt]=e,t}function ut(t){const e=t===Object(t)?t:{data:t};return at(e)?e:st(e,it++)}function lt(t){return ct(t,ut({}))}function ct(t,e){for(const n in t)e[n]=t[n];return e}function ft(t,e){return st(e,at(t))}function dt(t,e){return t?e?(n,r)=>t(n,r)||at(e(n))-at(e(r)):(e,n)=>t(e,n)||at(e)-at(n):null}function ht(t){return t&&t.constructor===pt}function pt(){const t=[],e=[],n=[],r=[],i=[];let o=null,a=!1;return{constructor:pt,insert(e){const n=Object(Z.i)(e),r=n.length;for(let e=0;e<r;++e)t.push(n[e]);return this},remove(t){const n=Object(Z.E)(t)?r:e,i=Object(Z.i)(t),o=i.length;for(let t=0;t<o;++t)n.push(i[t]);return this},modify(t,e,r){const o={field:e,value:Object(Z.m)(r)};return Object(Z.E)(t)?(o.filter=t,i.push(o)):(o.tuple=t,n.push(o)),this},encode(t,e){return Object(Z.E)(t)?i.push({filter:t,field:e}):n.push({tuple:t,field:e}),this},clean(t){return o=t,this},reflow(){return a=!0,this},pulse(s,u){const l={},c={};let f,d,h,p,g,m;for(f=0,d=u.length;f<d;++f)l[at(u[f])]=1;for(f=0,d=e.length;f<d;++f)g=e[f],l[at(g)]=-1;for(f=0,d=r.length;f<d;++f)p=r[f],u.forEach(t=>{p(t)&&(l[at(t)]=-1)});for(f=0,d=t.length;f<d;++f)g=t[f],m=at(g),l[m]?l[m]=1:s.add.push(ut(t[f]));for(f=0,d=u.length;f<d;++f)g=u[f],l[at(g)]<0&&s.rem.push(g);function b(t,e,n){n?t[e]=n(t):s.encode=e,a||(c[at(t)]=t)}for(f=0,d=n.length;f<d;++f)h=n[f],g=h.tuple,p=h.field,m=l[at(g)],m>0&&(b(g,p,h.value),s.modifies(p));for(f=0,d=i.length;f<d;++f)h=i[f],p=h.filter,u.forEach(t=>{p(t)&&l[at(t)]>0&&b(t,h.field,h.value)}),s.modifies(h.field);if(a)s.mod=e.length||r.length?u.filter(t=>l[at(t)]>0):u.slice();else for(m in c)s.mod.push(c[m]);return(o||null==o&&(e.length||r.length))&&s.clean(!0),s}}}function gt(){Object.defineProperty(this,"_:mod:_",{writable:!0,value:{}})}gt.prototype={set(t,e,n,r){const i=this,o=i[t],a=i["_:mod:_"];return null!=e&&e>=0?(o[e]!==n||r)&&(o[e]=n,a[e+":"+t]=-1,a[t]=-1):(o!==n||r)&&(i[t]=n,a[t]=Object(Z.B)(n)?1+n.length:-1),i},modified(t,e){const n=this["_:mod:_"];if(!arguments.length){for(const t in n)if(n[t])return!0;return!1}if(Object(Z.B)(t)){for(let e=0;e<t.length;++e)if(n[t[e]])return!0;return!1}return null!=e&&e>=0?e+1<n[t]||!!n[e+":"+t]:!!n[t]},clear(){return this["_:mod:_"]={},this}};let mt=0;const bt=new gt;function yt(t,e,n,r){this.id=++mt,this.value=t,this.stamp=-1,this.rank=-1,this.qrank=-1,this.flags=0,e&&(this._update=e),n&&this.parameters(n,r)}function vt(t){return function(e){const n=this.flags;return 0===arguments.length?!!(n&t):(this.flags=e?n|t:n&~t,this)}}yt.prototype={targets(){return this._targets||(this._targets=et(Z.x))},set(t){return this.value!==t?(this.value=t,1):0},skip:vt(1),modified:vt(2),parameters(t,e,n){e=!1!==e;const r=this._argval=this._argval||new gt,i=this._argops=this._argops||[],o=[];let a,s,u,l;const c=(t,n,a)=>{a instanceof yt?(a!==this&&(e&&a.targets().add(this),o.push(a)),i.push({op:a,name:t,index:n})):r.set(t,n,a)};for(a in t)if(s=t[a],"pulse"===a)Object(Z.i)(s).forEach(t=>{t instanceof yt?t!==this&&(t.targets().add(this),o.push(t)):Object(Z.o)("Pulse parameters must be operator instances.")}),this.source=s;else if(Object(Z.B)(s))for(r.set(a,-1,Array(u=s.length)),l=0;l<u;++l)c(a,l,s[l]);else c(a,-1,s);return this.marshall().clear(),n&&(i.initonly=!0),o},marshall(t){const e=this._argval||bt,n=this._argops;let r,i,o,a;if(n){const s=n.length;for(i=0;i<s;++i)r=n[i],o=r.op,a=o.modified()&&o.stamp===t,e.set(r.name,r.index,o.value,a);if(n.initonly){for(i=0;i<s;++i)r=n[i],r.op.targets().remove(this);this._argops=null,this._update=null}}return e},detach(){const t=this._argops;let e,n,r,i;if(t)for(e=0,n=t.length;e<n;++e)r=t[e],i=r.op,i._targets&&i._targets.remove(this)},evaluate(t){const e=this._update;if(e){const n=this.marshall(t.stamp),r=e.call(this,n,t);if(n.clear(),r!==this.value)this.value=r;else if(!this.modified())return t.StopPropagation}},run(t){if(t.stamp<this.stamp)return t.StopPropagation;let e;return this.skip()?(this.skip(!1),e=0):e=this.evaluate(t),this.pulse=e||t}};let xt=0;function _t(t,e,n){this.id=++xt,this.value=null,n&&(this.receive=n),t&&(this._filter=t),e&&(this._apply=e)}function Ot(t,e,n){return new _t(t,e,n)}_t.prototype={_filter:Z.hb,_apply:Z.y,targets(){return this._targets||(this._targets=et(Z.x))},consume(t){return arguments.length?(this._consume=!!t,this):!!this._consume},receive(t){if(this._filter(t)){const e=this.value=this._apply(t),n=this._targets,r=n?n.length:0;for(let t=0;t<r;++t)n[t].receive(e);this._consume&&(t.preventDefault(),t.stopPropagation())}},filter(t){const e=Ot(t);return this.targets().add(e),e},apply(t){const e=Ot(null,t);return this.targets().add(e),e},merge(){const t=Ot();this.targets().add(t);for(let e=0,n=arguments.length;e<n;++e)arguments[e].targets().add(t);return t},throttle(t){let e=-1;return this.filter(()=>{const n=Date.now();return n-e>t?(e=n,1):0})},debounce(t){const e=Ot();return this.targets().add(Ot(null,null,Object(Z.n)(t,t=>{const n=t.dataflow;e.receive(t),n&&n.run&&n.run()}))),e},between(t,e){let n=!1;return t.targets().add(Ot(null,null,()=>n=!0)),e.targets().add(Ot(null,null,()=>n=!1)),this.filter(()=>n)},detach(){}};const wt={skip:!0};function jt(t,e,n,r,i,o){const a=Object(Z.p)({},o,wt);let s,u;Object(Z.E)(n)||(n=Object(Z.m)(n)),void 0===r?s=e=>t.touch(n(e)):Object(Z.E)(r)?(u=new yt(null,r,i,!1),s=e=>{u.evaluate(e);const r=n(e),i=u.value;ht(i)?t.pulse(r,i,o):t.update(r,i,a)}):s=e=>t.update(n(e),r,a),e.apply(s)}function kt(t,e,n,r,i,o){if(void 0===r)e.targets().add(n);else{const a=o||{},s=new yt(null,function(t,e){return e=Object(Z.E)(e)?e:Object(Z.m)(e),t?function(n,r){const i=e(n,r);return t.skip()||(t.skip(i!==this.value).value=i),i}:e}(n,r),i,!1);s.modified(a.force),s.rank=e.rank,e.targets().add(s),n&&(s.skip(!0),s.value=n.value,s.targets().add(n),t.connect(n,[s]))}}const Et={};function At(t,e,n){this.dataflow=t,this.stamp=null==e?-1:e,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function Dt(t,e){const n=[];return Object(Z.jb)(t,e,t=>n.push(t)),n}function Mt(t,e){const n={};return t.visit(e,t=>{n[at(t)]=1}),t=>n[at(t)]?null:t}function St(t,e){return t?(n,r)=>t(n,r)&&e(n,r):e}function Ct(t,e,n,r){const i=this,o=n.length;let a=0;this.dataflow=t,this.stamp=e,this.fields=null,this.encode=r||null,this.pulses=n;for(let t=0;t<o;++t){const r=n[t];if(r.stamp===e){if(r.fields){const t=i.fields||(i.fields={});for(const e in r.fields)t[e]=1}r.changed(i.ADD)&&(a|=i.ADD),r.changed(i.REM)&&(a|=i.REM),r.changed(i.MOD)&&(a|=i.MOD)}}this.changes=a}function Ft(t){return t.error("Dataflow already running. Use runAsync() to chain invocations."),t}At.prototype={StopPropagation:Et,ADD:1,REM:2,MOD:4,ADD_REM:3,ADD_MOD:5,ALL:7,REFLOW:8,SOURCE:16,NO_SOURCE:32,NO_FIELDS:64,fork(t){return new At(this.dataflow).init(this,t)},clone(){const t=this.fork(7);return t.add=t.add.slice(),t.rem=t.rem.slice(),t.mod=t.mod.slice(),t.source&&(t.source=t.source.slice()),t.materialize(23)},addAll(){let t=this;return!t.source||t.add===t.rem||!t.rem.length&&t.source.length===t.add.length||(t=new At(this.dataflow).init(this),t.add=t.source,t.rem=[]),t},init(t,e){const n=this;return n.stamp=t.stamp,n.encode=t.encode,!t.fields||64&e||(n.fields=t.fields),1&e?(n.addF=t.addF,n.add=t.add):(n.addF=null,n.add=[]),2&e?(n.remF=t.remF,n.rem=t.rem):(n.remF=null,n.rem=[]),4&e?(n.modF=t.modF,n.mod=t.mod):(n.modF=null,n.mod=[]),32&e?(n.srcF=null,n.source=null):(n.srcF=t.srcF,n.source=t.source,t.cleans&&(n.cleans=t.cleans)),n},runAfter(t){this.dataflow.runAfter(t)},changed(t){const e=t||7;return 1&e&&this.add.length||2&e&&this.rem.length||4&e&&this.mod.length},reflow(t){if(t)return this.fork(7).reflow();const e=this.add.length,n=this.source&&this.source.length;return n&&n!==e&&(this.mod=this.source,e&&this.filter(4,Mt(this,1))),this},clean(t){return arguments.length?(this.cleans=!!t,this):this.cleans},modifies(t){const e=this.fields||(this.fields={});return Object(Z.B)(t)?t.forEach(t=>e[t]=!0):e[t]=!0,this},modified(t,e){const n=this.fields;return!(!e&&!this.mod.length||!n)&&(arguments.length?Object(Z.B)(t)?t.some(t=>n[t]):n[t]:!!n)},filter(t,e){const n=this;return 1&t&&(n.addF=St(n.addF,e)),2&t&&(n.remF=St(n.remF,e)),4&t&&(n.modF=St(n.modF,e)),16&t&&(n.srcF=St(n.srcF,e)),n},materialize(t){const e=this;return 1&(t=t||7)&&e.addF&&(e.add=Dt(e.add,e.addF),e.addF=null),2&t&&e.remF&&(e.rem=Dt(e.rem,e.remF),e.remF=null),4&t&&e.modF&&(e.mod=Dt(e.mod,e.modF),e.modF=null),16&t&&e.srcF&&(e.source=e.source.filter(e.srcF),e.srcF=null),e},visit(t,e){const n=this,r=e;if(16&t)return Object(Z.jb)(n.source,n.srcF,r),n;1&t&&Object(Z.jb)(n.add,n.addF,r),2&t&&Object(Z.jb)(n.rem,n.remF,r),4&t&&Object(Z.jb)(n.mod,n.modF,r);const i=n.source;if(8&t&&i){const t=n.add.length+n.mod.length;t===i.length||(t?Object(Z.jb)(i,Mt(n,5),r):Object(Z.jb)(i,n.srcF,r))}return n}},Object(Z.z)(Ct,At,{fork(t){const e=new At(this.dataflow).init(this,t&this.NO_FIELDS);return void 0!==t&&(t&e.ADD&&this.visit(e.ADD,t=>e.add.push(t)),t&e.REM&&this.visit(e.REM,t=>e.rem.push(t)),t&e.MOD&&this.visit(e.MOD,t=>e.mod.push(t))),e},changed(t){return this.changes&t},modified(t){const e=this,n=e.fields;return n&&e.changes&e.MOD?Object(Z.B)(t)?t.some(t=>n[t]):n[t]:0},filter(){Object(Z.o)("MultiPulse does not support filtering.")},materialize(){Object(Z.o)("MultiPulse does not support materialization.")},visit(t,e){const n=this,r=n.pulses,i=r.length;let o=0;if(t&n.SOURCE)for(;o<i;++o)r[o].visit(t,e);else for(;o<i;++o)r[o].stamp===n.stamp&&r[o].visit(t,e);return n}});const zt={skip:!1,force:!1};function Tt(t){let e=[];return{clear:()=>e=[],size:()=>e.length,peek:()=>e[0],push:n=>(e.push(n),$t(e,0,e.length-1,t)),pop:()=>{const n=e.pop();let r;return e.length?(r=e[0],e[0]=n,function(t,e,n){const r=e,i=t.length,o=t[e];let a,s=1+(e<<1);for(;s<i;)a=s+1,a<i&&n(t[s],t[a])>=0&&(s=a),t[e]=t[s],s=1+((e=s)<<1);t[e]=o,$t(t,r,e,n)}(e,0,t)):r=n,r}}}function $t(t,e,n,r){let i,o;const a=t[n];for(;n>e&&(o=n-1>>1,i=t[o],r(a,i)<0);)t[n]=i,n=o;return t[n]=a}function Nt(){this.logger(Object(Z.L)()),this.logLevel(Z.b),this._clock=0,this._rank=0,this._locale=Object(tt.a)();try{this._loader=Object(Q.e)()}catch(t){}this._touched=et(Z.x),this._input={},this._pulse=null,this._heap=Tt((t,e)=>t.qrank-e.qrank),this._postrun=[]}function Rt(t){return function(){return this._log[t].apply(this,arguments)}}function Pt(t,e){yt.call(this,t,null,e)}Nt.prototype={stamp(){return this._clock},loader(t){return arguments.length?(this._loader=t,this):this._loader},locale(t){return arguments.length?(this._locale=t,this):this._locale},logger(t){return arguments.length?(this._log=t,this):this._log},error:Rt("error"),warn:Rt("warn"),info:Rt("info"),debug:Rt("debug"),logLevel:Rt("level"),cleanThreshold:1e4,add:function(t,e,n,r){let i,o=1;return t instanceof yt?i=t:t&&t.prototype instanceof yt?i=new t:Object(Z.E)(t)?i=new yt(null,t):(o=0,i=new yt(t,e)),this.rank(i),o&&(r=n,n=e),n&&this.connect(i,i.parameters(n,r)),this.touch(i),i},connect:function(t,e){const n=t.rank,r=e.length;for(let i=0;i<r;++i)if(n<e[i].rank)return void this.rerank(t)},rank:function(t){t.rank=++this._rank},rerank:function(t){const e=[t];let n,r,i;for(;e.length;)if(this.rank(n=e.pop()),r=n._targets)for(i=r.length;--i>=0;)e.push(n=r[i]),n===t&&Object(Z.o)("Cycle detected in dataflow graph.")},pulse:function(t,e,n){this.touch(t,n||zt);const r=new At(this,this._clock+(this._pulse?0:1)),i=t.pulse&&t.pulse.source||[];return r.target=t,this._input[t.id]=e.pulse(r,i),this},touch:function(t,e){const n=e||zt;return this._pulse?this._enqueue(t):this._touched.add(t),n.skip&&t.skip(!0),this},update:function(t,e,n){const r=n||zt;return(t.set(e)||r.force)&&this.touch(t,r),this},changeset:pt,ingest:function(t,e,n){return e=this.parse(e,n),this.pulse(t,this.changeset().insert(e))},parse:function(t,e){const n=this.locale();return Object(Q.f)(t,e,n.timeParse,n.utcParse)},preload:async function(t,e,n){const r=this,i=r._pending||function(t){let e;const n=new Promise(t=>e=t);return n.requests=0,n.done=()=>{0==--n.requests&&(t._pending=null,e(t))},t._pending=n}(r);i.requests+=1;const o=await r.request(e,n);return r.pulse(t,r.changeset().remove(Z.hb).insert(o.data||[])),i.done(),o},request:async function(t,e){const n=this;let r,i=0;try{r=await n.loader().load(t,{context:"dataflow",response:Object(Q.g)(e&&e.type)});try{r=n.parse(r,e)}catch(e){i=-2,n.warn("Data ingestion failed",t,e)}}catch(e){i=-1,n.warn("Loading failed",t,e)}return{data:r,status:i}},events:function(t,e,n,r){const i=this,o=Ot(n,r),a=function(t){t.dataflow=i;try{o.receive(t)}catch(t){i.error(t)}finally{i.run()}};let s;s="string"==typeof t&&"undefined"!=typeof document?document.querySelectorAll(t):Object(Z.i)(t);const u=s.length;for(let t=0;t<u;++t)s[t].addEventListener(e,a);return o},on:function(t,e,n,r,i){return(t instanceof yt?kt:jt)(this,t,e,n,r,i),this},evaluate:async function(t,e,n){const r=this,i=[];if(r._pulse)return Ft(r);if(r._pending&&await r._pending,e&&await nt(r,e),!r._touched.length)return r.debug("Dataflow invoked, but nothing to do."),r;const o=++r._clock;r._pulse=new At(r,o,t),r._touched.forEach(t=>r._enqueue(t,!0)),r._touched=et(Z.x);let a,s,u,l=0;try{for(;r._heap.size()>0;)a=r._heap.pop(),a.rank===a.qrank?(s=a.run(r._getPulse(a,t)),s.then?s=await s:s.async&&(i.push(s.async),s=Et),s!==Et&&a._targets&&a._targets.forEach(t=>r._enqueue(t)),++l):r._enqueue(a,!0)}catch(t){r._heap.clear(),u=t}if(r._input={},r._pulse=null,r.debug("Pulse ".concat(o,": ").concat(l," operators")),u&&(r._postrun=[],r.error(u)),r._postrun.length){const t=r._postrun.sort((t,e)=>e.priority-t.priority);r._postrun=[];for(let e=0;e<t.length;++e)await nt(r,t[e].callback)}return n&&await nt(r,n),i.length&&Promise.all(i).then(t=>r.runAsync(null,()=>{t.forEach(t=>{try{t(r)}catch(t){r.error(t)}})})),r},run:function(t,e,n){return this._pulse?Ft(this):(this.evaluate(t,e,n),this)},runAsync:async function(t,e,n){for(;this._running;)await this._running;const r=()=>this._running=null;return(this._running=this.evaluate(t,e,n)).then(r,r),this._running},runAfter:function(t,e,n){if(this._pulse||e)this._postrun.push({priority:n||0,callback:t});else try{t(this)}catch(t){this.error(t)}},_enqueue:function(t,e){const n=t.stamp<this._clock;n&&(t.stamp=this._clock),(n||e)&&(t.qrank=t.rank,this._heap.push(t))},_getPulse:function(t,e){const n=t.source,r=this._clock;return n&&Object(Z.B)(n)?new Ct(this,r,n.map(t=>t.pulse),e):this._input[t.id]||function(t,e){if(e&&e.stamp===t.stamp)return e;t=t.fork(),e&&e!==Et&&(t.source=e.source);return t}(this._pulse,n&&n.pulse)}},Object(Z.z)(Pt,yt,{run(t){if(t.stamp<this.stamp)return t.StopPropagation;let e;return this.skip()?this.skip(!1):e=this.evaluate(t),e=e||t,e.then?e=e.then(t=>this.pulse=t):e!==t.StopPropagation&&(this.pulse=e),e},evaluate(t){const e=this.marshall(t.stamp),n=this.transform(e,t);return e.clear(),n},transform(){}});const Bt={};function Lt(t){const e=It(t);return e&&e.Definition||null}function It(t){return t=t&&t.toLowerCase(),Object(Z.w)(Bt,t)?Bt[t]:null}var Ut=n(21);function qt(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n<i||void 0===n&&i>=i)&&(n=i)}return n}function Wt(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function Yt(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}var Ht=function(t){return null===t?NaN:+t};function Gt(t,e,n){if(r=(t=Float64Array.from(function*(t,e){if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(yield e);else{let n=-1;for(let r of t)null!=(r=e(r,++n,t))&&(r=+r)>=r&&(yield r)}}(t,n))).length){if((e=+e)<=0||r<2)return Wt(t);if(e>=1)return qt(t);var r,i=(r-1)*e,o=Math.floor(i),a=qt(function t(e,n,r=0,i=e.length-1,o=Ut.a){for(;i>r;){if(i-r>600){const a=i-r+1,s=n-r+1,u=Math.log(a),l=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*l*(a-l)/a)*(s-a/2<0?-1:1);t(e,n,Math.max(r,Math.floor(n-s*l/a+c)),Math.min(i,Math.floor(n+(a-s)*l/a+c)),o)}const a=e[n];let s=r,u=i;for(Yt(e,r,n),o(e[i],a)>0&&Yt(e,r,i);s<u;){for(Yt(e,s,u),++s,--u;o(e[s],a)<0;)++s;for(;o(e[u],a)>0;)--u}0===o(e[r],a)?Yt(e,r,u):(++u,Yt(e,u,i)),u<=n&&(r=u+1),n<=u&&(i=u-1)}return e}(t,o).subarray(0,o+1));return a+(Wt(t.subarray(o+1))-a)*(i-o)}}function Vt(t,e,n=Ht){if(r=t.length){if((e=+e)<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),a=+n(t[o],o,t);return a+(+n(t[o+1],o+1,t)-a)*(i-o)}}var Xt=function(t,e){return Gt(t,.5,e)};function*Jt(t,e){if(null==e)for(let e of t)null!=e&&""!==e&&(e=+e)>=e&&(yield e);else{let n=-1;for(let r of t)r=e(r,++n,t),null!=r&&""!==r&&(r=+r)>=r&&(yield r)}}function Kt(t,e,n){const r=Float64Array.from(Jt(t,n));return r.sort(Ut.a),e.map(t=>Vt(r,t))}function Zt(t,e){return Kt(t,[.25,.5,.75],e)}function Qt(t,e){const n=t.length,r=function(t,e){const n=function(t,e){let n,r=0,i=0,o=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(n=e-i,i+=n/++r,o+=n*(e-i));else{let a=-1;for(let s of t)null!=(s=e(s,++a,t))&&(s=+s)>=s&&(n=s-i,i+=n/++r,o+=n*(s-i))}if(r>1)return o/(r-1)}(t,e);return n?Math.sqrt(n):n}(t,e),i=Zt(t,e),o=(i[2]-i[0])/1.34;return 1.06*(Math.min(r,o)||r||Math.abs(i[0])||1)*Math.pow(n,-.2)}function te(t){const e=t.maxbins||20,n=t.base||10,r=Math.log(n),i=t.divide||[5,2];let o,a,s,u,l,c,f=t.extent[0],d=t.extent[1];const h=t.span||d-f||Math.abs(f)||1;if(t.step)o=t.step;else if(t.steps){for(u=h/e,l=0,c=t.steps.length;l<c&&t.steps[l]<u;++l);o=t.steps[Math.max(0,l-1)]}else{for(a=Math.ceil(Math.log(e)/r),s=t.minstep||0,o=Math.max(s,Math.pow(n,Math.round(Math.log(h)/r)-a));Math.ceil(h/o)>e;)o*=n;for(l=0,c=i.length;l<c;++l)u=o/i[l],u>=s&&h/u<=e&&(o=u)}u=Math.log(o);const p=u>=0?0:1+~~(-u/r),g=Math.pow(n,-p-1);return(t.nice||void 0===t.nice)&&(u=Math.floor(f/o+g)*o,f=f<u?u-o:u,d=Math.ceil(d/o)*o),{start:f,stop:d===f?f+o:d,step:o}}var ee=Math.random;function ne(t){ee=t}function re(t,e,n,r){if(!t.length)return[void 0,void 0];const i=Float64Array.from(Jt(t,r)),o=i.length,a=e;let s,u,l,c;for(l=0,c=Array(a);l<a;++l){for(s=0,u=0;u<o;++u)s+=i[~~(ee()*o)];c[l]=s/o}return c.sort(Ut.a),[Gt(c,n/2),Gt(c,1-n/2)]}function ie(t,e,n,r){r=r||(t=>t);const i=t.length,o=new Float64Array(i);let a,s=0,u=1,l=r(t[0]),c=l,f=l+e;for(;u<i;++u){if(a=r(t[u]),a>=f){for(c=(l+c)/2;s<u;++s)o[s]=c;f=a+e,l=a}c=a}for(c=(l+c)/2;s<u;++s)o[s]=c;return n?function(t,e){const n=t.length;let r,i,o=0,a=1;for(;t[o]===t[a];)++a;for(;a<n;){for(r=a+1;t[a]===t[r];)++r;if(t[a]-t[a-1]<e){for(i=a+(o+r-a-a>>1);i<a;)t[i++]=t[a];for(;i>a;)t[i--]=t[o]}o=a,a=r}return t}(o,e+e/4):o}function oe(t){return function(){return(t=(1103515245*t+12345)%2147483647)/2147483647}}function ae(t,e){let n,r,i;null==e&&(e=t,t=0);const o={min(t){return arguments.length?(n=t||0,i=r-n,o):n},max(t){return arguments.length?(r=t||0,i=r-n,o):r},sample:()=>n+Math.floor(i*ee()),pdf:t=>t===Math.floor(t)&&t>=n&&t<r?1/i:0,cdf(t){const e=Math.floor(t);return e<n?0:e>=r?1:(e-n+1)/i},icdf:t=>t>=0&&t<=1?n-1+Math.floor(t*i):NaN};return o.min(t).max(e)}const se=Math.sqrt(2*Math.PI),ue=Math.SQRT2;let le=NaN;function ce(t,e){t=t||0,e=null==e?1:e;let n,r,i=0,o=0;if(le==le)i=le,le=NaN;else{do{i=2*ee()-1,o=2*ee()-1,n=i*i+o*o}while(0===n||n>1);r=Math.sqrt(-2*Math.log(n)/n),i*=r,le=o*r}return t+i*e}function fe(t,e,n){const r=(t-(e||0))/(n=null==n?1:n);return Math.exp(-.5*r*r)/(n*se)}function de(t,e,n){const r=(t-(e=e||0))/(n=null==n?1:n),i=Math.abs(r);let o;if(i>37)o=0;else{const t=Math.exp(-i*i/2);let e;i<7.07106781186547?(e=.0352624965998911*i+.700383064443688,e=e*i+6.37396220353165,e=e*i+33.912866078383,e=e*i+112.079291497871,e=e*i+221.213596169931,e=e*i+220.206867912376,o=t*e,e=.0883883476483184*i+1.75566716318264,e=e*i+16.064177579207,e=e*i+86.7807322029461,e=e*i+296.564248779674,e=e*i+637.333633378831,e=e*i+793.826512519948,e=e*i+440.413735824752,o/=e):(e=i+.65,e=i+4/e,e=i+3/e,e=i+2/e,e=i+1/e,o=t/e/2.506628274631)}return r>0?1-o:o}function he(t,e,n){return t<0||t>1?NaN:(e||0)+(null==n?1:n)*ue*function(t){let e,n=-Math.log((1-t)*(1+t));n<6.25?(n-=3.125,e=-364441206401782e-35,e=e*n-16850591381820166e-35,e=128584807152564e-32+e*n,e=11157877678025181e-33+e*n,e=e*n-1333171662854621e-31,e=20972767875968562e-33+e*n,e=6637638134358324e-30+e*n,e=e*n-4054566272975207e-29,e=e*n-8151934197605472e-29,e=26335093153082323e-28+e*n,e=e*n-12975133253453532e-27,e=e*n-5415412054294628e-26,e=1.0512122733215323e-9+e*n,e=e*n-4.112633980346984e-9,e=e*n-2.9070369957882005e-8,e=4.2347877827932404e-7+e*n,e=e*n-13654692000834679e-22,e=e*n-13882523362786469e-21,e=.00018673420803405714+e*n,e=e*n-.000740702534166267,e=e*n-.006033670871430149,e=.24015818242558962+e*n,e=1.6536545626831027+e*n):n<16?(n=Math.sqrt(n)-3.25,e=2.2137376921775787e-9,e=9.075656193888539e-8+e*n,e=e*n-2.7517406297064545e-7,e=1.8239629214389228e-8+e*n,e=15027403968909828e-22+e*n,e=e*n-4013867526981546e-21,e=29234449089955446e-22+e*n,e=12475304481671779e-21+e*n,e=e*n-47318229009055734e-21,e=6828485145957318e-20+e*n,e=24031110387097894e-21+e*n,e=e*n-.0003550375203628475,e=.0009532893797373805+e*n,e=e*n-.0016882755560235047,e=.002491442096107851+e*n,e=e*n-.003751208507569241,e=.005370914553590064+e*n,e=1.0052589676941592+e*n,e=3.0838856104922208+e*n):Number.isFinite(n)?(n=Math.sqrt(n)-5,e=-27109920616438573e-27,e=e*n-2.555641816996525e-10,e=1.5076572693500548e-9+e*n,e=e*n-3.789465440126737e-9,e=7.61570120807834e-9+e*n,e=e*n-1.496002662714924e-8,e=2.914795345090108e-8+e*n,e=e*n-6.771199775845234e-8,e=2.2900482228026655e-7+e*n,e=e*n-9.9298272942317e-7,e=4526062597223154e-21+e*n,e=e*n-1968177810553167e-20,e=7599527703001776e-20+e*n,e=e*n-.00021503011930044477,e=e*n-.00013871931833623122,e=1.0103004648645344+e*n,e=4.849906401408584+e*n):e=1/0;return e*t}(2*t-1)}function pe(t,e){let n,r;const i={mean(t){return arguments.length?(n=t||0,i):n},stdev(t){return arguments.length?(r=null==t?1:t,i):r},sample:()=>ce(n,r),pdf:t=>fe(t,n,r),cdf:t=>de(t,n,r),icdf:t=>he(t,n,r)};return i.mean(t).stdev(e)}function ge(t,e){const n=pe();let r=0;const i={data(n){return arguments.length?(t=n,r=n?n.length:0,i.bandwidth(e)):t},bandwidth(n){return arguments.length?(!(e=n)&&t&&(e=Qt(t)),i):e},sample:()=>t[~~(ee()*r)]+e*n.sample(),pdf(i){let o=0,a=0;for(;a<r;++a)o+=n.pdf((i-t[a])/e);return o/e/r},cdf(i){let o=0,a=0;for(;a<r;++a)o+=n.cdf((i-t[a])/e);return o/r},icdf(){throw Error("KDE icdf not supported.")}};return i.data(t)}function me(t,e){return t=t||0,e=null==e?1:e,Math.exp(t+ce()*e)}function be(t,e,n){if(t<=0)return 0;e=e||0,n=null==n?1:n;const r=(Math.log(t)-e)/n;return Math.exp(-.5*r*r)/(n*se*t)}function ye(t,e,n){return de(Math.log(t),e,n)}function ve(t,e,n){return Math.exp(he(t,e,n))}function xe(t,e){let n,r;const i={mean(t){return arguments.length?(n=t||0,i):n},stdev(t){return arguments.length?(r=null==t?1:t,i):r},sample:()=>me(n,r),pdf:t=>be(t,n,r),cdf:t=>ye(t,n,r),icdf:t=>ve(t,n,r)};return i.mean(t).stdev(e)}function _e(t,e){let n,r=0;const i={weights(t){return arguments.length?(n=function(t){const e=[];let n,i=0;for(n=0;n<r;++n)i+=e[n]=null==t[n]?1:+t[n];for(n=0;n<r;++n)e[n]/=i;return e}(e=t||[]),i):e},distributions(n){return arguments.length?(n?(r=n.length,t=n):(r=0,t=[]),i.weights(e)):t},sample(){const e=ee();let i=t[r-1],o=n[0],a=0;for(;a<r-1;o+=n[++a])if(e<o){i=t[a];break}return i.sample()},pdf(e){let i=0,o=0;for(;o<r;++o)i+=n[o]*t[o].pdf(e);return i},cdf(e){let i=0,o=0;for(;o<r;++o)i+=n[o]*t[o].cdf(e);return i},icdf(){throw Error("Mixture icdf not supported.")}};return i.distributions(t).weights(e)}function Oe(t,e){return null==e&&(e=null==t?1:t,t=0),t+(e-t)*ee()}function we(t,e,n){return null==n&&(n=null==e?1:e,e=0),t>=e&&t<=n?1/(n-e):0}function je(t,e,n){return null==n&&(n=null==e?1:e,e=0),t<e?0:t>n?1:(t-e)/(n-e)}function ke(t,e,n){return null==n&&(n=null==e?1:e,e=0),t>=0&&t<=1?e+t*(n-e):NaN}function Ee(t,e){let n,r;const i={min(t){return arguments.length?(n=t||0,i):n},max(t){return arguments.length?(r=null==t?1:t,i):r},sample:()=>Oe(n,r),pdf:t=>we(t,n,r),cdf:t=>je(t,n,r),icdf:t=>ke(t,n,r)};return null==e&&(e=null==t?1:t,t=0),i.min(t).max(e)}function Ae(t,e,n,r){const i=r-t*t,o=Math.abs(i)<1e-24?0:(n-t*e)/i;return[e-o*t,o]}function De(t,e,n,r){t=t.filter(t=>{let r=e(t),i=n(t);return null!=r&&(r=+r)>=r&&null!=i&&(i=+i)>=i}),r&&t.sort((t,n)=>e(t)-e(n));const i=t.length,o=new Float64Array(i),a=new Float64Array(i);let s,u,l,c=0,f=0,d=0;for(l of t)o[c]=s=+e(l),a[c]=u=+n(l),++c,f+=(s-f)/c,d+=(u-d)/c;for(c=0;c<i;++c)o[c]-=f,a[c]-=d;return[o,a,f,d]}function Me(t,e,n,r){let i,o,a=-1;for(const s of t)i=e(s),o=n(s),null!=i&&(i=+i)>=i&&null!=o&&(o=+o)>=o&&r(i,o,++a)}function Se(t,e,n,r,i){let o=0,a=0;return Me(t,e,n,(t,e)=>{const n=e-i(t),s=e-r;o+=n*n,a+=s*s}),1-o/a}function Ce(t,e,n){let r=0,i=0,o=0,a=0,s=0;Me(t,e,n,(t,e)=>{++s,r+=(t-r)/s,i+=(e-i)/s,o+=(t*e-o)/s,a+=(t*t-a)/s});const u=Ae(r,i,o,a),l=t=>u[0]+u[1]*t;return{coef:u,predict:l,rSquared:Se(t,e,n,i,l)}}function Fe(t,e,n){let r=0,i=0,o=0,a=0,s=0;Me(t,e,n,(t,e)=>{++s,t=Math.log(t),r+=(t-r)/s,i+=(e-i)/s,o+=(t*e-o)/s,a+=(t*t-a)/s});const u=Ae(r,i,o,a),l=t=>u[0]+u[1]*Math.log(t);return{coef:u,predict:l,rSquared:Se(t,e,n,i,l)}}function ze(t,e,n){const[r,i,o,a]=De(t,e,n);let s,u,l,c=0,f=0,d=0,h=0,p=0;Me(t,e,n,(t,e)=>{s=r[p++],u=Math.log(e),l=s*e,c+=(e*u-c)/p,f+=(l-f)/p,d+=(l*u-d)/p,h+=(s*l-h)/p});const[g,m]=Ae(f/a,c/a,d/a,h/a),b=t=>Math.exp(g+m*(t-o));return{coef:[Math.exp(g-m*o),m],predict:b,rSquared:Se(t,e,n,a,b)}}function Te(t,e,n){let r=0,i=0,o=0,a=0,s=0,u=0;Me(t,e,n,(t,e)=>{const n=Math.log(t),l=Math.log(e);++u,r+=(n-r)/u,i+=(l-i)/u,o+=(n*l-o)/u,a+=(n*n-a)/u,s+=(e-s)/u});const l=Ae(r,i,o,a),c=t=>l[0]*Math.pow(t,l[1]);return l[0]=Math.exp(l[0]),{coef:l,predict:c,rSquared:Se(t,e,n,s,c)}}function $e(t,e,n){const[r,i,o,a]=De(t,e,n),s=r.length;let u,l,c,f,d=0,h=0,p=0,g=0,m=0;for(u=0;u<s;)l=r[u],c=i[u++],f=l*l,d+=(f-d)/u,h+=(f*l-h)/u,p+=(f*f-p)/u,g+=(l*c-g)/u,m+=(f*c-m)/u;const b=p-d*d,y=d*b-h*h,v=(m*d-g*h)/y,x=(g*b-m*h)/y,_=-v*d,O=t=>v*(t-=o)*t+x*t+_+a;return{coef:[_-x*o+v*o*o+a,x-2*v*o,v],predict:O,rSquared:Se(t,e,n,a,O)}}function Ne(t,e,n,r){if(1===r)return Ce(t,e,n);if(2===r)return $e(t,e,n);const[i,o,a,s]=De(t,e,n),u=i.length,l=[],c=[],f=r+1;let d,h,p,g,m;for(d=0;d<f;++d){for(p=0,g=0;p<u;++p)g+=Math.pow(i[p],d)*o[p];for(l.push(g),m=new Float64Array(f),h=0;h<f;++h){for(p=0,g=0;p<u;++p)g+=Math.pow(i[p],d+h);m[h]=g}c.push(m)}c.push(l);const b=function(t){const e=t.length-1,n=[];let r,i,o,a,s;for(r=0;r<e;++r){for(a=r,i=r+1;i<e;++i)Math.abs(t[r][i])>Math.abs(t[r][a])&&(a=i);for(o=r;o<e+1;++o)s=t[o][r],t[o][r]=t[o][a],t[o][a]=s;for(i=r+1;i<e;++i)for(o=e;o>=r;o--)t[o][i]-=t[o][r]*t[r][i]/t[r][r]}for(i=e-1;i>=0;--i){for(s=0,o=i+1;o<e;++o)s+=t[o][i]*n[o];n[i]=(t[e][i]-s)/t[i][i]}return n}(c),y=t=>{t-=a;let e=s+b[0]+b[1]*t+b[2]*t*t;for(d=3;d<f;++d)e+=b[d]*Math.pow(t,d);return e};return{coef:Re(f,b,-a,s),predict:y,rSquared:Se(t,e,n,s,y)}}function Re(t,e,n,r){const i=Array(t);let o,a,s,u;for(o=0;o<t;++o)i[o]=0;for(o=t-1;o>=0;--o)for(s=e[o],u=1,i[o]+=s,a=1;a<=o;++a)u*=(o+1-a)/a,i[o-a]+=s*Math.pow(n,a)*u;return i[0]+=r,i}function Pe(t,e,n,r){const[i,o,a,s]=De(t,e,n,!0),u=i.length,l=Math.max(2,~~(r*u)),c=new Float64Array(u),f=new Float64Array(u),d=new Float64Array(u).fill(1);for(let t=-1;++t<=2;){const e=[0,l-1];for(let t=0;t<u;++t){const n=i[t],r=e[0],a=e[1],s=n-i[r]>i[a]-n?r:a;let u=0,l=0,h=0,p=0,g=0;const m=1/Math.abs(i[s]-n||1);for(let t=r;t<=a;++t){const e=i[t],r=o[t],a=Be(Math.abs(n-e)*m)*d[t],s=e*a;u+=a,l+=s,h+=r*a,p+=r*s,g+=e*s}const[b,y]=Ae(l/u,h/u,p/u,g/u);c[t]=b+y*n,f[t]=Math.abs(o[t]-c[t]),Le(i,t+1,e)}if(2===t)break;const n=Xt(f);if(Math.abs(n)<1e-12)break;for(let t,e,r=0;r<u;++r)t=f[r]/(6*n),d[r]=t>=1?1e-12:(e=1-t*t)*e}return function(t,e,n,r){const i=t.length,o=[];let a,s=0,u=0,l=[];for(;s<i;++s)a=t[s]+n,l[0]===a?l[1]+=(e[s]-l[1])/++u:(u=0,l[1]+=r,l=[a,e[s]],o.push(l));return l[1]+=r,o}(i,c,a,s)}function Be(t){return(t=1-t*t*t)*t*t}function Le(t,e,n){const r=t[e];let i=n[0],o=n[1]+1;if(!(o>=t.length))for(;e>i&&t[o]-r<=r-t[i];)n[0]=++i,n[1]=o,++o}const Ie=.1*Math.PI/180;function Ue(t,e,n,r){n=n||25,r=Math.max(n,r||200);const i=e=>[e,t(e)],o=e[0],a=e[1],s=a-o,u=s/r,l=[i(o)],c=[];if(n===r){for(let t=1;t<r;++t)l.push(i(o+t/n*s));return l.push(i(a)),l}c.push(i(a));for(let t=n;--t>0;)c.push(i(o+t/n*s));let f=l[0],d=c[c.length-1];for(;d;){const t=i((f[0]+d[0])/2);t[0]-f[0]>=u&&qe(f,t,d)>Ie?c.push(t):(f=d,l.push(d),c.pop()),d=c[c.length-1]}return l}function qe(t,e,n){const r=Math.atan2(n[1]-t[1],n[0]-t[0]),i=Math.atan2(e[1]-t[1],e[0]-t[0]);return Math.abs(r-i)}var We=function(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(i);++r<i;)o[r]=t+r*n;return o},Ye=n(35),He=n(1);function Ge(t){return t&&t.length?1===t.length?t[0]:(e=t,t=>{const n=e.length;let r=1,i=String(e[0](t));for(;r<n;++r)i+="|"+e[r](t);return i}):function(){return""};var e}function Ve(t,e,n){return n||t+(e?"_"+e:"")}const Xe=()=>{},Je={init:Xe,add:Xe,rem:Xe,idx:0},Ke={values:{init:t=>t.cell.store=!0,value:t=>t.cell.data.values(),idx:-1},count:{value:t=>t.cell.num},__count__:{value:t=>t.missing+t.valid},missing:{value:t=>t.missing},valid:{value:t=>t.valid},sum:{init:t=>t.sum=0,value:t=>t.sum,add:(t,e)=>t.sum+=+e,rem:(t,e)=>t.sum-=e},product:{init:t=>t.product=1,value:t=>t.valid?t.product:void 0,add:(t,e)=>t.product*=e,rem:(t,e)=>t.product/=e},mean:{init:t=>t.mean=0,value:t=>t.valid?t.mean:void 0,add:(t,e)=>(t.mean_d=e-t.mean,t.mean+=t.mean_d/t.valid),rem:(t,e)=>(t.mean_d=e-t.mean,t.mean-=t.valid?t.mean_d/t.valid:t.mean)},average:{value:t=>t.valid?t.mean:void 0,req:["mean"],idx:1},variance:{init:t=>t.dev=0,value:t=>t.valid>1?t.dev/(t.valid-1):void 0,add:(t,e)=>t.dev+=t.mean_d*(e-t.mean),rem:(t,e)=>t.dev-=t.mean_d*(e-t.mean),req:["mean"],idx:1},variancep:{value:t=>t.valid>1?t.dev/t.valid:void 0,req:["variance"],idx:2},stdev:{value:t=>t.valid>1?Math.sqrt(t.dev/(t.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:t=>t.valid>1?Math.sqrt(t.dev/t.valid):void 0,req:["variance"],idx:2},stderr:{value:t=>t.valid>1?Math.sqrt(t.dev/(t.valid*(t.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:t=>t.cell.data.distinct(t.get),req:["values"],idx:3},ci0:{value:t=>t.cell.data.ci0(t.get),req:["values"],idx:3},ci1:{value:t=>t.cell.data.ci1(t.get),req:["values"],idx:3},median:{value:t=>t.cell.data.q2(t.get),req:["values"],idx:3},q1:{value:t=>t.cell.data.q1(t.get),req:["values"],idx:3},q3:{value:t=>t.cell.data.q3(t.get),req:["values"],idx:3},min:{init:t=>t.min=void 0,value:t=>t.min=Number.isNaN(t.min)?t.cell.data.min(t.get):t.min,add:(t,e)=>{(e<t.min||void 0===t.min)&&(t.min=e)},rem:(t,e)=>{e<=t.min&&(t.min=NaN)},req:["values"],idx:4},max:{init:t=>t.max=void 0,value:t=>t.max=Number.isNaN(t.max)?t.cell.data.max(t.get):t.max,add:(t,e)=>{(e>t.max||void 0===t.max)&&(t.max=e)},rem:(t,e)=>{e>=t.max&&(t.max=NaN)},req:["values"],idx:4},argmin:{init:t=>t.argmin=void 0,value:t=>t.argmin||t.cell.data.argmin(t.get),add:(t,e,n)=>{e<t.min&&(t.argmin=n)},rem:(t,e)=>{e<=t.min&&(t.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:t=>t.argmax=void 0,value:t=>t.argmax||t.cell.data.argmax(t.get),add:(t,e,n)=>{e>t.max&&(t.argmax=n)},rem:(t,e)=>{e>=t.max&&(t.argmax=void 0)},req:["max","values"],idx:3}},Ze=Object.keys(Ke);function Qe(t,e){return Ke[t](e)}function tn(t,e){return t.idx-e.idx}function en(){this.valid=0,this.missing=0,this._ops.forEach(t=>t.init(this))}function nn(t,e){null!=t&&""!==t?t==t&&(++this.valid,this._ops.forEach(n=>n.add(this,t,e))):++this.missing}function rn(t,e){null!=t&&""!==t?t==t&&(--this.valid,this._ops.forEach(n=>n.rem(this,t,e))):--this.missing}function on(t){return this._out.forEach(e=>t[e.out]=e.value(this)),t}function an(t,e){const n=e||Z.y,r=function(t){const e={};t.forEach(t=>e[t.name]=t);const n=t=>{t.req&&t.req.forEach(t=>{e[t]||n(e[t]=Ke[t]())})};return t.forEach(n),Object.values(e).sort(tn)}(t),i=t.slice().sort(tn);function o(t){this._ops=r,this._out=i,this.cell=t,this.init()}return o.prototype.init=en,o.prototype.add=nn,o.prototype.rem=rn,o.prototype.set=on,o.prototype.get=n,o.fields=t.map(t=>t.out),o}function sn(t){this._key=t?Object(Z.u)(t):at,this.reset()}Ze.forEach(t=>{Ke[t]=function(t,e){return n=>Object(Z.p)({name:t,out:n||t},Je,e)}(t,Ke[t])});const un=sn.prototype;function ln(t){Pt.call(this,null,t),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}un.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},un.add=function(t){this._add.push(t)},un.rem=function(t){this._rem.push(t)},un.values=function(){if(this._get=null,0===this._rem.length)return this._add;const t=this._add,e=this._rem,n=this._key,r=t.length,i=e.length,o=Array(r-i),a={};let s,u,l;for(s=0;s<i;++s)a[n(e[s])]=1;for(s=0,u=0;s<r;++s)a[n(l=t[s])]?a[n(l)]=0:o[u++]=l;return this._rem=[],this._add=o},un.distinct=function(t){const e=this.values(),n={};let r,i=e.length,o=0;for(;--i>=0;)r=t(e[i])+"",Object(Z.w)(n,r)||(n[r]=1,++o);return o},un.extent=function(t){if(this._get!==t||!this._ext){const e=this.values(),n=Object(Z.r)(e,t);this._ext=[e[n[0]],e[n[1]]],this._get=t}return this._ext},un.argmin=function(t){return this.extent(t)[0]||{}},un.argmax=function(t){return this.extent(t)[1]||{}},un.min=function(t){const e=this.extent(t)[0];return null!=e?t(e):void 0},un.max=function(t){const e=this.extent(t)[1];return null!=e?t(e):void 0},un.quartile=function(t){return this._get===t&&this._q||(this._q=Zt(this.values(),t),this._get=t),this._q},un.q1=function(t){return this.quartile(t)[0]},un.q2=function(t){return this.quartile(t)[1]},un.q3=function(t){return this.quartile(t)[2]},un.ci=function(t){return this._get===t&&this._ci||(this._ci=re(this.values(),1e3,.05,t),this._get=t),this._ci},un.ci0=function(t){return this.ci(t)[0]},un.ci1=function(t){return this.ci(t)[1]},ln.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:Ze},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]},Object(Z.z)(ln,Pt,{transform(t,e){const n=this,r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=t.modified();return n.stamp=r.stamp,n.value&&(i||e.modified(n._inputs,!0))?(n._prev=n.value,n.value=i?n.init(t):{},e.visit(e.SOURCE,t=>n.add(t))):(n.value=n.value||n.init(t),e.visit(e.REM,t=>n.rem(t)),e.visit(e.ADD,t=>n.add(t))),r.modifies(n._outputs),n._drop=!1!==t.drop,t.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),e.clean()&&n._drop&&r.clean(!0).runAfter(()=>this.clean()),n.changes(r)},cross(){const t=this,e=t.value,n=t._dnames,r=n.map(()=>({})),i=n.length;function o(t){let e,o,a,s;for(e in t)for(a=t[e].tuple,o=0;o<i;++o)r[o][s=a[n[o]]]=s}o(t._prev),o(e),function o(a,s,u){const l=n[u],c=r[u++];for(const n in c){const r=a?a+"|"+n:n;s[l]=c[n],u<i?o(r,s,u):e[r]||t.cell(r,s)}}("",{},0)},init(t){const e=this._inputs=[],n=this._outputs=[],r={};function i(t){const n=Object(Z.i)(Object(Z.g)(t)),i=n.length;let o,a=0;for(;a<i;++a)r[o=n[a]]||(r[o]=1,e.push(o))}this._dims=Object(Z.i)(t.groupby),this._dnames=this._dims.map(t=>{const e=Object(Z.h)(t);return i(t),n.push(e),e}),this.cellkey=t.key?t.key:Ge(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const o=t.fields||[null],a=t.ops||["count"],s=t.as||[],u=o.length,l={};let c,f,d,h,p,g;for(u!==a.length&&Object(Z.o)("Unmatched number of fields and aggregate ops."),g=0;g<u;++g)c=o[g],f=a[g],null==c&&"count"!==f&&Object(Z.o)("Null aggregate field specified."),h=Object(Z.h)(c),p=Ve(f,h,s[g]),n.push(p),"count"!==f?(d=l[h],d||(i(c),d=l[h]=[],d.field=c,this._measures.push(d)),"count"!==f&&(this._countOnly=!1),d.push(Qe(f,p))):this._counts.push(p);return this._measures=this._measures.map(t=>an(t,t.field)),{}},cellkey:Ge(),cell(t,e){let n=this.value[t];return n?0===n.num&&this._drop&&n.stamp<this.stamp?(n.stamp=this.stamp,this._adds[this._alen++]=n):n.stamp<this.stamp&&(n.stamp=this.stamp,this._mods[this._mlen++]=n):(n=this.value[t]=this.newcell(t,e),this._adds[this._alen++]=n),n},newcell(t,e){const n={key:t,num:0,agg:null,tuple:this.newtuple(e,this._prev&&this._prev[t]),stamp:this.stamp,store:!1};if(!this._countOnly){const t=this._measures,e=t.length;n.agg=Array(e);for(let r=0;r<e;++r)n.agg[r]=new t[r](n)}return n.store&&(n.data=new sn),n},newtuple(t,e){const n=this._dnames,r=this._dims,i=r.length,o={};for(let e=0;e<i;++e)o[n[e]]=r[e](t);return e?ft(e.tuple,o):ut(o)},clean(){const t=this.value;for(const e in t)0===t[e].num&&delete t[e]},add(t){const e=this.cellkey(t),n=this.cell(e,t);if(n.num+=1,this._countOnly)return;n.store&&n.data.add(t);const r=n.agg;for(let e=0,n=r.length;e<n;++e)r[e].add(r[e].get(t),t)},rem(t){const e=this.cellkey(t),n=this.cell(e,t);if(n.num-=1,this._countOnly)return;n.store&&n.data.rem(t);const r=n.agg;for(let e=0,n=r.length;e<n;++e)r[e].rem(r[e].get(t),t)},celltuple(t){const e=t.tuple,n=this._counts;t.store&&t.data.values();for(let r=0,i=n.length;r<i;++r)e[n[r]]=t.num;if(!this._countOnly){const n=t.agg;for(let t=0,r=n.length;t<r;++t)n[t].set(e)}return e},changes(t){const e=this._adds,n=this._mods,r=this._prev,i=this._drop,o=t.add,a=t.rem,s=t.mod;let u,l,c,f;if(r)for(l in r)u=r[l],i&&!u.num||a.push(u.tuple);for(c=0,f=this._alen;c<f;++c)o.push(this.celltuple(e[c])),e[c]=null;for(c=0,f=this._mlen;c<f;++c)u=n[c],(0===u.num&&i?a:s).push(this.celltuple(u)),n[c]=null;return this._alen=this._mlen=0,this._prev=null,t}});function cn(t){Pt.call(this,null,t)}function fn(t,e,n){const r=t;let i=e||[],o=n||[],a={},s=0;return{add:t=>o.push(t),remove:t=>a[r(t)]=++s,size:()=>i.length,data:(t,e)=>(s&&(i=i.filter(t=>!a[r(t)]),a={},s=0),e&&t&&i.sort(t),o.length&&(i=t?Object(Z.N)(t,i,o.sort(t)):i.concat(o),o=[]),i)}}function dn(t){Pt.call(this,[],t)}function hn(t){yt.call(this,null,pn,t)}function pn(t){return this.value&&!t.modified()?this.value:Object(Z.l)(t.fields,t.orders)}function gn(t){Pt.call(this,null,t)}function mn(t){Pt.call(this,null,t)}cn.Definition={type:"Bin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"anchor",type:"number"},{name:"maxbins",type:"number",default:20},{name:"base",type:"number",default:10},{name:"divide",type:"number",array:!0,default:[5,2]},{name:"extent",type:"number",array:!0,length:2,required:!0},{name:"span",type:"number"},{name:"step",type:"number"},{name:"steps",type:"number",array:!0},{name:"minstep",type:"number",default:0},{name:"nice",type:"boolean",default:!0},{name:"name",type:"string"},{name:"as",type:"string",array:!0,length:2,default:["bin0","bin1"]}]},Object(Z.z)(cn,Pt,{transform(t,e){const n=!1!==t.interval,r=this._bins(t),i=r.start,o=r.step,a=t.as||["bin0","bin1"],s=a[0],u=a[1];let l;return l=t.modified()?(e=e.reflow(!0)).SOURCE:e.modified(Object(Z.g)(t.field))?e.ADD_MOD:e.ADD,e.visit(l,n?t=>{const e=r(t);t[s]=e,t[u]=null==e?null:i+o*(1+(e-i)/o)}:t=>t[s]=r(t)),e.modifies(n?a:s)},_bins(t){if(this.value&&!t.modified())return this.value;const e=t.field,n=te(t),r=n.step;let i,o,a=n.start,s=a+Math.ceil((n.stop-a)/r)*r;null!=(i=t.anchor)&&(o=i-(a+r*Math.floor((i-a)/r)),a+=o,s+=o);const u=function(t){let n=Object(Z.db)(e(t));return null==n?null:n<a?-1/0:n>s?1/0:(n=Math.max(a,Math.min(n,s-r)),a+r*Math.floor(1e-14+(n-a)/r))};return u.start=a,u.stop=n.stop,u.step=r,this.value=Object(Z.f)(u,Object(Z.g)(e),t.name||"bin_"+Object(Z.h)(e))}}),dn.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]},Object(Z.z)(dn,Pt,{transform(t,e){const n=e.fork(e.ALL),r=fn(at,this.value,n.materialize(n.ADD).add),i=t.sort,o=e.changed()||i&&(t.modified("sort")||e.modified(i.fields));return n.visit(n.REM,r.remove),this.modified(o),this.value=n.source=r.data(dt(i),o),e.source&&e.source.root&&(this.value.root=e.source.root),n}}),Object(Z.z)(hn,yt),gn.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{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:!0,length:2,default:["text","count"]}]},Object(Z.z)(gn,Pt,{transform(t,e){const n=e=>n=>{for(var r,i=function(t,e,n){switch(e){case"upper":t=t.toUpperCase();break;case"lower":t=t.toLowerCase()}return t.match(n)}(s(n),t.case,o)||[],u=0,l=i.length;u<l;++u)a.test(r=i[u])||e(r)},r=this._parameterCheck(t,e),i=this._counts,o=this._match,a=this._stop,s=t.field,u=t.as||["text","count"],l=n(t=>i[t]=1+(i[t]||0)),c=n(t=>i[t]-=1);return r?e.visit(e.SOURCE,l):(e.visit(e.ADD,l),e.visit(e.REM,c)),this._finish(e,u)},_parameterCheck(t,e){let n=!1;return!t.modified("stopwords")&&this._stop||(this._stop=new RegExp("^"+(t.stopwords||"")+"$","i"),n=!0),!t.modified("pattern")&&this._match||(this._match=new RegExp(t.pattern||"[\\w']+","g"),n=!0),(t.modified("field")||e.modified(t.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(t,e){const n=this._counts,r=this._tuples||(this._tuples={}),i=e[0],o=e[1],a=t.fork(t.NO_SOURCE|t.NO_FIELDS);let s,u,l;for(s in n)u=r[s],l=n[s]||0,!u&&l?(r[s]=u=ut({}),u[i]=s,u[o]=l,a.add.push(u)):0===l?(u&&a.rem.push(u),n[s]=null,r[s]=null):u[o]!==l&&(u[o]=l,a.mod.push(u));return a.modifies(e)}}),mn.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]},Object(Z.z)(mn,Pt,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.as||["a","b"],i=r[0],o=r[1],a=!this.value||e.changed(e.ADD_REM)||t.modified("as")||t.modified("filter");let s=this.value;return a?(s&&(n.rem=s),s=e.materialize(e.SOURCE).source,n.add=this.value=function(t,e,n,r){for(var i,o,a=[],s={},u=t.length,l=0;l<u;++l)for(s[e]=o=t[l],i=0;i<u;++i)s[n]=t[i],r(s)&&(a.push(ut(s)),(s={})[e]=o);return a}(s,i,o,t.filter||Z.hb)):n.mod=s,n.source=this.value,n.modifies(r)}});const bn={kde:ge,mixture:_e,normal:pe,lognormal:xe,uniform:Ee};function yn(t){Pt.call(this,null,t)}const vn=[{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:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],xn={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:vn},{name:"weights",type:"number",array:!0}]};function _n(t,e){return t?t.map((t,n)=>e[n]||Object(Z.h)(t)):null}function On(t,e,n){const r=[],i=t=>t(u);let o,a,s,u,l,c;if(null==e)r.push(t.map(n));else for(o={},a=0,s=t.length;a<s;++a)u=t[a],l=e.map(i),c=o[l],c||(o[l]=c=[],c.dims=l,r.push(c)),c.push(n(u));return r}yn.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,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:vn.concat(xn)},{name:"as",type:"string",array:!0,default:["value","density"]}]},Object(Z.z)(yn,Pt,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const r=function t(e,n){const r=e.function;Object(Z.w)(bn,r)||Object(Z.o)("Unknown distribution function: "+r);const i=bn[r]();for(const r in e)"field"===r?i.data((e.from||n()).map(e[r])):"distributions"===r?i[r](e[r].map(e=>t(e,n))):"function"==typeof i[r]&&i[r](e[r]);return i}(t.distribution,function(t){return()=>t.materialize(t.SOURCE).source}(e)),i=t.steps||t.minsteps||25,o=t.steps||t.maxsteps||200;let a=t.method||"pdf";"pdf"!==a&&"cdf"!==a&&Object(Z.o)("Invalid density method: "+a),t.extent||r.data||Object(Z.o)("Missing density extent parameter."),a=r[a];const s=t.as||["value","density"],u=Ue(a,t.extent||Object(Z.q)(r.data()),i,o).map(t=>{const e={};return e[s[0]]=t[0],e[s[1]]=t[1],ut(e)});this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n}});function wn(t){Pt.call(this,null,t)}wn.Definition={type:"DotBin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"step",type:"number"},{name:"smooth",type:"boolean",default:!1},{name:"as",type:"string",default:"bin"}]};function jn(t){yt.call(this,null,kn,t),this.modified(!0)}function kn(t){const e=t.expr;return this.value&&!t.modified("expr")?this.value:Object(Z.f)(n=>e(n,t),Object(Z.g)(e),Object(Z.h)(e))}function En(t){Pt.call(this,[void 0,void 0],t)}function An(t,e){yt.call(this,t),this.parent=e,this.count=0}function Dn(t){Pt.call(this,{},t),this._keys=Object(Z.t)();const e=this._targets=[];e.active=0,e.forEach=t=>{for(let n=0,r=e.active;n<r;++n)t(e[n],n,e)}}function Mn(t){yt.call(this,null,Sn,t)}function Sn(t){return this.value&&!t.modified()?this.value:Object(Z.B)(t.name)?Object(Z.i)(t.name).map(t=>Object(Z.u)(t)):Object(Z.u)(t.name,t.as)}function Cn(t){Pt.call(this,Object(Z.t)(),t)}function Fn(t){Pt.call(this,[],t)}function zn(t){Pt.call(this,[],t)}function Tn(t){Pt.call(this,null,t)}function $n(t){Pt.call(this,[],t)}Object(Z.z)(wn,Pt,{transform(t,e){if(this.value&&!t.modified()&&!e.changed())return e;const n=e.materialize(e.SOURCE).source,r=On(e.source,t.groupby,Z.y),i=t.smooth||!1,o=t.field,a=t.step||((t,e)=>Object(Z.Y)(Object(Z.q)(t,e))/30)(n,o),s=dt((t,e)=>o(t)-o(e)),u=t.as||"bin",l=r.length;let c,f=1/0,d=-1/0,h=0;for(;h<l;++h){const t=r[h].sort(s);c=-1;for(const e of ie(t,a,i,o))e<f&&(f=e),e>d&&(d=e),t[++c][u]=e}return this.value={start:f,stop:d,step:a},e.reflow(!0).modifies(u)}}),Object(Z.z)(jn,yt),En.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]},Object(Z.z)(En,Pt,{transform(t,e){const n=this.value,r=t.field,i=e.changed()||e.modified(r.fields)||t.modified("field");let o=n[0],a=n[1];if((i||null==o)&&(o=1/0,a=-1/0),e.visit(i?e.SOURCE:e.ADD,t=>{const e=Object(Z.db)(r(t));null!=e&&(e<o&&(o=e),e>a&&(a=e))}),!Number.isFinite(o)||!Number.isFinite(a)){let t=Object(Z.h)(r);t&&(t=' for field "'.concat(t,'"')),e.dataflow.warn("Infinite extent".concat(t,": [").concat(o,", ").concat(a,"]")),o=a=void 0}this.value=[o,a]}}),Object(Z.z)(An,yt,{connect(t){return this.detachSubflow=t.detachSubflow,this.targets().add(t),t.source=this},add(t){this.count+=1,this.value.add.push(t)},rem(t){this.count-=1,this.value.rem.push(t)},mod(t){this.value.mod.push(t)},init(t){this.value.init(t,t.NO_SOURCE)},evaluate(){return this.value}}),Object(Z.z)(Dn,Pt,{activate(t){this._targets[this._targets.active++]=t},subflow(t,e,n,r){const i=this.value;let o,a,s=Object(Z.w)(i,t)&&i[t];return s?s.value.stamp<n.stamp&&(s.init(n),this.activate(s)):(a=r||(a=this._group[t])&&a.tuple,o=n.dataflow,s=new An(n.fork(n.NO_SOURCE),this),o.add(s).connect(e(o,t,a)),i[t]=s,this.activate(s)),s},clean(){const t=this.value;for(const e in t)if(0===t[e].count){const n=t[e].detachSubflow;n&&n(),delete t[e]}},initTargets(){const t=this._targets,e=t.length;for(let n=0;n<e&&null!=t[n];++n)t[n]=null;t.active=0},transform(t,e){const n=e.dataflow,r=t.key,i=t.subflow,o=this._keys,a=t.modified("key"),s=t=>this.subflow(t,i,e);return this._group=t.group||{},this.initTargets(),e.visit(e.REM,t=>{const e=at(t),n=o.get(e);void 0!==n&&(o.delete(e),s(n).rem(t))}),e.visit(e.ADD,t=>{const e=r(t);o.set(at(t),e),s(e).add(t)}),a||e.modified(r.fields)?e.visit(e.MOD,t=>{const e=at(t),n=o.get(e),i=r(t);n===i?s(i).mod(t):(o.set(e,i),s(n).rem(t),s(i).add(t))}):e.changed(e.MOD)&&e.visit(e.MOD,t=>{s(o.get(at(t))).mod(t)}),a&&e.visit(e.REFLOW,t=>{const e=at(t),n=o.get(e),i=r(t);n!==i&&(o.set(e,i),s(n).rem(t),s(i).add(t))}),e.clean()?n.runAfter(()=>{this.clean(),o.clean()}):o.empty>n.cleanThreshold&&n.runAfter(o.clean),e}}),Object(Z.z)(Mn,yt),Cn.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]},Object(Z.z)(Cn,Pt,{transform(t,e){const n=e.dataflow,r=this.value,i=e.fork(),o=i.add,a=i.rem,s=i.mod,u=t.expr;let l=!0;function c(e){const n=at(e),i=u(e,t),c=r.get(n);i&&c?(r.delete(n),o.push(e)):i||c?l&&i&&!c&&s.push(e):(r.set(n,1),a.push(e))}return e.visit(e.REM,t=>{const e=at(t);r.has(e)?r.delete(e):a.push(t)}),e.visit(e.ADD,e=>{u(e,t)?o.push(e):r.set(at(e),1)}),e.visit(e.MOD,c),t.modified()&&(l=!1,e.visit(e.REFLOW,c)),r.empty>n.cleanThreshold&&n.runAfter(r.clean),i}}),Fn.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]},Object(Z.z)(Fn,Pt,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.fields,i=_n(r,t.as||[]),o=t.index||null,a=i.length;return n.rem=this.value,e.visit(e.SOURCE,t=>{const e=r.map(e=>e(t)),s=e.reduce((t,e)=>Math.max(t,e.length),0);let u,l,c,f=0;for(;f<s;++f){for(l=lt(t),u=0;u<a;++u)l[i[u]]=null==(c=e[u][f])?null:c;o&&(l[o]=f),n.add.push(l)}}),this.value=n.source=n.add,o&&n.modifies(o),n.modifies(i)}}),zn.Definition={type:"Fold",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0,length:2,default:["key","value"]}]},Object(Z.z)(zn,Pt,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.fields,i=r.map(Z.h),o=t.as||["key","value"],a=o[0],s=o[1],u=r.length;return n.rem=this.value,e.visit(e.SOURCE,t=>{for(let e,o=0;o<u;++o)e=lt(t),e[a]=i[o],e[s]=r[o](t),n.add.push(e)}),this.value=n.source=n.add,n.modifies(o)}}),Tn.Definition={type:"Formula",metadata:{modifies:!0},params:[{name:"expr",type:"expr",required:!0},{name:"as",type:"string",required:!0},{name:"initonly",type:"boolean"}]},Object(Z.z)(Tn,Pt,{transform(t,e){const n=t.expr,r=t.as,i=t.modified(),o=t.initonly?e.ADD:i?e.SOURCE:e.modified(n.fields)||e.modified(r)?e.ADD_MOD:e.ADD;return i&&(e=e.materialize().reflow(!0)),t.initonly||e.modifies(r),e.visit(o,e=>e[r]=n(e,t))}}),Object(Z.z)($n,Pt,{transform(t,e){const n=e.fork(e.ALL),r=t.generator;let i,o,a,s=this.value,u=t.size-s.length;if(u>0){for(i=[];--u>=0;)i.push(a=ut(r(t))),s.push(a);n.add=n.add.length?n.materialize(n.ADD).add.concat(i):i}else o=s.slice(0,-u),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(o):o,s=s.slice(-u);return n.source=this.value=s,n}});const Nn={value:"value",median:Xt,mean:function(t,e){let n=0,r=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(++n,r+=e);else{let i=-1;for(let o of t)null!=(o=e(o,++i,t))&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n},min:Wt,max:qt},Rn=[];function Pn(t){Pt.call(this,[],t)}function Bn(t){ln.call(this,t)}function Ln(t){Pt.call(this,null,t)}function In(t){yt.call(this,null,Un,t)}function Un(t){return this.value&&!t.modified()?this.value:Object(Z.J)(t.fields,t.flat)}function qn(t){Pt.call(this,[],t),this._pending=null}function Wn(t,e,n){n.forEach(ut);const r=e.fork(e.NO_FIELDS&e.NO_SOURCE);return r.rem=t.value,t.value=r.source=r.add=n,t._pending=null,r.rem.length&&r.clean(!0),r}function Yn(t){Pt.call(this,{},t)}function Hn(t){yt.call(this,null,Gn,t)}function Gn(t){if(this.value&&!t.modified())return this.value;const e=t.extents,n=e.length;let r,i,o=1/0,a=-1/0;for(r=0;r<n;++r)i=e[r],i[0]<o&&(o=i[0]),i[1]>a&&(a=i[1]);return[o,a]}function Vn(t){yt.call(this,null,Xn,t)}function Xn(t){return this.value&&!t.modified()?this.value:t.values.reduce((t,e)=>t.concat(e),[])}function Jn(t){Pt.call(this,null,t)}function Kn(t){ln.call(this,t)}function Zn(t){Dn.call(this,t)}function Qn(t){Pt.call(this,null,t)}function tr(t){Pt.call(this,null,t)}function er(t){Pt.call(this,null,t)}Pn.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]},Object(Z.z)(Pn,Pt,{transform(t,e){var n,r,i,o,a,s,u,l,c,f,d=e.fork(e.ALL),h=function(t){var e,n=t.method||Nn.value;if(null!=Nn[n])return n===Nn.value?(e=void 0!==t.value?t.value:0,()=>e):Nn[n];Object(Z.o)("Unrecognized imputation method: "+n)}(t),p=function(t){const e=t.field;return t=>t?e(t):NaN}(t),g=Object(Z.h)(t.field),m=Object(Z.h)(t.key),b=(t.groupby||[]).map(Z.h),y=function(t,e,n,r){var i,o,a,s,u,l,c,f,d=t=>t(f),h=[],p=r?r.slice():[],g={},m={};for(p.forEach((t,e)=>g[t]=e+1),s=0,c=t.length;s<c;++s)f=t[s],l=n(f),u=g[l]||(g[l]=p.push(l)),o=(i=e?e.map(d):Rn)+"",(a=m[o])||(a=m[o]=[],h.push(a),a.values=i),a[u-1]=f;return h.domain=p,h}(e.source,t.groupby,t.key,t.keyvals),v=[],x=this.value,_=y.domain.length;for(a=0,l=y.length;a<l;++a)for(i=(n=y[a]).values,r=NaN,u=0;u<_;++u)if(null==n[u]){for(o=y.domain[u],f={_impute:!0},s=0,c=i.length;s<c;++s)f[b[s]]=i[s];f[m]=o,f[g]=Number.isNaN(r)?r=h(n,p):r,v.push(ut(f))}return v.length&&(d.add=d.materialize(d.ADD).add.concat(v)),x.length&&(d.rem=d.materialize(d.REM).rem.concat(x)),this.value=v,d}}),Bn.Definition={type:"JoinAggregate",metadata:{modifies:!0},params:[{name:"groupby",type:"field",array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"ops",type:"enum",array:!0,values:Ze},{name:"as",type:"string",null:!0,array:!0},{name:"key",type:"field"}]},Object(Z.z)(Bn,ln,{transform(t,e){const n=this,r=t.modified();let i;return n.value&&(r||e.modified(n._inputs,!0))?(i=n.value=r?n.init(t):{},e.visit(e.SOURCE,t=>n.add(t))):(i=n.value=n.value||this.init(t),e.visit(e.REM,t=>n.rem(t)),e.visit(e.ADD,t=>n.add(t))),n.changes(),e.visit(e.SOURCE,t=>{Object(Z.p)(t,i[n.cellkey(t)].tuple)}),e.reflow(r).modifies(this._outputs)},changes(){const t=this._adds,e=this._mods;let n,r;for(n=0,r=this._alen;n<r;++n)this.celltuple(t[n]),t[n]=null;for(n=0,r=this._mlen;n<r;++n)this.celltuple(e[n]),e[n]=null;this._alen=this._mlen=0}}),Ln.Definition={type:"KDE",metadata:{generates:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"cumulative",type:"boolean",default:!1},{name:"counts",type:"boolean",default:!1},{name:"bandwidth",type:"number",default:0},{name:"extent",type:"number",array:!0,length:2},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"as",type:"string",array:!0,default:["value","density"]}]},Object(Z.z)(Ln,Pt,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const r=e.materialize(e.SOURCE).source,i=On(r,t.groupby,t.field),o=(t.groupby||[]).map(Z.h),a=t.bandwidth,s=t.cumulative?"cdf":"pdf",u=t.as||["value","density"],l=[];let c=t.extent,f=t.steps||t.minsteps||25,d=t.steps||t.maxsteps||200;"pdf"!==s&&"cdf"!==s&&Object(Z.o)("Invalid density method: "+s),"shared"===t.resolve&&(c||(c=Object(Z.q)(r,t.field)),f=d=t.steps||d),i.forEach(e=>{const n=ge(e,a)[s],r=t.counts?e.length:1;Ue(n,c||Object(Z.q)(e),f,d).forEach(t=>{const n={};for(let t=0;t<o.length;++t)n[o[t]]=e.dims[t];n[u[0]]=t[0],n[u[1]]=t[1]*r,l.push(ut(n))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}}),Object(Z.z)(In,yt),Object(Z.z)(qn,Pt,{transform(t,e){const n=e.dataflow;if(this._pending)return Wn(this,e,this._pending);if(function(t){return t.modified("async")&&!(t.modified("values")||t.modified("url")||t.modified("format"))}(t))return e.StopPropagation;if(t.values)return Wn(this,e,n.parse(t.values,t.format));if(t.async){return{async:n.request(t.url,t.format).then(t=>(this._pending=Object(Z.i)(t.data),t=>t.touch(this)))}}return n.request(t.url,t.format).then(t=>Wn(this,e,Object(Z.i)(t.data)))}}),Yn.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]},Object(Z.z)(Yn,Pt,{transform(t,e){const n=t.fields,r=t.index,i=t.values,o=null==t.default?null:t.default,a=t.modified(),s=n.length;let u,l,c,f=a?e.SOURCE:e.ADD,d=e,h=t.as;return i?(l=i.length,s>1&&!h&&Object(Z.o)('Multi-field lookup requires explicit "as" parameter.'),h&&h.length!==s*l&&Object(Z.o)('The "as" parameter has too few output field names.'),h=h||i.map(Z.h),u=function(t){for(var e,a,u=0,c=0;u<s;++u)if(null==(a=r.get(n[u](t))))for(e=0;e<l;++e,++c)t[h[c]]=o;else for(e=0;e<l;++e,++c)t[h[c]]=i[e](a)}):(h||Object(Z.o)("Missing output field names."),u=function(t){for(var e,i=0;i<s;++i)e=r.get(n[i](t)),t[h[i]]=null==e?o:e}),a?d=e.reflow(!0):(c=n.some(t=>e.modified(t.fields)),f|=c?e.MOD:0),e.visit(f,u),d.modifies(h)}}),Object(Z.z)(Hn,yt),Object(Z.z)(Vn,yt),Object(Z.z)(Jn,Pt,{transform(t,e){return this.modified(t.modified()),this.value=t,e.fork(e.NO_SOURCE|e.NO_FIELDS)}}),Kn.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:Ze,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]},Object(Z.z)(Kn,ln,{_transform:ln.prototype.transform,transform(t,e){return this._transform(function(t,e){const n=t.field,r=t.value,i=("count"===t.op?"__count__":t.op)||"sum",o=Object(Z.g)(n).concat(Object(Z.g)(r)),a=function(t,e,n){const r={},i=[];return n.visit(n.SOURCE,e=>{const n=t(e);r[n]||(r[n]=1,i.push(n))}),i.sort(Z.j),e?i.slice(0,e):i}(n,t.limit||0,e);e.changed()&&t.set("__pivot__",null,null,!0);return{key:t.key,groupby:t.groupby,ops:a.map(()=>i),fields:a.map(t=>function(t,e,n,r){return Object(Z.f)(r=>e(r)===t?n(r):NaN,r,t+"")}(t,n,r,o)),as:a.map(t=>t+""),modified:t.modified.bind(t)}}(t,e),e)}}),Object(Z.z)(Zn,Dn,{transform(t,e){const n=t.subflow,r=t.field,i=t=>this.subflow(at(t),n,e,t);return(t.modified("field")||r&&e.modified(Object(Z.g)(r)))&&Object(Z.o)("PreFacet does not support field modification."),this.initTargets(),r?(e.visit(e.MOD,t=>{const e=i(t);r(t).forEach(t=>e.mod(t))}),e.visit(e.ADD,t=>{const e=i(t);r(t).forEach(t=>e.add(ut(t)))}),e.visit(e.REM,t=>{const e=i(t);r(t).forEach(t=>e.rem(t))})):(e.visit(e.MOD,t=>i(t).mod(t)),e.visit(e.ADD,t=>i(t).add(t)),e.visit(e.REM,t=>i(t).rem(t))),e.clean()&&e.runAfter(()=>this.clean()),e}}),Qn.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]},Object(Z.z)(Qn,Pt,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.fields,i=_n(t.fields,t.as||[]),o=r?(t,e)=>function(t,e,n,r){for(let i=0,o=n.length;i<o;++i)e[r[i]]=n[i](t);return e}(t,e,r,i):ct;let a;return this.value?a=this.value:(e=e.addAll(),a=this.value={}),e.visit(e.REM,t=>{const e=at(t);n.rem.push(a[e]),a[e]=null}),e.visit(e.ADD,t=>{const e=o(t,ut({}));a[at(t)]=e,n.add.push(e)}),e.visit(e.MOD,t=>{n.mod.push(o(t,a[at(t)]))}),n}}),Object(Z.z)(tr,Pt,{transform(t,e){return this.value=t.value,t.modified("value")?e.fork(e.NO_SOURCE|e.NO_FIELDS):e.StopPropagation}}),er.Definition={type:"Quantile",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"probs",type:"number",array:!0},{name:"step",type:"number",default:.01},{name:"as",type:"string",array:!0,default:["prob","value"]}]};function nr(t){Pt.call(this,null,t)}function rr(t){Pt.call(this,[],t),this.count=0}function ir(t){Pt.call(this,null,t)}function or(t){Pt.call(this,null,t),this.modified(!0)}function ar(t){Pt.call(this,null,t)}Object(Z.z)(er,Pt,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=t.as||["prob","value"];if(this.value&&!t.modified()&&!e.changed())return n.source=this.value,n;const i=On(e.materialize(e.SOURCE).source,t.groupby,t.field),o=(t.groupby||[]).map(Z.h),a=[],s=t.step||.01,u=t.probs||We(s/2,1-1e-14,s),l=u.length;return i.forEach(t=>{const e=Kt(t,u);for(let n=0;n<l;++n){const i={};for(let e=0;e<o.length;++e)i[o[e]]=t.dims[e];i[r[0]]=u[n],i[r[1]]=e[n],a.push(ut(i))}}),this.value&&(n.rem=this.value),this.value=n.add=n.source=a,n}}),Object(Z.z)(nr,Pt,{transform(t,e){let n,r;return this.value?r=this.value:(n=e=e.addAll(),r=this.value={}),t.derive&&(n=e.fork(e.NO_SOURCE),e.visit(e.REM,t=>{const e=at(t);n.rem.push(r[e]),r[e]=null}),e.visit(e.ADD,t=>{const e=lt(t);r[at(t)]=e,n.add.push(e)}),e.visit(e.MOD,t=>{const e=r[at(t)];for(const r in t)e[r]=t[r],n.modifies(r);n.mod.push(e)})),n}}),rr.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]},Object(Z.z)(rr,Pt,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.modified("size"),i=t.size,o=this.value.reduce((t,e)=>(t[at(e)]=1,t),{});let a=this.value,s=this.count,u=0;function l(t){let e,r;a.length<i?a.push(t):(r=~~((s+1)*ee()),r<a.length&&r>=u&&(e=a[r],o[at(e)]&&n.rem.push(e),a[r]=t)),++s}if(e.rem.length&&(e.visit(e.REM,t=>{const e=at(t);o[e]&&(o[e]=-1,n.rem.push(t)),--s}),a=a.filter(t=>-1!==o[at(t)])),(e.rem.length||r)&&a.length<i&&e.source&&(u=s=a.length,e.visit(e.SOURCE,t=>{o[at(t)]||l(t)}),u=-1),r&&a.length>i){const t=a.length-i;for(let e=0;e<t;++e)o[at(a[e])]=-1,n.rem.push(a[e]);a=a.slice(t)}return e.mod.length&&e.visit(e.MOD,t=>{o[at(t)]&&n.mod.push(t)}),e.add.length&&e.visit(e.ADD,l),(e.add.length||u<0)&&(n.add=a.filter(t=>!o[at(t)])),this.count=s,this.value=n.source=a,n}}),ir.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]},Object(Z.z)(ir,Pt,{transform(t,e){if(this.value&&!t.modified())return;const n=e.materialize().fork(e.MOD),r=t.as||"data";return n.rem=this.value?e.rem.concat(this.value):e.rem,this.value=We(t.start,t.stop,t.step||1).map(t=>{const e={};return e[r]=t,ut(e)}),n.add=e.add.concat(this.value),n}}),Object(Z.z)(or,Pt,{transform(t,e){return this.value=e.source,e.changed()?e.fork(e.NO_SOURCE|e.NO_FIELDS):e.StopPropagation}});const sr=["unit0","unit1"];function ur(t){Pt.call(this,Object(Z.t)(),t)}function lr(t){Pt.call(this,null,t)}ar.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:He.j,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:sr}]},Object(Z.z)(ar,Pt,{transform(t,e){const n=t.field,r=!1!==t.interval,i="utc"===t.timezone,o=this._floor(t,e),a=(i?He.v:He.p)(o.unit).offset,s=t.as||sr,u=s[0],l=s[1],c=o.step;let f=o.start||1/0,d=o.stop||-1/0,h=e.ADD;return(t.modified()||e.modified(Object(Z.g)(n)))&&(h=(e=e.reflow(!0)).SOURCE,f=1/0,d=-1/0),e.visit(h,t=>{const e=n(t);let i,s;null==e?(t[u]=null,r&&(t[l]=null)):(t[u]=i=s=o(e),r&&(t[l]=s=a(i,c)),i<f&&(f=i),s>d&&(d=s))}),o.start=f,o.stop=d,e.modifies(r?s:u)},_floor(t,e){const n="utc"===t.timezone,{units:r,step:i}=t.units?{units:t.units,step:t.step||1}:Object(He.n)({extent:t.extent||Object(Z.q)(e.materialize(e.SOURCE).source,t.field),maxbins:t.maxbins}),o=Object(He.t)(r),a=this.value||{},s=(n?He.u:He.o)(o,i);return s.unit=Object(Z.V)(o),s.units=o,s.step=i,s.start=a.start,s.stop=a.stop,this.value=s}}),Object(Z.z)(ur,Pt,{transform(t,e){const n=e.dataflow,r=t.field,i=this.value,o=t=>i.set(r(t),t);let a=!0;return t.modified("field")||e.modified(r.fields)?(i.clear(),e.visit(e.SOURCE,o)):e.changed()?(e.visit(e.REM,t=>i.delete(r(t))),e.visit(e.ADD,o)):a=!1,this.modified(a),i.empty>n.cleanThreshold&&n.runAfter(i.clean),e.fork()}}),Object(Z.z)(lr,Pt,{transform(t,e){(!this.value||t.modified("field")||t.modified("sort")||e.changed()||t.sort&&e.modified(t.sort.fields))&&(this.value=(t.sort?e.source.slice().sort(dt(t.sort)):e.source).map(t.field))}});const cr={row_number:function(){return{next:t=>t.index+1}},rank:function(){let t;return{init:()=>t=1,next:e=>{const n=e.index,r=e.data;return n&&e.compare(r[n-1],r[n])?t=n+1:t}}},dense_rank:function(){let t;return{init:()=>t=1,next:e=>{const n=e.index,r=e.data;return n&&e.compare(r[n-1],r[n])?++t:t}}},percent_rank:function(){const t=cr.rank(),e=t.next;return{init:t.init,next:t=>(e(t)-1)/(t.data.length-1)}},cume_dist:function(){let t;return{init:()=>t=0,next:e=>{const n=e.data,r=e.compare;let i=e.index;if(t<i){for(;i+1<n.length&&!r(n[i],n[i+1]);)++i;t=i}return(1+t)/n.length}}},ntile:function(t,e){(e=+e)>0||Object(Z.o)("ntile num must be greater than zero.");const n=cr.cume_dist(),r=n.next;return{init:n.init,next:t=>Math.ceil(e*r(t))}},lag:function(t,e){return e=+e||1,{next:n=>{const r=n.index-e;return r>=0?t(n.data[r]):null}}},lead:function(t,e){return e=+e||1,{next:n=>{const r=n.index+e,i=n.data;return r<i.length?t(i[r]):null}}},first_value:function(t){return{next:e=>t(e.data[e.i0])}},last_value:function(t){return{next:e=>t(e.data[e.i1-1])}},nth_value:function(t,e){return(e=+e)>0||Object(Z.o)("nth_value nth must be greater than zero."),{next:n=>{const r=n.i0+(e-1);return r<n.i1?t(n.data[r]):null}}},prev_value:function(t){let e;return{init:()=>e=null,next:n=>{const r=t(n.data[n.index]);return null!=r?e=r:e}}},next_value:function(t){let e,n;return{init:()=>(e=null,n=-1),next:r=>{const i=r.data;return r.index<=n?e:(n=function(t,e,n){for(let r=e.length;n<r;++n){if(null!=t(e[n]))return n}return-1}(t,i,r.index))<0?(n=i.length,e=null):e=t(i[n])}}}};const fr=Object.keys(cr);function dr(t){const e=Object(Z.i)(t.ops),n=Object(Z.i)(t.fields),r=Object(Z.i)(t.params),i=Object(Z.i)(t.as),o=this.outputs=[],a=this.windows=[],s={},u={},l=[],c=[];let f=!0;function d(t){Object(Z.i)(Object(Z.g)(t)).forEach(t=>s[t]=1)}d(t.sort),e.forEach((t,e)=>{const s=n[e],h=Object(Z.h)(s),p=Ve(t,h,i[e]);if(d(s),o.push(p),Object(Z.w)(cr,t))a.push(function(t,e,n,r){const i=cr[t](e,n);return{init:i.init||Z.lb,update:function(t,e){e[r]=i.next(t)}}}(t,n[e],r[e],p));else{if(null==s&&"count"!==t&&Object(Z.o)("Null aggregate field specified."),"count"===t)return void l.push(p);f=!1;let e=u[h];e||(e=u[h]=[],e.field=s,c.push(e)),e.push(Qe(t,p))}}),(l.length||c.length)&&(this.cell=function(t,e,n){t=t.map(t=>an(t,t.field));const r={num:0,agg:null,store:!1,count:e};if(!n)for(var i=t.length,o=r.agg=Array(i),a=0;a<i;++a)o[a]=new t[a](r);if(r.store)var s=r.data=new sn;return r.add=function(t){if(r.num+=1,!n){s&&s.add(t);for(let e=0;e<i;++e)o[e].add(o[e].get(t),t)}},r.rem=function(t){if(r.num-=1,!n){s&&s.rem(t);for(let e=0;e<i;++e)o[e].rem(o[e].get(t),t)}},r.set=function(t){let i,a;for(s&&s.values(),i=0,a=e.length;i<a;++i)t[e[i]]=r.num;if(!n)for(i=0,a=o.length;i<a;++i)o[i].set(t)},r.init=function(){r.num=0,s&&s.reset();for(let t=0;t<i;++t)o[t].init()},r}(c,l,f)),this.inputs=Object.keys(s)}const hr=dr.prototype;function pr(t){Pt.call(this,{},t),this._mlen=0,this._mods=[]}function gr(t,e,n,r){const i=r.sort,o=i&&!r.ignorePeers,a=r.frame||[null,0],s=t.data(n),u=s.length,l=o?Object(Ye.a)(i):null,c={i0:0,i1:0,p0:0,p1:0,index:0,data:s,compare:i||Object(Z.m)(-1)};e.init();for(let t=0;t<u;++t)mr(c,a,t,u),o&&br(c,l),e.update(c,s[t])}function mr(t,e,n,r){t.p0=t.i0,t.p1=t.i1,t.i0=null==e[0]?0:Math.max(0,n-Math.abs(e[0])),t.i1=null==e[1]?r:Math.min(r,n+Math.abs(e[1])+1),t.index=n}function br(t,e){const n=t.i0,r=t.i1-1,i=t.compare,o=t.data,a=o.length-1;n>0&&!i(o[n],o[n-1])&&(t.i0=e.left(o,o[n])),r<a&&!i(o[r],o[r+1])&&(t.i1=e.right(o,o[r]))}function yr(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function vr(t){this._context=t}hr.init=function(){this.windows.forEach(t=>t.init()),this.cell&&this.cell.init()},hr.update=function(t,e){const n=this.cell,r=this.windows,i=t.data,o=r&&r.length;let a;if(n){for(a=t.p0;a<t.i0;++a)n.rem(i[a]);for(a=t.p1;a<t.i1;++a)n.add(i[a]);n.set(e)}for(a=0;a<o;++a)r[a].update(t,e)},pr.Definition={type:"Window",metadata:{modifies:!0},params:[{name:"sort",type:"compare"},{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:fr.concat(Ze)},{name:"params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"frame",type:"number",null:!0,array:!0,length:2,default:[null,0]},{name:"ignorePeers",type:"boolean",default:!1}]},Object(Z.z)(pr,Pt,{transform(t,e){this.stamp=e.stamp;const n=t.modified(),r=dt(t.sort),i=Ge(t.groupby),o=t=>this.group(i(t));let a=this.state;a&&!n||(a=this.state=new dr(t)),n||e.modified(a.inputs)?(this.value={},e.visit(e.SOURCE,t=>o(t).add(t))):(e.visit(e.REM,t=>o(t).remove(t)),e.visit(e.ADD,t=>o(t).add(t)));for(let e=0,n=this._mlen;e<n;++e)gr(this._mods[e],a,r,t);return this._mlen=0,this._mods=[],e.reflow(n).modifies(a.outputs)},group(t){let e=this.value[t];return e||(e=this.value[t]=fn(at),e.stamp=-1),e.stamp<this.stamp&&(e.stamp=this.stamp,this._mods[this._mlen++]=e),e}}),vr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:yr(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:yr(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};var xr=function(){};function _r(t){this._context=t}_r.prototype={areaStart:xr,areaEnd:xr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:yr(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Or(t){this._context=t}Or.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:yr(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function wr(t,e){this._basis=new vr(t),this._beta=e}wr.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r,i=t[0],o=e[0],a=t[n]-i,s=e[n]-o,u=-1;++u<=n;)r=u/n,this._basis.point(this._beta*t[u]+(1-this._beta)*(i+r*a),this._beta*e[u]+(1-this._beta)*(o+r*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var jr=function t(e){function n(t){return 1===e?new vr(t):new wr(t,e)}return n.beta=function(e){return t(+e)},n}(.85);function kr(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Er(t,e){this._context=t,this._k=(1-e)/6}Er.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:kr(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:kr(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Ar=function t(e){function n(t){return new Er(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Dr(t,e){this._context=t,this._k=(1-e)/6}Dr.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(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,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:kr(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Mr=function t(e){function n(t){return new Dr(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Sr(t,e){this._context=t,this._k=(1-e)/6}Sr.prototype={areaStart:xr,areaEnd:xr,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)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:kr(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Cr=function t(e){function n(t){return new Sr(t,e)}return n.tension=function(e){return t(+e)},n}(0),Fr=Math.abs,zr=Math.atan2,Tr=Math.cos,$r=Math.max,Nr=Math.min,Rr=Math.sin,Pr=Math.sqrt,Br=Math.PI,Lr=Br/2,Ir=2*Br;function Ur(t){return t>1?0:t<-1?Br:Math.acos(t)}function qr(t){return t>=1?Lr:t<=-1?-Lr:Math.asin(t)}function Wr(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>1e-12){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,u=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/u,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/u}if(t._l23_a>1e-12){var l=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,c=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*l+t._x1*t._l23_2a-e*t._l12_2a)/c,a=(a*l+t._y1*t._l23_2a-n*t._l12_2a)/c}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function Yr(t,e){this._context=t,this._alpha=e}Yr.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)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Wr(this,t,e)}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=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Hr=function t(e){function n(t){return e?new Yr(t,e):new Er(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Gr(t,e){this._context=t,this._alpha=e}Gr.prototype={areaStart:xr,areaEnd:xr,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)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Wr(this,t,e)}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=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Vr=function t(e){function n(t){return e?new Gr(t,e):new Sr(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Xr(t,e){this._context=t,this._alpha=e}Xr.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(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,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:Wr(this,t,e)}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=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Jr=function t(e){function n(t){return e?new Xr(t,e):new Dr(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Kr(t){this._context=t}Kr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var Zr=function(t){return new Kr(t)};function Qr(t){this._context=t}Qr.prototype={areaStart:xr,areaEnd:xr,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function ti(t){return t<0?-1:1}function ei(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(ti(o)+ti(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function ni(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function ri(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,s=(o-r)/3;t._context.bezierCurveTo(r+s,i+s*e,o-s,a-s*n,o,a)}function ii(t){this._context=t}function oi(t){this._context=new ai(t)}function ai(t){this._context=t}function si(t){this._context=t}function ui(t){var e,n,r=t.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=t[0]+2*t[1],e=1;e<r-1;++e)i[e]=1,o[e]=4,a[e]=4*t[e]+2*t[e+1];for(i[r-1]=2,o[r-1]=7,a[r-1]=8*t[r-1]+t[r],e=1;e<r;++e)n=i[e]/o[e-1],o[e]-=n,a[e]-=n*a[e-1];for(i[r-1]=a[r-1]/o[r-1],e=r-2;e>=0;--e)i[e]=(a[e]-i[e+1])/o[e];for(o[r-1]=(t[r]+i[r-1])/2,e=0;e<r-1;++e)o[e]=2*t[e+1]-i[e+1];return[i,o]}ii.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:ri(this,this._t0,ni(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,ri(this,ni(this,n=ei(this,t,e)),n);break;default:ri(this,this._t0,n=ei(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(oi.prototype=Object.create(ii.prototype)).point=function(t,e){ii.prototype.point.call(this,e,t)},ai.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,o){this._context.bezierCurveTo(e,t,r,n,o,i)}},si.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===n)this._context.lineTo(t[1],e[1]);else for(var r=ui(t),i=ui(e),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],t[a],e[a]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}};function li(t,e){this._context=t,this._t=e}li.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};const ci=Math.PI,fi=2*ci,di=fi-1e-6;function hi(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function pi(){return new hi}hi.prototype=pi.prototype={constructor:hi,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,r){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(t,e,n,r,i,o){this._+="C"+ +t+","+ +e+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+o)},arcTo:function(t,e,n,r,i){t=+t,e=+e,n=+n,r=+r,i=+i;var o=this._x1,a=this._y1,s=n-t,u=r-e,l=o-t,c=a-e,f=l*l+c*c;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(f>1e-6)if(Math.abs(c*s-u*l)>1e-6&&i){var d=n-o,h=r-a,p=s*s+u*u,g=d*d+h*h,m=Math.sqrt(p),b=Math.sqrt(f),y=i*Math.tan((ci-Math.acos((p+f-g)/(2*m*b)))/2),v=y/b,x=y/m;Math.abs(v-1)>1e-6&&(this._+="L"+(t+v*l)+","+(e+v*c)),this._+="A"+i+","+i+",0,0,"+ +(c*d>l*h)+","+(this._x1=t+x*s)+","+(this._y1=e+x*u)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,r,i,o){t=+t,e=+e,o=!!o;var a=(n=+n)*Math.cos(r),s=n*Math.sin(r),u=t+a,l=e+s,c=1^o,f=o?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+u+","+l:(Math.abs(this._x1-u)>1e-6||Math.abs(this._y1-l)>1e-6)&&(this._+="L"+u+","+l),n&&(f<0&&(f=f%fi+fi),f>di?this._+="A"+n+","+n+",0,1,"+c+","+(t-a)+","+(e-s)+"A"+n+","+n+",0,1,"+c+","+(this._x1=u)+","+(this._y1=l):f>1e-6&&(this._+="A"+n+","+n+",0,"+ +(f>=ci)+","+c+","+(this._x1=t+n*Math.cos(i))+","+(this._y1=e+n*Math.sin(i))))},rect:function(t,e,n,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var gi=pi,mi=function(t){return function(){return t}};function bi(t){return t.innerRadius}function yi(t){return t.outerRadius}function vi(t){return t.startAngle}function xi(t){return t.endAngle}function _i(t){return t&&t.padAngle}function Oi(t,e,n,r,i,o,a,s){var u=n-t,l=r-e,c=a-i,f=s-o,d=f*u-c*l;if(!(d*d<1e-12))return[t+(d=(c*(e-o)-f*(t-i))/d)*u,e+d*l]}function wi(t,e,n,r,i,o,a){var s=t-n,u=e-r,l=(a?o:-o)/Pr(s*s+u*u),c=l*u,f=-l*s,d=t+c,h=e+f,p=n+c,g=r+f,m=(d+p)/2,b=(h+g)/2,y=p-d,v=g-h,x=y*y+v*v,_=i-o,O=d*g-p*h,w=(v<0?-1:1)*Pr($r(0,_*_*x-O*O)),j=(O*v-y*w)/x,k=(-O*y-v*w)/x,E=(O*v+y*w)/x,A=(-O*y+v*w)/x,D=j-m,M=k-b,S=E-m,C=A-b;return D*D+M*M>S*S+C*C&&(j=E,k=A),{cx:j,cy:k,x01:-c,y01:-f,x11:j*(i/_-1),y11:k*(i/_-1)}}Array.prototype.slice;var ji=function(t){return"object"==typeof t&&"length"in t?t:Array.from(t)};function ki(t){return t[0]}function Ei(t){return t[1]}var Ai=function(t,e){var n=mi(!0),r=null,i=Zr,o=null;function a(a){var s,u,l,c=(a=ji(a)).length,f=!1;for(null==r&&(o=i(l=gi())),s=0;s<=c;++s)!(s<c&&n(u=a[s],s,a))===f&&((f=!f)?o.lineStart():o.lineEnd()),f&&o.point(+t(u,s,a),+e(u,s,a));if(l)return o=null,l+""||null}return t="function"==typeof t?t:void 0===t?ki:mi(t),e="function"==typeof e?e:void 0===e?Ei:mi(e),a.x=function(e){return arguments.length?(t="function"==typeof e?e:mi(+e),a):t},a.y=function(t){return arguments.length?(e="function"==typeof t?t:mi(+t),a):e},a.defined=function(t){return arguments.length?(n="function"==typeof t?t:mi(!!t),a):n},a.curve=function(t){return arguments.length?(i=t,null!=r&&(o=i(r)),a):i},a.context=function(t){return arguments.length?(null==t?r=o=null:o=i(r=t),a):r},a},Di=function(t,e,n){var r=null,i=mi(!0),o=null,a=Zr,s=null;function u(u){var l,c,f,d,h,p=(u=ji(u)).length,g=!1,m=new Array(p),b=new Array(p);for(null==o&&(s=a(h=gi())),l=0;l<=p;++l){if(!(l<p&&i(d=u[l],l,u))===g)if(g=!g)c=l,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),f=l-1;f>=c;--f)s.point(m[f],b[f]);s.lineEnd(),s.areaEnd()}g&&(m[l]=+t(d,l,u),b[l]=+e(d,l,u),s.point(r?+r(d,l,u):m[l],n?+n(d,l,u):b[l]))}if(h)return s=null,h+""||null}function l(){return Ai().defined(i).curve(a).context(o)}return t="function"==typeof t?t:void 0===t?ki:mi(+t),e="function"==typeof e?e:mi(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?Ei:mi(+n),u.x=function(e){return arguments.length?(t="function"==typeof e?e:mi(+e),r=null,u):t},u.x0=function(e){return arguments.length?(t="function"==typeof e?e:mi(+e),u):t},u.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:mi(+t),u):r},u.y=function(t){return arguments.length?(e="function"==typeof t?t:mi(+t),n=null,u):e},u.y0=function(t){return arguments.length?(e="function"==typeof t?t:mi(+t),u):e},u.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:mi(+t),u):n},u.lineX0=u.lineY0=function(){return l().x(t).y(e)},u.lineY1=function(){return l().x(t).y(n)},u.lineX1=function(){return l().x(r).y(e)},u.defined=function(t){return arguments.length?(i="function"==typeof t?t:mi(!!t),u):i},u.curve=function(t){return arguments.length?(a=t,null!=o&&(s=a(o)),u):a},u.context=function(t){return arguments.length?(null==t?o=s=null:s=a(o=t),u):o},u},Mi={draw:function(t,e){var n=Math.sqrt(e/Br);t.moveTo(n,0),t.arc(0,0,n,0,Ir)}},Si=(Math.sqrt(1/3),Math.sin(Br/10)/Math.sin(7*Br/10));Math.sin(Ir/10),Math.cos(Ir/10),Math.sqrt(3),Math.sqrt(3),Math.sqrt(12);function Ci(t,e){if("undefined"!=typeof document&&document.createElement){const n=document.createElement("canvas");if(n&&n.getContext)return n.width=t,n.height=e,n}return null}const Fi=()=>"undefined"!=typeof Image?Image:null,zi=Object(Ye.a)(Ut.a),Ti=zi.right,$i=zi.left;Object(Ye.a)(Ht).center;var Ni=Ti;function Ri(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function Pi(t,e){switch(arguments.length){case 0:break;case 1:"function"==typeof t?this.interpolator(t):this.range(t);break;default:this.domain(t),"function"==typeof e?this.interpolator(e):this.range(e)}return this}const Bi=Symbol("implicit");function Li(){var t=new Map,e=[],n=[],r=Bi;function i(i){var o=i+"",a=t.get(o);if(!a){if(r!==Bi)return r;t.set(o,a=e.push(i))}return n[(a-1)%n.length]}return i.domain=function(n){if(!arguments.length)return e.slice();e=[],t=new Map;for(const r of n){const n=r+"";t.has(n)||t.set(n,e.push(r))}return i},i.range=function(t){return arguments.length?(n=Array.from(t),i):n.slice()},i.unknown=function(t){return arguments.length?(r=t,i):r},i.copy=function(){return Li(e,n).unknown(r)},Ri.apply(i,arguments),i}var Ii=n(51),Ui=n(27),qi=n(104),Wi=n(64),Yi=n(105),Hi=n(106);function Gi(t,e,n,r){var i,o=Object(Ii.c)(t,e,n);switch((r=Object(Ui.a)(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(i=Object(qi.a)(o,a))||(r.precision=i),Object(Wi.b)(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=Object(Yi.a)(o,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=Object(Hi.a)(o))||(r.precision=i-2*("%"===r.type))}return Object(Wi.a)(r)}var Vi=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t};function Xi(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Ji(){}var Ki="\\s*([+-]?\\d+)\\s*",Zi="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Qi="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",to=/^#([0-9a-f]{3,8})$/,eo=new RegExp("^rgb\\("+[Ki,Ki,Ki]+"\\)$"),no=new RegExp("^rgb\\("+[Qi,Qi,Qi]+"\\)$"),ro=new RegExp("^rgba\\("+[Ki,Ki,Ki,Zi]+"\\)$"),io=new RegExp("^rgba\\("+[Qi,Qi,Qi,Zi]+"\\)$"),oo=new RegExp("^hsl\\("+[Zi,Qi,Qi]+"\\)$"),ao=new RegExp("^hsla\\("+[Zi,Qi,Qi,Zi]+"\\)$"),so={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};function uo(){return this.rgb().formatHex()}function lo(){return this.rgb().formatRgb()}function co(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=to.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?fo(e):3===n?new mo(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?ho(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?ho(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=eo.exec(t))?new mo(e[1],e[2],e[3],1):(e=no.exec(t))?new mo(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=ro.exec(t))?ho(e[1],e[2],e[3],e[4]):(e=io.exec(t))?ho(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=oo.exec(t))?xo(e[1],e[2]/100,e[3]/100,1):(e=ao.exec(t))?xo(e[1],e[2]/100,e[3]/100,e[4]):so.hasOwnProperty(t)?fo(so[t]):"transparent"===t?new mo(NaN,NaN,NaN,0):null}function fo(t){return new mo(t>>16&255,t>>8&255,255&t,1)}function ho(t,e,n,r){return r<=0&&(t=e=n=NaN),new mo(t,e,n,r)}function po(t){return t instanceof Ji||(t=co(t)),t?new mo((t=t.rgb()).r,t.g,t.b,t.opacity):new mo}function go(t,e,n,r){return 1===arguments.length?po(t):new mo(t,e,n,null==r?1:r)}function mo(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function bo(){return"#"+vo(this.r)+vo(this.g)+vo(this.b)}function yo(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"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))+(1===t?")":", "+t+")")}function vo(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function xo(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new wo(t,e,n,r)}function _o(t){if(t instanceof wo)return new wo(t.h,t.s,t.l,t.opacity);if(t instanceof Ji||(t=co(t)),!t)return new wo;if(t instanceof wo)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n<r):n===o?(r-e)/s+2:(e-n)/s+4,s/=u<.5?o+i:2-o-i,a*=60):s=u>0&&u<1?0:a,new wo(a,s,u,t.opacity)}function Oo(t,e,n,r){return 1===arguments.length?_o(t):new wo(t,e,n,null==r?1:r)}function wo(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function jo(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function ko(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}Vi(Ji,co,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:uo,formatHex:uo,formatHsl:function(){return _o(this).formatHsl()},formatRgb:lo,toString:lo}),Vi(mo,go,Xi(Ji,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new mo(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new mo(this.r*t,this.g*t,this.b*t,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:bo,formatHex:bo,formatRgb:yo,toString:yo})),Vi(wo,Oo,Xi(Ji,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new wo(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new wo(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new mo(jo(t>=240?t-240:t+120,i,r),jo(t,i,r),jo(t<120?t+240:t-120,i,r),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 t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var Eo=function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=r<e-1?t[r+2]:2*o-i;return ko((n-r/e)*e,a,i,o,s)}},Ao=function(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),i=t[(r+e-1)%e],o=t[r%e],a=t[(r+1)%e],s=t[(r+2)%e];return ko((n-r/e)*e,i,o,a,s)}},Do=t=>()=>t;function Mo(t,e){return function(n){return t+n*e}}function So(t,e){var n=e-t;return n?Mo(t,n>180||n<-180?n-360*Math.round(n/360):n):Do(isNaN(t)?e:t)}function Co(t){return 1==(t=+t)?Fo:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):Do(isNaN(e)?n:e)}}function Fo(t,e){var n=e-t;return n?Mo(t,n):Do(isNaN(t)?e:t)}var zo=function t(e){var n=Co(e);function r(t,e){var r=n((t=go(t)).r,(e=go(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=Fo(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function To(t){return function(e){var n,r,i=e.length,o=new Array(i),a=new Array(i),s=new Array(i);for(n=0;n<i;++n)r=go(e[n]),o[n]=r.r||0,a[n]=r.g||0,s[n]=r.b||0;return o=t(o),a=t(a),s=t(s),r.opacity=1,function(t){return r.r=o(t),r.g=a(t),r.b=s(t),r+""}}}var $o=To(Eo),No=To(Ao),Ro=function(t,e){e||(e=[]);var n,r=t?Math.min(e.length,t.length):0,i=e.slice();return function(o){for(n=0;n<r;++n)i[n]=t[n]*(1-o)+e[n]*o;return i}};function Po(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}var Bo=function(t,e){return(Po(e)?Ro:Lo)(t,e)};function Lo(t,e){var n,r=e?e.length:0,i=t?Math.min(r,t.length):0,o=new Array(i),a=new Array(r);for(n=0;n<i;++n)o[n]=Go(t[n],e[n]);for(;n<r;++n)a[n]=e[n];return function(t){for(n=0;n<i;++n)a[n]=o[n](t);return a}}var Io=function(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}},Uo=function(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}},qo=function(t,e){var n,r={},i={};for(n in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)n in t?r[n]=Go(t[n],e[n]):i[n]=e[n];return function(t){for(n in r)i[n]=r[n](t);return i}},Wo=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Yo=new RegExp(Wo.source,"g");var Ho=function(t,e){var n,r,i,o=Wo.lastIndex=Yo.lastIndex=0,a=-1,s=[],u=[];for(t+="",e+="";(n=Wo.exec(t))&&(r=Yo.exec(e));)(i=r.index)>o&&(i=e.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:Uo(n,r)})),o=Yo.lastIndex;return o<e.length&&(i=e.slice(o),s[a]?s[a]+=i:s[++a]=i),s.length<2?u[0]?function(t){return function(e){return t(e)+""}}(u[0].x):function(t){return function(){return t}}(e):(e=u.length,function(t){for(var n,r=0;r<e;++r)s[(n=u[r]).i]=n.x(t);return s.join("")})},Go=function(t,e){var n,r=typeof e;return null==e||"boolean"===r?Do(e):("number"===r?Uo:"string"===r?(n=co(e))?(e=n,zo):Ho:e instanceof co?zo:e instanceof Date?Io:Po(e)?Ro:Array.isArray(e)?Lo:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?qo:Uo)(t,e)},Vo=function(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}};function Xo(t){return+t}var Jo=[0,1];function Ko(t){return t}function Zo(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:(n=isNaN(e)?NaN:.5,function(){return n});var n}function Qo(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i<r?(r=Zo(i,r),o=n(a,o)):(r=Zo(r,i),o=n(o,a)),function(t){return o(r(t))}}function ta(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<r;)i[a]=Zo(t[a],t[a+1]),o[a]=n(e[a],e[a+1]);return function(e){var n=Ni(t,e,1,r)-1;return o[n](i[n](e))}}function ea(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function na(){var t,e,n,r,i,o,a=Jo,s=Jo,u=Go,l=Ko;function c(){var t,e,n,u=Math.min(a.length,s.length);return l!==Ko&&(t=a[0],e=a[u-1],t>e&&(n=t,t=e,e=n),l=function(n){return Math.max(t,Math.min(e,n))}),r=u>2?ta:Qo,i=o=null,f}function f(e){return isNaN(e=+e)?n:(i||(i=r(a.map(t),s,u)))(t(l(e)))}return f.invert=function(n){return l(e((o||(o=r(s,a.map(t),Uo)))(n)))},f.domain=function(t){return arguments.length?(a=Array.from(t,Xo),c()):a.slice()},f.range=function(t){return arguments.length?(s=Array.from(t),c()):s.slice()},f.rangeRound=function(t){return s=Array.from(t),u=Vo,c()},f.clamp=function(t){return arguments.length?(l=!!t||Ko,c()):l!==Ko},f.interpolate=function(t){return arguments.length?(u=t,c()):u},f.unknown=function(t){return arguments.length?(n=t,f):n},function(n,r){return t=n,e=r,c()}}function ra(){return na()(Ko,Ko)}function ia(t){var e=t.domain;return t.ticks=function(t){var n=e();return Object(Ii.a)(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return Gi(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,i,o=e(),a=0,s=o.length-1,u=o[a],l=o[s],c=10;for(l<u&&(i=u,u=l,l=i,i=a,a=s,s=i);c-- >0;){if((i=Object(Ii.b)(u,l,n))===r)return o[a]=u,o[s]=l,e(o);if(i>0)u=Math.floor(u/i)*i,l=Math.ceil(l/i)*i;else{if(!(i<0))break;u=Math.ceil(u*i)/i,l=Math.floor(l*i)/i}r=i}return t},t}function oa(t,e){var n,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return a<o&&(n=r,r=i,i=n,n=o,o=a,a=n),t[r]=e.floor(o),t[i]=e.ceil(a),t}function aa(t){return Math.log(t)}function sa(t){return Math.exp(t)}function ua(t){return-Math.log(-t)}function la(t){return-Math.exp(-t)}function ca(t){return isFinite(t)?+("1e"+t):t<0?0:t}function fa(t){return function(e){return-t(-e)}}function da(t){var e,n,r=t(aa,sa),i=r.domain,o=10;function a(){return e=function(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),function(e){return Math.log(e)/t})}(o),n=function(t){return 10===t?ca:t===Math.E?Math.exp:function(e){return Math.pow(t,e)}}(o),i()[0]<0?(e=fa(e),n=fa(n),t(ua,la)):t(aa,sa),r}return r.base=function(t){return arguments.length?(o=+t,a()):o},r.domain=function(t){return arguments.length?(i(t),a()):i()},r.ticks=function(t){var r,a=i(),s=a[0],u=a[a.length-1];(r=u<s)&&(d=s,s=u,u=d);var l,c,f,d=e(s),h=e(u),p=null==t?10:+t,g=[];if(!(o%1)&&h-d<p){if(d=Math.floor(d),h=Math.ceil(h),s>0){for(;d<=h;++d)for(c=1,l=n(d);c<o;++c)if(!((f=l*c)<s)){if(f>u)break;g.push(f)}}else for(;d<=h;++d)for(c=o-1,l=n(d);c>=1;--c)if(!((f=l*c)<s)){if(f>u)break;g.push(f)}2*g.length<p&&(g=Object(Ii.a)(s,u,p))}else g=Object(Ii.a)(d,h,Math.min(h-d,p)).map(n);return r?g.reverse():g},r.tickFormat=function(t,i){if(null==i&&(i=10===o?".0e":","),"function"!=typeof i&&(i=Object(Wi.a)(i)),t===1/0)return i;null==t&&(t=10);var a=Math.max(1,o*t/r.ticks().length);return function(t){var r=t/n(Math.round(e(t)));return r*o<o-.5&&(r*=o),r<=a?i(t):""}},r.nice=function(){return i(oa(i(),{floor:function(t){return n(Math.floor(e(t)))},ceil:function(t){return n(Math.ceil(e(t)))}}))},r}function ha(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function pa(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function ga(t){return t<0?-t*t:t*t}function ma(t){var e=t(Ko,Ko),n=1;function r(){return 1===n?t(Ko,Ko):.5===n?t(pa,ga):t(ha(n),ha(1/n))}return e.exponent=function(t){return arguments.length?(n=+t,r()):n},ia(e)}function ba(){var t=ma(na());return t.copy=function(){return ea(t,ba()).exponent(t.exponent())},Ri.apply(t,arguments),t}function ya(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function va(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function xa(t){var e=1,n=t(ya(e),va(e));return n.constant=function(n){return arguments.length?t(ya(e=+n),va(e)):e},ia(n)}var _a=n(25),Oa=n(60),wa=n(13),ja=n(23),ka=n(100),Ea=n(101),Aa=n(61),Da=n(62),Ma=n(36);function Sa(t){return new Date(t)}function Ca(t){return t instanceof Date?+t:+new Date(+t)}function Fa(t,e,n,r,i,o,a,s,u){var l=ra(),c=l.invert,f=l.domain,d=u(".%L"),h=u(":%S"),p=u("%I:%M"),g=u("%I %p"),m=u("%a %d"),b=u("%b %d"),y=u("%B"),v=u("%Y"),x=[[a,1,1e3],[a,5,5e3],[a,15,15e3],[a,30,3e4],[o,1,6e4],[o,5,3e5],[o,15,9e5],[o,30,18e5],[i,1,36e5],[i,3,108e5],[i,6,216e5],[i,12,432e5],[r,1,864e5],[r,2,1728e5],[n,1,6048e5],[e,1,2592e6],[e,3,7776e6],[t,1,31536e6]];function _(s){return(a(s)<s?d:o(s)<s?h:i(s)<s?p:r(s)<s?g:e(s)<s?n(s)<s?m:b:t(s)<s?y:v)(s)}function O(e,n,r){if(null==e&&(e=10),"number"==typeof e){var i,o=Math.abs(r-n)/e,a=Object(Ye.a)((function(t){return t[2]})).right(x,o);return a===x.length?(i=Object(Ii.c)(n/31536e6,r/31536e6,e),e=t):a?(i=(a=x[o/x[a-1][2]<x[a][2]/o?a-1:a])[1],e=a[0]):(i=Math.max(Object(Ii.c)(n,r,e),1),e=s),e.every(i)}return e}return l.invert=function(t){return new Date(c(t))},l.domain=function(t){return arguments.length?f(Array.from(t,Ca)):f().map(Sa)},l.ticks=function(t){var e,n=f(),r=n[0],i=n[n.length-1],o=i<r;return o&&(e=r,r=i,i=e),e=(e=O(t,r,i))?e.range(r,i+1):[],o?e.reverse():e},l.tickFormat=function(t,e){return null==e?_:u(e)},l.nice=function(t){var e=f();return(t=O(t,e[0],e[e.length-1]))?f(oa(e,t)):l},l.copy=function(){return ea(l,Fa(t,e,n,r,i,o,a,s,u))},l}var za=n(26),Ta=n(63),$a=n(14),Na=n(24),Ra=n(102),Pa=n(103);function Ba(){var t,e,n,r,i,o=0,a=1,s=Ko,u=!1;function l(e){return isNaN(e=+e)?i:s(0===n?.5:(e=(r(e)-t)*n,u?Math.max(0,Math.min(1,e)):e))}function c(t){return function(e){var n,r;return arguments.length?([n,r]=e,s=t(n,r),l):[s(0),s(1)]}}return l.domain=function(i){return arguments.length?([o,a]=i,t=r(o=+o),e=r(a=+a),n=t===e?0:1/(e-t),l):[o,a]},l.clamp=function(t){return arguments.length?(u=!!t,l):u},l.interpolator=function(t){return arguments.length?(s=t,l):s},l.range=c(Go),l.rangeRound=c(Vo),l.unknown=function(t){return arguments.length?(i=t,l):i},function(i){return r=i,t=i(o),e=i(a),n=t===e?0:1/(e-t),l}}function La(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function Ia(){var t=ia(Ba()(Ko));return t.copy=function(){return La(t,Ia())},Pi.apply(t,arguments)}function Ua(){var t=ma(Ba());return t.copy=function(){return La(t,Ua()).exponent(t.exponent())},Pi.apply(t,arguments)}function qa(t,e){void 0===e&&(e=t,t=Go);for(var n=0,r=e.length-1,i=e[0],o=new Array(r<0?0:r);n<r;)o[n]=t(i,i=e[++n]);return function(t){var e=Math.max(0,Math.min(r-1,Math.floor(t*=r)));return o[e](t-e)}}function Wa(){var t,e,n,r,i,o,a,s=0,u=.5,l=1,c=1,f=Ko,d=!1;function h(t){return isNaN(t=+t)?a:(t=.5+((t=+o(t))-e)*(c*t<c*e?r:i),f(d?Math.max(0,Math.min(1,t)):t))}function p(t){return function(e){var n,r,i;return arguments.length?([n,r,i]=e,f=qa(t,[n,r,i]),h):[f(0),f(.5),f(1)]}}return h.domain=function(a){return arguments.length?([s,u,l]=a,t=o(s=+s),e=o(u=+u),n=o(l=+l),r=t===e?0:.5/(e-t),i=e===n?0:.5/(n-e),c=e<t?-1:1,h):[s,u,l]},h.clamp=function(t){return arguments.length?(d=!!t,h):d},h.interpolator=function(t){return arguments.length?(f=t,h):f},h.range=p(Go),h.rangeRound=p(Vo),h.unknown=function(t){return arguments.length?(a=t,h):a},function(a){return o=a,t=a(s),e=a(u),n=a(l),r=t===e?0:.5/(e-t),i=e===n?0:.5/(n-e),c=e<t?-1:1,h}}function Ya(){var t=ma(Wa());return t.copy=function(){return La(t,Ya()).exponent(t.exponent())},Pi.apply(t,arguments)}var Ha,Ga=function(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}},Va=function(t,e){var n=So(+t,+e);return function(t){var e=n(t);return e-360*Math.floor(e/360)}},Xa=180/Math.PI,Ja={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},Ka=function(t,e,n,r,i,o){var a,s,u;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(u=t*n+e*r)&&(n-=t*u,r-=e*u),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,u/=s),t*r<e*n&&(t=-t,e=-e,u=-u,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*Xa,skewX:Math.atan(u)*Xa,scaleX:a,scaleY:s}};function Za(t,e,n,r){function i(t){return t.length?t.pop()+" ":""}return function(o,a){var s=[],u=[];return o=t(o),a=t(a),function(t,r,i,o,a,s){if(t!==i||r!==o){var u=a.push("translate(",null,e,null,n);s.push({i:u-4,x:Uo(t,i)},{i:u-2,x:Uo(r,o)})}else(i||o)&&a.push("translate("+i+e+o+n)}(o.translateX,o.translateY,a.translateX,a.translateY,s,u),function(t,e,n,o){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:Uo(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(o.rotate,a.rotate,s,u),function(t,e,n,o){t!==e?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:Uo(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(o.skewX,a.skewX,s,u),function(t,e,n,r,o,a){if(t!==n||e!==r){var s=o.push(i(o)+"scale(",null,",",null,")");a.push({i:s-4,x:Uo(t,n)},{i:s-2,x:Uo(e,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,s,u),o=a=null,function(t){for(var e,n=-1,r=u.length;++n<r;)s[(e=u[n]).i]=e.x(t);return s.join("")}}}var Qa=Za((function(t){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Ja:Ka(e.a,e.b,e.c,e.d,e.e,e.f)}),"px, ","px)","deg)"),ts=Za((function(t){return null==t?Ja:(Ha||(Ha=document.createElementNS("http://www.w3.org/2000/svg","g")),Ha.setAttribute("transform",t),(t=Ha.transform.baseVal.consolidate())?(t=t.matrix,Ka(t.a,t.b,t.c,t.d,t.e,t.f)):Ja)}),", ",")",")");function es(t){return((t=Math.exp(t))+1/t)/2}var ns=function t(e,n,r){function i(t,i){var o,a,s=t[0],u=t[1],l=t[2],c=i[0],f=i[1],d=i[2],h=c-s,p=f-u,g=h*h+p*p;if(g<1e-12)a=Math.log(d/l)/e,o=function(t){return[s+t*h,u+t*p,l*Math.exp(e*t*a)]};else{var m=Math.sqrt(g),b=(d*d-l*l+r*g)/(2*l*n*m),y=(d*d-l*l-r*g)/(2*d*n*m),v=Math.log(Math.sqrt(b*b+1)-b),x=Math.log(Math.sqrt(y*y+1)-y);a=(x-v)/e,o=function(t){var r,i=t*a,o=es(v),c=l/(n*m)*(o*(r=e*i+v,((r=Math.exp(2*r))-1)/(r+1))-function(t){return((t=Math.exp(t))-1/t)/2}(v));return[s+c*h,u+c*p,l*o/es(e*i+v)]}}return o.duration=1e3*a*e/Math.SQRT2,o}return i.rho=function(e){var n=Math.max(.001,+e),r=n*n;return t(n,r,r*r)},i}(Math.SQRT2,2,4);function rs(t){return function(e,n){var r=t((e=Oo(e)).h,(n=Oo(n)).h),i=Fo(e.s,n.s),o=Fo(e.l,n.l),a=Fo(e.opacity,n.opacity);return function(t){return e.h=r(t),e.s=i(t),e.l=o(t),e.opacity=a(t),e+""}}}var is=rs(So),os=rs(Fo);const as=Math.PI/180,ss=180/Math.PI;function us(t){if(t instanceof cs)return new cs(t.l,t.a,t.b,t.opacity);if(t instanceof bs)return ys(t);t instanceof mo||(t=po(t));var e,n,r=ps(t.r),i=ps(t.g),o=ps(t.b),a=fs((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?e=n=a:(e=fs((.4360747*r+.3850649*i+.1430804*o)/.96422),n=fs((.0139322*r+.0971045*i+.7141733*o)/.82521)),new cs(116*a-16,500*(e-a),200*(a-n),t.opacity)}function ls(t,e,n,r){return 1===arguments.length?us(t):new cs(t,e,n,null==r?1:r)}function cs(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}function fs(t){return t>6/29*(6/29)*(6/29)?Math.pow(t,1/3):t/(6/29*3*(6/29))+4/29}function ds(t){return t>6/29?t*t*t:6/29*3*(6/29)*(t-4/29)}function hs(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function ps(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function gs(t){if(t instanceof bs)return new bs(t.h,t.c,t.l,t.opacity);if(t instanceof cs||(t=us(t)),0===t.a&&0===t.b)return new bs(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*ss;return new bs(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function ms(t,e,n,r){return 1===arguments.length?gs(t):new bs(t,e,n,null==r?1:r)}function bs(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}function ys(t){if(isNaN(t.h))return new cs(t.l,0,0,t.opacity);var e=t.h*as;return new cs(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}function vs(t,e){var n=Fo((t=ls(t)).l,(e=ls(e)).l),r=Fo(t.a,e.a),i=Fo(t.b,e.b),o=Fo(t.opacity,e.opacity);return function(e){return t.l=n(e),t.a=r(e),t.b=i(e),t.opacity=o(e),t+""}}function xs(t){return function(e,n){var r=t((e=ms(e)).h,(n=ms(n)).h),i=Fo(e.c,n.c),o=Fo(e.l,n.l),a=Fo(e.opacity,n.opacity);return function(t){return e.h=r(t),e.c=i(t),e.l=o(t),e.opacity=a(t),e+""}}}Vi(cs,ls,Xi(Ji,{brighter:function(t){return new cs(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new cs(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return new mo(hs(3.1338561*(e=.96422*ds(e))-1.6168667*(t=1*ds(t))-.4906146*(n=.82521*ds(n))),hs(-.9787684*e+1.9161415*t+.033454*n),hs(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),Vi(bs,ms,Xi(Ji,{brighter:function(t){return new bs(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new bs(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return ys(this).rgb()}}));var _s=xs(So),Os=xs(Fo),ws=-.29227,js=1.97294,ks=-.90649*js,Es=1.78277*js,As=-.6557636667999999;function Ds(t){if(t instanceof Ss)return new Ss(t.h,t.s,t.l,t.opacity);t instanceof mo||(t=po(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(As*r+ks*e-Es*n)/(As+ks-Es),o=r-i,a=(js*(n-i)-ws*o)/-.90649,s=Math.sqrt(a*a+o*o)/(js*i*(1-i)),u=s?Math.atan2(a,o)*ss-120:NaN;return new Ss(u<0?u+360:u,s,i,t.opacity)}function Ms(t,e,n,r){return 1===arguments.length?Ds(t):new Ss(t,e,n,null==r?1:r)}function Ss(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Cs(t){return function e(n){function r(e,r){var i=t((e=Ms(e)).h,(r=Ms(r)).h),o=Fo(e.s,r.s),a=Fo(e.l,r.l),s=Fo(e.opacity,r.opacity);return function(t){return e.h=i(t),e.s=o(t),e.l=a(Math.pow(t,n)),e.opacity=s(t),e+""}}return n=+n,r.gamma=e,r}(1)}Vi(Ss,Ms,Xi(Ji,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Ss(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Ss(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*as,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new mo(255*(e+n*(-.14861*r+1.78277*i)),255*(e+n*(ws*r+-.90649*i)),255*(e+n*(js*r)),this.opacity)}}));var Fs=Cs(So),zs=Cs(Fo),Ts=function(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t(r/(e-1));return n};function $s(t,e,n){const r=t-e+2*n;return t?r>0?r:1:0}const Ns="log",Rs="time",Ps="utc",Bs="continuous";function Ls(){const t=Li().unknown(void 0),e=t.domain,n=t.range;let r,i,o=[0,1],a=!1,s=0,u=0,l=.5;function c(){const t=e().length,c=o[1]<o[0],f=o[1-c],d=$s(t,s,u);let h=o[c-0];r=(f-h)/(d||1),a&&(r=Math.floor(r)),h+=(f-h-r*(t-s))*l,i=r*(1-s),a&&(h=Math.round(h),i=Math.round(i));const p=We(t).map(t=>h+r*t);return n(c?p.reverse():p)}return delete t.unknown,t.domain=function(t){return arguments.length?(e(t),c()):e()},t.range=function(t){return arguments.length?(o=[+t[0],+t[1]],c()):o.slice()},t.rangeRound=function(t){return o=[+t[0],+t[1]],a=!0,c()},t.bandwidth=function(){return i},t.step=function(){return r},t.round=function(t){return arguments.length?(a=!!t,c()):a},t.padding=function(t){return arguments.length?(u=Math.max(0,Math.min(1,t)),s=u,c()):s},t.paddingInner=function(t){return arguments.length?(s=Math.max(0,Math.min(1,t)),c()):s},t.paddingOuter=function(t){return arguments.length?(u=Math.max(0,Math.min(1,t)),c()):u},t.align=function(t){return arguments.length?(l=Math.max(0,Math.min(1,t)),c()):l},t.invertRange=function(t){if(null==t[0]||null==t[1])return;const r=o[1]<o[0],a=r?n().reverse():n(),s=a.length-1;let u,l,c,f=+t[0],d=+t[1];return f!=f||d!=d||(d<f&&(c=f,f=d,d=c),d<a[0]||f>o[1-r])?void 0:(u=Math.max(0,Ti(a,f)-1),l=f===d?u:Ti(a,d)-1,f-a[u]>i+1e-10&&++u,r&&(c=u,u=s-l,l=s-c),u>l?void 0:e().slice(u,l+1))},t.invert=function(e){const n=t.invertRange([e,e]);return n?n[0]:n},t.copy=function(){return Ls().domain(e()).range(o).round(a).paddingInner(s).paddingOuter(u).align(l)},c()}var Is=Array.prototype.map;function Us(t){return Is.call(t,Z.db)}const qs=Array.prototype.slice;const Ws={};function Ys(t,e,n){const r=function(){const n=e();return n.invertRange||(n.invertRange=n.invert?function(t){return function(e){let n,r=e[0],i=e[1];return i<r&&(n=r,r=i,i=n),[t.invert(r),t.invert(i)]}}(n):n.invertExtent?function(t){return function(e){const n=t.range();let r,i,o,a,s=e[0],u=e[1],l=-1;for(u<s&&(i=s,s=u,u=i),o=0,a=n.length;o<a;++o)n[o]>=s&&n[o]<=u&&(l<0&&(l=o),r=o);if(!(l<0))return s=t.invertExtent(n[l]),u=t.invertExtent(n[r]),[void 0===s[0]?s[1]:s[0],void 0===u[1]?u[0]:u[1]]}}(n):void 0),n.type=t,n};return r.metadata=Object(Z.eb)(Object(Z.i)(n)),r}function Hs(t,e,n){return arguments.length>1?(Ws[t]=Ys(t,e,n),this):Gs(t)?Ws[t]:void 0}function Gs(t){return Object(Z.w)(Ws,t)}function Vs(t,e){const n=Ws[t];return n&&n.metadata[e]}function Xs(t){return Vs(t,Bs)}function Js(t){return Vs(t,"discrete")}function Ks(t){return Vs(t,"discretizing")}function Zs(t){return Vs(t,Ns)}function Qs(t){return Vs(t,"interpolating")}function tu(t){return Vs(t,"quantile")}Hs("identity",(function t(e){var n;function r(t){return isNaN(t=+t)?n:t}return r.invert=r,r.domain=r.range=function(t){return arguments.length?(e=Array.from(t,Xo),r):e.slice()},r.unknown=function(t){return arguments.length?(n=t,r):n},r.copy=function(){return t(e).unknown(n)},e=arguments.length?Array.from(e,Xo):[0,1],ia(r)})),Hs("linear",(function t(){var e=ra();return e.copy=function(){return ea(e,t())},Ri.apply(e,arguments),ia(e)}),Bs),Hs(Ns,(function t(){var e=da(na()).domain([1,10]);return e.copy=function(){return ea(e,t()).base(e.base())},Ri.apply(e,arguments),e}),[Bs,Ns]),Hs("pow",ba,Bs),Hs("sqrt",(function(){return ba.apply(null,arguments).exponent(.5)}),Bs),Hs("symlog",(function t(){var e=xa(na());return e.copy=function(){return ea(e,t()).constant(e.constant())},Ri.apply(e,arguments)}),Bs),Hs(Rs,(function(){return Ri.apply(Fa(_a.a,Oa.a,wa.b,ja.a,ka.a,Ea.a,Aa.a,Da.a,Ma.a).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}),[Bs,"temporal"]),Hs(Ps,(function(){return Ri.apply(Fa(za.a,Ta.a,$a.b,Na.a,Ra.a,Pa.a,Aa.a,Da.a,Ma.c).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}),[Bs,"temporal"]),Hs("sequential",Ia,[Bs,"interpolating"]),Hs("".concat("sequential","-").concat("linear"),Ia,[Bs,"interpolating"]),Hs("".concat("sequential","-").concat(Ns),(function t(){var e=da(Ba()).domain([1,10]);return e.copy=function(){return La(e,t()).base(e.base())},Pi.apply(e,arguments)}),[Bs,"interpolating",Ns]),Hs("".concat("sequential","-").concat("pow"),Ua,[Bs,"interpolating"]),Hs("".concat("sequential","-").concat("sqrt"),(function(){return Ua.apply(null,arguments).exponent(.5)}),[Bs,"interpolating"]),Hs("".concat("sequential","-").concat("symlog"),(function t(){var e=xa(Ba());return e.copy=function(){return La(e,t()).constant(e.constant())},Pi.apply(e,arguments)}),[Bs,"interpolating"]),Hs("".concat("diverging","-").concat("linear"),(function t(){var e=ia(Wa()(Ko));return e.copy=function(){return La(e,t())},Pi.apply(e,arguments)}),[Bs,"interpolating"]),Hs("".concat("diverging","-").concat(Ns),(function t(){var e=da(Wa()).domain([.1,1,10]);return e.copy=function(){return La(e,t()).base(e.base())},Pi.apply(e,arguments)}),[Bs,"interpolating",Ns]),Hs("".concat("diverging","-").concat("pow"),Ya,[Bs,"interpolating"]),Hs("".concat("diverging","-").concat("sqrt"),(function(){return Ya.apply(null,arguments).exponent(.5)}),[Bs,"interpolating"]),Hs("".concat("diverging","-").concat("symlog"),(function t(){var e=xa(Wa());return e.copy=function(){return La(e,t()).constant(e.constant())},Pi.apply(e,arguments)}),[Bs,"interpolating"]),Hs("quantile",(function t(){var e,n=[],r=[],i=[];function o(){var t=0,e=Math.max(1,r.length);for(i=new Array(e-1);++t<e;)i[t-1]=Vt(n,t/e);return a}function a(t){return isNaN(t=+t)?e:r[Ni(i,t)]}return a.invertExtent=function(t){var e=r.indexOf(t);return e<0?[NaN,NaN]:[e>0?i[e-1]:n[0],e<i.length?i[e]:n[n.length-1]]},a.domain=function(t){if(!arguments.length)return n.slice();n=[];for(let e of t)null==e||isNaN(e=+e)||n.push(e);return n.sort(Ut.a),o()},a.range=function(t){return arguments.length?(r=Array.from(t),o()):r.slice()},a.unknown=function(t){return arguments.length?(e=t,a):e},a.quantiles=function(){return i.slice()},a.copy=function(){return t().domain(n).range(r).unknown(e)},Ri.apply(a,arguments)}),["discretizing","quantile"]),Hs("quantize",(function t(){var e,n=0,r=1,i=1,o=[.5],a=[0,1];function s(t){return t<=t?a[Ni(o,t,0,i)]:e}function u(){var t=-1;for(o=new Array(i);++t<i;)o[t]=((t+1)*r-(t-i)*n)/(i+1);return s}return s.domain=function(t){return arguments.length?([n,r]=t,n=+n,r=+r,u()):[n,r]},s.range=function(t){return arguments.length?(i=(a=Array.from(t)).length-1,u()):a.slice()},s.invertExtent=function(t){var e=a.indexOf(t);return e<0?[NaN,NaN]:e<1?[n,o[0]]:e>=i?[o[i-1],r]:[o[e-1],o[e]]},s.unknown=function(t){return arguments.length?(e=t,s):s},s.thresholds=function(){return o.slice()},s.copy=function(){return t().domain([n,r]).range(a).unknown(e)},Ri.apply(ia(s),arguments)}),"discretizing"),Hs("threshold",(function t(){var e,n=[.5],r=[0,1],i=1;function o(t){return t<=t?r[Ni(n,t,0,i)]:e}return o.domain=function(t){return arguments.length?(n=Array.from(t),i=Math.min(n.length,r.length-1),o):n.slice()},o.range=function(t){return arguments.length?(r=Array.from(t),i=Math.min(n.length,r.length-1),o):r.slice()},o.invertExtent=function(t){var e=r.indexOf(t);return[n[e-1],n[e]]},o.unknown=function(t){return arguments.length?(e=t,o):e},o.copy=function(){return t().domain(n).range(r).unknown(e)},Ri.apply(o,arguments)}),"discretizing"),Hs("bin-ordinal",(function t(){let e=[],n=[];function r(t){return null==t||t!=t?void 0:n[(Ni(e,t)-1)%n.length]}return r.domain=function(t){return arguments.length?(e=Us(t),r):e.slice()},r.range=function(t){return arguments.length?(n=qs.call(t),r):n.slice()},r.tickFormat=function(t,n){return Gi(e[0],Object(Z.V)(e),null==t?10:t,n)},r.copy=function(){return t().domain(r.domain()).range(r.range())},r}),["discrete","discretizing"]),Hs("ordinal",Li,"discrete"),Hs("band",Ls,"discrete"),Hs("point",(function(){return function t(e){const n=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return t(n())},e}(Ls().paddingInner(1))}),"discrete");const eu=["clamp","base","constant","exponent"];function nu(t,e){const n=e[0],r=Object(Z.V)(e)-n;return function(e){return t(n+e*r)}}function ru(t,e,n){return qa(au(e||"rgb",n),t)}function iu(t,e){const n=new Array(e),r=e+1;for(let i=0;i<e;)n[i]=t(++i/r);return n}function ou(t,e,n){const r=n-e;let i,o,a;return r&&Number.isFinite(r)?(i=(o=t.type).indexOf("-"),o=i<0?o:o.slice(i+1),a=Hs(o)().domain([e,n]).range([0,1]),eu.forEach(e=>t[e]?a[e](t[e]()):0),a):Object(Z.m)(.5)}function au(t,e){const n=a[function(t){return"interpolate"+t.toLowerCase().split("-").map(t=>t[0].toUpperCase()+t.slice(1)).join("")}(t)];return null!=e&&n&&n.gamma?n.gamma(e):n}function su(t){const e=t.length/6|0,n=new Array(e);for(let r=0;r<e;)n[r]="#"+t.slice(6*r,6*++r);return n}function uu(t,e){for(const n in t)cu(n,e(t[n]))}const lu={};function cu(t,e){return t=t&&t.toLowerCase(),arguments.length>1?(lu[t]=e,this):lu[t]}uu({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"},su),uu({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"},t=>ru(su(t)));const fu=t=>Object(Z.B)(t)?t.map(t=>String(t)):String(t),du=(t,e)=>t[1]-e[1],hu=(t,e)=>e[1]-t[1];function pu(t,e,n){let r;return Object(Z.F)(e)&&(t.bins&&(e=Math.max(e,t.bins.length)),null!=n&&(e=Math.min(e,Math.floor(Object(Z.Y)(t.domain())/n||1)))),Object(Z.G)(e)&&(r=e.step,e=e.interval),Object(Z.I)(e)&&(e=t.type===Rs?Object(He.p)(e):t.type==Ps?Object(He.v)(e):Object(Z.o)("Only time and utc scales accept interval strings."),r&&(e=e.every(r))),e}function gu(t,e,n){let r=t.range(),i=r[0],o=Object(Z.V)(r),a=du;if(i>o&&(r=o,o=i,i=r,a=hu),i=Math.floor(i),o=Math.ceil(o),e=e.map(e=>[e,t(e)]).filter(t=>i<=t[1]&&t[1]<=o).sort(a).map(t=>t[0]),n>0&&e.length>1){const t=[e[0],Object(Z.V)(e)];for(;e.length>n&&e.length>=3;)e=e.filter((t,e)=>!(e%2));e.length<3&&(e=t)}return e}function mu(t,e){return t.bins?gu(t,t.bins):t.ticks?t.ticks(e):t.domain()}function bu(t,e,n,r,i,o){const a=e.type;let s=fu;if(a===Rs||i===Rs)s=t.timeFormat(r);else if(a===Ps||i===Ps)s=t.utcFormat(r);else if(Zs(a)){const i=t.formatFloat(r);if(o||e.bins)s=i;else{const t=yu(e,n,!1);s=e=>t(e)?i(e):""}}else if(e.tickFormat){const i=e.domain();s=t.formatSpan(i[0],i[i.length-1],n,r)}else r&&(s=t.format(r));return s}function yu(t,e,n){const r=mu(t,e),i=t.base(),o=Math.log(i),a=Math.max(1,i*e/r.length),s=t=>{let e=t/Math.pow(i,Math.round(Math.log(t)/o));return e*i<i-.5&&(e*=i),e<=a};return n?r.filter(s):s}const vu={quantile:"quantiles",quantize:"thresholds",threshold:"domain"},xu={quantile:"quantiles",quantize:"domain"};function _u(t,e){return t.bins?function(t){const e=t.slice(0,-1);return e.max=Object(Z.V)(t),e}(t.bins):t.type===Ns?yu(t,e,!0):vu[t.type]?function(t){const e=[-1/0].concat(t);return e.max=1/0,e}(t[vu[t.type]]()):mu(t,e)}function Ou(t,e,n,r,i,o,a){const s=xu[e.type]&&o!==Rs&&o!==Ps?function(t,e,n){const r=e[xu[e.type]](),i=r.length;let o,a=i>1?r[1]-r[0]:r[0];for(o=1;o<i;++o)a=Math.min(a,r[o]-r[o-1]);return t.formatSpan(0,a,30,n)}(t,e,i):bu(t,e,n,i,o,a);return"symbol"===r&&(t=>vu[t.type]||t.bins)(e)?wu(s):"discrete"===r?ku(s):Eu(s)}const wu=t=>(e,n,r)=>{const i=ju(r[n+1],ju(r.max,1/0)),o=Au(e,t),a=Au(i,t);return o&&a?o+" – "+a:a?"< "+a:"≥ "+o},ju=(t,e)=>null!=t?t:e,ku=t=>(e,n)=>n?t(e):null,Eu=t=>e=>t(e),Au=(t,e)=>Number.isFinite(t)?e(t):null;function Du(t,e,n,r){const i=r||e.type;return Object(Z.I)(n)&&Vs(i,"temporal")&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),n||i!==Rs?n||i!==Ps?Ou(t,e,5,null,n,r,!0):t.utcFormat("%A, %d %B %Y, %X UTC"):t.timeFormat("%A, %d %B %Y, %X")}function Mu(t,e,n){n=n||{};const r=Math.max(3,n.maxlen||7),i=Du(t,e,n.format,n.formatType);if(Ks(e.type)){const t=_u(e).slice(1).map(i),n=t.length;return"".concat(n," boundar").concat(1===n?"y":"ies",": ").concat(t.join(", "))}if(Js(e.type)){const t=e.domain(),n=t.length,o=n>r?t.slice(0,r-2).map(i).join(", ")+", ending with "+t.slice(-1).map(i):t.map(i).join(", ");return"".concat(n," value").concat(1===n?"":"s",": ").concat(o)}{const t=e.domain();return"values from ".concat(i(t[0])," to ").concat(i(Object(Z.V)(t)))}}let Su=0;function Cu(t){return t&&t.gradient}function Fu(t,e,n){const r=t.gradient;let i=t.id,o="radial"===r?"p_":"";return i||(i=t.id="gradient_"+Su++,"radial"===r?(t.x1=zu(t.x1,.5),t.y1=zu(t.y1,.5),t.r1=zu(t.r1,0),t.x2=zu(t.x2,.5),t.y2=zu(t.y2,.5),t.r2=zu(t.r2,.5),o="p_"):(t.x1=zu(t.x1,0),t.y1=zu(t.y1,0),t.x2=zu(t.x2,1),t.y2=zu(t.y2,0))),e[i]=t,"url("+(n||"")+"#"+o+i+")"}function zu(t,e){return null!=t?t:e}function Tu(t,e){var n,r=[];return n={gradient:"linear",x1:t?t[0]:0,y1:t?t[1]:0,x2:e?e[0]:1,y2:e?e[1]:0,stops:r,stop:function(t,e){return r.push({offset:t,color:e}),n}}}const $u={basis:{curve:function(t){return new vr(t)}},"basis-closed":{curve:function(t){return new _r(t)}},"basis-open":{curve:function(t){return new Or(t)}},bundle:{curve:jr,tension:"beta",value:.85},cardinal:{curve:Ar,tension:"tension",value:0},"cardinal-open":{curve:Mr,tension:"tension",value:0},"cardinal-closed":{curve:Cr,tension:"tension",value:0},"catmull-rom":{curve:Hr,tension:"alpha",value:.5},"catmull-rom-closed":{curve:Vr,tension:"alpha",value:.5},"catmull-rom-open":{curve:Jr,tension:"alpha",value:.5},linear:{curve:Zr},"linear-closed":{curve:function(t){return new Qr(t)}},monotone:{horizontal:function(t){return new oi(t)},vertical:function(t){return new ii(t)}},natural:{curve:function(t){return new si(t)}},step:{curve:function(t){return new li(t,.5)}},"step-after":{curve:function(t){return new li(t,1)}},"step-before":{curve:function(t){return new li(t,0)}}};function Nu(t,e,n){var r=Object(Z.w)($u,t)&&$u[t],i=null;return r&&(i=r.curve||r[e||"vertical"],r.tension&&null!=n&&(i=i[r.tension](n))),i}const Ru={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},Pu=[/([MLHVCSQTAZmlhvcsqtaz])/g,/###/,/(\.\d+)(\.\d)/g,/(\d)([-+])/g,/\s|,|###/];function Bu(t){const e=[];let n,r,i,o,a,s,u,l,c,f;const d=t.slice().replace(Pu[0],"###$1").split(Pu[1]).slice(1);for(u=0,c=d.length;u<c;++u){for(n=d[u],r=n.slice(1).trim().replace(Pu[2],"$1###$2").replace(Pu[3],"$1###$2").split(Pu[4]),a=n.charAt(0),i=[a],l=0,f=r.length;l<f;++l)(o=+r[l])===o&&i.push(o);if(s=Ru[a.toLowerCase()],i.length-1>s){const t=i.length;for(l=1,e.push([a].concat(i.slice(l,l+=s))),a="M"===a?"L":"m"===a?"l":a;l<t;l+=s)e.push([a].concat(i.slice(l,l+s)))}else e.push(i)}return e}const Lu=Math.PI/180,Iu=Math.PI/2,Uu=2*Math.PI,qu=Math.sqrt(3)/2;var Wu={},Yu={},Hu=[].join;function Gu(t){const e=Hu.call(t);if(Yu[e])return Yu[e];var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],l=t[7];const c=l*a,f=-u*s,d=u*a,h=l*s,p=Math.cos(i),g=Math.sin(i),m=Math.cos(o),b=Math.sin(o),y=.5*(o-i),v=Math.sin(.5*y),x=8/3*v*v/Math.sin(y),_=n+p-x*g,O=r+g+x*p,w=n+m,j=r+b,k=w+x*b,E=j-x*m;return Yu[e]=[c*_+f*O,d*_+h*O,c*k+f*E,d*k+h*E,c*w+f*j,d*w+h*j]}const Vu=["l",0,0,0,0,0,0,0];function Xu(t,e,n){const r=Vu[0]=t[0];if("a"===r||"A"===r)Vu[1]=e*t[1],Vu[2]=n*t[2],Vu[3]=t[3],Vu[4]=t[4],Vu[5]=t[5],Vu[6]=e*t[6],Vu[7]=n*t[7];else if("h"===r||"H"===r)Vu[1]=e*t[1];else if("v"===r||"V"===r)Vu[1]=n*t[1];else for(var i=1,o=t.length;i<o;++i)Vu[i]=(i%2==1?e:n)*t[i];return Vu}function Ju(t,e,n,r,i,o){var a,s,u,l,c,f=null,d=0,h=0,p=0,g=0;null==n&&(n=0),null==r&&(r=0),null==i&&(i=1),null==o&&(o=i),t.beginPath&&t.beginPath();for(var m=0,b=e.length;m<b;++m){switch(a=e[m],1===i&&1===o||(a=Xu(a,i,o)),a[0]){case"l":d+=a[1],h+=a[2],t.lineTo(d+n,h+r);break;case"L":d=a[1],h=a[2],t.lineTo(d+n,h+r);break;case"h":d+=a[1],t.lineTo(d+n,h+r);break;case"H":d=a[1],t.lineTo(d+n,h+r);break;case"v":h+=a[1],t.lineTo(d+n,h+r);break;case"V":h=a[1],t.lineTo(d+n,h+r);break;case"m":d+=a[1],h+=a[2],t.moveTo(d+n,h+r);break;case"M":d=a[1],h=a[2],t.moveTo(d+n,h+r);break;case"c":s=d+a[5],u=h+a[6],p=d+a[3],g=h+a[4],t.bezierCurveTo(d+a[1]+n,h+a[2]+r,p+n,g+r,s+n,u+r),d=s,h=u;break;case"C":d=a[5],h=a[6],p=a[3],g=a[4],t.bezierCurveTo(a[1]+n,a[2]+r,p+n,g+r,d+n,h+r);break;case"s":s=d+a[3],u=h+a[4],p=2*d-p,g=2*h-g,t.bezierCurveTo(p+n,g+r,d+a[1]+n,h+a[2]+r,s+n,u+r),p=d+a[1],g=h+a[2],d=s,h=u;break;case"S":s=a[3],u=a[4],p=2*d-p,g=2*h-g,t.bezierCurveTo(p+n,g+r,a[1]+n,a[2]+r,s+n,u+r),d=s,h=u,p=a[1],g=a[2];break;case"q":s=d+a[3],u=h+a[4],p=d+a[1],g=h+a[2],t.quadraticCurveTo(p+n,g+r,s+n,u+r),d=s,h=u;break;case"Q":s=a[3],u=a[4],t.quadraticCurveTo(a[1]+n,a[2]+r,s+n,u+r),d=s,h=u,p=a[1],g=a[2];break;case"t":s=d+a[1],u=h+a[2],null===f[0].match(/[QqTt]/)?(p=d,g=h):"t"===f[0]?(p=2*d-l,g=2*h-c):"q"===f[0]&&(p=2*d-p,g=2*h-g),l=p,c=g,t.quadraticCurveTo(p+n,g+r,s+n,u+r),h=u,p=(d=s)+a[1],g=h+a[2];break;case"T":s=a[1],u=a[2],p=2*d-p,g=2*h-g,t.quadraticCurveTo(p+n,g+r,s+n,u+r),d=s,h=u;break;case"a":Ku(t,d+n,h+r,[a[1],a[2],a[3],a[4],a[5],a[6]+d+n,a[7]+h+r]),d+=a[6],h+=a[7];break;case"A":Ku(t,d+n,h+r,[a[1],a[2],a[3],a[4],a[5],a[6]+n,a[7]+r]),d=a[6],h=a[7];break;case"z":case"Z":t.closePath()}f=a}}function Ku(t,e,n,r){const i=function(t,e,n,r,i,o,a,s,u){const l=Hu.call(arguments);if(Wu[l])return Wu[l];const c=a*Lu,f=Math.sin(c),d=Math.cos(c),h=d*(s-t)*.5+f*(u-e)*.5,p=d*(u-e)*.5-f*(s-t)*.5;let g=h*h/((n=Math.abs(n))*n)+p*p/((r=Math.abs(r))*r);g>1&&(g=Math.sqrt(g),n*=g,r*=g);const m=d/n,b=f/n,y=-f/r,v=d/r,x=m*s+b*u,_=y*s+v*u,O=m*t+b*e,w=y*t+v*e,j=(O-x)*(O-x)+(w-_)*(w-_);let k=1/j-.25;k<0&&(k=0);let E=Math.sqrt(k);o==i&&(E=-E);const A=.5*(x+O)-E*(w-_),D=.5*(_+w)+E*(O-x),M=Math.atan2(_-D,x-A),S=Math.atan2(w-D,O-A);let C=S-M;C<0&&1===o?C+=Uu:C>0&&0===o&&(C-=Uu);const F=Math.ceil(Math.abs(C/(Iu+.001))),z=[];for(let t=0;t<F;++t){const e=M+t*C/F,i=M+(t+1)*C/F;z[t]=[A,D,e,i,n,r,f,d]}return Wu[l]=z}(r[5],r[6],r[0],r[1],r[3],r[4],r[2],e,n);for(let e=0;e<i.length;++e){const n=Gu(i[e]);t.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5])}}const Zu=.5773502691896257,Qu={circle:{draw:function(t,e){const n=Math.sqrt(e)/2;t.moveTo(n,0),t.arc(0,0,n,0,Uu)}},cross:{draw:function(t,e){var n=Math.sqrt(e)/2,r=n/2.5;t.moveTo(-n,-r),t.lineTo(-n,r),t.lineTo(-r,r),t.lineTo(-r,n),t.lineTo(r,n),t.lineTo(r,r),t.lineTo(n,r),t.lineTo(n,-r),t.lineTo(r,-r),t.lineTo(r,-n),t.lineTo(-r,-n),t.lineTo(-r,-r),t.closePath()}},diamond:{draw:function(t,e){const n=Math.sqrt(e)/2;t.moveTo(-n,0),t.lineTo(0,-n),t.lineTo(n,0),t.lineTo(0,n),t.closePath()}},square:{draw:function(t,e){var n=Math.sqrt(e),r=-n/2;t.rect(r,r,n,n)}},arrow:{draw:function(t,e){var n=Math.sqrt(e)/2,r=n/7,i=n/2.5,o=n/8;t.moveTo(-r,n),t.lineTo(r,n),t.lineTo(r,-o),t.lineTo(i,-o),t.lineTo(0,-n),t.lineTo(-i,-o),t.lineTo(-r,-o),t.closePath()}},wedge:{draw:function(t,e){var n=Math.sqrt(e)/2,r=qu*n,i=r-n*Zu,o=n/4;t.moveTo(0,-r-i),t.lineTo(-o,r-i),t.lineTo(o,r-i),t.closePath()}},triangle:{draw:function(t,e){var n=Math.sqrt(e)/2,r=qu*n,i=r-n*Zu;t.moveTo(0,-r-i),t.lineTo(-n,r-i),t.lineTo(n,r-i),t.closePath()}},"triangle-up":{draw:function(t,e){var n=Math.sqrt(e)/2,r=qu*n;t.moveTo(0,-r),t.lineTo(-n,r),t.lineTo(n,r),t.closePath()}},"triangle-down":{draw:function(t,e){var n=Math.sqrt(e)/2,r=qu*n;t.moveTo(0,r),t.lineTo(-n,-r),t.lineTo(n,-r),t.closePath()}},"triangle-right":{draw:function(t,e){var n=Math.sqrt(e)/2,r=qu*n;t.moveTo(r,0),t.lineTo(-r,-n),t.lineTo(-r,n),t.closePath()}},"triangle-left":{draw:function(t,e){var n=Math.sqrt(e)/2,r=qu*n;t.moveTo(-r,0),t.lineTo(r,-n),t.lineTo(r,n),t.closePath()}},stroke:{draw:function(t,e){const n=Math.sqrt(e)/2;t.moveTo(-n,0),t.lineTo(n,0)}}};function tl(t){return Object(Z.w)(Qu,t)?Qu[t]:function(t){if(!Object(Z.w)(el,t)){const e=Bu(t);el[t]={draw:function(t,n){Ju(t,e,0,0,Math.sqrt(n)/2)}}}return el[t]}(t)}var el={};function nl(t){return t.x}function rl(t){return t.y}function il(t){return t.width}function ol(t){return t.height}function al(t){return"function"==typeof t?t:()=>+t}function sl(t,e,n){return Math.max(e,Math.min(t,n))}function ul(){var t=nl,e=rl,n=il,r=ol,i=al(0),o=i,a=i,s=i,u=null;function l(l,c,f){var d,h=null!=c?c:+t.call(this,l),p=null!=f?f:+e.call(this,l),g=+n.call(this,l),m=+r.call(this,l),b=Math.min(g,m)/2,y=sl(+i.call(this,l),0,b),v=sl(+o.call(this,l),0,b),x=sl(+a.call(this,l),0,b),_=sl(+s.call(this,l),0,b);if(u||(u=d=gi()),y<=0&&v<=0&&x<=0&&_<=0)u.rect(h,p,g,m);else{var O=h+g,w=p+m;u.moveTo(h+y,p),u.lineTo(O-v,p),u.bezierCurveTo(O-.448084975506*v,p,O,p+.448084975506*v,O,p+v),u.lineTo(O,w-_),u.bezierCurveTo(O,w-.448084975506*_,O-.448084975506*_,w,O-_,w),u.lineTo(h+x,w),u.bezierCurveTo(h+.448084975506*x,w,h,w-.448084975506*x,h,w-x),u.lineTo(h,p+y),u.bezierCurveTo(h,p+.448084975506*y,h+.448084975506*y,p,h+y,p),u.closePath()}if(d)return u=null,d+""||null}return l.x=function(e){return arguments.length?(t=al(e),l):t},l.y=function(t){return arguments.length?(e=al(t),l):e},l.width=function(t){return arguments.length?(n=al(t),l):n},l.height=function(t){return arguments.length?(r=al(t),l):r},l.cornerRadius=function(t,e,n,r){return arguments.length?(i=al(t),o=null!=e?al(e):i,s=null!=n?al(n):i,a=null!=r?al(r):o,l):i},l.context=function(t){return arguments.length?(u=null==t?null:t,l):u},l}function ll(){var t,e,n,r,i,o,a,s,u=null;function l(t,e,n){const r=n/2;if(i){var l=a-e,c=t-o;if(l||c){var f=Math.sqrt(l*l+c*c),d=(l/=f)*s,h=(c/=f)*s,p=Math.atan2(c,l);u.moveTo(o-d,a-h),u.lineTo(t-l*r,e-c*r),u.arc(t,e,r,p-Math.PI,p),u.lineTo(o+d,a+h),u.arc(o,a,s,p,p+Math.PI)}else u.arc(t,e,r,0,Uu);u.closePath()}else i=1;o=t,a=e,s=r}function c(o){var a,s,c,f=o.length,d=!1;for(null==u&&(u=c=gi()),a=0;a<=f;++a)!(a<f&&r(s=o[a],a,o))===d&&(d=!d)&&(i=0),d&&l(+t(s,a,o),+e(s,a,o),+n(s,a,o));if(c)return u=null,c+""||null}return c.x=function(e){return arguments.length?(t=e,c):t},c.y=function(t){return arguments.length?(e=t,c):e},c.size=function(t){return arguments.length?(n=t,c):n},c.defined=function(t){return arguments.length?(r=t,c):r},c.context=function(t){return arguments.length?(u=null==t?null:t,c):u},c}function cl(t,e){return null!=t?t:e}const fl=t=>t.x||0,dl=t=>t.y||0,hl=t=>!(!1===t.defined),pl=function(){var t=bi,e=yi,n=mi(0),r=null,i=vi,o=xi,a=_i,s=null;function u(){var u,l,c=+t.apply(this,arguments),f=+e.apply(this,arguments),d=i.apply(this,arguments)-Lr,h=o.apply(this,arguments)-Lr,p=Fr(h-d),g=h>d;if(s||(s=u=gi()),f<c&&(l=f,f=c,c=l),f>1e-12)if(p>Ir-1e-12)s.moveTo(f*Tr(d),f*Rr(d)),s.arc(0,0,f,d,h,!g),c>1e-12&&(s.moveTo(c*Tr(h),c*Rr(h)),s.arc(0,0,c,h,d,g));else{var m,b,y=d,v=h,x=d,_=h,O=p,w=p,j=a.apply(this,arguments)/2,k=j>1e-12&&(r?+r.apply(this,arguments):Pr(c*c+f*f)),E=Nr(Fr(f-c)/2,+n.apply(this,arguments)),A=E,D=E;if(k>1e-12){var M=qr(k/c*Rr(j)),S=qr(k/f*Rr(j));(O-=2*M)>1e-12?(x+=M*=g?1:-1,_-=M):(O=0,x=_=(d+h)/2),(w-=2*S)>1e-12?(y+=S*=g?1:-1,v-=S):(w=0,y=v=(d+h)/2)}var C=f*Tr(y),F=f*Rr(y),z=c*Tr(_),T=c*Rr(_);if(E>1e-12){var $,N=f*Tr(v),R=f*Rr(v),P=c*Tr(x),B=c*Rr(x);if(p<Br&&($=Oi(C,F,P,B,N,R,z,T))){var L=C-$[0],I=F-$[1],U=N-$[0],q=R-$[1],W=1/Rr(Ur((L*U+I*q)/(Pr(L*L+I*I)*Pr(U*U+q*q)))/2),Y=Pr($[0]*$[0]+$[1]*$[1]);A=Nr(E,(c-Y)/(W-1)),D=Nr(E,(f-Y)/(W+1))}}w>1e-12?D>1e-12?(m=wi(P,B,C,F,f,D,g),b=wi(N,R,z,T,f,D,g),s.moveTo(m.cx+m.x01,m.cy+m.y01),D<E?s.arc(m.cx,m.cy,D,zr(m.y01,m.x01),zr(b.y01,b.x01),!g):(s.arc(m.cx,m.cy,D,zr(m.y01,m.x01),zr(m.y11,m.x11),!g),s.arc(0,0,f,zr(m.cy+m.y11,m.cx+m.x11),zr(b.cy+b.y11,b.cx+b.x11),!g),s.arc(b.cx,b.cy,D,zr(b.y11,b.x11),zr(b.y01,b.x01),!g))):(s.moveTo(C,F),s.arc(0,0,f,y,v,!g)):s.moveTo(C,F),c>1e-12&&O>1e-12?A>1e-12?(m=wi(z,T,N,R,c,-A,g),b=wi(C,F,P,B,c,-A,g),s.lineTo(m.cx+m.x01,m.cy+m.y01),A<E?s.arc(m.cx,m.cy,A,zr(m.y01,m.x01),zr(b.y01,b.x01),!g):(s.arc(m.cx,m.cy,A,zr(m.y01,m.x01),zr(m.y11,m.x11),!g),s.arc(0,0,c,zr(m.cy+m.y11,m.cx+m.x11),zr(b.cy+b.y11,b.cx+b.x11),g),s.arc(b.cx,b.cy,A,zr(b.y11,b.x11),zr(b.y01,b.x01),!g))):s.arc(0,0,c,_,x,g):s.lineTo(z,T)}else s.moveTo(0,0);if(s.closePath(),u)return s=null,u+""||null}return u.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-Br/2;return[Tr(r)*n,Rr(r)*n]},u.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:mi(+e),u):t},u.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:mi(+t),u):e},u.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:mi(+t),u):n},u.padRadius=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:mi(+t),u):r},u.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:mi(+t),u):i},u.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:mi(+t),u):o},u.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:mi(+t),u):a},u.context=function(t){return arguments.length?(s=null==t?null:t,u):s},u}().startAngle(t=>t.startAngle||0).endAngle(t=>t.endAngle||0).padAngle(t=>t.padAngle||0).innerRadius(t=>t.innerRadius||0).outerRadius(t=>t.outerRadius||0).cornerRadius(t=>t.cornerRadius||0),gl=Di().x(fl).y1(dl).y0(t=>(t.y||0)+(t.height||0)).defined(hl),ml=Di().y(dl).x1(fl).x0(t=>(t.x||0)+(t.width||0)).defined(hl),bl=Ai().x(fl).y(dl).defined(hl),yl=ul().x(fl).y(dl).width(t=>t.width||0).height(t=>t.height||0).cornerRadius(t=>cl(t.cornerRadiusTopLeft,t.cornerRadius)||0,t=>cl(t.cornerRadiusTopRight,t.cornerRadius)||0,t=>cl(t.cornerRadiusBottomRight,t.cornerRadius)||0,t=>cl(t.cornerRadiusBottomLeft,t.cornerRadius)||0),vl=function(t,e){var n=null;function r(){var r;if(n||(n=r=gi()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),r)return n=null,r+""||null}return t="function"==typeof t?t:mi(t||Mi),e="function"==typeof e?e:mi(void 0===e?64:+e),r.type=function(e){return arguments.length?(t="function"==typeof e?e:mi(e),r):t},r.size=function(t){return arguments.length?(e="function"==typeof t?t:mi(+t),r):e},r.context=function(t){return arguments.length?(n=null==t?null:t,r):n},r}().type(t=>tl(t.shape||"circle")).size(t=>cl(t.size,64)),xl=ll().x(fl).y(dl).defined(hl).size(t=>t.size||1);function _l(t){return t.cornerRadius||t.cornerRadiusTopLeft||t.cornerRadiusTopRight||t.cornerRadiusBottomRight||t.cornerRadiusBottomLeft}function Ol(t,e,n,r){return yl.context(t)(e,n,r)}var wl=1;function jl(){wl=1}function kl(t,e,n){var r=e.clip,i=t._defs,o=e.clip_id||(e.clip_id="clip"+wl++),a=i.clipping[o]||(i.clipping[o]={id:o});return Object(Z.E)(r)?a.path=r(null):_l(n)?a.path=Ol(null,n,0,0):(a.width=n.width||0,a.height=n.height||0),"url(#"+o+")"}function El(t){this.clear(),t&&this.union(t)}function Al(t){this.mark=t,this.bounds=this.bounds||new El}function Dl(t){Al.call(this,t),this.items=this.items||[]}function Ml(t){this._pending=0,this._loader=t||Object(Q.e)()}function Sl(t){t._pending+=1}function Cl(t){t._pending-=1}function Fl(t,e,n){if(e.stroke&&0!==e.opacity&&0!==e.strokeOpacity){const r=null!=e.strokeWidth?+e.strokeWidth:1;t.expand(r+(n?function(t,e){return t.strokeJoin&&"miter"!==t.strokeJoin?0:e}(e,r):0))}return t}El.prototype={clone(){return new El(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2},set(t,e,n,r){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),r<e?(this.y2=e,this.y1=r):(this.y1=e,this.y2=r),this},add(t,e){return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this},expand(t){return this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(t){return this.x1*=t,this.y1*=t,this.x2*=t,this.y2*=t,this},translate(t,e){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this},rotate(t,e,n){const r=this.rotatedPoints(t,e,n);return this.clear().add(r[0],r[1]).add(r[2],r[3]).add(r[4],r[5]).add(r[6],r[7])},rotatedPoints(t,e,n){var{x1:r,y1:i,x2:o,y2:a}=this,s=Math.cos(t),u=Math.sin(t),l=e-e*s+n*u,c=n-e*u-n*s;return[s*r-u*i+l,u*r+s*i+c,s*r-u*a+l,u*r+s*a+c,s*o-u*i+l,u*o+s*i+c,s*o-u*a+l,u*o+s*a+c]},union(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this},intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this},encloses(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2},alignsWith(t){return t&&(this.x1==t.x1||this.x2==t.x2||this.y1==t.y1||this.y2==t.y2)},intersects(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)},contains(t,e){return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}},Object(Z.z)(Dl,Al),Ml.prototype={pending(){return this._pending},sanitizeURL(t){const e=this;return Sl(e),e._loader.sanitize(t,{context:"href"}).then(t=>(Cl(e),t)).catch(()=>(Cl(e),null))},loadImage(t){const e=this,n=Fi();return Sl(e),e._loader.sanitize(t,{context:"image"}).then(t=>{const r=t.href;if(!r||!n)throw{url:r};const i=new n,o=Object(Z.w)(t,"crossOrigin")?t.crossOrigin:"anonymous";return null!=o&&(i.crossOrigin=o),i.onload=()=>Cl(e),i.onerror=()=>Cl(e),i.src=r,i}).catch(t=>(Cl(e),{complete:!1,width:0,height:0,src:t&&t.url||""}))},ready(){const t=this;return new Promise(e=>{!function n(r){t.pending()?setTimeout(()=>{n(!0)},10):e(r)}(!1)})}};const zl=Uu-1e-8;let Tl,$l,Nl,Rl,Pl,Bl,Ll,Il;const Ul=(t,e)=>Tl.add(t,e),ql=(t,e)=>Ul($l=t,Nl=e),Wl=t=>Ul(t,Tl.y1),Yl=t=>Ul(Tl.x1,t),Hl=(t,e)=>Pl*t+Ll*e,Gl=(t,e)=>Bl*t+Il*e,Vl=(t,e)=>Ul(Hl(t,e),Gl(t,e)),Xl=(t,e)=>ql(Hl(t,e),Gl(t,e));function Jl(t,e){return Tl=t,e?(Rl=e*Lu,Pl=Il=Math.cos(Rl),Bl=Math.sin(Rl),Ll=-Bl):(Pl=Il=1,Rl=Bl=Ll=0),Kl}const Kl={beginPath(){},closePath(){},moveTo:Xl,lineTo:Xl,rect(t,e,n,r){Rl?(Vl(t+n,e),Vl(t+n,e+r),Vl(t,e+r),Xl(t,e)):(Ul(t+n,e+r),ql(t,e))},quadraticCurveTo(t,e,n,r){const i=Hl(t,e),o=Gl(t,e),a=Hl(n,r),s=Gl(n,r);Zl($l,i,a,Wl),Zl(Nl,o,s,Yl),ql(a,s)},bezierCurveTo(t,e,n,r,i,o){const a=Hl(t,e),s=Gl(t,e),u=Hl(n,r),l=Gl(n,r),c=Hl(i,o),f=Gl(i,o);Ql($l,a,u,c,Wl),Ql(Nl,s,l,f,Yl),ql(c,f)},arc(t,e,n,r,i,o){if(r+=Rl,i+=Rl,$l=n*Math.cos(i)+t,Nl=n*Math.sin(i)+e,Math.abs(i-r)>zl)Ul(t-n,e-n),Ul(t+n,e+n);else{const a=r=>Ul(n*Math.cos(r)+t,n*Math.sin(r)+e);let s,u;if(a(r),a(i),i!==r)if((r%=Uu)<0&&(r+=Uu),(i%=Uu)<0&&(i+=Uu),i<r&&(o=!o,s=r,r=i,i=s),o)for(i-=Uu,s=r-r%Iu,u=0;u<4&&s>i;++u,s-=Iu)a(s);else for(s=r-r%Iu+Iu,u=0;u<4&&s<i;++u,s+=Iu)a(s)}}};function Zl(t,e,n,r){const i=(t-e)/(t+n-2*e);0<i&&i<1&&r(t+(e-t)*i)}function Ql(t,e,n,r,i){const o=r-t+3*e-3*n,a=t+n-2*e,s=t-e;let u,l=0,c=0;Math.abs(o)>1e-14?(u=a*a+s*o,u>=0&&(u=Math.sqrt(u),l=(-a+u)/o,c=(-a-u)/o)):l=.5*s/a,0<l&&l<1&&i(tc(l,t,e,n,r)),0<c&&c<1&&i(tc(c,t,e,n,r))}function tc(t,e,n,r,i){const o=1-t,a=o*o,s=t*t;return a*o*e+3*a*t*n+3*o*s*r+s*t*i}var ec=(ec=Ci(1,1))?ec.getContext("2d"):null;const nc=new El;function rc(t){return function(e,n){if(!ec)return!0;t(ec,e),nc.clear().union(e.bounds).intersect(n).round();const{x1:r,y1:i,x2:o,y2:a}=nc;for(let t=i;t<=a;++t)for(let e=r;e<=o;++e)if(ec.isPointInPath(e,t))return!0;return!1}}function ic(t,e){return e.contains(t.x||0,t.y||0)}function oc(t,e){const n=t.x||0,r=t.y||0,i=t.width||0,o=t.height||0;return e.intersects(nc.set(n,r,n+i,r+o))}function ac(t,e){const n=t.x||0,r=t.y||0;return sc(e,n,r,null!=t.x2?t.x2:n,null!=t.y2?t.y2:r)}function sc(t,e,n,r,i){const{x1:o,y1:a,x2:s,y2:u}=t,l=r-e,c=i-n;let f,d,h,p,g=0,m=1;for(p=0;p<4;++p){if(0===p&&(f=-l,d=-(o-e)),1===p&&(f=l,d=s-e),2===p&&(f=-c,d=-(a-n)),3===p&&(f=c,d=u-n),Math.abs(f)<1e-10&&d<0)return!1;if(h=d/f,f<0){if(h>m)return!1;h>g&&(g=h)}else if(f>0){if(h<g)return!1;h<m&&(m=h)}}return!0}function uc(t,e){t.globalCompositeOperation=e.blend||"source-over"}function lc(t,e){return null==t?e:t}function cc(t,e){const n=e.length;for(let r=0;r<n;++r)t.addColorStop(e[r].offset,e[r].color);return t}function fc(t,e,n){return Cu(n)?function(t,e,n){const r=n.width(),i=n.height();let o;if("radial"===e.gradient)o=t.createRadialGradient(n.x1+lc(e.x1,.5)*r,n.y1+lc(e.y1,.5)*i,Math.max(r,i)*lc(e.r1,0),n.x1+lc(e.x2,.5)*r,n.y1+lc(e.y2,.5)*i,Math.max(r,i)*lc(e.r2,.5));else{const a=lc(e.x1,0),s=lc(e.y1,0),u=lc(e.x2,1),l=lc(e.y2,0);if(a!==u&&s!==l&&r!==i){const n=Ci(Math.ceil(r),Math.ceil(i)),o=n.getContext("2d");return o.scale(r,i),o.fillStyle=cc(o.createLinearGradient(a,s,u,l),e.stops),o.fillRect(0,0,r,i),t.createPattern(n,"no-repeat")}o=t.createLinearGradient(n.x1+a*r,n.y1+s*i,n.x1+u*r,n.y1+l*i)}return cc(o,e.stops)}(t,n,e.bounds):n}function dc(t,e,n){return(n*=null==e.fillOpacity?1:e.fillOpacity)>0&&(t.globalAlpha=n,t.fillStyle=fc(t,e,e.fill),!0)}var hc=[];function pc(t,e,n){var r=null!=(r=e.strokeWidth)?r:1;return!(r<=0)&&((n*=null==e.strokeOpacity?1:e.strokeOpacity)>0&&(t.globalAlpha=n,t.strokeStyle=fc(t,e,e.stroke),t.lineWidth=r,t.lineCap=e.strokeCap||"butt",t.lineJoin=e.strokeJoin||"miter",t.miterLimit=e.strokeMiterLimit||10,t.setLineDash&&(t.setLineDash(e.strokeDash||hc),t.lineDashOffset=e.strokeDashOffset||0),!0))}function gc(t,e){return t.zindex-e.zindex||t.index-e.index}function mc(t){if(!t.zdirty)return t.zitems;var e,n,r,i=t.items,o=[];for(n=0,r=i.length;n<r;++n)(e=i[n]).index=n,e.zindex&&o.push(e);return t.zdirty=!1,t.zitems=o.sort(gc)}function bc(t,e){var n,r,i=t.items;if(!i||!i.length)return;const o=mc(t);if(o&&o.length){for(n=0,r=i.length;n<r;++n)i[n].zindex||e(i[n]);i=o}for(n=0,r=i.length;n<r;++n)e(i[n])}function yc(t,e){var n,r,i=t.items;if(!i||!i.length)return null;const o=mc(t);for(o&&o.length&&(i=o),r=i.length;--r>=0;)if(n=e(i[r]))return n;if(i===o)for(r=(i=t.items).length;--r>=0;)if(!i[r].zindex&&(n=e(i[r])))return n;return null}function vc(t){return function(e,n,r){bc(n,n=>{r&&!r.intersects(n.bounds)||xc(t,e,n,n)})}}function xc(t,e,n,r){var i=null==n.opacity?1:n.opacity;0!==i&&(t(e,r)||(uc(e,n),n.fill&&dc(e,n,i)&&e.fill(),n.stroke&&pc(e,n,i)&&e.stroke()))}function _c(t){return t=t||Z.hb,function(e,n,r,i,o,a){return r*=e.pixelRatio,i*=e.pixelRatio,yc(n,n=>{const s=n.bounds;if((!s||s.contains(o,a))&&s)return t(e,n,r,i,o,a)?n:void 0})}}function Oc(t,e){return function(n,r,i,o){var a,s,u=Array.isArray(r)?r[0]:r,l=null==e?u.fill:e,c=u.stroke&&n.isPointInStroke;return c&&(a=u.strokeWidth,s=u.strokeCap,n.lineWidth=null!=a?a:1,n.lineCap=null!=s?s:"butt"),!t(n,r)&&(l&&n.isPointInPath(i,o)||c&&n.isPointInStroke(i,o))}}function wc(t){return _c(Oc(t))}function jc(t,e){return"translate("+t+","+e+")"}function kc(t){return"rotate("+t+")"}function Ec(t){return jc(t.x||0,t.y||0)}function Ac(t,e,n){function r(t,n){var r=n.x||0,i=n.y||0,o=n.angle||0;t.translate(r,i),o&&t.rotate(o*=Lu),t.beginPath(),e(t,n),o&&t.rotate(-o),t.translate(-r,-i)}return{type:t,tag:"path",nested:!1,attr:function(t,n){t("transform",function(t){return jc(t.x||0,t.y||0)+(t.angle?" "+kc(t.angle):"")}(n)),t("d",e(null,n))},bound:function(t,n){return e(Jl(t,n.angle),n),Fl(t,n).translate(n.x||0,n.y||0)},draw:vc(r),pick:wc(r),isect:n||rc(r)}}var Dc=Ac("arc",(function(t,e){return pl.context(t)(e)}));function Mc(t,e,n){function r(t,n){t.beginPath(),e(t,n)}const i=Oc(r);return{type:t,tag:"path",nested:!0,attr:function(t,n){var r=n.mark.items;r.length&&t("d",e(null,r))},bound:function(t,n){var r=n.items;return 0===r.length?t:(e(Jl(t),r),Fl(t,r[0]))},draw:(o=r,function(t,e,n){!e.items.length||n&&!n.intersects(e.bounds)||xc(o,t,e.items[0],e.items)}),pick:function(t,e,n,r,o,a){var s=e.items,u=e.bounds;return!s||!s.length||u&&!u.contains(o,a)?null:(n*=t.pixelRatio,r*=t.pixelRatio,i(t,s,n,r)?s[0]:null)},isect:ic,tip:n};var o}var Sc=Mc("area",(function(t,e){const n=e[0],r=n.interpolate||"linear";return("horizontal"===n.orient?ml:gl).curve(Nu(r,n.orient,n.tension)).context(t)(e)}),(function(t,e){for(var n,r,i="horizontal"===t[0].orient?e[1]:e[0],o="horizontal"===t[0].orient?"y":"x",a=t.length,s=1/0;--a>=0;)!1!==t[a].defined&&(r=Math.abs(t[a][o]-i))<s&&(s=r,n=t[a]);return n}));function Cc(t,e){t.beginPath(),_l(e)?Ol(t,e,0,0):t.rect(0,0,e.width||0,e.height||0),t.clip()}function Fc(t){const e=lc(t.strokeWidth,1);return null!=t.strokeOffset?t.strokeOffset:t.stroke&&e>.5&&e<1.5?.5-Math.abs(e-1):0}function zc(t,e){const n=Fc(e);t("d",Ol(null,e,n,n))}function Tc(t,e,n,r){const i=Fc(e);t.beginPath(),Ol(t,e,(n||0)+i,(r||0)+i)}const $c=Oc(Tc),Nc=Oc(Tc,!1),Rc=Oc(Tc,!0);var Pc={type:"group",tag:"g",nested:!1,attr:function(t,e){t("transform",Ec(e))},bound:function(t,e){if(!e.clip&&e.items){const n=e.items,r=n.length;for(let e=0;e<r;++e)t.union(n[e].bounds)}return(e.clip||e.width||e.height)&&!e.noBound&&t.add(0,0).add(e.width||0,e.height||0),Fl(t,e),t.translate(e.x||0,e.y||0)},draw:function(t,e,n){bc(e,e=>{const r=e.x||0,i=e.y||0,o=e.strokeForeground,a=null==e.opacity?1:e.opacity;(e.stroke||e.fill)&&a&&(Tc(t,e,r,i),uc(t,e),e.fill&&dc(t,e,a)&&t.fill(),e.stroke&&!o&&pc(t,e,a)&&t.stroke()),t.save(),t.translate(r,i),e.clip&&Cc(t,e),n&&n.translate(-r,-i),bc(e,e=>{this.draw(t,e,n)}),n&&n.translate(r,i),t.restore(),o&&e.stroke&&a&&(Tc(t,e,r,i),uc(t,e),pc(t,e,a)&&t.stroke())})},pick:function(t,e,n,r,i,o){if(e.bounds&&!e.bounds.contains(i,o)||!e.items)return null;const a=n*t.pixelRatio,s=r*t.pixelRatio;return yc(e,u=>{let l,c,f;const d=u.bounds;if(d&&!d.contains(i,o))return;c=u.x||0,f=u.y||0;const h=c+(u.width||0),p=f+(u.height||0),g=u.clip;if(g&&(i<c||i>h||o<f||o>p))return;if(t.save(),t.translate(c,f),c=i-c,f=o-f,g&&_l(u)&&!Rc(t,u,a,s))return t.restore(),null;const m=u.strokeForeground,b=!1!==e.interactive;return b&&m&&u.stroke&&Nc(t,u,a,s)?(t.restore(),u):(l=yc(u,t=>function(t,e,n){return(!1!==t.interactive||"group"===t.marktype)&&t.bounds&&t.bounds.contains(e,n)}(t,c,f)?this.pick(t,n,r,c,f):null),!l&&b&&(u.fill||!m&&u.stroke)&&$c(t,u,a,s)&&(l=u),t.restore(),l||null)})},isect:oc,content:function(t,e,n){t("clip-path",e.clip?kl(n,e,e):null)},background:function(t,e){t("class","background"),t("aria-hidden",!0),zc(t,e)},foreground:function(t,e){t("class","foreground"),t("aria-hidden",!0),e.strokeForeground?zc(t,e):t("d","")}},Bc={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function Lc(t,e){var n=t.image;return(!n||t.url&&t.url!==n.url)&&(n={complete:!1,width:0,height:0},e.loadImage(t.url).then(e=>{t.image=e,t.image.url=t.url})),n}function Ic(t,e){return null!=t.width?t.width:e&&e.width?!1!==t.aspect&&t.height?t.height*e.width/e.height:e.width:0}function Uc(t,e){return null!=t.height?t.height:e&&e.height?!1!==t.aspect&&t.width?t.width*e.height/e.width:e.height:0}function qc(t,e){return"center"===t?e/2:"right"===t?e:0}function Wc(t,e){return"middle"===t?e/2:"bottom"===t?e:0}var Yc={type:"image",tag:"image",nested:!1,attr:function(t,e,n){const r=Lc(e,n),i=Ic(e,r),o=Uc(e,r),a=(e.x||0)-qc(e.align,i),s=(e.y||0)-Wc(e.baseline,o);t("href",!r.src&&r.toDataURL?r.toDataURL():r.src||"",Bc["xmlns:xlink"],"xlink:href"),t("transform",jc(a,s)),t("width",i),t("height",o),t("preserveAspectRatio",!1===e.aspect?"none":"xMidYMid")},bound:function(t,e){const n=e.image,r=Ic(e,n),i=Uc(e,n),o=(e.x||0)-qc(e.align,r),a=(e.y||0)-Wc(e.baseline,i);return t.set(o,a,o+r,a+i)},draw:function(t,e,n){bc(e,e=>{if(n&&!n.intersects(e.bounds))return;const r=Lc(e,this);let i,o,a,s,u=Ic(e,r),l=Uc(e,r),c=(e.x||0)-qc(e.align,u),f=(e.y||0)-Wc(e.baseline,l);!1!==e.aspect&&(o=r.width/r.height,a=e.width/e.height,o==o&&a==a&&o!==a&&(a<o?(s=u/o,f+=(l-s)/2,l=s):(s=l*o,c+=(u-s)/2,u=s))),(r.complete||r.toDataURL)&&(uc(t,e),t.globalAlpha=null!=(i=e.opacity)?i:1,t.imageSmoothingEnabled=!1!==e.smooth,t.drawImage(r,c,f,u,l))})},pick:_c(),isect:Z.hb,get:Lc,xOffset:qc,yOffset:Wc},Hc=Mc("line",(function(t,e){const n=e[0],r=n.interpolate||"linear";return bl.curve(Nu(r,n.orient,n.tension)).context(t)(e)}),(function(t,e){for(var n,r,i=Math.pow(t[0].strokeWidth||1,2),o=t.length;--o>=0;)if(!1!==t[o].defined&&(n=t[o].x-e[0])*n+(r=t[o].y-e[1])*r<i)return t[o];return null}));function Gc(t,e){var n=e.path;if(null==n)return!0;var r=e.x||0,i=e.y||0,o=e.scaleX||1,a=e.scaleY||1,s=(e.angle||0)*Lu,u=e.pathCache;u&&u.path===n||((e.pathCache=u=Bu(n)).path=n),s&&t.rotate&&t.translate?(t.translate(r,i),t.rotate(s),Ju(t,u,0,0,o,a),t.rotate(-s),t.translate(-r,-i)):Ju(t,u,r,i,o,a)}var Vc={type:"path",tag:"path",nested:!1,attr:function(t,e){var n=e.scaleX||1,r=e.scaleY||1;1===n&&1===r||t("vector-effect","non-scaling-stroke"),t("transform",function(t){return jc(t.x||0,t.y||0)+(t.angle?" "+kc(t.angle):"")+(t.scaleX||t.scaleY?" "+(e=t.scaleX||1,n=t.scaleY||1,"scale("+e+","+n+")"):"");var e,n}(e)),t("d",e.path)},bound:function(t,e){return Gc(Jl(t,e.angle),e)?t.set(0,0,0,0):Fl(t,e,!0)},draw:vc(Gc),pick:wc(Gc),isect:rc(Gc)};function Xc(t,e){t.beginPath(),Ol(t,e)}var Jc={type:"rect",tag:"path",nested:!1,attr:function(t,e){t("d",Ol(null,e))},bound:function(t,e){var n,r;return Fl(t.set(n=e.x||0,r=e.y||0,n+e.width||0,r+e.height||0),e)},draw:vc(Xc),pick:wc(Xc),isect:oc};function Kc(t,e,n){var r,i,o,a;return!(!e.stroke||!pc(t,e,n))&&(r=e.x||0,i=e.y||0,o=null!=e.x2?e.x2:r,a=null!=e.y2?e.y2:i,t.beginPath(),t.moveTo(r,i),t.lineTo(o,a),!0)}var Zc={type:"rule",tag:"line",nested:!1,attr:function(t,e){t("transform",Ec(e)),t("x2",null!=e.x2?e.x2-(e.x||0):0),t("y2",null!=e.y2?e.y2-(e.y||0):0)},bound:function(t,e){var n,r;return Fl(t.set(n=e.x||0,r=e.y||0,null!=e.x2?e.x2:n,null!=e.y2?e.y2:r),e)},draw:function(t,e,n){bc(e,e=>{if(!n||n.intersects(e.bounds)){var r=null==e.opacity?1:e.opacity;r&&Kc(t,e,r)&&(uc(t,e),t.stroke())}})},pick:_c((function(t,e,n,r){return!!t.isPointInStroke&&(Kc(t,e,1)&&t.isPointInStroke(n,r))})),isect:ac},Qc=Ac("shape",(function(t,e){return(e.mark.shape||e.shape).context(t)(e)})),tf=Ac("symbol",(function(t,e){return vl.context(t)(e)}),ic);const ef=Object(Z.M)();var nf={height:lf,measureWidth:sf,estimateWidth:of,width:of,canvas:rf};function rf(t){nf.width=t&&ec?sf:of}function of(t,e){return af(hf(t,e),lf(t))}function af(t,e){return~~(.8*t.length*e)}function sf(t,e){return lf(t)<=0||!(e=hf(t,e))?0:uf(e,gf(t))}function uf(t,e){const n="(".concat(e,") ").concat(t);let r=ef.get(n);return void 0===r&&(ec.font=e,r=ec.measureText(t).width,ef.set(n,r)),r}function lf(t){return null!=t.fontSize?+t.fontSize||0:11}function cf(t){return null!=t.lineHeight?t.lineHeight:lf(t)+2}function ff(t){return e=t.lineBreak&&t.text&&!Object(Z.B)(t.text)?t.text.split(t.lineBreak):t.text,Object(Z.B)(e)?e.length>1?e:e[0]:e;var e}function df(t){const e=ff(t);return(Object(Z.B)(e)?e.length-1:0)*cf(t)}function hf(t,e){const n=null==e?"":(e+"").trim();return t.limit>0&&n.length?function(t,e){var n=+t.limit,r=function(t){if(nf.width===sf){const e=gf(t);return t=>uf(t,e)}{const e=lf(t);return t=>af(t,e)}}(t);if(r(e)<n)return e;var i,o=t.ellipsis||"…",a="rtl"===t.dir,s=0,u=e.length;if(n-=r(o),a){for(;s<u;)i=s+u>>>1,r(e.slice(i))>n?s=i+1:u=i;return o+e.slice(s)}for(;s<u;)i=1+(s+u>>>1),r(e.slice(0,i))<n?s=i:u=i-1;return e.slice(0,s)+o}(t,n):n}function pf(t,e){var n=t.font;return(e&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function gf(t,e){return(t.fontStyle?t.fontStyle+" ":"")+(t.fontVariant?t.fontVariant+" ":"")+(t.fontWeight?t.fontWeight+" ":"")+lf(t)+"px "+pf(t,e)}function mf(t){var e=t.baseline,n=lf(t);return Math.round("top"===e?.79*n:"middle"===e?.3*n:"bottom"===e?-.21*n:"line-top"===e?.29*n+.5*cf(t):"line-bottom"===e?.29*n-.5*cf(t):0)}rf(!0);const bf={left:"start",center:"middle",right:"end"},yf=new El;function vf(t){var e,n=t.x||0,r=t.y||0,i=t.radius||0;return i&&(e=(t.theta||0)-Iu,n+=i*Math.cos(e),r+=i*Math.sin(e)),yf.x1=n,yf.y1=r,yf}function xf(t,e,n){var r,i=nf.height(e),o=e.align,a=vf(e),s=a.x1,u=a.y1,l=e.dx||0,c=(e.dy||0)+mf(e)-Math.round(.8*i),f=ff(e);if(Object(Z.B)(f)?(i+=cf(e)*(f.length-1),r=f.reduce((t,n)=>Math.max(t,nf.width(e,n)),0)):r=nf.width(e,f),"center"===o?l-=r/2:"right"===o&&(l-=r),t.set(l+=s,c+=u,l+r,c+i),e.angle&&!n)t.rotate(e.angle*Lu,s,u);else if(2===n)return t.rotatedPoints(e.angle*Lu,s,u);return t}var _f={arc:Dc,area:Sc,group:Pc,image:Yc,line:Hc,path:Vc,rect:Jc,rule:Zc,shape:Qc,symbol:tf,text:{type:"text",tag:"text",nested:!1,attr:function(t,e){var n,r=e.dx||0,i=(e.dy||0)+mf(e),o=vf(e),a=o.x1,s=o.y1,u=e.angle||0;t("text-anchor",bf[e.align]||"start"),u?(n=jc(a,s)+" "+kc(u),(r||i)&&(n+=" "+jc(r,i))):n=jc(a+r,s+i),t("transform",n)},bound:xf,draw:function(t,e,n){bc(e,e=>{var r,i,o,a,s,u,l,c=null==e.opacity?1:e.opacity;if(!(n&&!n.intersects(e.bounds)||0===c||e.fontSize<=0||null==e.text||0===e.text.length)){if(t.font=gf(e),t.textAlign=e.align||"left",i=(r=vf(e)).x1,o=r.y1,e.angle&&(t.save(),t.translate(i,o),t.rotate(e.angle*Lu),i=o=0),i+=e.dx||0,o+=(e.dy||0)+mf(e),u=ff(e),uc(t,e),Object(Z.B)(u))for(s=cf(e),a=0;a<u.length;++a)l=hf(e,u[a]),e.fill&&dc(t,e,c)&&t.fillText(l,i,o),e.stroke&&pc(t,e,c)&&t.strokeText(l,i,o),o+=s;else l=hf(e,u),e.fill&&dc(t,e,c)&&t.fillText(l,i,o),e.stroke&&pc(t,e,c)&&t.strokeText(l,i,o);e.angle&&t.restore()}})},pick:_c((function(t,e,n,r,i,o){if(e.fontSize<=0)return!1;if(!e.angle)return!0;var a=vf(e),s=a.x1,u=a.y1,l=xf(yf,e,1),c=-e.angle*Lu,f=Math.cos(c),d=Math.sin(c),h=f*i-d*o+(s-f*s+d*u),p=d*i+f*o+(u-d*s-f*u);return l.contains(h,p)})),isect:function(t,e){const n=xf(yf,t,2);return sc(e,n[0],n[1],n[2],n[3])||sc(e,n[0],n[1],n[4],n[5])||sc(e,n[4],n[5],n[6],n[7])||sc(e,n[2],n[3],n[6],n[7])}},trail:Mc("trail",(function(t,e){return xl.context(t)(e)}),(function(t,e){for(var n,r,i=t.length;--i>=0;)if(!1!==t[i].defined&&(n=t[i].x-e[0])*n+(r=t[i].y-e[1])*r<(n=t[i].size||1)*n)return t[i];return null}))};function Of(t,e,n){var r=_f[t.mark.marktype],i=e||r.bound;return r.nested&&(t=t.mark),i(t.bounds||(t.bounds=new El),t,n)}var wf={mark:null};function jf(t,e,n){var r,i,o,a,s=_f[t.marktype],u=s.bound,l=t.items,c=l&&l.length;if(s.nested)return c?o=l[0]:(wf.mark=t,o=wf),a=Of(o,u,n),e=e&&e.union(a)||a;if(e=e||t.bounds&&t.bounds.clear()||new El,c)for(r=0,i=l.length;r<i;++r)e.union(Of(l[r],u,n));return t.bounds=e}const kf=["marktype","name","role","interactive","clip","items","zindex","x","y","width","height","align","baseline","fill","fillOpacity","opacity","blend","stroke","strokeOpacity","strokeWidth","strokeCap","strokeDash","strokeDashOffset","strokeForeground","strokeOffset","startAngle","endAngle","innerRadius","outerRadius","cornerRadius","padAngle","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight","interpolate","tension","orient","defined","url","aspect","smooth","path","scaleX","scaleY","x2","y2","size","shape","text","angle","theta","radius","dir","dx","dy","ellipsis","limit","lineBreak","lineHeight","font","fontSize","fontWeight","fontStyle","fontVariant","description","aria","ariaRole","ariaRoleDescription"];function Ef(t,e){return JSON.stringify(t,kf,e)}function Af(t){return function t(e){var n,r,i,o=e.marktype,a=e.items;if(a)for(r=0,i=a.length;r<i;++r)n=o?"mark":"group",a[r][n]=e,a[r].zindex&&(a[r][n].zdirty=!0),"group"===(o||n)&&t(a[r]);o&&jf(e);return e}("string"==typeof t?JSON.parse(t):t)}function Df(t){arguments.length?this.root=Af(t):(this.root=Mf({marktype:"group",name:"root",role:"frame"}),this.root.items=[new Dl(this.root)])}function Mf(t,e){const n={bounds:new El,clip:!!t.clip,group:e,interactive:!1!==t.interactive,items:[],marktype:t.marktype,name:t.name||void 0,role:t.role||void 0,zindex:t.zindex||0};return null!=t.aria&&(n.aria=t.aria),t.description&&(n.description=t.description),n}function Sf(t,e,n){return!t&&"undefined"!=typeof document&&document.createElement&&(t=document),t?n?t.createElementNS(n,e):t.createElement(e):null}function Cf(t,e){e=e.toLowerCase();for(var n=t.childNodes,r=0,i=n.length;r<i;++r)if(n[r].tagName.toLowerCase()===e)return n[r]}function Ff(t,e,n,r){var i,o=t.childNodes[e];return o&&o.tagName.toLowerCase()===n.toLowerCase()||(i=o||null,o=Sf(t.ownerDocument,n,r),t.insertBefore(o,i)),o}function zf(t,e){for(var n=t.childNodes,r=n.length;r>e;)t.removeChild(n[--r]);return t}function Tf(t){return"mark-"+t.marktype+(t.role?" role-"+t.role:"")+(t.name?" "+t.name:"")}function $f(t,e){const n=e.getBoundingClientRect();return[t.clientX-n.left-(e.clientLeft||0),t.clientY-n.top-(e.clientTop||0)]}function Nf(t,e){this._active=null,this._handlers={},this._loader=t||Object(Q.e)(),this._tooltip=e||Rf}function Rf(t,e,n,r){t.element().setAttribute("title",r||"")}function Pf(t){this._el=null,this._bgcolor=null,this._loader=new Ml(t)}Df.prototype={toJSON(t){return Ef(this.root,t||0)},mark(t,e,n){const r=Mf(t,e=e||this.root.items[0]);return e.items[n]=r,r.zindex&&(r.group.zdirty=!0),r}},Nf.prototype={initialize(t,e,n){return this._el=t,this._obj=n||null,this.origin(e)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},origin(t){return arguments.length?(this._origin=t||[0,0],this):this._origin.slice()},scene(t){return arguments.length?(this._scene=t,this):this._scene},on(){},off(){},_handlerIndex(t,e,n){for(let r=t?t.length:0;--r>=0;)if(t[r].type===e&&(!n||t[r].handler===n))return r;return-1},handlers(t){const e=this._handlers,n=[];if(t)n.push(...e[this.eventName(t)]);else for(const t in e)n.push(...e[t]);return n},eventName(t){const e=t.indexOf(".");return e<0?t:t.slice(0,e)},handleHref(t,e,n){this._loader.sanitize(n,{context:"href"}).then(e=>{const n=new MouseEvent(t.type,t),r=Sf(null,"a");for(const t in e)r.setAttribute(t,e[t]);r.dispatchEvent(n)}).catch(()=>{})},handleTooltip(t,e,n){if(e&&null!=e.tooltip){e=function(t,e,n,r){var i,o,a=t&&t.mark;if(a&&(i=_f[a.marktype]).tip){for((o=$f(e,n))[0]-=r[0],o[1]-=r[1];t=t.mark.group;)o[0]-=t.x||0,o[1]-=t.y||0;t=i.tip(a.items,o)}return t}(e,t,this.canvas(),this._origin);const r=n&&e&&e.tooltip||null;this._tooltip.call(this._obj,this,t,e,r)}},getItemBoundingClientRect(t){const e=this.canvas();if(!e)return;const n=e.getBoundingClientRect(),r=this._origin,i=t.bounds,o=i.width(),a=i.height();let s=i.x1+r[0]+n.left,u=i.y1+r[1]+n.top;for(;t.mark&&(t=t.mark.group);)s+=t.x||0,u+=t.y||0;return{x:s,y:u,width:o,height:a,left:s,top:u,right:s+o,bottom:u+a}}},Pf.prototype={initialize(t,e,n,r,i){return this._el=t,this.resize(e,n,r,i)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},background(t){return 0===arguments.length?this._bgcolor:(this._bgcolor=t,this)},resize(t,e,n,r){return this._width=t,this._height=e,this._origin=n||[0,0],this._scale=r||1,this},dirty(){},render(t){const e=this;return e._call=function(){e._render(t)},e._call(),e._call=null,e},_render(){},renderAsync(t){const e=this.render(t);return this._ready?this._ready.then(()=>e):Promise.resolve(e)},_load(t,e){var n=this,r=n._loader[t](e);if(!n._ready){const t=n._call;n._ready=n._loader.ready().then(e=>{e&&t(),n._ready=null})}return r},sanitizeURL(t){return this._load("sanitizeURL",t)},loadImage(t){return this._load("loadImage",t)}};const Bf="dragleave",Lf="mousedown",If="mousemove",Uf="mouseout",qf="click",Wf=["keydown","keypress","keyup","dragenter",Bf,"dragover",Lf,"mouseup",If,Uf,"mouseover",qf,"dblclick","wheel","mousewheel","touchstart","touchmove","touchend"],Yf=If,Hf=Uf,Gf=qf;function Vf(t,e){Nf.call(this,t,e),this._down=null,this._touch=null,this._first=!0,this._events={}}function Xf(t,e){(t=>"touchstart"===t||"touchmove"===t||"touchend"===t?["touchstart","touchmove","touchend"]:[t])(e).forEach(e=>function(t,e){const n=t.canvas();n&&!t._events[e]&&(t._events[e]=1,n.addEventListener(e,t[e]?n=>t[e](n):n=>t.fire(e,n)))}(t,e))}function Jf(t,e,n){return function(r){const i=this._active,o=this.pickEvent(r);o===i||(i&&i.exit||this.fire(n,r),this._active=o,this.fire(e,r)),this.fire(t,r)}}function Kf(t){return function(e){this.fire(t,e),this._active=null}}Object(Z.z)(Vf,Nf,{initialize(t,e,n){return this._canvas=t&&Cf(t,"canvas"),[qf,Lf,If,Uf,Bf].forEach(t=>Xf(this,t)),Nf.prototype.initialize.call(this,t,e,n)},canvas(){return this._canvas},context(){return this._canvas.getContext("2d")},events:Wf,DOMMouseScroll(t){this.fire("mousewheel",t)},mousemove:Jf(If,"mouseover",Uf),dragover:Jf("dragover","dragenter",Bf),mouseout:Kf(Uf),dragleave:Kf(Bf),mousedown(t){this._down=this._active,this.fire(Lf,t)},click(t){this._down===this._active&&(this.fire(qf,t),this._down=null)},touchstart(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire("touchstart",t,!0)},touchmove(t){this.fire("touchmove",t,!0)},touchend(t){this.fire("touchend",t,!0),this._touch=null},fire(t,e,n){const r=n?this._touch:this._active,i=this._handlers[t];if(e.vegaType=t,t===Gf&&r&&r.href?this.handleHref(e,r,r.href):t!==Yf&&t!==Hf||this.handleTooltip(e,r,t!==Hf),i)for(let t=0,n=i.length;t<n;++t)i[t].handler.call(this._obj,e,r)},on(t,e){const n=this.eventName(t),r=this._handlers;return this._handlerIndex(r[n],t,e)<0&&(Xf(this,t),(r[n]||(r[n]=[])).push({type:t,handler:e})),this},off(t,e){const n=this.eventName(t),r=this._handlers[n],i=this._handlerIndex(r,t,e);return i>=0&&r.splice(i,1),this},pickEvent(t){const e=$f(t,this._canvas),n=this._origin;return this.pick(this._scene,e[0],e[1],e[0]-n[0],e[1]-n[1])},pick(t,e,n,r,i){const o=this.context();return _f[t.marktype].pick.call(this,o,t,e,n,r,i)}});var Zf="undefined"!=typeof window&&window.devicePixelRatio||1;function Qf(t){Pf.call(this,t),this._options={},this._redraw=!1,this._dirty=new El,this._tempb=new El}const td=Pf.prototype;function ed(t,e){Nf.call(this,t,e);const n=this;n._hrefHandler=nd(n,(t,e)=>{e&&e.href&&n.handleHref(t,e,e.href)}),n._tooltipHandler=nd(n,(t,e)=>{n.handleTooltip(t,e,t.type!==Hf)})}Object(Z.z)(Qf,Pf,{initialize(t,e,n,r,i,o){return this._options=o||{},this._canvas=this._options.externalContext?null:Ci(1,1,this._options.type),t&&this._canvas&&(zf(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),td.initialize.call(this,t,e,n,r,i)},resize(t,e,n,r){if(td.resize.call(this,t,e,n,r),this._canvas)!function(t,e,n,r,i,o){const a="undefined"!=typeof HTMLElement&&t instanceof HTMLElement&&null!=t.parentNode,s=t.getContext("2d"),u=a?Zf:i;t.width=e*u,t.height=n*u;for(const t in o)s[t]=o[t];a&&1!==u&&(t.style.width=e+"px",t.style.height=n+"px"),s.pixelRatio=u,s.setTransform(u,0,0,u,u*r[0],u*r[1])}(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const t=this._options.externalContext;t||Object(Z.o)("CanvasRenderer is missing a valid canvas or context"),t.scale(this._scale,this._scale),t.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this},canvas(){return this._canvas},context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)},dirty(t){const e=this._tempb.clear().union(t.bounds);let n=t.mark.group;for(;n;)e.translate(n.x||0,n.y||0),n=n.mark.group;this._dirty.union(e)},_render(t){const e=this.context(),n=this._origin,r=this._width,i=this._height,o=this._dirty,a=(s=n,u=r,l=i,(new El).set(0,0,u,l).translate(-s[0],-s[1]));var s,u,l;e.save();const c=this._redraw||o.empty()?(this._redraw=!1,a.expand(1)):function(t,e,n){return e.expand(1).round(),t.pixelRatio%1&&e.scale(t.pixelRatio).round().scale(1/t.pixelRatio),e.translate(-n[0]%1,-n[1]%1),t.beginPath(),t.rect(e.x1,e.y1,e.width(),e.height()),t.clip(),e}(e,a.intersect(o),n);return this.clear(-n[0],-n[1],r,i),this.draw(e,t,c),e.restore(),o.clear(),this},draw(t,e,n){const r=_f[e.marktype];e.clip&&function(t,e){var n=e.clip;t.save(),Object(Z.E)(n)?(t.beginPath(),n(t),t.clip()):Cc(t,e.group)}(t,e),r.draw.call(this,t,e,n),e.clip&&t.restore()},clear(t,e,n,r){const i=this._options,o=this.context();"pdf"===i.type||i.externalContext||o.clearRect(t,e,n,r),null!=this._bgcolor&&(o.fillStyle=this._bgcolor,o.fillRect(t,e,n,r))}});const nd=(t,e)=>n=>{let r=n.target.__data__;r=Array.isArray(r)?r[0]:r,n.vegaType=n.type,e.call(t._obj,n,r)};Object(Z.z)(ed,Nf,{initialize(t,e,n){let r=this._svg;return r&&(r.removeEventListener(Gf,this._hrefHandler),r.removeEventListener(Yf,this._tooltipHandler),r.removeEventListener(Hf,this._tooltipHandler)),this._svg=r=t&&Cf(t,"svg"),r&&(r.addEventListener(Gf,this._hrefHandler),r.addEventListener(Yf,this._tooltipHandler),r.addEventListener(Hf,this._tooltipHandler)),Nf.prototype.initialize.call(this,t,e,n)},canvas(){return this._svg},on(t,e){const n=this.eventName(t),r=this._handlers;if(this._handlerIndex(r[n],t,e)<0){const i={type:t,handler:e,listener:nd(this,e)};(r[n]||(r[n]=[])).push(i),this._svg&&this._svg.addEventListener(n,i.listener)}return this},off(t,e){const n=this.eventName(t),r=this._handlers[n],i=this._handlerIndex(r,t,e);return i>=0&&(this._svg&&this._svg.removeEventListener(n,r[i].listener),r.splice(i,1)),this}});const rd=(t,e,n)=>({role:t,"aria-roledescription":e,"aria-label":n||void 0}),id=Object(Z.eb)(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),od={axis:{desc:"axis",caption:function(t){const e=t.datum,n=t.orient,r=e.title?cd(t):null,i=t.context,o=i.scales[e.scale].value,a=i.dataflow.locale(),s=o.type;return"".concat("left"===n||"right"===n?"Y":"X","-axis")+(r?" titled '".concat(r,"'"):"")+" for a ".concat(Js(s)?"discrete":s," scale")+" with ".concat(Mu(a,o,t))}},legend:{desc:"legend",caption:function(t){const e=t.datum,n=e.title?cd(t):null,r="".concat(e.type||""," legend").trim(),i=e.scales,o=Object.keys(i),a=t.context,s=a.scales[i[o[0]]].value,u=a.dataflow.locale();return l=r,(l.length?l[0].toUpperCase()+l.slice(1):l)+(n?" titled '".concat(n,"'"):"")+" for ".concat(function(t){return(t=t.map(t=>t+("fill"===t||"stroke"===t?" color":""))).length<2?t[0]:t.slice(0,-1).join(", ")+" and "+Object(Z.V)(t)}(o))+" with ".concat(Mu(u,s,t));var l}},"title-text":{desc:"title",caption:t=>"Title text '".concat(ld(t),"'")},"title-subtitle":{desc:"subtitle",caption:t=>"Subtitle text '".concat(ld(t),"'")}},ad={ariaRole:"role",ariaRoleDescription:"aria-roledescription",description:"aria-label"};function sd(t,e){const n=!1===e.aria;if(t("aria-hidden",n||void 0),n||null==e.description)for(const e in ad)t(ad[e],void 0);else{const n=e.mark.marktype;t("aria-label",e.description),t("role",e.ariaRole||("group"===n?"graphics-object":"graphics-symbol")),t("aria-roledescription",e.ariaRoleDescription||"".concat(n," mark"))}}function ud(t){return!1===t.aria?{"aria-hidden":!0}:id[t.role]?null:od[t.role]?function(t,e){try{const n=t.items[0],r=e.caption||(()=>"");return rd(e.role||"graphics-symbol",e.desc,n.description||r(n))}catch(t){return null}}(t,od[t.role]):function(t){const e=t.marktype,n="group"===e||"text"===e||t.items.some(t=>null!=t.description&&!1!==t.aria);return rd(n?"graphics-object":"graphics-symbol","".concat(e," mark container"),t.description)}(t)}function ld(t){return Object(Z.i)(t.text).join(" ")}function cd(t){try{return Object(Z.i)(Object(Z.V)(t.items).items[0].text).join(" ")}catch(t){return null}}const fd=t=>(t+"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");function dd(){let t="",e="",n="";const r=[],i=()=>e=n="",o=(t,n)=>(null!=n&&(e+=" ".concat(t,'="').concat(fd(n).replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
"),'"')),a),a={open(s,...u){(o=>{e&&(t+="".concat(e,">").concat(n),i()),r.push(o)})(s),e="<"+s;for(const t of u)for(const e in t)o(e,t[e]);return a},close(){const o=r.pop();return t+=e?e+(n?">".concat(n,"</").concat(o,">"):"/>"):"</".concat(o,">"),i(),a},attr:o,text:t=>(n+=fd(t),a),toString:()=>t};return a}const hd=t=>function t(e,n){if(e.open(n.tagName),n.hasAttributes()){const t=n.attributes,r=t.length;for(let n=0;n<r;++n)e.attr(t[n].name,t[n].value)}if(n.hasChildNodes()){const r=n.childNodes,i=r.length;for(let n=0;n<i;n++){const i=r[n];3===i.nodeType?e.text(i.nodeValue):t(e,i)}}return e.close()}(dd(),t)+"";const pd={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",strokeCap:"stroke-linecap",strokeJoin:"stroke-linejoin",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeMiterLimit:"stroke-miterlimit",opacity:"opacity",blend:"mix-blend-mode"},gd={fill:"none","stroke-miterlimit":10},md=Bc.xmlns;function bd(t){Pf.call(this,t),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}const yd=Pf.prototype;function vd(t,e){for(;t&&t.dirty!==e;t=t.mark.group){if(t.dirty=e,!t.mark||t.mark.dirty===e)return;t.mark.dirty=e}}function xd(t,e,n){let r,i,o;if("radial"===e.gradient){let r=Ff(t,n++,"pattern",md);Dd(r,{id:"p_"+e.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),r=Ff(r,0,"rect",md),Dd(r,{width:1,height:1,fill:"url(".concat(Sd(),"#").concat(e.id,")")}),Dd(t=Ff(t,n++,"radialGradient",md),{id:e.id,fx:e.x1,fy:e.y1,fr:e.r1,cx:e.x2,cy:e.y2,r:e.r2})}else Dd(t=Ff(t,n++,"linearGradient",md),{id:e.id,x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2});for(r=0,i=e.stops.length;r<i;++r)o=Ff(t,r,"stop",md),o.setAttribute("offset",e.stops[r].offset),o.setAttribute("stop-color",e.stops[r].color);return zf(t,r),n}function _d(t,e,n){let r;return(t=Ff(t,n,"clipPath",md)).setAttribute("id",e.id),e.path?(r=Ff(t,0,"path",md),r.setAttribute("d",e.path)):(r=Ff(t,0,"rect",md),Dd(r,{x:0,y:0,width:e.width,height:e.height})),zf(t,1),n+1}function Od(t,e,n,r,i){let o,a=t._svg;if(!a&&(o=e.ownerDocument,a=Sf(o,r,md),t._svg=a,t.mark&&(a.__data__=t,a.__values__={fill:"default"},"g"===r))){const e=Sf(o,"path",md);a.appendChild(e),e.__data__=t;const n=Sf(o,"g",md);a.appendChild(n),n.__data__=t;const r=Sf(o,"path",md);a.appendChild(r),r.__data__=t,r.__values__={fill:"default"}}return(a.ownerSVGElement!==i||function(t,e){return t.parentNode&&t.parentNode.childNodes.length>1&&t.previousSibling!=e}(a,n))&&e.insertBefore(a,n?n.nextSibling:e.firstChild),a}Object(Z.z)(bd,Pf,{initialize(t,e,n,r,i){return this._defs={},this._clearDefs(),t&&(this._svg=Ff(t,0,"svg",md),Dd(this._svg,Bc),this._svg.setAttribute("class","marks"),zf(t,1),this._root=Ff(this._svg,0,"g",md),Dd(this._root,gd),zf(this._svg,1)),this.background(this._bgcolor),yd.initialize.call(this,t,e,n,r,i)},background(t){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",t),yd.background.apply(this,arguments)},resize(t,e,n,r){return yd.resize.call(this,t,e,n,r),this._svg&&(Dd(this._svg,{width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 ".concat(this._width," ").concat(this._height)}),this._root.setAttribute("transform","translate(".concat(this._origin,")"))),this._dirty=[],this},canvas(){return this._svg},svg(){const t=this._svg,e=this._bgcolor;if(!t)return null;let n;e&&(t.removeAttribute("style"),n=Ff(t,0,"rect",md),Dd(n,{width:this._width,height:this._height,fill:e}));const r=hd(t);return e&&(t.removeChild(n),this._svg.style.setProperty("background-color",e)),r},_render(t){return this._dirtyCheck()&&(this._dirtyAll&&this._clearDefs(),this.mark(this._root,t),zf(this._root,1)),this.defs(),this._dirty=[],++this._dirtyID,this},dirty(t){t.dirty!==this._dirtyID&&(t.dirty=this._dirtyID,this._dirty.push(t))},isDirty(t){return this._dirtyAll||!t._svg||t.dirty===this._dirtyID},_dirtyCheck(){this._dirtyAll=!0;const t=this._dirty;if(!t.length||!this._dirtyID)return!0;const e=++this._dirtyID;let n,r,i,o,a,s,u;for(a=0,s=t.length;a<s;++a)n=t[a],r=n.mark,r.marktype!==i&&(i=r.marktype,o=_f[i]),r.zdirty&&r.dirty!==e&&(this._dirtyAll=!1,vd(n,e),r.items.forEach(t=>{t.dirty=e})),r.zdirty||(n.exit?(o.nested&&r.items.length?(u=r.items[0],u._svg&&this._update(o,u._svg,u)):n._svg&&(u=n._svg.parentNode,u&&u.removeChild(n._svg)),n._svg=null):(n=o.nested?r.items[0]:n,n._update!==e&&(n._svg&&n._svg.ownerSVGElement?this._update(o,n._svg,n):(this._dirtyAll=!1,vd(n,e)),n._update=e)));return!this._dirtyAll},mark(t,e,n){if(!this.isDirty(e))return e._svg;const r=this._svg,i=_f[e.marktype],o=!1===e.interactive?"none":null,a="g"===i.tag;let s=null,u=0;const l=Od(e,t,n,"g",r);l.setAttribute("class",Tf(e));const c=ud(e);for(const t in c)Md(l,t,c[t]);a||Md(l,"pointer-events",o),Md(l,"clip-path",e.clip?kl(this,e,e.group):null);const f=t=>{const e=this.isDirty(t),n=Od(t,l,s,i.tag,r);e&&(this._update(i,n,t),a&&function(t,e,n){e=e.lastChild.previousSibling;let r,i=0;bc(n,n=>{r=t.mark(e,n,r),++i}),zf(e,1+i)}(this,n,t)),s=n,++u};return i.nested?e.items.length&&f(e.items[0]):bc(e,f),zf(l,u),l},_update(t,e,n){wd=e,jd=e.__values__,sd(Ed,n),t.attr(Ed,n,this);const r=kd[t.type];r&&r.call(this,t,e,n),wd&&this.style(wd,n)},style(t,e){if(null!=e)for(const n in pd){let r="font"===n?pf(e):e[n];if(r===jd[n])continue;const i=pd[n];null==r?t.removeAttribute(i):(Cu(r)&&(r=Fu(r,this._defs.gradient,Sd())),t.setAttribute(i,r+"")),jd[n]=r}},defs(){const t=this._svg,e=this._defs;let n=e.el,r=0;for(const i in e.gradient)n||(e.el=n=Ff(t,1,"defs",md)),r=xd(n,e.gradient[i],r);for(const i in e.clipping)n||(e.el=n=Ff(t,1,"defs",md)),r=_d(n,e.clipping[i],r);n&&(0===r?(t.removeChild(n),e.el=null):zf(n,r))},_clearDefs(){const t=this._defs;t.gradient={},t.clipping={}}});let wd=null,jd=null;const kd={group(t,e,n){const r=wd=e.childNodes[2];jd=r.__values__,t.foreground(Ed,n,this),jd=e.__values__,wd=e.childNodes[1],t.content(Ed,n,this);const i=wd=e.childNodes[0];t.background(Ed,n,this);const o=!1===n.mark.interactive?"none":null;if(o!==jd.events&&(Md(r,"pointer-events",o),Md(i,"pointer-events",o),jd.events=o),n.strokeForeground&&n.stroke){const t=n.fill;Md(r,"display",null),this.style(i,n),Md(i,"stroke",null),t&&(n.fill=null),jd=r.__values__,this.style(r,n),t&&(n.fill=t),wd=null}else Md(r,"display","none")},image(t,e,n){!1===n.smooth?(Ad(e,"image-rendering","optimizeSpeed"),Ad(e,"image-rendering","pixelated")):Ad(e,"image-rendering",null)},text(t,e,n){const r=ff(n);let i,o,a,s;Object(Z.B)(r)?(o=r.map(t=>hf(n,t)),i=o.join("\n"),i!==jd.text&&(zf(e,0),a=e.ownerDocument,s=cf(n),o.forEach((t,r)=>{const i=Sf(a,"tspan",md);i.__data__=n,i.textContent=t,r&&(i.setAttribute("x",0),i.setAttribute("dy",s)),e.appendChild(i)}),jd.text=i)):(o=hf(n,r),o!==jd.text&&(e.textContent=o,jd.text=o)),Md(e,"font-family",pf(n)),Md(e,"font-size",lf(n)+"px"),Md(e,"font-style",n.fontStyle),Md(e,"font-variant",n.fontVariant),Md(e,"font-weight",n.fontWeight)}};function Ed(t,e,n){e!==jd[t]&&(n?function(t,e,n,r){null!=n?t.setAttributeNS(r,e,n):t.removeAttributeNS(r,e)}(wd,t,e,n):Md(wd,t,e),jd[t]=e)}function Ad(t,e,n){n!==jd[e]&&(null==n?t.style.removeProperty(e):t.style.setProperty(e,n+""),jd[e]=n)}function Dd(t,e){for(const n in e)Md(t,n,e[n])}function Md(t,e,n){null!=n?t.setAttribute(e,n):t.removeAttribute(e)}function Sd(){let t;return"undefined"==typeof window?"":(t=window.location).hash?t.href.slice(0,-t.hash.length):t.href}function Cd(t){Pf.call(this,t),this._text=null,this._defs={gradient:{},clipping:{}}}Object(Z.z)(Cd,Pf,{svg(){return this._text},_render(t){const e=dd();e.open("svg",Object(Z.p)({},Bc,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 ".concat(this._width," ").concat(this._height)}));const n=this._bgcolor;return n&&"transparent"!==n&&"none"!==n&&e.open("rect",{width:this._width,height:this._height,fill:n}).close(),e.open("g",gd,{transform:"translate("+this._origin+")"}),this.mark(e,t),e.close(),this.defs(e),this._text=e.close()+"",this},mark(t,e){const n=_f[e.marktype],r=n.tag,i=[sd,n.attr];t.open("g",{class:Tf(e),"clip-path":e.clip?kl(this,e,e.group):null},ud(e),{"pointer-events":"g"!==r&&!1===e.interactive?"none":null});const o=o=>{const a=this.href(o);if(a&&t.open("a",a),t.open(r,this.attr(e,o,i,"g"!==r?r:null)),"text"===r){const e=ff(o);if(Object(Z.B)(e)){const n={x:0,dy:cf(o)};for(let r=0;r<e.length;++r)t.open("tspan",r?n:null).text(hf(o,e[r])).close()}else t.text(hf(o,e))}else if("g"===r){const r=o.strokeForeground,i=o.fill,a=o.stroke;r&&a&&(o.stroke=null),t.open("path",this.attr(e,o,n.background,"bgrect")).close(),t.open("g",this.attr(e,o,n.content)),bc(o,e=>this.mark(t,e)),t.close(),r&&a?(i&&(o.fill=null),o.stroke=a,t.open("path",this.attr(e,o,n.foreground,"bgrect")).close(),i&&(o.fill=i)):t.open("path",this.attr(e,o,n.foreground,"bgfore")).close()}t.close(),a&&t.close()};return n.nested?e.items&&e.items.length&&o(e.items[0]):bc(e,o),t.close()},href(t){const e=t.href;let n;if(e){if(n=this._hrefs&&this._hrefs[e])return n;this.sanitizeURL(e).then(t=>{t["xlink:href"]=t.href,t.href=null,(this._hrefs||(this._hrefs={}))[e]=t})}return null},attr(t,e,n,r){const i={},o=(t,e,n,r)=>{i[r||t]=e};return Array.isArray(n)?n.forEach(t=>t(o,e,this)):n(o,e,this),r&&function(t,e,n,r,i){if(null==e)return t;"bgrect"===r&&!1===n.interactive&&(t["pointer-events"]="none");if("bgfore"===r&&(!1===n.interactive&&(t["pointer-events"]="none"),t.display="none",null!==e.fill))return t;"image"===r&&!1===e.smooth&&(t.style="image-rendering: optimizeSpeed; image-rendering: pixelated;");"text"===r&&(t["font-family"]=pf(e),t["font-size"]=lf(e)+"px",t["font-style"]=e.fontStyle,t["font-variant"]=e.fontVariant,t["font-weight"]=e.fontWeight);for(const n in pd){let r=e[n];const o=pd[n];("transparent"!==r||"fill"!==o&&"stroke"!==o)&&null!=r&&(Cu(r)&&(r=Fu(r,i.gradient,"")),t[o]=r)}}(i,e,t,r,this._defs),i},defs(t){const e=this._defs.gradient,n=this._defs.clipping;if(0!==Object.keys(e).length+Object.keys(n).length){t.open("defs");for(const n in e){const r=e[n],i=r.stops;"radial"===r.gradient?(t.open("pattern",{id:"p_"+n,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),t.open("rect",{width:"1",height:"1",fill:"url(#"+n+")"}).close(),t.close(),t.open("radialGradient",{id:n,fx:r.x1,fy:r.y1,fr:r.r1,cx:r.x2,cy:r.y2,r:r.r2})):t.open("linearGradient",{id:n,x1:r.x1,x2:r.x2,y1:r.y1,y2:r.y2});for(let e=0;e<i.length;++e)t.open("stop",{offset:i[e].offset,"stop-color":i[e].color}).close();t.close()}for(const e in n){const r=n[e];t.open("clipPath",{id:e}),r.path?t.open("path",{d:r.path}).close():t.open("rect",{x:0,y:0,width:r.width,height:r.height}).close(),t.close()}t.close()}}});const Fd={Canvas:"canvas",PNG:"png",SVG:"svg",None:"none"},zd={};function Td(t,e){return t=String(t||"").toLowerCase(),arguments.length>1?(zd[t]=e,this):zd[t]}function $d(t,e,n){const r=[],i=(new El).union(e),o=t.marktype;return o?Nd(t,i,n,r):"group"===o?Rd(t,i,n,r):Object(Z.o)("Intersect scene must be mark node or group item.")}function Nd(t,e,n,r){if(function(t,e,n){return t.bounds&&e.intersects(t.bounds)&&("group"===t.marktype||!1!==t.interactive&&(!n||n(t)))}(t,e,n)){const i=t.items,o=t.marktype,a=i.length;let s=0;if("group"===o)for(;s<a;++s)Rd(i[s],e,n,r);else for(const t=_f[o].isect;s<a;++s){const n=i[s];Pd(n,e,t)&&r.push(n)}}return r}function Rd(t,e,n,r){n&&n(t.mark)&&Pd(t,e,_f.group.isect)&&r.push(t);const i=t.items,o=i&&i.length;if(o){const a=t.x||0,s=t.y||0;e.translate(-a,-s);for(let t=0;t<o;++t)Nd(i[t],e,n,r);e.translate(a,s)}return r}function Pd(t,e,n){const r=t.bounds;return e.encloses(r)||e.intersects(r)&&n(t,e)}zd.canvas=zd.png={renderer:Qf,headless:Qf,handler:Vf},zd.svg={renderer:bd,headless:Cd,handler:ed},zd.none={};const Bd=new El;function Ld(t){const e=t.clip;if(Object(Z.E)(e))e(Jl(Bd.clear()));else{if(!e)return;Bd.set(0,0,t.group.width,t.group.height)}t.bounds.intersect(Bd)}function Id(t,e,n){return t===e||("path"===n?Ud(t,e):t instanceof Date&&e instanceof Date?+t==+e:Object(Z.F)(t)&&Object(Z.F)(e)?Math.abs(t-e)<=1e-9:t&&e&&(Object(Z.G)(t)||Object(Z.G)(e))?function(t,e){var n,r,i=Object.keys(t),o=Object.keys(e);if(i.length!==o.length)return!1;for(i.sort(),o.sort(),r=i.length-1;r>=0;r--)if(i[r]!=o[r])return!1;for(r=i.length-1;r>=0;r--)if(n=i[r],!Id(t[n],e[n],n))return!1;return typeof t==typeof e}(t,e):t==e)}function Ud(t,e){return Id(Bu(t),Bu(e))}function qd(){jl(),Su=0}const Wd="top",Yd="left",Hd="right",Gd="end",Vd="row";function Xd(t){Pt.call(this,null,t)}function Jd(t,e,n){return e(t.bounds.clear(),t,n)}Object(Z.z)(Xd,Pt,{transform(t,e){const n=e.dataflow,r=t.mark,i=r.marktype,o=_f[i],a=o.bound;let s,u=r.bounds;if(o.nested)r.items.length&&n.dirty(r.items[0]),u=Jd(r,a),r.items.forEach(t=>{t.bounds.clear().union(u)});else if("group"===i||t.modified())switch(e.visit(e.MOD,t=>n.dirty(t)),u.clear(),r.items.forEach(t=>u.union(Jd(t,a))),r.role){case"axis":case"legend":case"title":e.reflow()}else s=e.changed(e.REM),e.visit(e.ADD,t=>{u.union(Jd(t,a))}),e.visit(e.MOD,t=>{s=s||u.alignsWith(t.bounds),n.dirty(t),u.union(Jd(t,a))}),s&&(u.clear(),r.items.forEach(t=>u.union(t.bounds)));return Ld(r),e.modifies("bounds")}});function Kd(t){Pt.call(this,0,t)}function Zd(t){Pt.call(this,null,t)}function Qd(t){Pt.call(this,null,t)}Kd.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},Object(Z.z)(Kd,Pt,{transform(t,e){const n=(i=e.dataflow)._signals[":vega_identifier:"]||(i._signals[":vega_identifier:"]=i.add(0)),r=t.as;var i;let o=n.value;return e.visit(e.ADD,t=>t[r]=t[r]||++o),n.set(this.value=o),e}}),Object(Z.z)(Zd,Pt,{transform(t,e){let n=this.value;n||(n=e.dataflow.scenegraph().mark(t.markdef,function(t){const e=t.groups,n=t.parent;return e&&1===e.size?e.get(Object.keys(e.object)[0]):e&&n?e.lookup(n):null}(t),t.index),n.group.context=t.context,t.context.group||(t.context.group=n.group),n.source=this.source,n.clip=t.clip,n.interactive=t.interactive,this.value=n);const r="group"===n.marktype?Dl:Al;return e.visit(e.ADD,t=>r.call(t,n)),(t.modified("clip")||t.modified("interactive"))&&(n.clip=t.clip,n.interactive=!!t.interactive,n.zdirty=!0,e.reflow()),n.items=e.source,e}});const th={parity:t=>t.filter((t,e)=>e%2?t.opacity=0:1),greedy:(t,e)=>{let n;return t.filter((t,r)=>r&&eh(n.bounds,t.bounds,e)?t.opacity=0:(n=t,1))}},eh=(t,e,n)=>n>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2),nh=(t,e)=>{for(var n,r=1,i=t.length,o=t[0].bounds;r<i;o=n,++r)if(eh(o,n=t[r].bounds,e))return!0},rh=t=>{const e=t.bounds;return e.width()>1&&e.height()>1},ih=t=>(t.forEach(t=>t.opacity=1),t),oh=(t,e)=>t.reflow(e.modified()).modifies("opacity");function ah(t){Pt.call(this,null,t)}Object(Z.z)(Qd,Pt,{transform(t,e){const n=th[t.method]||th.parity,r=t.separation||0;let i,o,a=e.materialize(e.SOURCE).source;if(!a||!a.length)return;if(!t.method)return t.modified("method")&&(ih(a),e=oh(e,t)),e;if(a=a.filter(rh),!a.length)return;if(t.sort&&(a=a.slice().sort(t.sort)),i=ih(a),e=oh(e,t),i.length>=3&&nh(i,r)){do{i=n(i,r)}while(i.length>=3&&nh(i,r));i.length<3&&!Object(Z.V)(a).opacity&&(i.length>1&&(Object(Z.V)(i).opacity=0),Object(Z.V)(a).opacity=1)}var s,u,l,c,f;t.boundScale&&t.boundTolerance>=0&&(s=t.boundScale,u=t.boundOrient,l=+t.boundTolerance,c=s.range(),f=new El,u===Wd||"bottom"===u?f.set(c[0],-1/0,c[1],1/0):f.set(-1/0,c[0],1/0,c[1]),f.expand(l||1),o=t=>f.encloses(t.bounds),a.forEach(t=>{o(t)||(t.opacity=0)}));const d=i[0].mark.bounds.clear();return a.forEach(t=>{t.opacity&&d.union(t.bounds)}),e}}),Object(Z.z)(ah,Pt,{transform(t,e){const n=e.dataflow;if(e.visit(e.ALL,t=>n.dirty(t)),e.fields&&e.fields.zindex){const t=e.source&&e.source[0];t&&(t.mark.zdirty=!0)}}});const sh=new El;function uh(t,e,n){return t[e]===n?0:(t[e]=n,1)}function lh(t){var e=t.items[0].orient;return e===Yd||e===Hd}function ch(t,e,n,r){var i,o,a=e.items[0],s=a.datum,u=null!=a.translate?a.translate:.5,l=a.orient,c=function(t){let e=+t.grid;return[t.ticks?e++:-1,t.labels?e++:-1,e+ +t.domain]}(s),f=a.range,d=a.offset,h=a.position,p=a.minExtent,g=a.maxExtent,m=s.title&&a.items[c[2]].items[0],b=a.titlePadding,y=a.bounds,v=m&&df(m),x=0,_=0;switch(sh.clear().union(y),y.clear(),(i=c[0])>-1&&y.union(a.items[i].bounds),(i=c[1])>-1&&y.union(a.items[i].bounds),l){case Wd:x=h||0,_=-d,o=Math.max(p,Math.min(g,-y.y1)),y.add(0,-o).add(f,0),m&&fh(t,m,o,b,v,0,-1,y);break;case Yd:x=-d,_=h||0,o=Math.max(p,Math.min(g,-y.x1)),y.add(-o,0).add(0,f),m&&fh(t,m,o,b,v,1,-1,y);break;case Hd:x=n+d,_=h||0,o=Math.max(p,Math.min(g,y.x2)),y.add(0,0).add(o,f),m&&fh(t,m,o,b,v,1,1,y);break;case"bottom":x=h||0,_=r+d,o=Math.max(p,Math.min(g,y.y2)),y.add(0,0).add(f,o),m&&fh(t,m,o,b,0,0,1,y);break;default:x=a.x,_=a.y}return Fl(y.translate(x,_),a),uh(a,"x",x+u)|uh(a,"y",_+u)&&(a.bounds=sh,t.dirty(a),a.bounds=y,t.dirty(a)),a.mark.bounds.clear().union(y)}function fh(t,e,n,r,i,o,a,s){const u=e.bounds;if(e.auto){const s=a*(n+i+r);let l=0,c=0;t.dirty(e),o?l=(e.x||0)-(e.x=s):c=(e.y||0)-(e.y=s),e.mark.bounds.clear().union(u.translate(-l,-c)),t.dirty(e)}s.union(u)}const dh=(t,e)=>Math.floor(Math.min(t,e)),hh=(t,e)=>Math.ceil(Math.max(t,e));function ph(t){return(new El).set(0,0,t.width||0,t.height||0)}function gh(t){const e=t.bounds.clone();return e.empty()?e.set(0,0,0,0):e.translate(-(t.x||0),-(t.y||0))}function mh(t,e,n){const r=Object(Z.G)(t)?t[e]:t;return null!=r?r:void 0!==n?n:0}function bh(t){return t<0?Math.ceil(-t):0}function yh(t,e,n){var r,i,o,a,s,u,l,c,f,d,h,p=!n.nodirty,g="flush"===n.bounds?ph:gh,m=sh.set(0,0,0,0),b=mh(n.align,"column"),y=mh(n.align,Vd),v=mh(n.padding,"column"),x=mh(n.padding,Vd),_=n.columns||e.length,O=_<=0?1:Math.ceil(e.length/_),w=e.length,j=Array(w),k=Array(_),E=0,A=Array(w),D=Array(O),M=0,S=Array(w),C=Array(w),F=Array(w);for(i=0;i<_;++i)k[i]=0;for(i=0;i<O;++i)D[i]=0;for(i=0;i<w;++i)u=e[i],s=F[i]=g(u),u.x=u.x||0,S[i]=0,u.y=u.y||0,C[i]=0,o=i%_,a=~~(i/_),E=Math.max(E,l=Math.ceil(s.x2)),M=Math.max(M,c=Math.ceil(s.y2)),k[o]=Math.max(k[o],l),D[a]=Math.max(D[a],c),j[i]=v+bh(s.x1),A[i]=x+bh(s.y1),p&&t.dirty(e[i]);for(i=0;i<w;++i)i%_==0&&(j[i]=0),i<_&&(A[i]=0);if("each"===b)for(o=1;o<_;++o){for(h=0,i=o;i<w;i+=_)h<j[i]&&(h=j[i]);for(i=o;i<w;i+=_)j[i]=h+k[o-1]}else if("all"===b){for(h=0,i=0;i<w;++i)i%_&&h<j[i]&&(h=j[i]);for(i=0;i<w;++i)i%_&&(j[i]=h+E)}else for(b=!1,o=1;o<_;++o)for(i=o;i<w;i+=_)j[i]+=k[o-1];if("each"===y)for(a=1;a<O;++a){for(h=0,r=(i=a*_)+_;i<r;++i)h<A[i]&&(h=A[i]);for(i=a*_;i<r;++i)A[i]=h+D[a-1]}else if("all"===y){for(h=0,i=_;i<w;++i)h<A[i]&&(h=A[i]);for(i=_;i<w;++i)A[i]=h+M}else for(y=!1,a=1;a<O;++a)for(r=(i=a*_)+_;i<r;++i)A[i]+=D[a-1];for(f=0,i=0;i<w;++i)f=j[i]+(i%_?f:0),S[i]+=f-e[i].x;for(o=0;o<_;++o)for(d=0,i=o;i<w;i+=_)d+=A[i],C[i]+=d-e[i].y;if(b&&mh(n.center,"column")&&O>1)for(i=0;i<w;++i)(f=(s="all"===b?E:k[i%_])-F[i].x2-e[i].x-S[i])>0&&(S[i]+=f/2);if(y&&mh(n.center,Vd)&&1!==_)for(i=0;i<w;++i)(d=(s="all"===y?M:D[~~(i/_)])-F[i].y2-e[i].y-C[i])>0&&(C[i]+=d/2);for(i=0;i<w;++i)m.union(F[i].translate(S[i],C[i]));switch(f=mh(n.anchor,"x"),d=mh(n.anchor,"y"),mh(n.anchor,"column")){case Gd:f-=m.width();break;case"middle":f-=m.width()/2}switch(mh(n.anchor,Vd)){case Gd:d-=m.height();break;case"middle":d-=m.height()/2}for(f=Math.round(f),d=Math.round(d),m.clear(),i=0;i<w;++i)e[i].mark.bounds.clear();for(i=0;i<w;++i)(u=e[i]).x+=S[i]+=f,u.y+=C[i]+=d,m.union(u.mark.bounds.union(u.bounds.translate(S[i],C[i]))),p&&t.dirty(u);return m}function vh(t,e){return"x1"===e?t.x||0:"y1"===e?t.y||0:"x2"===e?(t.x||0)+(t.width||0):"y2"===e?(t.y||0)+(t.height||0):void 0}function xh(t,e){return t.bounds[e]}function _h(t,e,n,r,i,o,a,s,u,l,c,f,d,h){var p,g,m,b,y,v,x,_,O,w=n.length,j=0,k=0;if(!w)return j;for(p=c;p<w;p+=f)n[p]&&(j=a(j,u(n[p],l)));if(!e.length)return j;for(e.length>i&&(t.warn("Grid headers exceed limit: "+i),e=e.slice(0,i)),j+=o,g=0,b=e.length;g<b;++g)t.dirty(e[g]),e[g].mark.bounds.clear();for(p=c,g=0,b=e.length;g<b;++g,p+=f){for(y=(v=e[g]).mark.bounds,m=p;m>=0&&null==(x=n[m]);m-=d);s?(_=null==h?x.x:Math.round(x.bounds.x1+h*x.bounds.width()),O=j):(_=j,O=null==h?x.y:Math.round(x.bounds.y1+h*x.bounds.height())),y.union(v.bounds.translate(_-(v.x||0),O-(v.y||0))),v.x=_,v.y=O,t.dirty(v),k=a(k,y[l])}return k}function Oh(t,e,n,r,i,o){if(e){t.dirty(e);var a=n,s=n;r?a=Math.round(i.x1+o*i.width()):s=Math.round(i.y1+o*i.height()),e.bounds.translate(a-(e.x||0),s-(e.y||0)),e.mark.bounds.clear().union(e.bounds),e.x=a,e.y=s,t.dirty(e)}}function wh(t,e,n,r,i,o,a){const s=function(t,e){const n=t[e]||{};return(e,r)=>null!=n[e]?n[e]:null!=t[e]?t[e]:r}(n,e),u=function(t,e){let n=-1/0;return t.forEach(t=>{null!=t.offset&&(n=Math.max(n,t.offset))}),n>-1/0?n:e}(t,s("offset",0)),l=s("anchor","start"),c=l===Gd?1:"middle"===l?.5:0,f={align:"each",bounds:s("bounds","flush"),columns:"vertical"===s("direction")?1:t.length,padding:s("margin",8),center:s("center"),nodirty:!0};switch(e){case Yd:f.anchor={x:Math.floor(r.x1)-u,column:Gd,y:c*(a||r.height()+2*r.y1),row:l};break;case Hd:f.anchor={x:Math.ceil(r.x2)+u,y:c*(a||r.height()+2*r.y1),row:l};break;case Wd:f.anchor={y:Math.floor(i.y1)-u,row:Gd,x:c*(o||i.width()+2*i.x1),column:l};break;case"bottom":f.anchor={y:Math.ceil(i.y2)+u,x:c*(o||i.width()+2*i.x1),column:l};break;case"top-left":f.anchor={x:u,y:u};break;case"top-right":f.anchor={x:o-u,y:u,column:Gd};break;case"bottom-left":f.anchor={x:u,y:a-u,row:Gd};break;case"bottom-right":f.anchor={x:o-u,y:a-u,column:Gd,row:Gd}}return f}function jh(t,e){var n,r,i=e.items[0],o=i.datum,a=i.orient,s=i.bounds,u=i.x,l=i.y;return i._bounds?i._bounds.clear().union(s):i._bounds=s.clone(),s.clear(),function(t,e,n){var r=e.padding,i=r-n.x,o=r-n.y;if(e.datum.title){var a=e.items[1].items[0],s=a.anchor,u=e.titlePadding||0,l=r-a.x,c=r-a.y;switch(a.orient){case Yd:i+=Math.ceil(a.bounds.width())+u;break;case Hd:case"bottom":break;default:o+=a.bounds.height()+u}switch((i||o)&&Eh(t,n,i,o),a.orient){case Yd:c+=kh(e,n,a,s,1,1);break;case Hd:l+=kh(e,n,a,Gd,0,0)+u,c+=kh(e,n,a,s,1,1);break;case"bottom":l+=kh(e,n,a,s,0,0),c+=kh(e,n,a,Gd,-1,0,1)+u;break;default:l+=kh(e,n,a,s,0,0)}(l||c)&&Eh(t,a,l,c),(l=Math.round(a.bounds.x1-r))<0&&(Eh(t,n,-l,0),Eh(t,a,-l,0))}else(i||o)&&Eh(t,n,i,o)}(t,i,i.items[0].items[0]),s=function(t,e){return t.items.forEach(t=>e.union(t.bounds)),e.x1=t.padding,e.y1=t.padding,e}(i,s),n=2*i.padding,r=2*i.padding,s.empty()||(n=Math.ceil(s.width()+n),r=Math.ceil(s.height()+r)),"symbol"===o.type&&function(t){const e=t.reduce((t,e)=>(t[e.column]=Math.max(e.bounds.x2-e.x,t[e.column]||0),t),{});t.forEach(t=>{t.width=e[t.column],t.height=t.bounds.y2-t.y})}(i.items[0].items[0].items[0].items),"none"!==a&&(i.x=u=0,i.y=l=0),i.width=n,i.height=r,Fl(s.set(u,l,u+n,l+r),i),i.mark.bounds.clear().union(s),i}function kh(t,e,n,r,i,o,a){const s="symbol"!==t.datum.type,u=n.datum.vgrad,l=(!s||!o&&u||a?e:e.items[0]).bounds[i?"y2":"x2"]-t.padding,c=u&&o?l:0,f=u&&o?0:l,d=i<=0?0:df(n);return Math.round("start"===r?c:r===Gd?f-d:.5*(l-d))}function Eh(t,e,n,r){e.x+=n,e.y+=r,e.bounds.translate(n,r),e.mark.bounds.translate(n,r),t.dirty(e)}function Ah(t){Pt.call(this,null,t)}function Dh(t,e){let n=0;if(void 0===e)for(let e of t)(e=+e)&&(n+=e);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n}function Mh(t){Pt.call(this,null,t)}function Sh(t){Pt.call(this,null,t)}function Ch(){return ut({})}function Fh(t){Pt.call(this,null,t)}function zh(t){Pt.call(this,[],t)}Object(Z.z)(Ah,Pt,{transform(t,e){const n=e.dataflow;return t.mark.items.forEach(e=>{t.layout&&function(t,e,n){var r,i,o,a,s,u,l,c=function(t){var e,n,r=t.items,i=r.length,o=0;const a={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;o<i;++o)if(n=(e=r[o]).items,"group"===e.marktype)switch(e.role){case"axis":case"legend":case"title":break;case"row-header":a.rowheaders.push(...n);break;case"row-footer":a.rowfooters.push(...n);break;case"column-header":a.colheaders.push(...n);break;case"column-footer":a.colfooters.push(...n);break;case"row-title":a.rowtitle=n[0];break;case"column-title":a.coltitle=n[0];break;default:a.marks.push(...n)}return a}(e),f=c.marks,d="flush"===n.bounds?vh:xh,h=n.offset,p=n.columns||f.length,g=p<=0?1:Math.ceil(f.length/p),m=g*p;const b=yh(t,f,n);b.empty()&&b.set(0,0,0,0),c.rowheaders&&(u=mh(n.headerBand,Vd,null),r=_h(t,c.rowheaders,f,p,g,-mh(h,"rowHeader"),dh,0,d,"x1",0,p,1,u)),c.colheaders&&(u=mh(n.headerBand,"column",null),i=_h(t,c.colheaders,f,p,p,-mh(h,"columnHeader"),dh,1,d,"y1",0,1,p,u)),c.rowfooters&&(u=mh(n.footerBand,Vd,null),o=_h(t,c.rowfooters,f,p,g,mh(h,"rowFooter"),hh,0,d,"x2",p-1,p,1,u)),c.colfooters&&(u=mh(n.footerBand,"column",null),a=_h(t,c.colfooters,f,p,p,mh(h,"columnFooter"),hh,1,d,"y2",m-p,1,p,u)),c.rowtitle&&(s=mh(n.titleAnchor,Vd),l=mh(h,"rowTitle"),l=s===Gd?o+l:r-l,u=mh(n.titleBand,Vd,.5),Oh(t,c.rowtitle,l,0,b,u)),c.coltitle&&(s=mh(n.titleAnchor,"column"),l=mh(h,"columnTitle"),l=s===Gd?a+l:i-l,u=mh(n.titleBand,"column",.5),Oh(t,c.coltitle,l,1,b,u))}(n,e,t.layout),function(t,e,n){var r,i,o,a,s,u=e.items,l=Math.max(0,e.width||0),c=Math.max(0,e.height||0),f=(new El).set(0,0,l,c),d=f.clone(),h=f.clone(),p=[];for(a=0,s=u.length;a<s;++a)switch((i=u[a]).role){case"axis":(lh(i)?d:h).union(ch(t,i,l,c));break;case"title":r=i;break;case"legend":p.push(jh(t,i));break;case"frame":case"scope":case"row-header":case"row-footer":case"row-title":case"column-header":case"column-footer":case"column-title":d.union(i.bounds),h.union(i.bounds);break;default:f.union(i.bounds)}if(p.length){const e={};p.forEach(t=>{"none"!==(o=t.orient||Hd)&&(e[o]||(e[o]=[])).push(t)});for(const r in e){const i=e[r];yh(t,i,wh(i,r,n.legends,d,h,l,c))}p.forEach(e=>{const r=e.bounds;if(r.equals(e._bounds)||(e.bounds=e._bounds,t.dirty(e),e.bounds=r,t.dirty(e)),n.autosize&&"fit"===n.autosize.type)switch(e.orient){case Yd:case Hd:f.add(r.x1,0).add(r.x2,0);break;case Wd:case"bottom":f.add(0,r.y1).add(0,r.y2)}else f.union(r)})}f.union(d).union(h),r&&f.union(function(t,e,n,r,i){var o,a=e.items[0],s=a.frame,u=a.orient,l=a.anchor,c=a.offset,f=a.padding,d=a.items[0].items[0],h=a.items[1]&&a.items[1].items[0],p=u===Yd||u===Hd?r:n,g=0,m=0,b=0,y=0,v=0;if("group"!==s?u===Yd?(g=i.y2,p=i.y1):u===Hd?(g=i.y1,p=i.y2):(g=i.x1,p=i.x2):u===Yd&&(g=r,p=0),o="start"===l?g:l===Gd?p:(g+p)/2,h&&h.text){switch(u){case Wd:case"bottom":v=d.bounds.height()+f;break;case Yd:y=d.bounds.width()+f;break;case Hd:y=-d.bounds.width()-f}sh.clear().union(h.bounds),sh.translate(y-(h.x||0),v-(h.y||0)),uh(h,"x",y)|uh(h,"y",v)&&(t.dirty(h),h.bounds.clear().union(sh),h.mark.bounds.clear().union(sh),t.dirty(h)),sh.clear().union(h.bounds)}else sh.clear();switch(sh.union(d.bounds),u){case Wd:m=o,b=i.y1-sh.height()-c;break;case Yd:m=i.x1-sh.width()-c,b=o;break;case Hd:m=i.x2+sh.width()+c,b=o;break;case"bottom":m=o,b=i.y2+c;break;default:m=a.x,b=a.y}return uh(a,"x",m)|uh(a,"y",b)&&(sh.translate(m,b),t.dirty(a),a.bounds.clear().union(sh),e.bounds.clear().union(sh),t.dirty(a)),a.bounds}(t,r,l,c,f));e.clip&&f.set(0,0,e.width||0,e.height||0);!function(t,e,n,r){const i=r.autosize||{},o=i.type;if(t._autosize<1||!o)return;let a=t._width,s=t._height,u=Math.max(0,e.width||0),l=Math.max(0,Math.ceil(-n.x1)),c=Math.max(0,e.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-c));if("padding"===i.contains){const e=t.padding();a-=e.left+e.right,s-=e.top+e.bottom}"none"===o?(l=0,f=0,u=a,c=s):"fit"===o?(u=Math.max(0,a-l-d),c=Math.max(0,s-f-h)):"fit-x"===o?(u=Math.max(0,a-l-d),s=c+f+h):"fit-y"===o?(a=u+l+d,c=Math.max(0,s-f-h)):"pad"===o&&(a=u+l+d,s=c+f+h);t._resizeView(a,s,u,c,[l,f],i.resize)}(t,e,f,n)}(n,e,t)}),(r=t.mark.group)&&"legend-entry"!==r.mark.role?e.reflow():e;var r}}),Object(Z.z)(Mh,Pt,{transform(t,e){if(this.value&&!t.modified())return e.StopPropagation;var n=e.dataflow.locale(),r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=this.value,o=t.scale,a=pu(o,null==t.count?t.values?t.values.length:10:t.count,t.minstep),s=t.format||bu(n,o,a,t.formatSpecifier,t.formatType,!!t.values),u=t.values?gu(o,t.values,a):mu(o,a);return i&&(r.rem=i),i=u.map((t,e)=>ut({index:e/(u.length-1||1),value:t,label:s(t)})),t.extra&&i.length&&i.push(ut({index:-1,extra:{value:i[0].value},label:""})),r.source=i,r.add=i,this.value=i,r}}),Object(Z.z)(Sh,Pt,{transform(t,e){var n=e.dataflow,r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=t.item||Ch,o=t.key||at,a=this.value;return Object(Z.B)(r.encode)&&(r.encode=null),a&&(t.modified("key")||e.modified(o))&&Object(Z.o)("DataJoin does not support modified key function or fields."),a||(e=e.addAll(),this.value=a=function(t){const e=Object(Z.t)().test(t=>t.exit);return e.lookup=n=>e.get(t(n)),e}(o)),e.visit(e.ADD,t=>{const e=o(t);let n=a.get(e);n?n.exit?(a.empty--,r.add.push(n)):r.mod.push(n):(n=i(t),a.set(e,n),r.add.push(n)),n.datum=t,n.exit=!1}),e.visit(e.MOD,t=>{const e=o(t),n=a.get(e);n&&(n.datum=t,r.mod.push(n))}),e.visit(e.REM,t=>{const e=o(t),n=a.get(e);t!==n.datum||n.exit||(r.rem.push(n),n.exit=!0,++a.empty)}),e.changed(e.ADD_MOD)&&r.modifies("datum"),(e.clean()||t.clean&&a.empty>n.cleanThreshold)&&n.runAfter(a.clean),r}}),Object(Z.z)(Fh,Pt,{transform(t,e){var n=e.fork(e.ADD_REM),r=t.mod||!1,i=t.encoders,o=e.encode;if(Object(Z.B)(o)){if(!n.changed()&&!o.every(t=>i[t]))return e.StopPropagation;o=o[0],n.encode=null}var a="enter"===o,s=i.update||Z.s,u=i.enter||Z.s,l=i.exit||Z.s,c=(o&&!a?i[o]:s)||Z.s;if(e.changed(e.ADD)&&(e.visit(e.ADD,e=>{u(e,t),s(e,t)}),n.modifies(u.output),n.modifies(s.output),c!==Z.s&&c!==s&&(e.visit(e.ADD,e=>{c(e,t)}),n.modifies(c.output))),e.changed(e.REM)&&l!==Z.s&&(e.visit(e.REM,e=>{l(e,t)}),n.modifies(l.output)),a||c!==Z.s){const i=e.MOD|(t.modified()?e.REFLOW:0);a?(e.visit(i,e=>{const i=u(e,t)||r;(c(e,t)||i)&&n.mod.push(e)}),n.mod.length&&n.modifies(u.output)):e.visit(i,e=>{(c(e,t)||r)&&n.mod.push(e)}),n.mod.length&&n.modifies(c.output)}return n.changed()?n:e.StopPropagation}}),Object(Z.z)(zh,Pt,{transform(t,e){if(null!=this.value&&!t.modified())return e.StopPropagation;var n,r,i,o,a,s=e.dataflow.locale(),u=e.fork(e.NO_SOURCE|e.NO_FIELDS),l=this.value,c=t.type||"symbol",f=t.scale,d=+t.limit,h=pu(f,null==t.count?5:t.count,t.minstep),p=!!t.values||"symbol"===c,g=t.format||Ou(s,f,h,c,t.formatSpecifier,t.formatType,p),m=t.values||_u(f,h);return l&&(u.rem=l),"symbol"===c?(d&&m.length>d?(e.dataflow.warn("Symbol legend count exceeds limit, filtering items."),l=m.slice(0,d-1),a=!0):l=m,Object(Z.E)(i=t.size)?(t.values||0!==f(l[0])||(l=l.slice(1)),o=l.reduce((e,n)=>Math.max(e,i(n,t)),0)):i=Object(Z.m)(o=i||8),l=l.map((e,n)=>ut({index:n,label:g(e,n,l),value:e,offset:o,size:i(e,t)})),a&&(a=m[l.length],l.push(ut({index:l.length,label:"…".concat(m.length-l.length," entries"),value:a,offset:o,size:i(a,t)})))):"gradient"===c?(n=f.domain(),r=ou(f,n[0],Object(Z.V)(n)),m.length<3&&!t.values&&n[0]!==Object(Z.V)(n)&&(m=[n[0],Object(Z.V)(n)]),l=m.map((t,e)=>ut({index:e,label:g(t,e,m),value:t,perc:r(t)}))):(i=m.length-1,r=function(t){const e=t.domain(),n=e.length-1;let r=+e[0],i=+Object(Z.V)(e),o=i-r;if("threshold"===t.type){const t=n?o/n:.1;r-=t,i+=t,o=i-r}return t=>(t-r)/o}(f),l=m.map((t,e)=>ut({index:e,label:g(t,e,m),value:t,perc:e?r(t):0,perc2:e===i?1:r(m[e+1])}))),u.source=l,u.add=l,this.value=l,u}});const Th=t=>t.source.x,$h=t=>t.source.y,Nh=t=>t.target.x,Rh=t=>t.target.y;function Ph(t){Pt.call(this,{},t)}Ph.Definition={type:"LinkPath",metadata:{modifies:!0},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(Z.z)(Ph,Pt,{transform(t,e){var n=t.sourceX||Th,r=t.sourceY||$h,i=t.targetX||Nh,o=t.targetY||Rh,a=t.as||"path",s=t.orient||"vertical",u=t.shape||"line",l=Uh.get(u+"-"+s)||Uh.get(u);return l||Object(Z.o)("LinkPath unsupported type: "+t.shape+(t.orient?"-"+t.orient:"")),e.visit(e.SOURCE,t=>{t[a]=l(n(t),r(t),i(t),o(t))}),e.reflow(t.modified()).modifies(a)}});const Bh=(t,e,n,r)=>"M"+t+","+e+"L"+n+","+r,Lh=(t,e,n,r)=>{var i=n-t,o=r-e,a=Math.sqrt(i*i+o*o)/2;return"M"+t+","+e+"A"+a+","+a+" "+180*Math.atan2(o,i)/Math.PI+" 0 1 "+n+","+r},Ih=(t,e,n,r)=>{const i=n-t,o=r-e,a=.2*(i+o),s=.2*(o-i);return"M"+t+","+e+"C"+(t+a)+","+(e+s)+" "+(n+s)+","+(r-a)+" "+n+","+r},Uh=Object(Z.t)({line:Bh,"line-radial":(t,e,n,r)=>Bh(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n)),arc:Lh,"arc-radial":(t,e,n,r)=>Lh(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n)),curve:Ih,"curve-radial":(t,e,n,r)=>Ih(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n)),"orthogonal-horizontal":(t,e,n,r)=>"M"+t+","+e+"V"+r+"H"+n,"orthogonal-vertical":(t,e,n,r)=>"M"+t+","+e+"H"+n+"V"+r,"orthogonal-radial":(t,e,n,r)=>{const i=Math.cos(t),o=Math.sin(t),a=Math.cos(n),s=Math.sin(n);return"M"+e*i+","+e*o+"A"+e+","+e+" 0 0,"+((Math.abs(n-t)>Math.PI?n<=t:n>t)?1:0)+" "+e*a+","+e*s+"L"+r*a+","+r*s},"diagonal-horizontal":(t,e,n,r)=>{const i=(t+n)/2;return"M"+t+","+e+"C"+i+","+e+" "+i+","+r+" "+n+","+r},"diagonal-vertical":(t,e,n,r)=>{const i=(e+r)/2;return"M"+t+","+e+"C"+t+","+i+" "+n+","+i+" "+n+","+r},"diagonal-radial":(t,e,n,r)=>{const i=Math.cos(t),o=Math.sin(t),a=Math.cos(n),s=Math.sin(n),u=(e+r)/2;return"M"+e*i+","+e*o+"C"+u*i+","+u*o+" "+u*a+","+u*s+" "+r*a+","+r*s}});function qh(t){Pt.call(this,null,t)}qh.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]},Object(Z.z)(qh,Pt,{transform(t,e){var n,r,i,o=t.as||["startAngle","endAngle"],a=o[0],s=o[1],u=t.field||Z.P,l=t.startAngle||0,c=null!=t.endAngle?t.endAngle:2*Math.PI,f=e.source,d=f.map(u),h=d.length,p=l,g=(c-l)/Dh(d),m=We(h);for(t.sort&&m.sort((t,e)=>d[t]-d[e]),n=0;n<h;++n)i=d[m[n]],(r=f[m[n]])[a]=p,r[s]=p+=i*g;return this.value=d,e.reflow(t.modified()).modifies(o)}});function Wh(t){return Xs(t)&&"sequential"!==t}const Yh=Object(Z.eb)(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma"]);function Hh(t){Pt.call(this,null,t),this.modified(!0)}function Gh(t,e,n){Zs(t)&&(Math.abs(e.reduce((t,e)=>t+(e<0?-1:e>0?1:0),0))!==e.length&&n.warn("Log scale domain includes zero: "+Object(Z.ab)(e)));return e}function Vh(t,e,n){return Object(Z.E)(t)&&(e||n)?nu(t,Xh(e||[0,1],n)):t}function Xh(t,e){return e?t.slice().reverse():t}function Jh(t){Pt.call(this,null,t)}Object(Z.z)(Hh,Pt,{transform(t,e){var n=e.dataflow,r=this.value,i=function(t){var e,n=t.type,r="";if("sequential"===n)return"sequential-linear";(function(t){const e=t.type;return Xs(e)&&e!==Rs&&e!==Ps&&(t.scheme||t.range&&t.range.length&&t.range.every(Z.I))})(t)&&(e=t.rawDomain?t.rawDomain.length:t.domain?t.domain.length+ +(null!=t.domainMid):0,r=2===e?"sequential-":3===e?"diverging-":"");return(r+n||"linear").toLowerCase()}(t);for(i in r&&i===r.type||(this.value=r=Hs(i)()),t)if(!Yh[i]){if("padding"===i&&Wh(r.type))continue;Object(Z.E)(r[i])?r[i](t[i]):n.warn("Unsupported scale property: "+i)}return function(t,e,n){var r=t.type,i=e.round||!1,o=e.range;if(null!=e.rangeStep)o=function(t,e,n){"band"!==t&&"point"!==t&&Object(Z.o)("Only band and point scales support rangeStep.");var r=(null!=e.paddingOuter?e.paddingOuter:e.padding)||0,i="point"===t?1:(null!=e.paddingInner?e.paddingInner:e.padding)||0;return[0,e.rangeStep*$s(n,i,r)]}(r,e,n);else if(e.scheme&&(o=function(t,e,n){var r,i,o=e.schemeExtent;Object(Z.B)(e.scheme)?i=ru(e.scheme,e.interpolate,e.interpolateGamma):(r=e.scheme.toLowerCase(),(i=cu(r))||Object(Z.o)("Unrecognized scheme name: ".concat(e.scheme)));return n="threshold"===t?n+1:"bin-ordinal"===t?n-1:"quantile"===t||"quantize"===t?+e.schemeCount||5:n,Qs(t)?Vh(i,o,e.reverse):Object(Z.E)(i)?iu(Vh(i,o),n):"ordinal"===t?i:i.slice(0,n)}(r,e,n),Object(Z.E)(o))){if(t.interpolator)return t.interpolator(o);Object(Z.o)("Scale type ".concat(r," does not support interpolating color schemes."))}if(o&&Qs(r))return t.interpolator(ru(Xh(o,e.reverse),e.interpolate,e.interpolateGamma));o&&e.interpolate&&t.interpolate?t.interpolate(au(e.interpolate,e.interpolateGamma)):Object(Z.E)(t.round)?t.round(i):Object(Z.E)(t.rangeRound)&&t.interpolate(i?Vo:Go);o&&t.range(Xh(o,e.reverse))}(r,t,function(t,e,n){let r=e.bins;if(r&&!Object(Z.B)(r)){const e=t.domain(),n=e[0],i=Object(Z.V)(e),o=r.step;let a=null==r.start?n:r.start,s=null==r.stop?i:r.stop;o||Object(Z.o)("Scale bins parameter missing step property."),a<n&&(a=o*Math.ceil(n/o)),s>i&&(s=o*Math.floor(i/o)),r=We(a,s+o/2,o)}r?t.bins=r:t.bins&&delete t.bins;"bin-ordinal"===t.type&&(r?e.domain||e.domainRaw||(t.domain(r),n=r.length):t.bins=t.domain());return n}(r,t,function(t,e,n){const r=function(t,e,n){return e?(t.domain(Gh(t.type,e,n)),e.length):-1}(t,e.domainRaw,n);if(r>-1)return r;var i,o,a=e.domain,s=t.type,u=e.zero||void 0===e.zero&&function(t){const e=t.type;return!t.bins&&("linear"===e||"pow"===e||"sqrt"===e)}(t);if(!a)return 0;Wh(s)&&e.padding&&a[0]!==Object(Z.V)(a)&&(a=function(t,e,n,r,i,o){var a=Math.abs(Object(Z.V)(n)-n[0]),s=a/(a-2*r),u=t===Ns?Object(Z.nb)(e,null,s):"sqrt"===t?Object(Z.ob)(e,null,s,.5):"pow"===t?Object(Z.ob)(e,null,s,i||1):"symlog"===t?Object(Z.pb)(e,null,s,o||1):Object(Z.mb)(e,null,s);return(e=e.slice())[0]=u[0],e[e.length-1]=u[1],e}(s,a,e.range,e.padding,e.exponent,e.constant));if((u||null!=e.domainMin||null!=e.domainMax||null!=e.domainMid)&&(i=(a=a.slice()).length-1||1,u&&(a[0]>0&&(a[0]=0),a[i]<0&&(a[i]=0)),null!=e.domainMin&&(a[0]=e.domainMin),null!=e.domainMax&&(a[i]=e.domainMax),null!=e.domainMid)){const t=(o=e.domainMid)>a[i]?i+1:o<a[0]?0:i;t!==i&&n.warn("Scale domainMid exceeds domain min or max.",o),a.splice(t,0,o)}t.domain(Gh(s,a,n)),"ordinal"===s&&t.unknown(e.domainImplicit?Bi:void 0);e.nice&&t.nice&&t.nice(!0!==e.nice&&pu(t,e.nice)||null);return a.length}(r,t,n))),e.fork(e.NO_SOURCE|e.NO_FIELDS)}}),Object(Z.z)(Jh,Pt,{transform(t,e){const n=t.modified("sort")||e.changed(e.ADD)||e.modified(t.sort.fields)||e.modified("datum");return n&&e.source.sort(dt(t.sort)),this.modified(n),e}});const Kh=["y0","y1"];function Zh(t){Pt.call(this,null,t)}function Qh(t,e,n,r,i){for(var o,a=(e-t.sum)/2,s=t.length,u=0;u<s;++u)(o=t[u])[r]=a,o[i]=a+=Math.abs(n(o))}function tp(t,e,n,r,i){for(var o,a=1/t.sum,s=0,u=t.length,l=0,c=0;l<u;++l)(o=t[l])[r]=s,o[i]=s=a*(c+=Math.abs(n(o)))}function ep(t,e,n,r,i){for(var o,a,s=0,u=0,l=t.length,c=0;c<l;++c)(o=+n(a=t[c]))<0?(a[r]=u,a[i]=u+=o):(a[r]=s,a[i]=s+=o)}Zh.Definition={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:"zero",values:["zero","center","normalize"]},{name:"as",type:"string",array:!0,length:2,default:Kh}]},Object(Z.z)(Zh,Pt,{transform(t,e){var n,r,i,o,a=t.as||Kh,s=a[0],u=a[1],l=dt(t.sort),c=t.field||Z.P,f="center"===t.offset?Qh:"normalize"===t.offset?tp:ep;for(n=function(t,e,n,r){var i,o,a,s,u,l,c,f,d,h=[],p=t=>t(u);if(null==e)h.push(t.slice());else for(i={},o=0,a=t.length;o<a;++o)u=t[o],l=e.map(p),(c=i[l])||(i[l]=c=[],h.push(c)),c.push(u);for(l=0,d=0,s=h.length;l<s;++l){for(c=h[l],o=0,f=0,a=c.length;o<a;++o)f+=Math.abs(r(c[o]));c.sum=f,f>d&&(d=f),n&&c.sort(n)}return h.max=d,h}(e.source,t.groupby,l,c),r=0,i=n.length,o=n.max;r<i;++r)f(n[r],o,c,s,u);return e.reflow(t.modified()).modifies(a)}});var np=t=>t;function rp(t,e){t&&op.hasOwnProperty(t.type)&&op[t.type](t,e)}var ip={Feature:function(t,e){rp(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)rp(n[r].geometry,e)}},op={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){ap(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)ap(n[r],e,0)},Polygon:function(t,e){sp(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)sp(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)rp(n[r],e)}};function ap(t,e,n){var r,i=-1,o=t.length-n;for(e.lineStart();++i<o;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function sp(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)ap(t[n],e,1);e.polygonEnd()}var up=function(t,e){t&&ip.hasOwnProperty(t.type)?ip[t.type](t,e):rp(t,e)};class lp{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const e=this._partials;let n=0;for(let r=0;r<this._n&&r<32;r++){const i=e[r],o=t+i,a=Math.abs(t)<Math.abs(i)?t-(o-i):i-(o-t);a&&(e[n++]=a),t=o}return e[n]=t,this._n=n+1,this}valueOf(){const t=this._partials;let e,n,r,i=this._n,o=0;if(i>0){for(o=t[--i];i>0&&(e=o,n=t[--i],o=e+n,r=n-(o-e),!r););i>0&&(r<0&&t[i-1]<0||r>0&&t[i-1]>0)&&(n=2*r,e=o+n,n==e-o&&(o=e))}return o}}var cp=Math.PI,fp=cp/2,dp=cp/4,hp=2*cp,pp=180/cp,gp=cp/180,mp=Math.abs,bp=Math.atan,yp=Math.atan2,vp=Math.cos,xp=Math.ceil,_p=Math.exp,Op=(Math.floor,Math.hypot),wp=Math.log,jp=Math.pow,kp=Math.sin,Ep=Math.sign||function(t){return t>0?1:t<0?-1:0},Ap=Math.sqrt,Dp=Math.tan;function Mp(t){return t>1?0:t<-1?cp:Math.acos(t)}function Sp(t){return t>1?fp:t<-1?-fp:Math.asin(t)}function Cp(){}var Fp,zp,Tp,$p,Np=new lp,Rp=new lp,Pp={point:Cp,lineStart:Cp,lineEnd:Cp,polygonStart:function(){Pp.lineStart=Bp,Pp.lineEnd=Up},polygonEnd:function(){Pp.lineStart=Pp.lineEnd=Pp.point=Cp,Np.add(mp(Rp)),Rp=new lp},result:function(){var t=Np/2;return Np=new lp,t}};function Bp(){Pp.point=Lp}function Lp(t,e){Pp.point=Ip,Fp=Tp=t,zp=$p=e}function Ip(t,e){Rp.add($p*t-Tp*e),Tp=t,$p=e}function Up(){Ip(Fp,zp)}var qp=Pp,Wp=1/0,Yp=Wp,Hp=-Wp,Gp=Hp;var Vp,Xp,Jp,Kp,Zp={point:function(t,e){t<Wp&&(Wp=t);t>Hp&&(Hp=t);e<Yp&&(Yp=e);e>Gp&&(Gp=e)},lineStart:Cp,lineEnd:Cp,polygonStart:Cp,polygonEnd:Cp,result:function(){var t=[[Wp,Yp],[Hp,Gp]];return Hp=Gp=-(Yp=Wp=1/0),t}},Qp=0,tg=0,eg=0,ng=0,rg=0,ig=0,og=0,ag=0,sg=0,ug={point:lg,lineStart:cg,lineEnd:hg,polygonStart:function(){ug.lineStart=pg,ug.lineEnd=gg},polygonEnd:function(){ug.point=lg,ug.lineStart=cg,ug.lineEnd=hg},result:function(){var t=sg?[og/sg,ag/sg]:ig?[ng/ig,rg/ig]:eg?[Qp/eg,tg/eg]:[NaN,NaN];return Qp=tg=eg=ng=rg=ig=og=ag=sg=0,t}};function lg(t,e){Qp+=t,tg+=e,++eg}function cg(){ug.point=fg}function fg(t,e){ug.point=dg,lg(Jp=t,Kp=e)}function dg(t,e){var n=t-Jp,r=e-Kp,i=Ap(n*n+r*r);ng+=i*(Jp+t)/2,rg+=i*(Kp+e)/2,ig+=i,lg(Jp=t,Kp=e)}function hg(){ug.point=lg}function pg(){ug.point=mg}function gg(){bg(Vp,Xp)}function mg(t,e){ug.point=bg,lg(Vp=Jp=t,Xp=Kp=e)}function bg(t,e){var n=t-Jp,r=e-Kp,i=Ap(n*n+r*r);ng+=i*(Jp+t)/2,rg+=i*(Kp+e)/2,ig+=i,og+=(i=Kp*t-Jp*e)*(Jp+t),ag+=i*(Kp+e),sg+=3*i,lg(Jp=t,Kp=e)}var yg=ug;function vg(t){this._context=t}vg.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,hp)}},result:Cp};var xg,_g,Og,wg,jg,kg=new lp,Eg={point:Cp,lineStart:function(){Eg.point=Ag},lineEnd:function(){xg&&Dg(_g,Og),Eg.point=Cp},polygonStart:function(){xg=!0},polygonEnd:function(){xg=null},result:function(){var t=+kg;return kg=new lp,t}};function Ag(t,e){Eg.point=Dg,_g=wg=t,Og=jg=e}function Dg(t,e){wg-=t,jg-=e,kg.add(Ap(wg*wg+jg*jg)),wg=t,jg=e}var Mg=Eg;function Sg(){this._string=[]}function Cg(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}Sg.prototype={_radius:4.5,_circle:Cg(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=Cg(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}};var Fg=function(t,e){var n,r,i=4.5;function o(t){return t&&("function"==typeof i&&r.pointRadius(+i.apply(this,arguments)),up(t,n(r))),r.result()}return o.area=function(t){return up(t,n(qp)),qp.result()},o.measure=function(t){return up(t,n(Mg)),Mg.result()},o.bounds=function(t){return up(t,n(Zp)),Zp.result()},o.centroid=function(t){return up(t,n(yg)),yg.result()},o.projection=function(e){return arguments.length?(n=null==e?(t=null,np):(t=e).stream,o):t},o.context=function(t){return arguments.length?(r=null==t?(e=null,new Sg):new vg(e=t),"function"!=typeof i&&r.pointRadius(i),o):e},o.pointRadius=function(t){return arguments.length?(i="function"==typeof t?t:(r.pointRadius(+t),+t),o):i},o.projection(t).context(e)},zg=function(){var t,e=[];return{point:function(e,n,r){t.push([e,n,r])},lineStart:function(){e.push(t=[])},lineEnd:Cp,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}},Tg=function(t,e){return mp(t[0]-e[0])<1e-6&&mp(t[1]-e[1])<1e-6};function $g(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}var Ng=function(t,e,n,r,i){var o,a,s=[],u=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],a=t[e];if(Tg(r,a)){if(!r[2]&&!a[2]){for(i.lineStart(),o=0;o<e;++o)i.point((r=t[o])[0],r[1]);return void i.lineEnd()}a[0]+=2e-6}s.push(n=new $g(r,t,null,!0)),u.push(n.o=new $g(r,null,n,!1)),s.push(n=new $g(a,t,null,!1)),u.push(n.o=new $g(a,null,n,!0))}})),s.length){for(u.sort(e),Rg(s),Rg(u),o=0,a=u.length;o<a;++o)u[o].e=n=!n;for(var l,c,f=s[0];;){for(var d=f,h=!0;d.v;)if((d=d.n)===f)return;l=d.z,i.lineStart();do{if(d.v=d.o.v=!0,d.e){if(h)for(o=0,a=l.length;o<a;++o)i.point((c=l[o])[0],c[1]);else r(d.x,d.n.x,1,i);d=d.n}else{if(h)for(l=d.p.z,o=l.length-1;o>=0;--o)i.point((c=l[o])[0],c[1]);else r(d.x,d.p.x,-1,i);d=d.p}l=(d=d.o).z,h=!h}while(!d.v);i.lineEnd()}}};function Rg(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function Pg(t){return[yp(t[1],t[0]),Sp(t[2])]}function Bg(t){var e=t[0],n=t[1],r=vp(n);return[r*vp(e),r*kp(e),kp(n)]}function Lg(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Ig(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Ug(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function qg(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Wg(t){var e=Ap(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Yg(t){return mp(t[0])<=cp?t[0]:Ep(t[0])*((mp(t[0])+cp)%hp-cp)}function Hg(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}var Gg=function(t,e,n,r){return function(i){var o,a,s,u=e(i),l=zg(),c=e(l),f=!1,d={point:h,lineStart:g,lineEnd:m,polygonStart:function(){d.point=b,d.lineStart=y,d.lineEnd=v,a=[],o=[]},polygonEnd:function(){d.point=h,d.lineStart=g,d.lineEnd=m,a=Hg(a);var t=function(t,e){var n=Yg(e),r=e[1],i=kp(r),o=[kp(n),-vp(n),0],a=0,s=0,u=new lp;1===i?r=fp+1e-6:-1===i&&(r=-fp-1e-6);for(var l=0,c=t.length;l<c;++l)if(d=(f=t[l]).length)for(var f,d,h=f[d-1],p=Yg(h),g=h[1]/2+dp,m=kp(g),b=vp(g),y=0;y<d;++y,p=x,m=O,b=w,h=v){var v=f[y],x=Yg(v),_=v[1]/2+dp,O=kp(_),w=vp(_),j=x-p,k=j>=0?1:-1,E=k*j,A=E>cp,D=m*O;if(u.add(yp(D*k*kp(E),b*w+D*vp(E))),a+=A?j+k*hp:j,A^p>=n^x>=n){var M=Ig(Bg(h),Bg(v));Wg(M);var S=Ig(o,M);Wg(S);var C=(A^j>=0?-1:1)*Sp(S[2]);(r>C||r===C&&(M[0]||M[1]))&&(s+=A^j>=0?1:-1)}}return(a<-1e-6||a<1e-6&&u<-1e-12)^1&s}(o,r);a.length?(f||(i.polygonStart(),f=!0),Ng(a,Xg,t,n,i)):t&&(f||(i.polygonStart(),f=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),f&&(i.polygonEnd(),f=!1),a=o=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function h(e,n){t(e,n)&&i.point(e,n)}function p(t,e){u.point(t,e)}function g(){d.point=p,u.lineStart()}function m(){d.point=h,u.lineEnd()}function b(t,e){s.push([t,e]),c.point(t,e)}function y(){c.lineStart(),s=[]}function v(){b(s[0][0],s[0][1]),c.lineEnd();var t,e,n,r,u=c.clean(),d=l.result(),h=d.length;if(s.pop(),o.push(s),s=null,h)if(1&u){if((e=(n=d[0]).length-1)>0){for(f||(i.polygonStart(),f=!0),i.lineStart(),t=0;t<e;++t)i.point((r=n[t])[0],r[1]);i.lineEnd()}}else h>1&&2&u&&d.push(d.pop().concat(d.shift())),a.push(d.filter(Vg))}return d}};function Vg(t){return t.length>1}function Xg(t,e){return((t=t.x)[0]<0?t[1]-fp-1e-6:fp-t[1])-((e=e.x)[0]<0?e[1]-fp-1e-6:fp-e[1])}var Jg=Gg((function(){return!0}),(function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,a){var s=o>0?cp:-cp,u=mp(o-n);mp(u-cp)<1e-6?(t.point(n,r=(r+a)/2>0?fp:-fp),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(o,r),e=0):i!==s&&u>=cp&&(mp(n-i)<1e-6&&(n-=1e-6*i),mp(o-s)<1e-6&&(o-=1e-6*s),r=function(t,e,n,r){var i,o,a=kp(t-n);return mp(a)>1e-6?bp((kp(e)*(o=vp(r))*kp(n)-kp(r)*(i=vp(e))*kp(t))/(i*o*a)):(e+r)/2}(n,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),e=0),t.point(n=o,r=a),i=s},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;if(null==t)i=n*fp,r.point(-cp,i),r.point(0,i),r.point(cp,i),r.point(cp,0),r.point(cp,-i),r.point(0,-i),r.point(-cp,-i),r.point(-cp,0),r.point(-cp,i);else if(mp(t[0]-e[0])>1e-6){var o=t[0]<e[0]?cp:-cp;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(e[0],e[1])}),[-cp,-fp]);var Kg=function(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n};function Zg(t,e){return[mp(t)>cp?t+Math.round(-t/hp)*hp:t,e]}function Qg(t,e,n){return(t%=hp)?e||n?Kg(em(t),nm(e,n)):em(t):e||n?nm(e,n):Zg}function tm(t){return function(e,n){return[(e+=t)>cp?e-hp:e<-cp?e+hp:e,n]}}function em(t){var e=tm(t);return e.invert=tm(-t),e}function nm(t,e){var n=vp(t),r=kp(t),i=vp(e),o=kp(e);function a(t,e){var a=vp(e),s=vp(t)*a,u=kp(t)*a,l=kp(e),c=l*n+s*r;return[yp(u*i-c*o,s*n-l*r),Sp(c*i+u*o)]}return a.invert=function(t,e){var a=vp(e),s=vp(t)*a,u=kp(t)*a,l=kp(e),c=l*i-u*o;return[yp(u*i+l*o,s*n+c*r),Sp(c*n-s*r)]},a}Zg.invert=Zg;function rm(t,e,n,r,i,o){if(n){var a=vp(e),s=kp(e),u=r*n;null==i?(i=e+r*hp,o=e-u/2):(i=im(a,i),o=im(a,o),(r>0?i<o:i>o)&&(i+=r*hp));for(var l,c=i;r>0?c>o:c<o;c-=u)l=Pg([a,-s*vp(c),-s*kp(c)]),t.point(l[0],l[1])}}function im(t,e){(e=Bg(e))[0]-=t,Wg(e);var n=Mp(-e[1]);return((-e[2]<0?-n:n)+hp-1e-6)%hp}var om=function(t){var e=vp(t),n=6*gp,r=e>0,i=mp(e)>1e-6;function o(t,n){return vp(t)*vp(n)>e}function a(t,n,r){var i=[1,0,0],o=Ig(Bg(t),Bg(n)),a=Lg(o,o),s=o[0],u=a-s*s;if(!u)return!r&&t;var l=e*a/u,c=-e*s/u,f=Ig(i,o),d=qg(i,l);Ug(d,qg(o,c));var h=f,p=Lg(d,h),g=Lg(h,h),m=p*p-g*(Lg(d,d)-1);if(!(m<0)){var b=Ap(m),y=qg(h,(-p-b)/g);if(Ug(y,d),y=Pg(y),!r)return y;var v,x=t[0],_=n[0],O=t[1],w=n[1];_<x&&(v=x,x=_,_=v);var j=_-x,k=mp(j-cp)<1e-6;if(!k&&w<O&&(v=O,O=w,w=v),k||j<1e-6?k?O+w>0^y[1]<(mp(y[0]-x)<1e-6?O:w):O<=y[1]&&y[1]<=w:j>cp^(x<=y[0]&&y[0]<=_)){var E=qg(h,(-p+b)/g);return Ug(E,d),[y,Pg(E)]}}}function s(e,n){var i=r?t:cp-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return Gg(o,(function(t){var e,n,u,l,c;return{lineStart:function(){l=u=!1,c=1},point:function(f,d){var h,p=[f,d],g=o(f,d),m=r?g?0:s(f,d):g?s(f+(f<0?cp:-cp),d):0;if(!e&&(l=u=g)&&t.lineStart(),g!==u&&(!(h=a(e,p))||Tg(e,h)||Tg(p,h))&&(p[2]=1),g!==u)c=0,g?(t.lineStart(),h=a(p,e),t.point(h[0],h[1])):(h=a(e,p),t.point(h[0],h[1],2),t.lineEnd()),e=h;else if(i&&e&&r^g){var b;m&n||!(b=a(p,e,!0))||(c=0,r?(t.lineStart(),t.point(b[0][0],b[0][1]),t.point(b[1][0],b[1][1]),t.lineEnd()):(t.point(b[1][0],b[1][1]),t.lineEnd(),t.lineStart(),t.point(b[0][0],b[0][1],3)))}!g||e&&Tg(e,p)||t.point(p[0],p[1]),e=p,u=g,n=m},lineEnd:function(){u&&t.lineEnd(),e=null},clean:function(){return c|(l&&u)<<1}}}),(function(e,r,i,o){rm(o,t,n,i,e,r)}),r?[0,-t]:[-cp,t-cp])};function am(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function o(i,o,s,l){var c=0,f=0;if(null==i||(c=a(i,s))!==(f=a(o,s))||u(i,o)<0^s>0)do{l.point(0===c||3===c?t:n,c>1?r:e)}while((c=(c+s+4)%4)!==f);else l.point(o[0],o[1])}function a(r,i){return mp(r[0]-t)<1e-6?i>0?0:3:mp(r[0]-n)<1e-6?i>0?2:1:mp(r[1]-e)<1e-6?i>0?1:0:i>0?3:2}function s(t,e){return u(t.x,e.x)}function u(t,e){var n=a(t,1),r=a(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(a){var u,l,c,f,d,h,p,g,m,b,y,v=a,x=zg(),_={point:O,lineStart:function(){_.point=w,l&&l.push(c=[]);b=!0,m=!1,p=g=NaN},lineEnd:function(){u&&(w(f,d),h&&m&&x.rejoin(),u.push(x.result()));_.point=O,m&&v.lineEnd()},polygonStart:function(){v=x,u=[],l=[],y=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=l.length;n<i;++n)for(var o,a,s=l[n],u=1,c=s.length,f=s[0],d=f[0],h=f[1];u<c;++u)o=d,a=h,f=s[u],d=f[0],h=f[1],a<=r?h>r&&(d-o)*(r-a)>(h-a)*(t-o)&&++e:h<=r&&(d-o)*(r-a)<(h-a)*(t-o)&&--e;return e}(),n=y&&e,i=(u=Hg(u)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&Ng(u,s,e,o,a),a.polygonEnd());v=a,u=l=c=null}};function O(t,e){i(t,e)&&v.point(t,e)}function w(o,a){var s=i(o,a);if(l&&c.push([o,a]),b)f=o,d=a,h=s,b=!1,s&&(v.lineStart(),v.point(o,a));else if(s&&m)v.point(o,a);else{var u=[p=Math.max(-1e9,Math.min(1e9,p)),g=Math.max(-1e9,Math.min(1e9,g))],x=[o=Math.max(-1e9,Math.min(1e9,o)),a=Math.max(-1e9,Math.min(1e9,a))];!function(t,e,n,r,i,o){var a,s=t[0],u=t[1],l=0,c=1,f=e[0]-s,d=e[1]-u;if(a=n-s,f||!(a>0)){if(a/=f,f<0){if(a<l)return;a<c&&(c=a)}else if(f>0){if(a>c)return;a>l&&(l=a)}if(a=i-s,f||!(a<0)){if(a/=f,f<0){if(a>c)return;a>l&&(l=a)}else if(f>0){if(a<l)return;a<c&&(c=a)}if(a=r-u,d||!(a>0)){if(a/=d,d<0){if(a<l)return;a<c&&(c=a)}else if(d>0){if(a>c)return;a>l&&(l=a)}if(a=o-u,d||!(a<0)){if(a/=d,d<0){if(a>c)return;a>l&&(l=a)}else if(d>0){if(a<l)return;a<c&&(c=a)}return l>0&&(t[0]=s+l*f,t[1]=u+l*d),c<1&&(e[0]=s+c*f,e[1]=u+c*d),!0}}}}}(u,x,t,e,n,r)?s&&(v.lineStart(),v.point(o,a),y=!1):(m||(v.lineStart(),v.point(u[0],u[1])),v.point(x[0],x[1]),s||v.lineEnd(),y=!1)}p=o,g=a,m=s}return _}}function sm(t){return function(e){var n=new um;for(var r in t)n[r]=t[r];return n.stream=e,n}}function um(){}function lm(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),up(n,t.stream(Zp)),e(Zp.result()),null!=r&&t.clipExtent(r),t}function cm(t,e,n){return lm(t,(function(n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),a=+e[0][0]+(r-o*(n[1][0]+n[0][0]))/2,s=+e[0][1]+(i-o*(n[1][1]+n[0][1]))/2;t.scale(150*o).translate([a,s])}),n)}function fm(t,e,n){return cm(t,[[0,0],e],n)}function dm(t,e,n){return lm(t,(function(n){var r=+e,i=r/(n[1][0]-n[0][0]),o=(r-i*(n[1][0]+n[0][0]))/2,a=-i*n[0][1];t.scale(150*i).translate([o,a])}),n)}function hm(t,e,n){return lm(t,(function(n){var r=+e,i=r/(n[1][1]-n[0][1]),o=-i*n[0][0],a=(r-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([o,a])}),n)}um.prototype={constructor:um,point:function(t,e){this.stream.point(t,e)},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()}};var pm=vp(30*gp),gm=function(t,e){return+e?function(t,e){function n(r,i,o,a,s,u,l,c,f,d,h,p,g,m){var b=l-r,y=c-i,v=b*b+y*y;if(v>4*e&&g--){var x=a+d,_=s+h,O=u+p,w=Ap(x*x+_*_+O*O),j=Sp(O/=w),k=mp(mp(O)-1)<1e-6||mp(o-f)<1e-6?(o+f)/2:yp(_,x),E=t(k,j),A=E[0],D=E[1],M=A-r,S=D-i,C=y*M-b*S;(C*C/v>e||mp((b*M+y*S)/v-.5)>.3||a*d+s*h+u*p<pm)&&(n(r,i,o,a,s,u,A,D,k,x/=w,_/=w,O,g,m),m.point(A,D),n(A,D,k,x,_,O,l,c,f,d,h,p,g,m))}}return function(e){var r,i,o,a,s,u,l,c,f,d,h,p,g={point:m,lineStart:b,lineEnd:v,polygonStart:function(){e.polygonStart(),g.lineStart=x},polygonEnd:function(){e.polygonEnd(),g.lineStart=b}};function m(n,r){n=t(n,r),e.point(n[0],n[1])}function b(){c=NaN,g.point=y,e.lineStart()}function y(r,i){var o=Bg([r,i]),a=t(r,i);n(c,f,l,d,h,p,c=a[0],f=a[1],l=r,d=o[0],h=o[1],p=o[2],16,e),e.point(c,f)}function v(){g.point=m,e.lineEnd()}function x(){b(),g.point=_,g.lineEnd=O}function _(t,e){y(r=t,e),i=c,o=f,a=d,s=h,u=p,g.point=y}function O(){n(c,f,l,d,h,p,i,o,r,a,s,u,16,e),g.lineEnd=v,v()}return g}}(t,e):function(t){return sm({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)};var mm=sm({point:function(t,e){this.stream.point(t*gp,e*gp)}});function bm(t,e,n,r,i,o){if(!o)return function(t,e,n,r,i){function o(o,a){return[e+t*(o*=r),n-t*(a*=i)]}return o.invert=function(o,a){return[(o-e)/t*r,(n-a)/t*i]},o}(t,e,n,r,i);var a=vp(o),s=kp(o),u=a*t,l=s*t,c=a/t,f=s/t,d=(s*n-a*e)/t,h=(s*e+a*n)/t;function p(t,o){return[u*(t*=r)-l*(o*=i)+e,n-l*t-u*o]}return p.invert=function(t,e){return[r*(c*t-f*e+d),i*(h-f*t-c*e)]},p}function ym(t){return vm((function(){return t}))()}function vm(t){var e,n,r,i,o,a,s,u,l,c,f=150,d=480,h=250,p=0,g=0,m=0,b=0,y=0,v=0,x=1,_=1,O=null,w=Jg,j=null,k=np,E=.5;function A(t){return u(t[0]*gp,t[1]*gp)}function D(t){return(t=u.invert(t[0],t[1]))&&[t[0]*pp,t[1]*pp]}function M(){var t=bm(f,0,0,x,_,v).apply(null,e(p,g)),r=bm(f,d-t[0],h-t[1],x,_,v);return n=Qg(m,b,y),s=Kg(e,r),u=Kg(n,s),a=gm(s,E),S()}function S(){return l=c=null,A}return A.stream=function(t){return l&&c===t?l:l=mm(function(t){return sm({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}(n)(w(a(k(c=t)))))},A.preclip=function(t){return arguments.length?(w=t,O=void 0,S()):w},A.postclip=function(t){return arguments.length?(k=t,j=r=i=o=null,S()):k},A.clipAngle=function(t){return arguments.length?(w=+t?om(O=t*gp):(O=null,Jg),S()):O*pp},A.clipExtent=function(t){return arguments.length?(k=null==t?(j=r=i=o=null,np):am(j=+t[0][0],r=+t[0][1],i=+t[1][0],o=+t[1][1]),S()):null==j?null:[[j,r],[i,o]]},A.scale=function(t){return arguments.length?(f=+t,M()):f},A.translate=function(t){return arguments.length?(d=+t[0],h=+t[1],M()):[d,h]},A.center=function(t){return arguments.length?(p=t[0]%360*gp,g=t[1]%360*gp,M()):[p*pp,g*pp]},A.rotate=function(t){return arguments.length?(m=t[0]%360*gp,b=t[1]%360*gp,y=t.length>2?t[2]%360*gp:0,M()):[m*pp,b*pp,y*pp]},A.angle=function(t){return arguments.length?(v=t%360*gp,M()):v*pp},A.reflectX=function(t){return arguments.length?(x=t?-1:1,M()):x<0},A.reflectY=function(t){return arguments.length?(_=t?-1:1,M()):_<0},A.precision=function(t){return arguments.length?(a=gm(s,E=t*t),S()):Ap(E)},A.fitExtent=function(t,e){return cm(A,t,e)},A.fitSize=function(t,e){return fm(A,t,e)},A.fitWidth=function(t,e){return dm(A,t,e)},A.fitHeight=function(t,e){return hm(A,t,e)},function(){return e=t.apply(this,arguments),A.invert=e.invert&&D,M()}}function xm(t){var e=0,n=cp/3,r=vm(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*gp,n=t[1]*gp):[e*pp,n*pp]},i}function _m(t,e){var n=kp(t),r=(n+kp(e))/2;if(mp(r)<1e-6)return function(t){var e=vp(t);function n(t,n){return[t*e,kp(n)/e]}return n.invert=function(t,n){return[t/e,Sp(n*e)]},n}(t);var i=1+n*(2*r-n),o=Ap(i)/r;function a(t,e){var n=Ap(i-2*r*kp(e))/r;return[n*kp(t*=r),o-n*vp(t)]}return a.invert=function(t,e){var n=o-e,a=yp(t,mp(n))*Ep(n);return n*r<0&&(a-=cp*Ep(t)*Ep(n)),[a/r,Sp((i-(t*t+n*n)*r*r)/(2*r))]},a}var Om=function(){return xm(_m).scale(155.424).center([0,33.6442])},wm=function(){return Om().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])};function jm(t){return function(e,n){var r=vp(e),i=vp(n),o=t(r*i);return o===1/0?[2,0]:[o*i*kp(e),o*kp(n)]}}function km(t){return function(e,n){var r=Ap(e*e+n*n),i=t(r),o=kp(i),a=vp(i);return[yp(e*o,r*a),Sp(r&&n*o/r)]}}var Em=jm((function(t){return Ap(2/(1+t))}));Em.invert=km((function(t){return 2*Sp(t/2)}));var Am=jm((function(t){return(t=Mp(t))&&t/kp(t)}));Am.invert=km((function(t){return t}));function Dm(t,e){return[t,wp(Dp((fp+e)/2))]}Dm.invert=function(t,e){return[t,2*bp(_p(e))-fp]};function Mm(t){var e,n,r,i=ym(t),o=i.center,a=i.scale,s=i.translate,u=i.clipExtent,l=null;function c(){var o=cp*a(),s=i(function(t){function e(e){return(e=t(e[0]*gp,e[1]*gp))[0]*=pp,e[1]*=pp,e}return t=Qg(t[0]*gp,t[1]*gp,t.length>2?t[2]*gp:0),e.invert=function(e){return(e=t.invert(e[0]*gp,e[1]*gp))[0]*=pp,e[1]*=pp,e},e}(i.rotate()).invert([0,0]));return u(null==l?[[s[0]-o,s[1]-o],[s[0]+o,s[1]+o]]:t===Dm?[[Math.max(s[0]-o,l),e],[Math.min(s[0]+o,n),r]]:[[l,Math.max(s[1]-o,e)],[n,Math.min(s[1]+o,r)]])}return i.scale=function(t){return arguments.length?(a(t),c()):a()},i.translate=function(t){return arguments.length?(s(t),c()):s()},i.center=function(t){return arguments.length?(o(t),c()):o()},i.clipExtent=function(t){return arguments.length?(null==t?l=e=n=r=null:(l=+t[0][0],e=+t[0][1],n=+t[1][0],r=+t[1][1]),c()):null==l?null:[[l,e],[n,r]]},c()}function Sm(t){return Dp((fp+t)/2)}function Cm(t,e){var n=vp(t),r=t===e?kp(t):wp(n/vp(e))/wp(Sm(e)/Sm(t)),i=n*jp(Sm(t),r)/r;if(!r)return Dm;function o(t,e){i>0?e<1e-6-fp&&(e=1e-6-fp):e>fp-1e-6&&(e=fp-1e-6);var n=i/jp(Sm(e),r);return[n*kp(r*t),i-n*vp(r*t)]}return o.invert=function(t,e){var n=i-e,o=Ep(r)*Ap(t*t+n*n),a=yp(t,mp(n))*Ep(n);return n*r<0&&(a-=cp*Ep(t)*Ep(n)),[a/r,2*bp(jp(i/o,1/r))-fp]},o}function Fm(t,e){return[t,e]}Fm.invert=Fm;function zm(t,e){var n=vp(t),r=t===e?kp(t):(n-vp(e))/(e-t),i=n/r+t;if(mp(r)<1e-6)return Fm;function o(t,e){var n=i-e,o=r*t;return[n*kp(o),i-n*vp(o)]}return o.invert=function(t,e){var n=i-e,o=yp(t,mp(n))*Ep(n);return n*r<0&&(o-=cp*Ep(t)*Ep(n)),[o/r,i-Ep(r)*Ap(t*t+n*n)]},o}var Tm=1.340264,$m=-.081106,Nm=893e-6,Rm=.003796,Pm=Ap(3)/2;function Bm(t,e){var n=Sp(Pm*kp(e)),r=n*n,i=r*r*r;return[t*vp(n)/(Pm*(Tm+3*$m*r+i*(7*Nm+9*Rm*r))),n*(Tm+$m*r+i*(Nm+Rm*r))]}Bm.invert=function(t,e){for(var n,r=e,i=r*r,o=i*i*i,a=0;a<12&&(o=(i=(r-=n=(r*(Tm+$m*i+o*(Nm+Rm*i))-e)/(Tm+3*$m*i+o*(7*Nm+9*Rm*i)))*r)*i*i,!(mp(n)<1e-12));++a);return[Pm*t*(Tm+3*$m*i+o*(7*Nm+9*Rm*i))/vp(r),Sp(kp(r)/Pm)]};function Lm(t,e){var n=vp(e),r=vp(t)*n;return[n*kp(t)/r,kp(e)/r]}Lm.invert=km(bp);function Im(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),e*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}Im.invert=function(t,e){var n,r=e,i=25;do{var o=r*r,a=o*o;r-=n=(r*(1.007226+o*(.015085+a*(.028874*o-.044475-.005916*a)))-e)/(1.007226+o*(.045255+a*(.259866*o-.311325-.005916*11*a)))}while(mp(n)>1e-6&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]};function Um(t,e){return[vp(e)*kp(t),kp(e)]}Um.invert=km(Sp);function qm(t,e){var n=vp(e),r=1+vp(t)*n;return[n*kp(t)/r,kp(e)/r]}qm.invert=km((function(t){return 2*bp(t)}));function Wm(t,e){return[wp(Dp((fp+e)/2)),-t]}Wm.invert=function(t,e){return[-e,2*bp(_p(t))-fp]};var Ym=Math.abs,Hm=(Math.atan,Math.atan2,Math.ceil,Math.cos),Gm=(Math.exp,Math.floor,Math.log,Math.max,Math.min,Math.pow,Math.round,Math.sign,Math.sin),Vm=(Math.tan,Math.PI),Xm=Vm/2,Jm=(Math.SQRT1_2,Zm(2));Zm(Vm);function Km(t){return t>1?Xm:t<-1?-Xm:Math.asin(t)}function Zm(t){return t>0?Math.sqrt(t):0}function Qm(t,e){var n,r=t*Gm(e),i=30;do{e-=n=(e+Gm(e)-r)/(1+Hm(e))}while(Ym(n)>1e-6&&--i>0);return e/2}var tb=function(t,e,n){function r(r,i){return[t*r*Hm(i=Qm(n,i)),e*Gm(i)]}return r.invert=function(r,i){return i=Km(i/e),[r/(t*Hm(i)),Km((2*i+Gm(2*i))/n)]},r}(Jm/Xm,Jm,Vm);const eb=Fg(),nb=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function rb(t,e){return function n(){const r=e();return r.type=t,r.path=Fg().projection(r),r.copy=r.copy||function(){const t=n();return nb.forEach(e=>{r[e]&&t[e](r[e]())}),t.path.pointRadius(r.path.pointRadius()),t},r}}function ib(t,e){if(!t||"string"!=typeof t)throw new Error("Projection type must be a name string.");return t=t.toLowerCase(),arguments.length>1?(ab[t]=rb(t,e),this):ab[t]||null}function ob(t){return t&&t.path||eb}const ab={albers:wm,albersusa:function(){var t,e,n,r,i,o,a=wm(),s=Om().rotate([154,0]).center([-2,58.5]).parallels([55,65]),u=Om().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,e){o=[t,e]}};function c(t){var e=t[0],a=t[1];return o=null,n.point(e,a),o||(r.point(e,a),o)||(i.point(e,a),o)}function f(){return t=e=null,c}return c.invert=function(t){var e=a.scale(),n=a.translate(),r=(t[0]-n[0])/e,i=(t[1]-n[1])/e;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?s:i>=.166&&i<.234&&r>=-.214&&r<-.115?u:a).invert(t)},c.stream=function(n){return t&&e===n?t:(r=[a.stream(e=n),s.stream(n),u.stream(n)],i=r.length,t={point:function(t,e){for(var n=-1;++n<i;)r[n].point(t,e)},sphere:function(){for(var t=-1;++t<i;)r[t].sphere()},lineStart:function(){for(var t=-1;++t<i;)r[t].lineStart()},lineEnd:function(){for(var t=-1;++t<i;)r[t].lineEnd()},polygonStart:function(){for(var t=-1;++t<i;)r[t].polygonStart()},polygonEnd:function(){for(var t=-1;++t<i;)r[t].polygonEnd()}});var r,i},c.precision=function(t){return arguments.length?(a.precision(t),s.precision(t),u.precision(t),f()):a.precision()},c.scale=function(t){return arguments.length?(a.scale(t),s.scale(.35*t),u.scale(t),c.translate(a.translate())):a.scale()},c.translate=function(t){if(!arguments.length)return a.translate();var e=a.scale(),o=+t[0],c=+t[1];return n=a.translate(t).clipExtent([[o-.455*e,c-.238*e],[o+.455*e,c+.238*e]]).stream(l),r=s.translate([o-.307*e,c+.201*e]).clipExtent([[o-.425*e+1e-6,c+.12*e+1e-6],[o-.214*e-1e-6,c+.234*e-1e-6]]).stream(l),i=u.translate([o-.205*e,c+.212*e]).clipExtent([[o-.214*e+1e-6,c+.166*e+1e-6],[o-.115*e-1e-6,c+.234*e-1e-6]]).stream(l),f()},c.fitExtent=function(t,e){return cm(c,t,e)},c.fitSize=function(t,e){return fm(c,t,e)},c.fitWidth=function(t,e){return dm(c,t,e)},c.fitHeight=function(t,e){return hm(c,t,e)},c.scale(1070)},azimuthalequalarea:function(){return ym(Em).scale(124.75).clipAngle(179.999)},azimuthalequidistant:function(){return ym(Am).scale(79.4188).clipAngle(179.999)},conicconformal:function(){return xm(Cm).scale(109.5).parallels([30,30])},conicequalarea:Om,conicequidistant:function(){return xm(zm).scale(131.154).center([0,13.9389])},equalEarth:function(){return ym(Bm).scale(177.158)},equirectangular:function(){return ym(Fm).scale(152.63)},gnomonic:function(){return ym(Lm).scale(144.049).clipAngle(60)},identity:function(){var t,e,n,r,i,o,a,s=1,u=0,l=0,c=1,f=1,d=0,h=null,p=1,g=1,m=sm({point:function(t,e){var n=v([t,e]);this.stream.point(n[0],n[1])}}),b=np;function y(){return p=s*c,g=s*f,o=a=null,v}function v(n){var r=n[0]*p,i=n[1]*g;if(d){var o=i*t-r*e;r=r*t+i*e,i=o}return[r+u,i+l]}return v.invert=function(n){var r=n[0]-u,i=n[1]-l;if(d){var o=i*t+r*e;r=r*t-i*e,i=o}return[r/p,i/g]},v.stream=function(t){return o&&a===t?o:o=m(b(a=t))},v.postclip=function(t){return arguments.length?(b=t,h=n=r=i=null,y()):b},v.clipExtent=function(t){return arguments.length?(b=null==t?(h=n=r=i=null,np):am(h=+t[0][0],n=+t[0][1],r=+t[1][0],i=+t[1][1]),y()):null==h?null:[[h,n],[r,i]]},v.scale=function(t){return arguments.length?(s=+t,y()):s},v.translate=function(t){return arguments.length?(u=+t[0],l=+t[1],y()):[u,l]},v.angle=function(n){return arguments.length?(e=kp(d=n%360*gp),t=vp(d),y()):d*pp},v.reflectX=function(t){return arguments.length?(c=t?-1:1,y()):c<0},v.reflectY=function(t){return arguments.length?(f=t?-1:1,y()):f<0},v.fitExtent=function(t,e){return cm(v,t,e)},v.fitSize=function(t,e){return fm(v,t,e)},v.fitWidth=function(t,e){return dm(v,t,e)},v.fitHeight=function(t,e){return hm(v,t,e)},v},mercator:function(){return Mm(Dm).scale(961/hp)},mollweide:function(){return ym(tb).scale(169.529)},naturalEarth1:function(){return ym(Im).scale(175.295)},orthographic:function(){return ym(Um).scale(249.5).clipAngle(90.000001)},stereographic:function(){return ym(qm).scale(250).clipAngle(142)},transversemercator:function(){var t=Mm(Wm),e=t.center,n=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?n([t[0],t[1],t.length>2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)}};for(const t in ab)ib(t,ab[t]);function sb(t,e,n){var r=We(t,e-1e-6,n).concat(e);return function(t){return r.map((function(e){return[t,e]}))}}function ub(t,e,n){var r=We(t,e-1e-6,n).concat(e);return function(t){return r.map((function(e){return[e,t]}))}}function lb(){var t,e,n,r,i,o,a,s,u,l,c,f,d=10,h=d,p=90,g=360,m=2.5;function b(){return{type:"MultiLineString",coordinates:y()}}function y(){return We(xp(r/p)*p,n,p).map(c).concat(We(xp(s/g)*g,a,g).map(f)).concat(We(xp(e/d)*d,t,d).filter((function(t){return mp(t%p)>1e-6})).map(u)).concat(We(xp(o/h)*h,i,h).filter((function(t){return mp(t%g)>1e-6})).map(l))}return b.lines=function(){return y().map((function(t){return{type:"LineString",coordinates:t}}))},b.outline=function(){return{type:"Polygon",coordinates:[c(r).concat(f(a).slice(1),c(n).reverse().slice(1),f(s).reverse().slice(1))]}},b.extent=function(t){return arguments.length?b.extentMajor(t).extentMinor(t):b.extentMinor()},b.extentMajor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],s=+t[0][1],a=+t[1][1],r>n&&(t=r,r=n,n=t),s>a&&(t=s,s=a,a=t),b.precision(m)):[[r,s],[n,a]]},b.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],o=+n[0][1],i=+n[1][1],e>t&&(n=e,e=t,t=n),o>i&&(n=o,o=i,i=n),b.precision(m)):[[e,o],[t,i]]},b.step=function(t){return arguments.length?b.stepMajor(t).stepMinor(t):b.stepMinor()},b.stepMajor=function(t){return arguments.length?(p=+t[0],g=+t[1],b):[p,g]},b.stepMinor=function(t){return arguments.length?(d=+t[0],h=+t[1],b):[d,h]},b.precision=function(d){return arguments.length?(m=+d,u=sb(o,i,90),l=ub(e,t,m),c=sb(s,a,90),f=ub(r,n,m),b):m},b.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}function cb(){}const fb=[[],[[[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]]],[]];function db(){var t=1,e=1,n=a;function r(t,e){return e.map(e=>i(t,e))}function i(r,i){var a=[],s=[];return function(n,r,i){var a,s,u,l,c,f,d=new Array,h=new Array;a=s=-1,l=n[0]>=r,fb[l<<1].forEach(p);for(;++a<t-1;)u=l,l=n[a+1]>=r,fb[u|l<<1].forEach(p);fb[l<<0].forEach(p);for(;++s<e-1;){for(a=-1,l=n[s*t+t]>=r,c=n[s*t]>=r,fb[l<<1|c<<2].forEach(p);++a<t-1;)u=l,l=n[s*t+t+a+1]>=r,f=c,c=n[s*t+a+1]>=r,fb[u|l<<1|c<<2|f<<3].forEach(p);fb[l|c<<3].forEach(p)}a=-1,c=n[s*t]>=r,fb[c<<2].forEach(p);for(;++a<t-1;)f=c,c=n[s*t+a+1]>=r,fb[c<<2|f<<3].forEach(p);function p(t){var e,n,r=[t[0][0]+a,t[0][1]+s],u=[t[1][0]+a,t[1][1]+s],l=o(r),c=o(u);(e=h[l])?(n=d[c])?(delete h[e.end],delete d[n.start],e===n?(e.ring.push(u),i(e.ring)):d[e.start]=h[n.end]={start:e.start,end:n.end,ring:e.ring.concat(n.ring)}):(delete h[e.end],e.ring.push(u),h[e.end=c]=e):(e=d[c])?(n=h[l])?(delete d[e.start],delete h[n.end],e===n?(e.ring.push(u),i(e.ring)):d[n.start]=h[e.end]={start:n.start,end:e.end,ring:n.ring.concat(e.ring)}):(delete d[e.start],e.ring.unshift(r),d[e.start=l]=e):d[l]=h[c]={start:l,end:c,ring:[r,u]}}fb[c<<3].forEach(p)}(r,i,t=>{n(t,r,i),function(t){var e=0,n=t.length,r=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];for(;++e<n;)r+=t[e-1][1]*t[e][0]-t[e-1][0]*t[e][1];return r}(t)>0?a.push([t]):s.push(t)}),s.forEach(t=>{for(var e,n=0,r=a.length;n<r;++n)if(-1!==hb((e=a[n])[0],t))return void e.push(t)}),{type:"MultiPolygon",value:i,coordinates:a}}function o(e){return 2*e[0]+e[1]*(t+1)*4}function a(n,r,i){n.forEach(n=>{var o,a=n[0],s=n[1],u=0|a,l=0|s,c=r[l*t+u];a>0&&a<t&&u===a&&(o=r[l*t+u-1],n[0]=a+(i-o)/(c-o)-.5),s>0&&s<e&&l===s&&(o=r[(l-1)*t+u],n[1]=s+(i-o)/(c-o)-.5)})}return r.contour=i,r.size=function(n){if(!arguments.length)return[t,e];var i=Math.floor(n[0]),o=Math.floor(n[1]);return i>=0&&o>=0||Object(Z.o)("invalid size"),t=i,e=o,r},r.smooth=function(t){return arguments.length?(n=t?a:cb,r):n===a},r}function hb(t,e){for(var n,r=-1,i=e.length;++r<i;)if(n=pb(t,e[r]))return n;return 0}function pb(t,e){for(var n=e[0],r=e[1],i=-1,o=0,a=t.length,s=a-1;o<a;s=o++){var u=t[o],l=u[0],c=u[1],f=t[s],d=f[0],h=f[1];if(gb(u,f,e))return 0;c>r!=h>r&&n<(d-l)*(r-c)/(h-c)+l&&(i=-i)}return i}function gb(t,e,n){var r,i,o,a;return function(t,e,n){return(e[0]-t[0])*(n[1]-t[1])==(n[0]-t[0])*(e[1]-t[1])}(t,e,n)&&(i=t[r=+(t[0]===e[0])],o=n[r],a=e[r],i<=o&&o<=a||a<=o&&o<=i)}function mb(t,e,n){return function(r){var i=Object(Z.q)(r),o=n?Math.min(i[0],0):i[0],a=i[1],s=a-o,u=e?Object(Ii.c)(o,a,t):s/(t+1);return We(u,a,u)}}function bb(t){Pt.call(this,null,t)}function yb(t,e,n,r,i){const o=t.x1||0,a=t.y1||0,s=e*n<0;function u(t){t.forEach(l)}function l(t){s&&t.reverse(),t.forEach(c)}function c(t){t[0]=(t[0]-o)*e+r,t[1]=(t[1]-a)*n+i}return function(t){return t.coordinates.forEach(u),t}}function vb(t,e,n){const r=t>=0?t:Qt(e,n);return Math.round((Math.sqrt(4*r*r+1)-1)/2)}function xb(t){return Object(Z.E)(t)?t:Object(Z.m)(+t)}function _b(){var t=t=>t[0],e=t=>t[1],n=Z.P,r=[-1,-1],i=960,o=500,a=2;function s(s,u){const l=vb(r[0],s,t)>>a,c=vb(r[1],s,e)>>a,f=l?l+2:0,d=c?c+2:0,h=2*f+(i>>a),p=2*d+(o>>a),g=new Float32Array(h*p),m=new Float32Array(h*p);let b=g;s.forEach(r=>{const i=f+(+t(r)>>a),o=d+(+e(r)>>a);i>=0&&i<h&&o>=0&&o<p&&(g[i+o*h]+=+n(r))}),l>0&&c>0?(Ob(h,p,g,m,l),wb(h,p,m,g,c),Ob(h,p,g,m,l),wb(h,p,m,g,c),Ob(h,p,g,m,l),wb(h,p,m,g,c)):l>0?(Ob(h,p,g,m,l),Ob(h,p,m,g,l),Ob(h,p,g,m,l),b=m):c>0&&(wb(h,p,g,m,c),wb(h,p,m,g,c),wb(h,p,g,m,c),b=m);const y=u?Math.pow(2,-2*a):1/Dh(b);for(let t=0,e=h*p;t<e;++t)b[t]*=y;return{values:b,scale:1<<a,width:h,height:p,x1:f,y1:d,x2:f+(i>>a),y2:d+(o>>a)}}return s.x=function(e){return arguments.length?(t=xb(e),s):t},s.y=function(t){return arguments.length?(e=xb(t),s):e},s.weight=function(t){return arguments.length?(n=xb(t),s):n},s.size=function(t){if(!arguments.length)return[i,o];var e=+t[0],n=+t[1];return e>=0&&n>=0||Object(Z.o)("invalid size"),i=e,o=n,s},s.cellSize=function(t){return arguments.length?((t=+t)>=1||Object(Z.o)("invalid cell size"),a=Math.floor(Math.log(t)/Math.LN2),s):1<<a},s.bandwidth=function(t){return arguments.length?(1===(t=Object(Z.i)(t)).length&&(t=[+t[0],+t[0]]),2!==t.length&&Object(Z.o)("invalid bandwidth"),r=t,s):r},s}function Ob(t,e,n,r,i){const o=1+(i<<1);for(let a=0;a<e;++a)for(let e=0,s=0;e<t+i;++e)e<t&&(s+=n[e+a*t]),e>=i&&(e>=o&&(s-=n[e-o+a*t]),r[e-i+a*t]=s/Math.min(e+1,t-1+o-e,o))}function wb(t,e,n,r,i){const o=1+(i<<1);for(let a=0;a<t;++a)for(let s=0,u=0;s<e+i;++s)s<e&&(u+=n[a+s*t]),s>=i&&(s>=o&&(u-=n[a+(s-o)*t]),r[a+(s-i)*t]=u/Math.min(s+1,e-1+o-s,o))}function jb(t){Pt.call(this,null,t)}bb.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]},Object(Z.z)(bb,Pt,{transform(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=e.materialize(e.SOURCE).source,i=t.field||Z.y,o=db().smooth(!1!==t.smooth),a=t.thresholds||function(t,e,n){const r=mb(n.levels||10,n.nice,!1!==n.zero);return"shared"!==n.resolve?r:r(t.map(t=>qt(e(t).values)))}(r,i,t),s=null===t.as?null:t.as||"contour",u=[];return r.forEach(e=>{const n=i(e),r=o.size([n.width,n.height])(n.values,Object(Z.B)(a)?a:a(n.values));!function(t,e,n,r){let i=r.scale||e.scale,o=r.translate||e.translate;Object(Z.E)(i)&&(i=i(n,r));Object(Z.E)(o)&&(o=o(n,r));if((1===i||null==i)&&!o)return;const a=(Object(Z.F)(i)?i:i[0])||1,s=(Object(Z.F)(i)?i:i[1])||1,u=o&&o[0]||0,l=o&&o[1]||0;t.forEach(yb(e,a,s,u,l))}(r,n,e,t),r.forEach(t=>{u.push(ct(e,ut(null!=s?{[s]:t}:t)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}}),jb.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};const kb=["x","y","weight","size","cellSize","bandwidth"];function Eb(t,e){return kb.forEach(n=>null!=e[n]?t[n](e[n]):0),t}function Ab(t){Pt.call(this,null,t)}Object(Z.z)(jb,Pt,{transform(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n,r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=function(t,e){var n,r,i,o,a,s,u=[],l=t=>t(o);if(null==e)u.push(t);else for(n={},r=0,i=t.length;r<i;++r)o=t[r],a=e.map(l),(s=n[a])||(n[a]=s=[],s.dims=a,u.push(s)),s.push(o);return u}(e.materialize(e.SOURCE).source,t.groupby),o=(t.groupby||[]).map(Z.h),a=Eb(_b(),t),s=t.as||"grid";return n=i.map(e=>ut(function(t,e){for(let n=0;n<o.length;++n)t[o[n]]=e[n];return t}({[s]:a(e,t.counts)},e.dims))),this.value&&(r.rem=this.value),this.value=r.source=r.add=n,r}}),Ab.Definition={type:"Contour",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"values",type:"number",array:!0},{name:"x",type:"field"},{name:"y",type:"field"},{name:"weight",type:"field"},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number"},{name:"count",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"thresholds",type:"number",array:!0},{name:"smooth",type:"boolean",default:!0}]},Object(Z.z)(Ab,Pt,{transform(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n,r,i=e.fork(e.NO_SOURCE|e.NO_FIELDS),o=db().smooth(!1!==t.smooth),a=t.values,s=t.thresholds||mb(t.count||10,t.nice,!!a),u=t.size;return a||(a=e.materialize(e.SOURCE).source,r=yb(n=Eb(_b(),t)(a,!0),n.scale||1,n.scale||1,0,0),u=[n.width,n.height],a=n.values),s=Object(Z.B)(s)?s:s(a),a=o.size(u)(a,s),r&&a.forEach(r),this.value&&(i.rem=this.value),this.value=i.source=i.add=(a||[]).map(ut),i}});function Db(t){Pt.call(this,null,t)}function Mb(t){Pt.call(this,null,t)}function Sb(t){Pt.call(this,null,t)}function Cb(t){Pt.call(this,null,t)}function Fb(t){Pt.call(this,[],t),this.generator=lb()}function zb(t){Pt.call(this,null,t)}function Tb(t){if(!Object(Z.E)(t))return!1;const e=Object(Z.eb)(Object(Z.g)(t));return e.$x||e.$y||e.$value||e.$max}function $b(t){Pt.call(this,null,t),this.modified(!0)}function Nb(t,e,n){Object(Z.E)(t[e])&&t[e](n)}Db.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]},Object(Z.z)(Db,Pt,{transform(t,e){var n,r=this._features,i=this._points,o=t.fields,a=o&&o[0],s=o&&o[1],u=t.geojson||!o&&Z.y,l=e.ADD;n=t.modified()||e.changed(e.REM)||e.modified(Object(Z.g)(u))||a&&e.modified(Object(Z.g)(a))||s&&e.modified(Object(Z.g)(s)),this.value&&!n||(l=e.SOURCE,this._features=r=[],this._points=i=[]),u&&e.visit(l,t=>r.push(u(t))),a&&s&&(e.visit(l,t=>{var e=a(t),n=s(t);null!=e&&null!=n&&(e=+e)===e&&(n=+n)===n&&i.push([e,n])}),r=r.concat({type:"Feature",geometry:{type:"MultiPoint",coordinates:i}})),this.value={type:"FeatureCollection",features:r}}}),Mb.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]},Object(Z.z)(Mb,Pt,{transform(t,e){var n=e.fork(e.ALL),r=this.value,i=t.field||Z.y,o=t.as||"path",a=n.SOURCE;!r||t.modified()?(this.value=r=ob(t.projection),n.materialize().reflow()):a=i===Z.y||e.modified(i.fields)?n.ADD_MOD:n.ADD;const s=function(t,e){const n=t.pointRadius();t.context(null),null!=e&&t.pointRadius(e);return n}(r,t.pointRadius);return n.visit(a,t=>t[o]=r(i(t))),r.pointRadius(s),n.modifies(o)}}),Sb.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]},Object(Z.z)(Sb,Pt,{transform(t,e){var n,r=t.projection,i=t.fields[0],o=t.fields[1],a=t.as||["x","y"],s=a[0],u=a[1];function l(t){const e=r([i(t),o(t)]);e?(t[s]=e[0],t[u]=e[1]):(t[s]=void 0,t[u]=void 0)}return t.modified()?e=e.materialize().reflow(!0).visit(e.SOURCE,l):(n=e.modified(i.fields)||e.modified(o.fields),e.visit(n?e.ADD_MOD:e.ADD,l)),e.modifies(a)}}),Cb.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]},Object(Z.z)(Cb,Pt,{transform(t,e){var n=e.fork(e.ALL),r=this.value,i=t.as||"shape",o=n.ADD;return r&&!t.modified()||(this.value=r=function(t,e,n){const r=null==n?n=>t(e(n)):r=>{var i=t.pointRadius(),o=t.pointRadius(n)(e(r));return t.pointRadius(i),o};return r.context=e=>(t.context(e),r),r}(ob(t.projection),t.field||Object(Z.u)("datum"),t.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,t=>t[i]=r),n.modifies(i)}}),Fb.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]},Object(Z.z)(Fb,Pt,{transform(t,e){var n,r=this.value,i=this.generator;if(!r.length||t.modified())for(const e in t)Object(Z.E)(i[e])&&i[e](t[e]);return n=i(),r.length?e.mod.push(ft(r[0],n)):e.add.push(ut(n)),r[0]=n,e}}),zb.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]},Object(Z.z)(zb,Pt,{transform(t,e){if(!e.changed()&&!t.modified())return e.StopPropagation;var n=e.materialize(e.SOURCE).source,r="shared"===t.resolve,i=t.field||Z.y,o=function(t,e){let n;Object(Z.E)(t)?(n=n=>t(n,e),n.dep=Tb(t)):t?n=Object(Z.m)(t):(n=t=>t.$value/t.$max||0,n.dep=!0);return n}(t.opacity,t),a=function(t,e){let n;Object(Z.E)(t)?(n=n=>go(t(n,e)),n.dep=Tb(t)):n=Object(Z.m)(go(t||"#888"));return n}(t.color,t),s=t.as||"image",u={$x:0,$y:0,$value:0,$max:r?qt(n.map(t=>qt(i(t).values))):0};return n.forEach(t=>{const e=i(t),n=Object(Z.p)({},t,u);r||(n.$max=qt(e.values||[])),t[s]=function(t,e,n,r){const i=t.width,o=t.height,a=t.x1||0,s=t.y1||0,u=t.x2||i,l=t.y2||o,c=t.values,f=c?t=>c[t]:Z.lb,d=Ci(u-a,l-s),h=d.getContext("2d"),p=h.getImageData(0,0,u-a,l-s),g=p.data;for(let t=s,o=0;t<l;++t){e.$y=t-s;for(let s=a,l=t*i;s<u;++s,o+=4){e.$x=s-a,e.$value=f(s+l);const t=n(e);g[o+0]=t.r,g[o+1]=t.g,g[o+2]=t.b,g[o+3]=~~(255*r(e))}}return h.putImageData(p,0,0),d}(e,n,a.dep?a:Object(Z.m)(a(n)),o.dep?o:Object(Z.m)(o(n)))}),e.reflow(!0).modifies(s)}}),Object(Z.z)($b,Pt,{transform(t,e){let n=this.value;return!n||t.modified("type")?(this.value=n=function(t){const e=ib((t||"mercator").toLowerCase());e||Object(Z.o)("Unrecognized projection type: "+t);return e()}(t.type),nb.forEach(e=>{null!=t[e]&&Nb(n,e,t[e])})):nb.forEach(e=>{t.modified(e)&&Nb(n,e,t[e])}),null!=t.pointRadius&&n.path.pointRadius(t.pointRadius),t.fit&&function(t,e){const n=function(t){return 1===(t=Object(Z.i)(t)).length?t[0]:{type:"FeatureCollection",features:t.reduce((t,e)=>t.concat(function(t){return"FeatureCollection"===t.type?t.features:Object(Z.i)(t).filter(t=>null!=t).map(t=>"Feature"===t.type?t:{type:"Feature",geometry:t})}(e)),[])}}(e.fit);e.extent?t.fitExtent(e.extent,n):e.size&&t.fitSize(e.size,n)}(n,t),e.fork(e.NO_SOURCE|e.NO_FIELDS)}});function Rb(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,o,a,s,u,l,c,f,d,h=t._root,p={data:r},g=t._x0,m=t._y0,b=t._x1,y=t._y1;if(!h)return t._root=p,t;for(;h.length;)if((l=e>=(o=(g+b)/2))?g=o:b=o,(c=n>=(a=(m+y)/2))?m=a:y=a,i=h,!(h=h[f=c<<1|l]))return i[f]=p,t;if(s=+t._x.call(null,h.data),u=+t._y.call(null,h.data),e===s&&n===u)return p.next=h,i?i[f]=p:t._root=p,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(l=e>=(o=(g+b)/2))?g=o:b=o,(c=n>=(a=(m+y)/2))?m=a:y=a}while((f=c<<1|l)==(d=(u>=a)<<1|s>=o));return i[d]=h,i[f]=p,t}var Pb=function(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i};function Bb(t){return t[0]}function Lb(t){return t[1]}function Ib(t,e,n){var r=new Ub(null==e?Bb:e,null==n?Lb:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function Ub(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function qb(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var Wb=Ib.prototype=Ub.prototype;Wb.copy=function(){var t,e,n=new Ub(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=qb(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=qb(e));return n},Wb.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return Rb(this.cover(e,n),e,n,t)},Wb.addAll=function(t){var e,n,r,i,o=t.length,a=new Array(o),s=new Array(o),u=1/0,l=1/0,c=-1/0,f=-1/0;for(n=0;n<o;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(i=+this._y.call(null,e))||(a[n]=r,s[n]=i,r<u&&(u=r),r>c&&(c=r),i<l&&(l=i),i>f&&(f=i));if(u>c||l>f)return this;for(this.cover(u,l).cover(c,f),n=0;n<o;++n)Rb(this,a[n],s[n],t[n]);return this},Wb.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,o=(r=Math.floor(e))+1;else{for(var a,s,u=i-n||1,l=this._root;n>t||t>=i||r>e||e>=o;)switch(s=(e<r)<<1|t<n,(a=new Array(4))[s]=l,l=a,u*=2,s){case 0:i=n+u,o=r+u;break;case 1:n=i-u,o=r+u;break;case 2:i=n+u,r=o-u;break;case 3:n=i-u,r=o-u}this._root&&this._root.length&&(this._root=l)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this},Wb.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},Wb.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},Wb.find=function(t,e,n){var r,i,o,a,s,u,l,c=this._x0,f=this._y0,d=this._x1,h=this._y1,p=[],g=this._root;for(g&&p.push(new Pb(g,c,f,d,h)),null==n?n=1/0:(c=t-n,f=e-n,d=t+n,h=e+n,n*=n);u=p.pop();)if(!(!(g=u.node)||(i=u.x0)>d||(o=u.y0)>h||(a=u.x1)<c||(s=u.y1)<f))if(g.length){var m=(i+a)/2,b=(o+s)/2;p.push(new Pb(g[3],m,b,a,s),new Pb(g[2],i,b,m,s),new Pb(g[1],m,o,a,b),new Pb(g[0],i,o,m,b)),(l=(e>=b)<<1|t>=m)&&(u=p[p.length-1],p[p.length-1]=p[p.length-1-l],p[p.length-1-l]=u)}else{var y=t-+this._x.call(null,g.data),v=e-+this._y.call(null,g.data),x=y*y+v*v;if(x<n){var _=Math.sqrt(n=x);c=t-_,f=e-_,d=t+_,h=e+_,r=g.data}}return r},Wb.remove=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t)))return this;var e,n,r,i,o,a,s,u,l,c,f,d,h=this._root,p=this._x0,g=this._y0,m=this._x1,b=this._y1;if(!h)return this;if(h.length)for(;;){if((l=o>=(s=(p+m)/2))?p=s:m=s,(c=a>=(u=(g+b)/2))?g=u:b=u,e=h,!(h=h[f=c<<1|l]))return this;if(!h.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(n=e,d=f)}for(;h.data!==t;)if(r=h,!(h=h.next))return this;return(i=h.next)&&delete h.next,r?(i?r.next=i:delete r.next,this):e?(i?e[f]=i:delete e[f],(h=e[0]||e[1]||e[2]||e[3])&&h===(e[3]||e[2]||e[1]||e[0])&&!h.length&&(n?n[d]=h:this._root=h),this):(this._root=i,this)},Wb.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},Wb.root=function(){return this._root},Wb.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},Wb.visit=function(t){var e,n,r,i,o,a,s=[],u=this._root;for(u&&s.push(new Pb(u,this._x0,this._y0,this._x1,this._y1));e=s.pop();)if(!t(u=e.node,r=e.x0,i=e.y0,o=e.x1,a=e.y1)&&u.length){var l=(r+o)/2,c=(i+a)/2;(n=u[3])&&s.push(new Pb(n,l,c,o,a)),(n=u[2])&&s.push(new Pb(n,r,c,l,a)),(n=u[1])&&s.push(new Pb(n,l,i,o,c)),(n=u[0])&&s.push(new Pb(n,r,i,l,c))}return this},Wb.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new Pb(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i=e.node;if(i.length){var o,a=e.x0,s=e.y0,u=e.x1,l=e.y1,c=(a+u)/2,f=(s+l)/2;(o=i[0])&&n.push(new Pb(o,a,s,c,f)),(o=i[1])&&n.push(new Pb(o,c,s,u,f)),(o=i[2])&&n.push(new Pb(o,a,f,c,l)),(o=i[3])&&n.push(new Pb(o,c,f,u,l))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},Wb.x=function(t){return arguments.length?(this._x=t,this):this._x},Wb.y=function(t){return arguments.length?(this._y=t,this):this._y};var Yb=function(t){return function(){return t}},Hb=function(t){return 1e-6*(t()-.5)};function Gb(t){return t.x+t.vx}function Vb(t){return t.y+t.vy}var Xb={value:()=>{}};function Jb(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new Kb(r)}function Kb(t){this._=t}function Zb(t,e){return t.trim().split(/^|\s+/).map((function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function Qb(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function ty(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=Xb,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}Kb.prototype=Jb.prototype={constructor:Kb,on:function(t,e){var n,r=this._,i=Zb(t+"",r),o=-1,a=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<a;)if(n=(t=i[o]).type)r[n]=ty(r[n],t.name,e);else if(null==e)for(n in r)r[n]=ty(r[n],t.name,null);return this}for(;++o<a;)if((n=(t=i[o]).type)&&(n=Qb(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Kb(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(r=this._[t]).length;o<n;++o)r[o].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};var ey,ny,ry=Jb,iy=0,oy=0,ay=0,sy=0,uy=0,ly=0,cy="object"==typeof performance&&performance.now?performance:Date,fy="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function dy(){return uy||(fy(hy),uy=cy.now()+ly)}function hy(){uy=0}function py(){this._call=this._time=this._next=null}function gy(t,e,n){var r=new py;return r.restart(t,e,n),r}function my(){uy=(sy=cy.now())+ly,iy=oy=0;try{!function(){dy(),++iy;for(var t,e=ey;e;)(t=uy-e._time)>=0&&e._call.call(null,t),e=e._next;--iy}()}finally{iy=0,function(){var t,e,n=ey,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:ey=e);ny=t,yy(r)}(),uy=0}}function by(){var t=cy.now(),e=t-sy;e>1e3&&(ly-=e,sy=t)}function yy(t){iy||(oy&&(oy=clearTimeout(oy)),t-uy>24?(t<1/0&&(oy=setTimeout(my,t-cy.now()-ly)),ay&&(ay=clearInterval(ay))):(ay||(sy=cy.now(),ay=setInterval(by,1e3)),iy=1,fy(my)))}py.prototype=gy.prototype={constructor:py,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?dy():+n)+(null==e?0:+e),this._next||ny===this||(ny?ny._next=this:ey=this,ny=this),this._call=t,this._time=n,yy()},stop:function(){this._call&&(this._call=null,this._time=1/0,yy())}};function vy(t){return t.x}function xy(t){return t.y}var _y=Math.PI*(3-Math.sqrt(5));function Oy(t){return t.index}function wy(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}const jy={center:function(t,e){var n,r=1;function i(){var i,o,a=n.length,s=0,u=0;for(i=0;i<a;++i)s+=(o=n[i]).x,u+=o.y;for(s=(s/a-t)*r,u=(u/a-e)*r,i=0;i<a;++i)(o=n[i]).x-=s,o.y-=u}return null==t&&(t=0),null==e&&(e=0),i.initialize=function(t){n=t},i.x=function(e){return arguments.length?(t=+e,i):t},i.y=function(t){return arguments.length?(e=+t,i):e},i.strength=function(t){return arguments.length?(r=+t,i):r},i},collide:function(t){var e,n,r,i=1,o=1;function a(){for(var t,a,u,l,c,f,d,h=e.length,p=0;p<o;++p)for(a=Ib(e,Gb,Vb).visitAfter(s),t=0;t<h;++t)u=e[t],f=n[u.index],d=f*f,l=u.x+u.vx,c=u.y+u.vy,a.visit(g);function g(t,e,n,o,a){var s=t.data,h=t.r,p=f+h;if(!s)return e>l+p||o<l-p||n>c+p||a<c-p;if(s.index>u.index){var g=l-s.x-s.vx,m=c-s.y-s.vy,b=g*g+m*m;b<p*p&&(0===g&&(b+=(g=Hb(r))*g),0===m&&(b+=(m=Hb(r))*m),b=(p-(b=Math.sqrt(b)))/b*i,u.vx+=(g*=b)*(p=(h*=h)/(d+h)),u.vy+=(m*=b)*p,s.vx-=g*(p=1-p),s.vy-=m*p)}}}function s(t){if(t.data)return t.r=n[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function u(){if(e){var r,i,o=e.length;for(n=new Array(o),r=0;r<o;++r)i=e[r],n[i.index]=+t(i,r,e)}}return"function"!=typeof t&&(t=Yb(null==t?1:+t)),a.initialize=function(t,n){e=t,r=n,u()},a.iterations=function(t){return arguments.length?(o=+t,a):o},a.strength=function(t){return arguments.length?(i=+t,a):i},a.radius=function(e){return arguments.length?(t="function"==typeof e?e:Yb(+e),u(),a):t},a},nbody:function(){var t,e,n,r,i,o=Yb(-30),a=1,s=1/0,u=.81;function l(n){var i,o=t.length,a=Ib(t,vy,xy).visitAfter(f);for(r=n,i=0;i<o;++i)e=t[i],a.visit(d)}function c(){if(t){var e,n,r=t.length;for(i=new Array(r),e=0;e<r;++e)n=t[e],i[n.index]=+o(n,e,t)}}function f(t){var e,n,r,o,a,s=0,u=0;if(t.length){for(r=o=a=0;a<4;++a)(e=t[a])&&(n=Math.abs(e.value))&&(s+=e.value,u+=n,r+=n*e.x,o+=n*e.y);t.x=r/u,t.y=o/u}else{(e=t).x=e.data.x,e.y=e.data.y;do{s+=i[e.data.index]}while(e=e.next)}t.value=s}function d(t,o,l,c){if(!t.value)return!0;var f=t.x-e.x,d=t.y-e.y,h=c-o,p=f*f+d*d;if(h*h/u<p)return p<s&&(0===f&&(p+=(f=Hb(n))*f),0===d&&(p+=(d=Hb(n))*d),p<a&&(p=Math.sqrt(a*p)),e.vx+=f*t.value*r/p,e.vy+=d*t.value*r/p),!0;if(!(t.length||p>=s)){(t.data!==e||t.next)&&(0===f&&(p+=(f=Hb(n))*f),0===d&&(p+=(d=Hb(n))*d),p<a&&(p=Math.sqrt(a*p)));do{t.data!==e&&(h=i[t.data.index]*r/p,e.vx+=f*h,e.vy+=d*h)}while(t=t.next)}}return l.initialize=function(e,r){t=e,n=r,c()},l.strength=function(t){return arguments.length?(o="function"==typeof t?t:Yb(+t),c(),l):o},l.distanceMin=function(t){return arguments.length?(a=t*t,l):Math.sqrt(a)},l.distanceMax=function(t){return arguments.length?(s=t*t,l):Math.sqrt(s)},l.theta=function(t){return arguments.length?(u=t*t,l):Math.sqrt(u)},l},link:function(t){var e,n,r,i,o,a,s=Oy,u=function(t){return 1/Math.min(i[t.source.index],i[t.target.index])},l=Yb(30),c=1;function f(r){for(var i=0,s=t.length;i<c;++i)for(var u,l,f,d,h,p,g,m=0;m<s;++m)l=(u=t[m]).source,d=(f=u.target).x+f.vx-l.x-l.vx||Hb(a),h=f.y+f.vy-l.y-l.vy||Hb(a),d*=p=((p=Math.sqrt(d*d+h*h))-n[m])/p*r*e[m],h*=p,f.vx-=d*(g=o[m]),f.vy-=h*g,l.vx+=d*(g=1-g),l.vy+=h*g}function d(){if(r){var a,u,l=r.length,c=t.length,f=new Map(r.map((t,e)=>[s(t,e,r),t]));for(a=0,i=new Array(l);a<c;++a)(u=t[a]).index=a,"object"!=typeof u.source&&(u.source=wy(f,u.source)),"object"!=typeof u.target&&(u.target=wy(f,u.target)),i[u.source.index]=(i[u.source.index]||0)+1,i[u.target.index]=(i[u.target.index]||0)+1;for(a=0,o=new Array(c);a<c;++a)u=t[a],o[a]=i[u.source.index]/(i[u.source.index]+i[u.target.index]);e=new Array(c),h(),n=new Array(c),p()}}function h(){if(r)for(var n=0,i=t.length;n<i;++n)e[n]=+u(t[n],n,t)}function p(){if(r)for(var e=0,i=t.length;e<i;++e)n[e]=+l(t[e],e,t)}return null==t&&(t=[]),f.initialize=function(t,e){r=t,a=e,d()},f.links=function(e){return arguments.length?(t=e,d(),f):t},f.id=function(t){return arguments.length?(s=t,f):s},f.iterations=function(t){return arguments.length?(c=+t,f):c},f.strength=function(t){return arguments.length?(u="function"==typeof t?t:Yb(+t),h(),f):u},f.distance=function(t){return arguments.length?(l="function"==typeof t?t:Yb(+t),p(),f):l},f},x:function(t){var e,n,r,i=Yb(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vx+=(r[o]-i.x)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=Yb(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:Yb(+t),a(),o):i},o.x=function(e){return arguments.length?(t="function"==typeof e?e:Yb(+e),a(),o):t},o},y:function(t){var e,n,r,i=Yb(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vy+=(r[o]-i.y)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=Yb(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:Yb(+t),a(),o):i},o.y=function(e){return arguments.length?(t="function"==typeof e?e:Yb(+e),a(),o):t},o}},ky=["alpha","alphaMin","alphaTarget","velocityDecay","forces"],Ey=["static","iterations"],Ay=["x","y","vx","vy"];function Dy(t){Pt.call(this,null,t)}function My(t,e,n,r){var i,o,a,s,u=Object(Z.i)(e.forces);for(i=0,o=ky.length;i<o;++i)"forces"!==(a=ky[i])&&e.modified(a)&&t[a](e[a]);for(i=0,o=u.length;i<o;++i)s="forces"+i,(a=n||e.modified("forces",i)?Cy(u[i]):r&&Sy(u[i],r)?t.force(s):null)&&t.force(s,a);for(o=t.numForces||0;i<o;++i)t.force("forces"+i,null);return t.numForces=u.length,t}function Sy(t,e){var n,r;for(n in t)if(Object(Z.E)(r=t[n])&&e.modified(Object(Z.g)(r)))return 1;return 0}function Cy(t){var e,n;for(n in Object(Z.w)(jy,t.force)||Object(Z.o)("Unrecognized force: "+t.force),e=jy[t.force](),t)Object(Z.E)(e[n])&&Fy(e[n],t[n],t);return e}function Fy(t,e,n){t(Object(Z.E)(e)?t=>e(t,n):e)}function zy(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}Dy.Definition={type:"Force",metadata:{modifies:!0},params:[{name:"static",type:"boolean",default:!1},{name:"restart",type:"boolean",default:!1},{name:"iterations",type:"number",default:300},{name:"alpha",type:"number",default:1},{name:"alphaMin",type:"number",default:.001},{name:"alphaTarget",type:"number",default:0},{name:"velocityDecay",type:"number",default:.4},{name:"forces",type:"param",array:!0,params:[{key:{force:"center"},params:[{name:"x",type:"number",default:0},{name:"y",type:"number",default:0}]},{key:{force:"collide"},params:[{name:"radius",type:"number",expr:!0},{name:"strength",type:"number",default:.7},{name:"iterations",type:"number",default:1}]},{key:{force:"nbody"},params:[{name:"strength",type:"number",default:-30},{name:"theta",type:"number",default:.9},{name:"distanceMin",type:"number",default:1},{name:"distanceMax",type:"number"}]},{key:{force:"link"},params:[{name:"links",type:"data"},{name:"id",type:"field"},{name:"distance",type:"number",default:30,expr:!0},{name:"strength",type:"number",expr:!0},{name:"iterations",type:"number",default:1}]},{key:{force:"x"},params:[{name:"strength",type:"number",default:.1},{name:"x",type:"field"}]},{key:{force:"y"},params:[{name:"strength",type:"number",default:.1},{name:"y",type:"field"}]}]},{name:"as",type:"string",array:!0,modify:!1,default:Ay}]},Object(Z.z)(Dy,Pt,{transform(t,e){var n,r,i=this.value,o=e.changed(e.ADD_REM),a=t.modified(ky),s=t.iterations||300;if(i?(o&&(e.modifies("index"),i.nodes(e.source)),(a||e.changed(e.MOD))&&My(i,t,0,e)):(this.value=i=function(t,e){const n=function(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,s=new Map,u=gy(f),l=ry("tick","end"),c=function(){let t=1;return()=>(t=(1664525*t+1013904223)%4294967296)/4294967296}();function f(){d(),l.call("tick",e),n<r&&(u.stop(),l.call("end",e))}function d(r){var u,l,c=t.length;void 0===r&&(r=1);for(var f=0;f<r;++f)for(n+=(o-n)*i,s.forEach((function(t){t(n)})),u=0;u<c;++u)null==(l=t[u]).fx?l.x+=l.vx*=a:(l.x=l.fx,l.vx=0),null==l.fy?l.y+=l.vy*=a:(l.y=l.fy,l.vy=0);return e}function h(){for(var e,n=0,r=t.length;n<r;++n){if((e=t[n]).index=n,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var i=10*Math.sqrt(.5+n),o=n*_y;e.x=i*Math.cos(o),e.y=i*Math.sin(o)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function p(e){return e.initialize&&e.initialize(t,c),e}return null==t&&(t=[]),h(),e={tick:d,restart:function(){return u.restart(f),e},stop:function(){return u.stop(),e},nodes:function(n){return arguments.length?(t=n,h(),s.forEach(p),e):t},alpha:function(t){return arguments.length?(n=+t,e):n},alphaMin:function(t){return arguments.length?(r=+t,e):r},alphaDecay:function(t){return arguments.length?(i=+t,e):+i},alphaTarget:function(t){return arguments.length?(o=+t,e):o},velocityDecay:function(t){return arguments.length?(a=1-t,e):1-a},randomSource:function(t){return arguments.length?(c=t,s.forEach(p),e):c},force:function(t,n){return arguments.length>1?(null==n?s.delete(t):s.set(t,p(n)),e):s.get(t)},find:function(e,n,r){var i,o,a,s,u,l=0,c=t.length;for(null==r?r=1/0:r*=r,l=0;l<c;++l)(a=(i=e-(s=t[l]).x)*i+(o=n-s.y)*o)<r&&(u=s,r=a);return u},on:function(t,n){return arguments.length>1?(l.on(t,n),e):l.on(t)}}}(t),r=n.stop,i=n.restart;let o=!1;return n.stopped=()=>o,n.restart=()=>(o=!1,i()),n.stop=()=>(o=!0,r()),My(n,e,!0).on("end",()=>o=!0)}(e.source,t),i.on("tick",(n=e.dataflow,r=this,()=>n.touch(r).run())),t.static||(o=!0,i.tick()),e.modifies("index")),a||o||t.modified(Ey)||e.changed()&&t.restart)if(i.alpha(Math.max(i.alpha(),t.alpha||1)).alphaDecay(1-Math.pow(i.alphaMin(),1/s)),t.static)for(i.stop();--s>=0;)i.tick();else if(i.stopped()&&i.restart(),!o)return e.StopPropagation;return this.finish(t,e)},finish(t,e){const n=e.dataflow;for(let t,e=this._argops,s=0,u=e.length;s<u;++s)if(t=e[s],"forces"===t.name&&"link"===t.op._argval.force)for(var r,i=t.op._argops,o=0,a=i.length;o<a;++o)if("links"===i[o].name&&(r=i[o].op.source)){n.pulse(r,n.changeset().reflow());break}return e.reflow(t.modified()).modifies(Ay)}});function Ty(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=Ny)):void 0===e&&(e=$y);for(var n,r,i,o,a,s=new By(t),u=[s];n=u.pop();)if((i=e(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)u.push(r=i[o]=new By(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(Py)}function $y(t){return t.children}function Ny(t){return Array.isArray(t)?t[1]:null}function Ry(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function Py(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function By(t){this.data=t,this.depth=this.height=0,this.parent=null}By.prototype=Ty.prototype={constructor:By,count:function(){return this.eachAfter(zy)},each:function(t,e){let n=-1;for(const r of this)t.call(e,r,++n,this);return this},eachAfter:function(t,e){for(var n,r,i,o=this,a=[o],s=[],u=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)t.call(e,o,++u,this);return this},eachBefore:function(t,e){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(t.call(e,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(t,e){let n=-1;for(const r of this)if(t.call(e,r,++n,this))return r},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;t=n.pop(),e=r.pop();for(;t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return Ty(this).eachBefore(Ry)},[Symbol.iterator]:function*(){var t,e,n,r,i=this,o=[i];do{for(t=o.reverse(),o=[];i=t.pop();)if(yield i,e=i.children)for(n=0,r=e.length;n<r;++n)o.push(e[n])}while(o.length)}};var Ly=function(t){for(var e,n,r=0,i=(t=function(t){for(var e,n,r=t.length;r;)n=Math.random()*r--|0,e=t[r],t[r]=t[n],t[n]=e;return t}(Array.from(t))).length,o=[];r<i;)e=t[r],n&&qy(n,e)?++r:(n=Yy(o=Iy(o,e)),r=0);return n};function Iy(t,e){var n,r;if(Wy(e,t))return[e];for(n=0;n<t.length;++n)if(Uy(e,t[n])&&Wy(Hy(t[n],e),t))return[t[n],e];for(n=0;n<t.length-1;++n)for(r=n+1;r<t.length;++r)if(Uy(Hy(t[n],t[r]),e)&&Uy(Hy(t[n],e),t[r])&&Uy(Hy(t[r],e),t[n])&&Wy(Gy(t[n],t[r],e),t))return[t[n],t[r],e];throw new Error}function Uy(t,e){var n=t.r-e.r,r=e.x-t.x,i=e.y-t.y;return n<0||n*n<r*r+i*i}function qy(t,e){var n=t.r-e.r+1e-9*Math.max(t.r,e.r,1),r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function Wy(t,e){for(var n=0;n<e.length;++n)if(!qy(t,e[n]))return!1;return!0}function Yy(t){switch(t.length){case 1:return{x:(e=t[0]).x,y:e.y,r:e.r};case 2:return Hy(t[0],t[1]);case 3:return Gy(t[0],t[1],t[2])}var e}function Hy(t,e){var n=t.x,r=t.y,i=t.r,o=e.x,a=e.y,s=e.r,u=o-n,l=a-r,c=s-i,f=Math.sqrt(u*u+l*l);return{x:(n+o+u/f*c)/2,y:(r+a+l/f*c)/2,r:(f+i+s)/2}}function Gy(t,e,n){var r=t.x,i=t.y,o=t.r,a=e.x,s=e.y,u=e.r,l=n.x,c=n.y,f=n.r,d=r-a,h=r-l,p=i-s,g=i-c,m=u-o,b=f-o,y=r*r+i*i-o*o,v=y-a*a-s*s+u*u,x=y-l*l-c*c+f*f,_=h*p-d*g,O=(p*x-g*v)/(2*_)-r,w=(g*m-p*b)/_,j=(h*v-d*x)/(2*_)-i,k=(d*b-h*m)/_,E=w*w+k*k-1,A=2*(o+O*w+j*k),D=O*O+j*j-o*o,M=-(E?(A+Math.sqrt(A*A-4*E*D))/(2*E):D/A);return{x:r+O+w*M,y:i+j+k*M,r:M}}function Vy(t,e,n){var r,i,o,a,s=t.x-e.x,u=t.y-e.y,l=s*s+u*u;l?(i=e.r+n.r,i*=i,a=t.r+n.r,i>(a*=a)?(r=(l+a-i)/(2*l),o=Math.sqrt(Math.max(0,a/l-r*r)),n.x=t.x-r*s-o*u,n.y=t.y-r*u+o*s):(r=(l+i-a)/(2*l),o=Math.sqrt(Math.max(0,i/l-r*r)),n.x=e.x+r*s-o*u,n.y=e.y+r*u+o*s)):(n.x=e.x+n.r,n.y=e.y)}function Xy(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function Jy(t){var e=t._,n=t.next._,r=e.r+n.r,i=(e.x*n.r+n.x*e.r)/r,o=(e.y*n.r+n.y*e.r)/r;return i*i+o*o}function Ky(t){this._=t,this.next=null,this.previous=null}function Zy(t){if(!(o=(e=t,t="object"==typeof e&&"length"in e?e:Array.from(e)).length))return 0;var e,n,r,i,o,a,s,u,l,c,f,d;if((n=t[0]).x=0,n.y=0,!(o>1))return n.r;if(r=t[1],n.x=-r.r,r.x=n.r,r.y=0,!(o>2))return n.r+r.r;Vy(r,n,i=t[2]),n=new Ky(n),r=new Ky(r),i=new Ky(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(u=3;u<o;++u){Vy(n._,r._,i=t[u]),i=new Ky(i),l=r.next,c=n.previous,f=r._.r,d=n._.r;do{if(f<=d){if(Xy(l._,i._)){r=l,n.next=r,r.previous=n,--u;continue t}f+=l._.r,l=l.next}else{if(Xy(c._,i._)){(n=c).next=r,r.previous=n,--u;continue t}d+=c._.r,c=c.previous}}while(l!==c.next);for(i.previous=n,i.next=r,n.next=r.previous=r=i,a=Jy(n);(i=i.next)!==r;)(s=Jy(i))<a&&(n=i,a=s);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=Ly(n),u=0;u<o;++u)(n=t[u]).x-=i.x,n.y-=i.y;return i.r}function Qy(t){return null==t?null:tv(t)}function tv(t){if("function"!=typeof t)throw new Error;return t}function ev(){return 0}var nv=function(t){return function(){return t}};function rv(t){return Math.sqrt(t.value)}function iv(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function ov(t,e){return function(n){if(r=n.children){var r,i,o,a=r.length,s=t(n)*e||0;if(s)for(i=0;i<a;++i)r[i].r+=s;if(o=Zy(r),s)for(i=0;i<a;++i)r[i].r-=s;n.r=o+s}}}function av(t){return function(e){var n=e.parent;e.r*=t,n&&(e.x=n.x+t*e.x,e.y=n.y+t*e.y)}}var sv=function(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)},uv=function(t,e,n,r,i){for(var o,a=t.children,s=-1,u=a.length,l=t.value&&(r-e)/t.value;++s<u;)(o=a[s]).y0=n,o.y1=i,o.x0=e,o.x1=e+=o.value*l},lv={depth:-1},cv={};function fv(t){return t.id}function dv(t){return t.parentId}var hv=function(){var t=fv,e=dv;function n(n){var r,i,o,a,s,u,l,c=Array.from(n),f=c.length,d=new Map;for(i=0;i<f;++i)r=c[i],s=c[i]=new By(r),null!=(u=t(r,i,n))&&(u+="")&&(l=s.id=u,d.set(l,d.has(l)?cv:s)),null!=(u=e(r,i,n))&&(u+="")&&(s.parent=u);for(i=0;i<f;++i)if(u=(s=c[i]).parent){if(!(a=d.get(u)))throw new Error("missing: "+u);if(a===cv)throw new Error("ambiguous: "+u);a.children?a.children.push(s):a.children=[s],s.parent=a}else{if(o)throw new Error("multiple roots");o=s}if(!o)throw new Error("no root");if(o.parent=lv,o.eachBefore((function(t){t.depth=t.parent.depth+1,--f})).eachBefore(Py),o.parent=null,f>0)throw new Error("cycle");return o}return n.id=function(e){return arguments.length?(t=tv(e),n):t},n.parentId=function(t){return arguments.length?(e=tv(t),n):e},n};function pv(t,e){return t.parent===e.parent?1:2}function gv(t){var e=t.children;return e?e[0]:t.t}function mv(t){var e=t.children;return e?e[e.length-1]:t.t}function bv(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function yv(t,e,n){return t.a.parent===e.parent?t.a:n}function vv(t,e){this._=t,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=e}vv.prototype=Object.create(By.prototype);function xv(t,e){return t.parent===e.parent?1:2}function _v(t,e){return t+e.x}function Ov(t,e){return Math.max(t,e.y)}var wv=function(t,e,n,r,i){for(var o,a=t.children,s=-1,u=a.length,l=t.value&&(i-n)/t.value;++s<u;)(o=a[s]).x0=e,o.x1=r,o.y0=n,o.y1=n+=o.value*l},jv=(1+Math.sqrt(5))/2;function kv(t,e,n,r,i,o){for(var a,s,u,l,c,f,d,h,p,g,m,b=[],y=e.children,v=0,x=0,_=y.length,O=e.value;v<_;){u=i-n,l=o-r;do{c=y[x++].value}while(!c&&x<_);for(f=d=c,m=c*c*(g=Math.max(l/u,u/l)/(O*t)),p=Math.max(d/m,m/f);x<_;++x){if(c+=s=y[x].value,s<f&&(f=s),s>d&&(d=s),m=c*c*g,(h=Math.max(d/m,m/f))>p){c-=s;break}p=h}b.push(a={value:c,dice:u<l,children:y.slice(v,x)}),a.dice?uv(a,n,r,i,O?r+=l*c/O:o):wv(a,n,r,O?n+=u*c/O:i,o),O-=c,v=x}return b}var Ev=function t(e){function n(t,n,r,i,o){kv(e,t,n,r,i,o)}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(jv),Av=function t(e){function n(t,n,r,i,o){if((a=t._squarify)&&a.ratio===e)for(var a,s,u,l,c,f=-1,d=a.length,h=t.value;++f<d;){for(u=(s=a[f]).children,l=s.value=0,c=u.length;l<c;++l)s.value+=u[l].value;s.dice?uv(s,n,r,i,h?r+=(o-r)*s.value/h:o):wv(s,n,r,h?n+=(i-n)*s.value/h:i,o),h-=s.value}else t._squarify=a=kv(e,t,n,r,i,o),a.ratio=e}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(jv);function Dv(t,e,n){const r={};return t.each(t=>{const i=t.data;n(i)&&(r[e(i)]=t)}),t.lookup=r,t}function Mv(t){Pt.call(this,null,t)}Mv.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const Sv=t=>t.values;function Cv(){const t=[],e={entries:e=>function e(n,r){if(++r>t.length)return n;const i=[];for(const t in n)i.push({key:t,values:e(n[t],r)});return i}(function e(n,r){if(r>=t.length)return n;const i=n.length,o=t[r++],a={},s={};let u,l,c,f=-1;for(;++f<i;)u=o(l=n[f])+"",(c=a[u])?c.push(l):a[u]=[l];for(u in a)s[u]=e(a[u],r);return s}(e,0),0),key:n=>(t.push(n),e)};return e}function Fv(t){Pt.call(this,null,t)}Object(Z.z)(Mv,Pt,{transform(t,e){e.source||Object(Z.o)("Nest transform requires an upstream data source.");var n=t.generate,r=t.modified(),i=e.clone(),o=this.value;return(!o||r||e.changed())&&(o&&o.each(t=>{t.children&&ot(t.data)&&i.rem.push(t.data)}),this.value=o=Ty({values:Object(Z.i)(t.keys).reduce((t,e)=>(t.key(e),t),Cv()).entries(i.source)},Sv),n&&o.each(t=>{t.children&&(t=ut(t.data),i.add.push(t),i.source.push(t))}),Dv(o,at,at)),i.source.root=o,i}});const zv=(t,e)=>t.parent===e.parent?1:2;Object(Z.z)(Fv,Pt,{transform(t,e){e.source&&e.source.root||Object(Z.o)(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(t.method),r=this.fields,i=e.source.root,o=t.as||r;t.field?i.sum(t.field):i.count(),t.sort&&i.sort(dt(t.sort,t=>t.data)),function(t,e,n){for(let r,i=0,o=e.length;i<o;++i)r=e[i],r in n&&t[r](n[r])}(n,this.params,t),n.separation&&n.separation(!1!==t.separation?zv:Z.P);try{this.value=n(i)}catch(t){Object(Z.o)(t)}return i.each(t=>function(t,e,n){const r=t.data,i=e.length-1;for(let o=0;o<i;++o)r[n[o]]=t[e[o]];r[n[i]]=t.children?t.children.length:0}(t,r,o)),e.reflow(t.modified()).modifies(o).modifies("leaf")}});const Tv=["x","y","r","depth","children"];function $v(t){Fv.call(this,t)}$v.Definition={type:"Pack",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"radius",type:"field",default:null},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:Tv.length,default:Tv}]},Object(Z.z)($v,Fv,{layout:function(){var t=null,e=1,n=1,r=ev;function i(i){return i.x=e/2,i.y=n/2,t?i.eachBefore(iv(t)).eachAfter(ov(r,.5)).eachBefore(av(1)):i.eachBefore(iv(rv)).eachAfter(ov(ev,1)).eachAfter(ov(r,i.r/Math.min(e,n))).eachBefore(av(Math.min(e,n)/(2*i.r))),i}return i.radius=function(e){return arguments.length?(t=Qy(e),i):t},i.size=function(t){return arguments.length?(e=+t[0],n=+t[1],i):[e,n]},i.padding=function(t){return arguments.length?(r="function"==typeof t?t:nv(+t),i):r},i},params:["radius","size","padding"],fields:Tv});const Nv=["x0","y0","x1","y1","depth","children"];function Rv(t){Fv.call(this,t)}function Pv(t){Pt.call(this,null,t)}Rv.Definition={type:"Partition",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:Nv.length,default:Nv}]},Object(Z.z)(Rv,Fv,{layout:function(){var t=1,e=1,n=0,r=!1;function i(i){var o=i.height+1;return i.x0=i.y0=n,i.x1=t,i.y1=e/o,i.eachBefore(function(t,e){return function(r){r.children&&uv(r,r.x0,t*(r.depth+1)/e,r.x1,t*(r.depth+2)/e);var i=r.x0,o=r.y0,a=r.x1-n,s=r.y1-n;a<i&&(i=a=(i+a)/2),s<o&&(o=s=(o+s)/2),r.x0=i,r.y0=o,r.x1=a,r.y1=s}}(e,o)),r&&i.eachBefore(sv),i}return i.round=function(t){return arguments.length?(r=!!t,i):r},i.size=function(n){return arguments.length?(t=+n[0],e=+n[1],i):[t,e]},i.padding=function(t){return arguments.length?(n=+t,i):n},i},params:["size","round","padding"],fields:Nv}),Pv.Definition={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]},Object(Z.z)(Pv,Pt,{transform(t,e){e.source||Object(Z.o)("Stratify transform requires an upstream data source.");let n=this.value;const r=t.modified(),i=e.fork(e.ALL).materialize(e.SOURCE),o=!n||r||e.changed(e.ADD_REM)||e.modified(t.key.fields)||e.modified(t.parentKey.fields);return i.source=i.source.slice(),o&&(n=i.source.length?Dv(hv().id(t.key).parentId(t.parentKey)(i.source),t.key,Z.hb):Dv(hv()([{}]),t.key,t.key)),i.source.root=this.value=n,i}});const Bv={tidy:function(){var t=pv,e=1,n=1,r=null;function i(i){var u=function(t){for(var e,n,r,i,o,a=new vv(t,0),s=[a];e=s.pop();)if(r=e._.children)for(e.children=new Array(o=r.length),i=o-1;i>=0;--i)s.push(n=e.children[i]=new vv(r[i],i)),n.parent=e;return(a.parent=new vv(null,0)).children=[a],a}(i);if(u.eachAfter(o),u.parent.m=-u.z,u.eachBefore(a),r)i.eachBefore(s);else{var l=i,c=i,f=i;i.eachBefore((function(t){t.x<l.x&&(l=t),t.x>c.x&&(c=t),t.depth>f.depth&&(f=t)}));var d=l===c?1:t(l,c)/2,h=d-l.x,p=e/(c.x+d+h),g=n/(f.depth||1);i.eachBefore((function(t){t.x=(t.x+h)*p,t.y=t.depth*g}))}return i}function o(e){var n=e.children,r=e.parent.children,i=e.i?r[e.i-1]:null;if(n){!function(t){for(var e,n=0,r=0,i=t.children,o=i.length;--o>=0;)(e=i[o]).z+=n,e.m+=n,n+=e.s+(r+=e.c)}(e);var o=(n[0].z+n[n.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-o):e.z=o}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,n,r){if(n){for(var i,o=e,a=e,s=n,u=o.parent.children[0],l=o.m,c=a.m,f=s.m,d=u.m;s=mv(s),o=gv(o),s&&o;)u=gv(u),(a=mv(a)).a=e,(i=s.z+f-o.z-l+t(s._,o._))>0&&(bv(yv(s,e,r),e,i),l+=i,c+=i),f+=s.m,l+=o.m,d+=u.m,c+=a.m;s&&!mv(a)&&(a.t=s,a.m+=f-c),o&&!gv(u)&&(u.t=o,u.m+=l-d,r=e)}return r}(e,i,e.parent.A||r[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=e,t.y=t.depth*n}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i},cluster:function(){var t=xv,e=1,n=1,r=!1;function i(i){var o,a=0;i.eachAfter((function(e){var n=e.children;n?(e.x=function(t){return t.reduce(_v,0)/t.length}(n),e.y=function(t){return 1+t.reduce(Ov,0)}(n)):(e.x=o?a+=t(e,o):0,e.y=0,o=e)}));var s=function(t){for(var e;e=t.children;)t=e[0];return t}(i),u=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(i),l=s.x-t(s,u)/2,c=u.x+t(u,s)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*e,t.y=(i.y-t.y)*n}:function(t){t.x=(t.x-l)/(c-l)*e,t.y=(1-(i.y?t.y/i.y:1))*n})}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i}},Lv=["x","y","depth","children"];function Iv(t){Fv.call(this,t)}function Uv(t){Pt.call(this,[],t)}Iv.Definition={type:"Tree",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:!0,length:2},{name:"nodeSize",type:"number",array:!0,length:2},{name:"separation",type:"boolean",default:!0},{name:"as",type:"string",array:!0,length:Lv.length,default:Lv}]},Object(Z.z)(Iv,Fv,{layout(t){const e=t||"tidy";if(Object(Z.w)(Bv,e))return Bv[e]();Object(Z.o)("Unrecognized Tree layout method: "+e)},params:["size","nodeSize"],fields:Lv}),Uv.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]},Object(Z.z)(Uv,Pt,{transform(t,e){const n=this.value,r=e.source&&e.source.root,i=e.fork(e.NO_SOURCE),o={};return r||Object(Z.o)("TreeLinks transform requires a tree data source."),e.changed(e.ADD_REM)?(i.rem=n,e.visit(e.SOURCE,t=>o[at(t)]=1),r.each(t=>{const e=t.data,n=t.parent&&t.parent.data;n&&o[at(e)]&&o[at(n)]&&i.add.push(ut({source:n,target:e}))}),this.value=i.add):e.changed(e.MOD)&&(e.visit(e.MOD,t=>o[at(t)]=1),n.forEach(t=>{(o[at(t.source)]||o[at(t.target)])&&i.mod.push(t)})),i}});const qv={binary:function(t,e,n,r,i){var o,a,s=t.children,u=s.length,l=new Array(u+1);for(l[0]=a=o=0;o<u;++o)l[o+1]=a+=s[o].value;!function t(e,n,r,i,o,a,u){if(e>=n-1){var c=s[e];return c.x0=i,c.y0=o,c.x1=a,void(c.y1=u)}var f=l[e],d=r/2+f,h=e+1,p=n-1;for(;h<p;){var g=h+p>>>1;l[g]<d?h=g+1:p=g}d-l[h-1]<l[h]-d&&e+1<h&&--h;var m=l[h]-f,b=r-m;if(a-i>u-o){var y=r?(i*b+a*m)/r:a;t(e,h,m,i,o,y,u),t(h,n,b,y,o,a,u)}else{var v=r?(o*b+u*m)/r:u;t(e,h,m,i,o,a,v),t(h,n,b,i,v,a,u)}}(0,u,t.value,e,n,r,i)},dice:uv,slice:wv,slicedice:function(t,e,n,r,i){(1&t.depth?wv:uv)(t,e,n,r,i)},squarify:Ev,resquarify:Av},Wv=["x0","y0","x1","y1","depth","children"];function Yv(t){Fv.call(this,t)}Yv.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:Wv.length,default:Wv}]},Object(Z.z)(Yv,Fv,{layout(){const t=function(){var t=Ev,e=!1,n=1,r=1,i=[0],o=ev,a=ev,s=ev,u=ev,l=ev;function c(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(f),i=[0],e&&t.eachBefore(sv),t}function f(e){var n=i[e.depth],r=e.x0+n,c=e.y0+n,f=e.x1-n,d=e.y1-n;f<r&&(r=f=(r+f)/2),d<c&&(c=d=(c+d)/2),e.x0=r,e.y0=c,e.x1=f,e.y1=d,e.children&&(n=i[e.depth+1]=o(e)/2,r+=l(e)-n,c+=a(e)-n,(f-=s(e)-n)<r&&(r=f=(r+f)/2),(d-=u(e)-n)<c&&(c=d=(c+d)/2),t(e,r,c,f,d))}return c.round=function(t){return arguments.length?(e=!!t,c):e},c.size=function(t){return arguments.length?(n=+t[0],r=+t[1],c):[n,r]},c.tile=function(e){return arguments.length?(t=tv(e),c):t},c.padding=function(t){return arguments.length?c.paddingInner(t).paddingOuter(t):c.paddingInner()},c.paddingInner=function(t){return arguments.length?(o="function"==typeof t?t:nv(+t),c):o},c.paddingOuter=function(t){return arguments.length?c.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):c.paddingTop()},c.paddingTop=function(t){return arguments.length?(a="function"==typeof t?t:nv(+t),c):a},c.paddingRight=function(t){return arguments.length?(s="function"==typeof t?t:nv(+t),c):s},c.paddingBottom=function(t){return arguments.length?(u="function"==typeof t?t:nv(+t),c):u},c.paddingLeft=function(t){return arguments.length?(l="function"==typeof t?t:nv(+t),c):l},c}();return t.ratio=e=>{const n=t.tile();n.ratio&&t.tile(n.ratio(e))},t.method=e=>{Object(Z.w)(qv,e)?t.tile(qv[e]):Object(Z.o)("Unrecognized Treemap layout method: "+e)},t},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:Wv});function Hv(t,e,n,r){const i=t.width,o=t.height,a=n||r,s=Ci(i,o).getContext("2d");e.forEach(t=>function t(e,n,r){if(!n.length)return;const i=n[0].mark.marktype;"group"===i?n.forEach(n=>{n.items.forEach(n=>t(e,n.items,r))}):_f[i].draw(e,{items:r?n.map(Gv):n})}(s,t,a));const u=new Uint32Array(s.getImageData(0,0,i,o).data.buffer),l=t.bitmap(),c=a&&t.bitmap();let f,d,h,p,g;for(d=0;d<o;++d)for(f=0;f<i;++f)g=4278190080&u[d*i+f],g&&(h=t(f),p=t(d),r||l.set(h,p),a&&268435456^g&&c.set(h,p));return[l,c]}function Gv(t){const e=ct(t,{});return e.stroke&&(e.strokeOpacity=1),e.fill&&(e.fillOpacity=.0625,e.stroke="#000",e.strokeOpacity=1,e.strokeWidth=2),e}const Vv=new Uint32Array(33),Xv=new Uint32Array(33);Xv[0]=0,Vv[0]=~Xv[0];for(let t=1;t<=32;++t)Xv[t]=Xv[t-1]<<1|1,Vv[t]=~Xv[t];function Jv(t,e,n){const r=Math.max(1,Math.sqrt(t*e/1e6)),i=~~((t+2*n+r)/r),o=~~((e+2*n+r)/r),a=t=>~~((t+n)/r);return a.invert=t=>t*r-n,a.bitmap=()=>function(t,e){const n=new Uint32Array(~~((t*e+32)/32));function r(t,e){n[t]|=e}function i(t,e){n[t]&=e}return{array:n,get:(e,r)=>{const i=r*t+e;return n[i>>>5]&1<<(31&i)},set:(e,n)=>{const i=n*t+e;r(i>>>5,1<<(31&i))},clear:(e,n)=>{const r=n*t+e;i(r>>>5,~(1<<(31&r)))},getRange:(e,r,i,o)=>{let a,s,u,l,c=o;for(;c>=r;--c)if(a=c*t+e,s=c*t+i,u=a>>>5,l=s>>>5,u===l){if(n[u]&Vv[31&a]&Xv[1+(31&s)])return!0}else{if(n[u]&Vv[31&a])return!0;if(n[l]&Xv[1+(31&s)])return!0;for(let t=u+1;t<l;++t)if(n[t])return!0}return!1},setRange:(e,n,i,o)=>{let a,s,u,l,c;for(;n<=o;++n)if(a=n*t+e,s=n*t+i,u=a>>>5,l=s>>>5,u===l)r(u,Vv[31&a]&Xv[1+(31&s)]);else for(r(u,Vv[31&a]),r(l,Xv[1+(31&s)]),c=u+1;c<l;++c)r(c,4294967295)},clearRange:(e,n,r,o)=>{let a,s,u,l,c;for(;n<=o;++n)if(a=n*t+e,s=n*t+r,u=a>>>5,l=s>>>5,u===l)i(u,Xv[31&a]|Vv[1+(31&s)]);else for(i(u,Xv[31&a]),i(l,Vv[1+(31&s)]),c=u+1;c<l;++c)i(c,0)},outOfBounds:(n,r,i,o)=>n<0||r<0||o>=e||i>=t}}(i,o),a.ratio=r,a.padding=n,a.width=t,a.height=e,a}function Kv(t,e,n,r,i,o){let a=n/2;return t-a<0||t+a>i||e-(a=r/2)<0||e+a>o}function Zv(t,e,n,r,i,o,a,s){const u=i*o/(2*r),l=t(e-u),c=t(e+u),f=t(n-(o/=2)),d=t(n+o);return a.outOfBounds(l,f,c,d)||a.getRange(l,f,c,d)||s&&s.getRange(l,f,c,d)}const Qv=[-1,-1,1,1],tx=[-1,1,-1,1];const ex=["right","center","left"],nx=["bottom","middle","top"];function rx(t,e,n,r,i,o,a,s,u,l,c,f){return!(i.outOfBounds(t,n,e,r)||(f&&o?o.getRange(t,n,e,r)||!function(t,e,n,r,i){return i[0]<=t&&n<=i[2]&&i[3]<=e&&r<=i[5]}(a,u,s,l,c):i.getRange(t,n,e,r)))}const ix={"top-left":0,top:1,"top-right":2,left:4,middle:5,right:6,"bottom-left":8,bottom:9,"bottom-right":10},ox={naive:function(t,e,n,r){const i=t.width,o=t.height;return function(t){const e=t.datum.datum.items[r].items,n=e.length,a=t.datum.fontSize,s=nf.width(t.datum,t.datum.text);let u,l,c,f,d,h,p,g=0;for(let r=0;r<n;++r)u=e[r].x,c=e[r].y,l=void 0===e[r].x2?u:e[r].x2,f=void 0===e[r].y2?c:e[r].y2,d=(u+l)/2,h=(c+f)/2,p=Math.abs(l-u+f-c),p>=g&&(g=p,t.x=d,t.y=h);return d=s/2,h=a/2,u=t.x-d,l=t.x+d,c=t.y-h,f=t.y+h,t.align="center",u<0&&l<=i?t.align="left":0<=u&&i<l&&(t.align="right"),t.baseline="middle",c<0&&f<=o?t.baseline="top":0<=c&&o<f&&(t.baseline="bottom"),!0}},"reduced-search":function(t,e,n,r){const i=t.width,o=t.height,a=e[0],s=e[1];function u(e,n,r,u,l){const c=t.invert(e),f=t.invert(n);let d,h=r,p=o;if(!Kv(c,f,u,l,i,o)&&!Zv(t,c,f,l,u,h,a,s)&&!Zv(t,c,f,l,u,l,a,null)){for(;p-h>=1;)d=(h+p)/2,Zv(t,c,f,l,u,d,a,s)?p=d:h=d;if(h>r)return[c,f,h,!0]}}return function(e){const s=e.datum.datum.items[r].items,l=s.length,c=e.datum.fontSize,f=nf.width(e.datum,e.datum.text);let d,h,p,g,m,b,y,v,x,_,O,w,j,k,E,A,D,M=n?c:0,S=!1,C=!1,F=0;for(let r=0;r<l;++r){for(d=s[r].x,p=s[r].y,h=void 0===s[r].x2?d:s[r].x2,g=void 0===s[r].y2?p:s[r].y2,d>h&&(D=d,d=h,h=D),p>g&&(D=p,p=g,g=D),x=t(d),O=t(h),_=~~((x+O)/2),w=t(p),k=t(g),j=~~((w+k)/2),y=_;y>=x;--y)for(v=j;v>=w;--v)A=u(y,v,M,f,c),A&&([e.x,e.y,M,S]=A);for(y=_;y<=O;++y)for(v=j;v<=k;++v)A=u(y,v,M,f,c),A&&([e.x,e.y,M,S]=A);S||n||(E=Math.abs(h-d+g-p),m=(d+h)/2,b=(p+g)/2,E>=F&&!Kv(m,b,f,c,i,o)&&!Zv(t,m,b,c,f,c,a,null)&&(F=E,e.x=m,e.y=b,C=!0))}return!(!S&&!C)&&(m=f/2,b=c/2,a.setRange(t(e.x-m),t(e.y-b),t(e.x+m),t(e.y+b)),e.align="center",e.baseline="middle",!0)}},floodfill:function(t,e,n,r){const i=t.width,o=t.height,a=e[0],s=e[1],u=t.bitmap();return function(e){const l=e.datum.datum.items[r].items,c=l.length,f=e.datum.fontSize,d=nf.width(e.datum,e.datum.text),h=[];let p,g,m,b,y,v,x,_,O,w,j,k,E=n?f:0,A=!1,D=!1,M=0;for(let r=0;r<c;++r){for(p=l[r].x,m=l[r].y,g=void 0===l[r].x2?p:l[r].x2,b=void 0===l[r].y2?m:l[r].y2,h.push([t((p+g)/2),t((m+b)/2)]);h.length;)if([x,_]=h.pop(),!(a.get(x,_)||s.get(x,_)||u.get(x,_))){u.set(x,_);for(let t=0;t<4;++t)y=x+Qv[t],v=_+tx[t],u.outOfBounds(y,v,y,v)||h.push([y,v]);if(y=t.invert(x),v=t.invert(_),O=E,w=o,!Kv(y,v,d,f,i,o)&&!Zv(t,y,v,f,d,O,a,s)&&!Zv(t,y,v,f,d,f,a,null)){for(;w-O>=1;)j=(O+w)/2,Zv(t,y,v,f,d,j,a,s)?w=j:O=j;O>E&&(e.x=y,e.y=v,E=O,A=!0)}}A||n||(k=Math.abs(g-p+b-m),y=(p+g)/2,v=(m+b)/2,k>=M&&!Kv(y,v,d,f,i,o)&&!Zv(t,y,v,f,d,f,a,null)&&(M=k,e.x=y,e.y=v,D=!0))}return!(!A&&!D)&&(y=d/2,v=f/2,a.setRange(t(e.x-y),t(e.y-v),t(e.x+y),t(e.y+v)),e.align="center",e.baseline="middle",!0)}}};function ax(t,e,n,r,i,o,a,s,u,l,c){if(!t.length)return t;const f=Math.max(r.length,i.length),d=function(t,e){const n=new Float64Array(e),r=t.length;for(let e=0;e<r;++e)n[e]=t[e]||0;for(let t=r;t<e;++t)n[t]=n[r-1];return n}(r,f),h=function(t,e){const n=new Int8Array(e),r=t.length;for(let e=0;e<r;++e)n[e]|=ix[t[e]];for(let t=r;t<e;++t)n[t]=n[r-1];return n}(i,f),p=(x=t[0].datum)&&x.mark&&x.mark.marktype,g="group"===p&&t[0].datum.items[u].marktype,m="area"===g,b=function(t,e,n,r){const i=t=>[t.x,t.x,t.x,t.y,t.y,t.y];return t?"line"===t||"area"===t?t=>i(t.datum):"line"===e?t=>{const e=t.datum.items[r].items;return i(e.length?e["start"===n?0:e.length-1]:{x:NaN,y:NaN})}:t=>{const e=t.datum.bounds;return[e.x1,(e.x1+e.x2)/2,e.x2,e.y1,(e.y1+e.y2)/2,e.y2]}:i}(p,g,s,u),y=Jv(e[0],e[1],l),v=m&&"naive"===c;var x;const _=t.map(t=>({datum:t,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:b(t)}));let O;if(!v){n&&_.sort((t,e)=>n(t.datum,e.datum));let e=!1;for(let t=0;t<h.length&&!e;++t)e=5===h[t]||d[t]<0;p&&(a||m)&&(o=[t.map(t=>t.datum)].concat(o)),O=o.length?Hv(y,o,e,m):function(t,e){const n=t.bitmap();return(e||[]).forEach(e=>n.set(t(e.boundary[0]),t(e.boundary[3]))),[n,void 0]}(y,a&&_)}const w=m?ox[c](y,O,a,u):function(t,e,n,r){const i=t.width,o=t.height,a=e[0],s=e[1],u=r.length;return function(e){const l=e.boundary,c=e.datum.fontSize;if(l[2]<0||l[5]<0||l[0]>i||l[3]>o)return!1;let f,d,h,p,g,m,b,y,v,x,_,O,w,j,k,E=0;for(let i=0;i<u;++i){if(f=(3&n[i])-1,d=(n[i]>>>2&3)-1,h=0===f&&0===d||r[i]<0,p=f&&d?Math.SQRT1_2:1,g=r[i]<0?-1:1,m=l[1+f]+r[i]*f*p,_=l[4+d]+g*c*d/2+r[i]*d*p,y=_-c/2,v=_+c/2,O=t(m),j=t(y),k=t(v),!E){if(!rx(O,O,j,k,a,s,m,m,y,v,l,h))continue;E=nf.width(e.datum,e.datum.text)}if(x=m+g*E*f/2,m=x-E/2,b=x+E/2,O=t(m),w=t(b),rx(O,w,j,k,a,s,m,b,y,v,l,h))return e.x=f?f*g<0?b:m:x,e.y=d?d*g<0?v:y:_,e.align=ex[f*g+1],e.baseline=nx[d*g+1],a.setRange(O,j,w,k),!0}return!1}}(y,O,h,d);return _.forEach(t=>t.opacity=+w(t)),_}const sx=["x","y","opacity","align","baseline"],ux=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function lx(t){Pt.call(this,null,t)}function cx(t,e){var n,r,i,o,a,s,u=[],l=function(t){return t(o)};if(null==e)u.push(t);else for(n={},r=0,i=t.length;r<i;++r)o=t[r],(s=n[a=e.map(l)])||(n[a]=s=[],s.dims=a,u.push(s)),s.push(o);return u}function fx(t){Pt.call(this,null,t)}lx.Definition={type:"Label",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"sort",type:"compare"},{name:"anchor",type:"string",array:!0,default:ux},{name:"offset",type:"number",array:!0,default:[1]},{name:"padding",type:"number",default:0},{name:"lineAnchor",type:"string",values:["start","end"],default:"end"},{name:"markIndex",type:"number",default:0},{name:"avoidBaseMark",type:"boolean",default:!0},{name:"avoidMarks",type:"data",array:!0},{name:"method",type:"string",default:"naive"},{name:"as",type:"string",array:!0,length:sx.length,default:sx}]},Object(Z.z)(lx,Pt,{transform(t,e){const n=t.modified();if(!(n||e.changed(e.ADD_REM)||function(n){const r=t[n];return Object(Z.E)(r)&&e.modified(r.fields)}("sort")))return;t.size&&2===t.size.length||Object(Z.o)("Size parameter should be specified as a [width, height] array.");const r=t.as||sx;return ax(e.materialize(e.SOURCE).source,t.size,t.sort,Object(Z.i)(t.offset||1),Object(Z.i)(t.anchor||ux),t.avoidMarks||[],!1!==t.avoidBaseMark,t.lineAnchor||"end",t.markIndex||0,t.padding||0,t.method||"naive").forEach(t=>{const e=t.datum;e[r[0]]=t.x,e[r[1]]=t.y,e[r[2]]=t.opacity,e[r[3]]=t.align,e[r[4]]=t.baseline}),e.reflow(n).modifies(r)}}),fx.Definition={type:"Loess",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"bandwidth",type:"number",default:.3},{name:"as",type:"string",array:!0}]},Object(Z.z)(fx,Pt,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const r=cx(e.materialize(e.SOURCE).source,t.groupby),i=(t.groupby||[]).map(Z.h),o=i.length,a=t.as||[Object(Z.h)(t.x),Object(Z.h)(t.y)],s=[];r.forEach(e=>{Pe(e,t.x,t.y,t.bandwidth||.3).forEach(t=>{const n={};for(let t=0;t<o;++t)n[i[t]]=e.dims[t];n[a[0]]=t[0],n[a[1]]=t[1],s.push(ut(n))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=s}return n}});const dx={linear:Ce,log:Fe,exp:ze,pow:Te,quad:$e,poly:Ne};function hx(t){Pt.call(this,null,t)}hx.Definition={type:"Regression",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"string",default:"linear",values:Object.keys(dx)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:!0,length:2},{name:"params",type:"boolean",default:!1},{name:"as",type:"string",array:!0}]},Object(Z.z)(hx,Pt,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const r=cx(e.materialize(e.SOURCE).source,t.groupby),i=(t.groupby||[]).map(Z.h),o=t.method||"linear",a=t.order||3,s=((t,e)=>"poly"===t?e:"quad"===t?2:1)(o,a),u=t.as||[Object(Z.h)(t.x),Object(Z.h)(t.y)],l=dx[o],c=[];let f=t.extent;Object(Z.w)(dx,o)||Object(Z.o)("Invalid regression method: "+o),null!=f&&"log"===o&&f[0]<=0&&(e.dataflow.warn("Ignoring extent with values <= 0 for log regression."),f=null),r.forEach(n=>{if(n.length<=s)return void e.dataflow.warn("Skipping regression with more parameters than data points.");const r=l(n,t.x,t.y,a);if(t.params)return void c.push(ut({keys:n.dims,coef:r.coef,rSquared:r.rSquared}));const d=f||Object(Z.q)(n,t.x),h=t=>{const e={};for(let t=0;t<i.length;++t)e[i[t]]=n.dims[t];e[u[0]]=t[0],e[u[1]]=t[1],c.push(ut(e))};"linear"===o?d.forEach(t=>h([t,r.predict(t)])):Ue(r.predict,d,25,200).forEach(h)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=c}return n}});const px=Math.pow(2,-52),gx=new Uint32Array(512);class mx{static from(t,e=jx,n=kx){const r=t.length,i=new Float64Array(2*r);for(let o=0;o<r;o++){const r=t[o];i[2*o]=e(r),i[2*o+1]=n(r)}return new mx(i)}constructor(t){const e=t.length>>1;if(e>0&&"number"!=typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;const n=Math.max(2*e-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(e)),this._hullPrev=new Uint32Array(e),this._hullNext=new Uint32Array(e),this._hullTri=new Uint32Array(e),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(e),this._dists=new Float64Array(e),this.update()}update(){const{coords:t,_hullPrev:e,_hullNext:n,_hullTri:r,_hullHash:i}=this,o=t.length>>1;let a=1/0,s=1/0,u=-1/0,l=-1/0;for(let e=0;e<o;e++){const n=t[2*e],r=t[2*e+1];n<a&&(a=n),r<s&&(s=r),n>u&&(u=n),r>l&&(l=r),this._ids[e]=e}const c=(a+u)/2,f=(s+l)/2;let d,h,p,g=1/0;for(let e=0;e<o;e++){const n=bx(c,f,t[2*e],t[2*e+1]);n<g&&(d=e,g=n)}const m=t[2*d],b=t[2*d+1];g=1/0;for(let e=0;e<o;e++){if(e===d)continue;const n=bx(m,b,t[2*e],t[2*e+1]);n<g&&n>0&&(h=e,g=n)}let y=t[2*h],v=t[2*h+1],x=1/0;for(let e=0;e<o;e++){if(e===d||e===h)continue;const n=_x(m,b,y,v,t[2*e],t[2*e+1]);n<x&&(p=e,x=n)}let _=t[2*p],O=t[2*p+1];if(x===1/0){for(let e=0;e<o;e++)this._dists[e]=t[2*e]-t[0]||t[2*e+1]-t[1];Ox(this._ids,this._dists,0,o-1);const e=new Uint32Array(o);let n=0;for(let t=0,r=-1/0;t<o;t++){const i=this._ids[t];this._dists[i]>r&&(e[n++]=i,r=this._dists[i])}return this.hull=e.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(vx(m,b,y,v,_,O)){const t=h,e=y,n=v;h=p,y=_,v=O,p=t,_=e,O=n}const w=function(t,e,n,r,i,o){const a=n-t,s=r-e,u=i-t,l=o-e,c=a*a+s*s,f=u*u+l*l,d=.5/(a*l-s*u);return{x:t+(l*c-s*f)*d,y:e+(a*f-u*c)*d}}(m,b,y,v,_,O);this._cx=w.x,this._cy=w.y;for(let e=0;e<o;e++)this._dists[e]=bx(t[2*e],t[2*e+1],w.x,w.y);Ox(this._ids,this._dists,0,o-1),this._hullStart=d;let j=3;n[d]=e[p]=h,n[h]=e[d]=p,n[p]=e[h]=d,r[d]=0,r[h]=1,r[p]=2,i.fill(-1),i[this._hashKey(m,b)]=d,i[this._hashKey(y,v)]=h,i[this._hashKey(_,O)]=p,this.trianglesLen=0,this._addTriangle(d,h,p,-1,-1,-1);for(let o,a,s=0;s<this._ids.length;s++){const u=this._ids[s],l=t[2*u],c=t[2*u+1];if(s>0&&Math.abs(l-o)<=px&&Math.abs(c-a)<=px)continue;if(o=l,a=c,u===d||u===h||u===p)continue;let f=0;for(let t=0,e=this._hashKey(l,c);t<this._hashSize&&(f=i[(e+t)%this._hashSize],-1===f||f===n[f]);t++);f=e[f];let g,m=f;for(;g=n[m],!vx(l,c,t[2*m],t[2*m+1],t[2*g],t[2*g+1]);)if(m=g,m===f){m=-1;break}if(-1===m)continue;let b=this._addTriangle(m,u,n[m],-1,-1,r[m]);r[u]=this._legalize(b+2),r[m]=b,j++;let y=n[m];for(;g=n[y],vx(l,c,t[2*y],t[2*y+1],t[2*g],t[2*g+1]);)b=this._addTriangle(y,u,g,r[u],-1,r[y]),r[u]=this._legalize(b+2),n[y]=y,j--,y=g;if(m===f)for(;g=e[m],vx(l,c,t[2*g],t[2*g+1],t[2*m],t[2*m+1]);)b=this._addTriangle(g,u,m,-1,r[m],r[g]),this._legalize(b+2),r[g]=b,n[m]=m,j--,m=g;this._hullStart=e[u]=m,n[m]=e[y]=u,n[u]=y,i[this._hashKey(l,c)]=u,i[this._hashKey(t[2*m],t[2*m+1])]=m}this.hull=new Uint32Array(j);for(let t=0,e=this._hullStart;t<j;t++)this.hull[t]=e,e=n[e];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,e){return Math.floor(function(t,e){const n=t/(Math.abs(t)+Math.abs(e));return(e>0?3-n:1+n)/4}(t-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:e,_halfedges:n,coords:r}=this;let i=0,o=0;for(;;){const a=n[t],s=t-t%3;if(o=s+(t+2)%3,-1===a){if(0===i)break;t=gx[--i];continue}const u=a-a%3,l=s+(t+1)%3,c=u+(a+2)%3,f=e[o],d=e[t],h=e[l],p=e[c];if(xx(r[2*f],r[2*f+1],r[2*d],r[2*d+1],r[2*h],r[2*h+1],r[2*p],r[2*p+1])){e[t]=p,e[a]=f;const r=n[c];if(-1===r){let e=this._hullStart;do{if(this._hullTri[e]===c){this._hullTri[e]=t;break}e=this._hullPrev[e]}while(e!==this._hullStart)}this._link(t,r),this._link(a,n[o]),this._link(o,c);const s=u+(a+1)%3;i<gx.length&&(gx[i++]=s)}else{if(0===i)break;t=gx[--i]}}return o}_link(t,e){this._halfedges[t]=e,-1!==e&&(this._halfedges[e]=t)}_addTriangle(t,e,n,r,i,o){const a=this.trianglesLen;return this._triangles[a]=t,this._triangles[a+1]=e,this._triangles[a+2]=n,this._link(a,r),this._link(a+1,i),this._link(a+2,o),this.trianglesLen+=3,a}}function bx(t,e,n,r){const i=t-n,o=e-r;return i*i+o*o}function yx(t,e,n,r,i,o){const a=(r-e)*(i-t),s=(n-t)*(o-e);return Math.abs(a-s)>=33306690738754716e-32*Math.abs(a+s)?a-s:0}function vx(t,e,n,r,i,o){return(yx(i,o,t,e,n,r)||yx(t,e,n,r,i,o)||yx(n,r,i,o,t,e))<0}function xx(t,e,n,r,i,o,a,s){const u=t-a,l=e-s,c=n-a,f=r-s,d=i-a,h=o-s,p=c*c+f*f,g=d*d+h*h;return u*(f*g-p*h)-l*(c*g-p*d)+(u*u+l*l)*(c*h-f*d)<0}function _x(t,e,n,r,i,o){const a=n-t,s=r-e,u=i-t,l=o-e,c=a*a+s*s,f=u*u+l*l,d=.5/(a*l-s*u),h=(l*c-s*f)*d,p=(a*f-u*c)*d;return h*h+p*p}function Ox(t,e,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){const r=t[i],o=e[r];let a=i-1;for(;a>=n&&e[t[a]]>o;)t[a+1]=t[a--];t[a+1]=r}else{let i=n+1,o=r;wx(t,n+r>>1,i),e[t[n]]>e[t[r]]&&wx(t,n,r),e[t[i]]>e[t[r]]&&wx(t,i,r),e[t[n]]>e[t[i]]&&wx(t,n,i);const a=t[i],s=e[a];for(;;){do{i++}while(e[t[i]]<s);do{o--}while(e[t[o]]>s);if(o<i)break;wx(t,i,o)}t[n+1]=t[o],t[o]=a,r-i+1>=o-n?(Ox(t,e,i,r),Ox(t,e,n,o-1)):(Ox(t,e,n,o-1),Ox(t,e,i,r))}}function wx(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function jx(t){return t[0]}function kx(t){return t[1]}class Ex{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,e){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,e){this._+=`L${this._x1=+t},${this._y1=+e}`}arc(t,e,n){const r=(t=+t)+(n=+n),i=e=+e;if(n<0)throw new Error("negative radius");null===this._x1?this._+=`M${r},${i}`:(Math.abs(this._x1-r)>1e-6||Math.abs(this._y1-i)>1e-6)&&(this._+="L"+r+","+i),n&&(this._+=`A${n},${n},0,1,1,${t-n},${e}A${n},${n},0,1,1,${this._x1=r},${this._y1=i}`)}rect(t,e,n,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${+n}v${+r}h${-n}Z`}value(){return this._||null}}class Ax{constructor(){this._=[]}moveTo(t,e){this._.push([t,e])}closePath(){this._.push(this._[0].slice())}lineTo(t,e){this._.push([t,e])}value(){return this._.length?this._:null}}class Dx{constructor(t,[e,n,r,i]=[0,0,960,500]){if(!((r=+r)>=(e=+e)&&(i=+i)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(2*t.points.length),this.vectors=new Float64Array(2*t.points.length),this.xmax=r,this.xmin=e,this.ymax=i,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:e,triangles:n},vectors:r}=this,i=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let e,r,o=0,a=0,s=n.length;o<s;o+=3,a+=2){const s=2*n[o],u=2*n[o+1],l=2*n[o+2],c=t[s],f=t[s+1],d=t[u],h=t[u+1],p=t[l],g=t[l+1],m=d-c,b=h-f,y=p-c,v=g-f,x=m*m+b*b,_=y*y+v*v,O=2*(m*v-b*y);if(O)if(Math.abs(O)<1e-8)e=(c+p)/2,r=(f+g)/2;else{const t=1/O;e=c+(v*x-b*_)*t,r=f+(m*_-y*x)*t}else e=(c+p)/2-1e8*v,r=(f+g)/2+1e8*y;i[a]=e,i[a+1]=r}let o,a,s,u=e[e.length-1],l=4*u,c=t[2*u],f=t[2*u+1];r.fill(0);for(let n=0;n<e.length;++n)u=e[n],o=l,a=c,s=f,l=4*u,c=t[2*u],f=t[2*u+1],r[o+2]=r[l]=s-f,r[o+3]=r[l+1]=c-a}render(t){const e=null==t?t=new Ex:void 0,{delaunay:{halfedges:n,inedges:r,hull:i},circumcenters:o,vectors:a}=this;if(i.length<=1)return null;for(let e=0,r=n.length;e<r;++e){const r=n[e];if(r<e)continue;const i=2*Math.floor(e/3),a=2*Math.floor(r/3),s=o[i],u=o[i+1],l=o[a],c=o[a+1];this._renderSegment(s,u,l,c,t)}let s,u=i[i.length-1];for(let e=0;e<i.length;++e){s=u,u=i[e];const n=2*Math.floor(r[u]/3),l=o[n],c=o[n+1],f=4*s,d=this._project(l,c,a[f+2],a[f+3]);d&&this._renderSegment(l,c,d[0],d[1],t)}return e&&e.value()}renderBounds(t){const e=null==t?t=new Ex:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),e&&e.value()}renderCell(t,e){const n=null==e?e=new Ex:void 0,r=this._clip(t);if(null===r||!r.length)return;e.moveTo(r[0],r[1]);let i=r.length;for(;r[0]===r[i-2]&&r[1]===r[i-1]&&i>1;)i-=2;for(let t=2;t<i;t+=2)r[t]===r[t-2]&&r[t+1]===r[t-1]||e.lineTo(r[t],r[t+1]);return e.closePath(),n&&n.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let e=0,n=t.length/2;e<n;++e){const t=this.cellPolygon(e);t&&(t.index=e,yield t)}}cellPolygon(t){const e=new Ax;return this.renderCell(t,e),e.value()}_renderSegment(t,e,n,r,i){let o;const a=this._regioncode(t,e),s=this._regioncode(n,r);0===a&&0===s?(i.moveTo(t,e),i.lineTo(n,r)):(o=this._clipSegment(t,e,n,r,a,s))&&(i.moveTo(o[0],o[1]),i.lineTo(o[2],o[3]))}contains(t,e,n){return(e=+e)==e&&(n=+n)==n&&this.delaunay._step(t,e,n)===t}*neighbors(t){const e=this._clip(t);if(e)for(const n of this.delaunay.neighbors(t)){const t=this._clip(n);if(t)t:for(let r=0,i=e.length;r<i;r+=2)for(let o=0,a=t.length;o<a;o+=2)if(e[r]==t[o]&&e[r+1]==t[o+1]&&e[(r+2)%i]==t[(o+a-2)%a]&&e[(r+3)%i]==t[(o+a-1)%a]){yield n;break t}}}_cell(t){const{circumcenters:e,delaunay:{inedges:n,halfedges:r,triangles:i}}=this,o=n[t];if(-1===o)return null;const a=[];let s=o;do{const n=Math.floor(s/3);if(a.push(e[2*n],e[2*n+1]),s=s%3==2?s-2:s+1,i[s]!==t)break;s=r[s]}while(s!==o&&-1!==s);return a}_clip(t){if(0===t&&1===this.delaunay.hull.length)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const e=this._cell(t);if(null===e)return null;const{vectors:n}=this,r=4*t;return n[r]||n[r+1]?this._clipInfinite(t,e,n[r],n[r+1],n[r+2],n[r+3]):this._clipFinite(t,e)}_clipFinite(t,e){const n=e.length;let r,i,o,a,s,u=null,l=e[n-2],c=e[n-1],f=this._regioncode(l,c);for(let d=0;d<n;d+=2)if(r=l,i=c,l=e[d],c=e[d+1],o=f,f=this._regioncode(l,c),0===o&&0===f)a=s,s=0,u?u.push(l,c):u=[l,c];else{let e,n,d,h,p;if(0===o){if(null===(e=this._clipSegment(r,i,l,c,o,f)))continue;[n,d,h,p]=e}else{if(null===(e=this._clipSegment(l,c,r,i,f,o)))continue;[h,p,n,d]=e,a=s,s=this._edgecode(n,d),a&&s&&this._edge(t,a,s,u,u.length),u?u.push(n,d):u=[n,d]}a=s,s=this._edgecode(h,p),a&&s&&this._edge(t,a,s,u,u.length),u?u.push(h,p):u=[h,p]}if(u)a=s,s=this._edgecode(u[0],u[1]),a&&s&&this._edge(t,a,s,u,u.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return u}_clipSegment(t,e,n,r,i,o){for(;;){if(0===i&&0===o)return[t,e,n,r];if(i&o)return null;let a,s,u=i||o;8&u?(a=t+(n-t)*(this.ymax-e)/(r-e),s=this.ymax):4&u?(a=t+(n-t)*(this.ymin-e)/(r-e),s=this.ymin):2&u?(s=e+(r-e)*(this.xmax-t)/(n-t),a=this.xmax):(s=e+(r-e)*(this.xmin-t)/(n-t),a=this.xmin),i?(t=a,e=s,i=this._regioncode(t,e)):(n=a,r=s,o=this._regioncode(n,r))}}_clipInfinite(t,e,n,r,i,o){let a,s=Array.from(e);if((a=this._project(s[0],s[1],n,r))&&s.unshift(a[0],a[1]),(a=this._project(s[s.length-2],s[s.length-1],i,o))&&s.push(a[0],a[1]),s=this._clipFinite(t,s))for(let e,n=0,r=s.length,i=this._edgecode(s[r-2],s[r-1]);n<r;n+=2)e=i,i=this._edgecode(s[n],s[n+1]),e&&i&&(n=this._edge(t,e,i,s,n),r=s.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(s=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return s}_edge(t,e,n,r,i){for(;e!==n;){let n,o;switch(e){case 5:e=4;continue;case 4:e=6,n=this.xmax,o=this.ymin;break;case 6:e=2;continue;case 2:e=10,n=this.xmax,o=this.ymax;break;case 10:e=8;continue;case 8:e=9,n=this.xmin,o=this.ymax;break;case 9:e=1;continue;case 1:e=5,n=this.xmin,o=this.ymin}r[i]===n&&r[i+1]===o||!this.contains(t,n,o)||(r.splice(i,0,n,o),i+=2)}if(r.length>4)for(let t=0;t<r.length;t+=2){const e=(t+2)%r.length,n=(t+4)%r.length;(r[t]===r[e]&&r[e]===r[n]||r[t+1]===r[e+1]&&r[e+1]===r[n+1])&&(r.splice(e,2),t-=2)}return i}_project(t,e,n,r){let i,o,a,s=1/0;if(r<0){if(e<=this.ymin)return null;(i=(this.ymin-e)/r)<s&&(a=this.ymin,o=t+(s=i)*n)}else if(r>0){if(e>=this.ymax)return null;(i=(this.ymax-e)/r)<s&&(a=this.ymax,o=t+(s=i)*n)}if(n>0){if(t>=this.xmax)return null;(i=(this.xmax-t)/n)<s&&(o=this.xmax,a=e+(s=i)*r)}else if(n<0){if(t<=this.xmin)return null;(i=(this.xmin-t)/n)<s&&(o=this.xmin,a=e+(s=i)*r)}return[o,a]}_edgecode(t,e){return(t===this.xmin?1:t===this.xmax?2:0)|(e===this.ymin?4:e===this.ymax?8:0)}_regioncode(t,e){return(t<this.xmin?1:t>this.xmax?2:0)|(e<this.ymin?4:e>this.ymax?8:0)}}const Mx=2*Math.PI,Sx=Math.pow;function Cx(t){return t[0]}function Fx(t){return t[1]}function zx(t,e,n){return[t+Math.sin(t+e)*n,e+Math.cos(t-e)*n]}class Tx{static from(t,e=Cx,n=Fx,r){return new Tx("length"in t?function(t,e,n,r){const i=t.length,o=new Float64Array(2*i);for(let a=0;a<i;++a){const i=t[a];o[2*a]=e.call(r,i,a,t),o[2*a+1]=n.call(r,i,a,t)}return o}(t,e,n,r):Float64Array.from(function*(t,e,n,r){let i=0;for(const o of t)yield e.call(r,o,i,t),yield n.call(r,o,i,t),++i}(t,e,n,r)))}constructor(t){this._delaunator=new mx(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,e=this.points;if(t.hull&&t.hull.length>2&&function(t){const{triangles:e,coords:n}=t;for(let t=0;t<e.length;t+=3){const r=2*e[t],i=2*e[t+1],o=2*e[t+2];if((n[o]-n[r])*(n[i+1]-n[r+1])-(n[i]-n[r])*(n[o+1]-n[r+1])>1e-10)return!1}return!0}(t)){this.collinear=Int32Array.from({length:e.length/2},(t,e)=>e).sort((t,n)=>e[2*t]-e[2*n]||e[2*t+1]-e[2*n+1]);const t=this.collinear[0],n=this.collinear[this.collinear.length-1],r=[e[2*t],e[2*t+1],e[2*n],e[2*n+1]],i=1e-8*Math.hypot(r[3]-r[1],r[2]-r[0]);for(let t=0,n=e.length/2;t<n;++t){const n=zx(e[2*t],e[2*t+1],i);e[2*t]=n[0],e[2*t+1]=n[1]}this._delaunator=new mx(e)}else delete this.collinear;const n=this.halfedges=this._delaunator.halfedges,r=this.hull=this._delaunator.hull,i=this.triangles=this._delaunator.triangles,o=this.inedges.fill(-1),a=this._hullIndex.fill(-1);for(let t=0,e=n.length;t<e;++t){const e=i[t%3==2?t-2:t+1];-1!==n[t]&&-1!==o[e]||(o[e]=t)}for(let t=0,e=r.length;t<e;++t)a[r[t]]=t;r.length<=2&&r.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],this.triangles[1]=r[1],this.triangles[2]=r[1],o[r[0]]=1,2===r.length&&(o[r[1]]=0))}voronoi(t){return new Dx(this,t)}*neighbors(t){const{inedges:e,hull:n,_hullIndex:r,halfedges:i,triangles:o,collinear:a}=this;if(a){const e=a.indexOf(t);return e>0&&(yield a[e-1]),void(e<a.length-1&&(yield a[e+1]))}const s=e[t];if(-1===s)return;let u=s,l=-1;do{if(yield l=o[u],u=u%3==2?u-2:u+1,o[u]!==t)return;if(u=i[u],-1===u){const e=n[(r[t]+1)%n.length];return void(e!==l&&(yield e))}}while(u!==s)}find(t,e,n=0){if((t=+t)!=t||(e=+e)!=e)return-1;const r=n;let i;for(;(i=this._step(n,t,e))>=0&&i!==n&&i!==r;)n=i;return i}_step(t,e,n){const{inedges:r,hull:i,_hullIndex:o,halfedges:a,triangles:s,points:u}=this;if(-1===r[t]||!u.length)return(t+1)%(u.length>>1);let l=t,c=Sx(e-u[2*t],2)+Sx(n-u[2*t+1],2);const f=r[t];let d=f;do{let r=s[d];const f=Sx(e-u[2*r],2)+Sx(n-u[2*r+1],2);if(f<c&&(c=f,l=r),d=d%3==2?d-2:d+1,s[d]!==t)break;if(d=a[d],-1===d){if(d=i[(o[t]+1)%i.length],d!==r&&Sx(e-u[2*d],2)+Sx(n-u[2*d+1],2)<c)return d;break}}while(d!==f);return l}render(t){const e=null==t?t=new Ex:void 0,{points:n,halfedges:r,triangles:i}=this;for(let e=0,o=r.length;e<o;++e){const o=r[e];if(o<e)continue;const a=2*i[e],s=2*i[o];t.moveTo(n[a],n[a+1]),t.lineTo(n[s],n[s+1])}return this.renderHull(t),e&&e.value()}renderPoints(t,e=2){const n=null==t?t=new Ex:void 0,{points:r}=this;for(let n=0,i=r.length;n<i;n+=2){const i=r[n],o=r[n+1];t.moveTo(i+e,o),t.arc(i,o,e,0,Mx)}return n&&n.value()}renderHull(t){const e=null==t?t=new Ex:void 0,{hull:n,points:r}=this,i=2*n[0],o=n.length;t.moveTo(r[i],r[i+1]);for(let e=1;e<o;++e){const i=2*n[e];t.lineTo(r[i],r[i+1])}return t.closePath(),e&&e.value()}hullPolygon(){const t=new Ax;return this.renderHull(t),t.value()}renderTriangle(t,e){const n=null==e?e=new Ex:void 0,{points:r,triangles:i}=this,o=2*i[t*=3],a=2*i[t+1],s=2*i[t+2];return e.moveTo(r[o],r[o+1]),e.lineTo(r[a],r[a+1]),e.lineTo(r[s],r[s+1]),e.closePath(),n&&n.value()}*trianglePolygons(){const{triangles:t}=this;for(let e=0,n=t.length/3;e<n;++e)yield this.trianglePolygon(e)}trianglePolygon(t){const e=new Ax;return this.renderTriangle(t,e),e.value()}}function $x(t){Pt.call(this,null,t)}$x.Definition={type:"Voronoi",metadata:{modifies:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"size",type:"number",array:!0,length:2},{name:"extent",type:"array",array:!0,length:2,default:[[-1e5,-1e5],[1e5,1e5]],content:{type:"number",array:!0,length:2}},{name:"as",type:"string",default:"path"}]};const Nx=[-1e5,-1e5,1e5,1e5];function Rx(t){const e=t[0][0],n=t[0][1];let r=t.length-1;for(;t[r][0]===e&&t[r][1]===n;--r);return"M"+t.slice(0,r+1).join("L")+"Z"}Object(Z.z)($x,Pt,{transform(t,e){const n=t.as||"path",r=e.source;if(!r||!r.length)return e;let i=t.size;i=i?[0,0,i[0],i[1]]:(i=t.extent)?[i[0][0],i[0][1],i[1][0],i[1][1]]:Nx;const o=this.value=Tx.from(r,t.x,t.y).voronoi(i);for(let t=0,e=r.length;t<e;++t){const e=o.cellPolygon(t);r[t][n]=e?Rx(e):null}return e.reflow(t.modified()).modifies(n)}});var Px=Math.PI/180;function Bx(){var t,e,n,r,i,o,a,s=[256,256],u=qx,l=[],c=Math.random,f={};function d(t,e,n){for(var r,i,o,a,l,f=e.x,d=e.y,h=Math.sqrt(s[0]*s[0]+s[1]*s[1]),p=u(s),g=c()<.5?1:-1,m=-g;(r=p(m+=g))&&(i=~~r[0],o=~~r[1],!(Math.min(Math.abs(i),Math.abs(o))>=h));)if(e.x=f+i,e.y=d+o,!(e.x+e.x0<0||e.y+e.y0<0||e.x+e.x1>s[0]||e.y+e.y1>s[1]||n&&Ix(e,t,s[0])||n&&(l=n,!((a=e).x+a.x1>l[0].x&&a.x+a.x0<l[1].x&&a.y+a.y1>l[0].y&&a.y+a.y0<l[1].y)))){for(var b,y=e.sprite,v=e.width>>5,x=s[0]>>5,_=e.x-(v<<4),O=127&_,w=32-O,j=e.y1-e.y0,k=(e.y+e.y0)*x+(_>>5),E=0;E<j;E++){b=0;for(var A=0;A<=v;A++)t[k+A]|=b<<w|(A<v?(b=y[E*v+A])>>>O:0);k+=x}return e.sprite=null,!0}return!1}return f.layout=function(){for(var u=function(t){t.width=t.height=1;var e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2);t.width=2048/e,t.height=2048/e;var n=t.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",{context:n,ratio:e}}(Ci()),f=function(t){var e=[],n=-1;for(;++n<t;)e[n]=0;return e}((s[0]>>5)*s[1]),h=null,p=l.length,g=-1,m=[],b=l.map(s=>({text:t(s),font:e(s),style:r(s),weight:i(s),rotate:o(s),size:~~(n(s)+1e-14),padding:a(s),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:s})).sort((t,e)=>e.size-t.size);++g<p;){var y=b[g];y.x=s[0]*(c()+.5)>>1,y.y=s[1]*(c()+.5)>>1,Lx(u,y,b,g),y.hasText&&d(f,y,h)&&(m.push(y),h?Ux(h,y):h=[{x:y.x+y.x0,y:y.y+y.y0},{x:y.x+y.x1,y:y.y+y.y1}],y.x-=s[0]>>1,y.y-=s[1]>>1)}return m},f.words=function(t){return arguments.length?(l=t,f):l},f.size=function(t){return arguments.length?(s=[+t[0],+t[1]],f):s},f.font=function(t){return arguments.length?(e=Wx(t),f):e},f.fontStyle=function(t){return arguments.length?(r=Wx(t),f):r},f.fontWeight=function(t){return arguments.length?(i=Wx(t),f):i},f.rotate=function(t){return arguments.length?(o=Wx(t),f):o},f.text=function(e){return arguments.length?(t=Wx(e),f):t},f.spiral=function(t){return arguments.length?(u=Yx[t]||t,f):u},f.fontSize=function(t){return arguments.length?(n=Wx(t),f):n},f.padding=function(t){return arguments.length?(a=Wx(t),f):a},f.random=function(t){return arguments.length?(c=t,f):c},f}function Lx(t,e,n,r){if(!e.sprite){var i=t.context,o=t.ratio;i.clearRect(0,0,2048/o,2048/o);var a,s,u,l,c,f=0,d=0,h=0,p=n.length;for(--r;++r<p;){if(e=n[r],i.save(),i.font=e.style+" "+e.weight+" "+~~((e.size+1)/o)+"px "+e.font,a=i.measureText(e.text+"m").width*o,u=e.size<<1,e.rotate){var g=Math.sin(e.rotate*Px),m=Math.cos(e.rotate*Px),b=a*m,y=a*g,v=u*m,x=u*g;a=Math.max(Math.abs(b+x),Math.abs(b-x))+31>>5<<5,u=~~Math.max(Math.abs(y+v),Math.abs(y-v))}else a=a+31>>5<<5;if(u>h&&(h=u),f+a>=2048&&(f=0,d+=h,h=0),d+u>=2048)break;i.translate((f+(a>>1))/o,(d+(u>>1))/o),e.rotate&&i.rotate(e.rotate*Px),i.fillText(e.text,0,0),e.padding&&(i.lineWidth=2*e.padding,i.strokeText(e.text,0,0)),i.restore(),e.width=a,e.height=u,e.xoff=f,e.yoff=d,e.x1=a>>1,e.y1=u>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,f+=a}for(var _=i.getImageData(0,0,2048/o,2048/o).data,O=[];--r>=0;)if((e=n[r]).hasText){for(s=(a=e.width)>>5,u=e.y1-e.y0,l=0;l<u*s;l++)O[l]=0;if(null==(f=e.xoff))return;d=e.yoff;var w=0,j=-1;for(c=0;c<u;c++){for(l=0;l<a;l++){var k=s*c+(l>>5),E=_[2048*(d+c)+(f+l)<<2]?1<<31-l%32:0;O[k]|=E,w|=E}w?j=c:(e.y0++,u--,c--,d++)}e.y1=e.y0+j,e.sprite=O.slice(0,(e.y1-e.y0)*s)}}}function Ix(t,e,n){n>>=5;for(var r,i=t.sprite,o=t.width>>5,a=t.x-(o<<4),s=127&a,u=32-s,l=t.y1-t.y0,c=(t.y+t.y0)*n+(a>>5),f=0;f<l;f++){r=0;for(var d=0;d<=o;d++)if((r<<u|(d<o?(r=i[f*o+d])>>>s:0))&e[c+d])return!0;c+=n}return!1}function Ux(t,e){var n=t[0],r=t[1];e.x+e.x0<n.x&&(n.x=e.x+e.x0),e.y+e.y0<n.y&&(n.y=e.y+e.y0),e.x+e.x1>r.x&&(r.x=e.x+e.x1),e.y+e.y1>r.y&&(r.y=e.y+e.y1)}function qx(t){var e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function Wx(t){return"function"==typeof t?t:function(){return t}}var Yx={archimedean:qx,rectangular:function(t){var e=4*t[0]/t[1],n=0,r=0;return function(t){var i=t<0?-1:1;switch(Math.sqrt(1+4*i*t)-i&3){case 0:n+=e;break;case 1:r+=4;break;case 2:n-=e;break;default:r-=4}return[n,r]}}};const Hx=["x","y","font","fontSize","fontStyle","fontWeight","angle"],Gx=["text","font","rotate","fontSize","fontStyle","fontWeight"];function Vx(t){Pt.call(this,Bx(),t)}Vx.Definition={type:"Wordcloud",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2},{name:"font",type:"string",expr:!0,default:"sans-serif"},{name:"fontStyle",type:"string",expr:!0,default:"normal"},{name:"fontWeight",type:"string",expr:!0,default:"normal"},{name:"fontSize",type:"number",expr:!0,default:14},{name:"fontSizeRange",type:"number",array:"nullable",default:[10,50]},{name:"rotate",type:"number",expr:!0,default:0},{name:"text",type:"field"},{name:"spiral",type:"string",values:["archimedean","rectangular"]},{name:"padding",type:"number",expr:!0},{name:"as",type:"string",array:!0,length:7,default:Hx}]},Object(Z.z)(Vx,Pt,{transform(t,e){!t.size||t.size[0]&&t.size[1]||Object(Z.o)("Wordcloud size dimensions must be non-zero.");const n=t.modified();if(!(n||e.changed(e.ADD_REM)||Gx.some((function(n){const r=t[n];return Object(Z.E)(r)&&e.modified(r.fields)}))))return;const r=e.materialize(e.SOURCE).source,i=this.value,o=t.as||Hx;let a,s=t.fontSize||14;if(Object(Z.E)(s)?a=t.fontSizeRange:s=Object(Z.m)(s),a){const t=s,e=Hs("sqrt")().domain(Object(Z.q)(r,t)).range(a);s=n=>e(t(n))}r.forEach(t=>{t[o[0]]=NaN,t[o[1]]=NaN,t[o[3]]=0});const u=i.words(r).text(t.text).size(t.size||[500,500]).padding(t.padding||1).spiral(t.spiral||"archimedean").rotate(t.rotate||0).font(t.font||"sans-serif").fontStyle(t.fontStyle||"normal").fontWeight(t.fontWeight||"normal").fontSize(s).random(ee).layout(),l=i.size(),c=l[0]>>1,f=l[1]>>1,d=u.length;for(let t,e,n=0;n<d;++n)t=u[n],e=t.datum,e[o[0]]=t.x+c,e[o[1]]=t.y+f,e[o[2]]=t.font,e[o[3]]=t.size,e[o[4]]=t.style,e[o[5]]=t.weight,e[o[6]]=t.rotate;return e.reflow(n).modifies(o)}});const Xx=t=>new Uint8Array(t),Jx=t=>new Uint16Array(t),Kx=t=>new Uint32Array(t);function Zx(t,e,n){const r=(e<257?Xx:e<65537?Jx:Kx)(t);return n&&r.set(n),r}function Qx(t,e,n){const r=1<<e;return{one:r,zero:~r,range:n.slice(),bisect:t.bisect,index:t.index,size:t.size,onAdd(t,e){const n=this.bisect(this.range,t.value),i=t.index,o=n[0],a=n[1],s=i.length;let u;for(u=0;u<o;++u)e[i[u]]|=r;for(u=a;u<s;++u)e[i[u]]|=r;return this}}}function t_(){let t=Kx(0),e=[],n=0;return{insert:function(r,i,o){if(!i.length)return[];const a=n,s=i.length,u=Kx(s);let l,c,f,d=Array(s);for(f=0;f<s;++f)d[f]=r(i[f]),u[f]=f;if(d=function(t,e){return t.sort.call(e,(e,n)=>{const r=t[e],i=t[n];return r<i?-1:r>i?1:0}),function(t,e){return Array.from(e,e=>t[e])}(t,e)}(d,u),a)l=e,c=t,e=Array(a+s),t=Kx(a+s),function(t,e,n,r,i,o,a,s,u){let l,c=0,f=0;for(l=0;c<r&&f<a;++l)e[c]<i[f]?(s[l]=e[c],u[l]=n[c++]):(s[l]=i[f],u[l]=o[f++]+t);for(;c<r;++c,++l)s[l]=e[c],u[l]=n[c];for(;f<a;++f,++l)s[l]=i[f],u[l]=o[f]+t}(o,l,c,a,d,u,s,e,t);else{if(o>0)for(f=0;f<s;++f)u[f]+=o;e=d,t=u}return n=a+s,{index:u,value:d}},remove:function(r,i){const o=n;let a,s,u;for(s=0;!i[t[s]]&&s<o;++s);for(u=s;s<o;++s)i[a=t[s]]||(t[u]=a,e[u]=e[s],++u);n=o-r},bisect:function(t,r){let i;return r?i=r.length:(r=e,i=n),[$i(r,t[0],0,i),Ti(r,t[1],0,i)]},reindex:function(e){for(let r=0,i=n;r<i;++r)t[r]=e[t[r]]},index:()=>t,size:()=>n}}function e_(t){Pt.call(this,function(){let t=8,e=[],n=Kx(0),r=Zx(0,t),i=Zx(0,t);return{data:()=>e,seen:()=>{return t=n,r=e.length,n=t.length>=r?t:((i=i||new t.constructor(r)).set(t),i);var t,r,i},add(t){for(let n,r=0,i=e.length,o=t.length;r<o;++r)n=t[r],n._index=i++,e.push(n)},remove(t,n){const o=e.length,a=Array(o-t),s=e;let u,l,c;for(l=0;!n[l]&&l<o;++l)a[l]=e[l],s[l]=l;for(c=l;l<o;++l)u=e[l],n[l]?s[l]=-1:(s[l]=c,r[c]=r[l],i[c]=i[l],a[c]=u,u._index=c++),r[l]=0;return e=a,s},size:()=>e.length,curr:()=>r,prev:()=>i,reset:t=>i[t]=r[t],all:()=>t<257?255:t<65537?65535:4294967295,set(t,e){r[t]|=e},clear(t,e){r[t]&=~e},resize(e,n){(e>r.length||n>t)&&(t=Math.max(n,t),r=Zx(e,t,r),i=Zx(e,t))}}}(),t),this._indices=null,this._dims=null}function n_(t){Pt.call(this,null,t)}e_.Definition={type:"CrossFilter",metadata:{},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"query",type:"array",array:!0,required:!0,content:{type:"number",array:!0,length:2}}]},Object(Z.z)(e_,Pt,{transform(t,e){return this._dims?t.modified("fields")||t.fields.some(t=>e.modified(t.fields))?this.reinit(t,e):this.eval(t,e):this.init(t,e)},init(t,e){const n=t.fields,r=t.query,i=this._indices={},o=this._dims=[],a=r.length;let s,u,l=0;for(;l<a;++l)s=n[l].fname,u=i[s]||(i[s]=t_()),o.push(Qx(u,l,r[l]));return this.eval(t,e)},reinit(t,e){const n=e.materialize().fork(),r=t.fields,i=t.query,o=this._indices,a=this._dims,s=this.value,u=s.curr(),l=s.prev(),c=s.all(),f=n.rem=n.add,d=n.mod,h=i.length,p={};let g,m,b,y,v,x,_,O,w;if(l.set(u),e.rem.length&&(v=this.remove(t,e,n)),e.add.length&&s.add(e.add),e.mod.length)for(x={},y=e.mod,_=0,O=y.length;_<O;++_)x[y[_]._index]=1;for(_=0;_<h;++_)w=r[_],(!a[_]||t.modified("fields",_)||e.modified(w.fields))&&(b=w.fname,(g=p[b])||(o[b]=m=t_(),p[b]=g=m.insert(w,e.source,0)),a[_]=Qx(m,_,i[_]).onAdd(g,u));for(_=0,O=s.data().length;_<O;++_)v[_]||(l[_]!==u[_]?f.push(_):x[_]&&u[_]!==c&&d.push(_));return s.mask=(1<<h)-1,n},eval(t,e){const n=e.materialize().fork(),r=this._dims.length;let i=0;return e.rem.length&&(this.remove(t,e,n),i|=(1<<r)-1),t.modified("query")&&!t.modified("fields")&&(i|=this.update(t,e,n)),e.add.length&&(this.insert(t,e,n),i|=(1<<r)-1),e.mod.length&&(this.modify(e,n),i|=(1<<r)-1),this.value.mask=i,n},insert(t,e,n){const r=e.add,i=this.value,o=this._dims,a=this._indices,s=t.fields,u={},l=n.add,c=i.size()+r.length,f=o.length;let d,h,p,g=i.size();i.resize(c,f),i.add(r);const m=i.curr(),b=i.prev(),y=i.all();for(d=0;d<f;++d)h=s[d].fname,p=u[h]||(u[h]=a[h].insert(s[d],r,g)),o[d].onAdd(p,m);for(;g<c;++g)b[g]=y,m[g]!==y&&l.push(g)},modify(t,e){const n=e.mod,r=this.value,i=r.curr(),o=r.all(),a=t.mod;let s,u,l;for(s=0,u=a.length;s<u;++s)l=a[s]._index,i[l]!==o&&n.push(l)},remove(t,e,n){const r=this._indices,i=this.value,o=i.curr(),a=i.prev(),s=i.all(),u={},l=n.rem,c=e.rem;let f,d,h,p;for(f=0,d=c.length;f<d;++f)h=c[f]._index,u[h]=1,a[h]=p=o[h],o[h]=s,p!==s&&l.push(h);for(h in r)r[h].remove(d,u);return this.reindex(e,d,u),u},reindex(t,e,n){const r=this._indices,i=this.value;t.runAfter(()=>{const t=i.remove(e,n);for(const e in r)r[e].reindex(t)})},update(t,e,n){const r=this._dims,i=t.query,o=e.stamp,a=r.length;let s,u,l=0;for(n.filters=0,u=0;u<a;++u)t.modified("query",u)&&(s=u,++l);if(1===l)l=r[s].one,this.incrementOne(r[s],i[s],n.add,n.rem);else for(u=0,l=0;u<a;++u)t.modified("query",u)&&(l|=r[u].one,this.incrementAll(r[u],i[u],o,n.add),n.rem=n.add);return l},incrementAll(t,e,n,r){const i=this.value,o=i.seen(),a=i.curr(),s=i.prev(),u=t.index(),l=t.bisect(t.range),c=t.bisect(e),f=c[0],d=c[1],h=l[0],p=l[1],g=t.one;let m,b,y;if(f<h)for(m=f,b=Math.min(h,d);m<b;++m)y=u[m],o[y]!==n&&(s[y]=a[y],o[y]=n,r.push(y)),a[y]^=g;else if(f>h)for(m=h,b=Math.min(f,p);m<b;++m)y=u[m],o[y]!==n&&(s[y]=a[y],o[y]=n,r.push(y)),a[y]^=g;if(d>p)for(m=Math.max(f,p),b=d;m<b;++m)y=u[m],o[y]!==n&&(s[y]=a[y],o[y]=n,r.push(y)),a[y]^=g;else if(d<p)for(m=Math.max(h,d),b=p;m<b;++m)y=u[m],o[y]!==n&&(s[y]=a[y],o[y]=n,r.push(y)),a[y]^=g;t.range=e.slice()},incrementOne(t,e,n,r){const i=this.value.curr(),o=t.index(),a=t.bisect(t.range),s=t.bisect(e),u=s[0],l=s[1],c=a[0],f=a[1],d=t.one;let h,p,g;if(u<c)for(h=u,p=Math.min(c,l);h<p;++h)g=o[h],i[g]^=d,n.push(g);else if(u>c)for(h=c,p=Math.min(u,f);h<p;++h)g=o[h],i[g]^=d,r.push(g);if(l>f)for(h=Math.max(u,f),p=l;h<p;++h)g=o[h],i[g]^=d,n.push(g);else if(l<f)for(h=Math.max(c,l),p=f;h<p;++h)g=o[h],i[g]^=d,r.push(g);t.range=e.slice()}}),n_.Definition={type:"ResolveFilter",metadata:{},params:[{name:"ignore",type:"number",required:!0,description:"A bit mask indicating which filters to ignore."},{name:"filter",type:"object",required:!0,description:"Per-tuple filter bitmaps from a CrossFilter transform."}]},Object(Z.z)(n_,Pt,{transform(t,e){const n=~(t.ignore||0),r=t.filter,i=r.mask;if(0==(i&n))return e.StopPropagation;const o=e.fork(e.ALL),a=r.data(),s=r.curr(),u=r.prev(),l=t=>s[t]&n?null:a[t];return o.filter(o.MOD,l),i&i-1?(o.filter(o.ADD,t=>{const e=s[t]&n;return!e&&e^u[t]&n?a[t]:null}),o.filter(o.REM,t=>{const e=s[t]&n;return e&&!(e^e^u[t]&n)?a[t]:null})):(o.filter(o.ADD,l),o.filter(o.REM,t=>(s[t]&n)===i?a[t]:null)),o.filter(o.SOURCE,t=>l(t._index))}});function r_(t){this.type=t}var i_,o_,a_,s_,u_;r_.prototype.visit=function(t){let e,n,r;if(t(this))return 1;for(e=function(t){switch(t.type){case"ArrayExpression":return t.elements;case"BinaryExpression":case"LogicalExpression":return[t.left,t.right];case"CallExpression":return[t.callee].concat(t.arguments);case"ConditionalExpression":return[t.test,t.consequent,t.alternate];case"MemberExpression":return[t.object,t.property];case"ObjectExpression":return t.properties;case"Property":return[t.key,t.value];case"UnaryExpression":return[t.argument];case"Identifier":case"Literal":case"RawCode":default:return[]}}(this),n=0,r=e.length;n<r;++n)if(e[n].visit(t))return 1};(i_={})[1]="Boolean",i_[2]="<end>",i_[3]="Identifier",i_[4]="Keyword",i_[5]="Null",i_[6]="Numeric",i_[7]="Punctuator",i_[8]="String",i_[9]="RegularExpression";var l_="ILLEGAL",c_=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]"),f_=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 d_(t,e){if(!t)throw new Error("ASSERT: "+e)}function h_(t){return t>=48&&t<=57}function p_(t){return"0123456789abcdefABCDEF".indexOf(t)>=0}function g_(t){return"01234567".indexOf(t)>=0}function m_(t){return 32===t||9===t||11===t||12===t||160===t||t>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(t)>=0}function b_(t){return 10===t||13===t||8232===t||8233===t}function y_(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||92===t||t>=128&&c_.test(String.fromCharCode(t))}function v_(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||92===t||t>=128&&f_.test(String.fromCharCode(t))}const x_={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 __(){for(;a_<s_;){const t=o_.charCodeAt(a_);if(!m_(t)&&!b_(t))break;++a_}}function O_(t){var e,n,r,i=0;for(n="u"===t?4:2,e=0;e<n;++e)a_<s_&&p_(o_[a_])?(r=o_[a_++],i=16*i+"0123456789abcdef".indexOf(r.toLowerCase())):P_({},"Unexpected token %0",l_);return String.fromCharCode(i)}function w_(){var t,e,n,r;for(e=0,"}"===(t=o_[a_])&&P_({},"Unexpected token %0",l_);a_<s_&&p_(t=o_[a_++]);)e=16*e+"0123456789abcdef".indexOf(t.toLowerCase());return(e>1114111||"}"!==t)&&P_({},"Unexpected token %0",l_),e<=65535?String.fromCharCode(e):(n=55296+(e-65536>>10),r=56320+(e-65536&1023),String.fromCharCode(n,r))}function j_(){var t,e;for(t=o_.charCodeAt(a_++),e=String.fromCharCode(t),92===t&&(117!==o_.charCodeAt(a_)&&P_({},"Unexpected token %0",l_),++a_,(t=O_("u"))&&"\\"!==t&&y_(t.charCodeAt(0))||P_({},"Unexpected token %0",l_),e=t);a_<s_&&v_(t=o_.charCodeAt(a_));)++a_,e+=String.fromCharCode(t),92===t&&(e=e.substr(0,e.length-1),117!==o_.charCodeAt(a_)&&P_({},"Unexpected token %0",l_),++a_,(t=O_("u"))&&"\\"!==t&&v_(t.charCodeAt(0))||P_({},"Unexpected token %0",l_),e+=t);return e}function k_(){var t,e;return t=a_,{type:1===(e=92===o_.charCodeAt(a_)?j_():function(){var t,e;for(t=a_++;a_<s_;){if(92===(e=o_.charCodeAt(a_)))return a_=t,j_();if(!v_(e))break;++a_}return o_.slice(t,a_)}()).length?3:x_.hasOwnProperty(e)?4:"null"===e?5:"true"===e||"false"===e?1:3,value:e,start:t,end:a_}}function E_(){var t,e,n,r,i=a_,o=o_.charCodeAt(a_),a=o_[a_];switch(o){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++a_,{type:7,value:String.fromCharCode(o),start:i,end:a_};default:if(61===(t=o_.charCodeAt(a_+1)))switch(o){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return a_+=2,{type:7,value:String.fromCharCode(o)+String.fromCharCode(t),start:i,end:a_};case 33:case 61:return a_+=2,61===o_.charCodeAt(a_)&&++a_,{type:7,value:o_.slice(i,a_),start:i,end:a_}}}return">>>="===(r=o_.substr(a_,4))?{type:7,value:r,start:i,end:a_+=4}:">>>"===(n=r.substr(0,3))||"<<="===n||">>="===n?{type:7,value:n,start:i,end:a_+=3}:a===(e=n.substr(0,2))[1]&&"+-<>&|".indexOf(a)>=0||"=>"===e?{type:7,value:e,start:i,end:a_+=2}:"<>=!+-*%&|^/".indexOf(a)>=0?{type:7,value:a,start:i,end:++a_}:void P_({},"Unexpected token %0",l_)}function A_(){var t,e,n;if(d_(h_((n=o_[a_]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),e=a_,t="","."!==n){if(t=o_[a_++],n=o_[a_],"0"===t){if("x"===n||"X"===n)return++a_,function(t){let e="";for(;a_<s_&&p_(o_[a_]);)e+=o_[a_++];return 0===e.length&&P_({},"Unexpected token %0",l_),y_(o_.charCodeAt(a_))&&P_({},"Unexpected token %0",l_),{type:6,value:parseInt("0x"+e,16),start:t,end:a_}}(e);if(g_(n))return function(t){let e="0"+o_[a_++];for(;a_<s_&&g_(o_[a_]);)e+=o_[a_++];return(y_(o_.charCodeAt(a_))||h_(o_.charCodeAt(a_)))&&P_({},"Unexpected token %0",l_),{type:6,value:parseInt(e,8),octal:!0,start:t,end:a_}}(e);n&&h_(n.charCodeAt(0))&&P_({},"Unexpected token %0",l_)}for(;h_(o_.charCodeAt(a_));)t+=o_[a_++];n=o_[a_]}if("."===n){for(t+=o_[a_++];h_(o_.charCodeAt(a_));)t+=o_[a_++];n=o_[a_]}if("e"===n||"E"===n)if(t+=o_[a_++],"+"!==(n=o_[a_])&&"-"!==n||(t+=o_[a_++]),h_(o_.charCodeAt(a_)))for(;h_(o_.charCodeAt(a_));)t+=o_[a_++];else P_({},"Unexpected token %0",l_);return y_(o_.charCodeAt(a_))&&P_({},"Unexpected token %0",l_),{type:6,value:parseFloat(t),start:e,end:a_}}function D_(){var t,e,n,r;return u_=null,__(),t=a_,e=function(){var t,e,n,r;for(d_("/"===(t=o_[a_]),"Regular expression literal must start with a slash"),e=o_[a_++],n=!1,r=!1;a_<s_;)if(e+=t=o_[a_++],"\\"===t)b_((t=o_[a_++]).charCodeAt(0))&&P_({},"Invalid regular expression: missing /"),e+=t;else if(b_(t.charCodeAt(0)))P_({},"Invalid regular expression: missing /");else if(n)"]"===t&&(n=!1);else{if("/"===t){r=!0;break}"["===t&&(n=!0)}return r||P_({},"Invalid regular expression: missing /"),{value:e.substr(1,e.length-2),literal:e}}(),n=function(){var t,e,n;for(e="",n="";a_<s_&&v_((t=o_[a_]).charCodeAt(0));)++a_,"\\"===t&&a_<s_?P_({},"Unexpected token %0",l_):(n+=t,e+=t);return n.search(/[^gimuy]/g)>=0&&P_({},"Invalid regular expression",n),{value:n,literal:e}}(),r=function(t,e){let n=t;e.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,(t,e)=>{if(parseInt(e,16)<=1114111)return"x";P_({},"Invalid regular expression")}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(t){P_({},"Invalid regular expression")}try{return new RegExp(t,e)}catch(t){return null}}(e.value,n.value),{literal:e.literal+n.literal,value:r,regex:{pattern:e.value,flags:n.value},start:t,end:a_}}function M_(){if(__(),a_>=s_)return{type:2,start:a_,end:a_};const t=o_.charCodeAt(a_);return y_(t)?k_():40===t||41===t||59===t?E_():39===t||34===t?function(){var t,e,n,r,i="",o=!1;for(d_("'"===(t=o_[a_])||'"'===t,"String literal must starts with a quote"),e=a_,++a_;a_<s_;){if((n=o_[a_++])===t){t="";break}if("\\"===n)if((n=o_[a_++])&&b_(n.charCodeAt(0)))"\r"===n&&"\n"===o_[a_]&&++a_;else switch(n){case"u":case"x":"{"===o_[a_]?(++a_,i+=w_()):i+=O_(n);break;case"n":i+="\n";break;case"r":i+="\r";break;case"t":i+="\t";break;case"b":i+="\b";break;case"f":i+="\f";break;case"v":i+="\v";break;default:g_(n)?(0!==(r="01234567".indexOf(n))&&(o=!0),a_<s_&&g_(o_[a_])&&(o=!0,r=8*r+"01234567".indexOf(o_[a_++]),"0123".indexOf(n)>=0&&a_<s_&&g_(o_[a_])&&(r=8*r+"01234567".indexOf(o_[a_++]))),i+=String.fromCharCode(r)):i+=n}else{if(b_(n.charCodeAt(0)))break;i+=n}}return""!==t&&P_({},"Unexpected token %0",l_),{type:8,value:i,octal:o,start:e,end:a_}}():46===t?h_(o_.charCodeAt(a_+1))?A_():E_():h_(t)?A_():E_()}function S_(){const t=u_;return a_=t.end,u_=M_(),a_=t.end,t}function C_(){const t=a_;u_=M_(),a_=t}function F_(t,e,n){const r=new r_("||"===t||"&&"===t?"LogicalExpression":"BinaryExpression");return r.operator=t,r.left=e,r.right=n,r}function z_(t,e){const n=new r_("CallExpression");return n.callee=t,n.arguments=e,n}function T_(t){const e=new r_("Identifier");return e.name=t,e}function $_(t){const e=new r_("Literal");return e.value=t.value,e.raw=o_.slice(t.start,t.end),t.regex&&("//"===e.raw&&(e.raw="/(?:)/"),e.regex=t.regex),e}function N_(t,e,n){const r=new r_("MemberExpression");return r.computed="["===t,r.object=e,r.property=n,r.computed||(n.member=!0),r}function R_(t,e,n){const r=new r_("Property");return r.key=e,r.value=n,r.kind=t,r}function P_(t,e){var n,r=Array.prototype.slice.call(arguments,2),i=e.replace(/%(\d)/g,(t,e)=>(d_(e<r.length,"Message reference must be in range"),r[e]));throw(n=new Error(i)).index=a_,n.description=i,n}function B_(t){2===t.type&&P_(t,"Unexpected end of input"),6===t.type&&P_(t,"Unexpected number"),8===t.type&&P_(t,"Unexpected string"),3===t.type&&P_(t,"Unexpected identifier"),4===t.type&&P_(t,"Unexpected reserved word"),P_(t,"Unexpected token %0",t.value)}function L_(t){const e=S_();7===e.type&&e.value===t||B_(e)}function I_(t){return 7===u_.type&&u_.value===t}function U_(t){return 4===u_.type&&u_.value===t}function q_(){const t=[];for(a_=u_.start,L_("[");!I_("]");)I_(",")?(S_(),t.push(null)):(t.push(eO()),I_("]")||L_(","));return S_(),function(t){const e=new r_("ArrayExpression");return e.elements=t,e}(t)}function W_(){a_=u_.start;const t=S_();return 8===t.type||6===t.type?(t.octal&&P_(t,"Octal literals are not allowed in strict mode."),$_(t)):T_(t.value)}function Y_(){var t,e,n;return a_=u_.start,3===(t=u_).type?(n=W_(),L_(":"),R_("init",n,eO())):2!==t.type&&7!==t.type?(e=W_(),L_(":"),R_("init",e,eO())):void B_(t)}function H_(){var t,e,n=[],r={},i=String;for(a_=u_.start,L_("{");!I_("}");)e="$"+("Identifier"===(t=Y_()).key.type?t.key.name:i(t.key.value)),Object.prototype.hasOwnProperty.call(r,e)?P_({},"Duplicate data property in object literal not allowed in strict mode"):r[e]=!0,n.push(t),I_("}")||L_(",");return L_("}"),function(t){const e=new r_("ObjectExpression");return e.properties=t,e}(n)}const G_={if:1};function V_(){var t,e,n;if(I_("("))return function(){L_("(");const t=nO();return L_(")"),t}();if(I_("["))return q_();if(I_("{"))return H_();if(t=u_.type,a_=u_.start,3===t||G_[u_.value])n=T_(S_().value);else if(8===t||6===t)u_.octal&&P_(u_,"Octal literals are not allowed in strict mode."),n=$_(S_());else{if(4===t)throw new Error("Disabled.");1===t?((e=S_()).value="true"===e.value,n=$_(e)):5===t?((e=S_()).value=null,n=$_(e)):I_("/")||I_("/=")?(n=$_(D_()),C_()):B_(S_())}return n}function X_(){const t=[];if(L_("("),!I_(")"))for(;a_<s_&&(t.push(eO()),!I_(")"));)L_(",");return L_(")"),t}function J_(){return L_("."),function(){a_=u_.start;const t=S_();return function(t){return 3===t.type||4===t.type||1===t.type||5===t.type}(t)||B_(t),T_(t.value)}()}function K_(){L_("[");const t=nO();return L_("]"),t}function Z_(){const t=function(){var t;for(t=V_();;)if(I_("."))t=N_(".",t,J_());else if(I_("("))t=z_(t,X_());else{if(!I_("["))break;t=N_("[",t,K_())}return t}();if(7===u_.type&&(I_("++")||I_("--")))throw new Error("Disabled.");return t}function Q_(){var t,e;if(7!==u_.type&&4!==u_.type)e=Z_();else{if(I_("++")||I_("--"))throw new Error("Disabled.");if(I_("+")||I_("-")||I_("~")||I_("!"))t=S_(),e=Q_(),e=function(t,e){const n=new r_("UnaryExpression");return n.operator=t,n.argument=e,n.prefix=!0,n}(t.value,e);else{if(U_("delete")||U_("void")||U_("typeof"))throw new Error("Disabled.");e=Z_()}}return e}function tO(t){let e=0;if(7!==t.type&&4!==t.type)return 0;switch(t.value){case"||":e=1;break;case"&&":e=2;break;case"|":e=3;break;case"^":e=4;break;case"&":e=5;break;case"==":case"!=":case"===":case"!==":e=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":e=7;break;case"<<":case">>":case">>>":e=8;break;case"+":case"-":e=9;break;case"*":case"/":case"%":e=11}return e}function eO(){var t,e;return t=function(){var t,e,n,r,i,o,a,s,u,l;if(t=u_,u=Q_(),0===(i=tO(r=u_)))return u;for(r.prec=i,S_(),e=[t,u_],o=[u,r,a=Q_()];(i=tO(u_))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)a=o.pop(),s=o.pop().value,u=o.pop(),e.pop(),n=F_(s,u,a),o.push(n);(r=S_()).prec=i,o.push(r),e.push(u_),n=Q_(),o.push(n)}for(n=o[l=o.length-1],e.pop();l>1;)e.pop(),n=F_(o[l-1].value,o[l-2],n),l-=2;return n}(),I_("?")&&(S_(),e=eO(),L_(":"),t=function(t,e,n){const r=new r_("ConditionalExpression");return r.test=t,r.consequent=e,r.alternate=n,r}(t,e,eO())),t}function nO(){const t=eO();if(I_(","))throw new Error("Disabled.");return t}function rO(t){a_=0,s_=(o_=t).length,u_=null,C_();const e=nO();if(2!==u_.type)throw new Error("Unexpect token after expression.");return e}var iO={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"};function oO(t){function e(e,n,r){return i=>function(e,n,r,i){let o=t(n[0]);return r&&(o=r+"("+o+")",0===r.lastIndexOf("new ",0)&&(o="("+o+")")),o+"."+e+(i<0?"":0===i?"()":"("+n.slice(1).map(t).join(",")+")")}(e,i,n,r)}const n="new Date";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(e){e.length<3&&Object(Z.o)("Missing arguments to clamp function."),e.length>3&&Object(Z.o)("Too many arguments to clamp function.");const n=e.map(t);return"Math.max("+n[1]+", Math.min("+n[2]+","+n[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:n,date:e("getDate",n,0),day:e("getDay",n,0),year:e("getFullYear",n,0),month:e("getMonth",n,0),hours:e("getHours",n,0),minutes:e("getMinutes",n,0),seconds:e("getSeconds",n,0),milliseconds:e("getMilliseconds",n,0),time:e("getTime",n,0),timezoneoffset:e("getTimezoneOffset",n,0),utcdate:e("getUTCDate",n,0),utcday:e("getUTCDay",n,0),utcyear:e("getUTCFullYear",n,0),utcmonth:e("getUTCMonth",n,0),utchours:e("getUTCHours",n,0),utcminutes:e("getUTCMinutes",n,0),utcseconds:e("getUTCSeconds",n,0),utcmilliseconds:e("getUTCMilliseconds",n,0),length:e("length",null,-1),join:e("join",null),indexof:e("indexOf",null),lastindexof:e("lastIndexOf",null),slice:e("slice",null),reverse:function(e){return"("+t(e[0])+").slice().reverse()"},parseFloat:"parseFloat",parseInt:"parseInt",upper:e("toUpperCase","String",0),lower:e("toLowerCase","String",0),substring:e("substring","String"),split:e("split","String"),replace:e("replace","String"),trim:e("trim","String",0),regexp:"RegExp",test:e("test","RegExp"),if:function(e){e.length<3&&Object(Z.o)("Missing arguments to if function."),e.length>3&&Object(Z.o)("Too many arguments to if function.");const n=e.map(t);return"("+n[0]+"?"+n[1]+":"+n[2]+")"}}}var aO,sO,uO,lO,cO,fO=new lp,dO=new lp,hO={point:Cp,lineStart:Cp,lineEnd:Cp,polygonStart:function(){fO=new lp,hO.lineStart=pO,hO.lineEnd=gO},polygonEnd:function(){var t=+fO;dO.add(t<0?hp+t:t),this.lineStart=this.lineEnd=this.point=Cp},sphere:function(){dO.add(hp)}};function pO(){hO.point=mO}function gO(){bO(aO,sO)}function mO(t,e){hO.point=bO,aO=t,sO=e,uO=t*=gp,lO=vp(e=(e*=gp)/2+dp),cO=kp(e)}function bO(t,e){var n=(t*=gp)-uO,r=n>=0?1:-1,i=r*n,o=vp(e=(e*=gp)/2+dp),a=kp(e),s=cO*a,u=lO*o+s*vp(i),l=s*r*kp(i);fO.add(yp(l,u)),uO=t,lO=o,cO=a}var yO,vO,xO,_O,OO,wO,jO,kO,EO,AO,DO,MO={point:SO,lineStart:FO,lineEnd:zO,polygonStart:function(){MO.point=TO,MO.lineStart=$O,MO.lineEnd=NO,EO=new lp,hO.polygonStart()},polygonEnd:function(){hO.polygonEnd(),MO.point=SO,MO.lineStart=FO,MO.lineEnd=zO,fO<0?(yO=-(xO=180),vO=-(_O=90)):EO>1e-6?_O=90:EO<-1e-6&&(vO=-90),DO[0]=yO,DO[1]=xO},sphere:function(){yO=-(xO=180),vO=-(_O=90)}};function SO(t,e){AO.push(DO=[yO=t,xO=t]),e<vO&&(vO=e),e>_O&&(_O=e)}function CO(t,e){var n=Bg([t*gp,e*gp]);if(kO){var r=Ig(kO,n),i=Ig([r[1],-r[0],0],r);Wg(i),i=Pg(i);var o,a=t-OO,s=a>0?1:-1,u=i[0]*pp*s,l=mp(a)>180;l^(s*OO<u&&u<s*t)?(o=i[1]*pp)>_O&&(_O=o):l^(s*OO<(u=(u+360)%360-180)&&u<s*t)?(o=-i[1]*pp)<vO&&(vO=o):(e<vO&&(vO=e),e>_O&&(_O=e)),l?t<OO?RO(yO,t)>RO(yO,xO)&&(xO=t):RO(t,xO)>RO(yO,xO)&&(yO=t):xO>=yO?(t<yO&&(yO=t),t>xO&&(xO=t)):t>OO?RO(yO,t)>RO(yO,xO)&&(xO=t):RO(t,xO)>RO(yO,xO)&&(yO=t)}else AO.push(DO=[yO=t,xO=t]);e<vO&&(vO=e),e>_O&&(_O=e),kO=n,OO=t}function FO(){MO.point=CO}function zO(){DO[0]=yO,DO[1]=xO,MO.point=SO,kO=null}function TO(t,e){if(kO){var n=t-OO;EO.add(mp(n)>180?n+(n>0?360:-360):n)}else wO=t,jO=e;hO.point(t,e),CO(t,e)}function $O(){hO.lineStart()}function NO(){TO(wO,jO),hO.lineEnd(),mp(EO)>1e-6&&(yO=-(xO=180)),DO[0]=yO,DO[1]=xO,kO=null}function RO(t,e){return(e-=t)<0?e+360:e}function PO(t,e){return t[0]-e[0]}function BO(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}var LO,IO,UO,qO,WO,YO,HO,GO,VO,XO,JO,KO,ZO,QO,tw,ew,nw={sphere:Cp,point:rw,lineStart:ow,lineEnd:uw,polygonStart:function(){nw.lineStart=lw,nw.lineEnd=cw},polygonEnd:function(){nw.lineStart=ow,nw.lineEnd=uw}};function rw(t,e){t*=gp;var n=vp(e*=gp);iw(n*vp(t),n*kp(t),kp(e))}function iw(t,e,n){++LO,UO+=(t-UO)/LO,qO+=(e-qO)/LO,WO+=(n-WO)/LO}function ow(){nw.point=aw}function aw(t,e){t*=gp;var n=vp(e*=gp);QO=n*vp(t),tw=n*kp(t),ew=kp(e),nw.point=sw,iw(QO,tw,ew)}function sw(t,e){t*=gp;var n=vp(e*=gp),r=n*vp(t),i=n*kp(t),o=kp(e),a=yp(Ap((a=tw*o-ew*i)*a+(a=ew*r-QO*o)*a+(a=QO*i-tw*r)*a),QO*r+tw*i+ew*o);IO+=a,YO+=a*(QO+(QO=r)),HO+=a*(tw+(tw=i)),GO+=a*(ew+(ew=o)),iw(QO,tw,ew)}function uw(){nw.point=rw}function lw(){nw.point=fw}function cw(){dw(KO,ZO),nw.point=rw}function fw(t,e){KO=t,ZO=e,t*=gp,e*=gp,nw.point=dw;var n=vp(e);QO=n*vp(t),tw=n*kp(t),ew=kp(e),iw(QO,tw,ew)}function dw(t,e){t*=gp;var n=vp(e*=gp),r=n*vp(t),i=n*kp(t),o=kp(e),a=tw*o-ew*i,s=ew*r-QO*o,u=QO*i-tw*r,l=Op(a,s,u),c=Sp(l),f=l&&-c/l;VO.add(f*a),XO.add(f*s),JO.add(f*u),IO+=c,YO+=c*(QO+(QO=r)),HO+=c*(tw+(tw=i)),GO+=c*(ew+(ew=o)),iw(QO,tw,ew)}function hw(t,e){for(var n,r,i=e.fields,o=e.values,a=i.length,s=0;s<a;++s)if((r=i[s]).getter=Z.u.getter||Object(Z.u)(r.field),n=r.getter(t),Object(Z.D)(n)&&(n=Object(Z.db)(n)),Object(Z.D)(o[s])&&(o[s]=Object(Z.db)(o[s])),Object(Z.D)(o[s][0])&&(o[s]=o[s].map(Z.db)),"E"===r.type){if(Object(Z.B)(o[s])?o[s].indexOf(n)<0:n!==o[s])return!1}else if("R"===r.type){if(!Object(Z.A)(n,o[s]))return!1}else if("R-RE"===r.type){if(!Object(Z.A)(n,o[s],!0,!1))return!1}else if("R-E"===r.type){if(!Object(Z.A)(n,o[s],!1,!1))return!1}else if("R-LE"===r.type&&!Object(Z.A)(n,o[s],!1,!0))return!1;return!0}var pw={E_union:function(t,e){if(!t.length)return e;for(var n=0,r=e.length;n<r;++n)t.indexOf(e[n])<0&&t.push(e[n]);return t},E_intersect:function(t,e){return t.length?t.filter(t=>e.indexOf(t)>=0):e},R_union:function(t,e){var n=Object(Z.db)(e[0]),r=Object(Z.db)(e[1]);return n>r&&(n=e[1],r=e[0]),t.length?(t[0]>n&&(t[0]=n),t[1]<r&&(t[1]=r),t):[n,r]},R_intersect:function(t,e){var n=Object(Z.db)(e[0]),r=Object(Z.db)(e[1]);return n>r&&(n=e[1],r=e[0]),t.length?r<t[0]||t[1]<n?[]:(t[0]<n&&(t[0]=n),t[1]>r&&(t[1]=r),t):[n,r]}};function gw(t,e,n,r){"Literal"!==e[0].type&&Object(Z.o)("First argument to selection functions must be a string literal.");const i=e[0].value,o=":"+i;"intersect"!==(e.length>=2&&Object(Z.V)(e).value)||Object(Z.w)(r,"@unit")||(r["@unit"]=n.getData(i).indataRef(n,"unit")),Object(Z.w)(r,o)||(r[o]=n.getData(i).tuplesRef())}function mw(t){const e=this.context.data[t];return e?e.values.value:[]}const bw=t=>function(e,n){return this.context.dataflow.locale()[t](n)(e)},yw=bw("format"),vw=bw("timeFormat"),xw=bw("utcFormat"),_w=bw("timeParse"),Ow=bw("utcParse"),ww=new Date(2e3,0,1);function jw(t,e,n){return Number.isInteger(t)&&Number.isInteger(e)?(ww.setYear(2e3),ww.setMonth(t),ww.setDate(e),vw.call(this,ww,n)):""}function kw(t,e,n,r){"Literal"!==e[0].type&&Object(Z.o)("First argument to data functions must be a string literal.");const i=e[0].value,o=":"+i;if(!Object(Z.w)(o,r))try{r[o]=n.getData(i).tuplesRef()}catch(t){}}function Ew(t,e,n,r){if("Literal"===e[0].type)Aw(n,r,e[0].value);else for(t in n.scales)Aw(n,r,t)}function Aw(t,e,n){const r="%"+n;if(!Object(Z.w)(e,r))try{e[r]=t.scaleRef(n)}catch(t){}}function Dw(t,e){let n;return Object(Z.E)(t)?t:Object(Z.I)(t)?(n=e.scales[t])&&n.value:void 0}function Mw(t,e,n){e.__bandwidth=t=>t&&t.bandwidth?t.bandwidth():0,n._bandwidth=Ew,n._range=Ew,n._scale=Ew;const r=e=>"_["+("Literal"===e.type?Object(Z.ab)("%"+e.value):Object(Z.ab)("%")+"+"+t(e))+"]";return{_bandwidth:t=>"this.__bandwidth(".concat(r(t[0]),")"),_range:t=>"".concat(r(t[0]),".range()"),_scale:e=>"".concat(r(e[0]),"(").concat(t(e[1]),")")}}function Sw(t,e){return function(n,r,i){if(n){const e=Dw(n,(i||this).context);return e&&e.path[t](r)}return e(r)}}const Cw=Sw("area",(function(t){return dO=new lp,up(t,hO),2*dO})),Fw=Sw("bounds",(function(t){var e,n,r,i,o,a,s;if(_O=xO=-(yO=vO=1/0),AO=[],up(t,MO),n=AO.length){for(AO.sort(PO),e=1,o=[r=AO[0]];e<n;++e)BO(r,(i=AO[e])[0])||BO(r,i[1])?(RO(r[0],i[1])>RO(r[0],r[1])&&(r[1]=i[1]),RO(i[0],r[1])>RO(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,e=0,r=o[n=o.length-1];e<=n;r=i,++e)i=o[e],(s=RO(r[1],i[0]))>a&&(a=s,yO=i[0],xO=r[1])}return AO=DO=null,yO===1/0||vO===1/0?[[NaN,NaN],[NaN,NaN]]:[[yO,vO],[xO,_O]]})),zw=Sw("centroid",(function(t){LO=IO=UO=qO=WO=YO=HO=GO=0,VO=new lp,XO=new lp,JO=new lp,up(t,nw);var e=+VO,n=+XO,r=+JO,i=Op(e,n,r);return i<1e-12&&(e=YO,n=HO,r=GO,IO<1e-6&&(e=UO,n=qO,r=WO),(i=Op(e,n,r))<1e-12)?[NaN,NaN]:[yp(n,e)*pp,Sp(r/i)*pp]}));function Tw(t,e,n){try{t[e].apply(t,["EXPRESSION"].concat([].slice.call(n)))}catch(e){t.warn(e)}return n[n.length-1]}function $w(t){const e=t/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Nw(t){const e=go(t);return.2126*$w(e.r)+.7152*$w(e.g)+.0722*$w(e.b)}function Rw(t,e){return t===e||t!=t&&e!=e||(Object(Z.B)(t)?!(!Object(Z.B)(e)||t.length!==e.length)&&function(t,e){for(let n=0,r=t.length;n<r;++n)if(!Rw(t[n],e[n]))return!1;return!0}(t,e):!(!Object(Z.G)(t)||!Object(Z.G)(e))&&Pw(t,e))}function Pw(t,e){for(const n in t)if(!Rw(t[n],e[n]))return!1;return!0}function Bw(t){return e=>Pw(t,e)}const Lw=t=>t.data;function Iw(t,e){const n=mw.call(e,t);return n.root&&n.root.lookup||{}}const Uw=()=>"undefined"!=typeof window&&window||null;const qw={random:()=>ee(),cumulativeNormal:de,cumulativeLogNormal:ye,cumulativeUniform:je,densityNormal:fe,densityLogNormal:be,densityUniform:we,quantileNormal:he,quantileLogNormal:ve,quantileUniform:ke,sampleNormal:ce,sampleLogNormal:me,sampleUniform:Oe,isArray:Z.B,isBoolean:Z.C,isDate:Z.D,isDefined:t=>void 0!==t,isNumber:Z.F,isObject:Z.G,isRegExp:Z.H,isString:Z.I,isTuple:ot,isValid:t=>null!=t&&t==t,toBoolean:Z.bb,toDate:Z.cb,toNumber:Z.db,toString:Z.fb,flush:Z.v,lerp:Z.K,merge:function(){const t=[].slice.call(arguments);return t.unshift({}),Object(Z.p)(...t)},pad:Z.Q,peek:Z.V,span:Z.Y,inrange:Z.A,truncate:Z.gb,rgb:go,lab:ls,hcl:ms,hsl:Oo,luminance:Nw,contrast:function(t,e){const n=Nw(t),r=Nw(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)},sequence:We,format:yw,utcFormat:xw,utcParse:Ow,utcOffset:He.w,utcSequence:He.x,timeFormat:vw,timeParse:_w,timeOffset:He.q,timeSequence:He.r,timeUnitSpecifier:He.s,monthFormat:function(t){return jw.call(this,t,1,"%B")},monthAbbrevFormat:function(t){return jw.call(this,t,1,"%b")},dayFormat:function(t){return jw.call(this,0,2+t,"%A")},dayAbbrevFormat:function(t){return jw.call(this,0,2+t,"%a")},quarter:Z.W,utcquarter:Z.ib,week:He.A,utcweek:He.z,dayofyear:He.m,utcdayofyear:He.y,warn:function(){return Tw(this.context.dataflow,"warn",arguments)},info:function(){return Tw(this.context.dataflow,"info",arguments)},debug:function(){return Tw(this.context.dataflow,"debug",arguments)},extent:Z.q,inScope:function(t){const e=this.context.group;let n=!1;if(e)for(;t;){if(t===e){n=!0;break}t=t.mark.group}return n},intersect:function(t,e,n){if(!t)return[];const[r,i]=t,o=(new El).set(r[0],r[1],i[0],i[1]);return $d(n||this.context.dataflow.scenegraph().root,o,function(t){let e=null;if(t){const n=Object(Z.i)(t.marktype),r=Object(Z.i)(t.markname);e=t=>(!n.length||n.some(e=>t.marktype===e))&&(!r.length||r.some(e=>t.name===e))}return e}(e))},clampRange:Z.k,pinchDistance:function(t){const e=t.touches,n=e[0].clientX-e[1].clientX,r=e[0].clientY-e[1].clientY;return Math.sqrt(n*n+r*r)},pinchAngle:function(t){const e=t.touches;return Math.atan2(e[0].clientY-e[1].clientY,e[0].clientX-e[1].clientX)},screen:function(){const t=Uw();return t?t.screen:{}},containerSize:function(){const t=this.context.dataflow,e=t.container&&t.container();return e?[e.clientWidth,e.clientHeight]:[void 0,void 0]},windowSize:function(){const t=Uw();return t?[t.innerWidth,t.innerHeight]:[void 0,void 0]},bandspace:function(t,e,n){return $s(t||0,e||0,n||0)},setdata:function(t,e){const n=this.context.dataflow,r=this.context.data[t].input;return n.pulse(r,n.changeset().remove(Z.hb).insert(e)),1},pathShape:function(t){let e=null;return function(n){return n?Ju(n,e=e||Bu(t)):t}},panLinear:Z.R,panLog:Z.S,panPow:Z.T,panSymlog:Z.U,zoomLinear:Z.mb,zoomLog:Z.nb,zoomPow:Z.ob,zoomSymlog:Z.pb,encode:function(t,e,n){if(t){const n=this.context.dataflow,r=t.mark.source;n.pulse(r,n.changeset().encode(t,e))}return void 0!==n?n:t},modify:function(t,e,n,r,i,o){const a=this.context.dataflow,s=this.context.data[t],u=s.input,l=a.stamp();let c,f,d=s.changes;if(!1===a._trigger||!(u.value.length||e||r))return 0;if((!d||d.stamp<l)&&(s.changes=d=a.changeset(),d.stamp=l,a.runAfter(()=>{s.modified=!0,a.pulse(u,d).run()},!0,1)),n&&(c=!0===n?Z.hb:Object(Z.B)(n)||ot(n)?n:Bw(n),d.remove(c)),e&&d.insert(e),r&&(c=Bw(r),u.value.some(c)?d.remove(c):d.insert(r)),i)for(f in o)d.modify(i,f,o[f]);return 1}},Ww=["view","item","group","xy","x","y"],Yw={},Hw={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:t=>"_[".concat(Object(Z.ab)("$"+t),"]"),functions:function(t){const e=oO(t);Ww.forEach(t=>e[t]="event.vega."+t);for(const t in qw)e[t]="this."+t;return Object(Z.p)(e,Mw(t,qw,Yw)),e},constants:iO,visitors:Yw},Gw=function(t){const e=(t=t||{}).allowed?Object(Z.eb)(t.allowed):{},n=t.forbidden?Object(Z.eb)(t.forbidden):{},r=t.constants||iO,i=(t.functions||oO)(f),o=t.globalvar,a=t.fieldvar,s=Object(Z.E)(o)?o:t=>"".concat(o,'["').concat(t,'"]');let u={},l={},c=0;function f(t){if(Object(Z.I)(t))return t;const e=d[t.type];return null==e&&Object(Z.o)("Unsupported type: "+t.type),e(t)}const d={Literal:t=>t.raw,Identifier:t=>{const i=t.name;return c>0?i:Object(Z.w)(n,i)?Object(Z.o)("Illegal identifier: "+i):Object(Z.w)(r,i)?r[i]:Object(Z.w)(e,i)?i:(u[i]=1,s(i))},MemberExpression:t=>{const e=!t.computed,n=f(t.object);e&&(c+=1);const r=f(t.property);return n===a&&(l[function(t){const e=t&&t.length-1;return e&&('"'===t[0]&&'"'===t[e]||"'"===t[0]&&"'"===t[e])?t.slice(1,-1):t}(r)]=1),e&&(c-=1),n+(e?"."+r:"["+r+"]")},CallExpression:t=>{"Identifier"!==t.callee.type&&Object(Z.o)("Illegal callee type: "+t.callee.type);const e=t.callee.name,n=t.arguments,r=Object(Z.w)(i,e)&&i[e];return r||Object(Z.o)("Unrecognized function: "+e),Object(Z.E)(r)?r(n):r+"("+n.map(f).join(",")+")"},ArrayExpression:t=>"["+t.elements.map(f).join(",")+"]",BinaryExpression:t=>"("+f(t.left)+t.operator+f(t.right)+")",UnaryExpression:t=>"("+t.operator+f(t.argument)+")",ConditionalExpression:t=>"("+f(t.test)+"?"+f(t.consequent)+":"+f(t.alternate)+")",LogicalExpression:t=>"("+f(t.left)+t.operator+f(t.right)+")",ObjectExpression:t=>"{"+t.properties.map(f).join(",")+"}",Property:t=>{c+=1;const e=f(t.key);return c-=1,e+":"+f(t.value)}};function h(t){const e={code:f(t),globals:Object.keys(u),fields:Object.keys(l)};return u={},l={},e}return h.functions=i,h.constants=r,h}(Hw);function Vw(t,e,n){return 1===arguments.length?qw[t]:(qw[t]=e,n&&(Yw[t]=n),Gw&&(Gw.functions[t]="this."+t),this)}function Xw(t,e){const n={};let r;try{r=rO(t=Object(Z.I)(t)?t:Object(Z.ab)(t)+"")}catch(e){Object(Z.o)("Expression parse error: "+t)}r.visit(t=>{if("CallExpression"!==t.type)return;const r=t.callee.name,i=Hw.visitors[r];i&&i(r,t.arguments,e,n)});const i=Gw(r);return i.globals.forEach(t=>{const r="$"+t;!Object(Z.w)(n,r)&&e.getSignal(t)&&(n[r]=e.signalRef(t))}),{$expr:Object(Z.p)({code:i.code},e.options.ast?{ast:r}:null),$fields:i.fields,$params:n}}Vw("bandwidth",(function(t,e){const n=Dw(t,(e||this).context);return n&&n.bandwidth?n.bandwidth():0}),Ew),Vw("copy",(function(t,e){const n=Dw(t,(e||this).context);return n?n.copy():void 0}),Ew),Vw("domain",(function(t,e){const n=Dw(t,(e||this).context);return n?n.domain():[]}),Ew),Vw("range",(function(t,e){const n=Dw(t,(e||this).context);return n&&n.range?n.range():[]}),Ew),Vw("invert",(function(t,e,n){const r=Dw(t,(n||this).context);return r?Object(Z.B)(e)?(r.invertRange||r.invert)(e):(r.invert||r.invertExtent)(e):void 0}),Ew),Vw("scale",(function(t,e,n){const r=Dw(t,(n||this).context);return r?r(e):void 0}),Ew),Vw("gradient",(function(t,e,n,r,i){t=Dw(t,(i||this).context);const o=Tu(e,n);let a=t.domain(),s=a[0],u=Object(Z.V)(a),l=Z.y;return u-s?l=ou(t,s,u):t=(t.interpolator?Hs("sequential")().interpolator(t.interpolator()):Hs("linear")().interpolate(t.interpolate()).range(t.range())).domain([s=0,u=1]),t.ticks&&(a=t.ticks(+r||15),s!==a[0]&&a.unshift(s),u!==Object(Z.V)(a)&&a.push(u)),a.forEach(e=>o.stop(l(e),t(e))),o}),Ew),Vw("geoArea",Cw,Ew),Vw("geoBounds",Fw,Ew),Vw("geoCentroid",zw,Ew),Vw("geoShape",(function(t,e,n){const r=Dw(t,(n||this).context);return function(t){return r?r.path.context(t)(e):""}}),Ew),Vw("indata",(function(t,e,n){const r=this.context.data[t]["index:"+e],i=r?r.value.get(n):void 0;return i?i.count:i}),(function(t,e,n,r){"Literal"!==e[0].type&&Object(Z.o)("First argument to indata must be a string literal."),"Literal"!==e[1].type&&Object(Z.o)("Second argument to indata must be a string literal.");const i=e[0].value,o=e[1].value,a="@"+o;Object(Z.w)(a,r)||(r[a]=n.getData(i).indataRef(n,o))})),Vw("data",mw,kw),Vw("treePath",(function(t,e,n){const r=Iw(t,this),i=r[e],o=r[n];return i&&o?i.path(o).map(Lw):void 0}),kw),Vw("treeAncestors",(function(t,e){const n=Iw(t,this)[e];return n?n.ancestors().map(Lw):void 0}),kw),Vw("vlSelectionTest",(function(t,e,n){for(var r,i,o,a,s,u=this.context.data[t],l=u?u.values.value:[],c=u?u["index:unit"]&&u["index:unit"].value:void 0,f="intersect"===n,d=l.length,h=0;h<d;++h)if(r=l[h],c&&f){if(-1===(o=(i=i||{})[a=r.unit]||0))continue;if(s=hw(e,r),i[a]=s?-1:++o,s&&1===c.size)return!0;if(!s&&o===c.get(a).count)return!1}else if(f^(s=hw(e,r)))return s;return d&&f}),gw),Vw("vlSelectionResolve",(function(t,e,n){for(var r,i,o,a,s,u,l,c,f,d,h,p=this.context.data[t],g=p?p.values.value:[],m={},b={},y={},v=g.length,x=0;x<v;++x){for(a=(r=g[x]).unit,i=r.fields,o=r.values,d=0,h=i.length;d<h;++d)s=i[d],l=(u=m[s.field]||(m[s.field]={}))[a]||(u[a]=[]),y[s.field]=c=s.type.charAt(0),f=pw[c+"_union"],u[a]=f(l,Object(Z.i)(o[d]));n&&(l=b[a]||(b[a]=[])).push(Object(Z.i)(o).reduce((t,e,n)=>(t[i[n].field]=e,t),{}))}return e=e||"union",Object.keys(m).forEach(t=>{m[t]=Object.keys(m[t]).map(e=>m[t][e]).reduce((n,r)=>void 0===n?r:pw[y[t]+"_"+e](n,r))}),g=Object.keys(b),n&&g.length&&(m.vlMulti="union"===e?{or:g.reduce((t,e)=>(t.push(...b[e]),t),[])}:{and:g.map(t=>({or:b[t]}))}),m}),gw);const Jw=Object(Z.eb)(["rule"]),Kw=Object(Z.eb)(["group","image","rect"]);function Zw(t){return(t+"").toLowerCase()}function Qw(t,e,n){";"!==n[n.length-1]&&(n="return("+n+");");const r=Function(...e.concat(n));return t&&t.functions?r.bind(t.functions):r}var tj={operator:(t,e)=>Qw(t,["_"],e.code),parameter:(t,e)=>Qw(t,["datum","_"],e.code),event:(t,e)=>Qw(t,["event"],e.code),handler:(t,e)=>Qw(t,["_","event"],"var datum=event.item&&event.item.datum;return ".concat(e.code,";")),encode:(t,e)=>{const{marktype:n,channels:r}=e;let i="var o=item,datum=o.datum,m=0,$;";for(const t in r){const e="o["+Object(Z.ab)(t)+"]";i+="$=".concat(r[t].code,";if(").concat(e,"!==$)").concat(e,"=$,m=1;")}return i+=function(t,e){let n="";return Jw[e]||(t.x2&&(t.x?(Kw[e]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),t.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),t.y2&&(t.y?(Kw[e]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),t.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}(r,n),i+="return m;",Qw(t,["item","_"],i)},codegen:{get(t){const e="[".concat(t.map(Z.ab).join("]["),"]"),n=Function("_","return _".concat(e,";"));return n.path=e,n},comparator(t,e){let n;const r=Function("a","b","var u, v; return "+t.map((t,r)=>{const i=e[r];let o,a;return t.path?(o="a".concat(t.path),a="b".concat(t.path)):((n=n||{})["f"+r]=t,o="this.f".concat(r,"(a)"),a="this.f".concat(r,"(b)")),function(t,e,n,r){return"((u = ".concat(t,") < (v = ").concat(e,") || u == null) && v != null ? ").concat(n,"\n : (u > v || v == null) && u != null ? ").concat(r,"\n : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ").concat(n,"\n : v !== v && u === u ? ").concat(r," : ")}(o,a,-i,i)}).join("")+"0;");return n?r.bind(n):r}}};function ej(t,e,n){if(!t||!Object(Z.G)(t))return t;for(let r,i=0,o=nj.length;i<o;++i)if(r=nj[i],Object(Z.w)(t,r.key))return r.parse(t,e,n);return t}var nj=[{key:"$ref",parse:function(t,e){return e.get(t.$ref)||Object(Z.o)("Operator not defined: "+t.$ref)}},{key:"$key",parse:function(t,e){const n="k:"+t.$key+"_"+!!t.$flat;return e.fn[n]||(e.fn[n]=Object(Z.J)(t.$key,t.$flat,e.expr.codegen))}},{key:"$expr",parse:function(t,e,n){t.$params&&e.parseParameters(t.$params,n);const r="e:"+t.$expr.code+"_"+t.$name;return e.fn[r]||(e.fn[r]=Object(Z.f)(e.parameterExpression(t.$expr),t.$fields,t.$name))}},{key:"$field",parse:function(t,e){if(!t.$field)return null;const n="f:"+t.$field+"_"+t.$name;return e.fn[n]||(e.fn[n]=Object(Z.u)(t.$field,t.$name,e.expr.codegen))}},{key:"$encode",parse:function(t,e){const n=t.$encode,r={};for(const t in n){const i=n[t];r[t]=Object(Z.f)(e.encodeExpression(i.$expr),i.$fields),r[t].output=i.$output}return r}},{key:"$compare",parse:function(t,e){const n="c:"+t.$compare+"_"+t.$order,r=Object(Z.i)(t.$compare).map(t=>t&&t.$tupleid?at:t);return e.fn[n]||(e.fn[n]=Object(Z.l)(r,t.$order,e.expr.codegen))}},{key:"$context",parse:function(t,e){return e}},{key:"$subflow",parse:function(t,e){const n=t.$subflow;return function(t,r,i){const o=e.fork().parse(n),a=o.get(n.operators[0].id),s=o.signals.parent;return s&&s.set(i),a.detachSubflow=()=>e.detach(o),a}}},{key:"$tupleid",parse:function(){return at}}];const rj={skip:!0};function ij(t,e,n,r){return new oj(t,e,n,r)}function oj(t,e,n,r){this.dataflow=t,this.transforms=e,this.events=t.events.bind(t),this.expr=r||tj,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function aj(t){this.dataflow=t.dataflow,this.transforms=t.transforms,this.events=t.events,this.expr=t.expr,this.signals=Object.create(t.signals),this.scales=Object.create(t.scales),this.nodes=Object.create(t.nodes),this.data=Object.create(t.data),this.fn=Object.create(t.fn),t.functions&&(this.functions=Object.create(t.functions),this.functions.context=this)}oj.prototype=aj.prototype={fork(){const t=new aj(this);return(this.subcontext||(this.subcontext=[])).push(t),t},detach(t){this.subcontext=this.subcontext.filter(e=>e!==t);const e=Object.keys(t.nodes);for(const n of e)t.nodes[n]._targets=null;for(const n of e)t.nodes[n].detach();t.nodes=null},get(t){return this.nodes[t]},set(t,e){return this.nodes[t]=e},add(t,e){const n=this,r=n.dataflow,i=t.value;if(n.set(t.id,e),"collect"===Zw(t.type)&&i&&(i.$ingest?r.ingest(e,i.$ingest,i.$format):i.$request?r.preload(e,i.$request,i.$format):r.pulse(e,r.changeset().insert(i))),t.root&&(n.root=e),t.parent){let i=n.get(t.parent.$ref);i?(r.connect(i,[e]),e.targets().add(i)):(n.unresolved=n.unresolved||[]).push(()=>{i=n.get(t.parent.$ref),r.connect(i,[e]),e.targets().add(i)})}if(t.signal&&(n.signals[t.signal]=e),t.scale&&(n.scales[t.scale]=e),t.data)for(const r in t.data){const i=n.data[r]||(n.data[r]={});t.data[r].forEach(t=>i[t]=e)}},resolve(){return(this.unresolved||[]).forEach(t=>t()),delete this.unresolved,this},operator(t,e){this.add(t,this.dataflow.add(t.value,e))},transform(t,e){this.add(t,this.dataflow.add(this.transforms[Zw(e)]))},stream(t,e){this.set(t.id,e)},update(t,e,n,r,i){this.dataflow.on(e,n,r,i,t.options)},operatorExpression(t){return this.expr.operator(this,t)},parameterExpression(t){return this.expr.parameter(this,t)},eventExpression(t){return this.expr.event(this,t)},handlerExpression(t){return this.expr.handler(this,t)},encodeExpression(t){return this.expr.encode(this,t)},parse:function(t){const e=this,n=t.operators||[];return t.background&&(e.background=t.background),t.eventConfig&&(e.eventConfig=t.eventConfig),t.locale&&(e.locale=t.locale),n.forEach(t=>e.parseOperator(t)),n.forEach(t=>e.parseOperatorParameters(t)),(t.streams||[]).forEach(t=>e.parseStream(t)),(t.updates||[]).forEach(t=>e.parseUpdate(t)),e.resolve()},parseOperator:function(t){const e=this;"operator"!==Zw(t.type)&&t.type?e.transform(t,t.type):e.operator(t,t.update?e.operatorExpression(t.update):null)},parseOperatorParameters:function(t){const e=this;if(t.params){const n=e.get(t.id);n||Object(Z.o)("Invalid operator id: "+t.id),e.dataflow.connect(n,n.parameters(e.parseParameters(t.params),t.react,t.initonly))}},parseParameters:function(t,e){e=e||{};const n=this;for(const r in t){const i=t[r];e[r]=Object(Z.B)(i)?i.map(t=>ej(t,n,e)):ej(i,n,e)}return e},parseStream:function(t){var e,n=this,r=null!=t.filter?n.eventExpression(t.filter):void 0,i=null!=t.stream?n.get(t.stream):void 0;t.source?i=n.events(t.source,t.type,r):t.merge&&(i=(e=t.merge.map(t=>n.get(t)))[0].merge.apply(e[0],e.slice(1))),t.between&&(e=t.between.map(t=>n.get(t)),i=i.between(e[0],e[1])),t.filter&&(i=i.filter(r)),null!=t.throttle&&(i=i.throttle(+t.throttle)),null!=t.debounce&&(i=i.debounce(+t.debounce)),null==i&&Object(Z.o)("Invalid stream definition: "+JSON.stringify(t)),t.consume&&i.consume(!0),n.stream(t,i)},parseUpdate:function(t){var e,n=Object(Z.G)(n=t.source)?n.$ref:n,r=this.get(n),i=t.update,o=void 0;r||Object(Z.o)("Source not defined: "+t.source),e=t.target&&t.target.$expr?this.eventExpression(t.target.$expr):this.get(t.target),i&&i.$expr&&(i.$params&&(o=this.parseParameters(i.$params)),i=this.handlerExpression(i.$expr)),this.update(t,r,e,i,o)},getState:function(t){var e=this,n={};if(t.signals){var r=n.signals={};Object.keys(e.signals).forEach(n=>{const i=e.signals[n];t.signals(n,i)&&(r[n]=i.value)})}if(t.data){var i=n.data={};Object.keys(e.data).forEach(n=>{const r=e.data[n];t.data(n,r)&&(i[n]=r.input.value)})}return e.subcontext&&!1!==t.recurse&&(n.subcontext=e.subcontext.map(e=>e.getState(t))),n},setState:function(t){var e=this,n=e.dataflow,r=t.data,i=t.signals;Object.keys(i||{}).forEach(t=>{n.update(e.signals[t],i[t],rj)}),Object.keys(r||{}).forEach(t=>{n.pulse(e.data[t].input,n.changeset().remove(Z.hb).insert(r[t]))}),(t.subcontext||[]).forEach((t,n)=>{const r=e.subcontext[n];r&&r.setState(t)})}};function sj(t,e){t&&(null==e?t.removeAttribute("aria-label"):t.setAttribute("aria-label",e))}function uj(t,e){const n=t.globalCursor()?"undefined"!=typeof document&&document.body:t.container();if(n)return null==e?n.style.removeProperty("cursor"):n.style.cursor=e}function lj(t,e){var n=t._runtime.data;return Object(Z.w)(n,e)||Object(Z.o)("Unrecognized data set: "+e),n[e]}function cj(t,e){ht(e)||Object(Z.o)("Second argument to changes must be a changeset.");const n=lj(this,t);return n.modified=!0,this.pulse(n.input,e)}function fj(t){var e=t.padding();return Math.max(0,t._viewWidth+e.left+e.right)}function dj(t){var e=t.padding();return Math.max(0,t._viewHeight+e.top+e.bottom)}function hj(t){var e=t.padding(),n=t._origin;return[e.left+n[0],e.top+n[1]]}function pj(t,e,n){var r,i,o=t._renderer,a=o&&o.canvas();return a&&(i=hj(t),(r=$f(e.changedTouches?e.changedTouches[0]:e,a))[0]-=i[0],r[1]-=i[1]),e.dataflow=t,e.item=n,e.vega=function(t,e,n){const r=e?"group"===e.mark.marktype?e:e.mark.group:null;function i(t){var n,i=r;if(t)for(n=e;n;n=n.mark.group)if(n.mark.name===t){i=n;break}return i&&i.mark&&i.mark.interactive?i:{}}function o(t){if(!t)return n;Object(Z.I)(t)&&(t=i(t));const e=n.slice();for(;t;)e[0]-=t.x||0,e[1]-=t.y||0,t=t.mark&&t.mark.group;return e}return{view:Object(Z.m)(t),item:Object(Z.m)(e||{}),group:i,xy:o,x:function(t){return o(t)[0]},y:function(t){return o(t)[1]}}}(t,n,r),e}const gj={trap:!1};function mj(t,e,n){const r=t._eventConfig&&t._eventConfig[e];return!(!1===r||Object(Z.G)(r)&&!r[n])||(t.warn("Blocked ".concat(e," ").concat(n," event listener.")),!1)}function bj(t){return t.item}function yj(t){return t.item.mark.source}function vj(t){return function(e,n){return n.vega.view().changeset().encode(n.item,t)}}function xj(t,e,n){const r=document.createElement(t);for(const t in e)r.setAttribute(t,e[t]);return null!=n&&(r.textContent=n),r}function _j(t,e,n){if(!e)return;const r=n.param;let i=n.state;return i||(i=n.state={elements:null,active:!1,set:null,update:e=>{e!==t.signal(r.signal)&&t.runAsync(null,()=>{i.source=!0,t.signal(r.signal,e)})}},r.debounce&&(i.update=Object(Z.n)(r.debounce,i.update))),function(t,e,n,r){const i=xj("div",{class:"vega-bind"}),o="radio"===n.input?i:i.appendChild(xj("label"));o.appendChild(xj("span",{class:"vega-bind-name"},n.name||n.signal)),e.appendChild(i);let a=Oj;switch(n.input){case"checkbox":a=wj;break;case"select":a=jj;break;case"radio":a=kj;break;case"range":a=Ej}a(t,o,n,r)}(i,e,r,t.signal(r.signal)),i.active||(t.on(t._signals[r.signal],null,()=>{i.source?i.source=!1:i.set(t.signal(r.signal))}),i.active=!0),i}function Oj(t,e,n,r){const i=xj("input");for(const t in n)"signal"!==t&&"element"!==t&&i.setAttribute("input"===t?"type":t,n[t]);i.setAttribute("name",n.signal),i.value=r,e.appendChild(i),i.addEventListener("input",()=>t.update(i.value)),t.elements=[i],t.set=t=>i.value=t}function wj(t,e,n,r){const i={type:"checkbox",name:n.signal};r&&(i.checked=!0);const o=xj("input",i);e.appendChild(o),o.addEventListener("change",()=>t.update(o.checked)),t.elements=[o],t.set=t=>o.checked=!!t||null}function jj(t,e,n,r){const i=xj("select",{name:n.signal}),o=n.labels||[];n.options.forEach((t,e)=>{const n={value:t};Aj(t,r)&&(n.selected=!0),i.appendChild(xj("option",n,(o[e]||t)+""))}),e.appendChild(i),i.addEventListener("change",()=>{t.update(n.options[i.selectedIndex])}),t.elements=[i],t.set=t=>{for(let e=0,r=n.options.length;e<r;++e)if(Aj(n.options[e],t))return void(i.selectedIndex=e)}}function kj(t,e,n,r){const i=xj("span",{class:"vega-bind-radio"}),o=n.labels||[];e.appendChild(i),t.elements=n.options.map((e,a)=>{const s={type:"radio",name:n.signal,value:e};Aj(e,r)&&(s.checked=!0);const u=xj("input",s);u.addEventListener("change",()=>t.update(e));const l=xj("label",{},(o[a]||e)+"");return l.prepend(u),i.appendChild(l),u}),t.set=e=>{const n=t.elements,r=n.length;for(let t=0;t<r;++t)Aj(n[t].value,e)&&(n[t].checked=!0)}}function Ej(t,e,n,r){r=void 0!==r?r:(+n.max+ +n.min)/2;const i=null!=n.max?n.max:Math.max(100,+r)||100,o=n.min||Math.min(0,i,+r)||0,a=n.step||Object(Ii.c)(o,i,100),s=xj("input",{type:"range",name:n.signal,min:o,max:i,step:a});s.value=r;const u=xj("span",{},+r);e.appendChild(s),e.appendChild(u);const l=()=>{u.textContent=s.value,t.update(+s.value)};s.addEventListener("input",l),s.addEventListener("change",l),t.elements=[s],t.set=t=>{s.value=t,u.textContent=t}}function Aj(t,e){return t===e||t+""==e+""}function Dj(t,e,n,r,i,o){return(e=e||new r(t.loader())).initialize(n,fj(t),dj(t),hj(t),i,o).background(t.background())}function Mj(t,e){return e?function(){try{e.apply(this,arguments)}catch(e){t.error(e)}}:null}function Sj(t,e){if("string"==typeof e){if("undefined"==typeof document)return t.error("DOM document instance not found."),null;if(!(e=document.querySelector(e)))return t.error("Signal bind element not found: "+e),null}if(e)try{e.innerHTML=""}catch(n){e=null,t.error(n)}return e}const Cj=t=>+t||0;function Fj(t){return Object(Z.G)(t)?{top:Cj(t.top),bottom:Cj(t.bottom),left:Cj(t.left),right:Cj(t.right)}:(t=>({top:t,bottom:t,left:t,right:t}))(Cj(t))}async function zj(t,e,n,r){const i=Td(e),o=i&&i.headless;return o||Object(Z.o)("Unrecognized renderer type: "+e),await t.runAsync(),Dj(t,null,null,o,n,r).renderAsync(t._scenegraph.root)}var Tj={skip:!0};function $j(t,e){var n=t.autosize(),r=t.padding();return e-(n&&"padding"===n.contains?r.left+r.right:0)}function Nj(t,e){var n=t.autosize(),r=t.padding();return e-(n&&"padding"===n.contains?r.top+r.bottom:0)}function Rj(t,e){return e.modified&&Object(Z.B)(e.input.value)&&t.indexOf("_:vega:_")}function Pj(t,e){return!("parent"===t||e instanceof Bt.proxy)}function Bj(t,e,n,r){const i=t.element();i&&i.setAttribute("title",function(t){return null==t?"":Object(Z.B)(t)?Lj(t):Object(Z.G)(t)&&!Object(Z.D)(t)?(e=t,Object.keys(e).map(t=>{const n=e[t];return t+": "+(Object(Z.B)(n)?Lj(n):Ij(n))}).join("\n")):t+"";var e}(r))}function Lj(t){return"["+t.map(Ij).join(", ")+"]"}function Ij(t){return Object(Z.B)(t)?"[…]":Object(Z.G)(t)&&!Object(Z.D)(t)?"{…}":t}function Uj(t,e){const n=this;if(e=e||{},Nt.call(n),e.loader&&n.loader(e.loader),e.logger&&n.logger(e.logger),null!=e.logLevel&&n.logLevel(e.logLevel),e.locale||t.locale){const r=Object(Z.p)({},t.locale,e.locale);n.locale(Object(tt.b)(r.number,r.time))}n._el=null,n._elBind=null,n._renderType=e.renderer||Fd.Canvas,n._scenegraph=new Df;const r=n._scenegraph.root;n._renderer=null,n._tooltip=e.tooltip||Bj,n._redraw=!0,n._handler=(new Vf).scene(r),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=function(t){const e=Object(Z.p)({defaults:{}},t),n=(t,e)=>{e.forEach(e=>{Object(Z.B)(t[e])&&(t[e]=Object(Z.eb)(t[e]))})};return n(e.defaults,["prevent","allow"]),n(e,["view","window","selector"]),e}(t.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const i=function(t,e,n){return ij(t,Bt,qw,n).parse(e)}(n,t,e.expr);n._runtime=i,n._signals=i.signals,n._bind=(t.bindings||[]).map(t=>({state:null,param:Object(Z.p)({},t)})),i.root&&i.root.set(r),r.source=i.data.root.input,n.pulse(i.data.root.input,n.changeset().insert(r.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=$j(n,n._width),n._viewHeight=Nj(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,function(t){var e=t._signals,n=e.width,r=e.height,i=e.padding;function o(){t._autosize=t._resize=1}t._resizeWidth=t.add(null,e=>{t._width=e.size,t._viewWidth=$j(t,e.size),o()},{size:n}),t._resizeHeight=t.add(null,e=>{t._height=e.size,t._viewHeight=Nj(t,e.size),o()},{size:r});const a=t.add(null,o,{pad:i});t._resizeWidth.rank=n.rank+1,t._resizeHeight.rank=r.rank+1,a.rank=i.rank+1}(n),function(t){t.add(null,e=>(t._background=e.bg,t._resize=1,e.bg),{bg:t._signals.background})}(n),function(t){const e=t._signals.cursor||(t._signals.cursor=t.add({user:"default",item:null}));t.on(t.events("view","mousemove"),e,(t,n)=>{const r=e.value,i=r?Object(Z.I)(r)?r:r.user:"default",o=n.item&&n.item.cursor||null;return r&&i===r.user&&o==r.item?r:{user:i,item:o}}),t.add(null,(function(e){let n=e.cursor,r=this.value;return Object(Z.I)(n)||(r=n.item,n=n.user),uj(t,n&&"default"!==n?n:r||n),r}),{cursor:e})}(n),n.description(t.description),e.hover&&n.hover(),e.container&&n.initialize(e.container,e.bind)}function qj(t,e){return Object(Z.w)(t._signals,e)?t._signals[e]:Object(Z.o)("Unrecognized signal name: "+Object(Z.ab)(e))}function Wj(t,e){const n=(t._targets||[]).filter(t=>t._update&&t._update.handler===e);return n.length?n[0]:null}function Yj(t,e,n,r){let i=Wj(n,r);return i||(i=Mj(t,()=>r(e,n.value)),i.handler=r,t.on(n,null,i)),t}function Hj(t,e,n){const r=Wj(e,n);return r&&e._targets.remove(r),t}Object(Z.z)(Uj,Nt,{async evaluate(t,e,n){if(await Nt.prototype.evaluate.call(this,t,e),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,i=hj(r=this),o=fj(r),a=dj(r),r._renderer.background(r.background()),r._renderer.resize(o,a,i),r._handler.origin(i),r._resizeListeners.forEach(t=>{try{t(o,a)}catch(t){r.error(t)}})),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(t){this.error(t)}var r,i,o,a;return n&&nt(this,n),this},dirty(t){this._redraw=!0,this._renderer&&this._renderer.dirty(t)},description(t){if(arguments.length){const e=null!=t?t+"":null;return e!==this._desc&&sj(this._el,this._desc=e),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(t,e,n){const r=qj(this,t);return 1===arguments.length?r.value:this.update(r,e,n)},width(t){return arguments.length?this.signal("width",t):this.signal("width")},height(t){return arguments.length?this.signal("height",t):this.signal("height")},padding(t){return arguments.length?this.signal("padding",Fj(t)):Fj(this.signal("padding"))},autosize(t){return arguments.length?this.signal("autosize",t):this.signal("autosize")},background(t){return arguments.length?this.signal("background",t):this.signal("background")},renderer(t){return arguments.length?(Td(t)||Object(Z.o)("Unrecognized renderer type: "+t),t!==this._renderType&&(this._renderType=t,this._resetRenderer()),this):this._renderType},tooltip(t){return arguments.length?(t!==this._tooltip&&(this._tooltip=t,this._resetRenderer()),this):this._tooltip},loader(t){return arguments.length?(t!==this._loader&&(Nt.prototype.loader.call(this,t),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(qj(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:function(t,e,n,r,i,o){this.runAfter(a=>{let s=0;a._autosize=0,a.width()!==n&&(s=1,a.signal("width",n,Tj),a._resizeWidth.skip(!0)),a.height()!==r&&(s=1,a.signal("height",r,Tj),a._resizeHeight.skip(!0)),a._viewWidth!==t&&(a._resize=1,a._viewWidth=t),a._viewHeight!==e&&(a._resize=1,a._viewHeight=e),a._origin[0]===i[0]&&a._origin[1]===i[1]||(a._resize=1,a._origin=i),s&&a.run("enter"),o&&a.runAfter(t=>t.resize())},!1,1)},addEventListener(t,e,n){let r=e;return n&&!1===n.trap||(r=Mj(this,e),r.raw=e),this._handler.on(t,r),this},removeEventListener(t,e){for(var n,r,i=this._handler.handlers(t),o=i.length;--o>=0;)if(r=i[o].type,n=i[o].handler,t===r&&(e===n||e===n.raw)){this._handler.off(r,n);break}return this},addResizeListener(t){const e=this._resizeListeners;return e.indexOf(t)<0&&e.push(t),this},removeResizeListener(t){var e=this._resizeListeners,n=e.indexOf(t);return n>=0&&e.splice(n,1),this},addSignalListener(t,e){return Yj(this,t,qj(this,t),e)},removeSignalListener(t,e){return Hj(this,qj(this,t),e)},addDataListener(t,e){return Yj(this,t,lj(this,t).values,e)},removeDataListener(t,e){return Hj(this,lj(this,t).values,e)},globalCursor(t){if(arguments.length){if(this._globalCursor!==!!t){const e=uj(this,null);this._globalCursor=!!t,e&&uj(this,e)}return this}return this._globalCursor},preventDefault(t){return arguments.length?(this._preventDefault=t,this):this._preventDefault},timer:function(t,e){this._timers.push(function(t,e,n){var r=new py,i=e;return null==e?(r.restart(t,e,n),r):(r._restart=r.restart,r.restart=function(t,e,n){e=+e,n=null==n?dy():+n,r._restart((function o(a){a+=i,r._restart(o,i+=e,n),t(a)}),e,n)},r.restart(t,e,n),r)}((function(e){t({timestamp:Date.now(),elapsed:e})}),e))},events:function(t,e,n){var r,i=this,o=new _t(n),a=function(n,r){i.runAsync(null,()=>{"view"===t&&function(t,e){var n=t._eventConfig.defaults,r=n.prevent,i=n.allow;return!1!==r&&!0!==i&&(!0===r||!1===i||(r?r[e]:i?!i[e]:t.preventDefault()))}(i,e)&&n.preventDefault(),o.receive(pj(i,n,r))})};if("timer"===t)mj(i,"timer",e)&&i.timer(a,e);else if("view"===t)mj(i,"view",e)&&i.addEventListener(e,a,gj);else if("window"===t?mj(i,"window",e)&&"undefined"!=typeof window&&(r=[window]):"undefined"!=typeof document&&mj(i,"selector",e)&&(r=document.querySelectorAll(t)),r){for(var s=0,u=r.length;s<u;++s)r[s].addEventListener(e,a);i._eventListeners.push({type:e,sources:r,handler:a})}else i.warn("Can not resolve event source: "+t);return o},finalize:function(){var t,e,n,r=this._tooltip,i=this._timers,o=this._eventListeners;for(t=i.length;--t>=0;)i[t].stop();for(t=o.length;--t>=0;)for(e=(n=o[t]).sources.length;--e>=0;)n.sources[e].removeEventListener(n.type,n.handler);return r&&r.call(this,this._handler,null,null,null),this},hover:function(t,e){return e=[e||"update",(t=[t||"hover"])[0]],this.on(this.events("view","mouseover",bj),yj,vj(t)),this.on(this.events("view","mouseout",bj),yj,vj(e)),this},data:function(t,e){return arguments.length<2?lj(this,t).values.value:cj.call(this,t,pt().remove(Z.hb).insert(e))},change:cj,insert:function(t,e){return cj.call(this,t,pt().insert(e))},remove:function(t,e){return cj.call(this,t,pt().remove(e))},scale:function(t){var e=this._runtime.scales;return Object(Z.w)(e,t)||Object(Z.o)("Unrecognized scale or projection: "+t),e[t].value},initialize:function(t,e){const n=this,r=n._renderType,i=n._eventConfig.bind,o=Td(r);t=n._el=t?Sj(n,t):null,function(t){const e=t.container();e&&(e.setAttribute("role","graphics-document"),e.setAttribute("aria-roleDescription","visualization"),sj(e,t.description()))}(n),o||n.error("Unrecognized renderer type: "+r);const a=o.handler||Vf,s=t?o.renderer:o.headless;return n._renderer=s?Dj(n,n._renderer,t,s):null,n._handler=function(t,e,n,r){const i=new r(t.loader(),Mj(t,t.tooltip())).scene(t.scenegraph().root).initialize(n,hj(t),t);return e&&e.handlers().forEach(t=>{i.on(t.type,t.handler)}),i}(n,n._handler,t,a),n._redraw=!0,t&&"none"!==i&&(e=e?n._elBind=Sj(n,e):t.appendChild(xj("form",{class:"vega-bindings"})),n._bind.forEach(t=>{t.param.element&&"container"!==i&&(t.element=Sj(n,t.param.element))}),n._bind.forEach(t=>{_j(n,t.element||e,t)})),n},toImageURL:async function(t,e){t!==Fd.Canvas&&t!==Fd.SVG&&t!==Fd.PNG&&Object(Z.o)("Unrecognized image type: "+t);const n=await zj(this,t,e);return t===Fd.SVG?function(t,e){const n=new Blob([t],{type:e});return window.URL.createObjectURL(n)}(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")},toCanvas:async function(t,e){return(await zj(this,Fd.Canvas,t,e)).canvas()},toSVG:async function(t){return(await zj(this,Fd.SVG,t)).svg()},getState:function(t){return this._runtime.getState(t||{data:Rj,signals:Pj,recurse:!0})},setState:function(t){return this.runAsync(null,e=>{e._trigger=!1,e._runtime.setState(t)},t=>{t._trigger=!0}),this}});const Gj=/[[\]{}]/,Vj={"*":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 Xj,Jj;function Kj(t,e,n){return Xj=e||"view",Jj=n||Vj,Qj(t.trim()).map(tk)}function Zj(t,e,n,r,i){const o=t.length;let a,s=0;for(;e<o;++e){if(a=t[e],!s&&a===n)return e;i&&i.indexOf(a)>=0?--s:r&&r.indexOf(a)>=0&&++s}return e}function Qj(t){const e=[],n=t.length;let r=0,i=0;for(;i<n;)i=Zj(t,i,",","[{","]}"),e.push(t.substring(r,i).trim()),r=++i;if(0===e.length)throw"Empty event selector: "+t;return e}function tk(t){return"["===t[0]?function(t){const e=t.length;let n,r=1;if(r=Zj(t,r,"]","[","]"),r===e)throw"Empty between selector: "+t;if(n=Qj(t.substring(1,r)),2!==n.length)throw"Between selector must have two elements: "+t;if(">"!==(t=t.slice(r+1).trim())[0])throw"Expected '>' after between selector: "+t;n=n.map(tk);const i=tk(t.slice(1).trim());if(i.between)return{between:n,stream:i};i.between=n;return i}(t):function(t){const e={source:Xj},n=[];let r,i,o=[0,0],a=0,s=0,u=t.length,l=0;if("}"===t[u-1]){if(l=t.lastIndexOf("{"),!(l>=0))throw"Unmatched right brace: "+t;try{o=function(t){const e=t.split(",");if(!t.length||e.length>2)throw t;return e.map(e=>{const n=+e;if(n!=n)throw t;return n})}(t.substring(l+1,u-1))}catch(e){throw"Invalid throttle specification: "+t}t=t.slice(0,l).trim(),u=t.length,l=0}if(!u)throw t;"@"===t[0]&&(a=++l);r=Zj(t,l,":"),r<u&&(n.push(t.substring(s,r).trim()),s=l=++r);if(l=Zj(t,l,"["),l===u)n.push(t.substring(s,u).trim());else if(n.push(t.substring(s,l).trim()),i=[],s=++l,s===u)throw"Unmatched left bracket: "+t;for(;l<u;){if(l=Zj(t,l,"]"),l===u)throw"Unmatched left bracket: "+t;if(i.push(t.substring(s,l).trim()),l<u-1&&"["!==t[++l])throw"Expected left bracket: "+t;s=++l}if(!(u=n.length)||Gj.test(n[u-1]))throw"Invalid event selector: "+t;u>1?(e.type=n[1],a?e.markname=n[0].slice(1):(c=n[0],Jj[c]?e.marktype=n[0]:e.source=n[0])):e.type=n[0];var c;"!"===e.type.slice(-1)&&(e.consume=!0,e.type=e.type.slice(0,-1));null!=i&&(e.filter=i);o[0]&&(e.throttle=o[0]);o[1]&&(e.debounce=o[1]);return e}(t)}function ek(t){return Object(Z.G)(t)?t:{type:t||"pad"}}const nk=t=>+t||0;function rk(t){return Object(Z.G)(t)?t.signal?t:{top:nk(t.top),bottom:nk(t.bottom),left:nk(t.left),right:nk(t.right)}:{top:e=nk(t),bottom:e,left:e,right:e};var e}const ik=t=>Object(Z.G)(t)&&!Object(Z.B)(t)?Object(Z.p)({},t):{value:t};function ok(t,e,n,r){if(null!=n){return Object(Z.G)(n)&&!Object(Z.B)(n)||Object(Z.B)(n)&&n.length&&Object(Z.G)(n[0])?t.update[e]=n:t[r||"enter"][e]={value:n},1}return 0}function ak(t,e,n){for(const n in e)ok(t,n,e[n]);for(const e in n)ok(t,e,n[e],"update")}function sk(t,e,n){for(const r in e)n&&Object(Z.w)(n,r)||(t[r]=Object(Z.p)(t[r]||{},e[r]));return t}function uk(t,e){return e&&(e.enter&&e.enter[t]||e.update&&e.update[t])}function lk(t,e,n){t[e]=n&&n.signal?{signal:n.signal}:{value:n}}const ck=t=>Object(Z.I)(t)?Object(Z.ab)(t):t.signal?"(".concat(t.signal,")"):pk(t);function fk(t){if(null!=t.gradient)return function(t){const e=[t.start,t.stop,t.count].map(t=>null==t?null:Object(Z.ab)(t));for(;e.length&&null==Object(Z.V)(e);)e.pop();return e.unshift(ck(t.gradient)),"gradient(".concat(e.join(","),")")}(t);let e=t.signal?"(".concat(t.signal,")"):t.color?function(t){return t.c?dk("hcl",t.h,t.c,t.l):t.h||t.s?dk("hsl",t.h,t.s,t.l):t.l||t.a?dk("lab",t.l,t.a,t.b):t.r||t.g||t.b?dk("rgb",t.r,t.g,t.b):null}(t.color):null!=t.field?pk(t.field):void 0!==t.value?Object(Z.ab)(t.value):void 0;return null!=t.scale&&(e=function(t,e){const n=ck(t.scale);null!=t.range?e="lerp(_range(".concat(n,"), ").concat(+t.range,")"):(void 0!==e&&(e="_scale(".concat(n,", ").concat(e,")")),t.band&&(e=(e?e+"+":"")+"_bandwidth(".concat(n,")")+(1==+t.band?"":"*"+hk(t.band)),t.extra&&(e="(datum.extra ? _scale(".concat(n,", datum.extra.value) : ").concat(e,")"))),null==e&&(e="0"));return e}(t,e)),void 0===e&&(e=null),null!=t.exponent&&(e="pow(".concat(e,",").concat(hk(t.exponent),")")),null!=t.mult&&(e+="*".concat(hk(t.mult))),null!=t.offset&&(e+="+".concat(hk(t.offset))),t.round&&(e="round(".concat(e,")")),e}const dk=(t,e,n,r)=>"(".concat(t,"(").concat([e,n,r].map(fk).join(","),")+'')");function hk(t){return Object(Z.G)(t)?"("+fk(t)+")":t}function pk(t){return function t(e){let n,r,i;if(e.signal)n="datum",i=e.signal;else if(e.group||e.parent){for(r=Math.max(1,e.level||1),n="item";r-- >0;)n+=".mark.group";e.parent?(i=e.parent,n+=".datum"):i=e.group}else e.datum?(n="datum",i=e.datum):Object(Z.o)("Invalid field reference: "+Object(Z.ab)(e));e.signal||(i=Object(Z.I)(i)?Object(Z.Z)(i).map(Z.ab).join("]["):t(i));return n+"["+i+"]"}(Object(Z.G)(t)?t:{datum:t})}function gk(t,e,n,r,i,o){const a={};(o=o||{}).encoders={$encode:a},t=function(t,e,n,r,i){const o={},a={};let s,u,l,c;for(u in u="lineBreak","text"!==e||null==i[u]||uk(u,t)||lk(o,u,i[u]),("legend"==n||String(n).startsWith("axis"))&&(n=null),c="frame"===n?i.group:"mark"===n?Object(Z.p)({},i.mark,i[e]):null,c)l=uk(u,t)||("fill"===u||"stroke"===u)&&(uk("fill",t)||uk("stroke",t)),l||lk(o,u,c[u]);for(u in Object(Z.i)(r).forEach(e=>{const n=i.style&&i.style[e];for(const e in n)uk(e,t)||lk(o,e,n[e])}),t=Object(Z.p)({},t),o)c=o[u],c.signal?(s=s||{})[u]=c:a[u]=c;return t.enter=Object(Z.p)(a,t.enter),s&&(t.update=Object(Z.p)(s,t.update)),t}(t,e,n,r,i.config);for(const n in t)a[n]=mk(t[n],e,o,i);return o}function mk(t,e,n,r){const i={},o={};for(const e in t)null!=t[e]&&(i[e]=bk((a=t[e],Object(Z.B)(a)?function(t){let e="";return t.forEach(t=>{const n=fk(t);e+=t.test?"(".concat(t.test,")?").concat(n,":"):n}),":"===Object(Z.V)(e)&&(e+="null"),e}(a):fk(a)),r,n,o));var a;return{$expr:{marktype:e,channels:i},$fields:Object.keys(o),$output:Object.keys(t)}}function bk(t,e,n,r){const i=Xw(t,e);return i.$fields.forEach(t=>r[t]=1),Object(Z.p)(n,i.$params),i.$expr}const yk=["value","update","init","react","bind"];function vk(t,e){Object(Z.o)(t+' for "outer" push: '+Object(Z.ab)(e))}function xk(t,e){const n=t.name;if("outer"===t.push)e.signals[n]||vk("No prior signal definition",n),yk.forEach(e=>{void 0!==t[e]&&vk("Invalid property ",e)});else{const r=e.addSignal(n,t.value);!1===t.react&&(r.react=!1),t.bind&&e.addBinding(n,t.bind)}}function _k(t,e,n,r){this.id=-1,this.type=t,this.value=e,this.params=n,r&&(this.parent=r)}function Ok(t,e,n,r){return new _k(t,e,n,r)}function wk(t,e){return Ok("operator",t,e)}function jk(t){const e={$ref:t.id};return t.id<0&&(t.refs=t.refs||[]).push(e),e}function kk(t,e){return e?{$field:t,$name:e}:{$field:t}}const Ek=kk("key");function Ak(t,e){return{$compare:t,$order:e}}function Dk(t,e){return(t&&t.signal?"$"+t.signal:t||"")+(t&&e?"_":"")+(e&&e.signal?"$"+e.signal:e||"")}function Mk(t){return t&&t.signal}function Sk(t){if(Mk(t))return!0;if(Object(Z.G)(t))for(const e in t)if(Sk(t[e]))return!0;return!1}function Ck(t,e){return null!=t?t:e}function Fk(t){return t&&t.signal||t}function zk(t,e){return(t.merge?Tk:t.stream?$k:t.type?Nk:Object(Z.o)("Invalid stream specification: "+Object(Z.ab)(t)))(t,e)}function Tk(t,e){const n=Rk({merge:t.merge.map(t=>zk(t,e))},t,e);return e.addStream(n).id}function $k(t,e){const n=Rk({stream:zk(t.stream,e)},t,e);return e.addStream(n).id}function Nk(t,e){let n;var r;"timer"===t.type?(n=e.event("timer",t.throttle),t={between:t.between,filter:t.filter}):n=e.event("scope"===(r=t.source)?"view":r||"view",t.type);const i=Rk({stream:n},t,e);return 1===Object.keys(i).length?n:e.addStream(i).id}function Rk(t,e,n){let r=e.between;return r&&(2!==r.length&&Object(Z.o)('Stream "between" parameter must have 2 entries: '+Object(Z.ab)(e)),t.between=[zk(r[0],n),zk(r[1],n)]),r=e.filter?[].concat(e.filter):[],(e.marktype||e.markname||e.markrole)&&r.push(function(t,e,n){const r="event.item";return r+(t&&"*"!==t?"&&"+r+".mark.marktype==='"+t+"'":"")+(n?"&&"+r+".mark.role==='"+n+"'":"")+(e?"&&"+r+".mark.name==='"+e+"'":"")}(e.marktype,e.markname,e.markrole)),"scope"===e.source&&r.push("inScope(event.item)"),r.length&&(t.filter=Xw("("+r.join(")&&(")+")",n).$expr),null!=(r=e.throttle)&&(t.throttle=+r),null!=(r=e.debounce)&&(t.debounce=+r),e.consume&&(t.consume=!0),t}const Pk={code:"_.$value",ast:{type:"Identifier",value:"value"}};function Bk(t,e,n){const r=t.encode,i={target:n};let o=t.events,a=t.update,s=[];o||Object(Z.o)("Signal update missing events specification."),Object(Z.I)(o)&&(o=Kj(o,e.isSubscope()?"scope":"view")),o=Object(Z.i)(o).filter(t=>t.signal||t.scale?(s.push(t),0):1),s.length>1&&(s=[Lk(s)]),o.length&&s.push(o.length>1?{merge:o}:o[0]),null!=r&&(a&&Object(Z.o)("Signal encode and update are mutually exclusive."),a="encode(item(),"+Object(Z.ab)(r)+")"),i.update=Object(Z.I)(a)?Xw(a,e):null!=a.expr?Xw(a.expr,e):null!=a.value?a.value:null!=a.signal?{$expr:Pk,$params:{$value:e.signalRef(a.signal)}}:Object(Z.o)("Invalid signal update specification."),t.force&&(i.options={force:!0}),s.forEach(t=>e.addUpdate(Object(Z.p)(function(t,e){return{source:t.signal?e.signalRef(t.signal):t.scale?e.scaleRef(t.scale):zk(t,e)}}(t,e),i)))}function Lk(t){return{signal:"["+t.map(t=>t.scale?'scale("'+t.scale+'")':t.signal)+"]"}}const Ik=t=>(e,n,r)=>Ok(t,n,e||void 0,r),Uk=Ik("aggregate"),qk=Ik("axisticks"),Wk=Ik("bound"),Yk=Ik("collect"),Hk=Ik("compare"),Gk=Ik("datajoin"),Vk=Ik("encode"),Xk=Ik("expression"),Jk=Ik("facet"),Kk=Ik("field"),Zk=Ik("key"),Qk=Ik("legendentries"),tE=Ik("load"),eE=Ik("mark"),nE=Ik("multiextent"),rE=Ik("multivalues"),iE=Ik("overlap"),oE=Ik("params"),aE=Ik("prefacet"),sE=Ik("projection"),uE=Ik("proxy"),lE=Ik("relay"),cE=Ik("render"),fE=Ik("scale"),dE=Ik("sieve"),hE=Ik("sortitems"),pE=Ik("viewlayout"),gE=Ik("values");let mE=0;const bE={min:"min",max:"max",count:"sum"};function yE(t,e){const n=e.getScale(t.name).params;let r;var i;for(r in n.domain=OE(t.domain,t,e),null!=t.range&&(n.range=function t(e,n,r){const i=n.config.range;let o=e.range;if(o.signal)return n.signalRef(o.signal);if(Object(Z.I)(o)){if(i&&Object(Z.w)(i,o))return e=Object(Z.p)({},e,{range:i[o]}),t(e,n,r);"width"===o?o=[0,{signal:"width"}]:"height"===o?o=Js(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:Object(Z.o)("Unrecognized scale range value: "+Object(Z.ab)(o))}else{if(o.scheme)return r.scheme=Object(Z.B)(o.scheme)?xE(o.scheme,n):vE(o.scheme,n),o.extent&&(r.schemeExtent=xE(o.extent,n)),void(o.count&&(r.schemeCount=vE(o.count,n)));if(o.step)return void(r.rangeStep=vE(o.step,n));if(Js(e.type)&&!Object(Z.B)(o))return OE(o,e,n);Object(Z.B)(o)||Object(Z.o)("Unsupported range type: "+Object(Z.ab)(o))}return o.map(t=>(Object(Z.B)(t)?xE:vE)(t,n))}(t,e,n)),null!=t.interpolate&&function(t,e){e.interpolate=vE(t.type||t),null!=t.gamma&&(e.interpolateGamma=vE(t.gamma))}(t.interpolate,n),null!=t.nice&&(n.nice=(i=t.nice,Object(Z.G)(i)?{interval:vE(i.interval),step:vE(i.step)}:vE(i))),null!=t.bins&&(n.bins=function(t,e){return t.signal||Object(Z.B)(t)?xE(t,e):e.objectProperty(t)}(t.bins,e)),t)Object(Z.w)(n,r)||"name"===r||(n[r]=vE(t[r],e))}function vE(t,e){return Object(Z.G)(t)?t.signal?e.signalRef(t.signal):Object(Z.o)("Unsupported object: "+Object(Z.ab)(t)):t}function xE(t,e){return t.signal?e.signalRef(t.signal):t.map(t=>vE(t,e))}function _E(t){Object(Z.o)("Can not find data set: "+Object(Z.ab)(t))}function OE(t,e,n){if(t)return t.signal?n.signalRef(t.signal):(Object(Z.B)(t)?wE:t.fields?kE:jE)(t,e,n);null==e.domainMin&&null==e.domainMax||Object(Z.o)("No scale domain defined for domainMin/domainMax to override.")}function wE(t,e,n){return t.map(t=>vE(t,n))}function jE(t,e,n){const r=n.getData(t.data);return r||_E(t.data),Js(e.type)?r.valuesRef(n,t.field,AE(t.sort,!1)):tu(e.type)?r.domainRef(n,t.field):r.extentRef(n,t.field)}function kE(t,e,n){const r=t.data,i=t.fields.reduce((t,e)=>(e=Object(Z.I)(e)?{data:r,field:e}:Object(Z.B)(e)||e.signal?function(t,e){const n="_:vega:_"+mE++,r=Yk({});if(Object(Z.B)(t))r.value={$ingest:t};else if(t.signal){const i="setdata("+Object(Z.ab)(n)+","+t.signal+")";r.params.input=e.signalRef(i)}return e.addDataPipeline(n,[r,dE({})]),{data:n,field:"data"}}(e,n):e,t.push(e),t),[]);return(Js(e.type)?EE:tu(e.type)?DE:ME)(t,n,i)}function EE(t,e,n){const r=AE(t.sort,!0);let i,o;const a=n.map(t=>{const n=e.getData(t.data);return n||_E(t.data),n.countsRef(e,t.field,r)}),s={groupby:Ek,pulse:a};r&&(i=r.op||"count",o=r.field?Dk(i,r.field):"count",s.ops=[bE[i]],s.fields=[e.fieldRef(o)],s.as=[o]),i=e.add(Uk(s));const u=e.add(Yk({pulse:jk(i)}));return o=e.add(gE({field:Ek,sort:e.sortRef(r),pulse:jk(u)})),jk(o)}function AE(t,e){return t&&(t.field||t.op?t.field||"count"===t.op?e&&t.field&&t.op&&!bE[t.op]&&Object(Z.o)("Multiple domain scales can not be sorted using "+t.op):Object(Z.o)("No field provided for sort aggregate op: "+t.op):Object(Z.G)(t)?t.field="key":t={field:"key"}),t}function DE(t,e,n){const r=n.map(t=>{const n=e.getData(t.data);return n||_E(t.data),n.domainRef(e,t.field)});return jk(e.add(rE({values:r})))}function ME(t,e,n){const r=n.map(t=>{const n=e.getData(t.data);return n||_E(t.data),n.extentRef(e,t.field)});return jk(e.add(nE({extents:r})))}function SE(t,e,n){return Object(Z.B)(t)?t.map(t=>SE(t,e,n)):Object(Z.G)(t)?t.signal?n.signalRef(t.signal):"fit"===e?t:Object(Z.o)("Unsupported parameter object: "+Object(Z.ab)(t)):t}const CE="value",FE=["size","shape","fill","stroke","strokeWidth","strokeDash","opacity"],zE={name:1,style:1,interactive:1},TE={value:0},$E={value:1};function NE(t){return t.type="group",t.interactive=t.interactive||!1,t}function RE(t,e){const n=(n,r)=>Ck(t[n],Ck(e[n],r));return n.isVertical=n=>"vertical"===Ck(t.direction,e.direction||(n?e.symbolDirection:e.gradientDirection)),n.gradientLength=()=>Ck(t.gradientLength,e.gradientLength||e.gradientWidth),n.gradientThickness=()=>Ck(t.gradientThickness,e.gradientThickness||e.gradientHeight),n.entryColumns=()=>Ck(t.columns,Ck(e.columns,+n.isVertical(!0))),n}function PE(t,e){const n=e&&(e.update&&e.update[t]||e.enter&&e.enter[t]);return n&&n.signal?n:n?n.value:null}function BE(t,e,n){return"item.anchor === '".concat("start","' ? ").concat(t," : item.anchor === '").concat("end","' ? ").concat(e," : ").concat(n)}const LE=BE(Object(Z.ab)("left"),Object(Z.ab)("right"),Object(Z.ab)("center"));function IE(t,e){return e?t?Object(Z.G)(t)?Object.assign({},t,{offset:IE(t.offset,e)}):{value:t,offset:e}:e:t}function UE(t,e){return e?(t.name=e.name,t.style=e.style||t.style,t.interactive=!!e.interactive,t.encode=sk(t.encode,e,zE)):t.interactive=!1,t}function qE(t,e,n,r){const i=RE(t,n),o=i.isVertical(),a=i.gradientThickness(),s=i.gradientLength();let u,l,c,f,d;o?(l=[0,1],c=[0,0],f=a,d=s):(l=[0,0],c=[1,0],f=s,d=a);const h={enter:u={opacity:TE,x:TE,y:TE,width:ik(f),height:ik(d)},update:Object(Z.p)({},u,{opacity:$E,fill:{gradient:e,start:l,stop:c}}),exit:{opacity:TE}};return ak(h,{stroke:i("gradientStrokeColor"),strokeWidth:i("gradientStrokeWidth")},{opacity:i("gradientOpacity")}),UE({type:"rect",role:"legend-gradient",encode:h},r)}function WE(t,e,n,r,i){const o=RE(t,n),a=o.isVertical(),s=o.gradientThickness(),u=o.gradientLength();let l,c,f,d,h="";a?(l="y",f="y2",c="x",d="width",h="1-"):(l="x",f="x2",c="y",d="height");const p={opacity:TE,fill:{scale:e,field:CE}};p[l]={signal:h+"datum.perc",mult:u},p[c]=TE,p[f]={signal:h+"datum.perc2",mult:u},p[d]=ik(s);const g={enter:p,update:Object(Z.p)({},p,{opacity:$E}),exit:{opacity:TE}};return ak(g,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),UE({type:"rect",role:"legend-band",key:CE,from:i,encode:g},r)}const YE="datum.".concat("perc",'<=0?"').concat("left",'":datum.').concat("perc",'>=1?"').concat("right",'":"').concat("center",'"'),HE="datum.".concat("perc",'<=0?"').concat("bottom",'":datum.').concat("perc",'>=1?"').concat("top",'":"').concat("middle",'"');function GE(t,e,n,r){const i=RE(t,e),o=i.isVertical(),a=ik(i.gradientThickness()),s=i.gradientLength();let u,l,c,f,d=i("labelOverlap"),h="";const p={enter:u={opacity:TE},update:l={opacity:$E,text:{field:"label"}},exit:{opacity:TE}};return ak(p,{fill:i("labelColor"),fillOpacity:i("labelOpacity"),font:i("labelFont"),fontSize:i("labelFontSize"),fontStyle:i("labelFontStyle"),fontWeight:i("labelFontWeight"),limit:Ck(t.labelLimit,e.gradientLabelLimit)}),o?(u.align={value:"left"},u.baseline=l.baseline={signal:HE},c="y",f="x",h="1-"):(u.align=l.align={signal:YE},u.baseline={value:"top"},c="x",f="y"),u[c]=l[c]={signal:h+"datum.perc",mult:s},u[f]=l[f]=a,a.offset=Ck(t.labelOffset,e.gradientLabelOffset)||0,d=d?{separation:i("labelSeparation"),method:d,order:"datum.index"}:void 0,UE({type:"text",role:"legend-label",style:"guide-label",key:CE,from:r,encode:p,overlap:d},n)}function VE(t,e,n,r,i){const o=RE(t,e),a=n.entries,s=!(!a||!a.interactive),u=a?a.name:void 0,l=o("clipHeight"),c=o("symbolOffset"),f={data:"value"},d="(".concat(i,") ? datum.").concat("offset"," : datum.").concat("size"),h=l?ik(l):{field:"size"},p="datum.".concat("index"),g="max(1, ".concat(i,")");let m,b,y,v,x;h.mult=.5,m={enter:b={opacity:TE,x:{signal:d,mult:.5,offset:c},y:h},update:y={opacity:$E,x:b.x,y:b.y},exit:{opacity:TE}};let _=null,O=null;t.fill||(_=e.symbolBaseFillColor,O=e.symbolBaseStrokeColor),ak(m,{fill:o("symbolFillColor",_),shape:o("symbolType"),size:o("symbolSize"),stroke:o("symbolStrokeColor",O),strokeDash:o("symbolDash"),strokeDashOffset:o("symbolDashOffset"),strokeWidth:o("symbolStrokeWidth")},{opacity:o("symbolOpacity")}),FE.forEach(e=>{t[e]&&(y[e]=b[e]={scale:t[e],field:CE})});const w=UE({type:"symbol",role:"legend-symbol",key:CE,from:f,clip:!!l||void 0,encode:m},n.symbols),j=ik(c);j.offset=o("labelOffset"),m={enter:b={opacity:TE,x:{signal:d,offset:j},y:h},update:y={opacity:$E,text:{field:"label"},x:b.x,y:b.y},exit:{opacity:TE}},ak(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=UE({type:"text",role:"legend-label",style:"guide-label",key:CE,from:f,encode:m},n.labels);return m={enter:{noBound:{value:!l},width:TE,height:l?ik(l):TE,opacity:TE},exit:{opacity:TE},update:y={opacity:$E,row:{signal:null},column:{signal:null}}},o.isVertical(!0)?(v="ceil(item.mark.items.length / ".concat(g,")"),y.row.signal="".concat(p,"%").concat(v),y.column.signal="floor(".concat(p," / ").concat(v,")"),x={field:["row",p]}):(y.row.signal="floor(".concat(p," / ").concat(g,")"),y.column.signal="".concat(p," % ").concat(g),x={field:p}),y.column.signal="(".concat(i,")?").concat(y.column.signal,":").concat(p),NE({role:"scope",from:r={facet:{data:r,name:"value",groupby:"index"}},encode:sk(m,a,zE),marks:[w,k],name:u,interactive:s,sort:x})}const XE='item.orient === "left"',JE='item.orient === "right"',KE="(".concat(XE," || ").concat(JE,")"),ZE="datum.vgrad && ".concat(KE),QE=BE('"top"','"bottom"','"middle"'),tA=BE('"right"','"left"','"center"'),eA="datum.vgrad && ".concat(JE," ? (").concat(tA,") : (").concat(KE," && !(datum.vgrad && ").concat(XE,')) ? "left" : ').concat(LE),nA="item._anchor || (".concat(KE,' ? "middle" : "start")'),rA="".concat(ZE," ? (").concat(XE," ? -90 : 90) : 0"),iA="".concat(KE," ? (datum.vgrad ? (").concat(JE,' ? "bottom" : "top") : ').concat(QE,') : "top"');function oA(t,e){let n;return Object(Z.G)(t)&&(t.signal?n=t.signal:t.path?n="pathShape("+aA(t.path)+")":t.sphere&&(n="geoShape("+aA(t.sphere)+', {type: "Sphere"})')),n?e.signalRef(n):!!t}function aA(t){return Object(Z.G)(t)&&t.signal?t.signal:Object(Z.ab)(t)}function sA(t){const e=t.role||"";return e.indexOf("axis")&&e.indexOf("legend")&&e.indexOf("title")?"group"===t.type?"scope":e||"mark":e}function uA(t){return{marktype:t.type,name:t.name||void 0,role:t.role||sA(t),zindex:+t.zindex||void 0,aria:t.aria,description:t.description}}function lA(t,e){return t&&t.signal?e.signalRef(t.signal):!1!==t}function cA(t,e){const n=Lt(t.type);n||Object(Z.o)("Unrecognized transform type: "+Object(Z.ab)(t.type));const r=Ok(n.type.toLowerCase(),null,fA(n,t,e));return t.signal&&e.addSignal(t.signal,e.proxy(r)),r.metadata=n.metadata||{},r}function fA(t,e,n){const r={},i=t.params.length;for(let o=0;o<i;++o){const i=t.params[o];r[i.name]=dA(i,e,n)}return r}function dA(t,e,n){const r=t.type,i=e[t.name];return"index"===r?function(t,e,n){Object(Z.I)(e.from)||Object(Z.o)('Lookup "from" parameter must be a string literal.');return n.getData(e.from).lookupRef(n,e.key)}(0,e,n):void 0!==i?"param"===r?function(t,e,n){const r=e[t.name];return t.array?(Object(Z.B)(r)||Object(Z.o)("Expected an array of sub-parameters. Instead: "+Object(Z.ab)(r)),r.map(e=>pA(t,e,n))):pA(t,r,n)}(t,e,n):"projection"===r?n.projectionRef(e[t.name]):t.array&&!Mk(i)?i.map(e=>hA(t,e,n)):hA(t,i,n):void(t.required&&Object(Z.o)("Missing required "+Object(Z.ab)(e.type)+" parameter: "+Object(Z.ab)(t.name)))}function hA(t,e,n){const r=t.type;if(Mk(e))return yA(r)?Object(Z.o)("Expression references can not be signals."):vA(r)?n.fieldRef(e):xA(r)?n.compareRef(e):n.signalRef(e.signal);{const i=t.expr||vA(r);return i&&gA(e)?n.exprRef(e.expr,e.as):i&&mA(e)?kk(e.field,e.as):yA(r)?Xw(e,n):bA(r)?jk(n.getData(e).values):vA(r)?kk(e):xA(r)?n.compareRef(e):e}}function pA(t,e,n){const r=t.params.length;let i;for(let n=0;n<r;++n){i=t.params[n];for(const t in i.key)if(i.key[t]!==e[t]){i=null;break}if(i)break}i||Object(Z.o)("Unsupported parameter: "+Object(Z.ab)(e));const o=Object(Z.p)(fA(i,e,n),i.key);return jk(n.add(oE(o)))}const gA=t=>t&&t.expr,mA=t=>t&&t.field,bA=t=>"data"===t,yA=t=>"expr"===t,vA=t=>"field"===t,xA=t=>"compare"===t;function _A(t,e){return t.$ref?t:t.data&&t.data.$ref?t.data:jk(e.getData(t.data).output)}function OA(t,e,n,r,i){this.scope=t,this.input=e,this.output=n,this.values=r,this.aggregate=i,this.index={}}function wA(t){return Object(Z.I)(t)?t:null}function jA(t,e,n){const r=Dk(n.op,n.field);let i;if(e.ops){for(let t=0,n=e.as.length;t<n;++t)if(e.as[t]===r)return}else e.ops=["count"],e.fields=[null],e.as=["count"];n.op&&(e.ops.push((i=n.op.signal)?t.signalRef(i):n.op),e.fields.push(t.fieldRef(n.field)),e.as.push(r))}function kA(t,e,n,r,i,o,a){const s=e[n]||(e[n]={}),u=function(t){return Object(Z.G)(t)?("descending"===t.order?"-":"+")+Dk(t.op,t.field):""}(o);let l,c,f=wA(i);if(null!=f&&(t=e.scope,f+=u?"|"+u:"",l=s[f]),!l){const n=o?{field:Ek,pulse:e.countsRef(t,i,o)}:{field:t.fieldRef(i),pulse:jk(e.output)};u&&(n.sort=t.sortRef(o)),c=t.add(Ok(r,void 0,n)),a&&(e.index[i]=c),l=jk(c),null!=f&&(s[f]=l)}return l}function EA(t,e,n){const r=t.remove,i=t.insert,o=t.toggle,a=t.modify,s=t.values,u=e.add(wk()),l=Xw("if("+t.trigger+',modify("'+n+'",'+[i,r,o,a,s].map(t=>null==t?"null":t).join(",")+"),0)",e);u.update=l.$expr,u.params=l.$params}function AA(t,e){const n=sA(t),r="group"===t.type,i=t.from&&t.from.facet,o=t.overlap;let a,s,u,l,c,f,d,h=t.layout||"scope"===n||"frame"===n;const p="mark"===n||h||i,g=function(t,e,n){let r,i,o,a,s;return t?(r=t.facet)&&(e||Object(Z.o)("Only group marks can be faceted."),null!=r.field?a=s=_A(r,n):(t.data?s=jk(n.getData(t.data).aggregate):(o=cA(Object(Z.p)({type:"aggregate",groupby:Object(Z.i)(r.groupby)},r.aggregate),n),o.params.key=n.keyRef(r.groupby),o.params.pulse=_A(r,n),a=s=jk(n.add(o))),i=n.keyRef(r.groupby,!0))):a=jk(n.add(Yk(null,[{}]))),a||(a=_A(t,n)),{key:i,pulse:a,parent:s}}(t.from,r,e);s=e.add(Gk({key:g.key||(t.key?kk(t.key):void 0),pulse:g.pulse,clean:!r}));const m=jk(s);s=u=e.add(Yk({pulse:m})),s=e.add(eE({markdef:uA(t),interactive:lA(t.interactive,e),clip:oA(t.clip,e),context:{$context:!0},groups:e.lookup(),parent:e.signals.parent?e.signalRef("parent"):null,index:e.markpath(),pulse:jk(s)}));const b=jk(s);s=l=e.add(Vk(gk(t.encode,t.type,n,t.style,e,{mod:!1,pulse:b}))),s.params.parent=e.encode(),t.transform&&t.transform.forEach(t=>{const n=cA(t,e),r=n.metadata;(r.generates||r.changes)&&Object(Z.o)("Mark transforms should not generate new data."),r.nomod||(l.params.mod=!0),n.params.pulse=jk(s),e.add(s=n)}),t.sort&&(s=e.add(hE({sort:e.compareRef(t.sort),pulse:jk(s)})));const y=jk(s);(i||h)&&(h=e.add(pE({layout:e.objectProperty(t.layout),legends:e.legends,mark:b,pulse:y})),f=jk(h));const v=e.add(Wk({mark:b,pulse:f||y}));d=jk(v),r&&(p&&(a=e.operators,a.pop(),h&&a.pop()),e.pushState(y,f||d,m),i?function(t,e,n){const r=t.from.facet,i=r.name,o=_A(r,e);let a;r.name||Object(Z.o)("Facet must have a name: "+Object(Z.ab)(r)),r.data||Object(Z.o)("Facet must reference a data set: "+Object(Z.ab)(r)),r.field?a=e.add(aE({field:e.fieldRef(r.field),pulse:o})):r.groupby?a=e.add(Jk({key:e.keyRef(r.groupby),group:jk(e.proxy(n.parent)),pulse:o})):Object(Z.o)("Facet must specify groupby or field: "+Object(Z.ab)(r));const s=e.fork(),u=s.add(Yk()),l=s.add(dE({pulse:jk(u)}));s.addData(i,new OA(s,u,u,l)),s.addSignal("parent",null),a.params.subflow={$subflow:s.parse(t).toRuntime()}}(t,e,g):p?function(t,e,n){const r=e.add(aE({pulse:n.pulse})),i=e.fork();i.add(dE()),i.addSignal("parent",null),r.params.subflow={$subflow:i.parse(t).toRuntime()}}(t,e,g):e.parse(t),e.popState(),p&&(h&&a.push(h),a.push(v))),o&&(d=function(t,e,n){const r=t.method,i=t.bound,o=t.separation,a={separation:Mk(o)?n.signalRef(o.signal):o,method:Mk(r)?n.signalRef(r.signal):r,pulse:e};t.order&&(a.sort=n.compareRef({field:t.order}));if(i){const t=i.tolerance;a.boundTolerance=Mk(t)?n.signalRef(t.signal):+t,a.boundScale=n.scaleRef(i.scale),a.boundOrient=i.orient}return jk(n.add(iE(a)))}(o,d,e));const x=e.add(cE({pulse:d})),_=e.add(dE({pulse:jk(x)},void 0,e.parent()));null!=t.name&&(c=t.name,e.addData(c,new OA(e,u,x,_)),t.on&&t.on.forEach(t=>{(t.insert||t.remove||t.toggle)&&Object(Z.o)("Marks only support modify triggers."),EA(t,e,c)}))}function DA(t,e){const n=e.config.legend,r=t.encode||{},i=RE(t,n),o=r.legend||{},a=o.name||void 0,s=o.interactive,u=o.style,l={};let c,f,d,h=0;FE.forEach(e=>t[e]?(l[e]=t[e],h=h||t[e]):0),h||Object(Z.o)("Missing valid scale for legend.");const p=function(t,e){let n=t.type||"symbol";t.type||1!==function(t){return FE.reduce((e,n)=>e+(t[n]?1:0),0)}(t)||!t.fill&&!t.stroke||(n=Xs(e)?"gradient":Ks(e)?"discrete":"symbol");return"gradient"!==n?n:Ks(e)?"discrete":"gradient"}(t,e.scaleType(h)),g={title:null!=t.title,scales:l,type:p,vgrad:"symbol"!==p&&i.isVertical()},m=jk(e.add(Yk(null,[g]))),b=jk(e.add(Qk(f={type:p,scale:e.scaleRef(h),count:e.objectProperty(i("tickCount")),limit:e.property(i("symbolLimit")),values:e.objectProperty(t.values),minstep:e.property(t.tickMinStep),formatType:e.property(t.formatType),formatSpecifier:e.property(t.format)})));return"gradient"===p?(d=[qE(t,h,n,r.gradient),GE(t,n,r.labels,b)],f.count=f.count||e.signalRef("max(2,2*floor((".concat(Fk(i.gradientLength()),")/100))"))):"discrete"===p?d=[WE(t,h,n,r.gradient,b),GE(t,n,r.labels,b)]:(c=function(t,e){const n=RE(t,e);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}(t,n),d=[VE(t,n,r,b,Fk(c.columns))],f.size=function(t,e,n){const r=Fk(SA("size",t,n)),i=Fk(SA("strokeWidth",t,n)),o=Fk(function(t,e,n){return PE("fontSize",t)||function(t,e,n){const r=e.config.style[n];return r&&r[t]}("fontSize",e,n)}(n[1].encode,e,"guide-label"));return Xw("max(ceil(sqrt(".concat(r,")+").concat(i,"),").concat(o,")"),e)}(t,e,d[0].marks)),d=[NE({role:"legend-entry",from:m,encode:{enter:{x:{value:0},y:{value:0}}},marks:d,layout:c,interactive:s})],g.title&&d.push(function(t,e,n,r){const i=RE(t,e),o={enter:{opacity:TE},update:{opacity:$E,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:TE}};return ak(o,{orient:i("titleOrient"),_anchor:i("titleAnchor"),anchor:{signal:nA},angle:{signal:rA},align:{signal:eA},baseline:{signal:iA},text:t.title,fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),baseline:i("titleBaseline")}),UE({type:"text",role:"legend-title",style:"guide-title",from:r,encode:o},n)}(t,n,r.title,m)),AA(NE({role:"legend",from:m,encode:sk(MA(i,t,n),o,zE),marks:d,aria:i("aria"),description:i("description"),zindex:i("zindex"),name:a,interactive:s,style:u}),e)}function MA(t,e,n){const r={enter:{},update:{}};return ak(r,{orient:t("orient"),offset:t("offset"),padding:t("padding"),titlePadding:t("titlePadding"),cornerRadius:t("cornerRadius"),fill:t("fillColor"),stroke:t("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:t("legendX"),y:t("legendY"),format:e.format,formatType:e.formatType}),r}function SA(t,e,n){return e[t]?'scale("'.concat(e[t],'",datum)'):PE(t,n[0].encode)}OA.fromEntries=function(t,e){const n=e.length,r=e[n-1],i=e[n-2];let o=e[0],a=null,s=1;for(o&&"load"===o.type&&(o=e[1]),t.add(e[0]);s<n;++s)e[s].params.pulse=jk(e[s-1]),t.add(e[s]),"aggregate"===e[s].type&&(a=e[s]);return new OA(t,o,i,r,a)},OA.prototype={countsRef(t,e,n){const r=this,i=r.counts||(r.counts={}),o=wA(e);let a,s,u;return null!=o&&(t=r.scope,a=i[o]),a?n&&n.field&&jA(t,a.agg.params,n):(u={groupby:t.fieldRef(e,"key"),pulse:jk(r.output)},n&&n.field&&jA(t,u,n),s=t.add(Uk(u)),a=t.add(Yk({pulse:jk(s)})),a={agg:s,ref:jk(a)},null!=o&&(i[o]=a)),a.ref},tuplesRef(){return jk(this.values)},extentRef(t,e){return kA(t,this,"extent","extent",e,!1)},domainRef(t,e){return kA(t,this,"domain","values",e,!1)},valuesRef(t,e,n){return kA(t,this,"vals","values",e,n||!0)},lookupRef(t,e){return kA(t,this,"lookup","tupleindex",e,!1)},indataRef(t,e){return kA(t,this,"indata","tupleindex",e,!0,!0)}};const CA='item.orient==="'.concat("left",'"?-90:item.orient==="').concat("right",'"?90:0');function FA(t,e){const n=RE(t=Object(Z.I)(t)?{text:t}:t,e.config.title),r=t.encode||{},i=r.group||{},o=i.name||void 0,a=i.interactive,s=i.style,u=[],l=jk(e.add(Yk(null,[{}])));return u.push(function(t,e,n,r){const i={value:0},o=t.text,a={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return ak(a,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:e("dx"),dy:e("dy"),fill:e("color"),font:e("font"),fontSize:e("fontSize"),fontStyle:e("fontStyle"),fontWeight:e("fontWeight"),lineHeight:e("lineHeight")},{align:e("align"),angle:e("angle"),baseline:e("baseline")}),UE({type:"text",role:"title-text",style:"group-title",from:r,encode:a},n)}(t,n,function(t){const e=t.encode;return e&&e.title||Object(Z.p)({name:t.name,interactive:t.interactive,style:t.style},e)}(t),l)),t.subtitle&&u.push(function(t,e,n,r){const i={value:0},o=t.subtitle,a={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return ak(a,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:e("dx"),dy:e("dy"),fill:e("subtitleColor"),font:e("subtitleFont"),fontSize:e("subtitleFontSize"),fontStyle:e("subtitleFontStyle"),fontWeight:e("subtitleFontWeight"),lineHeight:e("subtitleLineHeight")},{align:e("align"),angle:e("angle"),baseline:e("baseline")}),UE({type:"text",role:"title-subtitle",style:"group-subtitle",from:r,encode:a},n)}(t,n,r.subtitle,l)),AA(NE({role:"title",from:l,encode:zA(n,i),marks:u,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:o,interactive:a,style:s}),e)}function zA(t,e){const n={enter:{},update:{}};return ak(n,{orient:t("orient"),anchor:t("anchor"),align:{signal:LE},angle:{signal:CA},limit:t("limit"),frame:t("frame"),offset:t("offset")||0,padding:t("subtitlePadding")}),sk(n,e,zE)}function TA(t,e){const n=[];t.transform&&t.transform.forEach(t=>{n.push(cA(t,e))}),t.on&&t.on.forEach(n=>{EA(n,e,t.name)}),e.addDataPipeline(t.name,function(t,e,n){const r=[];let i,o,a,s,u,l=null,c=!1,f=!1;t.values?Sk(t.values)||Sk(t.format)?(r.push(NA(e,t)),r.push(l=$A())):r.push(l=$A({$ingest:t.values,$format:t.format})):t.url?Sk(t.url)||Sk(t.format)?(r.push(NA(e,t)),r.push(l=$A())):r.push(l=$A({$request:t.url,$format:t.format})):t.source&&(l=i=Object(Z.i)(t.source).map(t=>jk(e.getData(t).output)),r.push(null));for(o=0,a=n.length;o<a;++o)s=n[o],u=s.metadata,l||u.source||r.push(l=$A()),r.push(s),u.generates&&(f=!0),u.modifies&&!f&&(c=!0),u.source?l=s:u.changes&&(l=null);i&&(a=i.length-1,r[0]=lE({derive:c,pulse:a?i:i[0]}),(c||a)&&r.splice(1,0,$A()));l||r.push($A());return r.push(dE({})),r}(t,e,n))}function $A(t){const e=Yk({},t);return e.metadata={source:!0},e}function NA(t,e){return tE({url:e.url?t.property(e.url):void 0,async:e.async?t.property(e.async):void 0,values:e.values?t.property(e.values):void 0,format:t.objectProperty(e.format)})}const RA=t=>"bottom"===t||"top"===t,PA=(t,e,n)=>Mk(t)?WA(t.signal,e,n):"left"===t||"top"===t?e:n,BA=(t,e,n)=>Mk(t)?UA(t.signal,e,n):RA(t)?e:n,LA=(t,e,n)=>Mk(t)?qA(t.signal,e,n):RA(t)?n:e,IA=(t,e,n)=>Mk(t)?YA(t.signal,e,n):"top"===t?{value:e}:{value:n},UA=(t,e,n)=>GA("".concat(t," === '").concat("top","' || ").concat(t," === '").concat("bottom","'"),e,n),qA=(t,e,n)=>GA("".concat(t," !== '").concat("top","' && ").concat(t," !== '").concat("bottom","'"),e,n),WA=(t,e,n)=>XA("".concat(t," === '").concat("left","' || ").concat(t," === '").concat("top","'"),e,n),YA=(t,e,n)=>XA("".concat(t," === '").concat("top","'"),e,n),HA=(t,e,n)=>XA("".concat(t," === '").concat("right","'"),e,n),GA=(t,e,n)=>(e=null!=e?ik(e):e,n=null!=n?ik(n):n,VA(e)&&VA(n)?(e=e?e.signal||Object(Z.ab)(e.value):null,n=n?n.signal||Object(Z.ab)(n.value):null,{signal:"".concat(t," ? (").concat(e,") : (").concat(n,")")}):[Object(Z.p)({test:t},e)].concat(n||[])),VA=t=>null==t||1===Object.keys(t).length,XA=(t,e,n)=>({signal:"".concat(t," ? (").concat(JA(e),") : (").concat(JA(n),")")}),JA=t=>Mk(t)?t.signal:null==t?null:Object(Z.ab)(t),KA=(t,e)=>{const n=t.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+e.signal}:t};function ZA(t,e,n,r){let i;if(e&&Object(Z.w)(e,t))return e[t];if(Object(Z.w)(n,t))return n[t];if(t.startsWith("title")){switch(t){case"titleColor":i="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":i=t[5].toLowerCase()+t.slice(6)}return r["guide-title"][i]}if(t.startsWith("label")){switch(t){case"labelColor":i="fill";break;case"labelFont":case"labelFontSize":i=t[5].toLowerCase()+t.slice(6)}return r["guide-label"][i]}return null}function QA(t){const e={};for(const n of t)if(n)for(const t in n)e[t]=1;return Object.keys(e)}function tD(t,e){return{scale:t.scale,range:e}}function eD(t,e,n,r,i){const o=RE(t,e),a=t.orient,s=t.gridScale,u=PA(a,1,-1),l=function(t,e){if(1===e);else if(Object(Z.G)(t)){let n=t=Object(Z.p)({},t);for(;null!=n.mult;){if(!Object(Z.G)(n.mult))return n.mult=Mk(e)?{signal:"(".concat(n.mult,") * (").concat(e.signal,")")}:n.mult*e,t;n=n.mult=Object(Z.p)({},n.mult)}n.mult=e}else t=Mk(e)?{signal:"(".concat(e.signal,") * (").concat(t||0,")")}:e*(t||0);return t}(t.offset,u);let c,f,d;const h={enter:c={opacity:TE},update:d={opacity:$E},exit:f={opacity:TE}};ak(h,{stroke:o("gridColor"),strokeCap:o("gridCap"),strokeDash:o("gridDash"),strokeDashOffset:o("gridDashOffset"),strokeOpacity:o("gridOpacity"),strokeWidth:o("gridWidth")});const p={scale:t.scale,field:CE,band:i.band,extra:i.extra,offset:i.offset,round:o("tickRound")},g=BA(a,{signal:"height"},{signal:"width"}),m=s?{scale:s,range:0,mult:u,offset:l}:{value:0,offset:l},b=s?{scale:s,range:1,mult:u,offset:l}:Object(Z.p)(g,{mult:u,offset:l});return c.x=d.x=BA(a,p,m),c.y=d.y=LA(a,p,m),c.x2=d.x2=LA(a,b),c.y2=d.y2=BA(a,b),f.x=BA(a,p),f.y=LA(a,p),UE({type:"rule",role:"axis-grid",key:CE,from:r,encode:h},n)}function nD(t,e,n,r,i){return{signal:'flush(range("'+t+'"), scale("'+t+'", datum.value), '+e+","+n+","+r+","+i+")"}}function rD(t,e,n,r,i,o){const a=RE(t,e),s=t.orient,u=t.scale,l=PA(s,-1,1),c=Fk(a("labelFlush")),f=Fk(a("labelFlushOffset")),d=a("labelAlign"),h=a("labelBaseline");let p,g=0===c||!!c;const m=ik(i);m.mult=l,m.offset=ik(a("labelPadding")||0),m.offset.mult=l;const b={scale:u,field:CE,band:.5,offset:IE(o.offset,a("labelOffset"))},y=BA(s,g?nD(u,c,'"left"','"right"','"center"'):{value:"center"},((t,e,n)=>Mk(t)?HA(t.signal,e,n):"right"===t?{value:e}:{value:n})(s,"left","right")),v=BA(s,IA(s,"bottom","top"),g?nD(u,c,'"top"','"bottom"','"middle"'):{value:"middle"}),x=nD(u,c,"-(".concat(f,")"),f,0);g=g&&f;const _={opacity:TE,x:BA(s,b,m),y:LA(s,b,m)},O={enter:_,update:p={opacity:$E,text:{field:"label"},x:_.x,y:_.y,align:y,baseline:v},exit:{opacity:TE,x:_.x,y:_.y}};ak(O,{dx:!d&&g?BA(s,x):null,dy:!h&&g?LA(s,x):null}),ak(O,{angle:a("labelAngle"),fill:a("labelColor"),fillOpacity:a("labelOpacity"),font:a("labelFont"),fontSize:a("labelFontSize"),fontWeight:a("labelFontWeight"),fontStyle:a("labelFontStyle"),limit:a("labelLimit"),lineHeight:a("labelLineHeight")},{align:d,baseline:h});const w=a("labelBound");let j=a("labelOverlap");return j=j||w?{separation:a("labelSeparation"),method:j,order:"datum.index",bound:w?{scale:u,orient:s,tolerance:w}:null}:void 0,p.align!==y&&(p.align=KA(p.align,y)),p.baseline!==v&&(p.baseline=KA(p.baseline,v)),UE({type:"text",role:"axis-label",style:"guide-label",key:CE,from:r,encode:O,overlap:j},n)}function iD(t,e,n,r){const i=RE(t,e),o=t.orient,a=PA(o,-1,1);let s,u;const l={enter:s={opacity:TE,anchor:ik(i("titleAnchor",null)),align:{signal:LE}},update:u=Object(Z.p)({},s,{opacity:$E,text:ik(t.title)}),exit:{opacity:TE}},c={signal:'lerp(range("'.concat(t.scale,'"), ').concat(BE(0,1,.5),")")};return u.x=BA(o,c),u.y=LA(o,c),s.angle=BA(o,TE,((t,e)=>0===e?0:Mk(t)?{signal:"(".concat(t.signal,") * ").concat(e)}:{value:t*e})(a,90)),s.baseline=BA(o,IA(o,"bottom","top"),{value:"bottom"}),u.angle=s.angle,u.baseline=s.baseline,ak(l,{fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),angle:i("titleAngle"),baseline:i("titleBaseline")}),function(t,e,n,r){const i=(t,e)=>null!=t?(n.update[e]=KA(ik(t),n.update[e]),!1):!uk(e,r),o=i(t("titleX"),"x"),a=i(t("titleY"),"y");n.enter.auto=a===o?ik(a):BA(e,ik(a),ik(o))}(i,o,l,n),l.update.align=KA(l.update.align,s.align),l.update.angle=KA(l.update.angle,s.angle),l.update.baseline=KA(l.update.baseline,s.baseline),UE({type:"text",role:"axis-title",style:"guide-title",from:r,encode:l},n)}function oD(t,e){const n=function(t,e){var n,r,i,o,a,s,u,l,c=e.config,f=c.style,d=c.axis,h="band"===e.scaleType(t.scale)&&c.axisBand,p=t.orient;if(Mk(p)){const t=QA([c.axisX,c.axisY]),e=QA([c.axisTop,c.axisBottom,c.axisLeft,c.axisRight]);for(i of(n={},t))n[i]=BA(p,ZA(i,c.axisX,d,f),ZA(i,c.axisY,d,f));for(i of(r={},e))r[i]=(o=p.signal,a=ZA(i,c.axisTop,d,f),s=ZA(i,c.axisBottom,d,f),u=ZA(i,c.axisLeft,d,f),l=ZA(i,c.axisRight,d,f),{signal:(null!=u?"".concat(o," === '").concat("left","' ? (").concat(JA(u),") : "):"")+(null!=s?"".concat(o," === '").concat("bottom","' ? (").concat(JA(s),") : "):"")+(null!=l?"".concat(o," === '").concat("right","' ? (").concat(JA(l),") : "):"")+(null!=a?"".concat(o," === '").concat("top","' ? (").concat(JA(a),") : "):"")+"(null)"})}else n="top"===p||"bottom"===p?c.axisX:c.axisY,r=c["axis"+p[0].toUpperCase()+p.slice(1)];return n||r||h?Object(Z.p)({},d,n,r,h):d}(t,e),r=t.encode||{},i=r.axis||{},o=i.name||void 0,a=i.interactive,s=i.style,u=RE(t,n),l=function(t){const e=t("tickBand");let n,r,i=t("tickOffset");return e?e.signal?(n={signal:"(".concat(e.signal,") === 'extent' ? 1 : 0.5")},r={signal:"(".concat(e.signal,") === 'extent'")},Object(Z.G)(i)||(i={signal:"(".concat(e.signal,") === 'extent' ? 0 : ").concat(i)})):"extent"===e?(n=1,r=!0,i=0):(n=.5,r=!1):(n=t("bandPosition"),r=t("tickExtra")),{extra:r,band:n,offset:i}}(u),c={scale:t.scale,ticks:!!u("ticks"),labels:!!u("labels"),grid:!!u("grid"),domain:!!u("domain"),title:null!=t.title},f=jk(e.add(Yk({},[c]))),d=jk(e.add(qk({scale:e.scaleRef(t.scale),extra:e.property(l.extra),count:e.objectProperty(t.tickCount),values:e.objectProperty(t.values),minstep:e.property(t.tickMinStep),formatType:e.property(t.formatType),formatSpecifier:e.property(t.format)}))),h=[];let p;return c.grid&&h.push(eD(t,n,r.grid,d,l)),c.ticks&&(p=u("tickSize"),h.push(function(t,e,n,r,i,o){const a=RE(t,e),s=t.orient,u=PA(s,-1,1);let l,c,f;const d={enter:l={opacity:TE},update:f={opacity:$E},exit:c={opacity:TE}};ak(d,{stroke:a("tickColor"),strokeCap:a("tickCap"),strokeDash:a("tickDash"),strokeDashOffset:a("tickDashOffset"),strokeOpacity:a("tickOpacity"),strokeWidth:a("tickWidth")});const h=ik(i);h.mult=u;const p={scale:t.scale,field:CE,band:o.band,extra:o.extra,offset:o.offset,round:a("tickRound")};return f.y=l.y=BA(s,TE,p),f.y2=l.y2=BA(s,h),c.x=BA(s,p),f.x=l.x=LA(s,TE,p),f.x2=l.x2=LA(s,h),c.y=LA(s,p),UE({type:"rule",role:"axis-tick",key:CE,from:r,encode:d},n)}(t,n,r.ticks,d,p,l))),c.labels&&(p=c.ticks?p:0,h.push(rD(t,n,r.labels,d,p,l))),c.domain&&h.push(function(t,e,n,r){const i=RE(t,e),o=t.orient;let a,s;const u={enter:a={opacity:TE},update:s={opacity:$E},exit:{opacity:TE}};ak(u,{stroke:i("domainColor"),strokeCap:i("domainCap"),strokeDash:i("domainDash"),strokeDashOffset:i("domainDashOffset"),strokeWidth:i("domainWidth"),strokeOpacity:i("domainOpacity")});const l=tD(t,0),c=tD(t,1);return a.x=s.x=BA(o,l,TE),a.x2=s.x2=BA(o,c),a.y=s.y=LA(o,l,TE),a.y2=s.y2=LA(o,c),UE({type:"rule",role:"axis-domain",from:r,encode:u},n)}(t,n,r.domain,f)),c.title&&h.push(iD(t,n,r.title,f)),AA(NE({role:"axis",from:f,encode:sk(aD(u,t),i,zE),marks:h,aria:u("aria"),description:u("description"),zindex:u("zindex"),name:o,interactive:a,style:s}),e)}function aD(t,e){const n={enter:{},update:{}};return ak(n,{orient:t("orient"),offset:t("offset")||0,position:Ck(e.position,0),titlePadding:t("titlePadding"),minExtent:t("minExtent"),maxExtent:t("maxExtent"),range:{signal:'abs(span(range("'.concat(e.scale,'")))')},translate:t("translate"),format:e.format,formatType:e.formatType}),n}function sD(t,e,n){const r=Object(Z.i)(t.signals),i=Object(Z.i)(t.scales);return n||r.forEach(t=>xk(t,e)),Object(Z.i)(t.projections).forEach(t=>function(t,e){const n=e.config.projection||{},r={};for(const n in t)"name"!==n&&(r[n]=SE(t[n],n,e));for(const t in n)null==r[t]&&(r[t]=SE(n[t],t,e));e.addProjection(t.name,r)}(t,e)),i.forEach(t=>function(t,e){const n=t.type||"linear";Gs(n)||Object(Z.o)("Unrecognized scale type: "+Object(Z.ab)(n)),e.addScale(t.name,{type:n,domain:void 0})}(t,e)),Object(Z.i)(t.data).forEach(t=>TA(t,e)),i.forEach(t=>yE(t,e)),(n||r).forEach(t=>function(t,e){const n=e.getSignal(t.name);let r=t.update;t.init&&(r?Object(Z.o)("Signals can not include both init and update expressions."):(r=t.init,n.initonly=!0)),r&&(r=Xw(r,e),n.update=r.$expr,n.params=r.$params),t.on&&t.on.forEach(t=>Bk(t,e,n.id))}(t,e)),Object(Z.i)(t.axes).forEach(t=>oD(t,e)),Object(Z.i)(t.marks).forEach(t=>AA(t,e)),Object(Z.i)(t.legends).forEach(t=>DA(t,e)),t.title&&FA(t.title,e),e.parseLambdas(),e}function uD(t,e){const n=e.config,r=jk(e.root=e.add(wk())),i=function(t,e){const n=n=>Ck(t[n],e[n]),r=[lD("background",n("background")),lD("autosize",ek(n("autosize"))),lD("padding",rk(n("padding"))),lD("width",n("width")||0),lD("height",n("height")||0)],i=r.reduce((t,e)=>(t[e.name]=e,t),{}),o={};return Object(Z.i)(t.signals).forEach(t=>{Object(Z.w)(i,t.name)?t=Object(Z.p)(i[t.name],t):r.push(t),o[t.name]=t}),Object(Z.i)(e.signals).forEach(t=>{Object(Z.w)(o,t.name)||Object(Z.w)(i,t.name)||r.push(t)}),r}(t,n);i.forEach(t=>xk(t,e)),e.description=t.description||n.description,e.eventConfig=n.events,e.legends=e.objectProperty(n.legend&&n.legend.layout),e.locale=n.locale;const o=e.add(Yk()),a=e.add(Vk(gk((t=>sk({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},t))(t.encode),"group","frame",t.style,e,{pulse:jk(o)}))),s=e.add(pE({layout:e.objectProperty(t.layout),legends:e.legends,autosize:e.signalRef("autosize"),mark:r,pulse:jk(a)}));e.operators.pop(),e.pushState(jk(a),jk(s),null),sD(t,e,i),e.operators.push(s);let u=e.add(Wk({mark:r,pulse:jk(s)}));return u=e.add(cE({pulse:jk(u)})),u=e.add(dE({pulse:jk(u)})),e.addData("root",new OA(e,o,o,u)),e}function lD(t,e){return e&&e.signal?{name:t,update:e.signal}:{name:t,value:e}}function cD(t,e){this.config=t||{},this.options=e||{},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 fD(t){this.config=t.config,this.options=t.options,this.legends=t.legends,this.field=Object.create(t.field),this.signals=Object.create(t.signals),this.lambdas=Object.create(t.lambdas),this.scales=Object.create(t.scales),this.events=Object.create(t.events),this.data=Object.create(t.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++t._nextsub[0],this._nextsub=t._nextsub,this._parent=t._parent.slice(),this._encode=t._encode.slice(),this._lookup=t._lookup.slice(),this._markpath=t._markpath}function dD(t){return(Object(Z.B)(t)?hD:pD)(t)}function hD(t){const e=t.length;let n="[";for(let r=0;r<e;++r){const e=t[r];n+=(r>0?",":"")+(Object(Z.G)(e)?e.signal||dD(e):Object(Z.ab)(e))}return n+"]"}function pD(t){let e,n,r="{",i=0;for(e in t)n=t[e],r+=(++i>1?",":"")+Object(Z.ab)(e)+":"+(Object(Z.G)(n)?n.signal||dD(n):Object(Z.ab)(n));return r+"}"}function gD(t,e,n){return Object(Z.G)(t)||Object(Z.o)("Input Vega specification must be an object."),uD(t,new cD(e=Object(Z.O)({description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:"#4c78a8"},area:{fill:"#4c78a8"},image:null,line:{stroke:"#4c78a8",strokeWidth:2},path:{stroke:"#4c78a8"},rect:{fill:"#4c78a8"},rule:{stroke:"#000"},shape:{stroke:"#4c78a8"},symbol:{fill:"#4c78a8",size:64},text:{fill:"#000",font:"sans-serif",fontSize:11},trail:{fill:"#4c78a8",size:2},style:{"guide-label":{fill:"#000",font:"sans-serif",fontSize:10},"guide-title":{fill:"#000",font:"sans-serif",fontSize:11,fontWeight:"bold"},"group-title":{fill:"#000",font:"sans-serif",fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:"#000",font:"sans-serif",fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:"#ddd"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:"#888",grid:!1,gridWidth:1,gridColor:"#ddd",labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:"#888",tickOffset:0,tickRound:!0,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:"#ddd",gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:"#888",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"]}},e,t.config),n)).toRuntime()}cD.prototype=fD.prototype={parse(t){return sD(t,this)},fork(){return new fD(this)},isSubscope(){return this._subid>0},toRuntime(){return this.finish(),{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(t){return this.operators.push(t),t.id=this.id(),t.refs&&(t.refs.forEach(e=>{e.$ref=t.id}),t.refs=null),t},proxy(t){const e=t instanceof _k?jk(t):t;return this.add(uE({value:e}))},addStream(t){return this.streams.push(t),t.id=this.id(),t},addUpdate(t){return this.updates.push(t),t},finish(){let t,e;for(t in this.root&&(this.root.root=!0),this.signals)this.signals[t].signal=t;for(t in this.scales)this.scales[t].scale=t;function n(t,e,n){let r,i;t&&(r=t.data||(t.data={}),i=r[e]||(r[e]=[]),i.push(n))}for(t in this.data){e=this.data[t],n(e.input,t,"input"),n(e.output,t,"output"),n(e.values,t,"values");for(const r in e.index)n(e.index[r],t,"index:"+r)}return this},pushState(t,e,n){this._encode.push(jk(this.add(dE({pulse:t})))),this._parent.push(e),this._lookup.push(n?jk(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return Object(Z.V)(this._parent)},encode(){return Object(Z.V)(this._encode)},lookup(){return Object(Z.V)(this._lookup)},markpath(){const t=this._markpath;return++t[t.length-1]},fieldRef(t,e){if(Object(Z.I)(t))return kk(t,e);t.signal||Object(Z.o)("Unsupported field reference: "+Object(Z.ab)(t));const n=t.signal;let r=this.field[n];if(!r){const t={name:this.signalRef(n)};e&&(t.as=e),this.field[n]=r=jk(this.add(Kk(t)))}return r},compareRef(t){let e=!1;const n=t=>Mk(t)?(e=!0,this.signalRef(t.signal)):function(t){return t&&t.expr}(t)?(e=!0,this.exprRef(t.expr)):t,r=Object(Z.i)(t.field).map(n),i=Object(Z.i)(t.order).map(n);return e?jk(this.add(Hk({fields:r,orders:i}))):Ak(r,i)},keyRef(t,e){let n=!1;const r=this.signals;return t=Object(Z.i)(t).map(t=>Mk(t)?(n=!0,jk(r[t.signal])):t),n?jk(this.add(Zk({fields:t,flat:e}))):function(t,e){const n={$key:t};return e&&(n.$flat=!0),n}(t,e)},sortRef(t){if(!t)return t;const e=Dk(t.op,t.field),n=t.order||"ascending";return n.signal?jk(this.add(Hk({fields:e,orders:this.signalRef(n.signal)}))):Ak(e,n)},event(t,e){const n=t+":"+e;if(!this.events[n]){const r=this.id();this.streams.push({id:r,source:t,type:e}),this.events[n]=r}return this.events[n]},hasOwnSignal(t){return Object(Z.w)(this.signals,t)},addSignal(t,e){this.hasOwnSignal(t)&&Object(Z.o)("Duplicate signal name: "+Object(Z.ab)(t));const n=e instanceof _k?e:this.add(wk(e));return this.signals[t]=n},getSignal(t){return this.signals[t]||Object(Z.o)("Unrecognized signal name: "+Object(Z.ab)(t)),this.signals[t]},signalRef(t){return this.signals[t]?jk(this.signals[t]):(Object(Z.w)(this.lambdas,t)||(this.lambdas[t]=this.add(wk(null))),jk(this.lambdas[t]))},parseLambdas(){const t=Object.keys(this.lambdas);for(let e=0,n=t.length;e<n;++e){const n=t[e],r=Xw(n,this),i=this.lambdas[n];i.params=r.$params,i.update=r.$expr}},property(t){return t&&t.signal?this.signalRef(t.signal):t},objectProperty(t){return t&&Object(Z.G)(t)?this.signalRef(t.signal||dD(t)):t},exprRef(t,e){const n={expr:Xw(t,this)};return e&&(n.expr.$name=e),jk(this.add(Xk(n)))},addBinding(t,e){this.bindings||Object(Z.o)("Nested signals do not support binding: "+Object(Z.ab)(t)),this.bindings.push(Object(Z.p)({signal:t},e))},addScaleProj(t,e){Object(Z.w)(this.scales,t)&&Object(Z.o)("Duplicate scale or projection name: "+Object(Z.ab)(t)),this.scales[t]=this.add(e)},addScale(t,e){this.addScaleProj(t,fE(e))},addProjection(t,e){this.addScaleProj(t,sE(e))},getScale(t){return this.scales[t]||Object(Z.o)("Unrecognized scale name: "+Object(Z.ab)(t)),this.scales[t]},scaleRef(t){return jk(this.getScale(t))},scaleType(t){return this.getScale(t).params.type},projectionRef(t){return this.scaleRef(t)},projectionType(t){return this.scaleType(t)},addData(t,e){return Object(Z.w)(this.data,t)&&Object(Z.o)("Duplicate data set name: "+Object(Z.ab)(t)),this.data[t]=e},getData(t){return this.data[t]||Object(Z.o)("Undefined data set name: "+Object(Z.ab)(t)),this.data[t]},addDataPipeline(t,e){return Object(Z.w)(this.data,t)&&Object(Z.o)("Duplicate data set name: "+Object(Z.ab)(t)),this.addData(t,OA.fromEntries(this,e))}};var mD="5.16.1";Object(Z.p)(Bt,o,s,u,l,c,d,f,h,p,g,m);function bD(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}Object.create;Object.create;function yD(t,e,n){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,n),n}Array.prototype.flat||Object.defineProperty(Array.prototype,"flat",{configurable:!0,value:function t(){var e=isNaN(arguments[0])?1:Number(arguments[0]);return e?Array.prototype.reduce.call(this,(function(n,r){return Array.isArray(r)?n.push.apply(n,t.call(r,e-1)):n.push(r),n}),[]):Array.prototype.slice.call(this)},writable:!0}),Array.prototype.flatMap||Object.defineProperty(Array.prototype,"flatMap",{configurable:!0,value:function(t){return Array.prototype.map.apply(this,arguments).flat()},writable:!0});var vD=n(57),xD=n.n(vD),_D=n(58),OD=n.n(_D),wD=n(22),jD=n.n(wD),kD="4.16.2";function ED(t){return!!t.or}function AD(t){return!!t.and}function DD(t){return!!t.not}function MD(t,e){return DD(t)?{not:MD(t.not,e)}:AD(t)?{and:t.and.map(t=>MD(t,e))}:ED(t)?{or:t.or.map(t=>MD(t,e))}:e(t)}const SD=OD.a,CD=xD.a;function FD(t,e){const n={};for(const r of e)Object(Z.w)(t,r)&&(n[r]=t[r]);return n}function zD(t,e){const n=Object.assign({},t);for(const t of e)delete n[t];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map(t=>jD()(t)).join(",")})`};const TD=jD.a;function $D(t){if(Object(Z.F)(t))return t;const e=Object(Z.I)(t)?t:jD()(t);if(e.length<250)return e;let n=0;for(let t=0;t<e.length;t++){n=(n<<5)-n+e.charCodeAt(t),n&=n}return n}function ND(t){return!1===t||null===t}function RD(t,e){return t.indexOf(e)>-1}function PD(t,e){let n=0;for(const[r,i]of t.entries())if(e(i,r,n++))return!0;return!1}function BD(t,e){let n=0;for(const[r,i]of t.entries())if(!e(i,r,n++))return!1;return!0}function LD(t,...e){for(const n of e)ID(t,null!=n?n:{});return t}function ID(t,e){for(const n of XD(e))Object(Z.kb)(t,n,e[n],!0)}function UD(t,e){const n=[],r={};let i;for(const o of t)i=e(o),i in r||(r[i]=1,n.push(o));return n}function qD(t,e){const n=XD(t),r=XD(e);if(n.length!==r.length)return!1;for(const r of n)if(t[r]!==e[r])return!1;return!0}function WD(t,e){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}function YD(t,e){for(const n of t)if(e.has(n))return!0;return!1}function HD(t){const e=new Set;for(const n of t){const t=Object(Z.Z)(n).map((t,e)=>0===e?t:`[${t}]`),r=t.map((e,n)=>t.slice(0,n+1).join(""));for(const t of r)e.add(t)}return e}function GD(t,e){return void 0===t||void 0===e||YD(HD(t),HD(e))}function VD(t){return 0===XD(t).length}const XD=Object.keys,JD=Object.values,KD=Object.entries;function ZD(t){return!0===t||!1===t}function QD(t){const e=t.replace(/\W/g,"_");return(t.match(/^\d+/)?"_":"")+e}function tM(t,e){return DD(t)?"!("+tM(t.not,e)+")":AD(t)?"("+t.and.map(t=>tM(t,e)).join(") && (")+")":ED(t)?"("+t.or.map(t=>tM(t,e)).join(") || (")+")":e(t)}function eM(t,e){if(0===e.length)return!0;const n=e.shift();return n in t&&eM(t[n],e)&&delete t[n],VD(t)}function nM(t){return t.charAt(0).toUpperCase()+t.substr(1)}function rM(t,e="datum"){const n=Object(Z.Z)(t),r=[];for(let t=1;t<=n.length;t++){const i=`[${n.slice(0,t).map(Z.ab).join("][")}]`;r.push(`${e}${i}`)}return r.join(" && ")}function iM(t,e="datum"){return`${e}[${Object(Z.ab)(Object(Z.Z)(t).join("."))}]`}function oM(t){return t.replace(/(\[|\]|\.|'|")/g,"\\$1")}function aM(t){return""+Object(Z.Z)(t).map(oM).join("\\.")}function sM(t,e,n){return t.replace(new RegExp(e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function uM(t){return""+Object(Z.Z)(t).join(".")}function lM(t){return t?Object(Z.Z)(t).length:0}function cM(...t){for(const e of t)if(void 0!==e)return e}let fM=42;function dM(t){const e=++fM;return t?String(t)+e:e}function hM(){fM=42}function pM(t){return gM(t)?t:"__"+t}function gM(t){return 0===t.indexOf("__")}function mM(t){if(void 0!==t)return(t%360+360)%360}function bM(t){return!!Object(Z.F)(t)||!isNaN(t)&&!isNaN(parseFloat(t))}const yM={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 vM(t){return t&&t.condition}const xM=["domain","grid","labels","ticks","title"],_M={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"},OM={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},wM=Object.assign(Object.assign({},OM),{style:1,labelExpr:1,encoding:1});function jM(t){return!!wM[t]}const kM=XD({axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1}),EM={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},AM={count:1,min:1,max:1};function DM(t){return!!t&&!!t.argmin}function MM(t){return!!t&&!!t.argmax}function SM(t){return Object(Z.I)(t)&&!!EM[t]}const CM=["count","valid","missing","distinct"];function FM(t){return Object(Z.I)(t)&&RD(CM,t)}const zM=["count","sum","distinct","valid","missing"],TM=Object(Z.eb)(["mean","average","median","q1","q3","min","max"]),$M="row",NM="column",RM="radius",PM="theta",BM="theta2",LM="color",IM="fill",UM="stroke",qM="shape",WM={theta:1,theta2:1,radius:1,radius2:1};function YM(t){return t in WM}const HM={longitude:1,longitude2:1,latitude:1,latitude2:1};const GM=XD(HM),VM=Object.assign(Object.assign(Object.assign(Object.assign({},{x:1,y:1,x2:1,y2:1}),WM),HM),{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 XM(t){return t===LM||t===IM||t===UM}const JM={row:1,column:1,facet:1},KM=XD(JM),ZM=Object.assign(Object.assign({},VM),JM),QM=XD(ZM),tS=bD(ZM,["order","detail","tooltip"]),eS=bD(tS,["row","column","facet"]);function nS(t){return!!ZM[t]}const rS=["x2","y2","latitude2","longitude2",BM,"radius2"];function iS(t){return oS(t)!==t}function oS(t){switch(t){case"x2":return"x";case"y2":return"y";case"latitude2":return"latitude";case"longitude2":return"longitude";case BM:return PM;case"radius2":return RM}return t}function aS(t){if(YM(t))switch(t){case PM:return"startAngle";case BM:return"endAngle";case RM:return"outerRadius";case"radius2":return"innerRadius"}return t}function sS(t){switch(t){case"x":return"x2";case"y":return"y2";case"latitude":return"latitude2";case"longitude":return"longitude2";case PM:return BM;case RM:return"radius2"}}function uS(t){switch(t){case"x":case"x2":return"width";case"y":case"y2":return"height"}}const lS=bD(VM,["x","y","x2","y2","latitude","longitude","latitude2","longitude2","theta","theta2","radius","radius2"]),cS=XD(lS),fS={x:1,y:1},dS=XD(fS);function hS(t){return t in fS}const pS={theta:1,radius:1},gS=XD(pS);function mS(t){return"width"===t?"x":"y"}const bS=bD(lS,["text","tooltip","href","url","description","detail","key","order"]),yS=XD(bS);const vS=Object.assign(Object.assign(Object.assign({},fS),pS),bS),xS=XD(vS);function _S(t){return!!vS[t]}function OS(t,e){return function(t){switch(t){case LM:case IM:case UM:case"description":case"detail":case"key":case"tooltip":case"href":case"order":case"opacity":case"fillOpacity":case"strokeOpacity":case"strokeWidth":case"facet":case $M:case NM:return wS;case"x":case"y":case"latitude":case"longitude":return jS;case"x2":case"y2":case"latitude2":case"longitude2":return{area:"always",bar:"always",image:"always",rect:"always",rule:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case"size":return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case"strokeDash":return{line:"always",point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",geoshape:"always"};case qM:return{point:"always",geoshape:"always"};case"text":return{text:"always"};case"angle":return{point:"always",square:"always",text:"always"};case"url":return{image:"always"};case PM:case RM:return{text:"always",arc:"always"};case BM:case"radius2":return{arc:"always"}}}(t)[e]}const wS={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"},jS=bD(wS,["geoshape"]);function kS(t){switch(t){case"x":case"y":case PM:case RM:case"size":case"angle":case"strokeWidth":case"opacity":case"fillOpacity":case"strokeOpacity":case"x2":case"y2":case BM:case"radius2":return;case"facet":case $M:case NM:case qM:case"strokeDash":case"text":case"tooltip":case"href":case"url":case"description":return"discrete";case LM:case IM:case UM:return"flexible";case"latitude":case"longitude":case"latitude2":case"longitude2":case"detail":case"key":case"order":return}}function ES(t){return Object(Z.C)(t)&&(t=aT(t,void 0)),"bin"+XD(t).map(e=>SS(t[e])?QD(`_${e}_${KD(t[e])}`):QD(`_${e}_${t[e]}`)).join("")}function AS(t){return!0===t||MS(t)&&!t.binned}function DS(t){return"binned"===t||MS(t)&&!0===t.binned}function MS(t){return Object(Z.G)(t)}function SS(t){return null==t?void 0:t.selection}function CS(t){switch(t){case $M:case NM:case"size":case LM:case IM:case UM:case"strokeWidth":case"opacity":case"fillOpacity":case"strokeOpacity":case qM:return 6;case"strokeDash":return 4;default:return 10}}function FS(t){return`Invalid specification ${JSON.stringify(t)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}function zS(t){return("width"==t?"Width":"Height")+' "container" only works for single views and layered views.'}function TS(t){return`${"width"==t?"Width":"Height"} "container" only works well with autosize "fit" or "fit-${"width"==t?"x":"y"}".`}function $S(t){return t?`Dropping "fit-${t}" because spec has discrete ${uS(t)}.`:'Dropping "fit" because spec has discrete size.'}function NS(t){return`Unknown field for ${t}. Cannot calculate view size.`}function RS(t){return`Cannot project a selection on encoding channel "${t}", which has no field.`}function PS(t,e){return`Cannot project a selection on encoding channel "${t}" as it uses an aggregate function ("${e}").`}function BS(t){return`Selection not supported for ${t} yet.`}function LS(t){return`The "columns" property cannot be used when "${t}" has nested row/column.`}function IS(t,e,n){return`An ancestor parsed field "${t}" as ${n} but a child wants to parse the field as ${e}.`}function US(t){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${t} are dropped.`}function qS(t){return`Invalid field type "${t}".`}function WS(t,e){const{fill:n,stroke:r}=e;return`Dropping color ${t} as the plot also has ${n&&r?"fill and stroke":n?"fill":"stroke"}.`}function YS(t,e){return`Dropping ${TD(t)} from channel "${e}" since it does not contain any data field, datum, value, or signal.`}function HS(t,e,n){return`${t} dropped as it is incompatible with "${e}"${n?" when "+n:""}.`}function GS(t){return t+" encoding should be discrete (ordinal / nominal / binned)."}function VS(t,e){return`Using discrete channel "${t}" to encode "${e}" field can be misleading as it does not encode ${"ordinal"===e?"order":"magnitude"}.`}function XS(t){return`Using unaggregated domain with raw field has no effect (${TD(t)}).`}function JS(t){return`Unaggregated domain not applicable for "${t}" since it produces values outside the origin domain of the source data.`}function KS(t){return`Unaggregated domain is currently unsupported for log scale (${TD(t)}).`}function ZS(t,e,n){return`${n}-scale's "${e}" is dropped as it does not work with ${t} scale.`}function QS(t){return`The step for "${t}" is dropped because the ${"width"===t?"x":"y"} is continuous.`}const tC="Domains that should be unioned has conflicting sort properties. Sort will be set to true.";function eC(t,e){return`Invalid ${t}: ${TD(e)}.`}function nC(t){return`1D error band does not support ${t}.`}function rC(t){return`Channel ${t} is required for "binned" bin.`}const iC=Object(Z.L)(Z.e);let oC=iC;function aC(...t){oC.warn(...t)}function sC(t){if(t&&Object(Z.G)(t))for(const e of gC)if(e in t)return!0;return!1}const uC=["january","february","march","april","may","june","july","august","september","october","november","december"],lC=uC.map(t=>t.substr(0,3)),cC=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],fC=cC.map(t=>t.substr(0,3));function dC(t,e){const n=[];if(e&&void 0!==t.day&&XD(t).length>1&&(aC(function(t){return`Dropping day from datetime ${TD(t)} as day cannot be combined with other units.`}(t)),delete(t=CD(t)).day),void 0!==t.year?n.push(t.year):n.push(2012),void 0!==t.month){const r=e?function(t){if(bM(t)&&(t=+t),Object(Z.F)(t))return t-1;{const e=t.toLowerCase(),n=uC.indexOf(e);if(-1!==n)return n;const r=e.substr(0,3),i=lC.indexOf(r);if(-1!==i)return i;throw new Error(eC("month",t))}}(t.month):t.month;n.push(r)}else if(void 0!==t.quarter){const r=e?function(t){if(bM(t)&&(t=+t),Object(Z.F)(t))return t>4&&aC(eC("quarter",t)),t-1;throw new Error(eC("quarter",t))}(t.quarter):t.quarter;n.push(Object(Z.F)(r)?3*r:r+"*3")}else n.push(0);if(void 0!==t.date)n.push(t.date);else if(void 0!==t.day){const r=e?function(t){if(bM(t)&&(t=+t),Object(Z.F)(t))return t%7;{const e=t.toLowerCase(),n=cC.indexOf(e);if(-1!==n)return n;const r=e.substr(0,3),i=fC.indexOf(r);if(-1!==i)return i;throw new Error(eC("day",t))}}(t.day):t.day;n.push(Object(Z.F)(r)?r+1:r+"+1")}else n.push(1);for(const e of["hours","minutes","seconds","milliseconds"]){const r=t[e];n.push(void 0===r?0:r)}return n}function hC(t){const e=dC(t,!0).join(", ");return t.utc?`utc(${e})`:`datetime(${e})`}const pC={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},gC=XD(pC);function mC(t){return t.startsWith("utc")}const bC={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function yC(t){const e=[];for(const n of gC)vC(t,n)&&e.push(n);return e}function vC(t,e){const n=t.indexOf(e);return!(n<0)&&(!(n>0&&"seconds"===e&&"i"===t.charAt(n-1))&&(!(t.length>n+3&&"day"===e&&"o"===t.charAt(n+3))&&!(n>0&&"year"===e&&"f"===t.charAt(n-1))))}function xC(t,e,{end:n}={end:!1}){const r=rM(e),i=mC(t)?"utc":"";let o;const a={};for(const e of gC)vC(t,e)&&(a[e]="quarter"===(s=e)?`(${i}quarter(${r})-1)`:`${i}${s}(${r})`,o=e);var s;return n&&(a[o]+="+1"),function(t){const e=dC(t,!1).join(", ");return t.utc?`utc(${e})`:`datetime(${e})`}(a)}function _C(t){if(!t)return;const e=yC(t);return`timeUnitSpecifier(${jD()(e)}, ${jD()(bC)})`}function OC(t){if(!t)return;let e;return Object(Z.I)(t)?e={unit:t}:Object(Z.G)(t)&&(e=Object.assign(Object.assign({},t),t.unit?{unit:t.unit}:{})),mC(e.unit)&&(e.utc=!0,e.unit=e.unit.substr(3)),e}function wC(t){return t&&!!t.signal}function jC(t){return!!t.step}function kC(t){return!Object(Z.B)(t)&&("field"in t&&"data"in t)}const EC=XD({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,url:1,smooth:1}),AC={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},DC=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function MC(t){return t&&!!t.field&&void 0!==t.equal}function SC(t){return t&&!!t.field&&void 0!==t.lt}function CC(t){return t&&!!t.field&&void 0!==t.lte}function FC(t){return t&&!!t.field&&void 0!==t.gt}function zC(t){return t&&!!t.field&&void 0!==t.gte}function TC(t){if(t&&t.field){if(Object(Z.B)(t.range)&&2===t.range.length)return!0;if(wC(t.range))return!0}return!1}function $C(t){return t&&!!t.field&&(Object(Z.B)(t.oneOf)||Object(Z.B)(t.in))}function NC(t){return $C(t)||MC(t)||TC(t)||SC(t)||FC(t)||CC(t)||zC(t)}function RC(t,e){return lT(t,{timeUnit:e,wrapTime:!0})}function PC(t,e=!0){var n;const{field:r}=t,i=null===(n=OC(t.timeUnit))||void 0===n?void 0:n.unit,o=i?"time("+xC(i,r)+")":Yz(t,{expr:"datum"});if(MC(t))return o+"==="+RC(t.equal,i);if(SC(t)){return`${o}<${RC(t.lt,i)}`}if(FC(t)){return`${o}>${RC(t.gt,i)}`}if(CC(t)){return`${o}<=${RC(t.lte,i)}`}if(zC(t)){return`${o}>=${RC(t.gte,i)}`}if($C(t))return`indexof([${function(t,e){return t.map(t=>RC(t,e))}(t.oneOf,i).join(",")}], ${o}) !== -1`;if(function(t){return t&&!!t.field&&void 0!==t.valid}(t))return BC(o,t.valid);if(TC(t)){const{range:n}=t,r=wC(n)?{signal:n.signal+"[0]"}:n[0],a=wC(n)?{signal:n.signal+"[1]"}:n[1];if(null!==r&&null!==a&&e)return"inrange("+o+", ["+RC(r,i)+", "+RC(a,i)+"])";const s=[];return null!==r&&s.push(`${o} >= ${RC(r,i)}`),null!==a&&s.push(`${o} <= ${RC(a,i)}`),s.length>0?s.join(" && "):"true"}throw new Error("Invalid field predicate: "+JSON.stringify(t))}function BC(t,e=!0){return e?`isValid(${t}) && isFinite(+${t})`:`!isValid(${t}) || !isFinite(+${t})`}function LC(t){var e;return NC(t)&&t.timeUnit?Object.assign(Object.assign({},t),{timeUnit:null===(e=OC(t.timeUnit))||void 0===e?void 0:e.unit}):t}const IC="quantitative",UC="ordinal",qC="temporal",WC="nominal",YC="geojson";const HC="linear",GC="log",VC="pow",XC="sqrt",JC="symlog",KC="time",ZC="utc",QC="quantile",tF="quantize",eF="threshold",nF="point",rF="band",iF={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"};function oF(t,e){const n=iF[t],r=iF[e];return n===r||"ordinal-position"===n&&"time"===r||"ordinal-position"===r&&"time"===n}const aF={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 sF(t){return aF[t]}const uF=["linear","log","pow","sqrt","symlog","time","utc"],lF=Object(Z.eb)(uF),cF=Object(Z.eb)(["linear","log","pow","sqrt","symlog"]);const fF=Object(Z.eb)(["quantile","quantize","threshold"]),dF=uF.concat(["quantile","quantize","threshold","sequential","identity"]),hF=Object(Z.eb)(dF),pF=Object(Z.eb)(["ordinal","bin-ordinal","point","band"]);function gF(t){return t in pF}function mF(t){return t in hF}function bF(t){return t in lF}function yF(t){return t in fF}function vF(t){return null==t?void 0:t.selection}const xF=bD({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},["type","domain","range","rangeMax","rangeMin","scheme"]),_F=XD(xF);function OF(t,e){switch(e){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!RD(["point","band","identity"],t);case"bins":return!RD(["point","band","identity","ordinal"],t);case"round":return bF(t)||"band"===t||"point"===t;case"padding":case"rangeMin":case"rangeMax":return bF(t)||RD(["point","band"],t);case"paddingOuter":case"align":return RD(["point","band"],t);case"paddingInner":return"band"===t;case"domainMax":case"domainMid":case"domainMin":case"clamp":return bF(t);case"nice":return bF(t)||"quantize"===t||"threshold"===t;case"exponent":return"pow"===t;case"base":return"log"===t;case"constant":return"symlog"===t;case"zero":return mF(t)&&!RD(["log","time","utc","threshold","quantile"],t)}}function wF(t,e){switch(e){case"interpolate":case"scheme":case"domainMid":return XM(t)?void 0:`Cannot use the scale property "${t}" with non-color channel.`;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}}function jF(t){return t&&!!t.expr}function kF(t){const e=XD(t||{}),n={};for(const r of e)n[r]=gT(t[r]);return n}const EF={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"},AF=EF.arc,DF=EF.area,MF=EF.bar,SF=EF.image,CF=EF.line,FF=EF.point,zF=EF.rect,TF=EF.rule,$F=EF.text,NF=EF.tick,RF=EF.trail,PF=EF.circle,BF=EF.square,LF=EF.geoshape;function IF(t){return RD(["line","area","trail"],t)}function UF(t){return RD(["rect","bar","image","arc"],t)}const qF=XD(EF);function WF(t){return t.type}Object(Z.eb)(qF);const YF=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit","fill","fillOpacity"],HF=XD({color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBand:1,timeUnitBandPosition:1}),GF=XD({mark:1,arc:1,area:1,bar:1,circle:1,image:1,line:1,point:1,rect:1,rule:1,square:1,text:1,tick:1,trail:1,geoshape:1}),VF={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},XF={binSpacing:1,continuousBandSize:5,timeUnitBandPosition:.5},JF={binSpacing:0,continuousBandSize:5,timeUnitBandPosition:.5};function KF(t){const{channel:e,channelDef:n,markDef:r,scale:i,config:o}=t,a=rz(t);return Fz(n)&&!FM(n.aggregate)&&i&&bF(i.get("type"))&&!1===i.get("zero")?ZF({fieldDef:n,channel:e,markDef:r,ref:a,config:o}):a}function ZF({fieldDef:t,channel:e,markDef:n,ref:r,config:i}){if(IF(n.type))return r;return null===_T("invalid",n,i)?r:[QF(t,e),r]}function QF(t,e){const n=tz(t,!0),r="y"===oS(e)?{field:{group:"height"}}:{value:0};return Object.assign({test:n},r)}function tz(t,e=!0){return BC(Object(Z.I)(t)?t:Yz(t,{expr:"datum"}),!e)}function ez(t,e,n,r){const i={};if(e&&(i.scale=e),Tz(t)){const{datum:e}=t;sC(e)?i.signal=hC(e):wC(e)?i.signal=e.signal:jF(e)?i.signal=e.expr:i.value=e}else i.field=Yz(t,n);if(r){const{offset:t,band:e}=r;t&&(i.offset=t),e&&(i.band=e)}return i}function nz({scaleName:t,fieldOrDatumDef:e,fieldOrDatumDef2:n,offset:r,startSuffix:i,band:o=.5}){const a=0<o&&o<1?"datum":void 0,s=Yz(e,{expr:a,suffix:i}),u=void 0!==n?Yz(n,{expr:a}):Yz(e,{suffix:"end",expr:a}),l={};if(0===o||1===o){l.scale=t;const e=0===o?s:u;l.field=e}else{const e=`${o} * ${s} + ${1-o} * ${u}`;l.signal=`scale("${t}", ${e})`}return r&&(l.offset=r),l}function rz({channel:t,channelDef:e,channel2Def:n,markDef:r,config:i,scaleName:o,scale:a,stack:s,offset:u,defaultRef:l,band:c}){var f;if(e){if(Rz(e)){if(Pz(e)){c=null!=c?c:Az({channel:t,fieldDef:e,fieldDef2:n,markDef:r,stack:s,config:i,isMidPoint:!0});const{bin:a,timeUnit:l,type:f}=e;if(AS(a)||c&&l&&f===qC)return s&&s.impute?ez(e,o,{binSuffix:"mid"},{offset:u}):c?nz({scaleName:o,fieldOrDatumDef:e,band:c,offset:u}):ez(e,o,fT(e,t)?{binSuffix:"range"}:{},{offset:u});if(DS(a)){if(Fz(n))return nz({scaleName:o,fieldOrDatumDef:e,fieldOrDatumDef2:n,band:c,offset:u});aC(rC("x"===t?"x2":"y2"))}}const l=null==a?void 0:a.get("type");return ez(e,o,gF(l)?{binSuffix:"range"}:{},{offset:u,band:"band"===l?null!==(f=null!=c?c:e.band)&&void 0!==f?f:.5:void 0})}if(Bz(e)){const n=e.value,r=u?{offset:u}:{};return Object.assign(Object.assign({},iz(t,n)),r)}}return Object(Z.E)(l)&&(l=l()),l?Object.assign(Object.assign({},l),u?{offset:u}:{}):l}function iz(t,e){return RD(["x","x2"],t)&&"width"===e?{field:{group:"width"}}:RD(["y","y2"],t)&&"height"===e?{field:{group:"height"}}:bT(e)}function oz(t){return t&&"number"!==t&&"time"!==t}function az(t,e,n){return`${t}(${e}${n?", "+JSON.stringify(n):""})`}function sz({fieldOrDatumDef:t,format:e,formatType:n,expr:r,normalizeStack:i,config:o}){var a,s;if(oz(n))return lz({fieldOrDatumDef:t,format:e,formatType:n,expr:r,config:o});const u=uz(t,r,i);if(uT(t)){const n=function(t,e,n,r,i){return!e||n?(n=Object(Z.I)(n)?n:r,`${i?"utc":"time"}Format(${t}, '${n}')`):function(t,e,n){if(!t)return;const r=_C(t);return`${n||mC(t)?"utc":"time"}Format(${e}, ${r})`}(e,t,i)}(u,Fz(t)?null===(a=OC(t.timeUnit))||void 0===a?void 0:a.unit:void 0,e,o.timeFormat,Lz(t)&&(null===(s=t.scale)||void 0===s?void 0:s.type)===ZC);return n?{signal:n}:void 0}if(e=dz(zz(t),e,o),Fz(t)&&AS(t.bin)){return{signal:gz(u,Yz(t,{expr:r,binSuffix:"end"}),e,n,o)}}return e||"quantitative"===zz(t)?{signal:""+hz(u,e)}:{signal:`isValid(${u}) ? ${u} : ""+${u}`}}function uz(t,e,n){return Fz(t)?n?`${Yz(t,{expr:e,suffix:"end"})}-${Yz(t,{expr:e,suffix:"start"})}`:Yz(t,{expr:e}):function(t){const{datum:e}=t;return sC(e)?hC(e):""+JSON.stringify(e)}(t)}function lz({fieldOrDatumDef:t,format:e,formatType:n,expr:r,normalizeStack:i,config:o,field:a}){if(a=null!=a?a:uz(t,r,i),Fz(t)&&AS(t.bin)){return{signal:gz(a,Yz(t,{expr:r,binSuffix:"end"}),e,n,o)}}return{signal:az(n,a,e)}}function cz(t,e,n,r,i,o){var a;if(!oz(r)){if(uT(t)){return function(t,e,n,r){if(t)return t;if(e)return{signal:_C(e)};return r?void 0:n.timeFormat}(n,Fz(t)?null===(a=OC(t.timeUnit))||void 0===a?void 0:a.unit:void 0,i,o)}return dz(e,n,i)}}function fz(t,e,n){return t&&(wC(t)||"number"===t||"time"===t)?t:uT(e)&&"time"!==n&&"utc"!==n?"time":void 0}function dz(t,e,n){return Object(Z.I)(e)?e:t===IC?n.numberFormat:void 0}function hz(t,e){return`format(${t}, "${e||""}")`}function pz(t,e,n,r){var i;return oz(n)?az(n,t,e):hz(t,null!==(i=Object(Z.I)(e)?e:void 0)&&void 0!==i?i:r.numberFormat)}function gz(t,e,n,r,i){const o=pz(t,n,r,i),a=pz(e,n,r,i);return`${BC(t,!1)} ? "null" : ${o} + " – " + ${a}`}const mz="min",bz={x:1,y:1,color:1,fill:1,stroke:1,strokeWidth:1,size:1,shape:1,fillOpacity:1,strokeOpacity:1,opacity:1,text:1};function yz(t){return t in bz}function vz(t){return!!t&&!!t.encoding}function xz(t){return!(!t||"count"!==t.op&&!t.field)}function _z(t){return!!t&&Object(Z.B)(t)}function Oz(t){return"row"in t||"column"in t}function wz(t){return!!t&&"header"in t}function jz(t){return"facet"in t}function kz(t){const{field:e,timeUnit:n,bin:r,aggregate:i}=t;return Object.assign(Object.assign(Object.assign(Object.assign({},n?{timeUnit:n}:{}),r?{bin:r}:{}),i?{aggregate:i}:{}),{field:e})}function Ez(t){return"sort"in t}function Az({channel:t,fieldDef:e,fieldDef2:n,markDef:r,stack:i,config:o,isMidPoint:a}){if(Rz(e)&&void 0!==e.band)return e.band;if(Fz(e)){const{timeUnit:t,bin:i}=e;if(t&&!n)return a?OT("timeUnitBandPosition",r,o):UF(r.type)?OT("timeUnitBand",r,o):0;if(AS(i))return UF(r.type)&&!a?1:.5}return(null==i?void 0:i.fieldChannel)===t&&a?.5:void 0}function Dz(t,e,n,r,i,o){return!!(AS(e.bin)||e.timeUnit&&Pz(e)&&"temporal"===e.type)&&!!Az({channel:t,fieldDef:e,fieldDef2:n,stack:r,markDef:i,config:o})}function Mz(t){return!!t&&"condition"in t}function Sz(t){const e=t&&t.condition;return!!e&&!Object(Z.B)(e)&&Fz(e)}function Cz(t){const e=t&&t.condition;return!!e&&!Object(Z.B)(e)&&Rz(e)}function Fz(t){return!(!t||!t.field&&"count"!==t.aggregate)}function zz(t){return t&&t.type}function Tz(t){return!!t&&"datum"in t}function $z(t){return Pz(t)&&Gz(t)||Nz(t)}function Nz(t){return Tz(t)&&Object(Z.F)(t.datum)}function Rz(t){return Fz(t)||Tz(t)}function Pz(t){return!!t&&("field"in t||"count"===t.aggregate)&&"type"in t}function Bz(t){return t&&"value"in t&&"value"in t}function Lz(t){return!!t&&("scale"in t||"sort"in t)}function Iz(t){return t&&("axis"in t||"stack"in t||"impute"in t)}function Uz(t){return!!t&&"legend"in t}function qz(t){return!!t&&("format"in t||"formatType"in t)}function Wz(t){return zD(t,["legend","axis","header","scale"])}function Yz(t,e={}){var n,r,i;let o=t.field;const a=e.prefix;let s=e.suffix,u="";if(function(t){return"count"===t.aggregate}(t))o=pM("count");else{let a;if(!e.nofn)if(function(t){return"op"in t}(t))a=t.op;else{const{bin:l,aggregate:c,timeUnit:f}=t;AS(l)?(a=ES(l),s=(null!==(n=e.binSuffix)&&void 0!==n?n:"")+(null!==(r=e.suffix)&&void 0!==r?r:"")):c?MM(c)?(u=`["${o}"]`,o="argmax_"+c.argmax):DM(c)?(u=`["${o}"]`,o="argmin_"+c.argmin):a=String(c):f&&(a=function(t){const e=OC(t),{utc:n}=e,r=bD(e,["utc"]);return r.unit?(n?"utc":"")+XD(r).map(t=>QD(`${"unit"===t?"":`_${t}_`}${r[t]}`)).join(""):(n?"utc":"")+"timeunit"+XD(r).map(t=>QD(`_${t}_${r[t]}`)).join("")}(f),s=(!RD(["range","mid"],e.binSuffix)&&e.binSuffix||"")+(null!==(i=e.suffix)&&void 0!==i?i:""))}a&&(o=o?`${a}_${o}`:a)}return s&&(o=`${o}_${s}`),a&&(o=`${a}_${o}`),e.forAs?uM(o):e.expr?iM(o,e.expr)+u:aM(o)+u}function Hz(t){switch(t.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return Fz(t)&&!!t.bin;case"temporal":return!1}throw new Error(qS(t.type))}function Gz(t){return!Hz(t)}const Vz=(t,e)=>{switch(e.fieldTitle){case"plain":return t.field;case"functional":return function(t){const{aggregate:e,bin:n,timeUnit:r,field:i}=t;if(MM(e))return`${i} for argmax(${e.argmax})`;if(DM(e))return`${i} for argmin(${e.argmin})`;const o=OC(r),a=e||(null==o?void 0:o.unit)||(null==o?void 0:o.maxbins)&&"timeunit"||AS(n)&&"bin";return a?a.toUpperCase()+"("+i+")":i}(t);default:return function(t,e){var n;const{field:r,bin:i,timeUnit:o,aggregate:a}=t;if("count"===a)return e.countTitle;if(AS(i))return r+" (binned)";if(o){const t=null===(n=OC(o))||void 0===n?void 0:n.unit;if(t)return`${r} (${yC(t).join("-")})`}else if(a)return MM(a)?`${r} for max ${a.argmax}`:DM(a)?`${r} for min ${a.argmin}`:`${nM(a)} of ${r}`;return r}(t,e)}};let Xz=Vz;function Jz(t){Xz=t}function Kz(t,e,{allowDisabling:n,includeDefault:r=!0}){var i,o;const a=null===(i=Zz(t))||void 0===i?void 0:i.title;if(!Fz(t))return a;const s=t,u=r?Qz(s,e):void 0;return n?cM(a,s.title,u):null!==(o=null!=a?a:s.title)&&void 0!==o?o:u}function Zz(t){return Iz(t)&&t.axis?t.axis:Uz(t)&&t.legend?t.legend:wz(t)&&t.header?t.header:void 0}function Qz(t,e){return Xz(t,e)}function tT(t){var e;if(qz(t)){const{format:e,formatType:n}=t;return{format:e,formatType:n}}{const n=null!==(e=Zz(t))&&void 0!==e?e:{},{format:r,formatType:i}=n;return{format:r,formatType:i}}}function eT(t){return Fz(t)?t:Sz(t)?t.condition:void 0}function nT(t){return Rz(t)?t:Cz(t)?t.condition:void 0}function rT(t,e,n,r={}){if(Object(Z.I)(t)||Object(Z.F)(t)||Object(Z.C)(t)){return aC(function(t,e,n){return`Channel ${t} is a ${e}. Converted to {value: ${TD(n)}}.`}(e,Object(Z.I)(t)?"string":Object(Z.F)(t)?"number":"boolean",t)),{value:t}}return Rz(t)?iT(t,e,n,r):Cz(t)?Object.assign(Object.assign({},t),{condition:iT(t.condition,e,n,r)}):t}function iT(t,e,n,r){if(qz(t)){const{format:i,formatType:o}=t,a=bD(t,["format","formatType"]);if(oz(o)&&!n.customFormatTypes)return aC(US(e)),iT(a,e,n,r)}else{const i=Iz(t)?"axis":Uz(t)?"legend":wz(t)?"header":null;if(i&&t[i]){const o=t[i],{format:a,formatType:s}=o,u=bD(o,["format","formatType"]);if(oz(s)&&!n.customFormatTypes)return aC(US(e)),iT(Object.assign(Object.assign({},t),{[i]:u}),e,n,r)}}return Fz(t)?oT(t,e,r):function(t){let e=t.type;if(e)return t;const{datum:n}=t;return e=Object(Z.F)(n)?"quantitative":Object(Z.I)(n)?"nominal":sC(n)?"temporal":void 0,Object.assign(Object.assign({},t),{type:e})}(t)}function oT(t,e,{compositeMark:n=!1}={}){const{aggregate:r,timeUnit:i,bin:o,field:a}=t,s=Object.assign({},t);if(n||!r||SM(r)||MM(r)||DM(r)||(aC(function(t){return`Invalid aggregation operator "${t}".`}(r)),delete s.aggregate),i&&(s.timeUnit=OC(i)),a&&(s.field=""+a),AS(o)&&(s.bin=aT(o,e)),DS(o)&&!hS(e)&&aC(function(t){return`Channel ${t} should not be used with "binned" bin.`}(e)),Pz(s)){const{type:t}=s,e=function(t){if(t)switch(t=t.toLowerCase()){case"q":case IC:return"quantitative";case"t":case qC:return"temporal";case"o":case UC:return"ordinal";case"n":case WC:return"nominal";case YC:return"geojson"}}(t);t!==e&&(s.type=e),"quantitative"!==t&&FM(r)&&(aC(function(t,e){return`Invalid field type "${t}" for aggregate: "${e}", using "quantitative" instead.`}(t,r)),s.type="quantitative")}else if(!iS(e)){const t=function(t,e){var n;switch(e){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(Ez(t)&&Object(Z.B)(t.sort))return"ordinal";const{aggregate:r,bin:i,timeUnit:o}=t;if(o)return"temporal";if(i||r&&!MM(r)&&!DM(r))return"quantitative";if(Lz(t)&&(null===(n=t.scale)||void 0===n?void 0:n.type))switch(iF[t.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}(s,e);s.type=t}if(Pz(s)){const{compatible:t,warning:n}=function(t,e){const n=t.type;if("geojson"===n&&"shape"!==e)return{compatible:!1,warning:`Channel ${e} should not be used with a geojson data.`};switch(e){case $M:case NM:case"facet":return Gz(t)?{compatible:!1,warning:GS(e)}:sT;case"x":case"y":case LM:case IM:case UM:case"text":case"detail":case"key":case"tooltip":case"href":case"url":case"angle":case PM:case RM:case"description":return sT;case"longitude":case"longitude2":case"latitude":case"latitude2":return n!==IC?{compatible:!1,warning:`Channel ${e} should be used with a quantitative field only, not ${t.type} field.`}:sT;case"opacity":case"fillOpacity":case"strokeOpacity":case"strokeWidth":case"size":case BM:case"radius2":case"x2":case"y2":return"nominal"!==n||t.sort?sT:{compatible:!1,warning:`Channel ${e} should not be used with an unsorted discrete field.`};case"strokeDash":return RD(["ordinal","nominal"],t.type)?sT:{compatible:!1,warning:"StrokeDash channel should be used with only discrete data."};case qM:return RD(["ordinal","nominal","geojson"],t.type)?sT:{compatible:!1,warning:"Shape channel should be used with only either discrete or geojson data."};case"order":return"nominal"!==t.type||"sort"in t?sT:{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}}}(s,e)||{};!1===t&&aC(n)}if(Ez(s)&&Object(Z.I)(s.sort)){const{sort:t}=s;if(yz(t))return Object.assign(Object.assign({},s),{sort:{encoding:t}});const e=t.substr(1);if("-"===t.charAt(0)&&yz(e))return Object.assign(Object.assign({},s),{sort:{encoding:e,order:"descending"}})}if(wz(s)){const{header:t}=s,{orient:e}=t,n=bD(t,["orient"]);if(e)return Object.assign(Object.assign({},s),{header:Object.assign(Object.assign({},n),{labelOrient:t.labelOrient||e,titleOrient:t.titleOrient||e})})}return s}function aT(t,e){return Object(Z.C)(t)?{maxbins:CS(e)}:"binned"===t?{binned:!0}:t.maxbins||t.step?t:Object.assign(Object.assign({},t),{maxbins:CS(e)})}const sT={compatible:!0};function uT(t){const{formatType:e}=tT(t);return"time"===e||!e&&((n=t)&&("temporal"===n.type||Fz(n)&&!!n.timeUnit));var n}function lT(t,{timeUnit:e,type:n,wrapTime:r,undefinedIfExprNotRequired:i}){var o;const a=e&&(null===(o=OC(e))||void 0===o?void 0:o.unit);let s,u=a||"temporal"===n;return jF(t)?s=t.expr:wC(t)?s=t.signal:sC(t)?(u=!0,s=hC(t)):(Object(Z.I)(t)||Object(Z.F)(t))&&u&&(s=`datetime(${JSON.stringify(t)})`,function(t){return!!pC[t]}(a)&&(Object(Z.F)(t)&&t<1e4||Object(Z.I)(t)&&isNaN(Date.parse(t)))&&(s=hC({[a]:t}))),s?r&&u?`time(${s})`:s:i?void 0:JSON.stringify(t)}function cT(t,e){const{type:n}=t;return e.map(e=>{const r=lT(e,{timeUnit:Fz(t)?t.timeUnit:void 0,type:n,undefinedIfExprNotRequired:!0});return void 0!==r?{signal:r}:e})}function fT(t,e){return AS(t.bin)?_S(e)&&RD(["ordinal","nominal"],t.type):(console.warn("Only call this method for binned field defs."),!1)}function dT(t){const{anchor:e,frame:n,offset:r,orient:i,color:o,subtitleColor:a,subtitleFont:s,subtitleFontSize:u,subtitleFontStyle:l,subtitleFontWeight:c,subtitleLineHeight:f,subtitlePadding:d}=t,h=bD(t,["anchor","frame","offset","orient","color","subtitleColor","subtitleFont","subtitleFontSize","subtitleFontStyle","subtitleFontWeight","subtitleLineHeight","subtitlePadding"]),p=Object.assign(Object.assign({},h),o?{fill:o}:{}),g=Object.assign(Object.assign(Object.assign(Object.assign({},e?{anchor:e}:{}),n?{frame:n}:{}),r?{offset:r}:{}),i?{orient:i}:{}),m=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a?{subtitleColor:a}:{}),s?{subtitleFont:s}:{}),u?{subtitleFontSize:u}:{}),l?{subtitleFontStyle:l}:{}),c?{subtitleFontWeight:c}:{}),f?{subtitleLineHeight:f}:{}),d?{subtitlePadding:d}:{});return{titleMarkConfig:p,subtitleMarkConfig:FD(p,["align","baseline","dx","dy","limit"]),nonMark:g,subtitle:m}}function hT(t){return Object(Z.I)(t)||Object(Z.B)(t)&&Object(Z.I)(t[0])}function pT(t){const e=Object(Z.B)(t.condition)?t.condition.map(mT):mT(t.condition);return Object.assign(Object.assign({},gT(t)),{condition:e})}function gT(t){if(jF(t)){const{expr:e}=t,n=bD(t,["expr"]);return Object.assign({signal:e},n)}return t}function mT(t){if(jF(t)){const{expr:e}=t,n=bD(t,["expr"]);return Object.assign({signal:e},n)}return t}function bT(t){if(jF(t)){const{expr:e}=t,n=bD(t,["expr"]);return Object.assign({signal:e},n)}return wC(t)?t:void 0!==t?{value:t}:void 0}function yT(t){return wC(t)?t.signal:Object(Z.ab)(t.value)}function vT(t){return wC(t)?t.signal:null==t?null:Object(Z.ab)(t)}function xT(t){var e;return[].concat(t.type,null!==(e=t.style)&&void 0!==e?e:[])}function _T(t,e,n,r={}){const{vgChannel:i,ignoreVgConfig:o}=r;return i&&void 0!==e[i]?e[i]:void 0!==e[t]?e[t]:!o||i&&i!==t?OT(t,e,n,r):void 0}function OT(t,e,n,{vgChannel:r}={}){return cM(r?wT(t,e,n.style):void 0,wT(t,e,n.style),r?n[e.type][r]:void 0,n[e.type][t],r?n.mark[r]:n.mark[t])}function wT(t,e,n){return jT(t,xT(e),n)}function jT(t,e,n){let r;e=Object(Z.i)(e);for(const i of e){const e=n[i];e&&void 0!==e[t]&&(r=e[t])}return r}function kT(t,e){return Object(Z.i)(t).reduce((t,n)=>{var r;return t.field.push(Yz(n,e)),t.order.push(null!==(r=n.sort)&&void 0!==r?r:"ascending"),t},{field:[],order:[]})}function ET(t,e){const n=[...t];return e.forEach(t=>{for(const e of n)if(SD(e,t))return;n.push(t)}),n}function AT(t,e){return SD(t,e)||!e?t:t?[...Object(Z.i)(t),...Object(Z.i)(e)].join(", "):e}function DT(t,e){const n=t.value,r=e.value;if(null==n||null===r)return{explicit:t.explicit,value:null};if((hT(n)||wC(n))&&(hT(r)||wC(r)))return{explicit:t.explicit,value:AT(n,r)};if(hT(n)||wC(n))return{explicit:t.explicit,value:n};if(hT(r)||wC(r))return{explicit:t.explicit,value:r};if(!(hT(n)||wC(n)||hT(r)||wC(r)))return{explicit:t.explicit,value:ET(n,r)};throw new Error("It should never reach here")}function MT(t){return"mark"in t}class ST{constructor(t,e){this.name=t,this.run=e}hasMatchingType(t){return!!MT(t)&&(WF(e=t.mark)?e.type:e)===this.name;var e}}function CT(t,e){const n=t&&t[e];return!!n&&(Object(Z.B)(n)?PD(n,t=>!!t.field):Fz(n)||Sz(n))}function FT(t){return PD(QM,e=>{if(CT(t,e)){const n=t[e];if(Object(Z.B)(n))return PD(n,t=>!!t.aggregate);{const t=eT(n);return t&&!!t.aggregate}}return!1})}function zT(t,e){const n=[],r=[],i=[],o=[],a={};return NT(t,(s,u)=>{if(Fz(s)){const{field:l,aggregate:c,bin:f,timeUnit:d}=s,h=bD(s,["field","aggregate","bin","timeUnit"]);if(c||d||f){const t=Zz(s),p=t&&t.title;let g=Yz(s,{forAs:!0});const m=Object.assign(Object.assign(Object.assign({},p?[]:{title:Kz(s,e,{allowDisabling:!0})}),h),{field:g});if(c){let t;if(MM(c)?(t="argmax",g=Yz({op:"argmax",field:c.argmax},{forAs:!0}),m.field=`${g}.${l}`):DM(c)?(t="argmin",g=Yz({op:"argmin",field:c.argmin},{forAs:!0}),m.field=`${g}.${l}`):"boxplot"!==c&&"errorbar"!==c&&"errorband"!==c&&(t=c),t){const e={op:t,as:g};l&&(e.field=l),o.push(e)}}else if(n.push(g),Pz(s)&&AS(f)){if(r.push({bin:f,field:l,as:g}),n.push(Yz(s,{binSuffix:"end"})),fT(s,u)&&n.push(Yz(s,{binSuffix:"range"})),hS(u)){const t={field:g+"_end"};a[u+"2"]=t}m.bin="binned",iS(u)||(m.type=IC)}else if(d){i.push({timeUnit:d,field:l,as:g});const t=Pz(s)&&s.type!==qC&&"time";t&&("text"===u||"tooltip"===u?m.formatType=t:!function(t){return!!lS[t]}(u)?hS(u)&&(m.axis=Object.assign({formatType:t},m.axis)):m.legend=Object.assign({formatType:t},m.legend))}a[u]=m}else n.push(l),a[u]=t[u]}else a[u]=t[u]}),{bins:r,timeUnits:i,aggregate:o,groupby:n,encoding:a}}function TT(t,e,n,r){return XD(t).reduce((i,o)=>{if(!nS(o))return aC(function(t){return`${t}-encoding is dropped as ${t} is not a valid encoding channel.`}(o)),i;const a=t[o];if("angle"!==o||"arc"!==e||t.theta||(aC("Arc marks uses theta channel rather than angle, replacing angle with theta."),o=PM),!function(t,e,n){const r=OS(e,n);if(!r)return!1;if("binned"===r){const n=t["x2"===e?"x":"y"];return!!(Fz(n)&&Fz(t[e])&&DS(n.bin))}return!0}(t,o,e))return aC(HS(o,e)),i;if("size"===o&&"line"===e){const e=eT(t[o]);if(null==e?void 0:e.aggregate)return aC("Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead."),i}if(o===LM&&(n?"fill"in t:"stroke"in t))return aC(WS("encoding",{fill:"fill"in t,stroke:"stroke"in t})),i;if("detail"===o||"order"===o&&!Object(Z.B)(a)&&!Bz(a)||"tooltip"===o&&Object(Z.B)(a))a&&(i[o]=Object(Z.i)(a).reduce((t,e)=>(Fz(e)?t.push(oT(e,o)):aC(YS(e,o)),t),[]));else{if("tooltip"===o&&null===a)i[o]=null;else if(!(Fz(a)||Tz(a)||Bz(a)||Mz(a)||wC(a)))return aC(YS(a,o)),i;i[o]=rT(a,o,r)}return i},{})}function $T(t,e){const n={};for(const r of XD(t)){const i=rT(t[r],r,e,{compositeMark:!0});n[r]=i}return n}function NT(t,e,n){if(t)for(const r of XD(t)){const i=t[r];if(Object(Z.B)(i))for(const t of i)e.call(n,t,r);else e.call(n,i,r)}}function RT(t,e){return XD(e).reduce((n,r)=>{switch(r){case"x":case"y":case"href":case"description":case"url":case"x2":case"y2":case PM:case BM:case RM:case"radius2":case"latitude":case"longitude":case"latitude2":case"longitude2":case"text":case qM:case"angle":case"tooltip":return n;case"order":if("line"===t||"trail"===t)return n;case"detail":case"key":{const t=e[r];if(Object(Z.B)(t)||Fz(t))for(const e of Object(Z.i)(t))e.aggregate||n.push(Yz(e,{}));return n}case"size":if("trail"===t)return n;case LM:case IM:case UM:case"opacity":case"fillOpacity":case"strokeOpacity":case"strokeDash":case"strokeWidth":{const t=eT(e[r]);return t&&!t.aggregate&&n.push(Yz(t,{})),n}}},[])}function PT(t,e,n,r=!0){if("tooltip"in n)return{tooltip:n.tooltip};return{tooltip:[...t.map(({fieldPrefix:t,titlePrefix:n})=>{const i=r?" of "+BT(e):"";return{field:t+e.field,type:e.type,title:wC(n)?{signal:n+`"${escape(i)}"`}:n+i}}),...UD(function(t){const e=[];for(const n of XD(t))if(CT(t,n)){const r=t[n],i=Object(Z.i)(r);for(const t of i)Fz(t)?e.push(t):Sz(t)&&e.push(t.condition)}return e}(n).map(Wz),$D)]}}function BT(t){const{title:e,field:n}=t;return cM(e,n)}function LT(t,e,n,r,i){const{scale:o,axis:a}=n;return({partName:s,mark:u,positionPrefix:l,endPositionPrefix:c,extraEncoding:f={}})=>{const d=BT(n);return IT(t,s,i,{mark:u,encoding:Object.assign(Object.assign(Object.assign({[e]:Object.assign(Object.assign(Object.assign({field:l+"_"+n.field,type:n.type},void 0!==d?{title:d}:{}),void 0!==o?{scale:o}:{}),void 0!==a?{axis:a}:{})},Object(Z.I)(c)?{[e+"2"]:{field:c+"_"+n.field}}:{}),r),f)})}}function IT(t,e,n,r){const{clip:i,color:o,opacity:a}=t,s=t.type;return t[e]||void 0===t[e]&&n[e]?[Object.assign(Object.assign({},r),{mark:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n[e]),i?{clip:i}:{}),o?{color:o}:{}),a?{opacity:a}:{}),WF(r.mark)?r.mark:{type:r.mark}),{style:`${s}-${e}`}),Object(Z.C)(t[e])?{}:t[e])})]:[]}function UT(t,e,n){const{encoding:r}=t,i="vertical"===e?"y":"x",o=r[i],a=r[i+"2"],s=r[i+"Error"],u=r[i+"Error2"];return{continuousAxisChannelDef:qT(o,n),continuousAxisChannelDef2:qT(a,n),continuousAxisChannelDefError:qT(s,n),continuousAxisChannelDefError2:qT(u,n),continuousAxis:i}}function qT(t,e){if(t&&t.aggregate){const{aggregate:n}=t,r=bD(t,["aggregate"]);return n!==e&&aC(function(t,e){return`Continuous axis should not have customized aggregation function ${t}; ${e} already agregates the axis.`}(n,e)),r}return t}function WT(t,e){const{mark:n,encoding:r}=t,{x:i,y:o}=r;if(WF(n)&&n.orient)return n.orient;if($z(i)){if($z(o)){const t=Fz(i)&&i.aggregate,n=Fz(o)&&o.aggregate;if(t||n!==e){if(n||t!==e){if(t===e&&n===e)throw new Error("Both x and y cannot have aggregate");return uT(o)&&!uT(i)?"horizontal":"vertical"}return"horizontal"}return"vertical"}return"horizontal"}if($z(o))return"vertical";throw new Error(`Need a valid continuous axis for ${e}s`)}const YT=new ST("boxplot",GT);function HT(t){return Object(Z.F)(t)?"tukey":t}function GT(t,{config:e}){var n,r;t=Object.assign(Object.assign({},t),{encoding:$T(t.encoding,e)});const{mark:i,encoding:o,selection:a,projection:s}=t,u=bD(t,["mark","encoding","selection","projection"]),l=WF(i)?i:{type:i};a&&aC(BS("boxplot"));const c=null!==(n=l.extent)&&void 0!==n?n:e.boxplot.extent,f=_T("size",l,e),d=HT(c),{bins:h,timeUnits:p,transform:g,continuousAxisChannelDef:m,continuousAxis:b,groupby:y,aggregate:v,encodingWithoutContinuousAxis:x,ticksOrient:_,boxOrient:O,customTooltipWithoutAggregatedField:w}=function(t,e,n){const r=WT(t,"boxplot"),{continuousAxisChannelDef:i,continuousAxis:o}=UT(t,r,"boxplot"),a=i.field,s=HT(e),u=[...VT(a),{op:"median",field:a,as:"mid_box_"+a},{op:"min",field:a,as:("min-max"===s?"lower_whisker_":"min_")+a},{op:"max",field:a,as:("min-max"===s?"upper_whisker_":"max_")+a}],l="min-max"===s||"tukey"===s?[]:[{calculate:`datum["upper_box_${a}"] - datum["lower_box_${a}"]`,as:"iqr_"+a},{calculate:`min(datum["upper_box_${a}"] + datum["iqr_${a}"] * ${e}, datum["max_${a}"])`,as:"upper_whisker_"+a},{calculate:`max(datum["lower_box_${a}"] - datum["iqr_${a}"] * ${e}, datum["min_${a}"])`,as:"lower_whisker_"+a}],c=t.encoding,f=o,d=(c[f],bD(c,["symbol"==typeof f?f:f+""])),{customTooltipWithoutAggregatedField:h,filteredEncoding:p}=function(t){const{tooltip:e}=t,n=bD(t,["tooltip"]);if(!e)return{filteredEncoding:n};let r,i;if(Object(Z.B)(e)){for(const t of e)t.aggregate?(r||(r=[]),r.push(t)):(i||(i=[]),i.push(t));r&&(n.tooltip=r)}else e.aggregate?n.tooltip=e:i=e;return Object(Z.B)(i)&&1===i.length&&(i=i[0]),{customTooltipWithoutAggregatedField:i,filteredEncoding:n}}(d),{bins:g,timeUnits:m,aggregate:b,groupby:y,encoding:v}=zT(p,n),x="vertical"===r?"horizontal":"vertical",_=r,O=[...g,...m,{aggregate:[...b,...u],groupby:y},...l];return{bins:g,timeUnits:m,transform:O,groupby:y,aggregate:b,continuousAxisChannelDef:i,continuousAxis:o,encodingWithoutContinuousAxis:v,ticksOrient:x,boxOrient:_,customTooltipWithoutAggregatedField:h}}(t,c,e),{color:j,size:k}=x,E=bD(x,["color","size"]),A=t=>LT(l,b,m,t,e.boxplot),D=A(E),M=A(x),S=A(Object.assign(Object.assign({},E),k?{size:k}:{})),C=PT([{fieldPrefix:"min-max"===d?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:"min-max"===d?"lower_whisker_":"min_",titlePrefix:"Min"}],m,x),F={type:"tick",color:"black",opacity:1,orient:_,invalid:null,aria:!1},z="min-max"===d?C:PT([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],m,x),T=[...D({partName:"rule",mark:{type:"rule",invalid:null,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:z}),...D({partName:"rule",mark:{type:"rule",invalid:null,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:z}),...D({partName:"ticks",mark:F,positionPrefix:"lower_whisker",extraEncoding:z}),...D({partName:"ticks",mark:F,positionPrefix:"upper_whisker",extraEncoding:z})],$=[..."tukey"!==d?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}),...S({partName:"median",mark:Object.assign(Object.assign(Object.assign({type:"tick",invalid:null},Object(Z.G)(e.boxplot.median)&&e.boxplot.median.color?{color:e.boxplot.median.color}:{}),f?{size:f}:{}),{orient:_,aria:!1}),positionPrefix:"mid_box",extraEncoding:C})];if("min-max"===d)return Object.assign(Object.assign({},u),{transform:(null!==(r=u.transform)&&void 0!==r?r:[]).concat(g),layer:$});const N=`datum["lower_box_${m.field}"]`,R=`datum["upper_box_${m.field}"]`,P=`(${R} - ${N})`,B=`${N} - ${c} * ${P}`,L=`${R} + ${c} * ${P}`,I=`datum["${m.field}"]`,U={joinaggregate:VT(m.field),groupby:y},q={transform:[{filter:`(${B} <= ${I}) && (${I} <= ${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},...v],groupby:y}],layer:T},W=bD(E,["tooltip"]),{scale:Y,axis:H}=m,G=BT(m),V=zD(H,["title"]),X=IT(l,"outliers",e.boxplot,{transform:[{filter:`(${I} < ${B}) || (${I} > ${L})`}],mark:"point",encoding:Object.assign(Object.assign(Object.assign({[b]:Object.assign(Object.assign(Object.assign({field:m.field,type:m.type},void 0!==G?{title:G}:{}),void 0!==Y?{scale:Y}:{}),VD(V)?{}:{axis:V})},W),j?{color:j}:{}),w?{tooltip:w}:{})})[0];let J;const K=[...h,...p,U];return X?J={transform:K,layer:[X,q]}:(J=q,J.transform.unshift(...K)),Object.assign(Object.assign({},u),{layer:[J,{transform:g,layer:$}]})}function VT(t){return[{op:"q1",field:t,as:"lower_box_"+t},{op:"q3",field:t,as:"upper_box_"+t}]}const XT=new ST("errorbar",JT);function JT(t,{config:e}){t=Object.assign(Object.assign({},t),{encoding:$T(t.encoding,e)});const{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:o,ticksOrient:a,markDef:s,outerSpec:u,tooltipEncoding:l}=ZT(t,"errorbar",e);delete o.size;const c=LT(s,i,r,o,e.errorbar),f=s.thickness,d=s.size,h=Object.assign(Object.assign({type:"tick",orient:a,aria:!1},void 0!==f?{thickness:f}:{}),void 0!==d?{size:d}:{}),p=[...c({partName:"ticks",mark:h,positionPrefix:"lower",extraEncoding:l}),...c({partName:"ticks",mark:h,positionPrefix:"upper",extraEncoding:l}),...c({partName:"rule",mark:Object.assign({type:"rule",ariaRoleDescription:"errorbar"},void 0!==f?{size:f}:{}),positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:l})];return Object.assign(Object.assign(Object.assign({},u),{transform:n}),p.length>1?{layer:p}:Object.assign({},p[0]))}function KT(t,e){const{encoding:n}=t;if(function(t){return(Rz(t.x)||Rz(t.y))&&!Rz(t.x2)&&!Rz(t.y2)&&!Rz(t.xError)&&!Rz(t.xError2)&&!Rz(t.yError)&&!Rz(t.yError2)}(n))return{orient:WT(t,e),inputType:"raw"};const r=function(t){return Rz(t.x2)||Rz(t.y2)}(n),i=function(t){return Rz(t.xError)||Rz(t.xError2)||Rz(t.yError)||Rz(t.yError2)}(n),o=n.x,a=n.y;if(r){if(i)throw new Error(e+" cannot be both type aggregated-upper-lower and aggregated-error");const t=n.x2,r=n.y2;if(Rz(t)&&Rz(r))throw new Error(e+" cannot have both x2 and y2");if(Rz(t)){if($z(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error("Both x and x2 have to be quantitative in "+e)}if(Rz(r)){if($z(a))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error("Both y and y2 have to be quantitative in "+e)}throw new Error("No ranged axis")}{const t=n.xError,r=n.xError2,i=n.yError,s=n.yError2;if(Rz(r)&&!Rz(t))throw new Error(e+" cannot have xError2 without xError");if(Rz(s)&&!Rz(i))throw new Error(e+" cannot have yError2 without yError");if(Rz(t)&&Rz(i))throw new Error(e+" cannot have both xError and yError with both are quantiative");if(Rz(t)){if($z(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}if(Rz(i)){if($z(a))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}function ZT(t,e,n){var r;const{mark:i,encoding:o,selection:a,projection:s}=t,u=bD(t,["mark","encoding","selection","projection"]),l=WF(i)?i:{type:i};a&&aC(BS(e));const{orient:c,inputType:f}=KT(t,e),{continuousAxisChannelDef:d,continuousAxisChannelDef2:h,continuousAxisChannelDefError:p,continuousAxisChannelDefError2:g,continuousAxis:m}=UT(t,c,e),{errorBarSpecificAggregate:b,postAggregateCalculates:y,tooltipSummary:v,tooltipTitleWithFieldName:x}=function(t,e,n,r,i,o,a,s){let u=[],l=[];const c=e.field;let f,d=!1;if("raw"===o){const e=t.center?t.center:t.extent?"iqr"===t.extent?"median":"mean":s.errorbar.center,n=t.extent?t.extent:"mean"===e?"stderr":"iqr";if("median"===e!=("iqr"===n)&&aC(function(t,e,n){return`${t} is not usually used with ${e} for ${n}.`}(e,n,a)),"stderr"===n||"stdev"===n)u=[{op:n,field:c,as:"extent_"+c},{op:e,field:c,as:"center_"+c}],l=[{calculate:`datum["center_${c}"] + datum["extent_${c}"]`,as:"upper_"+c},{calculate:`datum["center_${c}"] - datum["extent_${c}"]`,as:"lower_"+c}],f=[{fieldPrefix:"center_",titlePrefix:nM(e)},{fieldPrefix:"upper_",titlePrefix:QT(e,n,"+")},{fieldPrefix:"lower_",titlePrefix:QT(e,n,"-")}],d=!0;else{let t,e,r;"ci"===n?(t="mean",e="ci0",r="ci1"):(t="median",e="q1",r="q3"),u=[{op:e,field:c,as:"lower_"+c},{op:r,field:c,as:"upper_"+c},{op:t,field:c,as:"center_"+c}],f=[{fieldPrefix:"upper_",titlePrefix:Kz({field:c,aggregate:r,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:Kz({field:c,aggregate:e,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:Kz({field:c,aggregate:t,type:"quantitative"},s,{allowDisabling:!1})}]}}else{(t.center||t.extent)&&aC((h=t.center,`${(p=t.extent)?"extent ":""}${p&&h?"and ":""}${h?"center ":""}${p&&h?"are ":"is "}not needed when data are aggregated.`)),"aggregated-upper-lower"===o?(f=[],l=[{calculate:`datum["${n.field}"]`,as:"upper_"+c},{calculate:`datum["${c}"]`,as:"lower_"+c}]):"aggregated-error"===o&&(f=[{fieldPrefix:"",titlePrefix:c}],l=[{calculate:`datum["${c}"] + datum["${r.field}"]`,as:"upper_"+c}],i?l.push({calculate:`datum["${c}"] + datum["${i.field}"]`,as:"lower_"+c}):l.push({calculate:`datum["${c}"] - datum["${r.field}"]`,as:"lower_"+c}));for(const t of l)f.push({fieldPrefix:t.as.substring(0,6),titlePrefix:sM(sM(t.calculate,'datum["',""),'"]',"")})}var h,p;return{postAggregateCalculates:l,errorBarSpecificAggregate:u,tooltipSummary:f,tooltipTitleWithFieldName:d}}(l,d,h,p,g,f,e,n),_=o,O=m,w=(_[O],"x"===m?"x2":"y2"),j=(_[w],"x"===m?"xError":"yError"),k=(_[j],"x"===m?"xError2":"yError2"),E=(_[k],bD(_,["symbol"==typeof O?O:O+"","symbol"==typeof w?w:w+"","symbol"==typeof j?j:j+"","symbol"==typeof k?k:k+""])),{bins:A,timeUnits:D,aggregate:M,groupby:S,encoding:C}=zT(E,n),F=[...M,...b],z="raw"!==f?[]:S,T=PT(v,d,C,x);return{transform:[...null!==(r=u.transform)&&void 0!==r?r:[],...A,...D,...0===F.length?[]:[{aggregate:F,groupby:z}],...y],groupby:z,continuousAxisChannelDef:d,continuousAxis:m,encodingWithoutContinuousAxis:C,ticksOrient:"vertical"===c?"horizontal":"vertical",markDef:l,outerSpec:u,tooltipEncoding:T}}function QT(t,e,n){return nM(t)+" "+n+" "+e}const t$=new ST("errorband",e$);function e$(t,{config:e}){t=Object.assign(Object.assign({},t),{encoding:$T(t.encoding,e)});const{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:o,markDef:a,outerSpec:s,tooltipEncoding:u}=ZT(t,"errorband",e),l=a,c=LT(l,i,r,o,e.errorband),f=void 0!==t.encoding.x&&void 0!==t.encoding.y;let d={type:f?"area":"rect"},h={type:f?"line":"rule"};const p=Object.assign(Object.assign({},l.interpolate?{interpolate:l.interpolate}:{}),l.tension&&l.interpolate?{tension:l.tension}:{});return f?(d=Object.assign(Object.assign(Object.assign({},d),p),{ariaRoleDescription:"errorband"}),h=Object.assign(Object.assign(Object.assign({},h),p),{aria:!1})):l.interpolate?aC(nC("interpolate")):l.tension&&aC(nC("tension")),Object.assign(Object.assign({},s),{transform:n,layer:[...c({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u}),...c({partName:"borders",mark:h,positionPrefix:"lower",extraEncoding:u}),...c({partName:"borders",mark:h,positionPrefix:"upper",extraEncoding:u})]})}const n$={};function r$(t,e,n){const r=new ST(t,e);n$[t]={normalizer:r,parts:n}}r$("boxplot",GT,["box","median","outliers","rule","ticks"]),r$("errorbar",JT,["ticks","rule"]),r$("errorband",e$,["band","borders"]);const i$=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],o$={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"},a$={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"},s$=XD(o$),u$=XD(a$),l$=XD({header:1,headerRow:1,headerColumn:1,headerFacet:1}),c$=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"];function f$(t){const e=[];for(const n of t||[]){const{expr:t,bind:r}=n,i=bD(n,["expr","bind"]);if(r&&t){const n=Object.assign(Object.assign({},i),{bind:r,init:t});e.push(n)}else{const n=Object.assign(Object.assign(Object.assign({},i),t?{update:t}:{}),r?{bind:r}:{});e.push(n)}}return e}const d$={single:{on:"click",fields:["_vgsid_"],resolve:"global",empty:"all",clear:"dblclick"},multi:{on:"click",fields:["_vgsid_"],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 h$(t){return!(!t||"legend"!==t&&!t.legend)}function p$(t){return h$(t)&&Object(Z.G)(t)}function g$(t){return"concat"in t}function m$(t){return"vconcat"in t}function b$(t){return"hconcat"in t}function y$(t){return Object(Z.G)(t)&&void 0!==t.step}function v$(t){return t.view||t.width||t.height}const x$=XD({align:1,bounds:1,center:1,columns:1,spacing:1});function _$(t,e){var n;return null!==(n=t[e])&&void 0!==n?n:t["width"===e?"continuousWidth":"continuousHeight"]}function O$(t,e){const n=w$(t,e);return y$(n)?n.step:j$}function w$(t,e){var n;return cM(null!==(n=t[e])&&void 0!==n?n:t["width"===e?"discreteWidth":"discreteHeight"],{step:t.step})}const j$=20,k$={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:{continuousWidth:200,continuousHeight:200,step:j$},mark:{color:"#4c78a8",invalid:"filter",timeUnitBand:1},arc:{},area:{},bar:XF,circle:{},geoshape:{},image:{},line:{},point:{},rect:JF,rule:{color:"black"},square:{},text:{color:"black"},tick:{thickness:1},trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:!0,ticks:!1},errorband:{band:{opacity:.3},borders:!1},scale:{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},projection:{},legend:{gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:d$,style:{},title:{},facet:{spacing:20},concat:{spacing:20}},E$=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],A$={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},D$={blue:E$[0],orange:E$[1],red:E$[2],teal:E$[3],green:E$[4],yellow:E$[5],purple:E$[6],pink:E$[7],brown:E$[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 M$(t){const e=XD(t||{}),n={};for(const r of e){const e=t[r];n[r]=vM(e)?pT(e):gT(e)}return n}const S$=[...GF,...kM,...l$,"background","padding","legend","lineBreak","scale","style","title","view"];function C$(t={}){const{color:e,font:n,fontSize:r}=t,i=bD(t,["color","font","fontSize"]),o=Object(Z.O)({},k$,n?function(t){return{text:{font:t},style:{"guide-label":{font:t},"guide-title":{font:t},"group-title":{font:t},"group-subtitle":{font:t}}}}(n):{},e?function(t={}){return{signals:[{name:"color",value:Object(Z.G)(t)?Object.assign(Object.assign({},D$),t):D$}],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"}]}}}(e):{},r?function(t){return{signals:[{name:"fontSize",value:Object(Z.G)(t)?Object.assign(Object.assign({},A$),t):A$}],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"}}}}}(r):{},i||{}),a=zD(o,S$);for(const t of["background","lineBreak","padding"])o[t]&&(a[t]=gT(o[t]));for(const t of GF)o[t]&&(a[t]=kF(o[t]));for(const t of kM)o[t]&&(a[t]=M$(o[t]));for(const t of l$)o[t]&&(a[t]=kF(o[t]));return o.legend&&(a.legend=kF(o.legend)),o.scale&&(a.scale=kF(o.scale)),o.style&&(a.style=function(t){const e=XD(t),n={};for(const r of e)n[r]=M$(t[r]);return n}(o.style)),o.title&&(a.title=kF(o.title)),o.view&&(a.view=kF(o.view)),a}const F$=["view",...qF],z$=["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"],T$=Object.assign({view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"]},{area:["line","point"],bar:["binSpacing","continuousBandSize","discreteBandSize"],rect:["binSpacing","continuousBandSize","discreteBandSize"],line:["point"],tick:["bandSize","thickness"]});function $$(t){t=CD(t);for(const e of z$)delete t[e];if(t.axis)for(const e in t.axis)vM(t.axis[e])&&delete t.axis[e];if(t.legend)for(const e of i$)delete t.legend[e];if(t.mark){for(const e of HF)delete t.mark[e];t.mark.tooltip&&Object(Z.G)(t.mark.tooltip)&&delete t.mark.tooltip}t.params&&(t.signals=(t.signals||[]).concat(f$(t.params)),delete t.params);for(const e of F$){for(const n of HF)delete t[e][n];const n=T$[e];if(n)for(const r of n)delete t[e][r];N$(t,e)}for(const e of XD(n$))delete t[e];!function(t){const{titleMarkConfig:e,subtitleMarkConfig:n,subtitle:r}=dT(t.title);VD(e)||(t.style["group-title"]=Object.assign(Object.assign({},t.style["group-title"]),e));VD(n)||(t.style["group-subtitle"]=Object.assign(Object.assign({},t.style["group-subtitle"]),n));VD(r)?delete t.title:t.title=r}(t);for(const e in t)Object(Z.G)(t[e])&&VD(t[e])&&delete t[e];return VD(t)?void 0:t}function N$(t,e,n,r){const i=r?t[e][r]:t[e];"view"===e&&(n="cell");const o=Object.assign(Object.assign({},i),t.style[null!=n?n:e]);VD(o)||(t.style[null!=n?n:e]=o),r||delete t[e]}function R$(t){return"layer"in t}const P$={zero:1,center:1,normalize:1};const B$=new Set([AF,MF,DF,TF,FF,PF,BF,CF,$F,NF]),L$=new Set([MF,DF,AF]);function I$(t,e){var n,r;const i="x"===e?"y":"radius",o=t[e],a=t[i];if(Fz(o)&&Fz(a))if("quantitative"===zz(o)&&"quantitative"===zz(a)){if(o.stack)return e;if(a.stack)return i;const t=Fz(o)&&!!o.aggregate;if(t!==(Fz(a)&&!!a.aggregate))return t?e:i;{const t=null===(n=o.scale)||void 0===n?void 0:n.type,s=null===(r=a.scale)||void 0===r?void 0:r.type;if(t&&"linear"!==t)return i;if(s&&"linear"!==s)return e}}else{if("quantitative"===zz(o))return e;if("quantitative"===zz(a))return i}else{if("quantitative"===zz(o))return e;if("quantitative"===zz(a))return i}}function U$(t,e,n={}){const r=WF(t)?t.type:t;if(!B$.has(r))return null;const i=I$(e,"x")||I$(e,"theta");if(!i)return null;const o=e[i],a=Fz(o)?Yz(o,{}):void 0;let s=function(t){switch(t){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}(i),u=e[s],l=Fz(u)?Yz(u,{}):void 0;l===a&&(l=void 0,u=void 0,s=void 0);const c=cS.reduce((t,n)=>{if("tooltip"!==n&&CT(e,n)){const r=e[n];for(const e of Object(Z.i)(r)){const r=eT(e);if(r.aggregate)continue;const i=Yz(r,{});i&&i===l||t.push({channel:n,fieldDef:r})}}return t},[]);let f;if(void 0!==o.stack?f=Object(Z.C)(o.stack)?o.stack?"zero":null:o.stack:c.length>0&&L$.has(r)&&(f="zero"),!f||!(f in P$))return null;var d;if(FT(e)&&0===c.length)return null;if(o.scale&&o.scale.type&&o.scale.type!==HC){if(n.disallowNonLinearStack)return null;aC(`Cannot stack non-linear scale (${o.scale.type}).`)}return Rz(e[sS(i)])?(void 0!==o.stack&&aC(`Cannot stack "${d=i}" if there is already "${d}2".`),null):(Fz(o)&&o.aggregate&&!RD(zM,o.aggregate)&&aC(`Stacking is applied even though the aggregate function is non-summative ("${o.aggregate}").`),{groupbyChannel:u?s:void 0,groupbyField:l,fieldChannel:i,impute:null!==o.impute&&IF(r),stackBy:c,offset:f})}function q$(t){const e=bD(t,["point","line"]);return XD(e).length>1?e:e.type}function W$(t){for(const e of["line","area","rule","trail"])t[e]&&(t=Object.assign(Object.assign({},t),{[e]:zD(t[e],["point","line"])}));return t}function Y$(t,e={},n){return"transparent"===t.point?{opacity:0}:t.point?Object(Z.G)(t.point)?t.point:{}:void 0!==t.point?null:e.point||n.shape?Object(Z.G)(e.point)?e.point:{}:void 0}function H$(t,e={}){return t.line?!0===t.line?{}:t.line:void 0!==t.line?null:e.line?!0===e.line?{}:e.line:void 0}class G${constructor(){this.name="path-overlay"}hasMatchingType(t,e){if(MT(t)){const{mark:n,encoding:r}=t,i=WF(n)?n:{type:n};switch(i.type){case"line":case"rule":case"trail":return!!Y$(i,e[i.type],r);case"area":return!!Y$(i,e[i.type],r)||!!H$(i,e[i.type])}}return!1}run(t,e,n){const{config:r}=e,{selection:i,projection:o,mark:a,encoding:s}=t,u=bD(t,["selection","projection","mark","encoding"]),l=$T(s,r),c=WF(a)?a:{type:a},f=Y$(c,r[c.type],l),d="area"===c.type&&H$(c,r[c.type]),h=[Object.assign(Object.assign({},i?{selection:i}:{}),{mark:q$(Object.assign(Object.assign({},"area"===c.type&&void 0===c.opacity&&void 0===c.fillOpacity?{opacity:.7}:{}),c)),encoding:zD(l,["shape"])})],p=U$(c,l);let g=l;if(p){const{fieldChannel:t,offset:e}=p;g=Object.assign(Object.assign({},l),{[t]:Object.assign(Object.assign({},l[t]),e?{stack:e}:{})})}return d&&h.push(Object.assign(Object.assign({},o?{projection:o}:{}),{mark:Object.assign(Object.assign({type:"line"},FD(c,["clip","interpolate","tension","tooltip"])),d),encoding:g})),f&&h.push(Object.assign(Object.assign({},o?{projection:o}:{}),{mark:Object.assign(Object.assign({type:"point",opacity:1,filled:!0},FD(c,["clip","tooltip"])),f),encoding:g})),n(Object.assign(Object.assign({},u),{layer:h}),Object.assign(Object.assign({},e),{config:W$(r)}))}}class V${constructor(){this.name="RangeStep"}hasMatchingType(t){var e;if(MT(t)&&t.encoding)for(const n of dS){const r=t.encoding[n];if(r&&Rz(r)&&(null===(e=null==r?void 0:r.scale)||void 0===e?void 0:e.rangeStep))return!0}return!1}run(t){var e;const n={};let r=Object.assign({},t.encoding);for(const t of dS){const i=uS(t),o=r[t];if(o&&Rz(o)&&(null===(e=null==o?void 0:o.scale)||void 0===e?void 0:e.rangeStep)){const{scale:e}=o,a=bD(o,["scale"]),s=bD(e,["rangeStep"]);n[i]={step:e.rangeStep},aC('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.'),r=Object.assign(Object.assign({},r),{[t]:Object.assign(Object.assign({},a),VD(s)?{}:{scale:s})})}}return Object.assign(Object.assign(Object.assign({},n),t),{encoding:r})}}function X$(t,e){return e?Oz(t)?eN(t,e):Z$(t,e):t}function J$(t,e){return e?eN(t,e):t}function K$(t,e,n){const r=e[t];return(i=r)&&!Object(Z.I)(i)&&"repeat"in i?r.repeat in n?Object.assign(Object.assign({},e),{[t]:n[r.repeat]}):void aC(function(t){return`Unknown repeated value "${t}".`}(r.repeat)):e;var i}function Z$(t,e){if(void 0!==(t=K$("field",t,e))){if(null===t)return null;if(Ez(t)&&xz(t.sort)){const n=K$("field",t.sort,e);t=Object.assign(Object.assign({},t),n?{sort:n}:{})}return t}}function Q$(t,e){if(Fz(t))return Z$(t,e);{const n=K$("datum",t,e);return n===t||n.type||(n.type="nominal"),n}}function tN(t,e){if(!Rz(t)){if(Cz(t)){const n=Q$(t.condition,e);if(n)return Object.assign(Object.assign({},t),{condition:n});return bD(t,["condition"])}return t}{const n=Q$(t,e);if(n)return n;if(Mz(t))return{condition:t.condition}}}function eN(t,e){const n={};for(const r in t)if(Object(Z.w)(t,r)){const i=t[r];if(Object(Z.B)(i))n[r]=i.map(t=>tN(t,e)).filter(t=>t);else{const t=tN(i,e);void 0!==t&&(n[r]=t)}}return n}class nN{constructor(){this.name="RuleForRangedLine"}hasMatchingType(t){if(MT(t)){const{encoding:e,mark:n}=t;if("line"===n)for(const t of rS){const n=e[oS(t)];if(e[t]&&(Fz(n)&&!DS(n.bin)||Tz(n)))return!0}}return!1}run(t,e,n){const{encoding:r}=t;var i,o;return aC((i=!!r.x2,o=!!r.y2,`Line mark is for continuous lines and thus cannot be used with ${i&&o?"x2 and y2":i?"x2":"y2"}. We will use the rule mark (line segments) instead.`)),n(Object.assign(Object.assign({},t),{mark:"rule"}),e)}}function rN({parentEncoding:t,encoding:e={},layer:n}){let r={};if(t){const i=new Set([...XD(t),...XD(e)]);for(const o of i){const i=e[o],a=t[o];if(Rz(i)){const t=Object.assign(Object.assign({},a),i);r[o]=t}else Cz(i)?r[o]=Object.assign(Object.assign({},i),{condition:Object.assign(Object.assign({},a),i.condition)}):i||null===i?r[o]=i:(n||Bz(a)||wC(a)||Rz(a)||Object(Z.B)(a))&&(r[o]=a)}}else r=e;return!r||VD(r)?void 0:r}function iN(t){const{parentProjection:e,projection:n}=t;return e&&n&&aC(function(t){const{parentProjection:e,projection:n}=t;return`Layer's shared projection ${TD(e)} is overridden by a child projection ${TD(n)}.`}({parentProjection:e,projection:n})),null!=n?n:e}function oN(t,e){void 0===e&&(e=C$(t.config));const n=function(t,e={}){return aN.map(t,{config:e})}(t,e),{width:r,height:i}=t,o=function(t,e,n){let{width:r,height:i}=e;const o=MT(t)||R$(t),a={};o?"container"==r&&"container"==i?(a.type="fit",a.contains="padding"):"container"==r?(a.type="fit-x",a.contains="padding"):"container"==i&&(a.type="fit-y",a.contains="padding"):("container"==r&&(aC(zS("width")),r=void 0),"container"==i&&(aC(zS("height")),i=void 0));const s=Object.assign(Object.assign(Object.assign({type:"pad"},a),n?sN(n.autosize):{}),sN(t.autosize));"fit"!==s.type||o||(aC('Autosize "fit" only works for single views and layered views.'),s.type="pad");"container"==r&&"fit"!=s.type&&"fit-x"!=s.type&&aC(TS("width"));"container"==i&&"fit"!=s.type&&"fit-y"!=s.type&&aC(TS("height"));if(SD(s,{type:"pad"}))return;return s}(n,{width:r,height:i,autosize:t.autosize},e);return Object.assign(Object.assign({},n),o?{autosize:o}:{})}const aN=new class extends class{map(t,e){return jz(t)?this.mapFacet(t,e):function(t){return"repeat"in t}(t)?this.mapRepeat(t,e):b$(t)?this.mapHConcat(t,e):m$(t)?this.mapVConcat(t,e):g$(t)?this.mapConcat(t,e):this.mapLayerOrUnit(t,e)}mapLayerOrUnit(t,e){if(R$(t))return this.mapLayer(t,e);if(MT(t))return this.mapUnit(t,e);throw new Error(FS(t))}mapLayer(t,e){return Object.assign(Object.assign({},t),{layer:t.layer.map(t=>this.mapLayerOrUnit(t,e))})}mapHConcat(t,e){return Object.assign(Object.assign({},t),{hconcat:t.hconcat.map(t=>this.map(t,e))})}mapVConcat(t,e){return Object.assign(Object.assign({},t),{vconcat:t.vconcat.map(t=>this.map(t,e))})}mapConcat(t,e){const{concat:n}=t,r=bD(t,["concat"]);return Object.assign(Object.assign({},r),{concat:n.map(t=>this.map(t,e))})}mapFacet(t,e){return Object.assign(Object.assign({},t),{spec:this.map(t.spec,e)})}mapRepeat(t,e){return Object.assign(Object.assign({},t),{spec:this.map(t.spec,e)})}}{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[YT,XT,t$,new G$,new nN,new V$]}map(t,e){if(MT(t)){const n=CT(t.encoding,$M),r=CT(t.encoding,NM),i=CT(t.encoding,"facet");if(n||r||i)return this.mapFacetedUnit(t,e)}return super.map(t,e)}mapUnit(t,e){const{parentEncoding:n,parentProjection:r}=e,i=J$(t.encoding,e.repeater),o=Object.assign(Object.assign({},t),i?{encoding:i}:{});if(n||r)return this.mapUnitWithParentEncodingOrProjection(o,e);const a=this.mapLayerOrUnit.bind(this);for(const t of this.nonFacetUnitNormalizers)if(t.hasMatchingType(o,e.config))return t.run(o,e,a);return o}mapRepeat(t,e){return function(t){return!Object(Z.B)(t.repeat)&&t.repeat.layer}(t)?this.mapLayerRepeat(t,e):this.mapNonLayerRepeat(t,e)}mapLayerRepeat(t,e){const{repeat:n,spec:r}=t,i=bD(t,["repeat","spec"]),{row:o,column:a,layer:s}=n,{repeater:u={},repeaterPrefix:l=""}=e;return o||a?this.mapRepeat(Object.assign(Object.assign({},t),{repeat:Object.assign(Object.assign({},o?{row:o}:{}),a?{column:a}:{}),spec:{repeat:{layer:s},spec:r}}),e):Object.assign(Object.assign({},i),{layer:s.map(t=>{const n=Object.assign(Object.assign({},u),{layer:t}),i=(r.name||"")+l+"child__layer_"+QD(t),o=this.mapLayerOrUnit(r,Object.assign(Object.assign({},e),{repeater:n,repeaterPrefix:i}));return o.name=i,o})})}mapNonLayerRepeat(t,e){var n;const{repeat:r,spec:i,data:o}=t,a=bD(t,["repeat","spec","data"]);!Object(Z.B)(r)&&t.columns&&(t=zD(t,["columns"]),aC(LS("repeat")));const s=[],{repeater:u={},repeaterPrefix:l=""}=e,c=!Object(Z.B)(r)&&r.row||[u?u.row:null],f=!Object(Z.B)(r)&&r.column||[u?u.column:null],d=Object(Z.B)(r)&&r||[u?u.repeat:null];for(const t of d)for(const n of c)for(const o of f){const a={repeat:t,row:n,column:o,layer:u.layer},c=(i.name||"")+l+"child__"+(Object(Z.B)(r)?""+QD(t):(r.row?"row_"+QD(n):"")+(r.column?"column_"+QD(o):"")),f=this.map(i,Object.assign(Object.assign({},e),{repeater:a,repeaterPrefix:c}));f.name=c,s.push(zD(f,["data"]))}const h=Object(Z.B)(r)?t.columns:r.column?r.column.length:1;return Object.assign(Object.assign({data:null!==(n=i.data)&&void 0!==n?n:o,align:"all"},a),{columns:h,concat:s})}mapFacet(t,e){const{facet:n}=t;return Oz(n)&&t.columns&&(t=zD(t,["columns"]),aC(LS("facet"))),super.mapFacet(t,e)}mapUnitWithParentEncodingOrProjection(t,e){const{encoding:n,projection:r}=t,{parentEncoding:i,parentProjection:o,config:a}=e,s=iN({parentProjection:o,projection:r}),u=rN({parentEncoding:i,encoding:J$(n,e.repeater)});return this.mapUnit(Object.assign(Object.assign(Object.assign({},t),s?{projection:s}:{}),u?{encoding:u}:{}),{config:a})}mapFacetedUnit(t,e){const n=t.encoding,{row:r,column:i,facet:o}=n,a=bD(n,["row","column","facet"]),{mark:s,width:u,projection:l,height:c,view:f,selection:d,encoding:h}=t,p=bD(t,["mark","width","projection","height","view","selection","encoding"]),{facetMapping:g,layout:m}=this.getFacetMappingAndLayout({row:r,column:i,facet:o},e),b=J$(a,e.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}:{}),c?{height:c}:{}),f?{view:f}:{}),l?{projection:l}:{}),{mark:s,encoding:b}),d?{selection:d}:{})}),e)}getFacetMappingAndLayout(t,e){var n;const{row:r,column:i,facet:o}=t;if(r||i){o&&aC(`Facet encoding dropped as ${(a=[...r?[$M]:[],...i?[NM]:[]]).join(" and ")} ${a.length>1?"are":"is"} also specified.`);const e={},s={};for(const r of[$M,NM]){const i=t[r];if(i){const t=bD(i,["align","center","spacing","columns"]);e[r]=t;for(const t of["align","center","spacing"])void 0!==i[t]&&(s[t]=null!==(n=s[t])&&void 0!==n?n:{},s[t][r]=i[t])}}return{facetMapping:e,layout:s}}{const{align:t,center:n,spacing:r,columns:i}=o;return{facetMapping:X$(bD(o,["align","center","spacing","columns"]),e.repeater),layout:Object.assign(Object.assign(Object.assign(Object.assign({},t?{align:t}:{}),n?{center:n}:{}),r?{spacing:r}:{}),i?{columns:i}:{})}}var a}mapLayer(t,e){var{parentEncoding:n,parentProjection:r}=e,i=bD(e,["parentEncoding","parentProjection"]);const{encoding:o,projection:a}=t,s=bD(t,["encoding","projection"]),u=Object.assign(Object.assign({},i),{parentEncoding:rN({parentEncoding:n,encoding:o,layer:!0}),parentProjection:iN({parentProjection:r,projection:a})});return super.mapLayer(s,u)}};function sN(t){return Object(Z.I)(t)?{type:t}:null!=t?t:{}}const uN=["background","padding"];function lN(t,e){const n={};for(const e of uN)t&&void 0!==t[e]&&(n[e]=gT(t[e]));return e&&(n.params=t.params),n}class cN{constructor(t={},e={}){this.explicit=t,this.implicit=e}clone(){return new cN(CD(this.explicit),CD(this.implicit))}combine(){return Object.assign(Object.assign({},this.explicit),this.implicit)}get(t){return cM(this.explicit[t],this.implicit[t])}getWithExplicit(t){return void 0!==this.explicit[t]?{explicit:!0,value:this.explicit[t]}:void 0!==this.implicit[t]?{explicit:!1,value:this.implicit[t]}:{explicit:!1,value:void 0}}setWithExplicit(t,e){void 0!==e.value&&this.set(t,e.value,e.explicit)}set(t,e,n){return delete this[n?"implicit":"explicit"][t],this[n?"explicit":"implicit"][t]=e,this}copyKeyFromSplit(t,e){void 0!==e.explicit[t]?this.set(t,e.explicit[t],!0):void 0!==e.implicit[t]&&this.set(t,e.implicit[t],!1)}copyKeyFromObject(t,e){void 0!==e[t]&&this.set(t,e[t],!0)}copyAll(t){for(const e of XD(t.combine())){const n=t.getWithExplicit(e);this.setWithExplicit(e,n)}}}function fN(t){return{explicit:!0,value:t}}function dN(t){return{explicit:!1,value:t}}function hN(t){return(e,n,r,i)=>{const o=t(e.value,n.value);return o>0?e:o<0?n:pN(e,n,r,i)}}function pN(t,e,n,r){return t.explicit&&e.explicit&&aC(function(t,e,n,r){return`Conflicting ${e.toString()} property "${t.toString()}" (${TD(n)} and ${TD(r)}). Using ${TD(n)}.`}(n,r,t.value,e.value)),t}function gN(t,e,n,r,i=pN){return void 0===t||void 0===t.value?e:t.explicit&&!e.explicit?t:e.explicit&&!t.explicit?e:SD(t.value,e.value)?t:i(t,e,n,r)}class mN extends cN{constructor(t={},e={},n=!1){super(t,e),this.explicit=t,this.implicit=e,this.parseNothing=n}clone(){const t=super.clone();return t.parseNothing=this.parseNothing,t}}function bN(t){return"url"in t}function yN(t){return"values"in t}function vN(t){return"name"in t&&!bN(t)&&!yN(t)&&!xN(t)}function xN(t){return t&&(_N(t)||ON(t)||wN(t))}function _N(t){return"sequence"in t}function ON(t){return"sphere"in t}function wN(t){return"graticule"in t}var jN;function kN(t){return"filter"in t}function EN(t){return"lookup"in t}function AN(t){return"pivot"in t}function DN(t){return"density"in t}function MN(t){return"quantile"in t}function SN(t){return"regression"in t}function CN(t){return"loess"in t}function FN(t){return"sample"in t}function zN(t){return"window"in t}function TN(t){return"joinaggregate"in t}function $N(t){return"flatten"in t}function NN(t){return"calculate"in t}function RN(t){return"bin"in t}function PN(t){return"impute"in t}function BN(t){return"timeUnit"in t}function LN(t){return"aggregate"in t}function IN(t){return"stack"in t}function UN(t){return"fold"in t}function qN(t,e,n,r){const i=Mz(e)&&e.condition,o=r(e);if(i){return{[n]:[...Object(Z.i)(i).map(e=>{const n=r(e),i=function(t){return t.selection}(e)?tP(t,e.selection):nP(t,e.test);return Object.assign({test:i},n)}),...void 0!==o?[o]:[]]}}return void 0!==o?{[n]:o}:{}}function WN(t,e="text"){const n=t.encoding[e];return qN(t,n,e,e=>YN(e,t.config))}function YN(t,e,n="datum"){if(t){if(Bz(t))return bT(t.value);if(Rz(t)){const{format:r,formatType:i}=tT(t);return sz({fieldOrDatumDef:t,format:r,formatType:i,expr:n,config:e})}}}function HN(t,e={}){const{encoding:n,markDef:r,config:i,stack:o}=t,a=n.tooltip;if(Object(Z.B)(a))return{tooltip:VN({tooltip:a},o,i,e)};{const s=e.reactiveGeom?"datum.datum":"datum";return qN(t,a,"tooltip",t=>{const a=YN(t,i,s);if(a)return a;if(null===t)return;let u=_T("tooltip",r,i);return!0===u&&(u={content:"encoding"}),Object(Z.I)(u)?{value:u}:Object(Z.G)(u)?wC(u)?u:"encoding"===u.content?VN(n,o,i,e):{signal:s}:void 0})}}function GN(t,e,n,{reactiveGeom:r}={}){const i={},o=r?"datum.datum":"datum",a=[];function s(r,s){const u=oS(s),l=Pz(r)?r:Object.assign(Object.assign({},r),{type:t[u].type}),c=l.title||Qz(l,n),f=Object(Z.i)(c).join(", ");let d;if(hS(s)){const r="x"===s?"x2":"y2",a=eT(t[r]);if(DS(l.bin)&&a){const t=Yz(l,{expr:o}),e=Yz(a,{expr:o}),{format:s,formatType:u}=tT(l);d=gz(t,e,s,u,n),i[r]=!0}else if(e&&e.fieldChannel===s&&"normalize"===e.offset){const{format:t,formatType:e}=tT(l);d=sz({fieldOrDatumDef:l,format:t,formatType:e,expr:o,config:n,normalizeStack:!0}).signal}}d=null!=d?d:YN(l,n,o).signal,a.push({channel:s,key:f,value:d})}NT(t,(t,e)=>{Fz(t)?s(t,e):Sz(t)&&s(t.condition,e)});const u={};for(const{channel:t,key:e,value:n}of a)i[t]||u[e]||(u[e]=n);return u}function VN(t,e,n,{reactiveGeom:r}={}){const i=GN(t,e,n,{reactiveGeom:r}),o=KD(i).map(([t,e])=>`"${t}": ${e}`);return o.length>0?{signal:`{${o.join(", ")}}`}:void 0}function XN(t){const{markDef:e,config:n}=t,r=_T("aria",e,n);return!1===r?{}:Object.assign(Object.assign(Object.assign({},r?{aria:r}:{}),function(t){const{mark:e,markDef:n,config:r}=t;if(!1===r.aria)return{};const i=_T("ariaRoleDescription",n,r);if(null!=i)return{ariaRoleDescription:{value:i}};return e in AC?{}:{ariaRoleDescription:{value:e}}}(t)),function(t){const{encoding:e,markDef:n,config:r,stack:i}=t,o=e.description;if(o)return qN(t,o,"description",e=>YN(e,t.config));const a=_T("description",n,r);if(null!=a)return{description:bT(a)};if(!1===r.aria)return{};const s=GN(e,i,r);if(VD(s))return;return{description:{signal:KD(s).map(([t,e],n)=>`"${n>0?"; ":""}${t}: " + (${e})`).join(" + ")}}}(t))}function JN(t,e,n={}){const{markDef:r,encoding:i,config:o}=e,{vgChannel:a}=n;let{defaultRef:s,defaultValue:u}=n;void 0===s&&(u=null!=u?u:_T(t,r,o,{vgChannel:a,ignoreVgConfig:!0}),void 0!==u&&(s=bT(u)));const l=i[t];return qN(e,l,null!=a?a:t,n=>rz({channel:t,channelDef:n,markDef:r,config:o,scaleName:e.scaleName(t),scale:e.getScaleComponent(t),stack:null,defaultRef:s}))}function KN(t,e={filled:void 0}){var n,r,i,o;const{markDef:a,encoding:s,config:u}=t,{type:l}=a,c=null!==(n=e.filled)&&void 0!==n?n:_T("filled",a,u),f=RD(["bar","point","circle","square","geoshape"],l)?"transparent":void 0,d=null!==(i=null!==(r=_T(!0===c?"color":void 0,a,u,{vgChannel:"fill"}))&&void 0!==r?r:u.mark[!0===c&&"color"])&&void 0!==i?i:f,h=null!==(o=_T(!1===c?"color":void 0,a,u,{vgChannel:"stroke"}))&&void 0!==o?o:u.mark[!1===c&&"color"],p=c?"fill":"stroke",g=Object.assign(Object.assign({},d?{fill:bT(d)}:{}),h?{stroke:bT(h)}:{});return a.color&&(c?a.fill:a.stroke)&&aC(WS("property",{fill:"fill"in a,stroke:"stroke"in a})),Object.assign(Object.assign(Object.assign(Object.assign({},g),JN("color",t,{vgChannel:p,defaultValue:c?d:h})),JN("fill",t,{defaultValue:s.fill?d:void 0})),JN("stroke",t,{defaultValue:s.stroke?h:void 0}))}function ZN(t,e){const n=e[function(t){switch(t){case"x":return"xOffset";case"y":return"yOffset";case"x2":return"x2Offset";case"y2":return"y2Offset";case PM:return"thetaOffset";case RM:return"radiusOffset";case BM:return"theta2Offset";case"radius2":return"radius2Offset"}}(t)];if(n)return n}function QN(t,e,{defaultPos:n,vgChannel:r,isMidPoint:i}){const{encoding:o,markDef:a,config:s,stack:u}=e,l=o[t],c=o[sS(t)],f=e.scaleName(t),d=e.getScaleComponent(t),h=ZN(t,a),p=tR({model:e,defaultPos:n,channel:t,scaleName:f,scale:d}),g=!l&&hS(t)&&(o.latitude||o.longitude)?{field:e.getName(t)}:function(t){const{channel:e,channelDef:n,isMidPoint:r,scaleName:i,stack:o,offset:a,markDef:s,config:u}=t;if(Rz(n)&&o&&e===o.fieldChannel){if(Fz(n)){const t=Az({channel:e,fieldDef:n,isMidPoint:r,markDef:s,stack:o,config:u});if(void 0!==t)return nz({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",band:t,offset:a})}return ez(n,i,{suffix:"end"},{offset:a})}return KF(t)}({channel:t,channelDef:l,channel2Def:c,markDef:a,config:s,isMidPoint:i,scaleName:f,scale:d,stack:u,offset:h,defaultRef:p});return g?{[r||t]:g}:void 0}function tR({model:t,defaultPos:e,channel:n,scaleName:r,scale:i}){const{markDef:o,config:a}=t;return()=>{const s=oS(n),u=aS(n),l=_T(n,o,a,{vgChannel:u});if(void 0!==l)return iz(n,l);switch(e){case"zeroOrMin":case"zeroOrMax":if(r){const t=i.get("type");if(RD([GC,KC,ZC],t));else if(i.domainDefinitelyIncludesZero())return{scale:r,value:0}}if("zeroOrMin"===e)return"y"===s?{field:{group:"height"}}:{value:0};switch(s){case"radius":return{signal:`min(${t.width.signal},${t.height.signal})/2`};case"theta":return{signal:"2*PI"};case"x":return{field:{group:"width"}};case"y":return{value:0}}break;case"mid":{const e=t[uS(n)];return Object.assign(Object.assign({},e),{mult:.5})}}}}!function(t){t[t.Raw=0]="Raw",t[t.Main=1]="Main",t[t.Row=2]="Row",t[t.Column=3]="Column",t[t.Lookup=4]="Lookup"}(jN||(jN={}));const eR={left:"x",center:"xc",right:"x2"},nR={top:"y",middle:"yc",bottom:"y2"};function rR(t,e,n,r="middle"){if("radius"===t||"theta"===t)return aS(t);const i="x"===t?"align":"baseline",o=_T(i,e,n);let a;return wC(o)?(aC(function(t){return`The ${t} for range marks cannot be an expression`}(i)),a=void 0):a=o,"x"===t?eR[a||("top"===r?"left":"center")]:nR[a||r]}function iR(t,e,{defaultPos:n,defaultPos2:r,range:i}){return i?oR(t,e,{defaultPos:n,defaultPos2:r}):QN(t,e,{defaultPos:n})}function oR(t,e,{defaultPos:n,defaultPos2:r}){const{markDef:i,config:o}=e,a=sS(t),s=uS(t),u=function(t,e,n){const{encoding:r,mark:i,markDef:o,stack:a,config:s}=t,u=oS(n),l=uS(n),c=aS(n),f=r[u],d=t.scaleName(u),h=t.getScaleComponent(u),p=ZN(n in r||n in o?n:u,t.markDef);if(!f&&("x2"===n||"y2"===n)&&(r.latitude||r.longitude))return{[c]:{field:t.getName(n)}};const g=function({channel:t,channelDef:e,channel2Def:n,markDef:r,config:i,scaleName:o,scale:a,stack:s,offset:u,defaultRef:l}){if(Rz(e)&&s&&t.charAt(0)===s.fieldChannel.charAt(0))return ez(e,o,{suffix:"start"},{offset:u});return KF({channel:t,channelDef:n,scaleName:o,scale:a,stack:s,markDef:r,config:i,offset:u,defaultRef:l})}({channel:n,channelDef:f,channel2Def:r[n],markDef:o,config:s,scaleName:d,scale:h,stack:a,offset:p,defaultRef:void 0});if(void 0!==g)return{[c]:g};return aR(n,o)||aR(n,{[n]:wT(n,o,s.style),[l]:wT(l,o,s.style)})||aR(n,s[i])||aR(n,s.mark)||{[c]:tR({model:t,defaultPos:e,channel:n,scaleName:d,scale:h})()}}(e,r,a),l=u[s]?rR(t,i,o):aS(t);return Object.assign(Object.assign({},QN(t,e,{defaultPos:n,vgChannel:l})),u)}function aR(t,e){const n=uS(t),r=aS(t);return void 0!==e[r]?{[r]:iz(t,e[r])}:void 0!==e[t]?{[r]:iz(t,e[t])}:e[n]?{[n]:iz(t,e[n])}:void 0}function sR(t,e,n){var r,i,o,a;const{config:s,encoding:u,markDef:l,stack:c}=t,f=sS(e),d=uS(e),h=u[e],p=u[f],g=t.getScaleComponent(e),m=g?g.get("type"):void 0,b=t.scaleName(e),y=l.orient,v=null!==(i=null!==(r=u[d])&&void 0!==r?r:u.size)&&void 0!==i?i:_T("size",l,s,{vgChannel:d}),x="bar"===n&&("x"===e?"vertical"===y:"horizontal"===y);if(Fz(h)&&(AS(h.bin)||DS(h.bin)||h.timeUnit&&!p)&&!v&&!gF(m)){const n=Az({channel:e,fieldDef:h,stack:c,markDef:l,config:s}),r=null===(o=t.component.axes[e])||void 0===o?void 0:o[0];return function({fieldDef:t,fieldDef2:e,channel:n,band:r,scaleName:i,markDef:o,spacing:a=0,axisTranslate:s,reverse:u,config:l}){const c=sS(n),f=aS(n),d=aS(c),h=ZN(n,o);if(AS(t.bin)||t.timeUnit)return{[d]:cR({channel:n,fieldDef:t,scaleName:i,markDef:o,band:(1-r)/2,offset:lR(c,a,u,s,h),config:l}),[f]:cR({channel:n,fieldDef:t,scaleName:i,markDef:o,band:1-(1-r)/2,offset:lR(n,a,u,s,h),config:l})};if(DS(t.bin)){const r=ez(t,i,{},{offset:lR(c,a,u,s,h)});if(Fz(e))return{[d]:r,[f]:ez(e,i,{},{offset:lR(n,a,u,s,h)})};if(MS(t.bin)&&t.bin.step)return{[d]:r,[f]:{signal:`scale("${i}", ${Yz(t,{expr:"datum"})} + ${t.bin.step})`,offset:lR(n,a,u,s,h)}}}return void aC(rC(c))}({fieldDef:h,fieldDef2:p,channel:e,markDef:l,scaleName:b,band:n,axisTranslate:null!==(a=null==r?void 0:r.get("translate"))&&void 0!==a?a:.5,spacing:hS(e)?_T("binSpacing",l,s):void 0,reverse:g.get("reverse"),config:s})}return(Rz(h)&&gF(m)||x)&&!p?function(t,e,n,r){var i;const{markDef:o,encoding:a,config:s,stack:u}=r,l=o.orient,c=r.scaleName(n),f=r.getScaleComponent(n),d=uS(n),h=sS(n),p="horizontal"===l&&"y"===n||"vertical"===l&&"x"===n,g=_T(p?"size":d,o,s,{vgChannel:d});let m;(a.size||void 0!==g)&&(p?m=JN("size",r,{vgChannel:d,defaultValue:g}):aC(function(t){return`Cannot apply size to non-oriented mark "${t}".`}(o.type)));const b=null!==(i=Rz(e)?Az({channel:n,fieldDef:e,markDef:o,stack:u,config:s}):void 0)&&void 0!==i?i:1;m=m||{[d]:uR(t,d,c,f,s,b)};const y="band"!==(null==f?void 0:f.get("type"))||!("band"in m[d]),v=rR(n,o,s,y?"middle":"top"),x=ZN(n,o),_=KF({channel:n,channelDef:e,markDef:o,config:s,scaleName:c,scale:f,stack:u,offset:x,defaultRef:tR({model:r,defaultPos:"mid",channel:n,scaleName:c,scale:f}),band:y?.5:(1-b)/2});if(d)return Object.assign({[v]:_},m);{const t=aS(h),e=m[d],n=x?Object.assign(Object.assign({},e),{offset:x}):e;return{[v]:_,[t]:Object(Z.B)(_)?[_[0],Object.assign(Object.assign({},_[1]),{offset:n})]:Object.assign(Object.assign({},_),{offset:n})}}}(n,h,e,t):oR(e,t,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function uR(t,e,n,r,i,o){if(r){const e=r.get("type");if("point"===e||"band"===e){if(void 0!==i[t].discreteBandSize)return{value:i[t].discreteBandSize};if(e===nF){const t=r.get("range");return jC(t)&&Object(Z.F)(t.step)?{value:t.step-2}:{value:j$-2}}return{scale:n,band:o}}return{value:i[t].continuousBandSize}}const a=O$(i.view,e),s=cM(i[t].discreteBandSize,a-2);return void 0!==s?{value:s}:void 0}function lR(t,e,n,r,i){if(YM(t))return 0;const o="x"===t||"y2"===t?-e/2:e/2;if(wC(n)||wC(i)||wC(r)){const t=vT(n),e=vT(i),a=vT(r);return{signal:(a?a+" + ":"")+(t?`(${t} ? -1 : 1) * `:"")+(e?`(${e} + ${o})`:o)}}return i=i||0,r+(n?-i-o:+i+o)}function cR({channel:t,fieldDef:e,scaleName:n,markDef:r,band:i,offset:o,config:a}){return ZF({fieldDef:e,channel:t,markDef:r,ref:nz({scaleName:n,fieldOrDatumDef:e,band:i,offset:o}),config:a})}const fR=new Set(["aria"]);function dR(t,e){const{fill:n,stroke:r}="include"===e.color?KN(t):{};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({},function(t,e){return EC.reduce((n,r)=>(fR.has(r)||void 0===t[r]||"ignore"===e[r]||(n[r]=bT(t[r])),n),{})}(t.markDef,e)),hR(t,"fill",n)),hR(t,"stroke",r)),JN("opacity",t)),JN("fillOpacity",t)),JN("strokeOpacity",t)),JN("strokeWidth",t)),JN("strokeDash",t)),function(t){const{encoding:e,mark:n}=t,r=e.order;return!IF(n)&&Bz(r)?qN(t,r,"zindex",t=>bT(t.value)):{}}(t)),HN(t)),WN(t,"href")),XN(t))}function hR(t,e,n){const{config:r,mark:i,markDef:o}=t;if("hide"===_T("invalid",o,r)&&n&&!IF(i)){const r=function(t,{invalid:e=!1,channels:n}){const r=n.reduce((e,n)=>{const r=t.getScaleComponent(n);if(r){const i=r.get("type"),o=t.vgField(n,{expr:"datum"});o&&mF(i)&&(e[o]=!0)}return e},{}),i=XD(r);if(i.length>0){const t=e?"||":"&&";return i.map(t=>tz(t,e)).join(` ${t} `)}return}(t,{invalid:!0,channels:xS});if(r)return{[e]:[{test:r,value:null},...Object(Z.i)(n)]}}return n?{[e]:n}:{}}function pR(t){const{config:e,markDef:n}=t;if(_T("invalid",n,e)){const e=function(t,{invalid:e=!1,channels:n}){const r=n.reduce((e,n)=>{const r=t.getScaleComponent(n);if(r){const i=r.get("type"),o=t.vgField(n,{expr:"datum"});o&&mF(i)&&(e[o]=!0)}return e},{}),i=XD(r);if(i.length>0){const t=e?"||":"&&";return i.map(t=>tz(t,e)).join(` ${t} `)}return}(t,{channels:dS});if(e)return{defined:{signal:e}}}return{}}function gR(t,e){if(void 0!==e)return{[t]:bT(e)}}const mR={has:t=>"interval"!==t.type&&t.nearest,parse:(t,e)=>{if(e.events)for(const n of e.events)n.markname=t.getName("voronoi")},marks:(t,e,n)=>{const{x:r,y:i}=e.project.hasChannel,o=t.mark;if(IF(o))return aC(`The "nearest" transform is not supported for ${o} marks.`),n;const a={name:t.getName("voronoi"),type:"path",interactive:!0,from:{data:t.getName("marks")},encode:{update:Object.assign({fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0}},HN(t,{reactiveGeom:!0}))},transform:[{type:"voronoi",x:{expr:r||!i?"datum.datum.x || 0":"0"},y:{expr:i||!r?"datum.datum.y || 0":"0"},size:[t.getSizeSignalRef("width"),t.getSizeSignalRef("height")]}]};let s=0,u=!1;return n.forEach((e,n)=>{var r;const i=null!==(r=e.name)&&void 0!==r?r:"";i===t.component.mark[0].name?s=n:i.indexOf("voronoi")>=0&&(u=!0)}),u||n.splice(s+1,0,a),n}};class bR{constructor(t,e){this.debugName=e,this._children=[],this._parent=null,t&&(this.parent=t)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(t){this._parent=t,t&&t.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(t,e){this._children.indexOf(t)>-1?aC("Attempt to add the same child twice."):void 0!==e?this._children.splice(e,0,t):this._children.push(t)}removeChild(t){const e=this._children.indexOf(t);return this._children.splice(e,1),e}remove(){let t=this._parent.removeChild(this);for(const e of this._children)e._parent=this._parent,this._parent.addChild(e,t++)}insertAsParentOf(t){const e=t.parent;e.removeChild(this),this.parent=e,t.parent=this}swapWithParent(){const t=this._parent,e=t.parent;for(const e of this._children)e.parent=t;this._children=[],t.removeChild(this),t.parent.removeChild(t),this.parent=e,t.parent=this}}class yR extends bR{constructor(t,e,n,r){super(t,e),this.type=n,this.refCounts=r,this._source=this._name=e,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}clone(){const t=new this.constructor;return t.debugName="clone_"+this.debugName,t._source=this._source,t._name="clone_"+this._name,t.type=this.type,t.refCounts=this.refCounts,t.refCounts[t._name]=0,t}dependentFields(){return new Set}producedFields(){return new Set}hash(){return void 0===this._hash&&(this._hash="Output "+dM()),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(t){this._source=t}}class vR extends bR{constructor(t,e){super(t),this.formula=e}clone(){return new vR(null,CD(this.formula))}static makeFromEncoding(t,e){const n=e.reduceFieldDef((t,n,r)=>{const{field:i,timeUnit:o}=n,a=OL(e)?e.encoding[sS(r)]:void 0,s=OL(e)&&Dz(r,n,a,e.stack,e.markDef,e.config);if(o){const e=Yz(n,{forAs:!0});t[$D({as:e,field:i,timeUnit:o})]=Object.assign({as:e,field:i,timeUnit:o},s?{band:!0}:{})}return t},{});return VD(n)?null:new vR(t,n)}static makeFromTransform(t,e){const n=Object.assign({},e),{timeUnit:r}=n,i=bD(n,["timeUnit"]),o=OC(r),a=Object.assign(Object.assign({},i),{timeUnit:o});return new vR(t,{[$D(a)]:a})}merge(t){this.formula=Object.assign({},this.formula);for(const e in t.formula)this.formula[e]&&!t.formula[e].band||(this.formula[e]=t.formula[e]);for(const e of t.children)t.removeChild(e),e.parent=this;t.remove()}removeFormulas(t){const e={};for(const[n,r]of KD(this.formula))t.has(r.as)||(e[n]=r);this.formula=e}producedFields(){return new Set(JD(this.formula).map(t=>t.as))}dependentFields(){return new Set(JD(this.formula).map(t=>t.field))}hash(){return"TimeUnit "+$D(this.formula)}assemble(){const t=[];for(const e of JD(this.formula)){const{field:n,as:r,timeUnit:i}=e,o=OC(i),{unit:a,utc:s}=o,u=bD(o,["unit","utc"]);t.push(Object.assign(Object.assign(Object.assign(Object.assign({field:aM(n),type:"timeunit"},a?{units:yC(a)}:{}),s?{timezone:"utc"}:{}),u),{as:[r,r+"_end"]}))}return t}}class xR{constructor(...t){this.items=t,this.hasChannel={},this.hasField={}}}const _R={has:t=>"single"===t.type&&"global"===t.resolve&&t.bind&&"scales"!==t.bind&&!h$(t.bind),parse:(t,e,n,r)=>{r.on||delete e.events,r.clear||delete e.clear},topLevelSignals:(t,e,n)=>{const r=e.name,i=e.project,o=e.bind,a=e.init&&e.init[0],s=mR.has(e)?"(item().isVoronoi ? datum.datum : datum)":"datum";return i.items.forEach((t,i)=>{var u,l;const c=QD(`${r}_${t.field}`);n.filter(t=>t.name===c).length||n.unshift(Object.assign(Object.assign({name:c},a?{init:$R(a[i])}:{value:null}),{on:e.events?[{events:e.events,update:`datum && item().mark.marktype !== 'group' ? ${s}[${Object(Z.ab)(t.field)}] : null`}]:[],bind:null!==(l=null!==(u=o[t.field])&&void 0!==u?u:o[t.channel])&&void 0!==l?l:o}))}),n},signals:(t,e,n)=>{const r=e.name,i=e.project,o=n.filter(t=>t.name===r+YR)[0],a=r+"_tuple_fields",s=i.items.map(t=>QD(`${r}_${t.field}`)),u=s.map(t=>t+" !== null").join(" && ");return s.length&&(o.update=`${u} ? {fields: ${a}, values: [${s.join(", ")}]} : null`),delete o.value,delete o.on,n}},OR={has:t=>"multi"===t.type&&!!t.toggle,signals:(t,e,n)=>n.concat({name:e.name+"_toggle",value:!1,on:[{events:e.events,update:e.toggle}]}),modifyExpr:(t,e)=>{const n=e.name+YR,r=e.name+"_toggle";return`${r} ? null : ${n}, `+("global"===e.resolve?r+" ? null : true, ":`${r} ? null : {unit: ${JR(t)}}, `)+`${r} ? ${n} : null`}},wR={has:t=>void 0!==t.clear&&!1!==t.clear,parse:(t,e,n)=>{n.clear&&(e.clear=Object(Z.I)(n.clear)?Kj(n.clear,"scope"):n.clear)},topLevelSignals:(t,e,n)=>{if(_R.has(e))for(const t of e.project.items){const r=n.findIndex(n=>n.name===QD(`${e.name}_${t.field}`));-1!==r&&n[r].on.push({events:e.clear,update:"null"})}return n},signals:(t,e,n)=>{function r(t,r){-1!==t&&n[t].on&&n[t].on.push({events:e.clear,update:r})}if("interval"===e.type)for(const t of e.project.items){const e=n.findIndex(e=>e.name===t.signals.visual);if(r(e,"[0, 0]"),-1===e){r(n.findIndex(e=>e.name===t.signals.data),"null")}}else{let t=n.findIndex(t=>t.name===e.name+YR);r(t,"null"),OR.has(e)&&(t=n.findIndex(t=>t.name===e.name+"_toggle"),r(t,"false"))}return n}},jR={has:t=>"interval"===t.type&&"global"===t.resolve&&t.bind&&"scales"===t.bind,parse:(t,e)=>{const n=e.scales=[];for(const r of e.project.items){const i=r.channel;if(!_S(i))continue;const o=t.getScaleComponent(i),a=o?o.get("type"):void 0;if(!o||!mF(a)){aC("Scale bindings are currently only supported for scales with unbinned, continuous domains.");continue}const s={selection:e.name,field:r.field};o.set("selectionExtent",s,!0),n.push(r)}},topLevelSignals:(t,e,n)=>{const r=e.scales.filter(t=>0===n.filter(e=>e.name===t.signals.data).length);if(!t.parent||ER(t)||0===r.length)return n;const i=n.filter(t=>t.name===e.name)[0];let o=i.update;if(o.indexOf(GR)>=0)i.update=`{${r.map(t=>`${Object(Z.ab)(t.field)}: ${t.signals.data}`).join(", ")}}`;else{for(const t of r){const e=`${Object(Z.ab)(t.field)}: ${t.signals.data}`;o.indexOf(e)<0&&(o=`${o.substring(0,o.length-1)}, ${e}}`)}i.update=o}return n.concat(r.map(t=>({name:t.signals.data})))},signals:(t,e,n)=>{if(t.parent&&!ER(t))for(const t of e.scales){const e=n.filter(e=>e.name===t.signals.data)[0];e.push="outer",delete e.value,delete e.update}return n}};function kR(t,e){return`domain(${Object(Z.ab)(t.scaleName(e))})`}function ER(t){var e;return t.parent&&kL(t.parent)&&(null!==(e=!t.parent.parent)&&void 0!==e?e:ER(t.parent.parent))}const AR={has:t=>{const e="global"===t.resolve&&t.bind&&h$(t.bind),n=1===t.project.items.length&&"_vgsid_"!==t.project.items[0].field;return e&&!n&&aC("Legend bindings are only supported for selections over an individual field or encoding channel."),e&&n},parse:(t,e,n,r)=>{var i;if(r.on||delete e.events,r.clear||delete e.clear,r.on||r.clear){const t='event.item && indexof(event.item.mark.role, "legend") < 0';for(const n of e.events)n.filter=Object(Z.i)(null!==(i=n.filter)&&void 0!==i?i:[]),n.filter.indexOf(t)<0&&n.filter.push(t)}const o=p$(e.bind)?e.bind.legend:"click",a=Object(Z.I)(o)?Kj(o,"view"):Object(Z.i)(o);e.bind={legend:{merge:a}}},topLevelSignals:(t,e,n)=>{const r=e.name,i=p$(e.bind)&&e.bind.legend,o=t=>e=>{const n=CD(e);return n.markname=t,n};for(const t of e.project.items){if(!t.hasLegend)continue;const a=QD(t.field)+"_legend",s=`${r}_${a}`;if(0===n.filter(t=>t.name===s).length){const t=i.merge.map(o(a+"_symbols")).concat(i.merge.map(o(a+"_labels"))).concat(i.merge.map(o(a+"_entries")));n.unshift(Object.assign(Object.assign({name:s},e.init?{}:{value:null}),{on:[{events:t,update:"datum.value || item().items[0].items[0].datum.value",force:!0},{events:i.merge,update:"!event.item || !datum ? null : "+s,force:!0}]}))}}return n},signals:(t,e,n)=>{const r=e.name,i=e.project,o=n.find(t=>t.name===r+YR),a=r+"_tuple_fields",s=i.items.filter(t=>t.hasLegend).map(t=>QD(`${r}_${QD(t.field)}_legend`)),u=`${s.map(t=>t+" !== null").join(" && ")} ? {fields: ${a}, values: [${s.join(", ")}]} : null`;e.events&&s.length>0?o.on.push({events:s.map(t=>({signal:t})),update:u}):s.length>0&&(o.update=u,delete o.value,delete o.on);const l=n.find(t=>t.name===r+"_toggle"),c=p$(e.bind)&&e.bind.legend;return l&&(e.events?l.on.push(Object.assign(Object.assign({},l.on[0]),{events:c})):l.on[0].events=c),n}};const DR="_translate_delta",MR={has:t=>"interval"===t.type&&t.translate,signals:(t,e,n)=>{const r=e.name,i=jR.has(e),o=r+"_translate_anchor",{x:a,y:s}=e.project.hasChannel;let u=Kj(e.translate,"scope");return i||(u=u.map(t=>(t.between[0].markname=r+PR,t))),n.push({name:o,value:{},on:[{events:u.map(t=>t.between[0]),update:"{x: x(unit), y: y(unit)"+(void 0!==a?", extent_x: "+(i?kR(t,"x"):`slice(${a.signals.visual})`):"")+(void 0!==s?", extent_y: "+(i?kR(t,"y"):`slice(${s.signals.visual})`):"")+"}"}]},{name:r+DR,value:{},on:[{events:u,update:`{x: ${o}.x - x(unit), y: ${o}.y - y(unit)}`}]}),void 0!==a&&SR(t,e,a,"width",n),void 0!==s&&SR(t,e,s,"height",n),n}};function SR(t,e,n,r,i){var o;const a=e.name,s=a+"_translate_anchor",u=a+DR,l=n.channel,c=jR.has(e),f=i.filter(t=>t.name===n.signals[c?"data":"visual"])[0],d=t.getSizeSignalRef(r).signal,h=t.getScaleComponent(l),p=h.get("type"),g=`${s}.extent_${l}`,m=`${c?"log"===p?"panLog":"pow"===p?"panPow":"panLinear":"panLinear"}(${g}, ${`${c&&"x"===l?"-":""}${u}.${l} / `+(c?""+d:`span(${g})`)}`+(c&&"pow"===p?", "+(null!==(o=h.get("exponent"))&&void 0!==o?o:1):"")+")";f.on.push({events:{signal:u},update:c?m:`clampRange(${m}, 0, ${d})`})}const CR={has:t=>"interval"===t.type&&t.zoom,signals:(t,e,n)=>{const r=e.name,i=jR.has(e),o=r+"_zoom_delta",{x:a,y:s}=e.project.hasChannel,u=Object(Z.ab)(t.scaleName("x")),l=Object(Z.ab)(t.scaleName("y"));let c=Kj(e.zoom,"scope");return i||(c=c.map(t=>(t.markname=r+PR,t))),n.push({name:r+"_zoom_anchor",on:[{events:c,update:i?"{"+[u?`x: invert(${u}, x(unit))`:"",l?`y: invert(${l}, y(unit))`:""].filter(t=>!!t).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:o,on:[{events:c,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),void 0!==a&&FR(t,e,a,"width",n),void 0!==s&&FR(t,e,s,"height",n),n}};function FR(t,e,n,r,i){var o;const a=e.name,s=n.channel,u=jR.has(e),l=i.filter(t=>t.name===n.signals[u?"data":"visual"])[0],c=t.getSizeSignalRef(r).signal,f=t.getScaleComponent(s),d=f.get("type"),h=u?kR(t,s):l.name,p=a+"_zoom_delta",g=`${u?"log"===d?"zoomLog":"pow"===d?"zoomPow":"zoomLinear":"zoomLinear"}(${h}, ${`${a}_zoom_anchor.${s}`}, ${p}`+(u&&"pow"===d?", "+(null!==(o=f.get("exponent"))&&void 0!==o?o:1):"")+")";l.on.push({events:{signal:p},update:u?g:`clampRange(${g}, 0, ${c})`})}const zR=[{has:()=>!0,parse:(t,e,n)=>{var r,i,o;const a=e.name,s=null!==(r=e.project)&&void 0!==r?r:e.project=new xR,u={},l={},c=new Set,f=(t,e)=>{const n="visual"===e?t.channel:t.field;let r=QD(`${a}_${n}`);for(let t=1;c.has(r);t++)r=QD(`${a}_${n}_${t}`);return c.add(r),{[e]:r}};if(!n.fields&&!n.encodings){const e=t.config.selection[n.type];if(n.init)for(const t of Object(Z.i)(n.init))for(const r of XD(t))eS[r]?(n.encodings||(n.encodings=[])).push(r):"interval"===n.type?(aC('Interval selections should be initialized using "x" and/or "y" keys.'),n.encodings=e.encodings):(n.fields||(n.fields=[])).push(r);else n.encodings=e.encodings,n.fields=e.fields}for(const t of null!==(i=n.fields)&&void 0!==i?i:[]){const e={type:"E",field:t};e.signals=Object.assign({},f(e,"data")),s.items.push(e),s.hasField[t]=e}for(const r of null!==(o=n.encodings)&&void 0!==o?o:[]){const n=t.fieldDef(r);if(n){let i=n.field;if(n.aggregate){aC(PS(r,n.aggregate));continue}if(!i){aC(RS(r));continue}if(n.timeUnit){i=t.vgField(r);const e={timeUnit:n.timeUnit,as:i,field:n.field};l[$D(e)]=e}if(!u[i]){let o="E";if("interval"===e.type){mF(t.getScaleComponent(r).get("type"))&&(o="R")}else n.bin&&(o="R-RE");const a={field:i,channel:r,type:o};a.signals=Object.assign(Object.assign({},f(a,"data")),f(a,"visual")),s.items.push(u[i]=a),s.hasField[i]=s.hasChannel[r]=u[i]}}else aC(RS(r))}if(n.init){const t=t=>s.items.map(e=>void 0!==t[e.channel]?t[e.channel]:t[e.field]);if("interval"===n.type)e.init=t(n.init);else{const r=Object(Z.i)(n.init);e.init=r.map(t)}}VD(l)||(s.timeUnit=new vR(null,l))},signals:(t,e,n)=>{const r=e.name+"_tuple_fields";return n.filter(t=>t.name===r).length>0?n:n.concat({name:r,value:e.project.items.map(t=>{const e=bD(t,["signals","hasLegend"]);return e.field=aM(e.field),e})})}},OR,jR,AR,MR,CR,_R,mR,wR];function TR(t,e){for(const n of zR)n.has(t)&&e(n)}function $R(t,e=!0,n=Z.y){if(Object(Z.B)(t)){const r=t.map(t=>$R(t,e,n));return e?`[${r.join(", ")}]`:r}return sC(t)?n(e?hC(t):function(t){const e=dC(t,!0);return t.utc?+new Date(Date.UTC(...e)):+new Date(...e)}(t)):e?n(JSON.stringify(t)):t}function NR(t,e){return XR(t,(n,r)=>{e=r.marks?r.marks(t,n,e):e,TR(n,r=>{r.marks&&(e=r.marks(t,n,e))})}),e}function RR(t){return t.map(t=>(t.on&&!t.on.length&&delete t.on,t))}const PR="_brush",BR={signals:(t,e)=>{const n=e.name,r=n+"_tuple_fields",i=jR.has(e),o=[],a=[],s=[];if(e.translate&&!i){const t="!event.item || event.item.mark.name !== "+Object(Z.ab)(n+PR);LR(e,(e,n)=>{var r;const i=Object(Z.i)(null!==(r=n.between[0].filter)&&void 0!==r?r:n.between[0].filter=[]);return i.indexOf(t)<0&&i.push(t),e})}e.project.items.forEach((n,r)=>{const i=n.channel;if("x"!==i&&"y"!==i)return void aC("Interval selections only support x and y encoding channels.");const u=e.init?e.init[r]:null,l=function(t,e,n,r){const i=n.channel,o=n.signals.visual,a=n.signals.data,s=jR.has(e),u=Object(Z.ab)(t.scaleName(i)),l=t.getScaleComponent(i),c=l?l.get("type"):void 0,f=t=>`scale(${u}, ${t})`,d=t.getSizeSignalRef("x"===i?"width":"height").signal,h=i+"(unit)",p=LR(e,(t,e)=>[...t,{events:e.between[0],update:`[${h}, ${h}]`},{events:e,update:`[${o}[0], clamp(${h}, 0, ${d})]`}]);return p.push({events:{signal:e.name+"_scale_trigger"},update:mF(c)?`[${f(a+"[0]")}, ${f(a+"[1]")}]`:"[0, 0]"}),s?[{name:a,on:[]}]:[Object.assign(Object.assign({name:o},r?{init:$R(r,!0,f)}:{value:[]}),{on:p}),Object.assign(Object.assign({name:a},r?{init:$R(r)}:{}),{on:[{events:{signal:o},update:`${o}[0] === ${o}[1] ? null : invert(${u}, ${o})`}]})]}(t,e,n,u),c=n.signals.data,f=n.signals.visual,d=Object(Z.ab)(t.scaleName(i)),h=mF(t.getScaleComponent(i).get("type"))?"+":"";o.push(...l),a.push(c),s.push({scaleName:t.scaleName(i),expr:`(!isArray(${c}) || (${h}invert(${d}, ${f})[0] === ${h}${c}[0] && ${h}invert(${d}, ${f})[1] === ${h}${c}[1]))`})}),i||o.push({name:n+"_scale_trigger",value:{},on:[{events:s.map(t=>({scale:t.scaleName})),update:s.map(t=>t.expr).join(" && ")+` ? ${n+"_scale_trigger"} : {}`}]});const u=e.init,l=`unit: ${JR(t)}, fields: ${r}, values`;return o.concat(Object.assign(Object.assign({name:n+YR},u?{init:`{${l}: ${$R(u)}}`}:{}),{on:[{events:[{signal:a.join(" || ")}],update:a.join(" && ")+` ? {${l}: [${a}]} : null`}]}))},modifyExpr:(t,e)=>e.name+YR+", "+("global"===e.resolve?"true":`{unit: ${JR(t)}}`),marks:(t,e,n)=>{const r=e.name,{x:i,y:o}=e.project.hasChannel,a=i&&i.signals.visual,s=o&&o.signals.visual,u=`data(${Object(Z.ab)(e.name+WR)})`;if(jR.has(e))return n;const l={x:void 0!==i?{signal:a+"[0]"}:{value:0},y:void 0!==o?{signal:s+"[0]"}:{value:0},x2:void 0!==i?{signal:a+"[1]"}:{field:{group:"width"}},y2:void 0!==o?{signal:s+"[1]"}:{field:{group:"height"}}};if("global"===e.resolve)for(const e of XD(l))l[e]=[Object.assign({test:`${u}.length && ${u}[0].unit === ${JR(t)}`},l[e]),{value:0}];const c=e.mark,{fill:f,fillOpacity:d,cursor:h}=c,p=bD(c,["fill","fillOpacity","cursor"]),g=XD(p).reduce((t,e)=>(t[e]=[{test:[void 0!==i&&`${a}[0] !== ${a}[1]`,void 0!==o&&`${s}[0] !== ${s}[1]`].filter(t=>t).join(" && "),value:p[e]},{value:null}],t),{});return[{name:r+PR+"_bg",type:"rect",clip:!0,encode:{enter:{fill:{value:f},fillOpacity:{value:d}},update:l}},...n,{name:r+PR,type:"rect",clip:!0,encode:{enter:Object.assign(Object.assign({},h?{cursor:{value:h}}:{}),{fill:{value:"transparent"}}),update:Object.assign(Object.assign({},l),g)}}]}};function LR(t,e){return t.events.reduce((t,n)=>n.between?e(t,n):(aC(n+" is not an ordered event stream for interval selections."),t),[])}function IR(t,e){const n=e.name,r=n+"_tuple_fields",i=e.project,o="(item().isVoronoi ? datum.datum : datum)",a=i.items.map(e=>{const n=t.fieldDef(e.channel);return n&&n.bin?`[${o}[${Object(Z.ab)(t.vgField(e.channel,{}))}], ${o}[${Object(Z.ab)(t.vgField(e.channel,{binSuffix:"end"}))}]]`:`${o}[${Object(Z.ab)(e.field)}]`}).join(", "),s=`unit: ${JR(t)}, fields: ${r}, values`,u=e.events;return[{name:n+YR,on:u?[{events:u,update:`datum && item().mark.marktype !== 'group' ? {${s}: [${a}]} : null`,force:!0}]:[]}]}const UR={signals:IR,modifyExpr:(t,e)=>e.name+YR+", "+("global"===e.resolve?"null":`{unit: ${JR(t)}}`)},qR={signals:IR,modifyExpr:(t,e)=>e.name+YR+", "+("global"===e.resolve?"true":`{unit: ${JR(t)}}`)},WR="_store",YR="_tuple",HR="_modify",GR="vlSelectionResolve",VR={single:qR,multi:UR,interval:BR};function XR(t,e){const n=t.component.selection;if(n)for(const t of JD(n)){if(!0===e(t,VR[t.type]))break}}function JR(t,{escape:e}={escape:!0}){let n=e?Object(Z.ab)(t.name):t.name;const r=function(t){let e=t.parent;for(;e&&!wL(e);)e=e.parent;return e}(t);if(r){const{facet:t}=r;for(const e of KM)t[e]&&(n+=` + '__facet_${e}_' + (facet[${Object(Z.ab)(r.vgField(e))}])`)}return n}function KR(t){let e=!1;return XR(t,t=>{e=e||t.project.items.some(t=>"_vgsid_"===t.field)}),e}function ZR(t){const e=rO(t),n=new Set;return e.visit(t=>{"MemberExpression"===t.type&&function t(e){return"MemberExpression"===e.object.type?t(e.object):"datum"===e.object.name}(t)&&n.add(function t(e){const n=[];return"Identifier"===e.type?[e.name]:"Literal"===e.type?[e.value]:("MemberExpression"===e.type&&(n.push(...t(e.object)),n.push(...t(e.property))),n)}(t).slice(1).join("."))}),n}class QR extends bR{constructor(t,e,n){super(t),this.model=e,this.filter=n,this.expr=nP(this.model,this.filter,this),this._dependentFields=ZR(this.expr)}clone(){return new QR(null,this.model,CD(this.filter))}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return"Filter "+this.expr}}function tP(t,e,n,r="datum"){const i=[];const o=tM(e,(function(e){const o=QD(e),a=t.getSelectionComponent(o,e),s=Object(Z.ab)(o+WR);if(a.project.timeUnit){const e=null!=n?n:t.component.data.raw,r=a.project.timeUnit.clone();e.parent?r.insertAsParentOf(e):e.parent=r}return"none"!==a.empty&&i.push(s),`vlSelectionTest(${s}, ${r}`+("global"===a.resolve?")":`, ${Object(Z.ab)(a.resolve)})`)}));return(i.length?"!("+i.map(t=>`length(data(${t}))`).join(" || ")+") || ":"")+`(${o})`}function eP(t,e){const n=e.encoding;let r=e.field;if(n||r){if(n&&!r){const i=t.project.items.filter(t=>t.channel===n);!i.length||i.length>1?(r=t.project.items[0].field,aC((i.length?"Multiple ":"No ")+`matching ${Object(Z.ab)(n)} encoding found for selection ${Object(Z.ab)(e.selection)}. `+`Using "field": ${Object(Z.ab)(r)}.`)):r=i[0].field}}else r=t.project.items[0].field,t.project.items.length>1&&aC(`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${Object(Z.ab)(r)}.`);return`${t.name}[${Object(Z.ab)(r)}]`}function nP(t,e,n){return tM(e,e=>Object(Z.I)(e)?e:function(t){return null==t?void 0:t.selection}(e)?tP(t,e.selection,n):PC(e))}function rP(t,e,n,r){var i,o,a;t.encode=null!==(i=t.encode)&&void 0!==i?i:{},t.encode[e]=null!==(o=t.encode[e])&&void 0!==o?o:{},t.encode[e].update=null!==(a=t.encode[e].update)&&void 0!==a?a:{},t.encode[e].update[n]=r}function iP(t,e,n,r={header:!1}){var i,o;const a=t.combine(),{disable:s,orient:u,scale:l,labelExpr:c,title:f,zindex:d}=a,h=bD(a,["disable","orient","scale","labelExpr","title","zindex"]);if(!s){for(const t in h){const n=_M[t],r=h[t];if(n&&n!==e&&"both"!==n)delete h[t];else if(vM(r)){const{condition:e}=r,n=bD(r,["condition"]),i=Object(Z.i)(e),o=yM[t];if(o){const{vgProp:e,part:r}=o;rP(h,r,e,[...i.map(t=>{const{test:e}=t,n=bD(t,["test"]);return Object.assign({test:nP(null,e)},n)}),n]),delete h[t]}else if(null===o){const e={signal:i.map(t=>{const{test:e}=t,n=bD(t,["test"]);return`${nP(null,e)} ? ${yT(n)} : `}).join("")+yT(n)};h[t]=e}}else if(wC(r)){const e=yM[t];if(e){const{vgProp:n,part:i}=e;rP(h,i,n,r),delete h[t]}}}if("grid"===e){if(!h.grid)return;if(h.encode){const{grid:t}=h.encode;h.encode=Object.assign({},t?{grid:t}:{}),VD(h.encode)&&delete h.encode}return Object.assign(Object.assign({scale:l,orient:u},h),{domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:cM(d,0)})}{if(!r.header&&t.mainExtracted)return;if(void 0!==c){let t=c;(null===(o=null===(i=h.encode)||void 0===i?void 0:i.labels)||void 0===o?void 0:o.update)&&wC(h.encode.labels.update.text)&&(t=sM(c,"datum.label",h.encode.labels.update.text.signal)),rP(h,"labels","text",{signal:t})}if(null===h.labelAlign&&delete h.labelAlign,h.encode){for(const e of xM)t.hasAxisPart(e)||delete h.encode[e];VD(h.encode)&&delete h.encode}const e=function(t,e){if(t)return Object(Z.B)(t)&&!hT(t)?t.map(t=>Qz(t,e)).join(", "):t}(f,n);return Object.assign(Object.assign(Object.assign(Object.assign({scale:l,orient:u,grid:!1},e?{title:e}:{}),h),!1===n.aria?{aria:!1}:{}),{zindex:cM(d,0)})}}}function oP(t){const{axes:e}=t.component,n=[];for(const r of dS)if(e[r])for(const i of e[r])if(!i.get("disable")&&!i.get("gridScale")){const e="x"===r?"height":"width",i=t.getSizeSignalRef(e).signal;e!==i&&n.push({name:e,update:i})}return n}function aP(t,e,n,r){return Object.assign.apply(null,[{},...t.map(t=>{if("axisOrient"===t){const t="x"===n?"bottom":"left",i=e["x"===n?"axisBottom":"axisLeft"]||{},o=e["x"===n?"axisTop":"axisRight"]||{},a=new Set([...XD(i),...XD(o)]),s={};for(const e of a.values())s[e]={signal:`${r.signal} === "${t}" ? ${vT(i[e])} : ${vT(o[e])}`};return s}return e[t]})])}function sP(t,e,n,r){const i="band"===e?["axisDiscrete","axisBand"]:"point"===e?["axisDiscrete","axisPoint"]:e in cF?["axisQuantitative"]:"time"===e||"utc"===e?["axisTemporal"]:[];const o="x"===t?"axisX":"axisY",a=wC(n)?"axisOrient":"axis"+nM(n),s=[...i,...i.map(t=>o+t.substr(4))],u=["axis",a,o];return{vlOnlyAxisConfig:aP(s,r,t,n),vgAxisConfig:aP(u,r,t,n),axisConfigStyle:uP([...u,...s],r)}}function uP(t,e){var n;const r=[{}];for(const i of t){let t=null===(n=e[i])||void 0===n?void 0:n.style;if(t){t=Object(Z.i)(t);for(const n of t)r.push(e.style[n])}}return Object.assign.apply(null,r)}function lP(t,e,n,r={}){var i;const o=jT(t,n,e);if(void 0!==o)return{configFrom:"style",configValue:o};for(const e of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(void 0!==(null===(i=r[e])||void 0===i?void 0:i[t]))return{configFrom:e,configValue:r[e][t]};return{}}const cP={scale:({model:t,channel:e})=>t.scaleName(e),format:({fieldOrDatumDef:t,config:e,axis:n})=>{const{format:r,formatType:i}=n;return cz(t,t.type,r,i,e,!0)},formatType:({axis:t,fieldOrDatumDef:e,scaleType:n})=>{const{formatType:r}=t;return fz(r,e,n)},grid:({fieldOrDatumDef:t,axis:e,scaleType:n})=>{var r;return(!Fz(t)||!DS(t.bin))&&(null!==(r=e.grid)&&void 0!==r?r:function(t,e){return!gF(t)&&Fz(e)&&!AS(null==e?void 0:e.bin)}(n,t))},gridScale:({model:t,channel:e})=>function(t,e){const n="x"===e?"y":"x";if(t.getScaleComponent(n))return t.scaleName(n);return}(t,e),labelAlign:({axis:t,labelAngle:e,orient:n,channel:r})=>t.labelAlign||hP(e,n,r),labelAngle:({labelAngle:t})=>t,labelBaseline:({axis:t,labelAngle:e,orient:n,channel:r})=>t.labelBaseline||dP(e,n,r),labelFlush:({axis:t,fieldOrDatumDef:e,channel:n})=>{var r;return null!==(r=t.labelFlush)&&void 0!==r?r:function(t,e){if("x"===e&&RD(["quantitative","temporal"],t))return!0;return}(e.type,n)},labelOverlap:({axis:t,fieldOrDatumDef:e,scaleType:n})=>{var r;return null!==(r=t.labelOverlap)&&void 0!==r?r:function(t,e,n,r){if(n&&!Object(Z.G)(r)||"nominal"!==t&&"ordinal"!==t)return"log"!==e||"greedy";return}(e.type,n,Fz(e)&&!!e.timeUnit,Fz(e)?e.sort:void 0)},orient:({orient:t})=>t,tickCount:({channel:t,model:e,axis:n,fieldOrDatumDef:r,scaleType:i})=>{var o;const a="x"===t?"width":"y"===t?"height":void 0,s=a?e.getSizeSignalRef(a):void 0;return null!==(o=n.tickCount)&&void 0!==o?o:function({fieldOrDatumDef:t,scaleType:e,size:n,values:r}){var i;if(!r&&!gF(e)&&"log"!==e){if(Fz(t)){if(AS(t.bin))return{signal:`ceil(${n.signal}/10)`};if(t.timeUnit&&RD(["month","hours","day","quarter"],null===(i=OC(t.timeUnit))||void 0===i?void 0:i.unit))return}return{signal:`ceil(${n.signal}/40)`}}return}({fieldOrDatumDef:r,scaleType:i,size:s,values:n.values})},title:({axis:t,model:e,channel:n})=>{if(void 0!==t.title)return t.title;const r=pP(e,n);if(void 0!==r)return r;const i=e.typedFieldDef(n),o="x"===n?"x2":"y2",a=e.fieldDef(o);return ET(i?[kz(i)]:[],Fz(a)?[kz(a)]:[])},values:({axis:t,fieldOrDatumDef:e})=>function(t,e){const n=t.values;if(Object(Z.B)(n))return cT(e,n);if(wC(n))return n;return}(t,e),zindex:({axis:t,fieldOrDatumDef:e,mark:n})=>{var r;return null!==(r=t.zindex)&&void 0!==r?r:function(t,e){if("rect"===t&&Hz(e))return 1;return 0}(n,e)}};function fP(t){return`(((${t.signal} % 360) + 360) % 360)`}function dP(t,e,n,r){if(void 0!==t){if("x"===n){if(wC(t)){const n=fP(t);return{signal:`(45 < ${n} && ${n} < 135) || (225 < ${n} && ${n} < 315) ? "middle" :(${n} <= 45 || 315 <= ${n}) === ${wC(e)?`(${e.signal} === "top")`:"top"===e} ? "bottom" : "top"`}}if(45<t&&t<135||225<t&&t<315)return"middle";if(wC(e)){const n=t<=45||315<=t?"===":"!==";return{signal:`${e.signal} ${n} "top" ? "bottom" : "top"`}}return(t<=45||315<=t)==("top"===e)?"bottom":"top"}if(wC(t)){const n=fP(t);return{signal:`${n} <= 45 || 315 <= ${n} || (135 <= ${n} && ${n} <= 225) ? ${r?'"middle"':"null"} : (45 <= ${n} && ${n} <= 135) === ${wC(e)?`(${e.signal} === "left")`:"left"===e} ? "top" : "bottom"`}}if(t<=45||315<=t||135<=t&&t<=225)return r?"middle":null;if(wC(e)){const n=45<=t&&t<=135?"===":"!==";return{signal:`${e.signal} ${n} "left" ? "top" : "bottom"`}}return(45<=t&&t<=135)==("left"===e)?"top":"bottom"}}function hP(t,e,n){if(void 0===t)return;const r="x"===n,i=r?0:90,o=r?"bottom":"left";if(wC(t)){const n=fP(t);return{signal:`(${i?"("+n+" + 90)":n} % 180 === 0) ? ${r?null:'"center"'} :(${i} < ${n} && ${n} < ${180+i}) === ${wC(e)?`(${e.signal} === "${o}")`:e===o} ? "left" : "right"`}}if((t+i)%180==0)return r?null:"center";if(wC(e)){const n=i<t&&t<180+i?"===":"!==";return{signal:`${e.signal} ${n} "${o}"`+' ? "left" : "right"'}}return(i<t&&t<180+i)==(e===o)?"left":"right"}function pP(t,e){const n="x"===e?"x2":"y2",r=t.fieldDef(e),i=t.fieldDef(n),o=r?r.title:void 0,a=i?i.title:void 0;return o&&a?AT(o,a):o||(a||(void 0!==o?o:void 0!==a?a:void 0))}class gP extends bR{constructor(t,e){super(t),this.transform=e,this._dependentFields=ZR(this.transform.calculate)}clone(){return new gP(null,CD(this.transform))}static parseAllForSortIndex(t,e){return e.forEachFieldDef((e,n)=>{if(Lz(e)&&_z(e.sort)){const{field:r,timeUnit:i}=e,o=e.sort,a=o.map((t,e)=>`${PC({field:r,timeUnit:i,equal:t})} ? ${e} : `).join("")+o.length;t=new gP(t,{calculate:a,as:mP(e,n,{forAs:!0})})}}),t}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 "+$D(this.transform)}}function mP(t,e,n){return Yz(t,Object.assign({prefix:e,suffix:"sort_index"},null!=n?n:{}))}function bP(t,e){return RD(["top","bottom"],e)?"column":RD(["left","right"],e)||"row"===t?"row":"column"}function yP(t,e,n,r){const i="row"===r?n.headerRow:"column"===r?n.headerColumn:n.headerFacet;return cM((e||{})[t],i[t],n.header[t])}function vP(t,e,n,r){const i={};for(const o of t){const t=yP(o,e||{},n,r);void 0!==t&&(i[o]=t)}return i}const xP=["row","column"],_P=["header","footer"];function OP(t,e){const n=t.component.layoutHeaders[e].title,r=t.config?t.config:void 0,i=t.component.layoutHeaders[e].facetFieldDef?t.component.layoutHeaders[e].facetFieldDef:void 0,{titleAnchor:o,titleAngle:a,titleOrient:s}=vP(["titleAnchor","titleAngle","titleOrient"],i.header,r,e),u=bP(e,s),l=mM(a);return{name:e+"-title",type:"group",role:u+"-title",title:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({text:n},"row"===e?{orient:"left"}:{}),{style:"guide-title"}),jP(l,u)),wP(u,l,o)),CP(r,i,e,s$,o$))}}function wP(t,e,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const r=hP(e,"row"===t?"left":"top","row"===t?"y":"x");return r?{align:r}:{}}function jP(t,e){const n=dP(t,"row"===e?"left":"top","row"===e?"y":"x",!0);return n?{baseline:n}:{}}function kP(t,e){const n=t.component.layoutHeaders[e],r=[];for(const i of _P)if(n[i])for(const o of n[i]){const a=DP(t,e,i,n,o);null!=a&&r.push(a)}return r}function EP(t,e){var n;const{sort:r}=t;return xz(r)?{field:Yz(r,{expr:"datum"}),order:null!==(n=r.order)&&void 0!==n?n:"ascending"}:Object(Z.B)(r)?{field:mP(t,e,{expr:"datum"}),order:"ascending"}:{field:Yz(t,{expr:"datum"}),order:null!=r?r:"ascending"}}function AP(t,e,n){const{format:r,formatType:i,labelAngle:o,labelAnchor:a,labelOrient:s,labelExpr:u}=vP(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],t.header,n,e),l=sz({fieldOrDatumDef:t,format:r,formatType:i,expr:"parent",config:n}).signal,c=bP(e,s);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({text:{signal:u?sM(sM(u,"datum.label",l),"datum.value",Yz(t,{expr:"parent"})):l}},"row"===e?{orient:"left"}:{}),{style:"guide-label",frame:"group"}),jP(o,c)),wP(c,o,a)),CP(n,t,e,u$,a$))}function DP(t,e,n,r,i){if(i){let o=null;const{facetFieldDef:a}=r,s=t.config?t.config:void 0;if(a&&i.labels){const{labelOrient:t}=vP(["labelOrient"],a.header,s,e);("row"===e&&!RD(["top","bottom"],t)||"column"===e&&!RD(["left","right"],t))&&(o=AP(a,e,s))}const u=wL(t)&&!Oz(t.facet),l=i.axes,c=(null==l?void 0:l.length)>0;if(o||c){const s="row"===e?"height":"width";return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:t.getName(`${e}_${n}`),type:"group",role:`${e}-${n}`},r.facetFieldDef?{from:{data:t.getName(e+"_domain")},sort:EP(a,e)}:{}),c&&u?{from:{data:t.getName("facet_domain_"+e)}}:{}),o?{title:o}:{}),i.sizeSignal?{encode:{update:{[s]:i.sizeSignal}}}:{}),c?{axes:l}:{})}}return null}const MP={column:{start:0,end:1},row:{start:1,end:0}};function SP(t,e){return MP[e][t]}function CP(t,e,n,r,i){const o={};for(const a of r){if(!i[a])continue;const r=yP(a,null==e?void 0:e.header,t,n);void 0!==r&&(o[i[a]]=r)}return o}function FP(t){return[...zP(t,"width"),...zP(t,"height"),...zP(t,"childWidth"),...zP(t,"childHeight")]}function zP(t,e){const n="width"===e?"x":"y",r=t.component.layoutSize.get(e);if(!r||"merged"===r)return[];const i=t.getSizeSignalRef(e).signal;if("step"===r){const e=t.getScaleComponent(n);if(e){const r=e.get("type"),o=e.get("range");if(gF(r)&&jC(o)){const r=t.scaleName(n);if(wL(t.parent)){if("independent"===t.parent.component.resolve.scale[n])return[TP(r,o)]}return[TP(r,o),{name:i,update:$P(r,e,`domain('${r}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}if("container"==r){const e=i.endsWith("width"),n=e?"containerSize()[0]":"containerSize()[1]",r=`isFinite(${n}) ? ${n} : ${_$(t.config.view,e?"width":"height")}`;return[{name:i,init:r,on:[{update:r,events:"window:resize"}]}]}return[{name:i,value:r}]}function TP(t,e){return{name:t+"_step",value:e.step}}function $P(t,e,n){const r=e.get("type"),i=e.get("padding"),o=cM(e.get("paddingOuter"),i);let a=e.get("paddingInner");return a="band"===r?void 0!==a?a:i:1,`bandspace(${n}, ${vT(a)}, ${vT(o)}) * ${t}_step`}function NP(t){return"childWidth"===t?"width":"childHeight"===t?"height":t}function RP(t,e){return XD(t).reduce((n,r)=>{const i=t[r];return Object.assign(Object.assign({},n),qN(e,i,r,t=>bT(t.value)))},{})}function PP(t,e){if(kL(e)||wL(e))return"shared";if(jL(e))return hS(t)?"independent":"shared";throw new Error("invalid model type for resolve")}function BP(t,e){const n=t.scale[e],r=hS(e)?"axis":"legend";return"independent"===n?("shared"===t[r][e]&&aC(function(t){return`Setting the scale to be independent for "${t}" means we also have to set the guide (axis or legend) to be independent.`}(e)),"independent"):t[r][e]||"shared"}const LP=Object.assign(Object.assign({},{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}),{disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1}),IP=XD(LP);class UP extends cN{}const qP={symbols:function(t,{fieldOrDatumDef:e,model:n,channel:r,legendCmpt:i,legendType:o}){var a,s,u,l,c,f,d,h;if("symbol"!==o)return;const{markDef:p,encoding:g,config:m,mark:b}=n,y=p.filled&&"trail"!==b;let v=Object.assign(Object.assign({},function(t,e,n){for(const r of n){const n=OT(r,e.markDef,e.config);void 0!==n&&(t[r]=bT(n))}return t}({},n,YF)),KN(n,{filled:y}));const x=null!==(a=i.get("symbolOpacity"))&&void 0!==a?a:m.legend.symbolOpacity,_=null!==(s=i.get("symbolFillColor"))&&void 0!==s?s:m.legend.symbolFillColor,O=null!==(u=i.get("symbolStrokeColor"))&&void 0!==u?u:m.legend.symbolStrokeColor,w=void 0===x?null!==(l=WP(g.opacity))&&void 0!==l?l:p.opacity:void 0;if(v.fill)if("fill"===r||y&&r===LM)delete v.fill;else if(v.fill.field)_?delete v.fill:(v.fill=bT(null!==(c=m.legend.symbolBaseFillColor)&&void 0!==c?c:"black"),v.fillOpacity=bT(null!=w?w:1));else if(Object(Z.B)(v.fill)){const t=null!==(h=null!==(d=YP(null!==(f=g.fill)&&void 0!==f?f:g.color))&&void 0!==d?d:p.fill)&&void 0!==h?h:y&&p.color;t&&(v.fill=bT(t))}if(v.stroke)if("stroke"===r||!y&&r===LM)delete v.stroke;else if(v.stroke.field||O)delete v.stroke;else if(Object(Z.B)(v.stroke)){const t=cM(YP(g.stroke||g.color),p.stroke,y?p.color:void 0);t&&(v.stroke={value:t})}if("opacity"!==r){const t=Fz(e)&&GP(n,i,e);t?v.opacity=[Object.assign({test:t},bT(null!=w?w:1)),bT(m.legend.unselectedOpacity)]:w&&(v.opacity=bT(w))}return v=Object.assign(Object.assign({},v),t),VD(v)?void 0:v},gradient:function(t,{model:e,legendType:n,legendCmpt:r}){var i;if("gradient"!==n)return;const{config:o,markDef:a,encoding:s}=e;let u={};const l=void 0===(null!==(i=r.get("gradientOpacity"))&&void 0!==i?i:o.legend.gradientOpacity)?WP(s.opacity)||a.opacity:void 0;l&&(u.opacity=bT(l));return u=Object.assign(Object.assign({},u),t),VD(u)?void 0:u},labels:function(t,{fieldOrDatumDef:e,model:n,channel:r,legendCmpt:i}){const o=n.legend(r)||{},a=n.config,s=Fz(e)?GP(n,i,e):void 0,u=s?[{test:s,value:1},{value:a.legend.unselectedOpacity}]:void 0,{format:l,formatType:c}=o,f=oz(c)?lz({fieldOrDatumDef:e,field:"datum.value",format:l,formatType:c,config:a}):void 0,d=Object.assign(Object.assign(Object.assign({},u?{opacity:u}:{}),f?{text:f}:{}),t);return VD(d)?void 0:d},entries:function(t,{legendCmpt:e}){const n=e.get("selections");return(null==n?void 0:n.length)?Object.assign(Object.assign({},t),{fill:{value:"transparent"}}):t}};function WP(t){return HP(t,(t,e)=>Math.max(t,e.value))}function YP(t){return HP(t,(t,e)=>cM(t,e.value))}function HP(t,e){return function(t){const e=t&&t.condition;return!!e&&(Object(Z.B)(e)||Bz(e))}(t)?Object(Z.i)(t.condition).reduce(e,t.value):Bz(t)?t.value:void 0}function GP(t,e,n){const r=e.get("selections");if(!(null==r?void 0:r.length))return;const i=Object(Z.ab)(n.field);return r.map(t=>`(!length(data(${Object(Z.ab)(QD(t)+WR)})) || (${t}[${i}] && indexof(${t}[${i}], datum.value) >= 0))`).join(" || ")}const VP={direction:({direction:t})=>t,format:({fieldOrDatumDef:t,legend:e,config:n})=>{const{format:r,formatType:i}=e;return cz(t,t.type,r,i,n,!1)},formatType:({legend:t,fieldOrDatumDef:e,scaleType:n})=>{const{formatType:r}=t;return fz(r,e,n)},gradientLength:t=>{var e,n;const{legend:r,legendConfig:i}=t;return null!==(n=null!==(e=r.gradientLength)&&void 0!==e?e:i.gradientLength)&&void 0!==n?n:function({legendConfig:t,model:e,direction:n,orient:r,scaleType:i}){const{gradientHorizontalMaxLength:o,gradientHorizontalMinLength:a,gradientVerticalMaxLength:s,gradientVerticalMinLength:u}=t;if(bF(i))return"horizontal"===n?"top"===r||"bottom"===r?KP(e,"width",a,o):a:KP(e,"height",u,s);return}(t)},labelOverlap:({legend:t,legendConfig:e,scaleType:n})=>{var r,i;return null!==(i=null!==(r=t.labelOverlap)&&void 0!==r?r:e.labelOverlap)&&void 0!==i?i:function(t){if(RD(["quantile","threshold","log"],t))return"greedy";return}(n)},symbolType:({legend:t,markDef:e,channel:n,encoding:r})=>{var i;return null!==(i=t.symbolType)&&void 0!==i?i:function(t,e,n,r){var i;if("shape"!==e){const t=null!==(i=YP(n))&&void 0!==i?i:r;if(t)return t}switch(t){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"}}(e.type,n,r.shape,e.shape)},title:({fieldOrDatumDef:t,config:e})=>Kz(t,e,{allowDisabling:!0}),type:({legendType:t,scaleType:e,channel:n})=>{if(XM(n)&&bF(e)){if("gradient"===t)return}else if("symbol"===t)return;return t},values:({fieldOrDatumDef:t,legend:e})=>function(t,e){const n=t.values;if(Object(Z.B)(n))return cT(e,n);if(wC(n))return n;return}(e,t)};function XP(t){const{legend:e}=t;return cM(e.type,function({channel:t,timeUnit:e,scaleType:n}){if(XM(t)){if(RD(["quarter","month","day"],e))return"symbol";if(bF(n))return"gradient"}return"symbol"}(t))}function JP({legendConfig:t,legendType:e,orient:n,legend:r}){var i,o;return null!==(o=null!==(i=r.direction)&&void 0!==i?i:t[e?"gradientDirection":"symbolDirection"])&&void 0!==o?o:function(t,e){switch(t){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return"gradient"===e?"horizontal":void 0}}(n,e)}function KP(t,e,n,r){return{signal:`clamp(${t.getSizeSignalRef(e).signal}, ${n}, ${r})`}}function ZP(t){const e=OL(t)?function(t){const{encoding:e}=t,n={};for(const r of[LM,...c$]){const i=nT(e[r]);i&&t.getScaleComponent(r)&&(r===qM&&Fz(i)&&i.type===YC||(n[r]=tB(t,r)))}return n}(t):function(t){const{legends:e,resolve:n}=t.component;for(const r of t.children){ZP(r);for(const i of XD(r.component.legends))n.legend[i]=BP(t.component.resolve,i),"shared"===n.legend[i]&&(e[i]=eB(e[i],r.component.legends[i]),e[i]||(n.legend[i]="independent",delete e[i]))}for(const r of XD(e))for(const e of t.children)e.component.legends[r]&&"shared"===n.legend[r]&&delete e.component.legends[r];return e}(t);return t.component.legends=e,e}function QP(t,e,n,r){switch(e){case"disable":return void 0!==n;case"values":return!!(null==n?void 0:n.values);case"title":if("title"===e&&t===(null==r?void 0:r.title))return!0}return t===(n||{})[e]}function tB(t,e){var n,r,i;let o=t.legend(e);const{markDef:a,encoding:s,config:u}=t,l=u.legend,c=new UP({},function(t,e){const n=t.scaleName(e);if("trail"===t.mark){if("color"===e)return{stroke:n};if("size"===e)return{strokeWidth:n}}return"color"===e?t.markDef.filled?{fill:n}:{stroke:n}:{[e]:n}}(t,e));!function(t,e,n){var r;const i=null===(r=t.fieldDef(e))||void 0===r?void 0:r.field;XR(t,t=>{var r,o;const a=null!==(r=t.project.hasField[i])&&void 0!==r?r:t.project.hasChannel[e];if(a&&AR.has(t)){const e=null!==(o=n.get("selections"))&&void 0!==o?o:[];e.push(t.name),n.set("selections",e,!1),a.hasLegend=!0}})}(t,e,c);const f=void 0!==o?!o:l.disable;if(c.set("disable",f,void 0!==o),f)return c;o=o||{};const d=t.getScaleComponent(e).get("type"),h=nT(s[e]),p=Fz(h)?null===(n=OC(h.timeUnit))||void 0===n?void 0:n.unit:void 0,g=o.orient||u.legend.orient||"right",m=XP({legend:o,channel:e,timeUnit:p,scaleType:d}),b={legend:o,channel:e,model:t,markDef:a,encoding:s,fieldOrDatumDef:h,legendConfig:l,config:u,scaleType:d,orient:g,legendType:m,direction:JP({legend:o,legendType:m,orient:g,legendConfig:l})};for(const n of IP){if("gradient"===m&&n.startsWith("symbol")||"symbol"===m&&n.startsWith("gradient"))continue;const r=n in VP?VP[n](b):o[n];if(void 0!==r){const i=QP(r,n,o,t.fieldDef(e));(i||void 0===u.legend[n])&&c.set(n,r,i)}}const y=null!==(r=null==o?void 0:o.encoding)&&void 0!==r?r:{},v=c.get("selections"),x={},_={fieldOrDatumDef:h,model:t,channel:e,legendCmpt:c,legendType:m};for(const e of["labels","legend","title","symbols","gradient","entries"]){const n=RP(null!==(i=y[e])&&void 0!==i?i:{},t),r=e in qP?qP[e](n,_):n;void 0===r||VD(r)||(x[e]=Object.assign(Object.assign(Object.assign({},(null==v?void 0:v.length)&&Fz(h)?{name:`${QD(h.field)}_legend_${e}`}:{}),(null==v?void 0:v.length)?{interactive:!!v}:{}),{update:r}))}return VD(x)||c.set("encode",x,!!(null==o?void 0:o.encoding)),c}function eB(t,e){var n,r,i,o;if(!t)return e.clone();const a=t.getWithExplicit("orient"),s=e.getWithExplicit("orient");if(a.explicit&&s.explicit&&a.value!==s.value)return;let u=!1;for(const n of IP){const r=gN(t.getWithExplicit(n),e.getWithExplicit(n),n,"legend",(t,e)=>{switch(n){case"symbolType":return nB(t,e);case"title":return DT(t,e);case"type":return u=!0,dN("symbol")}return pN(t,e,n,"legend")});t.setWithExplicit(n,r)}return u&&((null===(r=null===(n=t.implicit)||void 0===n?void 0:n.encode)||void 0===r?void 0:r.gradient)&&eM(t.implicit,["encode","gradient"]),(null===(o=null===(i=t.explicit)||void 0===i?void 0:i.encode)||void 0===o?void 0:o.gradient)&&eM(t.explicit,["encode","gradient"])),t}function nB(t,e){return"circle"===e.value?e:t}function rB(t){const e=t.component.legends,n={};for(const r of XD(e)){const i=t.getScaleComponent(r),o=TD(i.get("domains"));if(n[o])for(const t of n[o]){eB(t,e[r])||n[o].push(e[r])}else n[o]=[e[r].clone()]}return JD(n).flat().map(e=>function(t,e){var n,r,i;const o=t.combine(),{disable:a,labelExpr:s,selections:u}=o,l=bD(o,["disable","labelExpr","selections"]);if(a)return;!1===e.aria&&null==l.aria&&(l.aria=!1);if(null===(n=l.encode)||void 0===n?void 0:n.symbols){const t=l.encode.symbols.update;!t.fill||"transparent"===t.fill.value||t.stroke||l.stroke||(t.stroke={value:"transparent"});for(const e of c$)l[e]&&delete t[e]}l.title||delete l.title;if(void 0!==s){let t=s;(null===(i=null===(r=l.encode)||void 0===r?void 0:r.labels)||void 0===i?void 0:i.update)&&wC(l.encode.labels.update.text)&&(t=sM(s,"datum.label",l.encode.labels.update.text.signal)),function(t,e,n,r){var i,o,a;t.encode=null!==(i=t.encode)&&void 0!==i?i:{},t.encode[e]=null!==(o=t.encode[e])&&void 0!==o?o:{},t.encode[e].update=null!==(a=t.encode[e].update)&&void 0!==a?a:{},t.encode[e].update[n]=r}(l,"labels","text",{signal:t})}return l}(e,t.config)).filter(t=>void 0!==t)}function iB(t){return kL(t)||jL(t)?function(t){return t.children.reduce((t,e)=>t.concat(e.assembleProjections()),oB(t))}(t):oB(t)}function oB(t){const e=t.component.projection;if(!e||e.merged)return[];const n=e.combine(),{name:r}=n;if(e.data){const i={signal:`[${e.size.map(t=>t.signal).join(", ")}]`},o=e.data.reduce((e,n)=>{const r=wC(n)?n.signal:`data('${t.lookupDataSource(n)}')`;return RD(e,r)||e.push(r),e},[]);if(o.length<=0)throw new Error("Projection's fit didn't find any data sources");return[Object.assign({name:r,size:i,fit:{signal:o.length>1?`[${o.join(", ")}]`:o[0]}},n)]}return[Object.assign(Object.assign({name:r},{translate:{signal:"[width / 2, height / 2]"}}),n)]}const aB=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class sB extends cN{constructor(t,e,n,r){super(Object.assign({},e),{name:t}),this.specifiedProjection=e,this.size=n,this.data=r,this.merged=!1}get isFit(){return!!this.data}}function uB(t){t.component.projection=OL(t)?function(t){var e;if(t.hasProjection){const n=t.specifiedProjection,r=!(n&&(null!=n.scale||null!=n.translate)),i=r?[t.getSizeSignalRef("width"),t.getSizeSignalRef("height")]:void 0,o=r?function(t){const e=[],{encoding:n}=t;for(const r of[["longitude","latitude"],["longitude2","latitude2"]])(nT(n[r[0]])||nT(n[r[1]]))&&e.push({signal:t.getName("geojson_"+e.length)});t.channelHasField(qM)&&t.typedFieldDef(qM).type===YC&&e.push({signal:t.getName("geojson_"+e.length)});0===e.length&&e.push(t.requestDataName(jN.Main));return e}(t):void 0;return new sB(t.projectionName(!0),Object.assign(Object.assign({},null!==(e=t.config.projection)&&void 0!==e?e:{}),null!=n?n:{}),i,o)}return}(t):function(t){if(0===t.children.length)return;let e;for(const e of t.children)uB(e);const n=BD(t.children,t=>{const n=t.component.projection;if(n){if(e){const t=function(t,e){const n=BD(aB,n=>!Object(Z.w)(t.explicit,n)&&!Object(Z.w)(e.explicit,n)||!(!Object(Z.w)(t.explicit,n)||!Object(Z.w)(e.explicit,n)||TD(t.get(n))!==TD(e.get(n))));if(TD(t.size)===TD(e.size)){if(n)return t;if(TD(t.explicit)===TD({}))return e;if(TD(e.explicit)===TD({}))return t}return null}(e,n);return t&&(e=t),!!t}return e=n,!0}return!0});if(e&&n){const n=t.projectionName(!0),r=new sB(n,e.specifiedProjection,e.size,CD(e.data));for(const e of t.children){const t=e.component.projection;t&&(t.isFit&&r.data.push(...e.component.projection.data),e.renameProjection(t.get("name"),n),t.merged=!0)}return r}return}(t)}function lB(t,e){return`${ES(t)}_${e}`}function cB(t,e,n){var r;const i=lB(null!==(r=aT(n,void 0))&&void 0!==r?r:{},e);return t.getName(i+"_bins")}function fB(t,e,n){let r,i;r=function(t){return"as"in t}(t)?Object(Z.I)(t.as)?[t.as,t.as+"_end"]:[t.as[0],t.as[1]]:[Yz(t,{forAs:!0}),Yz(t,{binSuffix:"end",forAs:!0})];const o=Object.assign({},aT(e,void 0)),a=lB(o,t.field),{signal:s,extentSignal:u}=function(t,e){return{signal:t.getName(e+"_bins"),extentSignal:t.getName(e+"_extent")}}(n,a);if(SS(o.extent)){const t=o.extent,e=t.selection;i=eP(n.getSelectionComponent(QD(e),e),t),delete o.extent}return{key:a,binComponent:Object.assign(Object.assign(Object.assign({bin:o,field:t.field,as:[r]},s?{signal:s}:{}),u?{extentSignal:u}:{}),i?{span:i}:{})}}class dB extends bR{constructor(t,e){super(t),this.bins=e}clone(){return new dB(null,CD(this.bins))}static makeFromEncoding(t,e){const n=e.reduceFieldDef((t,n,r)=>{if(Pz(n)&&AS(n.bin)){const{key:i,binComponent:o}=fB(n,n.bin,e);t[i]=Object.assign(Object.assign(Object.assign({},o),t[i]),function(t,e,n,r){var i,o;if(fT(e,n)){const a=OL(t)&&null!==(o=null!==(i=t.axis(n))&&void 0!==i?i:t.legend(n))&&void 0!==o?o:{},s=Yz(e,{expr:"datum"}),u=Yz(e,{expr:"datum",binSuffix:"end"});return{formulaAs:Yz(e,{binSuffix:"range",forAs:!0}),formula:gz(s,u,a.format,a.formatType,r)}}return{}}(e,n,r,e.config))}return t},{});return VD(n)?null:new dB(t,n)}static makeFromTransform(t,e,n){const{key:r,binComponent:i}=fB(e,e.bin,n);return new dB(t,{[r]:i})}merge(t,e){for(const n of XD(t.bins))n in this.bins?(e(t.bins[n].signal,this.bins[n].signal),this.bins[n].as=UD([...this.bins[n].as,...t.bins[n].as],$D)):this.bins[n]=t.bins[n];for(const e of t.children)t.removeChild(e),e.parent=this;t.remove()}producedFields(){return new Set(JD(this.bins).map(t=>t.as).flat(2))}dependentFields(){return new Set(JD(this.bins).map(t=>t.field))}hash(){return"Bin "+$D(this.bins)}assemble(){return JD(this.bins).flatMap(t=>{const e=[],[n,...r]=t.as,i=t.bin,{extent:o}=i,a=bD(i,["extent"]),s=Object.assign(Object.assign(Object.assign({type:"bin",field:aM(t.field),as:n,signal:t.signal},SS(o)?{extent:null}:{extent:o}),t.span?{span:{signal:`span(${t.span})`}}:{}),a);!o&&t.extentSignal&&(e.push({type:"extent",field:aM(t.field),signal:t.extentSignal}),s.extent={signal:t.extentSignal}),e.push(s);for(const t of r)for(let r=0;r<2;r++)e.push({type:"formula",expr:Yz({field:n[r]},{expr:"datum"}),as:t[r]});return t.formula&&e.push({type:"formula",expr:t.formula,as:t.formulaAs}),e})}}function hB(t,e,n,r){const i=OL(r)?r.encoding[sS(e)]:void 0;if(Pz(n)&&OL(r)&&Dz(e,n,i,r.stack,r.markDef,r.config))t.add(Yz(n,{})),t.add(Yz(n,{suffix:"end"})),n.bin&&fT(n,e)&&t.add(Yz(n,{binSuffix:"range"}));else if(e in HM){const n=function(t){switch(t){case"latitude":return"y";case"latitude2":return"y2";case"longitude":return"x";case"longitude2":return"x2"}}(e);t.add(r.getName(n))}else t.add(Yz(n));return t}class pB extends bR{constructor(t,e,n){super(t),this.dimensions=e,this.measures=n}clone(){return new pB(null,new Set(this.dimensions),CD(this.measures))}get groupBy(){return this.dimensions}static makeFromEncoding(t,e){let n=!1;e.forEachFieldDef(t=>{t.aggregate&&(n=!0)});const r={},i=new Set;return n?(e.forEachFieldDef((t,n)=>{var o,a,s,u;const{aggregate:l,field:c}=t;if(l)if("count"===l)r["*"]=null!==(o=r["*"])&&void 0!==o?o:{},r["*"].count=new Set([Yz(t,{forAs:!0})]);else{if(DM(l)||MM(l)){const t=DM(l)?"argmin":"argmax",e=l[t];r[e]=null!==(a=r[e])&&void 0!==a?a:{},r[e][t]=new Set([Yz({op:t,field:e},{forAs:!0})])}else r[c]=null!==(s=r[c])&&void 0!==s?s:{},r[c][l]=new Set([Yz(t,{forAs:!0})]);_S(n)&&"unaggregated"===e.scaleDomain(n)&&(r[c]=null!==(u=r[c])&&void 0!==u?u:{},r[c].min=new Set([Yz({field:c,aggregate:"min"},{forAs:!0})]),r[c].max=new Set([Yz({field:c,aggregate:"max"},{forAs:!0})]))}else hB(i,n,t,e)}),i.size+XD(r).length===0?null:new pB(t,i,r)):null}static makeFromTransform(t,e){var n,r,i;const o=new Set,a={};for(const t of e.aggregate){const{op:e,field:i,as:o}=t;e&&("count"===e?(a["*"]=null!==(n=a["*"])&&void 0!==n?n:{},a["*"].count=new Set([o||Yz(t,{forAs:!0})])):(a[i]=null!==(r=a[i])&&void 0!==r?r:{},a[i][e]=new Set([o||Yz(t,{forAs:!0})])))}for(const t of null!==(i=e.groupby)&&void 0!==i?i:[])o.add(t);return o.size+XD(a).length===0?null:new pB(t,o,a)}merge(t){return WD(this.dimensions,t.dimensions)?(function(t,e){var n;for(const r of XD(e)){const i=e[r];for(const e of XD(i))r in t?t[r][e]=new Set([...null!==(n=t[r][e])&&void 0!==n?n:[],...i[e]]):t[r]={[e]:i[e]}}}(this.measures,t.measures),!0):(function(...t){oC.debug(...t)}("different dimensions, cannot merge"),!1)}addDimensions(t){t.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...XD(this.measures)])}producedFields(){const t=new Set;for(const e of XD(this.measures))for(const n of XD(this.measures[e])){const r=this.measures[e][n];0===r.size?t.add(`${n}_${e}`):r.forEach(t.add,t)}return t}hash(){return"Aggregate "+$D({dimensions:this.dimensions,measures:this.measures})}assemble(){const t=[],e=[],n=[];for(const r of XD(this.measures))for(const i of XD(this.measures[r]))for(const o of this.measures[r][i])n.push(o),t.push(i),e.push("*"===r?null:aM(r));return{type:"aggregate",groupby:[...this.dimensions].map(aM),ops:t,fields:e,as:n}}}class gB extends bR{constructor(t,e,n,r){super(t),this.model=e,this.name=n,this.data=r;for(const t of KM){const n=e.facet[t];if(n){const{bin:r,sort:i}=n;this[t]=Object.assign({name:e.getName(t+"_domain"),fields:[Yz(n),...AS(r)?[Yz(n,{binSuffix:"end"})]:[]]},xz(i)?{sortField:i}:Object(Z.B)(i)?{sortIndexField:mP(n,t)}:{})}}this.childModel=e.child}hash(){let t="Facet";for(const e of KM)this[e]&&(t+=` ${e.charAt(0)}:${$D(this[e])}`);return t}get fields(){var t;const e=[];for(const n of KM)(null===(t=this[n])||void 0===t?void 0:t.fields)&&e.push(...this[n].fields);return e}dependentFields(){const t=new Set(this.fields);for(const e of KM)this[e]&&(this[e].sortField&&t.add(this[e].sortField.field),this[e].sortIndexField&&t.add(this[e].sortIndexField));return t}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const t={};for(const e of dS){const n=this.childModel.component.scales[e];if(n&&!n.merged){const r=n.get("type"),i=n.get("range");if(gF(r)&&jC(i)){const n=iL(oL(this.childModel,e));n?t[e]=n:aC(NS(e))}}}return t}assembleRowColumnHeaderData(t,e,n){const r={row:"y",column:"x"}[t],i=[],o=[],a=[];n&&n[r]&&(e?(i.push("distinct_"+n[r]),o.push("max")):(i.push(n[r]),o.push("distinct")),a.push("distinct_"+n[r]));const{sortField:s,sortIndexField:u}=this[t];if(s){const{op:t=mz,field:e}=s;i.push(e),o.push(t),a.push(Yz(s,{forAs:!0}))}else u&&(i.push(u),o.push("max"),a.push(u));return{name:this[t].name,source:null!=e?e:this.data,transform:[Object.assign({type:"aggregate",groupby:this[t].fields},i.length?{fields:i,ops:o,as:a}:{})]}}assembleFacetHeaderData(t){var e,n;const{columns:r}=this.model.layout,{layoutHeaders:i}=this.model.component,o=[],a={};for(const t of xP){for(const r of _P){const o=null!==(e=i[t]&&i[t][r])&&void 0!==e?e:[];for(const e of o)if((null===(n=e.axes)||void 0===n?void 0:n.length)>0){a[t]=!0;break}}if(a[t]){const e=`length(data("${this.facet.name}"))`,n="row"===t?r?{signal:`ceil(${e} / ${r})`}:1:r?{signal:`min(${e}, ${r})`}:{signal:e};o.push({name:`${this.facet.name}_${t}`,transform:[{type:"sequence",start:0,stop:n}]})}}const{row:s,column:u}=a;return(s||u)&&o.unshift(this.assembleRowColumnHeaderData("facet",null,t)),o}assemble(){var t,e;const n=[];let r=null;const i=this.getChildIndependentFieldsWithStep(),{column:o,row:a,facet:s}=this;if(o&&a&&(i.x||i.y)){r=`cross_${this.column.name}_${this.row.name}`;const o=[].concat(null!==(t=i.x)&&void 0!==t?t:[],null!==(e=i.y)&&void 0!==e?e:[]),a=o.map(()=>"distinct");n.push({name:r,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:o,ops:a}]})}for(const t of[NM,$M])this[t]&&n.push(this.assembleRowColumnHeaderData(t,r,i));if(s){const t=this.assembleFacetHeaderData(i);t&&n.push(...t)}return n}}function mB(t){return"'"===t[0]&&"'"===t[t.length-1]||'"'===t[0]&&'"'===t[t.length-1]?t.slice(1,-1):t}function bB(t){const e={};return function t(e,n){if(DD(e))t(e.not,n);else if(AD(e))for(const r of e.and)t(r,n);else if(ED(e))for(const r of e.or)t(r,n);else n(e)}(t.filter,t=>{var n;if(NC(t)){let r=null;MC(t)?r=gT(t.equal):CC(t)?r=gT(t.lte):SC(t)?r=gT(t.lt):FC(t)?r=gT(t.gt):zC(t)?r=gT(t.gte):TC(t)?r=t.range[0]:$C(t)&&(r=(null!==(n=t.oneOf)&&void 0!==n?n:t.in)[0]),r&&(sC(r)?e[t.field]="date":Object(Z.F)(r)?e[t.field]="number":Object(Z.I)(r)&&(e[t.field]="string")),t.timeUnit&&(e[t.field]="date")}}),e}function yB(t){const e={};function n(t){var n;uT(t)?e[t.field]="date":"quantitative"===t.type&&(n=t.aggregate,Object(Z.I)(n)&&RD(["min","max"],n))?e[t.field]="number":lM(t.field)>1?t.field in e||(e[t.field]="flatten"):Lz(t)&&xz(t.sort)&&lM(t.sort.field)>1&&(t.sort.field in e||(e[t.sort.field]="flatten"))}if((OL(t)||wL(t))&&t.forEachFieldDef((e,r)=>{if(Pz(e))n(e);else{const i=oS(r),o=t.fieldDef(i);n(Object.assign(Object.assign({},e),{type:o.type}))}}),OL(t)){const{mark:n,markDef:r,encoding:i}=t;if(IF(n)&&!t.encoding.order){const t=i["horizontal"===r.orient?"y":"x"];Fz(t)&&"quantitative"===t.type&&!(t.field in e)&&(e[t.field]="number")}}return e}class vB extends bR{constructor(t,e){super(t),this._parse=e}clone(){return new vB(null,CD(this._parse))}hash(){return"Parse "+$D(this._parse)}static makeExplicit(t,e,n){let r={};const i=e.data;return!xN(i)&&i&&i.format&&i.format.parse&&(r=i.format.parse),this.makeWithAncestors(t,r,{},n)}static makeWithAncestors(t,e,n,r){for(const t of XD(n)){const e=r.getWithExplicit(t);void 0!==e.value&&(e.explicit||e.value===n[t]||"derived"===e.value||"flatten"===n[t]?delete n[t]:aC(IS(t,n[t],e.value)))}for(const t of XD(e)){const n=r.get(t);void 0!==n&&(n===e[t]?delete e[t]:aC(IS(t,e[t],n)))}const i=new cN(e,n);r.copyAll(i);const o={};for(const t of XD(i.combine())){const e=i.get(t);null!==e&&(o[t]=e)}return 0===XD(o).length||r.parseNothing?null:new vB(t,o)}get parse(){return this._parse}merge(t){this._parse=Object.assign(Object.assign({},this._parse),t.parse),t.remove()}assembleFormatParse(){const t={};for(const e of XD(this._parse)){const n=this._parse[e];1===lM(e)&&(t[e]=n)}return t}producedFields(){return new Set(XD(this._parse))}dependentFields(){return new Set(XD(this._parse))}assembleTransforms(t=!1){return XD(this._parse).filter(e=>!t||lM(e)>1).map(t=>{const e=function(t,e){const n=rM(t);if("number"===e)return`toNumber(${n})`;if("boolean"===e)return`toBoolean(${n})`;if("string"===e)return`toString(${n})`;if("date"===e)return`toDate(${n})`;if("flatten"===e)return n;if(0===e.indexOf("date:")){return`timeParse(${n},'${mB(e.slice(5,e.length))}')`}if(0===e.indexOf("utc:")){return`utcParse(${n},'${mB(e.slice(4,e.length))}')`}return aC(`Unrecognized parse "${e}".`),null}(t,this._parse[t]);if(!e)return null;return{type:"formula",expr:e,as:uM(t)}}).filter(t=>null!==t)}}class xB extends bR{clone(){return new xB(null)}constructor(t){super(t)}dependentFields(){return new Set}producedFields(){return new Set(["_vgsid_"])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:"_vgsid_"}}}class _B extends bR{constructor(t,e){super(t),this.params=e}clone(){return new _B(null,this.params)}dependentFields(){return new Set}producedFields(){}hash(){return"Graticule "+$D(this.params)}assemble(){return Object.assign({type:"graticule"},!0===this.params?{}:this.params)}}class OB extends bR{constructor(t,e){super(t),this.params=e}clone(){return new OB(null,this.params)}dependentFields(){return new Set}producedFields(){var t;return new Set([null!==(t=this.params.as)&&void 0!==t?t:"data"])}hash(){return"Hash "+$D(this.params)}assemble(){return Object.assign({type:"sequence"},this.params)}}class wB extends bR{constructor(t){let e;if(super(null),xN(t=null!=t?t:{name:"source"})||(e=t.format?Object.assign({},zD(t.format,["parse"])):{}),yN(t))this._data={values:t.values};else if(bN(t)){if(this._data={url:t.url},!e.type){let n=/(?:\.([^.]+))?$/.exec(t.url)[1];RD(["json","csv","tsv","dsv","topojson"],n)||(n="json"),e.type=n}}else ON(t)?this._data={values:[{type:"Sphere"}]}:(vN(t)||xN(t))&&(this._data={});this._generator=xN(t),t.name&&(this._name=t.name),e&&!VD(e)&&(this._data.format=e)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(t){this._name=t}set parent(t){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 jB;function kB(t){return t instanceof wB||t instanceof _B||t instanceof OB}class EB{constructor(){jB.set(this,void 0),yD(this,jB,!1)}setModified(){yD(this,jB,!0)}get modifiedFlag(){return function(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}(this,jB)}}jB=new WeakMap;class AB extends EB{getNodeDepths(t,e,n){n.set(t,e);for(const r of t.children)this.getNodeDepths(r,e+1,n);return n}optimize(t){const e=[...this.getNodeDepths(t,0,new Map).entries()].sort((t,e)=>e[1]-t[1]);for(const t of e)this.run(t[0]);return this.modifiedFlag}}class DB extends EB{optimize(t){this.run(t);for(const e of t.children)this.optimize(e);return this.modifiedFlag}}class MB extends DB{mergeNodes(t,e){const n=e.shift();for(const r of e)t.removeChild(r),r.parent=n,r.remove()}run(t){const e=t.children.map(t=>t.hash()),n={};for(let r=0;r<e.length;r++)void 0===n[e[r]]?n[e[r]]=[t.children[r]]:n[e[r]].push(t.children[r]);for(const e of XD(n))n[e].length>1&&(this.setModified(),this.mergeNodes(t,n[e]))}}class SB extends DB{constructor(t){super(),this.requiresSelectionId=t&&KR(t)}run(t){t instanceof xB&&(this.requiresSelectionId&&(kB(t.parent)||t.parent instanceof pB||t.parent instanceof vB)||(this.setModified(),t.remove()))}}class CB extends EB{optimize(t){return this.run(t,new Set),this.modifiedFlag}run(t,e){let n=new Set;t instanceof vR&&(n=t.producedFields(),YD(n,e)&&(this.setModified(),t.removeFormulas(e),0===t.producedFields.length&&t.remove()));for(const r of t.children)this.run(r,new Set([...e,...n]))}}class FB extends DB{constructor(){super()}run(t){t instanceof yR&&!t.isRequired()&&(this.setModified(),t.remove())}}class zB extends AB{run(t){if(!(kB(t)||t.numChildren()>1))for(const e of t.children)if(e instanceof vB)if(t instanceof vB)this.setModified(),t.merge(e);else{if(GD(t.producedFields(),e.dependentFields()))continue;this.setModified(),e.swapWithParent()}}}class TB extends AB{run(t){const e=[...t.children],n=t.children.filter(t=>t instanceof vB);if(t.numChildren()>1&&n.length>=1){const r={},i=new Set;for(const t of n){const e=t.parse;for(const t of XD(e))t in r?r[t]!==e[t]&&i.add(t):r[t]=e[t]}for(const t of i)delete r[t];if(!VD(r)){this.setModified();const n=new vB(t,r);for(const i of e){if(i instanceof vB)for(const t of XD(r))delete i.parse[t];t.removeChild(i),i.parent=n,i instanceof vB&&0===XD(i.parse).length&&i.remove()}}}}}class $B extends AB{run(t){t instanceof yR||t.numChildren()>0||t instanceof gB||(this.setModified(),t.remove())}}class NB extends AB{run(t){const e=t.children.filter(t=>t instanceof vR),n=e.pop();for(const t of e)this.setModified(),n.merge(t)}}class RB extends AB{run(t){const e=t.children.filter(t=>t instanceof pB),n={};for(const t of e){const e=$D(t.groupBy);e in n||(n[e]=[]),n[e].push(t)}for(const e of XD(n)){const r=n[e];if(r.length>1){const e=r.pop();for(const n of r)e.merge(n)&&(t.removeChild(n),n.parent=e,n.remove(),this.setModified())}}}}class PB extends AB{constructor(t){super(),this.model=t}run(t){const e=!(kB(t)||t instanceof QR||t instanceof vB||t instanceof xB),n=[],r=[];for(const i of t.children)i instanceof dB&&(e&&!GD(t.producedFields(),i.dependentFields())?n.push(i):r.push(i));if(n.length>0){const e=n.pop();for(const t of n)e.merge(t,this.model.renameSignal.bind(this.model));this.setModified(),t instanceof dB?t.merge(e,this.model.renameSignal.bind(this.model)):e.swapWithParent()}if(r.length>1){const t=r.pop();for(const e of r)t.merge(e,this.model.renameSignal.bind(this.model));this.setModified()}}}class BB extends AB{run(t){const e=[...t.children];if(!PD(e,t=>t instanceof yR)||t.numChildren()<=1)return;const n=[];let r;for(const i of e)if(i instanceof yR){let e=i;for(;1===e.numChildren();){const[t]=e.children;if(!(t instanceof yR))break;e=t}n.push(...e.children),r?(t.removeChild(i),i.parent=r.parent,r.parent.removeChild(r),r.parent=e,this.setModified()):r=e}else n.push(i);if(n.length){this.setModified();for(const t of n)t.parent.removeChild(t),t.parent=r}}}class LB extends bR{constructor(t,e){super(t),this.transform=e}clone(){return new LB(null,CD(this.transform))}addDimensions(t){this.transform.groupby=UD(this.transform.groupby.concat(t),t=>t)}dependentFields(){const t=new Set;return this.transform.groupby&&this.transform.groupby.forEach(t.add,t),this.transform.joinaggregate.map(t=>t.field).filter(t=>void 0!==t).forEach(t.add,t),t}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(t){var e;return null!==(e=t.as)&&void 0!==e?e:Yz(t)}hash(){return"JoinAggregateTransform "+$D(this.transform)}assemble(){const t=[],e=[],n=[];for(const r of this.transform.joinaggregate)e.push(r.op),n.push(this.getDefaultName(r)),t.push(void 0===r.field?null:r.field);const r=this.transform.groupby;return Object.assign({type:"joinaggregate",as:n,ops:e,fields:t},void 0!==r?{groupby:r}:{})}}class IB extends bR{constructor(t,e){super(t),this._stack=e}clone(){return new IB(null,CD(this._stack))}static makeFromTransform(t,e){const{stack:n,groupby:r,as:i,offset:o="zero"}=e,a=[],s=[];if(void 0!==e.sort)for(const t of e.sort)a.push(t.field),s.push(cM(t.order,"ascending"));const u={field:a,order:s};let l;return l=function(t){return Object(Z.B)(t)&&t.every(t=>Object(Z.I)(t))&&t.length>1}(i)?i:Object(Z.I)(i)?[i,i+"_end"]:[e.stack+"_start",e.stack+"_end"],new IB(t,{stackField:n,groupby:r,offset:o,sort:u,facetby:[],as:l})}static makeFromEncoding(t,e){const n=e.stack,{encoding:r}=e;if(!n)return null;const{groupbyChannel:i,fieldChannel:o,offset:a,impute:s}=n;let u;if(i){u=eT(r[i])}const l=function(t){return t.stack.stackBy.reduce((t,e)=>{const n=Yz(e.fieldDef);return n&&t.push(n),t},[])}(e),c=e.encoding.order;let f;return f=Object(Z.B)(c)||Fz(c)?kT(c):l.reduce((t,e)=>(t.field.push(e),t.order.push("y"===o?"descending":"ascending"),t),{field:[],order:[]}),new IB(t,{dimensionFieldDef:u,stackField:e.vgField(o),facetby:[],stackby:l,sort:f,offset:a,impute:s,as:[e.vgField(o,{suffix:"start",forAs:!0}),e.vgField(o,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(t){this._stack.facetby.push(...t)}dependentFields(){const t=new Set;return t.add(this._stack.stackField),this.getGroupbyFields().forEach(t.add,t),this._stack.facetby.forEach(t.add,t),this._stack.sort.field.forEach(t.add,t),t}producedFields(){return new Set(this._stack.as)}hash(){return"Stack "+$D(this._stack)}getGroupbyFields(){const{dimensionFieldDef:t,impute:e,groupby:n}=this._stack;return t?t.bin?e?[Yz(t,{binSuffix:"mid"})]:[Yz(t,{}),Yz(t,{binSuffix:"end"})]:[Yz(t)]:null!=n?n:[]}assemble(){const t=[],{facetby:e,dimensionFieldDef:n,stackField:r,stackby:i,sort:o,offset:a,impute:s,as:u}=this._stack;if(s&&n){const{band:o=.5,bin:a}=n;a&&t.push({type:"formula",expr:o+"*"+Yz(n,{expr:"datum"})+`+${1-o}*`+Yz(n,{expr:"datum",binSuffix:"end"}),as:Yz(n,{binSuffix:"mid",forAs:!0})}),t.push({type:"impute",field:r,groupby:[...i,...e],key:Yz(n,{binSuffix:"mid"}),method:"value",value:0})}return t.push({type:"stack",groupby:[...this.getGroupbyFields(),...e],field:r,sort:o,as:u,offset:a}),t}}class UB extends bR{constructor(t,e){super(t),this.transform=e}clone(){return new UB(null,CD(this.transform))}addDimensions(t){this.transform.groupby=UD(this.transform.groupby.concat(t),t=>t)}dependentFields(){var t,e;const n=new Set;return(null!==(t=this.transform.groupby)&&void 0!==t?t:[]).forEach(n.add,n),(null!==(e=this.transform.sort)&&void 0!==e?e:[]).forEach(t=>n.add(t.field)),this.transform.window.map(t=>t.field).filter(t=>void 0!==t).forEach(n.add,n),n}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(t){var e;return null!==(e=t.as)&&void 0!==e?e:Yz(t)}hash(){return"WindowTransform "+$D(this.transform)}assemble(){var t;const e=[],n=[],r=[],i=[];for(const t of this.transform.window)n.push(t.op),r.push(this.getDefaultName(t)),i.push(void 0===t.param?null:t.param),e.push(void 0===t.field?null:t.field);const o=this.transform.frame,a=this.transform.groupby;if(o&&null===o[0]&&null===o[1]&&n.every(t=>SM(t)))return Object.assign({type:"joinaggregate",as:r,ops:n,fields:e},void 0!==a?{groupby:a}:{});const s=[],u=[];if(void 0!==this.transform.sort)for(const e of this.transform.sort)s.push(e.field),u.push(null!==(t=e.order)&&void 0!==t?t:"ascending");const l={field:s,order:u},c=this.transform.ignorePeers;return Object.assign(Object.assign(Object.assign({type:"window",params:i,as:r,ops:n,fields:e,sort:l},void 0!==c?{ignorePeers:c}:{}),void 0!==a?{groupby:a}:{}),void 0!==o?{frame:o}:{})}}function qB(t){if(t instanceof gB)if(1!==t.numChildren()||t.children[0]instanceof yR){const n=t.model.component.data.main;!function t(e){if(e instanceof yR&&e.type===jN.Main&&1===e.numChildren()){const n=e.children[0];n instanceof gB||(n.swapWithParent(),t(e))}}(n);const r=(e=t,function t(n){if(!(n instanceof gB)){const r=n.clone();if(r instanceof yR){const t=WB+r.getSource();r.setSource(t),e.model.component.data.outputNodes[t]=r}else(r instanceof pB||r instanceof IB||r instanceof UB||r instanceof LB)&&r.addDimensions(e.fields);for(const e of n.children.flatMap(t))e.parent=r;return[r]}return n.children.flatMap(t)}),i=t.children.map(r).flat();for(const t of i)t.parent=n}else{const e=t.children[0];(e instanceof pB||e instanceof IB||e instanceof UB||e instanceof LB)&&e.addDimensions(t.fields),e.swapWithParent(),qB(t)}else t.children.map(qB);var e}const WB="scale_";function YB(t){for(const e of t){for(const t of e.children)if(t.parent!==e)return!1;if(!YB(e.children))return!1}return!0}function HB(t,e){let n=!1;for(const r of e)n=t.optimize(r)||n;return n}function GB(t,e,n){let r=t.sources,i=!1;return i=HB(new FB,r)||i,i=HB(new SB(e),r)||i,r=r.filter(t=>t.numChildren()>0),i=HB(new $B,r)||i,r=r.filter(t=>t.numChildren()>0),n||(i=HB(new zB,r)||i,i=HB(new PB(e),r)||i,i=HB(new CB,r)||i,i=HB(new TB,r)||i,i=HB(new RB,r)||i,i=HB(new NB,r)||i,i=HB(new MB,r)||i,i=HB(new BB,r)||i),t.sources=r,i}class VB{constructor(t){Object.defineProperty(this,"signal",{enumerable:!0,get:t})}static fromName(t,e){return new VB(()=>t(e))}}function XB(t){OL(t)?function(t){const e=t.component.scales;for(const n of XD(e)){const r=JB(t,n);if(e[n].setWithExplicit("domains",r),tL(t,n),t.component.data.isFaceted){let e=t;for(;!wL(e)&&e.parent;)e=e.parent;if("shared"===e.component.resolve.scale[n])for(const t of r.value)kC(t)&&(t.data=WB+t.data.replace(WB,""))}}}(t):function(t){for(const e of t.children)XB(e);const e=t.component.scales;for(const n of XD(e)){let r,i=null;for(const e of t.children){const t=e.component.scales[n];if(t){r=void 0===r?t.getWithExplicit("domains"):gN(r,t.getWithExplicit("domains"),"domains","scale",nL);const e=t.get("selectionExtent");i&&e&&i.selection!==e.selection&&aC("The same selection must be used to override scale domains in a layered view."),i=e}}e[n].setWithExplicit("domains",r),i&&e[n].set("selectionExtent",i,!0)}}(t)}function JB(t,e){const n=t.getScaleComponent(e).get("type"),{encoding:r}=t,i=function(t,e,n,r){if("unaggregated"===t){const{valid:t,reason:r}=eL(e,n);if(!t)return void aC(r)}else if(void 0===t&&r.useUnaggregatedDomain){const{valid:t}=eL(e,n);if(t)return"unaggregated"}return t}(t.scaleDomain(e),t.typedFieldDef(e),n,t.config.scale);return i!==t.scaleDomain(e)&&(t.specifiedScales[e]=Object.assign(Object.assign({},t.specifiedScales[e]),{domain:i})),"x"===e&&nT(r.x2)?nT(r.x)?gN(ZB(n,i,t,"x"),ZB(n,i,t,"x2"),"domain","scale",nL):ZB(n,i,t,"x2"):"y"===e&&nT(r.y2)?nT(r.y)?gN(ZB(n,i,t,"y"),ZB(n,i,t,"y2"),"domain","scale",nL):ZB(n,i,t,"y2"):ZB(n,i,t,e)}function KB(t,e,n){var r;const i=null===(r=OC(n))||void 0===r?void 0:r.unit;return"temporal"===e||i?function(t,e,n){return t.map(t=>({signal:`{data: ${lT(t,{timeUnit:n,type:e})}}`}))}(t,e,i):[t]}function ZB(t,e,n,r){const{encoding:i}=n,o=nT(i[r]),{type:a}=o,s=o.timeUnit;if(function(t){return t&&t.unionWith}(e)){const i=ZB(t,void 0,n,r),o=KB(e.unionWith,a,s);return fN([...i.value,...o])}if(wC(e))return fN([e]);if(e&&"unaggregated"!==e&&!vF(e))return fN(KB(e,a,s));const u=n.stack;if(u&&r===u.fieldChannel){if("normalize"===u.offset)return dN([[0,1]]);const t=n.requestDataName(jN.Main);return dN([{data:t,field:n.vgField(r,{suffix:"start"})},{data:t,field:n.vgField(r,{suffix:"end"})}])}const l=_S(r)&&Fz(o)?function(t,e,n){if(!gF(n))return;const r=t.fieldDef(e),i=r.sort;if(_z(i))return{op:"min",field:mP(r,e),order:"ascending"};const{stack:o}=t,a=o?[...o.groupbyField?[o.groupbyField]:[],...o.stackBy.map(t=>t.fieldDef.field)]:void 0;if(xz(i)){const t=o&&!RD(a,i.field);return QB(i,t)}if(vz(i)){const{encoding:e,order:n}=i,r=t.fieldDef(e),{aggregate:s,field:u}=r,l=o&&!RD(a,u);if(DM(s)||MM(s))return QB({field:Yz(r),order:n},l);if(SM(s)||!s)return QB({op:s,field:u,order:n},l)}else{if("descending"===i)return{op:"min",field:t.vgField(e),order:"descending"};if(RD(["ascending",void 0],i))return!0}return}(n,r,t):void 0;if(Tz(o)){return dN(KB([o.datum],a,s))}const c=o;if("unaggregated"===e){const t=n.requestDataName(jN.Main),{field:e}=o;return dN([{data:t,field:Yz({field:e,aggregate:"min"})},{data:t,field:Yz({field:e,aggregate:"max"})}])}if(AS(c.bin)){if(gF(t))return dN("bin-ordinal"===t?[]:[{data:ZD(l)?n.requestDataName(jN.Main):n.requestDataName(jN.Raw),field:n.vgField(r,fT(c,r)?{binSuffix:"range"}:{}),sort:!0!==l&&Object(Z.G)(l)?l:{field:n.vgField(r,{}),op:"min"}}]);{const{bin:t}=c;if(AS(t)){const e=cB(n,c.field,t);return dN([new VB(()=>{const t=n.getSignalName(e);return`[${t}.start, ${t}.stop]`})])}return dN([{data:n.requestDataName(jN.Main),field:n.vgField(r,{})}])}}if(c.timeUnit&&RD(["time","utc"],t)&&Dz(r,c,OL(n)?n.encoding[sS(r)]:void 0,n.stack,n.markDef,n.config)){const t=n.requestDataName(jN.Main);return dN([{data:t,field:n.vgField(r)},{data:t,field:n.vgField(r,{suffix:"end"})}])}return dN(l?[{data:ZD(l)?n.requestDataName(jN.Main):n.requestDataName(jN.Raw),field:n.vgField(r),sort:l}]:[{data:n.requestDataName(jN.Main),field:n.vgField(r)}])}function QB(t,e){const{op:n,field:r,order:i}=t;return Object.assign(Object.assign({op:null!=n?n:e?"sum":mz},r?{field:aM(r)}:{}),i?{order:i}:{})}function tL(t,e){var n;const r=t.component.scales[e],i=t.specifiedScales[e].domain,o=null===(n=t.fieldDef(e))||void 0===n?void 0:n.bin,a=vF(i)&&i,s=MS(o)&&SS(o.extent)&&o.extent;(a||s)&&r.set("selectionExtent",null!=a?a:s,!0)}function eL(t,e){const{aggregate:n,type:r}=t;return n?Object(Z.I)(n)&&!TM[n]?{valid:!1,reason:JS(n)}:"quantitative"===r&&"log"===e?{valid:!1,reason:KS(t)}:{valid:!0}:{valid:!1,reason:XS(t)}}function nL(t,e,n,r){return t.explicit&&e.explicit&&aC(function(t,e,n,r){return`Conflicting ${e.toString()} property "${t.toString()}" (${TD(n)} and ${TD(r)}). Using the union of the two domains.`}(n,r,t.value,e.value)),{explicit:t.explicit,value:[...t.value,...e.value]}}function rL(t){const e=UD(t.map(t=>{if(kC(t)){return bD(t,["sort"])}return t}),$D),n=UD(t.map(t=>{if(kC(t)){const e=t.sort;return void 0===e||ZD(e)||("op"in e&&"count"===e.op&&delete e.field,"ascending"===e.order&&delete e.order),e}}).filter(t=>void 0!==t),$D);if(0===e.length)return;if(1===e.length){const e=t[0];if(kC(e)&&n.length>0){let t=n[0];if(n.length>1)aC(tC),t=!0;else if(Object(Z.G)(t)&&"field"in t){const n=t.field;e.field===n&&(t=!t.order||{order:t.order})}return Object.assign(Object.assign({},e),{sort:t})}return e}const r=UD(n.map(t=>ZD(t)||!("op"in t)||Object(Z.I)(t.op)&&t.op in AM?t:(aC(function(t){return`Dropping sort property ${TD(t)} as unioned domains only support boolean or op "count", "min", and "max".`}(t)),!0)),$D);let i;1===r.length?i=r[0]:r.length>1&&(aC(tC),i=!0);const o=UD(t.map(t=>kC(t)?t.data:null),t=>t);if(1===o.length&&null!==o[0]){return Object.assign({data:o[0],fields:e.map(t=>t.field)},i?{sort:i}:{})}return Object.assign({fields:e},i?{sort:i}:{})}function iL(t){if(kC(t)&&Object(Z.I)(t.field))return t.field;if(function(t){return!Object(Z.B)(t)&&("fields"in t&&!("data"in t))}(t)){let e;for(const n of t.fields)if(kC(n)&&Object(Z.I)(n.field))if(e){if(e!==n.field)return aC("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."),e}else e=n.field;return aC("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."),e}if(function(t){return!Object(Z.B)(t)&&("fields"in t&&"data"in t)}(t)){aC("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 e=t.fields[0];return Object(Z.I)(e)?e:void 0}}function oL(t,e){return rL(t.component.scales[e].get("domains").map(e=>(kC(e)&&(e.data=t.lookupDataSource(e.data)),e)))}function aL(t){return XD(t.component.scales).reduce((e,n)=>{const r=t.component.scales[n];if(r.merged)return e;const i=r.combine(),{name:o,type:a,selectionExtent:s,domains:u,range:l,reverse:c}=i,f=bD(i,["name","type","selectionExtent","domains","range","reverse"]),d=function(t,e,n,r){if(hS(n)){if(jC(t))return{step:{signal:e+"_step"}}}else if(Object(Z.G)(t)&&kC(t))return Object.assign(Object.assign({},t),{data:r.lookupDataSource(t.data)});return t}(i.range,o,n,t);let h;s&&(h=function(t,e){const n=e.selection;return{signal:eP(t.getSelectionComponent(n,QD(n)),e)}}(t,s));const p=oL(t,n);return e.push(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:o,type:a},p?{domain:p}:{}),h?{domainRaw:h}:{}),{range:d}),void 0!==c?{reverse:c}:{}),f)),e},[])}class sL extends cN{constructor(t,e){super({},{name:t}),this.merged=!1,this.setWithExplicit("type",e)}domainDefinitelyIncludesZero(){return!1!==this.get("zero")||PD(this.get("domains"),t=>Object(Z.B)(t)&&2===t.length&&t[0]<=0&&t[1]>=0)}}const uL=["range","scheme"];function lL(t){return"x"===t?"width":"y"===t?"height":void 0}function cL(t,e){const n=t.fieldDef(e);if(n&&n.bin&&AS(n.bin)){const r=cB(t,n.field,n.bin),i=lL(e),o=t.getName(i);return new VB(()=>{const e=t.getSignalName(r),n=`(${e}.stop - ${e}.start) / ${e}.step`;return`${t.getSignalName(o)} / (${n})`})}}function fL(t,e){const n=e.specifiedScales[t],{size:r}=e,i=e.getScaleComponent(t).get("type");for(const r of uL)if(void 0!==n[r]){const o=OF(i,r),a=wF(t,r);if(o)if(a)aC(a);else switch(r){case"range":{const r=n.range;if(Object(Z.B)(r)){if(hS(t))return fN(r.map(t=>{if("width"===t||"height"===t){const n=e.getName(t),r=e.getSignalName.bind(e);return VB.fromName(r,n)}return t}))}else if(Object(Z.G)(r))return fN({data:e.requestDataName(jN.Main),field:r.field,sort:{op:"min",field:e.vgField(t)}});return fN(r)}case"scheme":return fN(dL(n[r]))}else aC(ZS(i,r,t))}if("x"===t||"y"===t){const e="x"===t?"width":"height",n=r[e];if(y$(n)){if(gF(i))return fN({step:n.step});aC(QS(e))}}const{rangeMin:o,rangeMax:a}=n,s=function(t,e){const{size:n,config:r,mark:i,encoding:o}=e,a=e.getSignalName.bind(e),{type:s}=nT(o[t]),u=e.getScaleComponent(t).get("type"),{domain:l,domainMid:c}=e.specifiedScales[t];switch(t){case"x":case"y":{if(RD(["point","band"],u))if("x"!==t||n.width){if("y"===t&&!n.height){const t=w$(r.view,"height");if(y$(t))return t}}else{const t=w$(r.view,"width");if(y$(t))return t}const i=lL(t),o=e.getName(i);return"y"===t&&mF(u)?[VB.fromName(a,o),0]:[0,VB.fromName(a,o)]}case"size":{const o=e.component.scales[t].get("zero"),a=function t(e,n,r){if(n)return wC(n)?{signal:`${n.signal} ? 0 : ${t(e,!1,r)}`}:0;switch(e){case"bar":case"tick":return r.scale.minBandSize;case"line":case"trail":case"rule":return r.scale.minStrokeWidth;case"text":return r.scale.minFontSize;case"point":case"square":case"circle":return r.scale.minSize}throw new Error(HS("size",e))}(i,o,r),s=function(t,e,n,r){const i={x:cL(n,"x"),y:cL(n,"y")};switch(t){case"bar":case"tick":{if(void 0!==r.scale.maxBandSize)return r.scale.maxBandSize;const t=hL(e,i,r.view);return Object(Z.F)(t)?t-1:new VB(()=>t.signal+" - 1")}case"line":case"trail":case"rule":return r.scale.maxStrokeWidth;case"text":return r.scale.maxFontSize;case"point":case"square":case"circle":{if(r.scale.maxSize)return r.scale.maxSize;const t=hL(e,i,r.view);return Object(Z.F)(t)?Math.pow(.95*t,2):new VB(()=>`pow(0.95 * ${t.signal}, 2)`)}}throw new Error(HS("size",t))}(i,n,e,r);return yF(u)?function(t,e,n){const r=()=>{const r=vT(e),i=vT(t),o=`(${r} - ${i}) / (${n} - 1)`;return`sequence(${i}, ${r} + ${o}, ${o})`};return wC(e)?new VB(r):{signal:r()}}(a,s,function(t,e,n,r){switch(t){case"quantile":return e.scale.quantileCount;case"quantize":return e.scale.quantizeCount;case"threshold":return void 0!==n&&Object(Z.B)(n)?n.length+1:(aC(function(t){return`Domain for ${t} is required for threshold scale.`}(r)),3)}}(u,r,l,t)):[a,s]}case PM:return[0,2*Math.PI];case"angle":return[0,360];case RM:return[0,new VB(()=>`min(${e.getSignalName("width")},${e.getSignalName("height")})/2`)];case"strokeWidth":return[r.scale.minStrokeWidth,r.scale.maxStrokeWidth];case"strokeDash":return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case qM:return"symbol";case LM:case IM:case UM:return"ordinal"===u?"nominal"===s?"category":"ordinal":void 0!==c?"diverging":"rect"===i||"geoshape"===i?"heatmap":"ramp";case"opacity":case"fillOpacity":case"strokeOpacity":return[r.scale.minOpacity,r.scale.maxOpacity]}throw new Error("Scale range undefined for channel "+t)}(t,e);return(void 0!==o||void 0!==a)&&OF(i,"rangeMin")&&Object(Z.B)(s)&&2===s.length?fN([null!=o?o:s[0],null!=a?a:s[1]]):dN(s)}function dL(t){return function(t){return!Object(Z.I)(t)&&!!t.name}(t)?Object.assign({scheme:t.name},zD(t,["name"])):{scheme:t}}function hL(t,e,n){const r=y$(t.width)?t.width.step:O$(n,"width"),i=y$(t.height)?t.height.step:O$(n,"height");return e.x||e.y?new VB(()=>`min(${[e.x?e.x.signal:r,e.y?e.y.signal:i].join(", ")})`):Math.min(r,i)}function pL(t,e){OL(t)?function(t,e){const n=t.component.scales,{config:r,encoding:i,markDef:o,specifiedScales:a}=t;for(const s of XD(n)){const u=a[s],l=n[s],c=t.getScaleComponent(s),f=nT(i[s]),d=u[e],h=c.get("type"),p=c.get("padding"),g=c.get("paddingInner"),m=OF(h,e),b=wF(s,e);if(void 0!==d&&(m?b&&aC(b):aC(ZS(h,e,s))),m&&void 0===b)if(void 0!==d){const t=f.timeUnit,n=f.type;switch(e){case"domainMax":case"domainMin":sC(u[e])||"temporal"===n||t?l.set(e,{signal:lT(u[e],{type:n,timeUnit:t})},!0):l.set(e,u[e],!0);break;default:l.copyKeyFromObject(e,u)}}else{const n=e in gL?gL[e]({model:t,channel:s,fieldOrDatumDef:f,scaleType:h,scalePadding:p,scalePaddingInner:g,domain:u.domain,markDef:o,config:r}):r.scale[e];void 0!==n&&l.set(e,n,!1)}}}(t,e):bL(t,e)}const gL={bins:({model:t,fieldOrDatumDef:e})=>Fz(e)?function(t,e){const n=e.bin;if(AS(n)){const r=cB(t,e.field,n);return new VB(()=>t.getSignalName(r))}if(DS(n)&&MS(n)&&void 0!==n.step)return{step:n.step};return}(t,e):void 0,interpolate:({channel:t,fieldOrDatumDef:e})=>function(t,e){if(RD([LM,IM,UM],t)&&"nominal"!==e)return"hcl";return}(t,e.type),nice:({scaleType:t,channel:e,fieldOrDatumDef:n})=>function(t,e,n){var r;if((null===(r=eT(n))||void 0===r?void 0:r.bin)||RD([KC,ZC],t))return;return e in fS||void 0}(t,e,n),padding:({channel:t,scaleType:e,fieldOrDatumDef:n,markDef:r,config:i})=>function(t,e,n,r,i,o){if(t in fS){if(bF(e)){if(void 0!==n.continuousPadding)return n.continuousPadding;const{type:e,orient:a}=i;if("bar"===e&&(!Fz(r)||!r.bin&&!r.timeUnit)&&("vertical"===a&&"x"===t||"horizontal"===a&&"y"===t))return o.continuousBandSize}if(e===nF)return n.pointPadding}return}(t,e,i.scale,n,r,i.bar),paddingInner:({scalePadding:t,channel:e,markDef:n,config:r})=>function(t,e,n,r){if(void 0!==t)return;if(e in fS){const{bandPaddingInner:t,barBandPaddingInner:e,rectBandPaddingInner:i}=r;return cM(t,"bar"===n?e:i)}return}(t,e,n.type,r.scale),paddingOuter:({scalePadding:t,channel:e,scaleType:n,markDef:r,scalePaddingInner:i,config:o})=>function(t,e,n,r,i,o){if(void 0!==t)return;if(e in fS&&n===rF){const{bandPaddingOuter:t}=o;return cM(t,wC(i)?{signal:i.signal+"/2"}:i/2)}return}(t,e,n,r.type,i,o.scale),reverse:({fieldOrDatumDef:t,scaleType:e,channel:n,config:r})=>function(t,e,n,r){if("x"===n&&void 0!==r.xReverse)return mF(t)&&"descending"===e?wC(r.xReverse)?{signal:"!"+r.xReverse.signal}:!r.xReverse:r.xReverse;if(mF(t)&&"descending"===e)return!0;return}(e,Fz(t)?t.sort:void 0,n,r.scale),zero:({channel:t,fieldOrDatumDef:e,domain:n,markDef:r,scaleType:i})=>function(t,e,n,r,i){if(n&&"unaggregated"!==n&&mF(i)){if(Object(Z.B)(n)){const t=n[0],e=n[n.length-1];if(t<=0&&e>=0)return!0}return!1}if("size"===t&&"quantitative"===e.type&&!yF(i))return!0;if((!Fz(e)||!e.bin)&&RD([...dS,...gS],t)){const{orient:e,type:n}=r;return!RD(["bar","area","line","trail"],n)||!("horizontal"===e&&"y"===t||"vertical"===e&&"x"===t)}return!1}(t,e,n,r,i)};function mL(t){OL(t)?function(t){const e=t.component.scales;for(const n of xS){const r=e[n];if(!r)continue;const i=fL(n,t);r.setWithExplicit("range",i)}}(t):bL(t,"range")}function bL(t,e){const n=t.component.scales;for(const n of t.children)"range"===e?mL(n):pL(n,e);for(const r of XD(n)){let i;for(const n of t.children){const t=n.component.scales[r];if(t){i=gN(i,t.getWithExplicit(e),e,"scale",hN((t,n)=>{switch(e){case"range":return t.step&&n.step?t.step-n.step:0}return 0}))}}n[r].setWithExplicit(e,i)}}function yL(t,e,n,r){const i=function(t,e,n){var r;switch(e.type){case"nominal":case"ordinal":if(XM(t)||"discrete"===kS(t))return"shape"===t&&"ordinal"===e.type&&aC(VS(t,"ordinal")),"ordinal";if(t in fS){if(RD(["rect","bar","image","rule"],n))return"band"}else if("arc"===n&&t in pS)return"band";return void 0!==e.band||Iz(e)&&(null===(r=e.axis)||void 0===r?void 0:r.tickBand)?"band":"point";case"temporal":return XM(t)?"time":"discrete"===kS(t)?(aC(VS(t,"temporal")),"ordinal"):Fz(e)&&e.timeUnit&&OC(e.timeUnit).utc?"utc":"time";case"quantitative":return XM(t)?Fz(e)&&AS(e.bin)?"bin-ordinal":"linear":"discrete"===kS(t)?(aC(VS(t,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(qS(e.type))}(e,n,r),{type:o}=t;return _S(e)?void 0!==o?function(t,e){if(!_S(t))return!1;switch(t){case"x":case"y":case PM:case RM:return bF(e)||RD(["band","point"],e);case"size":case"strokeWidth":case"opacity":case"fillOpacity":case"strokeOpacity":case"angle":return bF(e)||yF(e)||RD(["band","point","ordinal"],e);case LM:case IM:case UM:return"band"!==e;case"strokeDash":return"ordinal"===e||yF(e);case qM:return"ordinal"===e}}(e,o)?Fz(n)&&(a=o,s=n.type,!(RD([UC,WC],s)?void 0===a||gF(a):s===qC?RD([KC,ZC,void 0],a):s!==IC||RD([GC,VC,XC,JC,QC,tF,eF,HC,void 0],a)))?(aC(function(t,e){return`FieldDef does not work with "${t}" scale. We are using "${e}" scale instead.`}(o,i)),i):o:(aC(function(t,e,n){return`Channel "${t}" does not work with "${e}" scale. We are using "${n}" scale instead.`}(e,o,i)),i):i:null;var a,s}function vL(t){OL(t)?t.component.scales=function(t){const{encoding:e,mark:n}=t;return xS.reduce((r,i)=>{const o=nT(e[i]);if(o&&n===LF&&i===qM&&o.type===YC)return r;let a=o&&o.scale;if(o&&null!==a&&!1!==a){a=null!=a?a:{};const e=yL(a,i,o,n);r[i]=new sL(t.scaleName(i+"",!0),{value:e,explicit:a.type===e})}return r},{})}(t):t.component.scales=function(t){var e;const n=t.component.scales={},r={},i=t.component.resolve;for(const n of t.children){vL(n);for(const o of XD(n.component.scales))if(i.scale[o]=null!==(e=i.scale[o])&&void 0!==e?e:PP(o,t),"shared"===i.scale[o]){const t=r[o],e=n.component.scales[o].getWithExplicit("type");t?oF(t.value,e.value)?r[o]=gN(t,e,"type","scale",xL):(i.scale[o]="independent",delete r[o]):r[o]=e}}for(const e of XD(r)){const i=t.scaleName(e,!0),o=r[e];n[e]=new sL(i,o);for(const n of t.children){const t=n.component.scales[e];t&&(n.renameScale(t.get("name"),i),t.merged=!0)}}return n}(t)}const xL=hN((t,e)=>sF(t)-sF(e));class _L{constructor(){this.nameMap={}}rename(t,e){this.nameMap[t]=e}has(t){return void 0!==this.nameMap[t]}get(t){for(;this.nameMap[t]&&t!==this.nameMap[t];)t=this.nameMap[t];return t}}function OL(t){return"unit"===(null==t?void 0:t.type)}function wL(t){return"facet"===(null==t?void 0:t.type)}function jL(t){return"concat"===(null==t?void 0:t.type)}function kL(t){return"layer"===(null==t?void 0:t.type)}class EL{constructor(t,e,n,r,i,o,a){var s,u;this.type=e,this.parent=n,this.config=i,this.children=[],this.correctDataNames=t=>(t.from&&t.from.data&&(t.from.data=this.lookupDataSource(t.from.data)),t.from&&t.from.facet&&t.from.facet.data&&(t.from.facet.data=this.lookupDataSource(t.from.facet.data)),t),this.parent=n,this.config=i,this.view=kF(a),this.name=null!==(s=t.name)&&void 0!==s?s:r,this.title=hT(t.title)?{text:t.title}:t.title?this.initTitle(t.title):void 0,this.scaleNameMap=n?n.scaleNameMap:new _L,this.projectionNameMap=n?n.projectionNameMap:new _L,this.signalNameMap=n?n.signalNameMap:new _L,this.data=t.data,this.description=t.description,this.transforms=(null!==(u=t.transform)&&void 0!==u?u:[]).map(t=>kN(t)?{filter:MD(t.filter,LC)}:t),this.layout="layer"===e||"unit"===e?{}:function(t,e,n){var r,i;const o=n[e],a={},{spacing:s,columns:u}=o;void 0!==s&&(a.spacing=s),void 0!==u&&(jz(t)&&!Oz(t.facet)||g$(t))&&(a.columns=u),m$(t)&&(a.columns=1);for(const e of x$)if(void 0!==t[e])if("spacing"===e){const n=t[e];a[e]=Object(Z.F)(n)?n:{row:null!==(r=n.row)&&void 0!==r?r:s,column:null!==(i=n.column)&&void 0!==i?i:s}}else a[e]=t[e];return a}(t,e,i),this.component={data:{sources:n?n.component.data.sources:[],outputNodes:n?n.component.data.outputNodes:{},outputNodeRefCounts:n?n.component.data.outputNodeRefCounts:{},isFaceted:jz(t)||n&&n.component.data.isFaceted&&void 0===t.data},layoutSize:new cN,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:Object.assign({scale:{},axis:{},legend:{}},o?CD(o):{}),selection:null,scales:null,projection:null,axes:{},legends:{}}}initTitle(t){const e=XD(t),n={text:gT(t.text)};for(const r of e)n[r]=gT(t[r]);return n}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(){!function(t,{ignoreRange:e}={}){vL(t),XB(t);for(const e of _F)pL(t,e);e||mL(t)}(this)}parseProjection(){uB(this)}renameTopLevelLayoutSizeSignal(){"width"!==this.getName("width")&&this.renameSignal(this.getName("width"),"width"),"height"!==this.getName("height")&&this.renameSignal(this.getName("height"),"height")}parseLegends(){ZP(this)}assembleGroupStyle(){var t,e;if("unit"===this.type||"layer"===this.type)return null!==(e=null===(t=this.view)||void 0===t?void 0:t.style)&&void 0!==e?e:"cell"}assembleEncodeFromView(t){const e=bD(t,["style"]),n={};for(const t of XD(e)){const r=e[t];void 0!==r&&(n[t]=bT(r))}return n}assembleGroupEncodeEntry(t){let e={};return this.view&&(e=this.assembleEncodeFromView(this.view)),t||(this.description&&(e.description=bT(this.description)),"unit"!==this.type&&"layer"!==this.type)?VD(e)?void 0:e:Object.assign({width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height")},null!=e?e:{})}assembleLayout(){if(!this.layout)return;const t=this.layout,{spacing:e}=t,n=bD(t,["spacing"]),{component:r,config:i}=this,o=function(t,e){const n={};for(const r of KM){const i=t[r];if(null==i?void 0:i.facetFieldDef){const{titleAnchor:t,titleOrient:o}=vP(["titleAnchor","titleOrient"],i.facetFieldDef.header,e,r),a=bP(r,o),s=SP(t,a);void 0!==s&&(n[a]=s)}}return VD(n)?void 0:n}(r.layoutHeaders,i);return Object.assign(Object.assign(Object.assign({padding:e},this.assembleDefaultLayout()),n),o?{titleBand:o}:{})}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:t}=this.component;let e=[];for(const n of KM)t[n].title&&e.push(OP(this,n));for(const t of xP)e=e.concat(kP(this,t));return e}assembleAxes(){return function(t,e){const{x:n=[],y:r=[]}=t;return[...n.map(t=>iP(t,"grid",e)),...r.map(t=>iP(t,"grid",e)),...n.map(t=>iP(t,"main",e)),...r.map(t=>iP(t,"main",e))].filter(t=>t)}(this.component.axes,this.config)}assembleLegends(){return rB(this)}assembleProjections(){return iB(this)}assembleTitle(){var t,e,n;const r=null!==(t=this.title)&&void 0!==t?t:{},{encoding:i}=r,o=bD(r,["encoding"]),a=Object.assign(Object.assign(Object.assign({},dT(this.config.title).nonMark),o),i?{encode:{update:i}}:{});if(a.text)return RD(["unit","layer"],this.type)?RD(["middle",void 0],a.anchor)&&(a.frame=null!==(e=a.frame)&&void 0!==e?e:"group"):a.anchor=null!==(n=a.anchor)&&void 0!==n?n:"start",VD(a)?void 0:a}assembleGroup(t=[]){const e={};(t=t.concat(this.assembleSignals())).length>0&&(e.signals=t);const n=this.assembleLayout();n&&(e.layout=n),e.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const r=!this.parent||wL(this.parent)?function t(e){return kL(e)||jL(e)?e.children.reduce((e,n)=>e.concat(t(n)),aL(e)):aL(e)}(this):[];r.length>0&&(e.scales=r);const i=this.assembleAxes();i.length>0&&(e.axes=i);const o=this.assembleLegends();return o.length>0&&(e.legends=o),e}getName(t){return QD((this.name?this.name+"_":"")+t)}getDataName(t){return this.getName(jN[t].toLowerCase())}requestDataName(t){const e=this.getDataName(t),n=this.component.data.outputNodeRefCounts;return n[e]=(n[e]||0)+1,e}getSizeSignalRef(t){if(wL(this.parent)){const e=mS(NP(t)),n=this.component.scales[e];if(n&&!n.merged){const t=n.get("type"),r=n.get("range");if(gF(t)&&jC(r)){const t=n.get("name"),r=iL(oL(this,e));if(r){return{signal:$P(t,n,Yz({aggregate:"distinct",field:r},{expr:"datum"}))}}return aC(NS(e)),null}}}return{signal:this.signalNameMap.get(this.getName(t))}}lookupDataSource(t){const e=this.component.data.outputNodes[t];return e?e.getSource():t}getSignalName(t){return this.signalNameMap.get(t)}renameSignal(t,e){this.signalNameMap.rename(t,e)}renameScale(t,e){this.scaleNameMap.rename(t,e)}renameProjection(t,e){this.projectionNameMap.rename(t,e)}scaleName(t,e){return e?this.getName(t):nS(t)&&_S(t)&&this.component.scales[t]||this.scaleNameMap.has(this.getName(t))?this.scaleNameMap.get(this.getName(t)):void 0}projectionName(t){return t?this.getName("projection"):this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection"))?this.projectionNameMap.get(this.getName("projection")):void 0}getScaleComponent(t){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const e=this.component.scales[t];return e&&!e.merged?e:this.parent?this.parent.getScaleComponent(t):void 0}getSelectionComponent(t,e){let n=this.component.selection[t];if(!n&&this.parent&&(n=this.parent.getSelectionComponent(t,e)),!n)throw new Error(`Cannot find a selection named "${e}".`);return n}hasAxisOrientSignalRef(){var t,e;return(null===(t=this.component.axes.x)||void 0===t?void 0:t.some(t=>t.hasOrientSignalRef()))||(null===(e=this.component.axes.y)||void 0===e?void 0:e.some(t=>t.hasOrientSignalRef()))}}class AL extends EL{vgField(t,e={}){const n=this.fieldDef(t);if(n)return Yz(n,e)}reduceFieldDef(t,e){return function(t,e,n,r){return t?XD(t).reduce((n,i)=>{const o=t[i];return Object(Z.B)(o)?o.reduce((t,n)=>e.call(r,t,n,i),n):e.call(r,n,o,i)},n):n}(this.getMapping(),(e,n,r)=>{const i=eT(n);return i?t(e,i,r):e},e)}forEachFieldDef(t,e){NT(this.getMapping(),(e,n)=>{const r=eT(e);r&&t(r,n)},e)}}class DL extends bR{constructor(t,e){var n,r,i;super(t),this.transform=e,this.transform=CD(e);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(r=o[0])&&void 0!==r?r:"value",null!==(i=o[1])&&void 0!==i?i:"density"]}clone(){return new DL(null,CD(this.transform))}dependentFields(){var t;return new Set([this.transform.density,...null!==(t=this.transform.groupby)&&void 0!==t?t:[]])}producedFields(){return new Set(this.transform.as)}hash(){return"DensityTransform "+$D(this.transform)}assemble(){const t=this.transform,{density:e}=t,n=bD(t,["density"]);return Object.assign({type:"kde",field:e},n)}}class ML extends bR{constructor(t,e){super(t),this.filter=e}clone(){return new ML(null,Object.assign({},this.filter))}static make(t,e){const{config:n,mark:r,markDef:i}=e;if("filter"!==_T("invalid",i,n))return null;const o=e.reduceFieldDef((t,n,i)=>{const o=_S(i)&&e.getScaleComponent(i);if(o){mF(o.get("type"))&&"count"!==n.aggregate&&!IF(r)&&(t[n.field]=n)}return t},{});return XD(o).length?new ML(t,o):null}dependentFields(){return new Set(XD(this.filter))}producedFields(){return new Set}hash(){return"FilterInvalid "+$D(this.filter)}assemble(){const t=XD(this.filter).reduce((t,e)=>{const n=this.filter[e],r=Yz(n,{expr:"datum"});return null!==n&&("temporal"===n.type?t.push(`(isDate(${r}) || (isValid(${r}) && isFinite(+${r})))`):"quantitative"===n.type&&(t.push(`isValid(${r})`),t.push(`isFinite(+${r})`))),t},[]);return t.length>0?{type:"filter",expr:t.join(" && ")}:null}}class SL extends bR{constructor(t,e){super(t),this.transform=e,this.transform=CD(e);const{flatten:n,as:r=[]}=this.transform;this.transform.as=n.map((t,e)=>{var n;return null!==(n=r[e])&&void 0!==n?n:t})}clone(){return new SL(this.parent,CD(this.transform))}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return"FlattenTransform "+$D(this.transform)}assemble(){const{flatten:t,as:e}=this.transform;return{type:"flatten",fields:t,as:e}}}class CL extends bR{constructor(t,e){var n,r,i;super(t),this.transform=e,this.transform=CD(e);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(r=o[0])&&void 0!==r?r:"key",null!==(i=o[1])&&void 0!==i?i:"value"]}clone(){return new CL(null,CD(this.transform))}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return"FoldTransform "+$D(this.transform)}assemble(){const{fold:t,as:e}=this.transform;return{type:"fold",fields:t,as:e}}}class FL extends bR{constructor(t,e,n,r){super(t),this.fields=e,this.geojson=n,this.signal=r}clone(){return new FL(null,CD(this.fields),this.geojson,this.signal)}static parseAll(t,e){if(e.component.projection&&!e.component.projection.isFit)return t;let n=0;for(const r of[["longitude","latitude"],["longitude2","latitude2"]]){const i=r.map(t=>{const n=nT(e.encoding[t]);return Fz(n)?n.field:Tz(n)?{expr:""+n.datum}:Bz(n)?{expr:""+n.value}:void 0});(i[0]||i[1])&&(t=new FL(t,i,null,e.getName("geojson_"+n++)))}if(e.channelHasField(qM)){const r=e.typedFieldDef(qM);r.type===YC&&(t=new FL(t,null,r.field,e.getName("geojson_"+n++)))}return t}dependentFields(){var t;const e=(null!==(t=this.fields)&&void 0!==t?t:[]).filter(Z.I);return new Set([...this.geojson?[this.geojson]:[],...e])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${$D(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 zL extends bR{constructor(t,e,n,r){super(t),this.projection=e,this.fields=n,this.as=r}clone(){return new zL(null,this.projection,CD(this.fields),CD(this.as))}static parseAll(t,e){if(!e.projectionName())return t;for(const n of[["longitude","latitude"],["longitude2","latitude2"]]){const r=n.map(t=>{const n=nT(e.encoding[t]);return Fz(n)?n.field:Tz(n)?{expr:""+n.datum}:Bz(n)?{expr:""+n.value}:void 0}),i="longitude2"===n[0]?"2":"";(r[0]||r[1])&&(t=new zL(t,e.projectionName(),r,[e.getName("x"+i),e.getName("y"+i)]))}return t}dependentFields(){return new Set(this.fields.filter(Z.I))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${$D(this.fields)} ${$D(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class TL extends bR{constructor(t,e){super(t),this.transform=e}clone(){return new TL(null,CD(this.transform))}dependentFields(){var t;return new Set([this.transform.impute,this.transform.key,...null!==(t=this.transform.groupby)&&void 0!==t?t:[]])}producedFields(){return new Set([this.transform.impute])}processSequence(t){const{start:e=0,stop:n,step:r}=t;return{signal:`sequence(${[e,n,...r?[r]:[]].join(",")})`}}static makeFromTransform(t,e){return new TL(t,e)}static makeFromEncoding(t,e){const n=e.encoding,r=n.x,i=n.y;if(Fz(r)&&Fz(i)){const o=r.impute?r:i.impute?i:void 0;if(void 0===o)return;const a=r.impute?i:i.impute?r:void 0,{method:s,value:u,frame:l,keyvals:c}=o.impute,f=RT(e.mark,n);return new TL(t,Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({impute:o.field,key:a.field},s?{method:s}:{}),void 0!==u?{value:u}:{}),l?{frame:l}:{}),void 0!==c?{keyvals:c}:{}),f.length?{groupby:f}:{}))}return null}hash(){return"Impute "+$D(this.transform)}assemble(){const{impute:t,key:e,keyvals:n,method:r,groupby:i,value:o,frame:a=[null,null]}=this.transform,s=Object.assign(Object.assign(Object.assign(Object.assign({type:"impute",field:t,key:e},n?{keyvals:(u=n,void 0!==(null==u?void 0:u.stop)?this.processSequence(n):n)}:{}),{method:"value"}),i?{groupby:i}:{}),{value:r&&"value"!==r?null:o});var u;if(r&&"value"!==r){return[s,Object.assign({type:"window",as:[`imputed_${t}_value`],ops:[r],fields:[t],frame:a,ignorePeers:!1},i?{groupby:i}:{}),{type:"formula",expr:`datum.${t} === null ? datum.imputed_${t}_value : datum.${t}`,as:t}]}return[s]}}class $L extends bR{constructor(t,e){var n,r,i;super(t),this.transform=e,this.transform=CD(e);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(r=o[0])&&void 0!==r?r:e.on,null!==(i=o[1])&&void 0!==i?i:e.loess]}clone(){return new $L(null,CD(this.transform))}dependentFields(){var t;return new Set([this.transform.loess,this.transform.on,...null!==(t=this.transform.groupby)&&void 0!==t?t:[]])}producedFields(){return new Set(this.transform.as)}hash(){return"LoessTransform "+$D(this.transform)}assemble(){const t=this.transform,{loess:e,on:n}=t,r=bD(t,["loess","on"]);return Object.assign({type:"loess",x:n,y:e},r)}}class NL extends bR{constructor(t,e,n){super(t),this.transform=e,this.secondary=n}clone(){return new NL(null,CD(this.transform),this.secondary)}static make(t,e,n,r){const i=e.component.data.sources,{from:o}=n;let a=null;if(function(t){return"data"in t}(o)){let t=JL(o.data,i);t||(t=new wB(o.data),i.push(t));const n=e.getName("lookup_"+r);a=new yR(t,n,jN.Lookup,e.component.data.outputNodeRefCounts),e.component.data.outputNodes[n]=a}else if(function(t){return"selection"in t}(o)){const t=o.selection;if(n=Object.assign({as:t},n),a=e.getSelectionComponent(QD(t),t).materialized,!a)throw new Error(`Cannot define and lookup the "${t}" selection in the same view. Try moving the lookup into a second, layered view?`)}return new NL(t,n,a.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?Object(Z.i)(this.transform.as):this.transform.from.fields)}hash(){return"Lookup "+$D({transform:this.transform,secondary:this.secondary})}assemble(){let t;if(this.transform.from.fields)t=Object.assign({values:this.transform.from.fields},this.transform.as?{as:Object(Z.i)(this.transform.as)}:{});else{let e=this.transform.as;Object(Z.I)(e)||(aC('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.'),e="_lookup"),t={as:[e]}}return Object.assign(Object.assign({type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup]},t),this.transform.default?{default:this.transform.default}:{})}}class RL extends bR{constructor(t,e){var n,r,i;super(t),this.transform=e,this.transform=CD(e);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(r=o[0])&&void 0!==r?r:"prob",null!==(i=o[1])&&void 0!==i?i:"value"]}clone(){return new RL(null,CD(this.transform))}dependentFields(){var t;return new Set([this.transform.quantile,...null!==(t=this.transform.groupby)&&void 0!==t?t:[]])}producedFields(){return new Set(this.transform.as)}hash(){return"QuantileTransform "+$D(this.transform)}assemble(){const t=this.transform,{quantile:e}=t,n=bD(t,["quantile"]);return Object.assign({type:"quantile",field:e},n)}}class PL extends bR{constructor(t,e){var n,r,i;super(t),this.transform=e,this.transform=CD(e);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(r=o[0])&&void 0!==r?r:e.on,null!==(i=o[1])&&void 0!==i?i:e.regression]}clone(){return new PL(null,CD(this.transform))}dependentFields(){var t;return new Set([this.transform.regression,this.transform.on,...null!==(t=this.transform.groupby)&&void 0!==t?t:[]])}producedFields(){return new Set(this.transform.as)}hash(){return"RegressionTransform "+$D(this.transform)}assemble(){const t=this.transform,{regression:e,on:n}=t,r=bD(t,["regression","on"]);return Object.assign({type:"regression",x:n,y:e},r)}}class BL extends bR{constructor(t,e){super(t),this.transform=e}clone(){return new BL(null,CD(this.transform))}addDimensions(t){var e;this.transform.groupby=UD((null!==(e=this.transform.groupby)&&void 0!==e?e:[]).concat(t),t=>t)}producedFields(){}dependentFields(){var t;return new Set([this.transform.pivot,this.transform.value,...null!==(t=this.transform.groupby)&&void 0!==t?t:[]])}hash(){return"PivotTransform "+$D(this.transform)}assemble(){const{pivot:t,value:e,groupby:n,limit:r,op:i}=this.transform;return Object.assign(Object.assign(Object.assign({type:"pivot",field:t,value:e},void 0!==r?{limit:r}:{}),void 0!==i?{op:i}:{}),void 0!==n?{groupby:n}:{})}}class LL extends bR{constructor(t,e){super(t),this.transform=e}clone(){return new LL(null,CD(this.transform))}dependentFields(){return new Set}producedFields(){return new Set}hash(){return"SampleTransform "+$D(this.transform)}assemble(){return{type:"sample",size:this.transform.sample}}}function IL(t){let e=0;return function n(r,i){var o;if(r instanceof wB&&!r.isGenerator&&!bN(r.data)){t.push(i);i={name:null,source:i.name,transform:[]}}if(r instanceof vB&&(r.parent instanceof wB&&!i.source?(i.format=Object.assign(Object.assign({},null!==(o=i.format)&&void 0!==o?o:{}),{parse:r.assembleFormatParse()}),i.transform.push(...r.assembleTransforms(!0))):i.transform.push(...r.assembleTransforms())),r instanceof gB){i.name||(i.name="data_"+e++),!i.source||i.transform.length>0?(t.push(i),r.data=i.name):r.data=i.source;for(const e of r.assemble())t.push(e)}else{if((r instanceof _B||r instanceof OB||r instanceof ML||r instanceof QR||r instanceof gP||r instanceof zL||r instanceof FL||r instanceof pB||r instanceof NL||r instanceof UB||r instanceof LB||r instanceof CL||r instanceof SL||r instanceof DL||r instanceof $L||r instanceof RL||r instanceof PL||r instanceof xB||r instanceof LL||r instanceof BL)&&i.transform.push(r.assemble()),(r instanceof dB||r instanceof vR||r instanceof TL||r instanceof IB)&&i.transform.push(...r.assemble()),r instanceof yR)if(i.source&&0===i.transform.length)r.setSource(i.source);else if(r.parent instanceof yR)r.setSource(i.name);else if(i.name||(i.name="data_"+e++),r.setSource(i.name),1===r.numChildren()){t.push(i);i={name:null,source:i.name,transform:[]}}switch(r.numChildren()){case 0:r instanceof yR&&(!i.source||i.transform.length>0)&&t.push(i);break;case 1:n(r.children[0],i);break;default:{i.name||(i.name="data_"+e++);let o=i.name;!i.source||i.transform.length>0?t.push(i):o=i.source;for(const t of r.children){n(t,{name:null,source:o,transform:[]})}break}}}}}function UL(t,e){var n;const{facet:r,config:i,child:o,component:a}=t;if(t.channelHasField(e)){const s=r[e],u=yP("title",null,i,e);let l=Kz(s,i,{allowDisabling:!0,includeDefault:void 0===u||!!u});o.component.layoutHeaders[e].title&&(l=Object(Z.B)(l)?l.join(", "):l,l+=" / "+o.component.layoutHeaders[e].title,o.component.layoutHeaders[e].title=null);const c=yP("labelOrient",s,i,e),f=cM((null!==(n=s.header)&&void 0!==n?n:{}).labels,i.header.labels,!0),d=RD(["bottom","right"],c)?"footer":"header";a.layoutHeaders[e]={title:l,facetFieldDef:s,[d]:"facet"===e?[]:[qL(t,e,f)]}}}function qL(t,e,n){const r="row"===e?"height":"width";return{labels:n,sizeSignal:t.child.component.layoutSize.get(r)?t.child.getSizeSignalRef(r):void 0,axes:[]}}function WL(t,e){var n;const{child:r}=t;if(r.component.axes[e]){const{layoutHeaders:o,resolve:a}=t.component;if(a.axis[e]=BP(a,e),"shared"===a.axis[e]){const a="x"===e?"column":"row",s=o[a];for(const o of r.component.axes[e]){const e="top"===(i=o.get("orient"))||"left"===i||wC(i)?"header":"footer";s[e]=null!==(n=s[e])&&void 0!==n?n:[qL(t,a,!1)];const r=iP(o,"main",t.config,{header:!0});r&&s[e][0].axes.push(r),o.mainExtracted=!0}}}var i}function YL(t){for(const e of t.children)e.parseLayoutSize()}function HL(t,e){const n=NP(e),r=mS(n),i=t.component.resolve,o=t.component.layoutSize;let a;for(const e of t.children){const t=e.component.layoutSize.getWithExplicit(n),o=i.scale[r];if("independent"===o&&"step"===t.value){a=void 0;break}if(a){if("independent"===o&&a.value!==t.value){a=void 0;break}a=gN(a,t,n,"")}else a=t}if(a){for(const r of t.children)t.renameSignal(r.getName(n),t.getName(e)),r.component.layoutSize.set(n,"merged",!1);o.setWithExplicit(e,a)}else o.setWithExplicit(e,{explicit:!1,value:void 0})}function GL(t,e){const n="width"===e?"x":"y",r=t.config,i=t.getScaleComponent(n);if(i){const t=i.get("type"),n=i.get("range");if(gF(t)){const t=w$(r.view,e);return jC(n)||y$(t)?"step":t}return _$(r.view,e)}if(t.hasProjection||"arc"===t.mark)return _$(r.view,e);{const t=w$(r.view,e);return y$(t)?t.step:t}}function VL(t,e,n){return Yz(e,Object.assign({suffix:"by_"+Yz(t)},null!=n?n:{}))}class XL extends AL{constructor(t,e,n,r){super(t,"facet",e,n,r,t.resolve),this.child=mI(t.spec,this,this.getName("child"),void 0,r),this.children=[this.child],this.facet=this.initFacet(t.facet)}initFacet(t){if(!Oz(t))return{facet:this.initFacetFieldDef(t,"facet")};const e=XD(t),n={};for(const r of e){if(!RD([$M,NM],r)){aC(HS(r,"facet"));break}const e=t[r];if(void 0===e.field){aC(YS(e,r));break}n[r]=this.initFacetFieldDef(e,r)}return n}initFacetFieldDef(t,e){const{header:n}=t,r=oT(bD(t,["header"]),e);return n&&(r.header=kF(n)),r}channelHasField(t){return!!this.facet[t]}fieldDef(t){return this.facet[t]}parseData(){this.component.data=KL(this),this.child.parseData()}parseLayoutSize(){YL(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),function(t){for(const e of KM)UL(t,e);WL(t,"x"),WL(t,"y")}(this)}assembleSelectionTopLevelSignals(t){return this.child.assembleSelectionTopLevelSignals(t)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(t){return this.child.assembleSelectionData(t)}getHeaderLayoutMixins(){var t,e,n;const r={};for(const i of KM)for(const o of _P){const a=this.component.layoutHeaders[i],s=a[o],{facetFieldDef:u}=a;if(u){const e=yP("titleOrient",u.header,this.config,i);if(RD(["right","bottom"],e)){const n=bP(i,e);r.titleAnchor=null!==(t=r.titleAnchor)&&void 0!==t?t:{},r.titleAnchor[n]="end"}}if(null==s?void 0:s[0]){const t="row"===i?"height":"width",s="header"===o?"headerBand":"footerBand";"facet"===i||this.child.component.layoutSize.get(t)||(r[s]=null!==(e=r[s])&&void 0!==e?e:{},r[s][i]=.5),a.title&&(r.offset=null!==(n=r.offset)&&void 0!==n?n:{},r.offset["row"===i?"rowTitle":"columnTitle"]=10)}}return r}assembleDefaultLayout(){const{column:t,row:e}=this.facet,n=t?this.columnDistinctSignal():e?1:void 0;let r="all";return(e||"independent"!==this.component.resolve.scale.x)&&(t||"independent"!==this.component.resolve.scale.y)||(r="none"),Object.assign(Object.assign(Object.assign({},this.getHeaderLayoutMixins()),n?{columns:n}:{}),{bounds:"full",align:r})}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof XL)){return{signal:`length(data('${this.getName("column_domain")}'))`}}}assembleGroup(t){return this.parent&&this.parent instanceof XL?Object.assign(Object.assign({},this.channelHasField("column")?{encode:{update:{columns:{field:Yz(this.facet.column,{prefix:"distinct"})}}}}:{}),super.assembleGroup(t)):super.assembleGroup(t)}getCardinalityAggregateForChild(){const t=[],e=[],n=[];if(this.child instanceof XL){if(this.child.channelHasField("column")){const r=Yz(this.child.facet.column);t.push(r),e.push("distinct"),n.push("distinct_"+r)}}else for(const r of dS){const i=this.child.component.scales[r];if(i&&!i.merged){const o=i.get("type"),a=i.get("range");if(gF(o)&&jC(a)){const i=iL(oL(this.child,r));i?(t.push(i),e.push("distinct"),n.push("distinct_"+i)):aC(NS(r))}}}return{fields:t,ops:e,as:n}}assembleFacet(){const{name:t,data:e}=this.component.data.facetRoot,{row:n,column:r}=this.facet,{fields:i,ops:o,as:a}=this.getCardinalityAggregateForChild(),s=[];for(const t of KM){const e=this.facet[t];if(e){s.push(Yz(e));const{bin:u,sort:l}=e;if(AS(u)&&s.push(Yz(e,{binSuffix:"end"})),xz(l)){const{field:t,op:s=mz}=l,u=VL(e,l);n&&r?(i.push(u),o.push("max"),a.push(u)):(i.push(t),o.push(s),a.push(u))}else if(Object(Z.B)(l)){const n=mP(e,t);i.push(n),o.push("max"),a.push(n)}}}const u=!!n&&!!r;return Object.assign({name:t,data:e,groupby:s},u||i.length>0?{aggregate:Object.assign(Object.assign({},u?{cross:u}:{}),i.length?{fields:i,ops:o,as:a}:{})}:{})}facetSortFields(t){const{facet:e}=this,n=e[t];return n?xz(n.sort)?[VL(n,n.sort,{expr:"datum"})]:Object(Z.B)(n.sort)?[mP(n,t,{expr:"datum"})]:[Yz(n,{expr:"datum"})]:[]}facetSortOrder(t){const{facet:e}=this,n=e[t];if(n){const{sort:t}=n;return[(xz(t)?t.order:!Object(Z.B)(t)&&t)||"ascending"]}return[]}assembleLabelTitle(){var t;const{facet:e,config:n}=this;if(e.facet)return AP(e.facet,"facet",n);const r={row:["top","bottom"],column:["left","right"]};for(const i of xP)if(e[i]){const o=yP("labelOrient",null===(t=e[i])||void 0===t?void 0:t.header,n,i);if(RD(r[i],o))return AP(e[i],i,n)}}assembleMarks(){const{child:t}=this,e=function(t){const e=[],n=IL(e);for(const e of t.children)n(e,{source:t.name,name:null,transform:[]});return e}(this.component.data.facetRoot),n=t.assembleGroupEncodeEntry(!1),r=this.assembleLabelTitle()||t.assembleTitle(),i=t.assembleGroupStyle();return[Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:this.getName("cell"),type:"group"},r?{title:r}:{}),i?{style:i}:{}),{from:{facet:this.assembleFacet()},sort:{field:KM.map(t=>this.facetSortFields(t)).flat(),order:KM.map(t=>this.facetSortOrder(t)).flat()}}),e.length>0?{data:e}:{}),n?{encode:{update:n}}:{}),t.assembleGroup(function(t,e){if(t.component.selection&&XD(t.component.selection).length){const n=Object(Z.ab)(t.getName("cell"));e.unshift({name:"facet",value:{},on:[{events:Kj("mousemove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return RR(e)}(this,[])))]}getMapping(){return this.facet}}function JL(t,e){var n,r,i,o;for(const a of e){const e=a.data;if(t.name&&a.hasName()&&t.name!==a.dataName)continue;const s=null===(n=t.format)||void 0===n?void 0:n.mesh,u=null===(r=e.format)||void 0===r?void 0:r.feature;if(s&&u)continue;const l=null===(i=t.format)||void 0===i?void 0:i.feature;if((l||u)&&l!==u)continue;const c=null===(o=e.format)||void 0===o?void 0:o.mesh;if(!s&&!c||s===c)if(yN(t)&&yN(e)){if(SD(t.values,e.values))return a}else if(bN(t)&&bN(e)){if(t.url===e.url)return a}else if(vN(t)&&t.name===a.dataName)return a}return null}function KL(t){var e,n,r,i,o,a,s,u,l,c;let f=function(t,e){if(t.data||!t.parent){if(null===t.data){const t=new wB({values:[]});return e.push(t),t}const n=JL(t.data,e);if(n)return xN(t.data)||(n.data.format=LD({},t.data.format,n.data.format)),!n.hasName()&&t.data.name&&(n.dataName=t.data.name),n;{const n=new wB(t.data);return e.push(n),n}}return t.parent.component.data.facetRoot?t.parent.component.data.facetRoot:t.parent.component.data.main}(t,t.component.data.sources);const{outputNodes:d,outputNodeRefCounts:h}=t.component.data,p=t.parent?t.parent.component.data.ancestorParse.clone():new mN,g=t.data;xN(g)?(_N(g)?f=new OB(f,g.sequence):wN(g)&&(f=new _B(f,g.graticule)),p.parseNothing=!0):null===(null===(e=null==g?void 0:g.format)||void 0===e?void 0:e.parse)&&(p.parseNothing=!0),f=null!==(n=vB.makeExplicit(f,t,p))&&void 0!==n?n:f,f=new xB(f);const m=t.parent&&kL(t.parent);(OL(t)||wL(t))&&m&&(f=null!==(r=dB.makeFromEncoding(f,t))&&void 0!==r?r:f),t.transforms.length>0&&(f=function(t,e,n){var r,i;let o=0;for(const a of e.transforms){let s,u=void 0;if(NN(a))s=t=new gP(t,a),u="derived";else if(kN(a)){const i=bB(a);s=t=null!==(r=vB.makeWithAncestors(t,{},i,n))&&void 0!==r?r:t,t=new QR(t,e,a.filter)}else if(RN(a))s=t=dB.makeFromTransform(t,a,e),u="number";else if(BN(a)){u="date";void 0===n.getWithExplicit(a.field).value&&(t=new vB(t,{[a.field]:u}),n.set(a.field,u,!1)),s=t=vR.makeFromTransform(t,a)}else if(LN(a))s=t=pB.makeFromTransform(t,a),u="number",KR(e)&&(t=new xB(t));else if(EN(a))s=t=NL.make(t,e,a,o++),u="derived";else if(zN(a))s=t=new UB(t,a),u="number";else if(TN(a))s=t=new LB(t,a),u="number";else if(IN(a))s=t=IB.makeFromTransform(t,a),u="derived";else if(UN(a))s=t=new CL(t,a),u="derived";else if($N(a))s=t=new SL(t,a),u="derived";else if(AN(a))s=t=new BL(t,a),u="derived";else if(FN(a))t=new LL(t,a);else if(PN(a))s=t=TL.makeFromTransform(t,a),u="derived";else if(DN(a))s=t=new DL(t,a),u="derived";else if(MN(a))s=t=new RL(t,a),u="derived";else if(SN(a))s=t=new PL(t,a),u="derived";else{if(!CN(a)){aC(`Ignoring an invalid transform: ${TD(a)}.`);continue}s=t=new $L(t,a),u="derived"}if(s&&void 0!==u)for(const t of null!==(i=s.producedFields())&&void 0!==i?i:[])n.set(t,u,!1)}return t}(f,t,p));const b=function(t){const e={};if(OL(t)&&t.component.selection)for(const n of XD(t.component.selection)){const r=t.component.selection[n];for(const t of r.project.items)!t.channel&&lM(t.field)>1&&(e[t.field]="flatten")}return e}(t),y=yB(t);f=null!==(i=vB.makeWithAncestors(f,{},Object.assign(Object.assign({},b),y),p))&&void 0!==i?i:f,OL(t)&&(f=FL.parseAll(f,t),f=zL.parseAll(f,t)),(OL(t)||wL(t))&&(m||(f=null!==(o=dB.makeFromEncoding(f,t))&&void 0!==o?o:f),f=null!==(a=vR.makeFromEncoding(f,t))&&void 0!==a?a:f,f=gP.parseAllForSortIndex(f,t));const v=t.getDataName(jN.Raw),x=new yR(f,v,jN.Raw,h);if(d[v]=x,f=x,OL(t)){const e=pB.makeFromEncoding(f,t);e&&(f=e,KR(t)&&(f=new xB(f))),f=null!==(s=TL.makeFromEncoding(f,t))&&void 0!==s?s:f,f=null!==(u=IB.makeFromEncoding(f,t))&&void 0!==u?u:f}OL(t)&&(f=null!==(l=ML.make(f,t))&&void 0!==l?l:f);const _=t.getDataName(jN.Main),O=new yR(f,_,jN.Main,h);d[_]=O,f=O,OL(t)&&function(t,e){XR(t,n=>{const r=n.name,i=t.getName("lookup_"+r);t.component.data.outputNodes[i]=n.materialized=new yR(new QR(e,t,{selection:r}),i,jN.Lookup,t.component.data.outputNodeRefCounts)})}(t,O);let w=null;if(wL(t)){const e=t.getName("facet");f=null!==(c=function(t,e){const{row:n,column:r}=e;if(n&&r){let e=null;for(const i of[n,r])if(xz(i.sort)){const{field:n,op:r=mz}=i.sort;t=e=new LB(t,{joinaggregate:[{op:r,field:n,as:VL(i,i.sort,{forAs:!0})}],groupby:[Yz(i)]})}return e}return null}(f,t.facet))&&void 0!==c?c:f,w=new gB(f,t,e,O.getSource()),d[e]=w}return Object.assign(Object.assign({},t.component.data),{outputNodes:d,outputNodeRefCounts:h,raw:x,main:O,facetRoot:w,ancestorParse:p})}class ZL extends EL{constructor(t,e,n,r){var i,o,a,s;super(t,"concat",e,n,r,t.resolve),"shared"!==(null===(o=null===(i=t.resolve)||void 0===i?void 0:i.axis)||void 0===o?void 0:o.x)&&"shared"!==(null===(s=null===(a=t.resolve)||void 0===a?void 0:a.axis)||void 0===s?void 0:s.y)||aC("Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415)."),this.children=this.getChildren(t).map((t,e)=>mI(t,this,this.getName("concat_"+e),void 0,r))}parseData(){this.component.data=KL(this);for(const t of this.children)t.parseData()}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const e of XD(t.component.selection))this.component.selection[e]=t.component.selection[e]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){for(const t of this.children)t.parseAxesAndHeaders()}getChildren(t){return m$(t)?t.vconcat:b$(t)?t.hconcat:t.concat}parseLayoutSize(){!function(t){YL(t);const e=1===t.layout.columns?"width":"childWidth",n=void 0===t.layout.columns?"height":"childHeight";HL(t,e),HL(t,n)}(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(t){return this.children.reduce((t,e)=>e.assembleSelectionTopLevelSignals(t),t)}assembleSignals(){return this.children.forEach(t=>t.assembleSignals()),[]}assembleLayoutSignals(){const t=FP(this);for(const e of this.children)t.push(...e.assembleLayoutSignals());return t}assembleSelectionData(t){return this.children.reduce((t,e)=>e.assembleSelectionData(t),t)}assembleMarks(){return this.children.map(t=>{const e=t.assembleTitle(),n=t.assembleGroupStyle(),r=t.assembleGroupEncodeEntry(!1);return Object.assign(Object.assign(Object.assign(Object.assign({type:"group",name:t.getName("group")},e?{title:e}:{}),n?{style:n}:{}),r?{encode:{update:r}}:{}),t.assembleGroup())})}assembleDefaultLayout(){const t=this.layout.columns;return Object.assign(Object.assign({},null!=t?{columns:t}:{}),{bounds:"full",align:"each"})}}const QL=Object.assign(Object.assign({disable:1,gridScale:1,scale:1},OM),{labelExpr:1,encode:1}),tI=XD(QL);class eI extends cN{constructor(t={},e={},n=!1){super(),this.explicit=t,this.implicit=e,this.mainExtracted=n}clone(){return new eI(CD(this.explicit),CD(this.implicit),this.mainExtracted)}hasAxisPart(t){return"axis"===t||("grid"===t||"title"===t?!!this.get(t):!(!1===(e=this.get(t))||null===e));var e}hasOrientSignalRef(){return wC(this.explicit.orient)}}const nI={bottom:"top",top:"bottom",left:"right",right:"left"};function rI(t,e){if(!t)return e.map(t=>t.clone());{if(t.length!==e.length)return;const n=t.length;for(let r=0;r<n;r++){const n=t[r],i=e[r];if(!!n!=!!i)return;if(n&&i){const e=n.getWithExplicit("orient"),o=i.getWithExplicit("orient");if(e.explicit&&o.explicit&&e.value!==o.value)return;t[r]=iI(n,i)}}}return t}function iI(t,e){for(const n of tI){const r=gN(t.getWithExplicit(n),e.getWithExplicit(n),n,"axis",(t,e)=>{switch(n){case"title":return DT(t,e);case"gridScale":return{explicit:t.explicit,value:cM(t.value,e.value)}}return pN(t,e,n,"axis")});t.setWithExplicit(n,r)}return t}function oI(t,e,n,r,i){if("disable"===e)return void 0!==n;switch(n=n||{},e){case"titleAngle":case"labelAngle":return t===(wC(n.labelAngle)?n.labelAngle:mM(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(t===pP(r,i))return!0}return t===n[e]}const aI=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function sI(t,e){var n,r,i;let o=e.axis(t);const a=new eI,s=nT(e.encoding[t]),{mark:u,config:l}=e,c=(null==o?void 0:o.orient)||(null===(n=l["x"===t?"axisX":"axisY"])||void 0===n?void 0:n.orient)||(null===(r=l.axis)||void 0===r?void 0:r.orient)||function(t){return"x"===t?"bottom":"left"}(t),f=e.getScaleComponent(t).get("type"),d=sP(t,f,c,e.config),h=void 0!==o?!o:lP("disable",l.style,null==o?void 0:o.style,d).configValue;if(a.set("disable",h,void 0!==o),h)return a;o=o||{};const p=function(t,e,n,r,i){const o=null==e?void 0:e.labelAngle;if(void 0!==o)return wC(o)?o:mM(o);{const{configValue:o}=lP("labelAngle",r,null==e?void 0:e.style,i);return void 0!==o?mM(o):"x"!==n||!RD([WC,UC],t.type)||Fz(t)&&t.timeUnit?void 0:270}}(s,o,t,l.style,d),g={fieldOrDatumDef:s,axis:o,channel:t,model:e,scaleType:f,orient:c,labelAngle:p,mark:u,config:l};for(const n of tI){const r=n in cP?cP[n](g):jM(n)?o[n]:void 0,i=void 0!==r,s=oI(r,n,o,e,t);if(i&&s)a.set(n,r,s);else{const{configValue:t,configFrom:e}=jM(n)&&"values"!==n?lP(n,l.style,o.style,d):{},u=void 0!==t;i&&!u?a.set(n,r,s):("vgAxisConfig"!==e||aI.has(n)&&u||vM(t)||wC(t))&&a.set(n,t,!1)}}const m=null!==(i=o.encoding)&&void 0!==i?i:{},b=xM.reduce((n,r)=>{var i;if(!a.hasAxisPart(r))return n;const o=RP(null!==(i=m[r])&&void 0!==i?i:{},e),s="labels"===r?function(t,e,n){var r;const{encoding:i,config:o}=t,a=null!==(r=nT(i[e]))&&void 0!==r?r:nT(i[sS(e)]),s=t.axis(e)||{},{format:u,formatType:l}=s;return oz(l)?Object.assign({text:lz({fieldOrDatumDef:a,field:"datum.value",format:u,formatType:l,config:o})},n):n}(e,t,o):o;return void 0===s||VD(s)||(n[r]={update:s}),n},{});return VD(b)||a.set("encode",b,!!o.encoding||void 0!==o.labelAngle),a}function uI(t,e,n){const r=kF(t),i=_T("orient",r,n);if(r.orient=function(t,e,n){switch(t){case FF:case PF:case BF:case $F:case zF:case SF:return}const{x:r,y:i,x2:o,y2:a}=e;switch(t){case MF:if(Fz(r)&&(DS(r.bin)||Fz(i)&&i.aggregate&&!r.aggregate))return"vertical";if(Fz(i)&&(DS(i.bin)||Fz(r)&&r.aggregate&&!i.aggregate))return"horizontal";if(a||o){if(n)return n;if(!o&&(Fz(r)&&r.type===IC&&!AS(r.bin)||Nz(r)))return"horizontal";if(!a&&(Fz(i)&&i.type===IC&&!AS(i.bin)||Nz(i)))return"vertical"}case TF:if(o&&(!Fz(r)||!DS(r.bin))&&a&&(!Fz(i)||!DS(i.bin)))return;case DF:if(a)return Fz(i)&&DS(i.bin)?"horizontal":"vertical";if(o)return Fz(r)&&DS(r.bin)?"vertical":"horizontal";if(t===TF){if(r&&!i)return"vertical";if(i&&!r)return"horizontal"}case CF:case NF:{const e=$z(r),o=$z(i);if(e&&!o)return"tick"!==t?"horizontal":"vertical";if(!e&&o)return"tick"!==t?"vertical":"horizontal";if(e&&o){const e=r,o=i,a=e.type===qC,s=o.type===qC;return a&&!s?"tick"!==t?"vertical":"horizontal":!a&&s?"tick"!==t?"horizontal":"vertical":!e.aggregate&&o.aggregate?"tick"!==t?"vertical":"horizontal":e.aggregate&&!o.aggregate?"tick"!==t?"horizontal":"vertical":n||"vertical"}return n||void 0}}return"vertical"}(r.type,e,i),void 0!==i&&i!==r.orient&&aC(`Specified orient "${r.orient}" overridden with "${i}".`),"bar"===r.type&&r.orient){const t=_T("cornerRadiusEnd",r,n);if(void 0!==t){const n="horizontal"===r.orient&&e.x2||"vertical"===r.orient&&e.y2?["cornerRadius"]:VF[r.orient];for(const e of n)r[e]=t;void 0!==r.cornerRadiusEnd&&delete r.cornerRadiusEnd}}void 0===_T("opacity",r,n)&&(r.opacity=function(t,e){if(RD([FF,NF,PF,BF],t)&&!FT(e))return.7;return}(r.type,e));return void 0===_T("cursor",r,n)&&(r.cursor=function(t,e,n){if(e.href||t.href||_T("href",t,n))return"pointer";return t.cursor}(r,e,n)),r}function lI(t,e){const{config:n}=t;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},dR(t,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"})),QN("x",t,{defaultPos:"mid"})),QN("y",t,{defaultPos:"mid"})),JN("size",t)),JN("angle",t)),function(t,e,n){if(n)return{shape:{value:n}};return JN("shape",t)}(t,0,e))}function cI(t){var e;const{config:n,markDef:r}=t,{orient:i}=r,o="horizontal"===i?"width":"height",a=t.getScaleComponent("horizontal"===i?"x":"y"),s=null!==(e=_T("size",r,n,{vgChannel:o}))&&void 0!==e?e:n.tick.bandSize;if(void 0!==s)return s;{const t=a?a.get("range"):void 0;if(t&&jC(t)&&Object(Z.F)(t.step))return 3*t.step/4;return 3*O$(n.view,o)/4}}const fI={arc:{vgMark:"arc",encodeEntry:t=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},dR(t,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),QN("x",t,{defaultPos:"mid"})),QN("y",t,{defaultPos:"mid"})),sR(t,"radius","arc")),sR(t,"theta","arc"))},area:{vgMark:"area",encodeEntry:t=>Object.assign(Object.assign(Object.assign(Object.assign({},dR(t,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"})),iR("x",t,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"horizontal"===t.markDef.orient})),iR("y",t,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"vertical"===t.markDef.orient})),pR(t))},bar:{vgMark:"rect",encodeEntry:t=>Object.assign(Object.assign(Object.assign({},dR(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),sR(t,"x","bar")),sR(t,"y","bar"))},circle:{vgMark:"symbol",encodeEntry:t=>lI(t,"circle")},geoshape:{vgMark:"shape",encodeEntry:t=>Object.assign({},dR(t,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),postEncodingTransform:t=>{const{encoding:e}=t,n=e.shape;return[Object.assign({type:"geoshape",projection:t.projectionName()},n&&Fz(n)&&n.type===YC?{field:Yz(n,{expr:"datum"})}:{})]}},image:{vgMark:"image",encodeEntry:t=>Object.assign(Object.assign(Object.assign(Object.assign({},dR(t,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"})),sR(t,"x","image")),sR(t,"y","image")),WN(t,"url"))},line:{vgMark:"line",encodeEntry:t=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},dR(t,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),QN("x",t,{defaultPos:"mid"})),QN("y",t,{defaultPos:"mid"})),JN("size",t,{vgChannel:"strokeWidth"})),pR(t))},point:{vgMark:"symbol",encodeEntry:t=>lI(t)},rect:{vgMark:"rect",encodeEntry:t=>Object.assign(Object.assign(Object.assign({},dR(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),sR(t,"x","rect")),sR(t,"y","rect"))},rule:{vgMark:"rule",encodeEntry:t=>{const{markDef:e}=t,n=e.orient;return t.encoding.x||t.encoding.y||t.encoding.latitude||t.encoding.longitude?Object.assign(Object.assign(Object.assign(Object.assign({},dR(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),iR("x",t,{defaultPos:"horizontal"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"vertical"!==n})),iR("y",t,{defaultPos:"vertical"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"horizontal"!==n})),JN("size",t,{vgChannel:"strokeWidth"})):{}}},square:{vgMark:"symbol",encodeEntry:t=>lI(t,"square")},text:{vgMark:"text",encodeEntry:t=>{const{config:e,encoding:n}=t;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},dR(t,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"})),QN("x",t,{defaultPos:"mid"})),QN("y",t,{defaultPos:"mid"})),WN(t)),JN("size",t,{vgChannel:"fontSize"})),JN("angle",t)),gR("align",function(t,e,n){if(void 0===_T("align",t,n))return"center";return}(t.markDef,0,e))),gR("baseline",function(t,e,n){if(void 0===_T("baseline",t,n))return"middle";return}(t.markDef,0,e))),QN("radius",t,{defaultPos:null,isMidPoint:!0})),QN("theta",t,{defaultPos:null,isMidPoint:!0}))}},tick:{vgMark:"rect",encodeEntry:t=>{const{config:e,markDef:n}=t,r=n.orient,i="horizontal"===r?"width":"height",o="horizontal"===r?"height":"width";return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},dR(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),QN("x",t,{defaultPos:"mid",vgChannel:"xc"})),QN("y",t,{defaultPos:"mid",vgChannel:"yc"})),JN("size",t,{defaultValue:cI(t),vgChannel:i})),{[o]:bT(_T("thickness",n,e))})}},trail:{vgMark:"trail",encodeEntry:t=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},dR(t,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"})),QN("x",t,{defaultPos:"mid"})),QN("y",t,{defaultPos:"mid"})),JN("size",t)),pR(t))}};function dI(t){if(RD([CF,DF,RF],t.mark)){const e=RT(t.mark,t.encoding);if(e.length>0)return function(t,e){return[{name:t.getName("pathgroup"),type:"group",from:{facet:{name:"faceted_path_"+t.requestDataName(jN.Main),data:t.requestDataName(jN.Main),groupby:e}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:hI(t,{fromPrefix:"faceted_path_"})}]}(t,e)}else if(RD([MF],t.mark)){const e=DC.some(e=>_T(e,t.markDef,t.config));if(t.stack&&!t.fieldDef("size")&&e)return function(t){const[e]=hI(t,{fromPrefix:"stack_group_"}),n=t.scaleName(t.stack.fieldChannel),r=(e={})=>t.vgField(t.stack.fieldChannel,e),i=(t,e)=>`${t}(${[r({prefix:"min",suffix:"start",expr:e}),r({prefix:"max",suffix:"start",expr:e}),r({prefix:"min",suffix:"end",expr:e}),r({prefix:"max",suffix:"end",expr:e})].map(t=>`scale('${n}',${t})`).join(",")})`;let o,a;"x"===t.stack.fieldChannel?(o=Object.assign(Object.assign({},FD(e.encode.update,["y","yc","y2","height",...DC])),{x:{signal:i("min","datum")},x2:{signal:i("max","datum")},clip:{value:!0}}),a={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},e.encode.update=Object.assign(Object.assign({},zD(e.encode.update,["y","yc","y2"])),{height:{field:{group:"height"}}})):(o=Object.assign(Object.assign({},FD(e.encode.update,["x","xc","x2","width"])),{y:{signal:i("min","datum")},y2:{signal:i("max","datum")},clip:{value:!0}}),a={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},e.encode.update=Object.assign(Object.assign({},zD(e.encode.update,["x","xc","x2"])),{width:{field:{group:"width"}}}));for(const n of DC){const r=OT(n,t.markDef,t.config);e.encode.update[n]?(o[n]=e.encode.update[n],delete e.encode.update[n]):r&&(o[n]=bT(r)),r&&(e.encode.update[n]={value:0})}const s=t.fieldDef(t.stack.groupbyChannel),u=Yz(s)?[Yz(s)]:[];((null==s?void 0:s.bin)||(null==s?void 0:s.timeUnit))&&u.push(Yz(s,{binSuffix:"end"}));o=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((n,r)=>{if(e.encode.update[r])return Object.assign(Object.assign({},n),{[r]:e.encode.update[r]});{const e=OT(r,t.markDef,t.config);return void 0!==e?Object.assign(Object.assign({},n),{[r]:bT(e)}):n}},o),o.stroke&&(o.strokeForeground={value:!0},o.strokeOffset={value:0});return[{type:"group",from:{facet:{data:t.requestDataName(jN.Main),name:"stack_group_"+t.requestDataName(jN.Main),groupby:u,aggregate:{fields:[r({suffix:"start"}),r({suffix:"start"}),r({suffix:"end"}),r({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:o},marks:[{type:"group",encode:{update:a},marks:[e]}]}]}(t)}return hI(t)}function hI(t,e={fromPrefix:""}){const{mark:n,markDef:r,encoding:i,config:o}=t,a=cM(r.clip,function(t){const e=t.getScaleComponent("x"),n=t.getScaleComponent("y");return!!(e&&e.get("selectionExtent")||n&&n.get("selectionExtent"))||void 0}(t),function(t){const e=t.component.projection;return!(!e||e.isFit)||void 0}(t)),s=xT(r),u=i.key,l=function(t){const{encoding:e,stack:n,mark:r,markDef:i,config:o}=t,a=e.order;if(!(!Object(Z.B)(a)&&Bz(a)&&ND(a.value)||!a&&ND(_T("order",i,o)))){if((Object(Z.B)(a)||Fz(a))&&!n)return kT(a,{expr:"datum"});if(IF(r)){const n="horizontal"===i.orient?"y":"x",r=e[n];if(Fz(r)){const e=r.sort;if(Object(Z.B)(e))return{field:Yz(r,{prefix:n,suffix:"sort_index",expr:"datum"})};if(xz(e))return{field:Yz({aggregate:FT(t.encoding)?e.op:void 0,field:e.field},{expr:"datum"})};if(vz(e)){return{field:Yz(t.fieldDef(e.encoding),{expr:"datum"}),order:e.order}}return null===e?void 0:{field:Yz(r,{binSuffix:t.stack&&t.stack.impute?"mid":void 0,expr:"datum"})}}}else;}}(t),c=function(t){if(!t.component.selection)return null;const e=XD(t.component.selection).length;let n=e,r=t.parent;for(;r&&0===n;)n=XD(r.component.selection).length,r=r.parent;return n?{interactive:e>0||!!t.encoding.tooltip}:null}(t),f=_T("aria",r,o),d=fI[n].postEncodingTransform?fI[n].postEncodingTransform(t):null;return[Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:t.getName("marks"),type:fI[n].vgMark},a?{clip:!0}:{}),s?{style:s}:{}),u?{key:u.field}:{}),l?{sort:l}:{}),c||{}),!1===f?{aria:f}:{}),{from:{data:e.fromPrefix+t.requestDataName(jN.Main)},encode:{update:fI[n].encodeEntry(t)}}),d?{transform:d}:{})]}class pI extends AL{constructor(t,e,n,r={},i){super(t,"unit",e,n,i,void 0,v$(t)?t.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection={},this.children=[];const o=WF(t.mark)?Object.assign({},t.mark):{type:t.mark},a=o.type;void 0===o.filled&&(o.filled=function(t,e,{graticule:n}){if(n)return!1;const r=OT("filled",t,e),i=t.type;return cM(r,i!==FF&&i!==CF&&i!==TF)}(o,i,{graticule:t.data&&wN(t.data)}));const s=this.encoding=TT(t.encoding||{},a,o.filled,i);this.markDef=uI(o,s,i),this.size=function({encoding:t,size:e}){for(const n of dS){const r=uS(n);y$(e[r])&&$z(t[n])&&(delete e[r],aC(QS(r)))}return e}({encoding:s,size:v$(t)?Object.assign(Object.assign(Object.assign({},r),t.width?{width:t.width}:{}),t.height?{height:t.height}:{}):r}),this.stack=U$(a,s),this.specifiedScales=this.initScales(a,s),this.specifiedAxes=this.initAxes(s),this.specifiedLegends=this.initLegends(s),this.specifiedProjection=t.projection,this.selection=t.selection}get hasProjection(){const{encoding:t}=this,e=this.mark===LF,n=t&&GM.some(e=>Rz(t[e]));return e||n}scaleDomain(t){const e=this.specifiedScales[t];return e?e.domain:void 0}axis(t){return this.specifiedAxes[t]}legend(t){return this.specifiedLegends[t]}initScales(t,e){return xS.reduce((t,n)=>{var r;const i=nT(e[n]);return i&&(t[n]=this.initScale(null!==(r=i.scale)&&void 0!==r?r:{})),t},{})}initScale(t){const{domain:e,range:n}=t,r=kF(t);return Object(Z.B)(e)&&(r.domain=e.map(gT)),Object(Z.B)(n)&&(r.range=n.map(gT)),r}initAxes(t){return dS.reduce((e,n)=>{const r=t[n];if(Rz(r)||"x"===n&&Rz(t.x2)||"y"===n&&Rz(t.y2)){const t=Rz(r)?r.axis:void 0;e[n]=t?this.initAxis(Object.assign({},t)):t}return e},{})}initAxis(t){const e=XD(t),n={};for(const r of e){const e=t[r];n[r]=vM(e)?pT(e):gT(e)}return n}initLegends(t){return yS.reduce((e,n)=>{const r=nT(t[n]);if(r&&function(t){switch(t){case LM:case IM:case UM:case"size":case qM:case"opacity":case"strokeWidth":case"strokeDash":return!0;case"fillOpacity":case"strokeOpacity":case"angle":return!1}}(n)){const t=r.legend;e[n]=t?kF(t):t}return e},{})}parseData(){this.component.data=KL(this)}parseLayoutSize(){!function(t){const{size:e,component:n}=t;for(const r of dS){const i=uS(r);if(e[i]){const t=e[i];n.layoutSize.set(i,y$(t)?"step":t,!0)}else{const e=GL(t,i);n.layoutSize.set(i,e,!1)}}}(this)}parseSelections(){this.component.selection=function(t,e){var n;const r={},i=t.config.selection;for(const o of XD(null!=e?e:{})){const a=CD(e[o]),s=bD(i[a.type],["fields","encodings"]);for(const t in s)"encodings"===t&&a.fields||"fields"===t&&a.encodings||("mark"===t&&(a[t]=Object.assign(Object.assign({},s[t]),a[t])),void 0!==a[t]&&!0!==a[t]||(a[t]=null!==(n=s[t])&&void 0!==n?n:a[t]));const u=QD(o),l=r[u]=Object.assign(Object.assign({},a),{name:u,events:Object(Z.I)(a.on)?Kj(a.on,"scope"):CD(a.on)});TR(l,n=>{n.has(l)&&n.parse&&n.parse(t,l,a,e[o])})}return r}(this,this.selection)}parseMarkGroup(){this.component.mark=dI(this)}parseAxesAndHeaders(){var t;this.component.axes=(t=this,dS.reduce((e,n)=>(t.component.scales[n]&&(e[n]=[sI(n,t)]),e),{}))}assembleSelectionTopLevelSignals(t){return function(t,e){let n=!1;if(XR(t,(r,i)=>{const o=r.name,a=Object(Z.ab)(o+WR);if(0===e.filter(t=>t.name===o).length){const t="global"===r.resolve?"union":r.resolve,n="multi"===r.type?", true)":")";e.push({name:r.name,update:`${GR}(${a}, ${Object(Z.ab)(t)}${n}`})}n=!0,i.topLevelSignals&&(e=i.topLevelSignals(t,r,e)),TR(r,n=>{n.topLevelSignals&&(e=n.topLevelSignals(t,r,e))})}),n){0===e.filter(t=>"unit"===t.name).length&&e.unshift({name:"unit",value:{},on:[{events:"mousemove",update:"isTuple(group()) ? group() : unit"}]})}return RR(e)}(this,t)}assembleSignals(){return[...oP(this),...(t=this,e=[],XR(t,(n,r)=>{const i=n.name;let o=r.modifyExpr(t,n);e.push(...r.signals(t,n)),TR(n,r=>{r.signals&&(e=r.signals(t,n,e)),r.modifyExpr&&(o=r.modifyExpr(t,n,o))}),e.push({name:i+HR,on:[{events:{signal:n.name+YR},update:`modify(${Object(Z.ab)(n.name+WR)}, ${o})`}]})}),RR(e))];var t,e}assembleSelectionData(t){return function(t,e){const n=[...e];return XR(t,e=>{const r={name:e.name+WR};if(e.init){const n=e.project.items.map(t=>bD(t,["signals"])),i=e.init.map(t=>$R(t,!1));r.values="interval"===e.type?[{unit:JR(t,{escape:!1}),fields:n,values:i}]:i.map(e=>({unit:JR(t,{escape:!1}),fields:n,values:e}))}n.filter(t=>t.name===e.name+WR).length||n.push(r)}),n}(this,t)}assembleLayout(){return null}assembleLayoutSignals(){return FP(this)}assembleMarks(){var t;let e=null!==(t=this.component.mark)&&void 0!==t?t:[];return this.parent&&kL(this.parent)||(e=NR(this,e)),e.map(this.correctDataNames)}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(t){return CT(this.encoding,t)}fieldDef(t){return eT(this.encoding[t])}typedFieldDef(t){const e=this.fieldDef(t);return Pz(e)?e:null}}class gI extends EL{constructor(t,e,n,r,i){super(t,"layer",e,n,i,t.resolve,t.view);const o=Object.assign(Object.assign(Object.assign({},r),t.width?{width:t.width}:{}),t.height?{height:t.height}:{});this.children=t.layer.map((t,e)=>{if(R$(t))return new gI(t,this,this.getName("layer_"+e),o,i);if(MT(t))return new pI(t,this,this.getName("layer_"+e),o,i);throw new Error(FS(t))})}parseData(){this.component.data=KL(this);for(const t of this.children)t.parseData()}parseLayoutSize(){var t;YL(t=this),HL(t,"width"),HL(t,"height")}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const e of XD(t.component.selection))this.component.selection[e]=t.component.selection[e]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){!function(t){var e;const{axes:n,resolve:r}=t.component,i={top:0,bottom:0,right:0,left:0};for(const e of t.children){e.parseAxesAndHeaders();for(const i of XD(e.component.axes))r.axis[i]=BP(t.component.resolve,i),"shared"===r.axis[i]&&(n[i]=rI(n[i],e.component.axes[i]),n[i]||(r.axis[i]="independent",delete n[i]))}for(const o of dS){for(const a of t.children)if(a.component.axes[o]){if("independent"===r.axis[o]){n[o]=(null!==(e=n[o])&&void 0!==e?e:[]).concat(a.component.axes[o]);for(const t of a.component.axes[o]){const{value:e,explicit:n}=t.getWithExplicit("orient");if(!wC(e)){if(i[e]>0&&!n){const n=nI[e];i[e]>i[n]&&t.set("orient",n,!1)}i[e]++}}}delete a.component.axes[o]}if("independent"===r.axis[o]&&n[o]&&n[o].length>1)for(const t of n[o])t.get("grid")&&!t.explicit.grid&&(t.implicit.grid=!1)}}(this)}assembleSelectionTopLevelSignals(t){return this.children.reduce((t,e)=>e.assembleSelectionTopLevelSignals(t),t)}assembleSignals(){return this.children.reduce((t,e)=>t.concat(e.assembleSignals()),oP(this))}assembleLayoutSignals(){return this.children.reduce((t,e)=>t.concat(e.assembleLayoutSignals()),FP(this))}assembleSelectionData(t){return this.children.reduce((t,e)=>e.assembleSelectionData(t),t)}assembleTitle(){let t=super.assembleTitle();if(t)return t;for(const e of this.children)if(t=e.assembleTitle(),t)return t}assembleLayout(){return null}assembleMarks(){return function(t,e){for(const n of t.children)OL(n)&&(e=NR(n,e));return e}(this,this.children.flatMap(t=>t.assembleMarks()))}assembleLegends(){return this.children.reduce((t,e)=>t.concat(e.assembleLegends()),rB(this))}}function mI(t,e,n,r,i){if(jz(t))return new XL(t,e,n,i);if(R$(t))return new gI(t,e,n,r,i);if(MT(t))return new pI(t,e,n,r,i);if(function(t){return m$(t)||b$(t)||g$(t)}(t))return new ZL(t,e,n,i);throw new Error(FS(t))}function bI(t,e={}){var n;e.logger&&(n=e.logger,oC=n),e.fieldTitle&&Jz(e.fieldTitle);try{const n=C$(Object(Z.O)(e.config,t.config)),r=oN(t,n),i=mI(r,null,"",void 0,n);i.parse(),function(t,e){YB(t.sources);let n=0,r=0;for(let r=0;r<5&&GB(t,e,!0);r++)n++;t.sources.map(qB);for(let n=0;n<5&&GB(t,e,!1);n++)r++;YB(t.sources),5===Math.max(n,r)&&aC("Maximum optimization runs(5) reached.")}(i.component.data,i);return{spec:function(t,e,n={},r){const i=t.config?$$(t.config):void 0,o=[].concat(t.assembleSelectionData([]),function(t,e){var n,r;const i=[],o=IL(i);let a=0;for(const e of t.sources){e.hasName()||(e.dataName="source_"+a++);const t=e.assemble();o(e,t)}for(const t of i)0===t.transform.length&&delete t.transform;let s=0;for(const[t,e]of i.entries())0!==(null!==(n=e.transform)&&void 0!==n?n:[]).length||e.source||i.splice(s++,0,i.splice(t,1)[0]);for(const e of i)for(const n of null!==(r=e.transform)&&void 0!==r?r:[])"lookup"===n.type&&(n.from=t.outputNodes[n.from].getSource());for(const t of i)t.name in e&&(t.values=e[t.name]);return i}(t.component.data,n)),a=t.assembleProjections(),s=t.assembleTitle(),u=t.assembleGroupStyle(),l=t.assembleGroupEncodeEntry(!0);let c=t.assembleLayoutSignals();c=c.filter(t=>"width"!==t.name&&"height"!==t.name||void 0===t.value||(e[t.name]=+t.value,!1));const{params:f}=e,d=bD(e,["params"]);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"},t.description?{description:t.description}:{}),d),s?{title:s}:{}),u?{style:u}:{}),l?{encode:{update:l}}:{}),{data:o}),a.length>0?{projections:a}:{}),t.assembleGroup([...c,...t.assembleSelectionTopLevelSignals([]),...f$(f)])),i?{config:i}:{}),r?{usermeta:r}:{})}(i,function(t,e,n,r){const i=r.component.layoutSize.get("width"),o=r.component.layoutSize.get("height");void 0===e?(e={type:"pad"},r.hasAxisOrientSignalRef()&&(e.resize=!0)):Object(Z.I)(e)&&(e={type:e});if(i&&o&&(a=e.type,"fit"===a||"fit-x"===a||"fit-y"===a))if("step"===i&&"step"===o)aC($S()),e.type="pad";else if("step"===i||"step"===o){const t="step"===i?"width":"height";aC($S(mS(t)));const n="width"===t?"height":"width";e.type=function(t){return t?"fit-"+mS(t):"fit"}(n)}var a;return Object.assign(Object.assign(Object.assign({},1===XD(e).length&&e.type?"pad"===e.type?{}:{autosize:e.type}:{autosize:e}),lN(n,!1)),lN(t,!0))}(t,r.autosize,n,i),t.datasets,t.usermeta),normalized:r}}finally{e.logger&&(oC=iC),e.fieldTitle&&Jz(Vz)}}var yI=function(t){const[e,n]=/\/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(t).slice(1,3);return{library:e,version:n}};const vI={background:"#333",title:{color:"#fff"},style:{"guide-label":{fill:"#fff"},"guide-title":{fill:"#fff"}},axis:{domainColor:"#fff",gridColor:"#888",tickColor:"#fff"}},xI={background:"#fff",arc:{fill:"#4572a7"},area:{fill:"#4572a7"},line:{stroke:"#4572a7",strokeWidth:2},path:{stroke:"#4572a7"},rect:{fill:"#4572a7"},shape:{stroke:"#4572a7"},symbol:{fill:"#4572a7",strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},_I={arc:{fill:"#30a2da"},area:{fill:"#30a2da"},axis:{domainColor:"#cbcbcb",grid:!0,gridColor:"#cbcbcb",gridWidth:1,labelColor:"#999",labelFontSize:10,titleColor:"#333",tickColor:"#cbcbcb",tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:"#f0f0f0",group:{fill:"#f0f0f0"},legend:{labelColor:"#333",labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:"#333",titleFontSize:14,titlePadding:10},line:{stroke:"#30a2da",strokeWidth:2},path:{stroke:"#30a2da",strokeWidth:.5},rect:{fill:"#30a2da"},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:!0,shape:"circle"},shape:{stroke:"#30a2da"},bar:{binSpacing:2,fill:"#30a2da",stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},OI={group:{fill:"#e5e5e5"},arc:{fill:"#000"},area:{fill:"#000"},line:{stroke:"#000"},path:{stroke:"#000"},rect:{fill:"#000"},shape:{stroke:"#000"},symbol:{fill:"#000",size:40},axis:{domain:!1,grid:!0,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"]}},wI="Benton Gothic Bold, sans-serif",jI={"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"]},kI={background:"#ffffff",title:{anchor:"start",color:"#000000",font:wI,fontSize:22,fontWeight:"normal"},arc:{fill:"#82c6df"},area:{fill:"#82c6df"},line:{stroke:"#82c6df",strokeWidth:2},path:{stroke:"#82c6df"},rect:{fill:"#82c6df"},shape:{stroke:"#82c6df"},symbol:{fill:"#82c6df",size:30},axis:{labelFont:"Benton Gothic, sans-serif",labelFontSize:11.5,labelFontWeight:"normal",titleFont:wI,titleFontSize:13,titleFontWeight:"normal"},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:"Benton Gothic, sans-serif",labelFontSize:11.5,symbolType:"square",titleFont:wI,titleFontSize:13,titleFontWeight:"normal"},range:{category:jI["category-6"],diverging:jI["fireandice-6"],heatmap:jI["fire-7"],ordinal:jI["fire-7"],ramp:jI["fire-7"]}},EI={background:"#f9f9f9",arc:{fill:"#ab5787"},area:{fill:"#ab5787"},line:{stroke:"#ab5787"},path:{stroke:"#ab5787"},rect:{fill:"#ab5787"},shape:{stroke:"#ab5787"},symbol:{fill:"#ab5787",size:30},axis:{domainColor:"#979797",domainWidth:.5,gridWidth:.2,labelColor:"#979797",tickColor:"#979797",tickWidth:.2,titleColor:"#979797"},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},AI={background:"#fff",arc:{fill:"#3e5c69"},area:{fill:"#3e5c69"},line:{stroke:"#3e5c69"},path:{stroke:"#3e5c69"},rect:{fill:"#3e5c69"},shape:{stroke:"#3e5c69"},symbol:{fill:"#3e5c69"},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},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"]}},DI={"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"]},MI={background:"#FFFFFF",title:{anchor:"start",fontSize:18,font:"Lato"},axisX:{domain:!0,domainColor:"#000000",domainWidth:1,grid:!1,labelFontSize:12,labelFont:"Lato",labelAngle:0,tickColor:"#000000",tickSize:5,titleFontSize:12,titlePadding:10,titleFont:"Lato"},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:"#DEDDDD",gridWidth:1,labelFontSize:12,labelFont:"Lato",labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:"Lato",titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:"Lato",symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:"Lato",orient:"right",offset:10},view:{stroke:"transparent"},range:{category:DI["six-groups-cat-1"],diverging:DI["diverging-colors"],heatmap:DI["diverging-colors"],ordinal:DI["six-groups-seq"],ramp:DI["shades-blue"]},area:{fill:"#1696d2"},rect:{fill:"#1696d2"},line:{color:"#1696d2",stroke:"#1696d2",strokeWidth:5},trail:{color:"#1696d2",stroke:"#1696d2",strokeWidth:0,size:1},path:{stroke:"#1696d2",strokeWidth:.5},point:{filled:!0},text:{font:"Lato",color:"#1696d2",fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:"#1696d2",stroke:null}},arc:{fill:"#1696d2"},shape:{stroke:"#1696d2"},symbol:{fill:"#1696d2",size:30}},SI={arc:{fill:"#3366CC"},area:{fill:"#3366CC"},path:{stroke:"#3366CC"},rect:{fill:"#3366CC"},shape:{stroke:"#3366CC"},symbol:{stroke:"#3366CC"},circle:{fill:"#3366CC"},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:"Arial, sans-serif",fontSize:12},"guide-title":{font:"Arial, sans-serif",fontSize:12},"group-title":{font:"Arial, sans-serif",fontSize:12}},title:{font:"Arial, sans-serif",fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:"#ccc",tickColor:"#ccc",domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},CI="2.9.1";var FI="#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 zI="vg-tooltip-element",TI={offsetX:10,offsetY:10,id:zI,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:function(t){return String(t).replace(/&/g,"&").replace(/</g,"<")},maxDepth:2};function $I(t,e,n){if(Object(Z.B)(t))return`[${t.map(t=>e(Object(Z.I)(t)?t:NI(t,n))).join(", ")}]`;if(Object(Z.G)(t)){let r="";const i=t,{title:o,image:a}=i,s=
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(i,["title","image"]);o&&(r+=`<h2>${e(o)}</h2>`),a&&(r+=`<img src="${e(a)}">`);const u=Object.keys(s);if(u.length>0){r+="<table>";for(const t of u){let i=s[t];void 0!==i&&(Object(Z.G)(i)&&(i=NI(i,n)),r+=`<tr><td class="key">${e(t)}:</td><td class="value">${e(i)}</td></tr>`)}r+="</table>"}return r||"{}"}return e(t)}function NI(t,e){return JSON.stringify(t,function(t){const e=[];return function(n,r){if("object"!=typeof r||null===r)return r;const i=e.indexOf(this)+1;return e.length=i,e.length>t?"[Object]":e.indexOf(r)>=0?"[Circular]":(e.push(r),r)}}(e))}class RI{constructor(t){this.options=Object.assign(Object.assign({},TI),t);const e=this.options.id;if(this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const t=document.createElement("style");t.setAttribute("id",this.options.styleId),t.innerHTML=function(t){if(!/^[A-Za-z]+[-:.\w]*$/.test(t))throw new Error("Invalid HTML ID");return FI.toString().replace(zI,t)}(e);const n=document.head;n.childNodes.length>0?n.insertBefore(t,n.childNodes[0]):n.appendChild(t)}this.el=document.getElementById(e),this.el||(this.el=document.createElement("div"),this.el.setAttribute("id",e),this.el.classList.add("vg-tooltip"),document.body.appendChild(this.el))}tooltipHandler(t,e,n,r){if(null==r||""===r)return void this.el.classList.remove("visible",this.options.theme+"-theme");this.el.innerHTML=$I(r,this.options.sanitize,this.options.maxDepth),this.el.classList.add("visible",this.options.theme+"-theme");const{x:i,y:o}=function(t,e,n,r){let i=t.clientX+n;i+e.width>window.innerWidth&&(i=+t.clientX-n-e.width);let o=t.clientY+r;return o+e.height>window.innerHeight&&(o=+t.clientY-r-e.height),{x:i,y:o}}(e,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY);this.el.setAttribute("style",`top: ${o}px; left: ${i}px`)}}
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
function PI(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))}var BI,LI='.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';function II(t,...e){for(const n of e)UI(t,n);return t}function UI(t,e){for(const n of Object.keys(e))Object(Z.kb)(t,n,e[n],!0)}String.prototype.startsWith||(String.prototype.startsWith=function(t,e){return this.substr(!e||e<0?0:+e,t.length)===t});const qI=b;let WI=y;const YI="undefined"!=typeof window?window:void 0;void 0===WI&&(null===(BI=null==YI?void 0:YI.vl)||void 0===BI?void 0:BI.compile)&&(WI=YI.vl);const HI={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},GI={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"},VI={vega:"Vega","vega-lite":"Vega-Lite"},XI={vega:qI.version,"vega-lite":WI?WI.version:"not available"},JI={vega:t=>t,"vega-lite":(t,e)=>WI.compile(t,{config:e}).spec};function KI(t,e,n,r){const i=`<html><head>${e}</head><body><pre><code class="json">`,o=`</code></pre>${n}</body></html>`,a=window.open("");a.document.write(i+t+o),a.document.title=VI[r]+" JSON Source"}function ZI(t,e){var n;return PI(this,void 0,void 0,(function*(){const r=Object(Z.I)(t.config)?JSON.parse(yield e.load(t.config)):null!==(n=t.config)&&void 0!==n?n:{},i=Object(Z.I)(t.patch)?JSON.parse(yield e.load(t.patch)):t.patch;return Object.assign(Object.assign(Object.assign({},t),i?{patch:i}:{}),r?{config:r}:{})}))}var QI=function(t,e,n={}){var r,i,o;return PI(this,void 0,void 0,(function*(){const a=(s=n.loader)&&"load"in s?n.loader:qI.loader(n.loader);var s;const u=Object(Z.I)(e)?JSON.parse(yield a.load(e)):e,l=yield ZI(null!==(r=u.usermeta&&u.usermeta.embedOptions)&&void 0!==r?r:{},a),c=yield ZI(n,a),f=Object.assign(Object.assign({},II(c,l)),{config:Object(Z.O)(null!==(i=c.config)&&void 0!==i?i:{},null!==(o=l.config)&&void 0!==o?o:{})});return yield function(t,e,n={},r){var i,o,a,s,u,l;return PI(this,void 0,void 0,(function*(){const c=n.theme?Object(Z.O)(v[n.theme],null!==(i=n.config)&&void 0!==i?i:{}):n.config,f=Object(Z.C)(n.actions)?n.actions:II({},HI,null!==(o=n.actions)&&void 0!==o?o:{}),d=Object.assign(Object.assign({},GI),n.i18n),h=null!==(a=n.renderer)&&void 0!==a?a:"canvas",p=null!==(s=n.logLevel)&&void 0!==s?s:qI.Warn,g=null!==(u=n.downloadFileName)&&void 0!==u?u:"visualization",m="string"==typeof t?document.querySelector(t):t;if(!m)throw new Error(t+" does not exist");if(!1!==n.defaultStyle){const t="vega-embed-style",{root:e,rootContainer:r}=function(t){var e;const n=t.getRootNode?t.getRootNode():document;return n instanceof ShadowRoot?{root:n,rootContainer:n}:{root:document,rootContainer:null!==(e=document.head)&&void 0!==e?e:document.body}}(m);if(!e.getElementById(t)){const e=document.createElement("style");e.id=t,e.innerText=void 0===n.defaultStyle||!0===n.defaultStyle?LI.toString():n.defaultStyle,r.appendChild(e)}}const b=function(t,e){var n;if(t.$schema){const r=yI(t.$schema);e&&e!==r.library&&console.warn(`The given visualization spec is written in ${VI[r.library]}, but mode argument sets ${null!==(n=VI[e])&&void 0!==n?n:e}.`);const i=r.library;return Object(K.satisfies)(XI[i],"^"+r.version.slice(1))||console.warn(`The input spec uses ${VI[i]} ${r.version}, but the current version of ${VI[i]} is v${XI[i]}.`),i}return"mark"in t||"encoding"in t||"layer"in t||"hconcat"in t||"vconcat"in t||"facet"in t||"repeat"in t?"vega-lite":"marks"in t||"signals"in t||"scales"in t||"axes"in t?"vega":null!=e?e:"vega"}(e,n.mode);let y=JI[b](e,c);if("vega-lite"===b&&y.$schema){const t=yI(y.$schema);Object(K.satisfies)(XI.vega,"^"+t.version.slice(1))||console.warn(`The compiled spec uses Vega ${t.version}, but current version is v${XI.vega}.`)}m.classList.add("vega-embed"),f&&m.classList.add("has-actions"),m.innerHTML="";let x=m;if(f){const t=document.createElement("div");t.classList.add("chart-wrapper"),m.appendChild(t),x=t}const _=n.patch;_&&(y=_ instanceof Function?_(y):N(y,_,!0,!1).newDocument),n.formatLocale&&qI.formatLocale(n.formatLocale),n.timeFormatLocale&&qI.timeFormatLocale(n.timeFormatLocale);const{ast:O}=n,w=qI.parse(y,"vega-lite"===b?{}:c,{ast:O}),j=new qI.View(w,Object.assign({loader:r,logLevel:p,renderer:h},O?{expr:qI.expressionInterpreter}:{}));if(!1!==n.tooltip){let t;t="function"==typeof n.tooltip?n.tooltip:new RI(!0===n.tooltip?{}:n.tooltip).call,j.tooltip(t)}let k,{hover:E}=n;if(void 0===E&&(E="vega"===b),E){const{hoverSet:t,updateSet:e}="boolean"==typeof E?{}:E;j.hover(t,e)}if(n&&(null!=n.width&&j.width(n.width),null!=n.height&&j.height(n.height),null!=n.padding&&j.padding(n.padding)),yield j.initialize(x).runAsync(),!1!==f){let t=m;if(!1!==n.defaultStyle){const e=document.createElement("details");e.title=d.CLICK_TO_VIEW_ACTIONS,m.append(e),t=e;const n=document.createElement("summary");n.innerHTML='\n<svg viewBox="0 0 16 16" fill="currentColor" stroke="none" stroke-width="1" stroke-linecap="round" stroke-linejoin="round">\n <circle r="2" cy="8" cx="2"></circle>\n <circle r="2" cy="8" cx="8"></circle>\n <circle r="2" cy="8" cx="14"></circle>\n</svg>',e.append(n),k=t=>{e.contains(t.target)||e.removeAttribute("open")},document.addEventListener("click",k)}const r=document.createElement("div");if(t.append(r),r.classList.add("vega-actions"),!0===f||!1!==f.export)for(const t of["svg","png"])if(!0===f||!0===f.export||f.export[t]){const e=d[t.toUpperCase()+"_ACTION"],i=document.createElement("a");i.text=e,i.href="#",i.target="_blank",i.download=`${g}.${t}`,i.addEventListener("mousedown",(function(e){return PI(this,void 0,void 0,(function*(){e.preventDefault();const r=yield j.toImageURL(t,n.scaleFactor);this.href=r}))})),r.append(i)}if(!0===f||!1!==f.source){const t=document.createElement("a");t.text=d.SOURCE_ACTION,t.href="#",t.addEventListener("click",(function(t){var r,i;KI(J()(e),null!==(r=n.sourceHeader)&&void 0!==r?r:"",null!==(i=n.sourceFooter)&&void 0!==i?i:"",b),t.preventDefault()})),r.append(t)}if("vega-lite"===b&&(!0===f||!1!==f.compiled)){const t=document.createElement("a");t.text=d.COMPILED_ACTION,t.href="#",t.addEventListener("click",(function(t){var e,r;KI(J()(y),null!==(e=n.sourceHeader)&&void 0!==e?e:"",null!==(r=n.sourceFooter)&&void 0!==r?r:"","vega"),t.preventDefault()})),r.append(t)}if(!0===f||!1!==f.editor){const t=null!==(l=n.editorUrl)&&void 0!==l?l:"https://vega.github.io/editor/",i=document.createElement("a");i.text=d.EDITOR_ACTION,i.href="#",i.addEventListener("click",(function(n){!function(t,e,n){const r=t.open(e),{origin:i}=new URL(e);let o=40;t.addEventListener("message",(function e(n){n.source===r&&(o=0,t.removeEventListener("message",e,!1))}),!1),setTimeout((function t(){o<=0||(r.postMessage(n,i),setTimeout(t,250),o-=1)}),250)}(window,t,{config:c,mode:b,renderer:h,spec:J()(e)}),n.preventDefault()})),r.append(i)}}return{view:j,spec:e,vgSpec:y,finalize:function(){k&&document.removeEventListener("click",k),j.finalize()}}}))}(t,u,f,a)}))},tU=n(2),eU=n(7),nU=n.n(eU);const rU={bin_type:{label:"Binning Type",section:" Values",type:"string",order:2,display:"select",values:[{"Max Bins":"bins"},{Steps:"steps"},{Breakpoints:"breakpoints"}],default:"bins"},bin_style:{label:"Chart Type",section:" Values",type:"string",order:1,display:"select",default:"simple_hist",values:[{"Simple Histogram":"simple_hist"},{"Scatter Histogram":"binned_hist"}]},winsorization:{label:"Limit Outliers (Winsorize)",section:" Values",type:"boolean",order:7,default:!1},color_col:{type:"string",section:" Style",label:"Color",display:"color",display_size:"half",default:"#1A73E8",order:3},color_on_hover:{type:"string",section:" Style",label:"Color On Hover",display:"color",display_size:"half",default:"#338bff",order:4},x_axis_label_divider:{label:"X Axis -------------------------------------------------------",section:"Labels",type:"string",display:"divider",order:6},x_axis_override:{label:"X Axis Title Override",section:"Labels",type:"string",display:"text",default:"",order:7},x_grids:{label:"X Axis Gridlines",section:" Style",type:"boolean",display:"select",display_size:"half",default:!0},x_axis_title_font_size:{label:"X Axis Title Size",section:"Labels",type:"number",default:16,display_size:"half",order:9},x_axis_label_font_size:{label:"X Axis Label Size",section:"Labels",type:"number",default:12,display_size:"half",order:10},x_axis_label_angle:{label:"X Axis Label Angle",section:"Labels",type:"number",display:"range",default:0,order:11,min:0,max:90,step:1,display_size:"half"},x_label_separation:{label:"X Axis Label Density",section:"Labels",type:"number",display:"range",default:100,order:12,min:1,max:100,step:1,display_size:"half"},y_axis_label_divider:{label:"Y Axis -------------------------------------------------------",section:"Labels",type:"string",display:"divider",order:13},y_axis_override:{label:"Y Axis Title Override",section:"Labels",type:"string",display:"text",default:"",order:14},y_grids:{label:"Y Axis Gridlines",section:" Style",type:"boolean",display:"select",display_size:"half",order:15,default:!0},y_axis_title_font_size:{label:"Y Axis Title Size",section:"Labels",type:"number",default:16,display_size:"half",order:16},y_axis_label_font_size:{label:"Y Axis Label Size",section:"Labels",type:"number",default:12,display_size:"half",order:17},y_axis_label_angle:{label:"Y Axis Label Angle",section:"Labels",type:"number",display:"range",default:0,order:18,min:0,max:90,step:1,display_size:"half"},y_label_separation:{label:"Y Axis Label Density",section:"Labels",type:"number",display:"range",default:100,order:19,min:1,max:100,step:1,display_size:"half"},x_axis_value_format:{label:"X Axis Value Format",order:200,section:" Values",type:"string",display:"text",default:"",placeholder:"Spreadsheet Style Value Format"}};function iU(t,e,n){return[{title:""!==e?e:t.title,bin:n,field:n.binned?"label":t.lookerName.replace(".","_"),type:n.binned?"ordinal":"quantitative"},{title:"Count of Records",aggregate:"count",type:"quantitative",...!n.binned&&{aggregate:"count"},...n.binned&&{field:"count_x"}}]}var oU=function({dataProperties:t,config:e,maxX:n,width:r}){return{selection:{grid:{type:"interval",bind:"scales"},highlight:{type:"single",empty:"none",on:"mouseover"}},name:"X_HISTOGRAM",mark:{type:"bar",cursor:"pointer"},height:60,width:r,encoding:{x:{bin:{..."bins"===e.bin_type&&{maxbins:e.max_bins},..."steps"===e.bin_type&&{step:e.num_step_x<=Math.floor(n/200)?Math.floor(n/200):e.num_step_x},..."breakpoints"===e.bin_type&&{binned:!0}},field:"breakpoints"===e.bin_type?"bin_start_x":e.x,type:"quantitative",axis:{grid:e.x_grids,title:null,labels:!1,ticks:!1}},..."breakpoints"===e.bin_type&&{x2:{field:"bin_end_x"}},y:{..."breakpoints"!==e.bin_type&&{aggregate:"count"},..."breakpoints"===e.bin_type&&{field:"count_x"},type:"quantitative",title:"",axis:{labelColor:"#696969",titleColor:"#696969",grid:e.y_grids}},tooltip:iU(t[e.x],e.x_axis_override,{..."bins"===e.bin_type&&{maxbins:e.max_bins},..."steps"===e.bin_type&&{step:e.num_step_x<=Math.floor(n/200)?Math.floor(n/200):e.num_step_x},..."breakpoints"===e.bin_type&&{binned:!0}}),color:{condition:{selection:"highlight",value:e.color_on_hover},value:e.color_col}}}};var aU=({dataProperties:t,config:e,maxY:n,height:r})=>({selection:{grid:{type:"interval",bind:"scales"},highlight:{type:"single",empty:"none",on:"mouseover"}},name:"Y_HISTOGRAM",mark:{type:"bar",cursor:"pointer"},width:60,height:r,encoding:{y:{bin:{..."bins"===e.bin_type&&{maxbins:e.max_bins},..."steps"===e.bin_type&&{step:e.num_step_y<=Math.floor(n/200)?Math.floor(n/200):e.num_step_y},..."breakpoints"===e.bin_type&&{binned:!0}},field:"breakpoints"===e.bin_type?"bin_start_y":e.y,type:"quantitative",axis:{grid:e.y_grids,title:null,labels:!1,ticks:!1}},..."breakpoints"===e.bin_type&&{y2:{field:"bin_end_y"}},x:{..."breakpoints"!==e.bin_type&&{aggregate:"count"},..."breakpoints"===e.bin_type&&{field:"count_y"},type:"quantitative",title:"",axis:{labelColor:"#696969",titleColor:"#696969",grid:e.x_grids,title:null}},tooltip:iU(t[e.y],e.y_axis_override,{..."bins"===e.bin_type&&{maxbins:e.max_bins},..."steps"===e.bin_type&&{step:e.num_step_y<=Math.floor(n/200)?Math.floor(n/200):e.num_step_y},..."breakpoints"===e.bin_type&&{binned:!0}}),color:{condition:{selection:"highlight",value:e.color_on_hover},value:e.color_col}}}),sU=n(6);var uU=function({dataProperties:t,config:e,maxX:n,maxY:r,height:i,width:o,valFormatX:a,valFormatY:s}){return{selection:{grid:{type:"interval",bind:"scales"},highlight:{type:"single",empty:"none",on:"mouseover"}},name:"HEATMAP",mark:{zindex:-1,type:"rect",invalid:null,...e.heatmap_off&&{cursor:"pointer"},...!e.heatmap_off&&{fillOpacity:0}},height:i,width:o,encoding:{x:{...e.heatmap_off&&{bin:{..."bins"===e.bin_type&&{maxbins:e.max_bins},..."steps"===e.bin_type&&{step:e.num_step_x<=Math.floor(n/200)?Math.floor(n/200):e.num_step_x},..."breakpoints"===e.bin_type&&{binned:!0}}},field:"breakpoints"===e.bin_type?"bin_start_x":e.x,type:"quantitative",axis:{name:"xAxis",title:""===e.x_axis_override?t[e.x].title:e.x_axis_override,titleFontSize:e.x_axis_title_font_size,format:"d",labelFontSize:e.x_axis_label_font_size,grid:e.x_grids,titleFontWeight:"normal",titleFont:sU.a,labelFont:sU.a,labelSeparation:100-e.x_label_separation,labelOverlap:!0,labelColor:"#696969",labelAngle:-1*e.x_axis_label_angle,titleColor:"#696969",titlePadding:25+a.length}},..."breakpoints"===e.bin_type&&{x2:{field:"bin_end_x"}},y:{...e.heatmap_off&&{bin:{..."bins"===e.bin_type&&{maxbins:e.max_bins},..."steps"===e.bin_type&&{step:e.num_step_y<=Math.floor(r/200)?Math.floor(r/200):e.num_step_y},..."breakpoints"===e.bin_type&&{binned:!0}}},field:"breakpoints"===e.bin_type?"bin_start_y":e.y,type:"quantitative",axis:{title:""===e.y_axis_override?t[e.y].title:e.y_axis_override,titleFontSize:e.y_axis_title_font_size,format:"d",labelFontSize:e.y_axis_label_font_size,labelAngle:-1*e.y_axis_label_angle,grid:e.y_grids,titleFontWeight:"normal",titleFont:sU.a,labelFont:sU.a,labelSeparation:100-e.y_label_separation,labelOverlap:!0,labelColor:"#696969",titleColor:"#696969",titlePadding:25+3*s.length}},..."breakpoints"===e.bin_type&&{y2:{field:"bin_end_y"}},color:{aggregate:"count",type:"quantitative",legend:!!e.heatmap_off&&{orient:e.legend_orient,labelFontSize:e.legend_size,titleFontSize:e.legend_size,titleFontWeight:"normal",offset:e.y_hist?85:10,titleFont:sU.a,labelFont:sU.a,labelColor:"#696969",titleColor:"#696969"}},opacity:{condition:{selection:"highlight",value:1},value:e.heatmap_opacity},...e.heatmap_off&&{tooltip:(()=>{let i=iU(t[e.x],e.x_axis_override,{..."bins"===e.bin_type&&{maxbins:e.max_bins},..."steps"===e.bin_type&&{step:e.num_step_x<=Math.floor(n/200)?Math.floor(n/200):e.num_step_x},..."breakpoints"===e.bin_type&&{binned:!0}}).concat(iU(t[e.y],e.y_axis_override,{..."bins"===e.bin_type&&{maxbins:e.max_bins},..."steps"===e.bin_type&&{step:e.num_step_y<=Math.floor(r/200)?Math.floor(r/200):e.num_step_y},..."breakpoints"===e.bin_type&&{binned:!0}}));return i=i.concat(i.splice(1,1)),i})()}}}};var lU=function({config:t,dataProperties:e,mainDimensions:n}){return{mark:{type:"text",align:"left",angle:t.point_labels_angle,dx:t.point_labels_x_offset,dy:t.point_labels_y_offset,fontSize:t.point_labels_font_size},encoding:{x:{field:t.x,type:"quantitative"},y:{field:t.y,type:"quantitative"},text:{field:e._filterlabels?"_filterlabels":n[0]}}}};function cU({config:t,tooltipFields:e,dataProperties:n,width:r,height:i,mainDimensions:o}){const a=function({config:t,tooltipFields:e,width:n,height:r}){return{name:"SCATTERPLOT",mark:{color:t.color_col,cursor:"pointer",type:"circle",opacity:t.point_opacity,zindex:2,size:100},height:r,width:n,encoding:{tooltip:e,x:{field:t.x,type:"quantitative"},y:{field:t.y,type:"quantitative"}}}}({config:t,dataProperties:n,tooltipFields:e,width:r,height:i});return t.layer_points&&""!==t.size&&void 0!==t.size&&function(t,e,n){t.encoding.size={field:e.size,type:"quantitative",title:n[e.size].title,legend:{orient:e.legend_orient,format:"d",labelFontSize:e.legend_size,titleFontWeight:"normal",offset:e.y_hist?85:10,titleFontSize:e.legend_size,titleFont:sU.a,labelFont:sU.a,labelColor:"#696969",titleColor:"#696969"}}}(a,t,n),t.layer_points&&void 0!==o[1]&&function(t,e,n,r){t.encoding.color={scale:{scheme:e.point_group_colors},field:r[1],legend:{type:"symbol",offset:e.y_hist?85:10,title:n[r[1]].title,type:"symbol",orient:e.legend_orient,labelFontSize:e.legend_size,titleFontWeight:"normal",titleFontSize:e.legend_size,titleFont:sU.a,labelFont:sU.a,labelColor:"#696969",titleColor:"#696969"}}}(a,t,n,o),a}var fU=n(9);var dU=function({axis:t,config:e,data:n,min:r,max:i}){const o=Object(fU.a)(e[`reference_line_${t}_p`],e[t],n);return{name:"refLine"+t,mark:{type:"rule"},encoding:{x:{datum:"x"===t?o:r},y:{datum:"x"===t?r:o},x2:{datum:"x"===t?o:i},y2:{datum:"x"===t?i:o},color:{value:"red"},size:{value:e[`reference_line_${t}_width`]},strokeDash:{value:[4,4]}}}};var hU=function({layers:t,data:e,config:n,tooltipFields:r,dataProperties:i,width:o,height:a,mainDimensions:s,minX:u,minY:l,maxX:c,maxY:f}){n.layer_points&&t.push(cU({config:n,tooltipFields:r,dataProperties:i,width:o,height:a,mainDimensions:s})),n.layer_points&&n.point_labels&&t.push(lU({config:n,dataProperties:i,mainDimensions:s})),n.reference_line_x&&t.push(dU({axis:"x",min:l,max:f,config:n,data:e})),n.reference_line_y&&t.push(dU({axis:"y",min:u,max:c,config:n,data:e}))};var pU=function({data:t,dataProperties:e,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}){const h={vconcat:[oU({dataProperties:e,config:n,maxX:r,width:u}),{spacing:15,bounds:"flush",hconcat:[{name:"BOUNDING_BOX",layer:[uU({dataProperties:e,config:n,maxX:r,maxY:o,height:s,width:u,valFormatX:c,valFormatY:f})]},aU({dataProperties:e,config:n,maxY:o,height:s})]}],config:{range:{heatmap:{scheme:n.color_scheme}}}};let p=h.vconcat[1].hconcat[0].layer;return hU({layers:p,data:t,dataProperties:e,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}),h};var gU=function({data:t,dataProperties:e,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}){const h={name:"BOUNDING_BOX",layer:[uU({dataProperties:e,config:n,maxX:r,maxY:o,height:s,width:u,valFormatX:c,valFormatY:f})],config:{range:{heatmap:{scheme:n.color_scheme}}}};return hU({layers:h.layer,data:t,dataProperties:e,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}),h};var mU=function({data:t,dataProperties:e,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}){const h={vconcat:[oU({dataProperties:e,config:n,maxX:r,width:u}),{name:"BOUNDING_BOX",layer:[uU({dataProperties:e,config:n,maxX:r,maxY:o,height:s,width:u,valFormatX:c,valFormatY:f})]}],config:{range:{heatmap:{scheme:n.color_scheme}}}};let p=h.vconcat[1].layer;return hU({layers:p,data:t,dataProperties:e,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}),h};var bU=function({data:t,dataProperties:e,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}){const h={hconcat:[{name:"BOUNDING_BOX",layer:[uU({dataProperties:e,config:n,maxX:r,maxY:o,height:s,width:u,valFormatX:c,valFormatY:f})]},aU({dataProperties:e,config:n,maxY:o,height:s})],config:{range:{heatmap:{scheme:n.color_scheme}}}};let p=h.hconcat[0].layer;return hU({layers:p,data:t,dataProperties:e,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}),h};var yU=function(t){return t.config.x_hist&&t.config.y_hist?pU(t):t.config.x_hist?mU(t):t.config.y_hist?bU(t):gU(t)};function vU(t,e,n,r,i,o,a,s){a.clearErrors();let{dataProperties:u,myData:l}=Object(fU.d)(t,r);const c=e.clientWidth,f=e.clientHeight,d=Math.max(...l.map(t=>t[n.x])),h=Math.min(...l.map(t=>t[n.x])),p=Math.max(...l.map(t=>t[n.y])),g=Math.min(...l.map(t=>t[n.y])),m=r.fields.dimension_like.map(t=>t.name.replace(".","_")),b=function(t,e,n,r,i,o){var a={};a.options=Object.assign({},e),a.measures=[],a.dimensions=[],a.masterList=[],a.options.bin_type.values.length>2&&a.options.bin_type.values.pop();var s,u,l,c,f=1,d=1;t.fields.dimension_like.forEach((function(t){if("_filterlabels"!==t.name&&(t.is_numeric||"tier"===t.type)){var e={},n=t.name.replace(".","_");void 0!==t.label_short?e[t.label_short]=n:e[t.label]=n,1==f?s=n:2==f&&(u=n),a.masterList.push(e),a.dimensions.push(e),f+=1}})),t.fields.measure_like.forEach((function(t){if("_filterlabels"!==t.name){var e={},n=t.name.replace(".","_");void 0!==t.label_short?(e[t.label_short]=n,a.measures.push(e)):(e[t.label]=n,"yesno"==t.type?a.dimensions.push(e):a.measures.push(e)),1==d?l=n:2==d&&(c=n),a.masterList.push(e),d+=1}})),void 0===l&&(l=s),void 0===c&&(c=u),"steps"===n.bin_type?(a.options.num_step_x={label:"Step Size (X)",section:" Values",type:"number",order:5,default:Math.floor(r/10),display_size:"half"},a.options.num_step_y={label:"Step Size (Y)",section:" Values",type:"number",order:6,default:Math.floor(i/10),display_size:"half"}):"bins"===n.bin_type?a.options.max_bins={label:"Max number of Bins",section:" Values",type:"string",order:4,default:"10"}:"breakpoints"===n.bin_type&&(a.options.breakpointsX={label:"Breakpoints (X)",section:" Values",type:"string",placeholder:"Comma seperated breakpoints (100, 200, 300)",order:4},a.options.breakpointsY={label:"Breakpoints (Y)",section:" Values",type:"string",placeholder:"Comma seperated breakpoints (100, 200, 300)",order:5}),n.winsorization&&(a.options.percentile={label:"Percentiles",section:" Values",type:"string",order:7,display:"select",display_size:"half",default:"1_99",values:[{"1% - 99%":"1_99"},{"5% - 95%":"5_95"}]}),a.options.x={label:"X Axis",section:" Values",type:"string",display:"select",order:1,values:a.measures,default:l},a.options.y={label:"Y Axis",section:" Values",type:"string",display:"select",order:1,values:a.measures,default:c},a.options.heatmap_off={label:"Heatmap",section:" Values",type:"boolean",order:10,display:"select",display_size:"half",default:!0},a.options.x_hist={label:"X Histogram",section:" Values",type:"boolean",display_size:"half",order:11,default:!0},a.options.y_hist={label:"Y Histogram",section:" Values",type:"boolean",display_size:"half",order:11,default:!0},a.options.layer_points={label:"Points",section:" Values",type:"boolean",display_size:"half",order:11,display:"select",default:!0};var h=a.measures.length>2?a.measures[2]:"",p=a.measures.concat([{None:""}]);return a.options.size={label:"Size Points By",section:" Values",type:"string",order:12,display:"select",values:p,default:h[Object.keys(h)[0]]},a.options.color_scheme={label:"Heatmap Color Scheme",section:" Style",type:"array",display:"colors",order:1,default:["#7FCDAE","#7ED09C","#7DD389","#85D67C","#9AD97B","#B1DB7A","#CADF79","#E2DF78","#E5C877","#E7AF75","#EB9474","#EE7772"]},o&&(a.options.point_group_colors={label:"Point Groups Colors",section:" Style",type:"array",display:"colors",order:2,default:["#7FCDAE","#7ED09C","#7DD389","#85D67C","#9AD97B","#B1DB7A","#CADF79","#E2DF78","#E5C877","#E7AF75","#EB9474","#EE7772"]}),a.options.heatmap_opacity={label:"Heatmap Opacity",section:" Style",type:"number",display:"range",min:0,max:1,step:.05,default:.8,order:1},a.options.point_opacity={label:"Point Opacity",section:" Style",type:"number",display:"range",min:0,max:1,step:.05,default:.8,order:6},a.options.legend_orient={label:"Legend Position",section:"Labels",type:"string",display:"select",order:6,values:[{Left:"left"},{Right:"right"},{Top:"top"},{Bottom:"bottom"}],display_size:"half",default:"right"},a.options.legend_size={label:"Legend Font Size",section:"Labels",type:"number",default:16,display_size:"half",order:5},a.options.y_axis_value_format={label:"Y Axis Value Format",order:201,section:" Values",type:"string",display:"text",default:"",placeholder:"Spreadsheet Style Value Format"},a.options.points_legend_value_format={label:"Point Value Format",order:202,section:" Values",type:"string",display:"text",default:"",placeholder:"Spreadsheet Style Value Format"},a.options.point_labels_divider={label:"Point Labels ---------------------------------------------",section:"Labels",type:"string",display:"divider",order:1e3,default:!1},a.options.point_labels={label:"Scatterplot Point Labels",section:"Labels",type:"boolean",order:1001,default:!1},a.options.point_labels_x_offset={label:"Point Label X Offset",section:"Labels",type:"number",display:"range",display_size:"half",default:0,order:1002,min:-50,max:50,step:1},a.options.point_labels_y_offset={label:"Point Label Y Offset",section:"Labels",type:"number",display:"range",display_size:"half",order:1003,default:0,min:-50,max:50,step:1},a.options.point_labels_angle={label:"Point Label Angle",section:"Labels",type:"number",display:"range",display_size:"half",order:1004,default:0,min:-90,max:90,step:1},a.options.point_labels_font_size={label:"Point Label Font Size",section:"Labels",type:"number",display_size:"half",default:12,order:1005},a.options.reference_line_divider={label:"Reference Lines ----------------------------------------",order:1006,section:"Labels",type:"string",display:"divder"},a.options.reference_line_x={label:"X Axis",order:1007,section:"Labels",type:"boolean",display_size:"half"},a.options.reference_line_y={label:"Y Axis",order:1008,section:"Labels",type:"boolean",display_size:"half"},a.options.reference_line_x_p={label:"X Axis Percentile",placeholder:"Value from 0 to 100",order:1009,section:"Labels",type:"number",display_size:"half",default:50},a.options.reference_line_y_p={label:"Y Axis Percentile",placeholder:"Value from 0 to 100",order:1010,section:"Labels",type:"number",display_size:"half",default:50},a.options.reference_line_x_width={label:"X Axis Stroke",order:1011,section:"Labels",type:"number",display_size:"half",default:3},a.options.reference_line_y_width={label:"Y Axis Stroke",order:1012,section:"Labels",type:"number",display_size:"half",default:3},a}(r,rU,n,d,p,void 0!==m[1]).options;if(a.trigger("registerOptions",b),"breakpoints"===n.bin_type&&a.addError({title:"Breakpoints Currently not supported for Scatter Histogram"}),null==u[n.x]||null==u[n.y])return;const y=u[n.x].valueFormat,v=u[n.y].valueFormat,x=n.x_axis_value_format,_=n.y_axis_value_format;let O=""!==x?x:y;null==O&&(O="#,##0");let w,j=""!==_?_:v;if(null==j&&(j="#,##0"),n.size){const t=u[n.size].valueFormat,e=n.points_legend_value_format;w=""!==e?e:t,null==w&&(w="#,##0")}n.winsorization&&(l=Object(fU.e)(l,n.x,n.percentile),l=Object(fU.e)(l,n.y,n.percentile));const k=function(t,e,n){let r=[];for(let e in t)if("_filterlabels"!==e&&("nominal"===t[e].dtype||e===n.x||e===n.y||e===n.size)){let i={};i.field=e,i.type=t[e].dtype,i.title=(e=>{switch(e){case n.x:return""!==n.x_axis_override?n.x_axis_override:t[e].title;case n.y:return""!==n.y_axis_override?n.y_axis_override:t[e].title;default:return t[e].title}})(e),r.push(i)}let i=[n.x,n.y];n.size&&i.push(n.size),r.sort((t,e)=>i.indexOf(t.field)-i.indexOf(e.field));for(let t=0;t<e.fields.dimensions.length;t++)r.push(r.shift());return r}(u,r,n);var E={$schema:"https://vega.github.io/schema/vega-lite/v4.json",data:{values:l},spacing:15,bounds:"flush",...yU({data:l,dataProperties:u,config:n,maxX:d,minX:h,maxY:p,minY:g,height:f,width:c,valFormatX:O,valFormatY:j,tooltipFields:k,mainDimensions:m})};const A=()=>{Object(sU.d)(i,n,m,O,j,w)};s("#my-vega",E,{actions:!1,renderer:"svg",tooltip:{theme:"custom"}}).then(({spec:t,view:e})=>{Object(sU.b)(),A(),i.print?o():(e.addEventListener("wheel",A,{passive:!0}),e.addEventListener("mousedown",A,{passive:!0}),e.addEventListener("mouseup",A,{passive:!0}),e.addEventListener("drag",A,{passive:!0}),e.addEventListener("mousemove",(t,e)=>{!function(t,e,n,r,i,o){if(void 0===e||void 0===n||0===n.fillOpacity||"breakpoints"===e.bin_type)return;const a=t=>t.replace(/\u2013|\u2014|\u2212/g,"-"),s=r=>{let i=""!==e[r+"_axis_override"]?e[r+"_axis_override"]:t[e[r].replace(".","_")].title;return n.tooltip[i].split(" ")},u=r=>{let i="size"!==r&&""!==e[r+"_axis_override"]?e[r+"_axis_override"]:t[e[r].replace(".","_")].title;return Number(a(n.tooltip[i]))},l=(t,e)=>{let n="x"===t?r:i;return[nU.a.format(n,Number(a(e[0]))),nU.a.format(n,Number(a(e[2])))]};if("X_HISTOGRAM_marks"===n.mark.name){let[t,e]=l("x",s("x"));tU.a("td.value").text(t+" - "+e)}if("Y_HISTOGRAM_marks"===n.mark.name){let[t,e]=l("y",s("y"));tU.a("td.value").text(t+" - "+e)}if("HEATMAP_marks"===n.mark.name){let[t,n]=l("x",s("x")),[r,i]=l("y",s("y"));tU.b("td.value").each((function(o,a){0===a?tU.a(this).text(t+" - "+n):1===a&&e.x!==e.y&&tU.a(this).text(r+" - "+i)}))}if("SCATTERPLOT_marks"===n.mark.name){let t=0;tU.b("td.value").each((function(n,a){0===a?tU.a(this).text(nU.a.format(r,u("x"))):1===a?e.x!==e.y?tU.a(this).text(nU.a.format(i,u("y"))):e.size&&(tU.a(this).text(nU.a.format(o,u("size"))),t=1):2===a&&!t&&e.size&&e.x!==e.size&&e.y!==e.size&&tU.a(this).text(nU.a.format(o,u("size")))}))}}(u,n,e,O,j,w)}),void 0!==m[1]&&n.size&&(n.x_hist||n.y_hist)&&Object(sU.c)(n.legend_orient),e.addEventListener("click",(function(t,e){if(!(void 0===e||void 0===e.datum||Object.keys(e.datum).length<=1||0===e.fillOpacity))if(i.crossfilterEnabled&&"rect"!==e.mark.marktype){let n={[u[m[0]].lookerName]:{value:e.datum[m[0]]}};LookerCharts.Utils.toggleCrossfilter({row:n,event:t})}else{var o=e.datum.links;if(Object.keys(e.datum)[0].startsWith("bin_")){let t=[];for(let e of r.fields.dimension_like.concat(r.fields.measure_like))t.push(e.name);const i=u[n.x].lookerName,a=u[n.y].lookerName,s=Object.keys(e.datum).filter(t=>t.includes(n.x)),c=Object.keys(e.datum).filter(t=>t.includes(n.y));let f=l[0].links;if(f.length<1)o=[];else{f=f.filter(t=>t.url.includes("/explore/"))[0].url.split("?")[0];let n=`${f}?fields=${t.join(",")}`;if(s.length>0&&(n+=`&f[${i}]=[${e.datum[s[0]]}, ${e.datum[s[1]]})`),c.length>0&&(n+=`&f[${a}]=[${e.datum[c[0]]}, ${e.datum[c[1]]})`),void 0!==r.applied_filters){let t=r.applied_filters;for(let e in t)n+=`&f[${t[e].field.name}]=${t[e].value}`}o=[{label:`Show ${e.datum.__count} Records`,type:"drill",type_label:"Drill into Records",url:n}]}}LookerCharts.Utils.openDrillMenu({links:o,event:t})}})))})}function xU(t,e,n,r,i,o,a,s){a.clearErrors();let{dataProperties:u,myData:l}=Object(fU.d)(t,r);const c=r.fields.measure_like[0].name.replace(".","_"),f=r.fields.dimensions[0].name.replace(".","_"),d=Math.max(...l.map(t=>t[c])),h=Object.assign({},rU);if(h.bin_type.values.length<3){let t=h.bin_type.values.length;h.bin_type.values[t]={Breakpoints:"breakpoints"}}"bins"===n.bin_type?h.max_bins={label:"Max number of Bins",section:" Values",type:"string",order:4,display:"text",default:"10"}:"steps"===n.bin_type?h.step_size={label:"Step Size",section:" Values",type:"number",order:4,default:Math.floor(d/10)}:(h.breakpoint_array={label:"Breakpoints",section:" Values",order:4,type:"string",default:`min, ${Math.floor(d/5)}, ${Math.floor(d/4)}, ${Math.floor(d/3)}, ${Math.floor(d/2)}, max`},h.breakpoint_ordinal={label:"Use Equal Sized Columns (Ordinal Bins)",order:4,section:" Values",type:"boolean",display:"select",default:!1}),n.winsorization&&(h.percentile={label:"Percentiles",section:" Values",type:"string",order:7,display:"select",display_size:"half",default:"1_99",values:[{"1% - 99%":"1_99"},{"5% - 95%":"5_95"}]}),a.trigger("registerOptions",h),n.winsorization&&(l=Object(fU.e)(l,c,n.percentile));const p=u[c].valueFormat,g=n.x_axis_value_format;let m=""!==g?g:p;null==m&&(m="#,##0");let b=[];"breakpoints"===n.bin_type&&(b=Object(fU.c)(l,c,n.breakpoint_array,m,"x"));var y,v,x;s("#my-vega",{$schema:"https://vega.github.io/schema/vega-lite/v4.json",config:{view:{stroke:"transparent"}},data:{values:"breakpoints"===n.bin_type?b:l},width:.9*e.clientWidth,height:.8*e.clientHeight,padding:20,selection:{highlight:{type:"single",empty:"none",on:"mouseover"}},mark:{type:"bar",cursor:"pointer"},encoding:{x:{type:n.breakpoint_ordinal?"ordinal":"quantitative",...n.breakpoint_ordinal&&{sort:["order"]},...!n.breakpoint_ordinal&&{bin:{..."bins"===n.bin_type&&{maxbins:n.max_bins},..."steps"===n.bin_type&&{step:n.step_size<=Math.floor(d/200)?Math.floor(d/200):n.step_size},..."breakpoints"===n.bin_type&&{binned:!0}}},field:"breakpoints"===n.bin_type?n.breakpoint_ordinal?"label":"bin_start_x":c,axis:{title:""===n.x_axis_override?u[c].title:n.x_axis_override,titleFontSize:n.x_axis_title_font_size,labelFontSize:n.x_axis_label_font_size,labelAngle:-1*n.x_axis_label_angle,format:"d",grid:n.x_grids,titleFontWeight:"normal",titleFont:sU.a,labelFont:sU.a,labelSeparation:100-n.x_label_separation,labelOverlap:!0,labelColor:"#696969",titleColor:"#696969",titlePadding:25}},..."breakpoints"===n.bin_type&&!1===n.breakpoint_ordinal&&{x2:{field:"bin_end_x"}},y:{type:"quantitative",..."breakpoints"!==n.bin_type&&{aggregate:"count"},..."breakpoints"===n.bin_type&&{field:"count_x"},axis:{title:""===n.y_axis_override?"Count of "+u[f].title:n.y_axis_override,titleFontSize:n.y_axis_title_font_size,labelFontSize:n.y_axis_label_font_size,labelAngle:-1*n.y_axis_label_angle,grid:n.y_grids,titleFontWeight:"normal",titleFont:sU.a,labelFont:sU.a,labelSeparation:100-n.y_label_separation,labelOverlap:!0,labelColor:"#696969",titleColor:"#696969",titlePadding:25}},color:{condition:{selection:"highlight",value:n.color_on_hover},value:n.color_col},tooltip:(y=u[c],v=n.x_axis_override,x={..."bins"===n.bin_type&&{maxbins:n.max_bins},..."steps"===n.bin_type&&{step:n.step_size},..."breakpoints"===n.bin_type&&{binned:!0}},[{title:""!==v?v:y.title,bin:x,field:x.binned?"label":y.lookerName.replace(".","_"),type:x.binned?"ordinal":"quantitative"},{title:"Count of Records",type:"quantitative",...!x.binned&&{aggregate:"count"},...x.binned&&{field:"count_x"}}])}},{actions:!1,renderer:"svg",tooltip:{theme:"custom"}}).then(({spec:t,view:e})=>{Object(sU.b)(),Object(sU.e)(n,"simple",m),i.print?o():(e.addEventListener("mousemove",(t,e)=>{!function(t,e,n,r,i){if(void 0===e||void 0===r||"transparent"===r.stroke||"breakpoints"===e.bin_type)return;const o=t=>t.replace(/\u2013|\u2014|\u2212/g,"-");let[a,s]=(u=(r=>{let i=""!==e.x_axis_override?e.x_axis_override:t[n].title;return r.tooltip[i].split(" ")})(r),[nU.a.format(i,Number(o(u[0]))),nU.a.format(i,Number(o(u[2])))]);var u;tU.a("td.value").text(a+" - "+s)}(u,n,c,e,m)}),e.addEventListener("click",(function(t,e){if(void 0===e.datum)return;const i=u[c].lookerName,o="breakpoints"===n.bin_type?["bin_start_x","bin_end_x"]:Object.keys(e.datum).filter(t=>t.includes(c));let a=e.datum.links,s=l[0].links,f=[];for(let t of r.fields.dimension_like.concat(r.fields.measure_like))f.push(t.name);if(s.length<1)a=[];else{s=s.filter(t=>t.url.includes("/explore/"))[0].url.split("?")[0];let t=`${s}?fields=${f.join(",")}`;if(t+=`&f[${i}]=[${e.datum[o[0]]}, ${e.datum[o[1]]})`,void 0!==r.applied_filters){let e=r.applied_filters;for(let n in e)t+=`&f[${e[n].field.name}]=${e[n].value}`}a=[{label:`Show ${"breakpoints"===n.bin_type?e.datum.count_x:e.datum.__count} Records`,type:"drill",type_label:"Drill into Records",url:t}]}LookerCharts.Utils.openDrillMenu({links:a,event:t})})))})}n(96);looker.plugins.visualizations.add({options:rU,create:function(t,e){t.appendChild(document.createElement("div")).setAttribute("id","my-vega")},updateAsync:function(t,e,n,r,i,o){if(0===t.length)return this.addError({title:"No Results"}),void o();if("binned_hist"===n.bin_style){if(!Object(fU.b)(this,r,{min_pivots:0,max_pivots:0,min_dimensions:1,max_dimensions:void 0,min_measures:2,max_measures:void 0}))return;vU(t,e,n,r,i,o,this,QI)}else{if(!Object(fU.b)(this,r,{min_pivots:0,max_pivots:0,min_dimensions:1,max_dimensions:void 0,min_measures:1,max_measures:void 0}))return;xU(t,e,n,r,i,o,this,QI)}o()}})},function(t,e,n){"use strict";var r=n(3),i=n(4),o=Object(r.a)((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*i.d-t.getMinutes()*i.c)}),(function(t,e){t.setTime(+t+e*i.b)}),(function(t,e){return(e-t)/i.b}),(function(t){return t.getHours()}));e.a=o;o.range},function(t,e,n){"use strict";var r=n(3),i=n(4),o=Object(r.a)((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*i.d)}),(function(t,e){t.setTime(+t+e*i.c)}),(function(t,e){return(e-t)/i.c}),(function(t){return t.getMinutes()}));e.a=o;o.range},function(t,e,n){"use strict";var r=n(3),i=n(4),o=Object(r.a)((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+e*i.b)}),(function(t,e){return(e-t)/i.b}),(function(t){return t.getUTCHours()}));e.a=o;o.range},function(t,e,n){"use strict";var r=n(3),i=n(4),o=Object(r.a)((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+e*i.c)}),(function(t,e){return(e-t)/i.c}),(function(t){return t.getUTCMinutes()}));e.a=o;o.range},function(t,e,n){"use strict";var r=n(15);e.a=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Object(r.a)(e)/3)))-Object(r.a)(Math.abs(t)))}},function(t,e,n){"use strict";var r=n(15);e.a=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Object(r.a)(e)-Object(r.a)(t))+1}},function(t,e,n){"use strict";var r=n(15);e.a=function(t){return Math.max(0,-Object(r.a)(Math.abs(t)))}},function(t,e,n){"use strict";var r={},i={};function o(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function a(t){var e=Object.create(null),n=[];return t.forEach((function(t){for(var r in t)r in e||n.push(e[r]=r)})),n}function s(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function u(t){var e,n=t.getUTCHours(),r=t.getUTCMinutes(),i=t.getUTCSeconds(),o=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":((e=t.getUTCFullYear())<0?"-"+s(-e,6):e>9999?"+"+s(e,6):s(e,4))+"-"+s(t.getUTCMonth()+1,2)+"-"+s(t.getUTCDate(),2)+(o?"T"+s(n,2)+":"+s(r,2)+":"+s(i,2)+"."+s(o,3)+"Z":i?"T"+s(n,2)+":"+s(r,2)+":"+s(i,2)+"Z":r||n?"T"+s(n,2)+":"+s(r,2)+"Z":"")}e.a=function(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function s(t,e){var o,a=[],s=t.length,u=0,l=0,c=s<=0,f=!1;function d(){if(c)return i;if(f)return f=!1,r;var e,o,a=u;if(34===t.charCodeAt(a)){for(;u++<s&&34!==t.charCodeAt(u)||34===t.charCodeAt(++u););return(e=u)>=s?c=!0:10===(o=t.charCodeAt(u++))?f=!0:13===o&&(f=!0,10===t.charCodeAt(u)&&++u),t.slice(a+1,e-1).replace(/""/g,'"')}for(;u<s;){if(10===(o=t.charCodeAt(e=u++)))f=!0;else if(13===o)f=!0,10===t.charCodeAt(u)&&++u;else if(o!==n)continue;return t.slice(a,e)}return c=!0,t.slice(a,s)}for(10===t.charCodeAt(s-1)&&--s,13===t.charCodeAt(s-1)&&--s;(o=d())!==i;){for(var h=[];o!==r&&o!==i;)h.push(o),o=d();e&&null==(h=e(h,l++))||a.push(h)}return a}function l(e,n){return e.map((function(e){return n.map((function(t){return f(e[t])})).join(t)}))}function c(e){return e.map(f).join(t)}function f(t){return null==t?"":t instanceof Date?u(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,r,i=s(t,(function(t,i){if(n)return n(t,i-1);r=t,n=e?function(t,e){var n=o(t);return function(r,i){return e(n(r),i,t)}}(t,e):o(t)}));return i.columns=r||[],i},parseRows:s,format:function(e,n){return null==n&&(n=a(e)),[n.map(f).join(t)].concat(l(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=a(t)),l(t,e).join("\n")},formatRows:function(t){return t.map(c).join("\n")},formatRow:c,formatValue:f}}}])}));