!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("vega-util"),require("d3-shape"),require("d3-path"),require("vega-canvas"),require("vega-loader"),require("vega-scale")):"function"==typeof define&&define.amd?define(["exports","vega-util","d3-shape","d3-path","vega-canvas","vega-loader","vega-scale"],e):e((t=t||self).vega={},t.vega,t.d3,t.d3,t.vega,t.vega,t.vega)}(this,(function(t,e,n,i,r,o,s){"use strict";var a=0;function l(t){return t&&t.gradient}function u(t,e,n){let i=t.id,r=t.gradient,o="radial"===r?"p_":"";return i||(i=t.id="gradient_"+a++,"radial"===r?(t.x1=c(t.x1,.5),t.y1=c(t.y1,.5),t.r1=c(t.r1,0),t.x2=c(t.x2,.5),t.y2=c(t.y2,.5),t.r2=c(t.r2,.5),o="p_"):(t.x1=c(t.x1,0),t.y1=c(t.y1,0),t.x2=c(t.x2,1),t.y2=c(t.y2,0))),e[i]=t,"url("+(n||"")+"#"+o+i+")"}function c(t,e){return null!=t?t:e}var h={basis:{curve:n.curveBasis},"basis-closed":{curve:n.curveBasisClosed},"basis-open":{curve:n.curveBasisOpen},bundle:{curve:n.curveBundle,tension:"beta",value:.85},cardinal:{curve:n.curveCardinal,tension:"tension",value:0},"cardinal-open":{curve:n.curveCardinalOpen,tension:"tension",value:0},"cardinal-closed":{curve:n.curveCardinalClosed,tension:"tension",value:0},"catmull-rom":{curve:n.curveCatmullRom,tension:"alpha",value:.5},"catmull-rom-closed":{curve:n.curveCatmullRomClosed,tension:"alpha",value:.5},"catmull-rom-open":{curve:n.curveCatmullRomOpen,tension:"alpha",value:.5},linear:{curve:n.curveLinear},"linear-closed":{curve:n.curveLinearClosed},monotone:{horizontal:n.curveMonotoneY,vertical:n.curveMonotoneX},natural:{curve:n.curveNatural},step:{curve:n.curveStep},"step-after":{curve:n.curveStepAfter},"step-before":{curve:n.curveStepBefore}};function f(t,n,i){var r=e.hasOwnProperty(h,t)&&h[t],o=null;return r&&(o=r.curve||r[n||"vertical"],r.tension&&null!=i&&(o=o[r.tension](i))),o}var d={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},g=[/([MLHVCSQTAZmlhvcsqtaz])/g,/###/,/(\d)([-+])/g,/\s|,|###/];function p(t){var e,n,i,r,o,s,a,l,u,c,h,f=[];for(l=0,c=(e=t.slice().replace(g[0],"###$1").split(g[1]).slice(1)).length;la)for(u=1,h=r.length;u1&&(n*=p=Math.sqrt(p),i*=p);var m=f/n,b=h/n,w=-h/i,T=f/i,A=m*a+b*l,M=w*a+T*l,C=m*t+b*e,R=w*t+T*e,z=(C-A)*(C-A)+(R-M)*(R-M),P=1/z-.25;P<0&&(P=0);var S=Math.sqrt(P);o==r&&(S=-S);var L=.5*(A+C)-S*(R-M),O=.5*(M+R)+S*(C-A),N=Math.atan2(M-O,A-L),q=Math.atan2(R-O,C-L),D=q-N;D<0&&1===o?D+=_:D>0&&0===o&&(D-=_);for(var E=Math.ceil(Math.abs(D/(y+.001))),I=[],B=0;B+t}function I(t,e,n){return Math.max(e,Math.min(t,n))}function B(){var t=O,e=N,n=q,r=D,o=E(0),s=o,a=o,l=o,u=null;function c(c,h,f){var d,g=null!=h?h:+t.call(this,c),p=null!=f?f:+e.call(this,c),v=+n.call(this,c),y=+r.call(this,c),_=Math.min(v,y)/2,m=I(+o.call(this,c),0,_),x=I(+s.call(this,c),0,_),b=I(+a.call(this,c),0,_),k=I(+l.call(this,c),0,_);if(u||(u=d=i.path()),m<=0&&x<=0&&b<=0&&k<=0)u.rect(g,p,v,y);else{var w=g+v,T=p+y;u.moveTo(g+m,p),u.lineTo(w-x,p),u.bezierCurveTo(w-L*x,p,w,p+L*x,w,p+x),u.lineTo(w,T-k),u.bezierCurveTo(w,T-L*k,w-L*k,T,w-k,T),u.lineTo(g+b,T),u.bezierCurveTo(g+L*b,T,g,T-L*b,g,T-b),u.lineTo(g,p+m),u.bezierCurveTo(g,p+L*m,g+L*m,p,g+m,p),u.closePath()}if(d)return u=null,d+""||null}return c.x=function(e){return arguments.length?(t=E(e),c):t},c.y=function(t){return arguments.length?(e=E(t),c):e},c.width=function(t){return arguments.length?(n=E(t),c):n},c.height=function(t){return arguments.length?(r=E(t),c):r},c.cornerRadius=function(t,e,n,i){return arguments.length?(o=E(t),s=null!=e?E(e):o,l=null!=n?E(n):o,a=null!=i?E(i):s,c):o},c.context=function(t){return arguments.length?(u=null==t?null:t,c):u},c}function V(){var t,e,n,r,o,s,a,l,u=null;function c(t,e,n){var i=n/2;if(o){var r=a-e,c=t-s;if(r||c){var h=Math.sqrt(r*r+c*c),f=(r/=h)*l,d=(c/=h)*l,g=Math.atan2(c,r);u.moveTo(s-f,a-d),u.lineTo(t-r*i,e-c*i),u.arc(t,e,i,g-Math.PI,g),u.lineTo(s+f,a+d),u.arc(s,a,l,g,g+Math.PI)}else u.arc(t,e,i,0,_);u.closePath()}else o=1;s=t,a=e,l=i}function h(s){var a,l,h,f=s.length,d=!1;for(null==u&&(u=h=i.path()),a=0;a<=f;++a)!(at.x||0,j=t=>t.y||0,W=t=>!(!1===t.defined),U=n.arc().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),X=n.area().x(G).y1(j).y0(t=>(t.y||0)+(t.height||0)).defined(W),F=n.area().y(j).x1(G).x0(t=>(t.x||0)+(t.width||0)).defined(W),Y=n.line().x(G).y(j).defined(W),J=B().x(G).y(j).width(t=>t.width||0).height(t=>t.height||0).cornerRadius(t=>H(t.cornerRadiusTopLeft,t.cornerRadius)||0,t=>H(t.cornerRadiusTopRight,t.cornerRadius)||0,t=>H(t.cornerRadiusBottomRight,t.cornerRadius)||0,t=>H(t.cornerRadiusBottomLeft,t.cornerRadius)||0),$=n.symbol().type(t=>P(t.shape||"circle")).size(t=>H(t.size,64)),Q=V().x(G).y(j).defined(W).size(t=>t.size||1);function Z(t){return t.cornerRadius||t.cornerRadiusTopLeft||t.cornerRadiusTopRight||t.cornerRadiusBottomRight||t.cornerRadiusBottomLeft}function K(t,e,n,i){return J.context(t)(e,n,i)}var tt=1;function et(){tt=1}function nt(t,n,i){var r=n.clip,o=t._defs,s=n.clip_id||(n.clip_id="clip"+tt++),a=o.clipping[s]||(o.clipping[s]={id:s});return e.isFunction(r)?a.path=r(null):Z(i)?a.path=K(null,i,0,0):(a.width=i.width||0,a.height=i.height||0),"url(#"+s+")"}function it(t){this.clear(),t&&this.union(t)}var rt=it.prototype;function ot(t){this.mark=t,this.bounds=this.bounds||new it}function st(t){ot.call(this,t),this.items=this.items||[]}function at(t){this._pending=0,this._loader=t||o.loader()}rt.clone=function(){return new it(this)},rt.clear=function(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},rt.empty=function(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},rt.equals=function(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2},rt.set=function(t,e,n,i){return nthis.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this},rt.expand=function(t){return this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t,this},rt.round=function(){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},rt.scale=function(t){return this.x1*=t,this.y1*=t,this.x2*=t,this.y2*=t,this},rt.translate=function(t,e){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this},rt.rotate=function(t,e,n){const i=this.rotatedPoints(t,e,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])},rt.rotatedPoints=function(t,e,n){var{x1:i,y1:r,x2:o,y2:s}=this,a=Math.cos(t),l=Math.sin(t),u=e-e*a+n*l,c=n-e*l-n*a;return[a*i-l*r+u,l*i+a*r+c,a*i-l*s+u,l*i+a*s+c,a*o-l*r+u,l*o+a*r+c,a*o-l*s+u,l*o+a*s+c]},rt.union=function(t){return t.x1this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this},rt.intersect=function(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2=t.x2&&this.y1<=t.y1&&this.y2>=t.y2},rt.alignsWith=function(t){return t&&(this.x1==t.x1||this.x2==t.x2||this.y1==t.y1||this.y2==t.y2)},rt.intersects=function(t){return t&&!(this.x2t.x2||this.y2t.y2)},rt.contains=function(t,e){return!(tthis.x2||ethis.y2)},rt.width=function(){return this.x2-this.x1},rt.height=function(){return this.y2-this.y1},e.inherits(st,ot);var lt=at.prototype;function ut(t){t._pending+=1}function ct(t){t._pending-=1}function ht(t,e,n){if(e.stroke&&0!==e.opacity&&0!==e.strokeOpacity){const i=null!=e.strokeWidth?+e.strokeWidth:1;t.expand(i+(n?function(t,e){return t.strokeJoin&&"miter"!==t.strokeJoin?0:e}(e,i):0))}return t}lt.pending=function(){return this._pending},lt.sanitizeURL=function(t){var e=this;return ut(e),e._loader.sanitize(t,{context:"href"}).then((function(t){return ct(e),t})).catch((function(){return ct(e),null}))},lt.loadImage=function(t){const n=this,i=r.image();return ut(n),n._loader.sanitize(t,{context:"image"}).then((function(t){const r=t.href;if(!r||!i)throw{url:r};const o=new i,s=e.hasOwnProperty(t,"crossOrigin")?t.crossOrigin:"anonymous";return null!=s&&(o.crossOrigin=s),o.onload=()=>ct(n),o.onerror=()=>ct(n),o.src=r,o})).catch((function(t){return ct(n),{complete:!1,width:0,height:0,src:t&&t.url||""}}))},lt.ready=function(){var t=this;return new Promise((function(e){!function n(i){t.pending()?setTimeout((function(){n(!0)}),10):e(i)}(!1)}))};var ft,dt,gt,pt=_-1e-8;function vt(t){return ft=t,vt}function yt(){}function _t(t,e){ft.add(t,e)}function mt(t,e){_t(dt=t,gt=e)}function xt(t){_t(t,ft.y1)}function bt(t){_t(ft.x1,t)}function kt(t,e,n,i){const r=(t-e)/(t+n-2*e);01e-14?(l=s*s+a*o,l>=0&&(l=Math.sqrt(l),u=(-s+l)/o,c=(-s-l)/o)):u=.5*a/s,0pt)_t(t-n,e-n),_t(t+n,e+n);else{const s=i=>_t(n*Math.cos(i)+t,n*Math.sin(i)+e);let a,l;if(s(i),s(r),r!==i)if((i%=_)<0&&(i+=_),(r%=_)<0&&(r+=_),rr;++l,a-=y)s(a);else for(a=i-i%y+y,l=0;l<4&&av)return!1;d>p&&(p=d)}else if(h>0){if(d0&&(t.globalAlpha=n,t.fillStyle=qt(t,e,e.fill),!0)}var Et=[];function It(t,e,n){var i=null!=(i=e.strokeWidth)?i:1;return!(i<=0)&&((n*=null==e.strokeOpacity?1:e.strokeOpacity)>0&&(t.globalAlpha=n,t.strokeStyle=qt(t,e,e.stroke),t.lineWidth=i,t.lineCap=e.strokeCap||"butt",t.lineJoin=e.strokeJoin||"miter",t.miterLimit=e.strokeMiterLimit||10,t.setLineDash&&(t.setLineDash(e.strokeDash||Et),t.lineDashOffset=e.strokeDashOffset||0),!0))}function Bt(t,e){return t.zindex-e.zindex||t.index-e.index}function Vt(t){if(!t.zdirty)return t.zitems;var e,n,i,r=t.items,o=[];for(n=0,i=r.length;n=0;)if(n=e(r[i]))return n;if(r===o)for(i=(r=t.items).length;--i>=0;)if(!r[i].zindex&&(n=e(r[i])))return n;return null}function jt(t){return function(e,n,i){Ht(n,(function(n){i&&!i.intersects(n.bounds)||Ut(t,e,n,n)}))}}function Wt(t){return function(e,n,i){!n.items.length||i&&!i.intersects(n.bounds)||Ut(t,e,n.items[0],n.items)}}function Ut(t,e,n,i){var r=null==n.opacity?1:n.opacity;0!==r&&(t(e,i)||(Lt(e,n),n.fill&&Dt(e,n,r)&&e.fill(),n.stroke&&It(e,n,r)&&e.stroke()))}function Xt(t){return t=t||e.truthy,function(e,n,i,r,o,s){return i*=e.pixelRatio,r*=e.pixelRatio,Gt(n,(function(n){var a=n.bounds;if((!a||a.contains(o,s))&&a)return t(e,n,i,r,o,s)?n:void 0}))}}function Ft(t,e){return function(n,i,r,o){var s,a,l=Array.isArray(i)?i[0]:i,u=null==e?l.fill:e,c=l.stroke&&n.isPointInStroke;return c&&(s=l.strokeWidth,a=l.strokeCap,n.lineWidth=null!=s?s:1,n.lineCap=null!=a?a:"butt"),!t(n,i)&&(u&&n.isPointInPath(r,o)||c&&n.isPointInStroke(r,o))}}function Yt(t){return Xt(Ft(t))}function Jt(t,e){return"translate("+t+","+e+")"}function $t(t){return"rotate("+t+")"}function Qt(t){return Jt(t.x||0,t.y||0)}function Zt(t){return Jt(t.x||0,t.y||0)+(t.angle?" "+$t(t.angle):"")+(t.scaleX||t.scaleY?" "+(e=t.scaleX||1,n=t.scaleY||1,"scale("+e+","+n+")"):"");var e,n}function Kt(t,e,n){function i(t,n){var i=n.x||0,r=n.y||0,o=n.angle||0;t.translate(i,r),o&&t.rotate(o*=v),t.beginPath(),e(t,n),o&&t.rotate(-o),t.translate(-i,-r)}return{type:t,tag:"path",nested:!1,attr:function(t,n){t("transform",Zt(n)),t("d",e(null,n))},bound:function(t,n){var i=n.x||0,r=n.y||0;return e(vt(t),n),ht(t,n).translate(i,r),n.angle&&t.rotate(n.angle*v,i,r),t},draw:jt(i),pick:Yt(i),isect:n||Ct(i)}}var te=Kt("arc",(function(t,e){return U.context(t)(e)}));function ee(t,e,n){function i(t,n){t.beginPath(),e(t,n)}var r=Ft(i);return{type:t,tag:"path",nested:!0,attr:function(t,n){var i=n.mark.items;i.length&&t("d",e(null,i))},bound:function(t,n){var i=n.items;return 0===i.length?t:(e(vt(t),i),ht(t,i[0]))},draw:Wt(i),pick:function(t,e,n,i,o,s){var a=e.items,l=e.bounds;return!a||!a.length||l&&!l.contains(o,s)?null:(n*=t.pixelRatio,i*=t.pixelRatio,r(t,a,n,i)?a[0]:null)},isect:Rt,tip:n}}var ne=ee("area",(function(t,e){var n=e[0],i=n.interpolate||"linear";return("horizontal"===n.orient?F:X).curve(f(i,n.orient,n.tension)).context(t)(e)}),(function(t,e){for(var n,i,r="horizontal"===t[0].orient?e[1]:e[0],o="horizontal"===t[0].orient?"y":"x",s=t.length,a=1/0;--s>=0;)!1!==t[s].defined&&(i=Math.abs(t[s][o]-r)).5&&e<1.5?.5-Math.abs(e-1):0}function oe(t,e){const n=re(e);t("d",K(null,e,n,n))}function se(t,e,n,i){const r=re(e);t.beginPath(),K(t,e,(n||0)+r,(i||0)+r)}const ae=Ft(se),le=Ft(se,!1);var ue={type:"group",tag:"g",nested:!1,attr:function(t,e){t("transform",Qt(e))},bound:function(t,e){if(!e.clip&&e.items){const n=e.items,i=n.length;for(let e=0;e{const i=e.x||0,r=e.y||0,o=e.strokeForeground,s=null==e.opacity?1:e.opacity;(e.stroke||e.fill)&&s&&(se(t,e,i,r),Lt(t,e),e.fill&&Dt(t,e,s)&&t.fill(),e.stroke&&!o&&It(t,e,s)&&t.stroke()),t.save(),t.translate(i,r),e.clip&&ie(t,e),n&&n.translate(-i,-r),Ht(e,e=>{this.draw(t,e,n)}),n&&n.translate(i,r),t.restore(),o&&e.stroke&&s&&(se(t,e,i,r),Lt(t,e),It(t,e,s)&&t.stroke())})},pick:function(t,e,n,i,r,o){if(e.bounds&&!e.bounds.contains(r,o)||!e.items)return null;const s=n*t.pixelRatio,a=i*t.pixelRatio;return Gt(e,l=>{let u,c,h,f,d,g,p,v,y;if(v=l.bounds,(!v||v.contains(r,o))&&(f=l.x||0,d=l.y||0,g=f+(l.width||0),p=d+(l.height||0),y=l.clip,!y||!(rg||op)))return t.save(),t.translate(f,d),f=r-f,d=o-d,y&&Z(l)&&!ae(t,l,s,a)?(t.restore(),null):(c=l.strokeForeground,h=!1!==e.interactive,h&&c&&l.stroke&&le(t,l,s,a)?(t.restore(),l):(u=Gt(l,t=>function(t,e,n){return(!1!==t.interactive||"group"===t.marktype)&&t.bounds&&t.bounds.contains(e,n)}(t,f,d)?this.pick(t,n,i,f,d):null),!u&&h&&(l.fill||!c&&l.stroke)&&ae(t,l,s,a)&&(u=l),t.restore(),u||null))})},isect:zt,content:function(t,e,n){t("clip-path",e.clip?nt(n,e,e):null)},background:function(t,e){t("class","background"),t("aria-hidden",!0),oe(t,e)},foreground:function(t,e){t("class","foreground"),t("aria-hidden",!0),e.strokeForeground?oe(t,e):t("d","")}},ce={version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"};function he(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 fe(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 de(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 ge(t,e){return"center"===t?e/2:"right"===t?e:0}function pe(t,e){return"middle"===t?e/2:"bottom"===t?e:0}var ve={type:"image",tag:"image",nested:!1,attr:function(t,e,n){const i=he(e,n),r=fe(e,i),o=de(e,i),s=(e.x||0)-ge(e.align,r),a=(e.y||0)-pe(e.baseline,o);t("href",!i.src&&i.toDataURL?i.toDataURL():i.src||"",ce["xmlns:xlink"],"xlink:href"),t("transform",Jt(s,a)),t("width",r),t("height",o),t("preserveAspectRatio",!1===e.aspect?"none":"xMidYMid")},bound:function(t,e){const n=e.image,i=fe(e,n),r=de(e,n),o=(e.x||0)-ge(e.align,i),s=(e.y||0)-pe(e.baseline,r);return t.set(o,s,o+i,s+r)},draw:function(t,e,n){Ht(e,e=>{if(n&&!n.intersects(e.bounds))return;let i,r,o,s,a=he(e,this),l=fe(e,a),u=de(e,a),c=(e.x||0)-ge(e.align,l),h=(e.y||0)-pe(e.baseline,u);!1!==e.aspect&&(r=a.width/a.height,o=e.width/e.height,r==r&&o==o&&r!==o&&(o=0;)if(!1!==t[o].defined&&(n=t[o].x-e[0])*n+(i=t[o].y-e[1])*i1?n:n[0]:n;var n}function De(t,e){const n=null==e?"":(e+"").trim();return t.limit>0&&n.length?function(t,e){var n=+t.limit,i=function(t){if(Ce.width===Se){const e=Ie(t);return t=>Le(t,e)}{const e=Oe(t);return t=>Pe(t,e)}}(t);if(i(e)>>1,i(e.slice(r))>n?a=r+1:l=r;return o+e.slice(a)}for(;a>>1),i(e.slice(0,r))Math.max(t,Ce.width(n,e)),0)):r=Ce.width(n,f),"center"===s?c-=r/2:"right"===s&&(c-=r),t.set(c+=l,h+=u,c+r,h+o),n.angle&&!i)t.rotate(n.angle*v,l,u);else if(2===i)return t.rotatedPoints(n.angle*v,l,u);return t}var We={arc:te,area:ne,group:ue,image:ve,line:ye,path:me,rect:be,rule:we,shape:Te,symbol:Ae,text:{type:"text",tag:"text",nested:!1,attr:function(t,e){var n,i=e.dx||0,r=(e.dy||0)+Be(e),o=Ge(e),s=o.x1,a=o.y1,l=e.angle||0;t("text-anchor",Ve[e.align]||"start"),l?(n=Jt(s,a)+" "+$t(l),(i||r)&&(n+=" "+Jt(i,r))):n=Jt(s+i,a+r),t("transform",n)},bound:je,draw:function(t,n,i){Ht(n,(function(n){var r,o,s,a,l,u,c,h=null==n.opacity?1:n.opacity;if(!(i&&!i.intersects(n.bounds)||0===h||n.fontSize<=0||null==n.text||0===n.text.length)){if(t.font=Ie(n),t.textAlign=n.align||"left",o=(r=Ge(n)).x1,s=r.y1,n.angle&&(t.save(),t.translate(o,s),t.rotate(n.angle*v),o=s=0),o+=n.dx||0,s+=(n.dy||0)+Be(n),u=qe(n),Lt(t,n),e.isArray(u))for(l=Ne(n),a=0;a=0;)if(!1!==t[r].defined&&(n=t[r].x-e[0])*n+(i=t[r].y-e[1])*i<(n=t[r].size||1)*n)return t[r];return null}))};function Ue(t,e,n){var i=We[t.mark.marktype],r=e||i.bound;return i.nested&&(t=t.mark),r(t.bounds||(t.bounds=new it),t,n)}var Xe={mark:null};function Fe(t,e,n){var i,r,o,s,a=We[t.marktype],l=a.bound,u=t.items,c=u&&u.length;if(a.nested)return c?o=u[0]:(Xe.mark=t,o=Xe),s=Ue(o,l,n),e=e&&e.union(s)||s;if(e=e||t.bounds&&t.bounds.clear()||new it,c)for(i=0,r=u.length;ie;)t.removeChild(n[--i]);return t}function on(t){return"mark-"+t.marktype+(t.role?" role-"+t.role:"")+(t.name?" "+t.name:"")}function sn(t,e){var n=e.getBoundingClientRect();return[t.clientX-n.left-(e.clientLeft||0),t.clientY-n.top-(e.clientTop||0)]}function an(t,e){this._active=null,this._handlers={},this._loader=t||o.loader(),this._tooltip=e||ln}function ln(t,e,n,i){t.element().setAttribute("title",i||"")}Ze.toJSON=function(t){return Je(this.root,t||0)},Ze.mark=function(t,e,n){var i=Ke(t,e=e||this.root.items[0]);return e.items[n]=i,i.zindex&&(i.group.zdirty=!0),i};const un=an.prototype;function cn(t){this._el=null,this._bgcolor=null,this._loader=new at(t)}un.initialize=function(t,e,n){return this._el=t,this._obj=n||null,this.origin(e)},un.element=function(){return this._el},un.canvas=function(){return this._el&&this._el.firstChild},un.origin=function(t){return arguments.length?(this._origin=t||[0,0],this):this._origin.slice()},un.scene=function(t){return arguments.length?(this._scene=t,this):this._scene},un.on=function(){},un.off=function(){},un._handlerIndex=function(t,e,n){for(let i=t?t.length:0;--i>=0;)if(t[i].type===e&&(!n||t[i].handler===n))return i;return-1},un.handlers=function(t){const e=this._handlers,n=[];if(t)n.push.apply(n,e[this.eventName(t)]);else for(const t in e)n.push.apply(n,e[t]);return n},un.eventName=function(t){const e=t.indexOf(".");return e<0?t:t.slice(0,e)},un.handleHref=function(t,e,n){this._loader.sanitize(n,{context:"href"}).then(e=>{const n=new MouseEvent(t.type,t),i=tn(null,"a");for(const t in e)i.setAttribute(t,e[t]);i.dispatchEvent(n)}).catch((function(){}))},un.handleTooltip=function(t,e,n){if(e&&null!=e.tooltip){e=function(t,e,n,i){var r,o,s=t&&t.mark;if(s&&(r=We[s.marktype]).tip){for((o=sn(e,n))[0]-=i[0],o[1]-=i[1];t=t.mark.group;)o[0]-=t.x||0,o[1]-=t.y||0;t=r.tip(s.items,o)}return t}(e,t,this.canvas(),this._origin);const i=n&&e&&e.tooltip||null;this._tooltip.call(this._obj,this,t,e,i)}},un.getItemBoundingClientRect=function(t){const e=this.canvas();if(!e)return;const n=e.getBoundingClientRect(),i=this._origin,r=t.bounds,o=r.width(),s=r.height();let a=r.x1+i[0]+n.left,l=r.y1+i[1]+n.top;for(;t.mark&&(t=t.mark.group);)a+=t.x||0,l+=t.y||0;return{x:a,y:l,width:o,height:s,left:a,top:l,right:a+o,bottom:l+s}};var hn=cn.prototype;hn.initialize=function(t,e,n,i,r){return this._el=t,this.resize(e,n,i,r)},hn.element=function(){return this._el},hn.canvas=function(){return this._el&&this._el.firstChild},hn.background=function(t){return 0===arguments.length?this._bgcolor:(this._bgcolor=t,this)},hn.resize=function(t,e,n,i){return this._width=t,this._height=e,this._origin=n||[0,0],this._scale=i||1,this},hn.dirty=function(){},hn.render=function(t){var e=this;return e._call=function(){e._render(t)},e._call(),e._call=null,e},hn._render=function(){},hn.renderAsync=function(t){var e=this.render(t);return this._ready?this._ready.then((function(){return e})):Promise.resolve(e)},hn._load=function(t,e){var n=this,i=n._loader[t](e);if(!n._ready){var r=n._call;n._ready=n._loader.ready().then((function(t){t&&r(),n._ready=null}))}return i},hn.sanitizeURL=function(t){return this._load("sanitizeURL",t)},hn.loadImage=function(t){return this._load("loadImage",t)};const fn="dragleave",dn="mousedown",gn="mousemove",pn="mouseout",vn="click",yn=["keydown","keypress","keyup","dragenter",fn,"dragover",dn,"mouseup",gn,pn,"mouseover",vn,"dblclick","wheel","mousewheel","touchstart","touchmove","touchend"],_n=gn,mn=pn,xn=vn;function bn(t,e){an.call(this,t,e),this._down=null,this._touch=null,this._first=!0,this._events={}}const kn=e.inherits(bn,an);kn.initialize=function(t,e,n){return this._canvas=t&&en(t,"canvas"),[vn,dn,gn,pn,fn].forEach(t=>wn(this,t)),an.prototype.initialize.call(this,t,e,n)};function wn(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 Tn(t,e,n){return function(i){const r=this._active,o=this.pickEvent(i);o===r||(r&&r.exit||this.fire(n,i),this._active=o,this.fire(e,i)),this.fire(t,i)}}function An(t){return function(e){this.fire(t,e),this._active=null}}kn.canvas=function(){return this._canvas},kn.context=function(){return this._canvas.getContext("2d")},kn.events=yn,kn.DOMMouseScroll=function(t){this.fire("mousewheel",t)},kn.mousemove=Tn(gn,"mouseover",pn),kn.dragover=Tn("dragover","dragenter",fn),kn.mouseout=An(pn),kn.dragleave=An(fn),kn.mousedown=function(t){this._down=this._active,this.fire(dn,t)},kn.click=function(t){this._down===this._active&&(this.fire(vn,t),this._down=null)},kn.touchstart=function(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire("touchstart",t,!0)},kn.touchmove=function(t){this.fire("touchmove",t,!0)},kn.touchend=function(t){this.fire("touchend",t,!0),this._touch=null},kn.fire=function(t,e,n){const i=n?this._touch:this._active,r=this._handlers[t];if(e.vegaType=t,t===xn&&i&&i.href?this.handleHref(e,i,i.href):t!==_n&&t!==mn||this.handleTooltip(e,i,t!==mn),r)for(let t=0,n=r.length;t=0&&i.splice(r,1),this},kn.pickEvent=function(t){const e=sn(t,this._canvas),n=this._origin;return this.pick(this._scene,e[0],e[1],e[0]-n[0],e[1]-n[1])},kn.pick=function(t,e,n,i,r){const o=this.context();return We[t.marktype].pick.call(this,o,t,e,n,i,r)};var Mn="undefined"!=typeof window&&window.devicePixelRatio||1;function Cn(t){cn.call(this,t),this._options={},this._redraw=!1,this._dirty=new it,this._tempb=new it}const Rn=e.inherits(Cn,cn),zn=cn.prototype;Rn.initialize=function(t,e,n,i,o,s){return this._options=s||{},this._canvas=this._options.externalContext?null:r.canvas(1,1,this._options.type),t&&this._canvas&&(rn(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),zn.initialize.call(this,t,e,n,i,o)},Rn.resize=function(t,n,i,r){if(zn.resize.call(this,t,n,i,r),this._canvas)!function(t,e,n,i,r,o){const s="undefined"!=typeof HTMLElement&&t instanceof HTMLElement&&null!=t.parentNode,a=t.getContext("2d"),l=s?Mn:r;t.width=e*l,t.height=n*l;for(const t in o)a[t]=o[t];s&&1!==l&&(t.style.width=e+"px",t.style.height=n+"px"),a.pixelRatio=l,a.setTransform(l,0,0,l,l*i[0],l*i[1])}(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const t=this._options.externalContext;t||e.error("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},Rn.canvas=function(){return this._canvas},Rn.context=function(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)},Rn.dirty=function(t){let e=this._tempb.clear().union(t.bounds),n=t.mark.group;for(;n;)e.translate(n.x||0,n.y||0),n=n.mark.group;this._dirty.union(e)};function Pn(t,e){an.call(this,t,e);const n=this;n._hrefHandler=Ln(n,(t,e)=>{e&&e.href&&n.handleHref(t,e,e.href)}),n._tooltipHandler=Ln(n,(t,e)=>{n.handleTooltip(t,e,t.type!==mn)})}Rn._render=function(t){const e=this.context(),n=this._origin,i=this._width,r=this._height,o=this._dirty,s=(a=n,l=i,u=r,(new it).set(0,0,l,u).translate(-a[0],-a[1]));var a,l,u;e.save();const c=this._redraw||o.empty()?(this._redraw=!1,s.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,s.intersect(o),n);return this.clear(-n[0],-n[1],i,r),this.draw(e,t,c),e.restore(),o.clear(),this},Rn.draw=function(t,n,i){const r=We[n.marktype];n.clip&&function(t,n){var i=n.clip;t.save(),e.isFunction(i)?(t.beginPath(),i(t),t.clip()):ie(t,n.group)}(t,n),r.draw.call(this,t,n,i),n.clip&&t.restore()},Rn.clear=function(t,e,n,i){const r=this._options,o=this.context();"pdf"===r.type||r.externalContext||o.clearRect(t,e,n,i),null!=this._bgcolor&&(o.fillStyle=this._bgcolor,o.fillRect(t,e,n,i))};const Sn=e.inherits(Pn,an);Sn.initialize=function(t,e,n){let i=this._svg;return i&&(i.removeEventListener(xn,this._hrefHandler),i.removeEventListener(_n,this._tooltipHandler),i.removeEventListener(mn,this._tooltipHandler)),this._svg=i=t&&en(t,"svg"),i&&(i.addEventListener(xn,this._hrefHandler),i.addEventListener(_n,this._tooltipHandler),i.addEventListener(mn,this._tooltipHandler)),an.prototype.initialize.call(this,t,e,n)},Sn.canvas=function(){return this._svg};const Ln=(t,e)=>n=>{let i=n.target.__data__;i=Array.isArray(i)?i[0]:i,n.vegaType=n.type,e.call(t._obj,n,i)};Sn.on=function(t,e){const n=this.eventName(t),i=this._handlers;if(this._handlerIndex(i[n],t,e)<0){const r={type:t,handler:e,listener:Ln(this,e)};(i[n]||(i[n]=[])).push(r),this._svg&&this._svg.addEventListener(n,r.listener)}return this},Sn.off=function(t,e){const n=this.eventName(t),i=this._handlers[n],r=this._handlerIndex(i,t,e);return r>=0&&(this._svg&&this._svg.removeEventListener(n,i[r].listener),i.splice(r,1)),this};const On=(t,e,n)=>({role:t,"aria-roledescription":e,"aria-label":n||void 0}),Nn=e.toSet(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),qn={axis:{desc:"axis",caption:function(t){const e=t.datum,n=t.orient,i=e.title?Vn(t):null,r=t.context,o=r.scales[e.scale].value,a=r.dataflow.locale(),l=o.type;return("left"===n||"right"===n?"Y":"X")+"-axis"+(i?` titled '${i}'`:"")+` for a ${s.isDiscrete(l)?"discrete":l} scale with `+s.domainCaption(a,o,t)}},legend:{desc:"legend",caption:function(t){const n=t.datum,i=n.title?Vn(t):null,r=((n.type||"")+" legend").trim(),o=n.scales,a=Object.keys(o),l=t.context,u=l.scales[o[a[0]]].value,c=l.dataflow.locale();return h=r,(h.length?h[0].toUpperCase()+h.slice(1):h)+(i?` titled '${i}'`:"")+" for "+function(t){return(t=t.map(t=>t+("fill"===t||"stroke"===t?" color":""))).length<2?t[0]:t.slice(0,-1).join(", ")+" and "+e.peek(t)}(a)+" with "+s.domainCaption(c,u,t);var h}},"title-text":{desc:"title",caption:t=>`Title text '${Bn(t)}'`},"title-subtitle":{desc:"subtitle",caption:t=>`Subtitle text '${Bn(t)}'`}},Dn={ariaRole:"role",ariaRoleDescription:"aria-roledescription",description:"aria-label"};function En(t,e){const n=!1===e.aria;if(t("aria-hidden",n||void 0),n||null==e.description)for(const e in Dn)t(Dn[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||n+" mark")}}function In(t){return!1===t.aria?{"aria-hidden":!0}:Nn[t.role]?null:qn[t.role]?function(t,e){try{const n=t.items[0],i=e.caption||(()=>"");return On(e.role||"graphics-symbol",e.desc,n.description||i(n))}catch(t){return null}}(t,qn[t.role]):function(t){const e=t.marktype,n="group"===e||"text"===e||t.items.some(t=>null!=t.description&&!1!==t.aria);return On(n?"graphics-object":"graphics-symbol",e+" mark container",t.description)}(t)}function Bn(t){return e.array(t.text).join(" ")}function Vn(t){try{return e.array(e.peek(t.items).items[0].text).join(" ")}catch(t){return null}}const Hn=t=>(t+"").replace(/&/g,"&").replace(/"/g,""");function Gn(t,e,n){var i,r,o="<"+t;if(e)for(i in e)null!=(r=e[i])&&(o+=" "+i+'="'+Hn(r)+'"');return n&&(o+=" "+n),o+">"}function jn(t){return""}const Wn={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"},Un={fill:"none","stroke-miterlimit":10},Xn=ce.xmlns;function Fn(t){cn.call(this,t),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}var Yn=e.inherits(Fn,cn),Jn=cn.prototype;function $n(t,e,n){var i,r,o;if("radial"===e.gradient){var s=nn(t,n++,"pattern",Xn);s.setAttribute("id","p_"+e.id),s.setAttribute("viewBox","0,0,1,1"),s.setAttribute("width","100%"),s.setAttribute("height","100%"),s.setAttribute("preserveAspectRatio","xMidYMid slice"),(s=nn(s,0,"rect",Xn)).setAttribute("width","1"),s.setAttribute("height","1"),s.setAttribute("fill","url("+si()+"#"+e.id+")"),(t=nn(t,n++,"radialGradient",Xn)).setAttribute("id",e.id),t.setAttribute("fx",e.x1),t.setAttribute("fy",e.y1),t.setAttribute("fr",e.r1),t.setAttribute("cx",e.x2),t.setAttribute("cy",e.y2),t.setAttribute("r",e.r2)}else(t=nn(t,n++,"linearGradient",Xn)).setAttribute("id",e.id),t.setAttribute("x1",e.x1),t.setAttribute("x2",e.x2),t.setAttribute("y1",e.y1),t.setAttribute("y2",e.y2);for(i=0,r=e.stops.length;i1&&t.previousSibling!=e}(s,n))&&e.insertBefore(s,n?n.nextSibling:e.firstChild),s}Yn.initialize=function(t,e,n,i){if(this._defs={gradient:{},clipping:{}},t){this._svg=nn(t,0,"svg",Xn),this._svg.setAttribute("class","marks"),rn(t,1),this._root=nn(this._svg,0,"g",Xn);for(const t in Un)this._root.setAttribute(t,Un[t]);rn(this._svg,1)}return this.background(this._bgcolor),Jn.initialize.call(this,t,e,n,i)},Yn.background=function(t){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",t),Jn.background.apply(this,arguments)},Yn.resize=function(t,e,n,i){return Jn.resize.call(this,t,e,n,i),this._svg&&(this._svg.setAttribute("width",this._width*this._scale),this._svg.setAttribute("height",this._height*this._scale),this._svg.setAttribute("viewBox","0 0 "+this._width+" "+this._height),this._root.setAttribute("transform","translate("+this._origin+")")),this._dirty=[],this},Yn.canvas=function(){return this._svg},Yn.svg=function(){if(!this._svg)return null;var t={class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 "+this._width+" "+this._height};for(var e in ce)t[e]=ce[e];var n=this._bgcolor?Gn("rect",{width:this._width,height:this._height,fill:this._bgcolor})+jn("rect"):"";return Gn("svg",t)+(this._defs.el?this._defs.el.outerHTML:"")+n+this._root.outerHTML+jn("svg")},Yn._render=function(t){return this._dirtyCheck()&&(this._dirtyAll&&this._resetDefs(),this.draw(this._root,t),rn(this._root,1)),this.updateDefs(),this._dirty=[],++this._dirtyID,this},Yn.updateDefs=function(){const t=this._svg,e=this._defs;let n=e.el,i=0;for(const r in e.gradient)n||(e.el=n=nn(t,0,"defs",Xn)),i=$n(n,e.gradient[r],i);for(const r in e.clipping)n||(e.el=n=nn(t,0,"defs",Xn)),i=Qn(n,e.clipping[r],i);n&&(0===i?(t.removeChild(n),e.el=null):rn(n,i))},Yn._resetDefs=function(){var t=this._defs;t.gradient={},t.clipping={}},Yn.dirty=function(t){t.dirty!==this._dirtyID&&(t.dirty=this._dirtyID,this._dirty.push(t))},Yn.isDirty=function(t){return this._dirtyAll||!t._svg||t.dirty===this._dirtyID},Yn._dirtyCheck=function(){this._dirtyAll=!0;var t=this._dirty;if(!t.length||!this._dirtyID)return!0;var e,n,i,r,o,s,a,l=++this._dirtyID;for(o=0,s=t.length;o{const e=this.isDirty(t),n=Kn(t,i,l,o.tag,r);e&&(this._update(o,n,t),a&&function(t,e,n){e=e.lastChild.previousSibling;let i,r=0;Ht(n,n=>{i=t.draw(e,n,i),++r}),rn(e,1+r)}(this,n,t)),l=n,++u};return o.nested?e.items.length&&h(e.items[0]):Ht(e,h),rn(i,u),i};var ti=null,ei=null,ni={group:function(t,e,n){const i=ti=e.childNodes[2];ei=i.__values__,t.foreground(ri,n,this),ei=e.__values__,ti=e.childNodes[1],t.content(ri,n,this);const r=ti=e.childNodes[0];t.background(ri,n,this);const o=!1===n.mark.interactive?"none":null;if(o!==ei.events&&(oi(i,"pointer-events",o),oi(r,"pointer-events",o),ei.events=o),n.strokeForeground&&n.stroke){const t=n.fill;oi(i,"display",null),this.style(r,n),oi(r,"stroke",null),t&&(n.fill=null),ei=i.__values__,this.style(i,n),t&&(n.fill=t),ti=null}else oi(i,"display","none")},image:function(t,e,n){!1===n.smooth?(ii(e,"image-rendering","optimizeSpeed"),ii(e,"image-rendering","pixelated")):ii(e,"image-rendering",null)},text:function(t,n,i){let r,o,s,a,l=qe(i);e.isArray(l)?(o=l.map(t=>De(i,t)),r=o.join("\n"),r!==ei.text&&(rn(n,0),s=n.ownerDocument,a=Ne(i),o.forEach((t,e)=>{const r=tn(s,"tspan",Xn);r.__data__=i,r.textContent=t,e&&(r.setAttribute("x",0),r.setAttribute("dy",a)),n.appendChild(r)}),ei.text=r)):(o=De(i,l),o!==ei.text&&(n.textContent=o,ei.text=o)),oi(n,"font-family",Ee(i)),oi(n,"font-size",Oe(i)+"px"),oi(n,"font-style",i.fontStyle),oi(n,"font-variant",i.fontVariant),oi(n,"font-weight",i.fontWeight)}};function ii(t,e,n){n!==ei[e]&&(null==n?t.style.removeProperty(e):t.style.setProperty(e,n+""),ei[e]=n)}function ri(t,e,n){e!==ei[t]&&(n?function(t,e,n,i){null!=n?t.setAttributeNS(i,e,n):t.removeAttributeNS(i,e)}(ti,t,e,n):oi(ti,t,e),ei[t]=e)}function oi(t,e,n){null!=n?t.setAttribute(e,n):t.removeAttribute(e)}function si(){let t;return"undefined"==typeof window?"":(t=window.location).hash?t.href.slice(0,-t.hash.length):t.href}function ai(t){cn.call(this,t),this._text={head:"",bg:"",root:"",foot:"",defs:"",body:""},this._defs={gradient:{},clipping:{}}}Yn._update=function(t,e,n){ti=e,ei=e.__values__,En(ri,n),t.attr(ri,n,this);const i=ni[t.type];i&&i.call(this,t,e,n),ti&&this.style(ti,n)},Yn.style=function(t,e){if(null!=e)for(const n in Wn){let i="font"===n?Ee(e):e[n];if(i===ei[n])continue;const r=Wn[n];null==i?t.removeAttribute(r):(l(i)&&(i=u(i,this._defs.gradient,si())),t.setAttribute(r,i+"")),ei[n]=i}};var li=e.inherits(ai,cn),ui=cn.prototype;function ci(t){return t.replace(/&/g,"&").replace(//g,">")}li.resize=function(t,n,i,r){ui.resize.call(this,t,n,i,r);var o=this._origin,s=this._text,a={class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 "+this._width+" "+this._height};for(var l in ce)a[l]=ce[l];s.head=Gn("svg",a);var u=this._bgcolor;return"transparent"!==u&&"none"!==u||(u=null),s.bg=u?Gn("rect",{width:this._width,height:this._height,fill:u})+jn("rect"):"",s.root=Gn("g",e.extend({},Un,{transform:"translate("+o+")"})),s.foot=jn("g")+jn("svg"),this},li.background=function(){var t=ui.background.apply(this,arguments);return arguments.length&&this._text.head&&this.resize(this._width,this._height,this._origin,this._scale),t},li.svg=function(){var t=this._text;return t.head+t.defs+t.bg+t.root+t.body+t.foot},li._render=function(t){return this._text.body=this.mark(t),this._text.defs=this.buildDefs(),this},li.buildDefs=function(){let t,e="";for(const n in this._defs.gradient){const i=this._defs.gradient[n],r=i.stops;"radial"===i.gradient?(e+=Gn(t="pattern",{id:"p_"+n,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),e+=Gn("rect",{width:"1",height:"1",fill:"url(#"+n+")"})+jn("rect"),e+=jn(t),e+=Gn(t="radialGradient",{id:n,fx:i.x1,fy:i.y1,fr:i.r1,cx:i.x2,cy:i.y2,r:i.r2})):e+=Gn(t="linearGradient",{id:n,x1:i.x1,x2:i.x2,y1:i.y1,y2:i.y2});for(let t=0;t{r[i||t]=e};return Array.isArray(n)?n.forEach(t=>t(o,e,this)):n(o,e,this),i&&function(t,e,n,i,r){if(null==e)return t;"bgrect"===i&&!1===n.interactive&&(t["pointer-events"]="none");if("bgfore"===i&&(!1===n.interactive&&(t["pointer-events"]="none"),t.display="none",null!==e.fill))return t;"image"===i&&!1===e.smooth&&(t.style="image-rendering: optimizeSpeed; image-rendering: pixelated;");"text"===i&&(t["font-family"]=Ee(e),t["font-size"]=Oe(e)+"px",e.fontStyle&&(t["font-style"]=e.fontStyle),e.fontVariant&&(t["font-variant"]=e.fontVariant),e.fontWeight&&(t["font-weight"]=e.fontWeight));for(const n in Wn){let i=e[n];const o=Wn[n];("transparent"!==i||"fill"!==o&&"stroke"!==o)&&null!=i&&(l(i)&&(i=u(i,r.gradient,"")),t[o]=i)}}(r,e,t,i,this._defs),r},li.href=function(t){var e,n=this,i=t.href;if(i){if(e=n._hrefs&&n._hrefs[i])return e;n.sanitizeURL(i).then(t=>{t["xlink:href"]=t.href,t.href=null,(n._hrefs||(n._hrefs={}))[i]=t})}return null},li.mark=function(t){const n=We[t.marktype],i=n.tag,r=[En,n.attr];let o="";o+=Gn("g",e.extend({class:on(t),"clip-path":t.clip?nt(this,t,t.group):null},In(t),{"pointer-events":"g"!==i&&!1===t.interactive?"none":null}));const s=s=>{const a=this.href(s);if(a&&(o+=Gn("a",a)),o+=Gn(i,this.attr(t,s,r,"g"!==i?i:null)),"text"===i){const t=qe(s);if(e.isArray(t)){const e={x:0,dy:Ne(s)};for(let n=0;n{e+=this.mark(t)}),e};var hi={Canvas:"canvas",PNG:"png",SVG:"svg",None:"none"},fi={};function di(t,e,n,i){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 r=t.items,o=t.marktype,s=r.length;let a=0;if("group"===o)for(;a=0;i--)if(r[i]!=o[i])return!1;for(i=r.length-1;i>=0;i--)if(n=r[i],!yi(t[n],e[n],n))return!1;return typeof t==typeof e}(t,n):t==n)}function _i(t,e){return yi(p(t),p(e))}t.Bounds=it,t.CanvasHandler=bn,t.CanvasRenderer=Cn,t.Gradient=function(t,e){var n,i=[];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:i,stop:function(t,e){return i.push({offset:t,color:e}),n}}},t.GroupItem=st,t.Handler=an,t.Item=ot,t.Marks=We,t.RenderType=hi,t.Renderer=cn,t.ResourceLoader=at,t.SVGHandler=Pn,t.SVGRenderer=Fn,t.SVGStringRenderer=ai,t.Scenegraph=Qe,t.boundClip=function(t){var n=t.clip;if(e.isFunction(n))n(vt(vi.clear()));else{if(!n)return;vi.set(0,0,t.group.width,t.group.height)}t.bounds.intersect(vi)},t.boundContext=vt,t.boundItem=Ue,t.boundMark=Fe,t.boundStroke=ht,t.closeTag=jn,t.domChild=nn,t.domClear=rn,t.domCreate=tn,t.domFind=en,t.font=Ie,t.fontFamily=Ee,t.fontSize=Oe,t.intersect=function(t,n,i){const r=[],o=(new it).union(n),s=t.marktype;return s?di(t,o,i,r):"group"===s?gi(t,o,i,r):e.error("Intersect scene must be mark node or group item.")},t.intersectBoxLine=St,t.intersectPath=Ct,t.intersectPoint=Rt,t.intersectRule=Pt,t.lineHeight=Ne,t.multiLineOffset=function(t){const n=qe(t);return(e.isArray(n)?n.length-1:0)*Ne(t)},t.openTag=Gn,t.pathCurves=f,t.pathEqual=_i,t.pathParse=p,t.pathRectangle=B,t.pathRender=M,t.pathSymbols=P,t.pathTrail=V,t.point=sn,t.renderModule=function(t,e){return t=String(t||"").toLowerCase(),arguments.length>1?(fi[t]=e,this):fi[t]},t.resetSVGClipId=et,t.resetSVGDefIds=function(){et(),a=0},t.sceneEqual=yi,t.sceneFromJSON=$e,t.scenePickVisit=Gt,t.sceneToJSON=Je,t.sceneVisit=Ht,t.sceneZOrder=Vt,t.textMetrics=Ce,Object.defineProperty(t,"__esModule",{value:!0})}));