import{hasOwnProperty as Pt,inherits as Xi,lruCache as Yi,isArray as Z,error as hn,toSet as Ji,extend as Fi,isFunction as ce,isNumber as un,isObject as cn,truthy as fn,array as dn,peek as pn}from"/-/vega-util@v1.17.2-LUfkDhormMyfWqy3Ts6U/dist=es2020,mode=imports,min/optimized/vega-util.js";import{arc as Ki,area as gn,line as Zi,symbol as Qi,curveBasis as tr,curveBasisClosed as er,curveBasisOpen as nr,curveBundle as ir,curveCardinal as rr,curveCardinalOpen as sr,curveCardinalClosed as or,curveCatmullRom as ar,curveCatmullRomClosed as lr,curveCatmullRomOpen as hr,curveLinear as ur,curveLinearClosed as cr,curveMonotoneY as fr,curveMonotoneX as dr,curveNatural as pr,curveStep as gr,curveStepAfter as vr,curveStepBefore as yr}from"/-/d3-shape@v3.2.0-jvLE9CjF3Vp4eEpVme8s/dist=es2020,mode=imports,min/optimized/d3-shape.js";import{path as vn}from"/-/d3-path@v3.1.0-nHaUoYzlRDYONpece9h0/dist=es2020,mode=imports,min/optimized/d3-path.js";export{path}from"/-/d3-path@v3.1.0-nHaUoYzlRDYONpece9h0/dist=es2020,mode=imports,min/optimized/d3-path.js";import{image as _r,canvas as fe}from"/-/vega-canvas@v1.2.7-hCEcvULuKIOqBVGX1Tn8/dist=es2020,mode=imports,min/optimized/vega-canvas.js";import{loader as yn}from"/-/vega-loader@v4.5.2-1ImBl2TigOVzvurACWyz/dist=es2020,mode=imports,min/optimized/vega-loader.js";import{isDiscrete as kr,domainCaption as _n}from"/-/vega-scale@v7.4.1-M0T9Gn9zHGGuV6XhZsTO/dist=es2020,mode=imports,min/optimized/vega-scale.js";let kn=0;function wr(){kn=0}const St="p_";function de(t){return t&&t.gradient}function wn(t,e,n){const i=t.gradient;let r=t.id,o=i==="radial"?St:"";return r||(r=t.id="gradient_"+kn++,i==="radial"?(t.x1=I(t.x1,.5),t.y1=I(t.y1,.5),t.r1=I(t.r1,0),t.x2=I(t.x2,.5),t.y2=I(t.y2,.5),t.r2=I(t.r2,.5),o=St):(t.x1=I(t.x1,0),t.y1=I(t.y1,0),t.x2=I(t.x2,1),t.y2=I(t.y2,0))),e[r]=t,"url("+(n||"")+"#"+o+r+")"}function I(t,e){return t??e}function br(t,e){var n=[],i;return i={gradient:"linear",x1:t?t[0]:0,y1:t?t[1]:0,x2:e?e[0]:1,y2:e?e[1]:0,stops:n,stop:function(r,o){return n.push({offset:r,color:o}),i}}}const bn={basis:{curve:tr},"basis-closed":{curve:er},"basis-open":{curve:nr},bundle:{curve:ir,tension:"beta",value:.85},cardinal:{curve:rr,tension:"tension",value:0},"cardinal-open":{curve:sr,tension:"tension",value:0},"cardinal-closed":{curve:or,tension:"tension",value:0},"catmull-rom":{curve:ar,tension:"alpha",value:.5},"catmull-rom-closed":{curve:lr,tension:"alpha",value:.5},"catmull-rom-open":{curve:hr,tension:"alpha",value:.5},linear:{curve:ur},"linear-closed":{curve:cr},monotone:{horizontal:fr,vertical:dr},natural:{curve:pr},step:{curve:gr},"step-after":{curve:vr},"step-before":{curve:yr}};function pe(t,e,n){var i=Pt(bn,t)&&bn[t],r=null;return i&&(r=i.curve||i[e||"vertical"],i.tension&&n!=null&&(r=r[i.tension](n))),r}const xr={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},Tr=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,Mr=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,Cr=/^((\s+,?\s*)|(,\s*))/,Rr=/^[01]/;function dt(t){const e=[],n=t.match(Tr)||[];return n.forEach(i=>{let r=i[0];const o=r.toLowerCase(),s=xr[o],l=zr(o,s,i.slice(1).trim()),a=l.length;if(a1&&(p=Math.sqrt(p),n*=p,i*=p);const v=f/n,y=c/n,k=-c/i,T=f/i,_=v*l+y*a,R=k*l+T*a,z=v*t+y*e,x=k*t+T*e,A=(z-_)*(z-_)+(x-R)*(x-R);let ot=1/A-.25;ot<0&&(ot=0);let F=Math.sqrt(ot);o==r&&(F=-F);const ae=.5*(_+z)-F*(x-R),le=.5*(R+x)+F*(z-_),he=Math.atan2(R-le,_-ae),ji=Math.atan2(x-le,z-ae);let K=ji-he;K<0&&o===1?K+=D:K>0&&o===0&&(K-=D);const ue=Math.ceil(Math.abs(K/(Q+.001))),ln=[];for(let ft=0;ft+t}function mt(t,e,n){return Math.max(e,Math.min(t,n))}function zn(){var t=mr,e=Or,n=$r,i=Ir,r=H(0),o=r,s=r,l=r,a=null;function h(u,c,f){var d,g=c??+t.call(this,u),p=f??+e.call(this,u),v=+n.call(this,u),y=+i.call(this,u),k=Math.min(v,y)/2,T=mt(+r.call(this,u),0,k),_=mt(+o.call(this,u),0,k),R=mt(+s.call(this,u),0,k),z=mt(+l.call(this,u),0,k);if(a||(a=d=vn()),T<=0&&_<=0&&R<=0&&z<=0)a.rect(g,p,v,y);else{var x=g+v,A=p+y;a.moveTo(g+T,p),a.lineTo(x-_,p),a.bezierCurveTo(x-G*_,p,x,p+G*_,x,p+_),a.lineTo(x,A-z),a.bezierCurveTo(x,A-G*z,x-G*z,A,x-z,A),a.lineTo(g+R,A),a.bezierCurveTo(g+G*R,A,g,A-G*R,g,A-R),a.lineTo(g,p+T),a.bezierCurveTo(g,p+G*T,g+G*T,p,g+T,p),a.closePath()}if(d)return a=null,d+""||null}return h.x=function(u){return arguments.length?(t=H(u),h):t},h.y=function(u){return arguments.length?(e=H(u),h):e},h.width=function(u){return arguments.length?(n=H(u),h):n},h.height=function(u){return arguments.length?(i=H(u),h):i},h.cornerRadius=function(u,c,f,d){return arguments.length?(r=H(u),o=c!=null?H(c):r,l=f!=null?H(f):r,s=d!=null?H(d):o,h):r},h.context=function(u){return arguments.length?(a=u??null,h):a},h}function An(){var t,e,n,i,r=null,o,s,l,a;function h(c,f,d){const g=d/2;if(o){var p=l-f,v=c-s;if(p||v){var y=Math.hypot(p,v),k=(p/=y)*a,T=(v/=y)*a,_=Math.atan2(v,p);r.moveTo(s-k,l-T),r.lineTo(c-p*g,f-v*g),r.arc(c,f,g,_-Math.PI,_),r.lineTo(s+k,l+T),r.arc(s,l,a,_,_+Math.PI)}else r.arc(c,f,g,0,D);r.closePath()}else o=1;s=c,l=f,a=g}function u(c){var f,d=c.length,g,p=!1,v;for(r==null&&(r=v=vn()),f=0;f<=d;++f)!(ft.x||0,vt=t=>t.y||0,Dr=t=>t.width||0,Nr=t=>t.height||0,Hr=t=>(t.x||0)+(t.width||0),qr=t=>(t.y||0)+(t.height||0),Br=t=>t.startAngle||0,Gr=t=>t.endAngle||0,Vr=t=>t.padAngle||0,jr=t=>t.innerRadius||0,Wr=t=>t.outerRadius||0,Ur=t=>t.cornerRadius||0,Xr=t=>pt(t.cornerRadiusTopLeft,t.cornerRadius)||0,Yr=t=>pt(t.cornerRadiusTopRight,t.cornerRadius)||0,Jr=t=>pt(t.cornerRadiusBottomRight,t.cornerRadius)||0,Fr=t=>pt(t.cornerRadiusBottomLeft,t.cornerRadius)||0,Kr=t=>pt(t.size,64),Zr=t=>t.size||1,Ot=t=>!(t.defined===!1),Qr=t=>Rn(t.shape||"circle"),ts=Ki().startAngle(Br).endAngle(Gr).padAngle(Vr).innerRadius(jr).outerRadius(Wr).cornerRadius(Ur),es=gn().x(gt).y1(vt).y0(qr).defined(Ot),ns=gn().y(vt).x1(gt).x0(Hr).defined(Ot),is=Zi().x(gt).y(vt).defined(Ot),rs=zn().x(gt).y(vt).width(Dr).height(Nr).cornerRadius(Xr,Yr,Jr,Fr),ss=Qi().type(Qr).size(Kr),os=An().x(gt).y(vt).defined(Ot).size(Zr);function _e(t){return t.cornerRadius||t.cornerRadiusTopLeft||t.cornerRadiusTopRight||t.cornerRadiusBottomRight||t.cornerRadiusBottomLeft}function as(t,e){return ts.context(t)(e)}function ls(t,e){const n=e[0],i=n.interpolate||"linear";return(n.orient==="horizontal"?ns:es).curve(pe(i,n.orient,n.tension)).context(t)(e)}function hs(t,e){const n=e[0],i=n.interpolate||"linear";return is.curve(pe(i,n.orient,n.tension)).context(t)(e)}function lt(t,e,n,i){return rs.context(t)(e,n,i)}function us(t,e){return(e.mark.shape||e.shape).context(t)(e)}function cs(t,e){return ss.context(t)(e)}function fs(t,e){return os.context(t)(e)}var En=1;function Pn(){En=1}function ke(t,e,n){var i=e.clip,r=t._defs,o=e.clip_id||(e.clip_id="clip"+En++),s=r.clipping[o]||(r.clipping[o]={id:o});return ce(i)?s.path=i(null):_e(n)?s.path=lt(null,n,0,0):(s.width=n.width||0,s.height=n.height||0),"url(#"+o+")"}function E(t){this.clear(),t&&this.union(t)}E.prototype={clone(){return new E(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,i){return nthis.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 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])},rotatedPoints(t,e,n){var{x1:i,y1:r,x2:o,y2:s}=this,l=Math.cos(t),a=Math.sin(t),h=e-e*l+n*a,u=n-e*a-n*l;return[l*i-a*r+h,a*i+l*r+u,l*i-a*s+h,a*i+l*s+u,l*o-a*r+h,a*o+l*r+u,l*o-a*s+h,a*o+l*s+u]},union(t){return t.x1this.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=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.x2t.x2||this.y2t.y2)},contains(t,e){return!(tthis.x2||ethis.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}};function we(t){this.mark=t,this.bounds=this.bounds||new E}function be(t){we.call(this,t),this.items=this.items||[]}Xi(be,we);class Sn{constructor(e){this._pending=0,this._loader=e||yn()}pending(){return this._pending}sanitizeURL(e){const n=this;return Ln(n),n._loader.sanitize(e,{context:"href"}).then(i=>(yt(n),i)).catch(()=>(yt(n),null))}loadImage(e){const n=this,i=_r();return Ln(n),n._loader.sanitize(e,{context:"image"}).then(r=>{const o=r.href;if(!o||!i)throw{url:o};const s=new i,l=Pt(r,"crossOrigin")?r.crossOrigin:"anonymous";return l!=null&&(s.crossOrigin=l),s.onload=()=>yt(n),s.onerror=()=>yt(n),s.src=o,s}).catch(r=>(yt(n),{complete:!1,width:0,height:0,src:r&&r.url||""}))}ready(){const e=this;return new Promise(n=>{function i(r){e.pending()?setTimeout(()=>{i(!0)},10):n(r)}i(!1)})}}function Ln(t){t._pending+=1}function yt(t){t._pending-=1}function tt(t,e,n){if(e.stroke&&e.opacity!==0&&e.strokeOpacity!==0){const i=e.strokeWidth!=null?+e.strokeWidth:1;t.expand(i+(n?ds(e,i):0))}return t}function ds(t,e){return t.strokeJoin&&t.strokeJoin!=="miter"?0:e}const ps=D-1e-8;let $t,It,Dt,et,xe,Nt,Te,Me;const V=(t,e)=>$t.add(t,e),Ht=(t,e)=>V(It=t,Dt=e),mn=t=>V(t,$t.y1),On=t=>V($t.x1,t),nt=(t,e)=>xe*t+Te*e,it=(t,e)=>Nt*t+Me*e,Ce=(t,e)=>V(nt(t,e),it(t,e)),Re=(t,e)=>Ht(nt(t,e),it(t,e));function _t(t,e){return $t=t,e?(et=e*B,xe=Me=Math.cos(et),Nt=Math.sin(et),Te=-Nt):(xe=Me=1,et=Nt=Te=0),gs}const gs={beginPath(){},closePath(){},moveTo:Re,lineTo:Re,rect(t,e,n,i){et?(Ce(t+n,e),Ce(t+n,e+i),Ce(t,e+i),Re(t,e)):(V(t+n,e+i),Ht(t,e))},quadraticCurveTo(t,e,n,i){const r=nt(t,e),o=it(t,e),s=nt(n,i),l=it(n,i);$n(It,r,s,mn),$n(Dt,o,l,On),Ht(s,l)},bezierCurveTo(t,e,n,i,r,o){const s=nt(t,e),l=it(t,e),a=nt(n,i),h=it(n,i),u=nt(r,o),c=it(r,o);In(It,s,a,u,mn),In(Dt,l,h,c,On),Ht(u,c)},arc(t,e,n,i,r,o){if(i+=et,r+=et,It=n*Math.cos(r)+t,Dt=n*Math.sin(r)+e,Math.abs(r-i)>ps)V(t-n,e-n),V(t+n,e+n);else{const s=h=>V(n*Math.cos(h)+t,n*Math.sin(h)+e);let l,a;if(s(i),s(r),r!==i)if(i=i%D,i<0&&(i+=D),r=r%D,r<0&&(r+=D),rr;++a,l-=Q)s(l);else for(l=i-i%Q+Q,a=0;a<4&&lAr?(u=s*s+l*o,u>=0&&(u=Math.sqrt(u),a=(-s+u)/o,h=(-s-u)/o)):a=.5*l/s,0f)return!1;p>c&&(c=p)}else if(d>0){if(p0?(t.globalAlpha=n,t.fillStyle=Bn(t,e,e.fill),!0):!1}var ys=[];function ct(t,e,n){var i=(i=e.strokeWidth)!=null?i:1;return i<=0?!1:(n*=e.strokeOpacity==null?1:e.strokeOpacity,n>0?(t.globalAlpha=n,t.strokeStyle=Bn(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||ys),t.lineDashOffset=e.strokeDashOffset||0),!0):!1)}function _s(t,e){return t.zindex-e.zindex||t.index-e.index}function Pe(t){if(!t.zdirty)return t.zitems;var e=t.items,n=[],i,r,o;for(r=0,o=e.length;r=0;)if(i=e(n[r]))return i;if(n===o){for(n=t.items,r=n.length;--r>=0;)if(!n[r].zindex&&(i=e(n[r])))return i}return null}function Se(t){return function(e,n,i){m(n,r=>{(!i||i.intersects(r.bounds))&&Gn(t,e,r,r)})}}function ks(t){return function(e,n,i){n.items.length&&(!i||i.intersects(n.bounds))&&Gn(t,e,n.items[0],n.items)}}function Gn(t,e,n,i){var r=n.opacity==null?1:n.opacity;if(r===0)return;if(t(e,i))return;ut(e,n),n.fill&&qt(e,n,r)&&e.fill(),n.stroke&&ct(e,n,r)&&e.stroke()}function Gt(t){return t=t||fn,function(e,n,i,r,o,s){return i*=e.pixelRatio,r*=e.pixelRatio,Bt(n,l=>{const a=l.bounds;if(a&&!a.contains(o,s)||!a)return;if(t(e,l,i,r,o,s))return l})}}function kt(t,e){return function(n,i,r,o){var s=Array.isArray(i)?i[0]:i,l=e??s.fill,a=s.stroke&&n.isPointInStroke,h,u;return a&&(h=s.strokeWidth,u=s.strokeCap,n.lineWidth=h??1,n.lineCap=u??"butt"),t(n,i)?!1:l&&n.isPointInPath(r,o)||a&&n.isPointInStroke(r,o)}}function Le(t){return Gt(kt(t))}function rt(t,e){return"translate("+t+","+e+")"}function me(t){return"rotate("+t+")"}function ws(t,e){return"scale("+t+","+e+")"}function Vn(t){return rt(t.x||0,t.y||0)}function bs(t){return rt(t.x||0,t.y||0)+(t.angle?" "+me(t.angle):"")}function xs(t){return rt(t.x||0,t.y||0)+(t.angle?" "+me(t.angle):"")+(t.scaleX||t.scaleY?" "+ws(t.scaleX||1,t.scaleY||1):"")}function Oe(t,e,n){function i(s,l){s("transform",bs(l)),s("d",e(null,l))}function r(s,l){return e(_t(s,l.angle),l),tt(s,l).translate(l.x||0,l.y||0)}function o(s,l){var a=l.x||0,h=l.y||0,u=l.angle||0;s.translate(a,h),u&&s.rotate(u*=B),s.beginPath(),e(s,l),u&&s.rotate(-u),s.translate(-a,-h)}return{type:t,tag:"path",nested:!1,attr:i,bound:r,draw:Se(o),pick:Le(o),isect:n||Ae(o)}}var Ts=Oe("arc",as);function Ms(t,e){for(var n=t[0].orient==="horizontal"?e[1]:e[0],i=t[0].orient==="horizontal"?"y":"x",r=t.length,o=Infinity,s,l;--r>=0;){if(t[r].defined===!1)continue;l=Math.abs(t[r][i]-n),l=0;){if(t[i].defined===!1)continue;if(r=t[i].x-e[0],o=t[i].y-e[1],s=r*r+o*o,s=0;){if(t[n].defined===!1)continue;if(i=t[n].x-e[0],r=t[n].y-e[1],o=i*i+r*r,i=t[n].size||1,o.5&&e<1.5?.5-Math.abs(e-1):0}function Es(t,e){t("transform",Vn(e))}function Un(t,e){const n=Wn(e);t("d",lt(null,e,n,n))}function Ps(t,e){t("class","background"),t("aria-hidden",!0),Un(t,e)}function Ss(t,e){t("class","foreground"),t("aria-hidden",!0),e.strokeForeground?Un(t,e):t("d","")}function Ls(t,e,n){const i=e.clip?ke(n,e,e):null;t("clip-path",i)}function ms(t,e){if(!e.clip&&e.items){const n=e.items,i=n.length;for(let r=0;r{const o=r.x||0,s=r.y||0,l=r.strokeForeground,a=r.opacity==null?1:r.opacity;(r.stroke||r.fill)&&a&&(wt(t,r,o,s),ut(t,r),r.fill&&qt(t,r,a)&&t.fill(),r.stroke&&!l&&ct(t,r,a)&&t.stroke()),t.save(),t.translate(o,s),r.clip&&jn(t,r),n&&n.translate(-o,-s),m(r,h=>{(h.marktype==="group"||i==null||i.includes(h.marktype))&&this.draw(t,h,n,i)}),n&&n.translate(o,s),t.restore(),l&&r.stroke&&a&&(wt(t,r,o,s),ut(t,r),ct(t,r,a)&&t.stroke())})}function Ns(t,e,n,i,r,o){if(e.bounds&&!e.bounds.contains(r,o)||!e.items)return null;const s=n*t.pixelRatio,l=i*t.pixelRatio;return Bt(e,a=>{let h,u,c;const f=a.bounds;if(f&&!f.contains(r,o))return;u=a.x||0,c=a.y||0;const d=u+(a.width||0),g=c+(a.height||0),p=a.clip;if(p&&(rd||og))return;if(t.save(),t.translate(u,c),u=r-u,c=o-c,p&&_e(a)&&!Is(t,a,s,l))return t.restore(),null;const v=a.strokeForeground,y=e.interactive!==!1;return y&&v&&a.stroke&&$s(t,a,s,l)?(t.restore(),a):(h=Bt(a,k=>Hs(k,u,c)?this.pick(k,n,i,u,c):null),!h&&y&&(a.fill||!v&&a.stroke)&&Os(t,a,s,l)&&(h=a),t.restore(),h||null)})}function Hs(t,e,n){return(t.interactive!==!1||t.marktype==="group")&&t.bounds&&t.bounds.contains(e,n)}var qs={type:"group",tag:"g",nested:!1,attr:Es,bound:ms,draw:Ds,pick:Ns,isect:Nn,content:Ls,background:Ps,foreground:Ss},bt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function Ie(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(i=>{t.image=i,t.image.url=t.url})),n}function De(t,e){return t.width!=null?t.width:!e||!e.width?0:t.aspect!==!1&&t.height?t.height*e.width/e.height:e.width}function Ne(t,e){return t.height!=null?t.height:!e||!e.height?0:t.aspect!==!1&&t.width?t.width*e.height/e.width:e.height}function Vt(t,e){return t==="center"?e/2:t==="right"?e:0}function jt(t,e){return t==="middle"?e/2:t==="bottom"?e:0}function Bs(t,e,n){const i=Ie(e,n),r=De(e,i),o=Ne(e,i),s=(e.x||0)-Vt(e.align,r),l=(e.y||0)-jt(e.baseline,o),a=!i.src&&i.toDataURL?i.toDataURL():i.src||"";t("href",a,bt["xmlns:xlink"],"xlink:href"),t("transform",rt(s,l)),t("width",r),t("height",o),t("preserveAspectRatio",e.aspect===!1?"none":"xMidYMid")}function Gs(t,e){const n=e.image,i=De(e,n),r=Ne(e,n),o=(e.x||0)-Vt(e.align,i),s=(e.y||0)-jt(e.baseline,r);return t.set(o,s,o+i,s+r)}function Vs(t,e,n){m(e,i=>{if(n&&!n.intersects(i.bounds))return;const r=Ie(i,this);let o=De(i,r),s=Ne(i,r);if(o===0||s===0)return;let l=(i.x||0)-Vt(i.align,o),a=(i.y||0)-jt(i.baseline,s),h,u,c,f;i.aspect!==!1&&(u=r.width/r.height,c=i.width/i.height,u===u&&c===c&&u!==c&&(c{if(n&&!n.intersects(i.bounds))return;var r=i.opacity==null?1:i.opacity;r&&Yn(t,i,r)&&(ut(t,i),t.stroke())})}function eo(t,e,n,i){return t.isPointInStroke?Yn(t,e,1)&&t.isPointInStroke(n,i):!1}var no={type:"rule",tag:"line",nested:!1,attr:Zs,bound:Qs,draw:to,pick:Gt(eo),isect:Hn},io=Oe("shape",us),ro=Oe("symbol",cs,Ee);const Jn=Yi();var W={height:N,measureWidth:He,estimateWidth:Ut,width:Ut,canvas:Fn};Fn(!0);function Fn(t){W.width=t&&j?He:Ut}function Ut(t,e){return Kn(X(t,e),N(t))}function Kn(t,e){return~~(.8*t.length*e)}function He(t,e){return N(t)<=0||!(e=X(t,e))?0:Zn(e,Xt(t))}function Zn(t,e){const n=`(${e}) ${t}`;let i=Jn.get(n);return i===void 0&&(j.font=e,i=j.measureText(t).width,Jn.set(n,i)),i}function N(t){return t.fontSize!=null?+t.fontSize||0:11}function U(t){return t.lineHeight!=null?t.lineHeight:N(t)+2}function so(t){return Z(t)?t.length>1?t:t[0]:t}function xt(t){return so(t.lineBreak&&t.text&&!Z(t.text)?t.text.split(t.lineBreak):t.text)}function oo(t){const e=xt(t);return(Z(e)?e.length-1:0)*U(t)}function X(t,e){const n=e==null?"":(e+"").trim();return t.limit>0&&n.length?lo(t,n):n}function ao(t){if(W.width===He){const e=Xt(t);return n=>Zn(n,e)}else if(W.width===Ut){const e=N(t);return n=>Kn(n,e)}else return e=>W.width(t,e)}function lo(t,e){var n=+t.limit,i=ao(t);if(i(e)>>1,i(e.slice(a))>n?s=a+1:l=a;return r+e.slice(s)}else{for(;s>>1),i(e.slice(0,a))Math.max(f,W.width(e,d)),0)):c=W.width(e,u),r==="center"?a-=c/2:r==="right"&&(a-=c),t.set(a+=s,h+=l,a+c,h+i),e.angle&&!n)t.rotate(e.angle*B,s,l);else if(n===2)return t.rotatedPoints(e.angle*B,s,l);return t}function co(t,e,n){m(e,i=>{var r=i.opacity==null?1:i.opacity,o,s,l,a,h,u,c;if(n&&!n.intersects(i.bounds)||r===0||i.fontSize<=0||i.text==null||i.text.length===0)return;if(t.font=Xt(i),t.textAlign=i.align||"left",o=Yt(i),s=o.x1,l=o.y1,i.angle&&(t.save(),t.translate(s,l),t.rotate(i.angle*B),s=l=0),s+=i.dx||0,l+=(i.dy||0)+qe(i),u=xt(i),ut(t,i),Z(u))for(h=U(i),a=0;ae;)t.removeChild(n[--i]);return t}function si(t){return"mark-"+t.marktype+(t.role?" role-"+t.role:"")+(t.name?" "+t.name:"")}function je(t,e){const n=e.getBoundingClientRect();return[t.clientX-n.left-(e.clientLeft||0),t.clientY-n.top-(e.clientTop||0)]}function ko(t,e,n,i){var r=t&&t.mark,o,s;if(r&&(o=O[r.marktype]).tip){for(s=je(e,n),s[0]-=i[0],s[1]-=i[1];t=t.mark.group;)s[0]-=t.x||0,s[1]-=t.y||0;t=o.tip(r.items,s)}return t}class We{constructor(e,n){this._active=null,this._handlers={},this._loader=e||yn(),this._tooltip=n||wo}initialize(e,n,i){return this._el=e,this._obj=i||null,this.origin(n)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}origin(e){return arguments.length?(this._origin=e||[0,0],this):this._origin.slice()}scene(e){return arguments.length?(this._scene=e,this):this._scene}on(){}off(){}_handlerIndex(e,n,i){for(let r=e?e.length:0;--r>=0;)if(e[r].type===n&&(!i||e[r].handler===i))return r;return-1}handlers(e){const n=this._handlers,i=[];if(e)i.push(...n[this.eventName(e)]);else for(const r in n)i.push(...n[r]);return i}eventName(e){const n=e.indexOf(".");return n<0?e:e.slice(0,n)}handleHref(e,n,i){this._loader.sanitize(i,{context:"href"}).then(r=>{const o=new MouseEvent(e.type,e),s=Y(null,"a");for(const l in r)s.setAttribute(l,r[l]);s.dispatchEvent(o)}).catch(()=>{})}handleTooltip(e,n,i){if(n&&n.tooltip!=null){n=ko(n,e,this.canvas(),this._origin);const r=i&&n&&n.tooltip||null;this._tooltip.call(this._obj,this,e,n,r)}}getItemBoundingClientRect(e){const n=this.canvas();if(!n)return;const i=n.getBoundingClientRect(),r=this._origin,o=e.bounds,s=o.width(),l=o.height();let a=o.x1+r[0]+i.left,h=o.y1+r[1]+i.top;for(;e.mark&&(e=e.mark.group);)a+=e.x||0,h+=e.y||0;return{x:a,y:h,width:s,height:l,left:a,top:h,right:a+s,bottom:h+l}}}function wo(t,e,n,i){t.element().setAttribute("title",i||"")}class Ct{constructor(e){this._el=null,this._bgcolor=null,this._loader=new Sn(e)}initialize(e,n,i,r,o){return this._el=e,this.resize(n,i,r,o)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}background(e){return arguments.length===0?this._bgcolor:(this._bgcolor=e,this)}resize(e,n,i,r){return this._width=e,this._height=n,this._origin=i||[0,0],this._scale=r||1,this}dirty(){}render(e,n){const i=this;return i._call=function(){i._render(e,n)},i._call(),i._call=null,i}_render(){}renderAsync(e,n){const i=this.render(e,n);return this._ready?this._ready.then(()=>i):Promise.resolve(i)}_load(e,n){var i=this,r=i._loader[e](n);if(!i._ready){const o=i._call;i._ready=i._loader.ready().then(s=>{s&&o(),i._ready=null})}return r}sanitizeURL(e){return this._load("sanitizeURL",e)}loadImage(e){return this._load("loadImage",e)}}const bo="keydown",xo="keypress",To="keyup",oi="dragenter",Jt="dragleave",ai="dragover",Ue="pointerdown",Mo="pointerup",Ft="pointermove",Kt="pointerout",li="pointerover",Xe="mousedown",Co="mouseup",hi="mousemove",Zt="mouseout",ui="mouseover",Qt="click",Ro="dblclick",zo="wheel",ci="mousewheel",te="touchstart",ee="touchmove",ne="touchend",Ao=[bo,xo,To,oi,Jt,ai,Ue,Mo,Ft,Kt,li,Xe,Co,hi,Zt,ui,Qt,Ro,zo,ci,te,ee,ne],Ye=Ft,Rt=Zt,Je=Qt;class Fe extends We{constructor(e,n){super(e,n);this._down=null,this._touch=null,this._first=!0,this._events={},this.events=Ao,this.pointermove=di([Ft,hi],[li,ui],[Kt,Zt]),this.dragover=di([ai],[oi],[Jt]),this.pointerout=pi([Kt,Zt]),this.dragleave=pi([Jt])}initialize(e,n,i){return this._canvas=e&&Ve(e,"canvas"),[Qt,Xe,Ue,Ft,Kt,Jt].forEach(r=>fi(this,r)),super.initialize(e,n,i)}canvas(){return this._canvas}context(){return this._canvas.getContext("2d")}DOMMouseScroll(e){this.fire(ci,e)}pointerdown(e){this._down=this._active,this.fire(Ue,e)}mousedown(e){this._down=this._active,this.fire(Xe,e)}click(e){this._down===this._active&&(this.fire(Qt,e),this._down=null)}touchstart(e){this._touch=this.pickEvent(e.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(te,e,!0)}touchmove(e){this.fire(ee,e,!0)}touchend(e){this.fire(ne,e,!0),this._touch=null}fire(e,n,i){const r=i?this._touch:this._active,o=this._handlers[e];if(n.vegaType=e,e===Je&&r&&r.href?this.handleHref(n,r,r.href):(e===Ye||e===Rt)&&this.handleTooltip(n,r,e!==Rt),o)for(let s=0,l=o.length;s=0&&r.splice(o,1),this}pickEvent(e){const n=je(e,this._canvas),i=this._origin;return this.pick(this._scene,n[0],n[1],n[0]-i[0],n[1]-i[1])}pick(e,n,i,r,o){const s=this.context(),l=O[e.marktype];return l.pick.call(this,s,e,n,i,r,o)}}const Eo=t=>t===te||t===ee||t===ne?[te,ee,ne]:[t];function fi(t,e){Eo(e).forEach(n=>Po(t,n))}function Po(t,e){const n=t.canvas();n&&!t._events[e]&&(t._events[e]=1,n.addEventListener(e,t[e]?i=>t[e](i):i=>t.fire(e,i)))}function zt(t,e,n){e.forEach(i=>t.fire(i,n))}function di(t,e,n){return function(i){const r=this._active,o=this.pickEvent(i);o===r?zt(this,t,i):((!r||!r.exit)&&zt(this,n,i),this._active=o,zt(this,e,i),zt(this,t,i))}}function pi(t){return function(e){zt(this,t,e),this._active=null}}function So(){return typeof window!="undefined"&&window.devicePixelRatio||1}function Lo(t,e,n,i,r,o){const s=typeof HTMLElement!="undefined"&&t instanceof HTMLElement&&t.parentNode!=null,l=t.getContext("2d"),a=s?So():r;t.width=e*a,t.height=n*a;for(const h in o)l[h]=o[h];return s&&a!==1&&(t.style.width=e+"px",t.style.height=n+"px"),l.pixelRatio=a,l.setTransform(a,0,0,a,a*i[0],a*i[1]),t}class ie extends Ct{constructor(e){super(e);this._options={},this._redraw=!1,this._dirty=new E,this._tempb=new E}initialize(e,n,i,r,o,s){return this._options=s||{},this._canvas=this._options.externalContext?null:fe(1,1,this._options.type),e&&this._canvas&&(S(e,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),super.initialize(e,n,i,r,o)}resize(e,n,i,r){if(super.resize(e,n,i,r),this._canvas)Lo(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const o=this._options.externalContext;o||hn("CanvasRenderer is missing a valid canvas or context"),o.scale(this._scale,this._scale),o.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(e){const n=this._tempb.clear().union(e.bounds);let i=e.mark.group;for(;i;)n.translate(i.x||0,i.y||0),i=i.mark.group;this._dirty.union(n)}_render(e,n){const i=this.context(),r=this._origin,o=this._width,s=this._height,l=this._dirty,a=mo(r,o,s);i.save();const h=this._redraw||l.empty()?(this._redraw=!1,a.expand(1)):Oo(i,a.intersect(l),r);return this.clear(-r[0],-r[1],o,s),this.draw(i,e,h,n),i.restore(),l.clear(),this}draw(e,n,i,r){if(n.marktype!=="group"&&r!=null&&!r.includes(n.marktype))return;const o=O[n.marktype];n.clip&&As(e,n),o.draw.call(this,e,n,i,r),n.clip&&e.restore()}clear(e,n,i,r){const o=this._options,s=this.context();o.type!=="pdf"&&!o.externalContext&&s.clearRect(e,n,i,r),this._bgcolor!=null&&(s.fillStyle=this._bgcolor,s.fillRect(e,n,i,r))}}const mo=(t,e,n)=>new E().set(0,0,e,n).translate(-t[0],-t[1]);function Oo(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}class gi extends We{constructor(e,n){super(e,n);const i=this;i._hrefHandler=Ke(i,(r,o)=>{o&&o.href&&i.handleHref(r,o,o.href)}),i._tooltipHandler=Ke(i,(r,o)=>{i.handleTooltip(r,o,r.type!==Rt)})}initialize(e,n,i){let r=this._svg;return r&&(r.removeEventListener(Je,this._hrefHandler),r.removeEventListener(Ye,this._tooltipHandler),r.removeEventListener(Rt,this._tooltipHandler)),this._svg=r=e&&Ve(e,"svg"),r&&(r.addEventListener(Je,this._hrefHandler),r.addEventListener(Ye,this._tooltipHandler),r.addEventListener(Rt,this._tooltipHandler)),super.initialize(e,n,i)}canvas(){return this._svg}on(e,n){const i=this.eventName(e),r=this._handlers,o=this._handlerIndex(r[i],e,n);if(o<0){const s={type:e,handler:n,listener:Ke(this,n)};(r[i]||(r[i]=[])).push(s),this._svg&&this._svg.addEventListener(i,s.listener)}return this}off(e,n){const i=this.eventName(e),r=this._handlers[i],o=this._handlerIndex(r,e,n);return o>=0&&(this._svg&&this._svg.removeEventListener(i,r[o].listener),r.splice(o,1)),this}}const Ke=(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)},vi="aria-hidden",Ze="aria-label",Qe="role",tn="aria-roledescription",yi="graphics-object",en="graphics-symbol",_i=(t,e,n)=>({[Qe]:t,[tn]:e,[Ze]:n||void 0}),$o=Ji(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),ki={axis:{desc:"axis",caption:No},legend:{desc:"legend",caption:Ho},"title-text":{desc:"title",caption:t=>`Title text '${Ti(t)}'`},"title-subtitle":{desc:"subtitle",caption:t=>`Subtitle text '${Ti(t)}'`}},wi={ariaRole:Qe,ariaRoleDescription:tn,description:Ze};function bi(t,e){const n=e.aria===!1;if(t(vi,n||void 0),n||e.description==null)for(const i in wi)t(wi[i],void 0);else{const i=e.mark.marktype;t(Ze,e.description),t(Qe,e.ariaRole||(i==="group"?yi:en)),t(tn,e.ariaRoleDescription||`${i} mark`)}}function xi(t){return t.aria===!1?{[vi]:!0}:$o[t.role]?null:ki[t.role]?Do(t,ki[t.role]):Io(t)}function Io(t){const e=t.marktype,n=e==="group"||e==="text"||t.items.some(i=>i.description!=null&&i.aria!==!1);return _i(n?yi:en,`${e} mark container`,t.description)}function Do(t,e){try{const n=t.items[0],i=e.caption||(()=>"");return _i(e.role||en,e.desc,n.description||i(n))}catch(n){return null}}function Ti(t){return dn(t.text).join(" ")}function No(t){const e=t.datum,n=t.orient,i=e.title?Mi(t):null,r=t.context,o=r.scales[e.scale].value,s=r.dataflow.locale(),l=o.type,a=n==="left"||n==="right"?"Y":"X";return`${a}-axis`+(i?` titled '${i}'`:"")+` for a ${kr(l)?"discrete":l} scale with ${_n(s,o,t)}`}function Ho(t){const e=t.datum,n=e.title?Mi(t):null,i=`${e.type||""} legend`.trim(),r=e.scales,o=Object.keys(r),s=t.context,l=s.scales[r[o[0]]].value,a=s.dataflow.locale();return Bo(i)+(n?` titled '${n}'`:"")+` for ${qo(o)} with ${_n(a,l,t)}`}function Mi(t){try{return dn(pn(t.items).items[0].text).join(" ")}catch(e){return null}}function qo(t){return t=t.map(e=>e+(e==="fill"||e==="stroke"?" color":"")),t.length<2?t[0]:t.slice(0,-1).join(", ")+" and "+pn(t)}function Bo(t){return t.length?t[0].toUpperCase()+t.slice(1):t}const Ci=t=>(t+"").replace(/&/g,"&").replace(//g,">"),Go=t=>Ci(t).replace(/"/g,""").replace(/\t/g," ").replace(/\n/g," ").replace(/\r/g," ");function nn(){let t="",e="",n="";const i=[],r=()=>e=n="",o=a=>{e&&(t+=`${e}>${n}`,r()),i.push(a)},s=(a,h)=>(h!=null&&(e+=` ${a}="${Go(h)}"`),l),l={open(a){o(a),e="<"+a;for(var h=arguments.length,u=new Array(h>1?h-1:0),c=1;c${n}`:"/>"):t+=``,r(),l},attr:s,text:a=>(n+=Ci(a),l),toString:()=>t};return l}const Ri=t=>zi(nn(),t)+"";function zi(t,e){if(t.open(e.tagName),e.hasAttributes()){const n=e.attributes,i=n.length;for(let r=0;r{u.dirty=n})),r.zdirty)continue;if(i.exit){s.nested&&r.items.length?(h=r.items[0],h._svg&&this._update(s,h._svg,h)):i._svg&&(h=i._svg.parentNode,h&&h.removeChild(i._svg)),i._svg=null;continue}if(i=s.nested?r.items[0]:i,i._update===n)continue;!i._svg||!i._svg.ownerSVGElement?(this._dirtyAll=!1,Pi(i,n)):this._update(s,i._svg,i),i._update=n}return!this._dirtyAll}mark(e,n,i,r){if(!this.isDirty(n))return n._svg;const o=this._svg,s=n.marktype,l=O[s],a=n.interactive===!1?"none":null,h=l.tag==="g",u=Si(n,e,i,"g",o);if(s!=="group"&&r!=null&&!r.includes(s))return S(u,0),n._svg;u.setAttribute("class",si(n));const c=xi(n);for(const p in c)C(u,p,c[p]);h||C(u,"pointer-events",a),C(u,"clip-path",n.clip?ke(this,n,n.group):null);let f=null,d=0;const g=p=>{const v=this.isDirty(p),y=Si(p,u,f,l.tag,o);v&&(this._update(l,y,p),h&&Wo(this,y,p,r)),f=y,++d};return l.nested?n.items.length&&g(n.items[0]):m(n,g),S(u,d),u}_update(e,n,i){q=n,M=n.__values__,bi(Et,i),e.attr(Et,i,this);const r=Xo[e.type];r&&r.call(this,e,n,i),q&&this.style(q,i)}style(e,n){if(n==null)return;for(const i in re){let r=i==="font"?Tt(n):n[i];if(r===M[i])continue;const o=re[i];r==null?e.removeAttribute(o):(de(r)&&(r=wn(r,this._defs.gradient,Li())),e.setAttribute(o,r+"")),M[i]=r}for(const i in se)oe(e,se[i],n[i])}defs(){const e=this._svg,n=this._defs;let i=n.el,r=0;for(const o in n.gradient)i||(n.el=i=w(e,At+1,"defs",b)),r=Vo(i,n.gradient[o],r);for(const o in n.clipping)i||(n.el=i=w(e,At+1,"defs",b)),r=jo(i,n.clipping[o],r);i&&(r===0?(e.removeChild(i),n.el=null):S(i,r))}_clearDefs(){const e=this._defs;e.gradient={},e.clipping={}}}function Pi(t,e){for(;t&&t.dirty!==e;t=t.mark.group)if(t.dirty=e,t.mark&&t.mark.dirty!==e)t.mark.dirty=e;else return}function Vo(t,e,n){let i,r,o;if(e.gradient==="radial"){let s=w(t,n++,"pattern",b);J(s,{id:St+e.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),s=w(s,0,"rect",b),J(s,{width:1,height:1,fill:`url(${Li()}#${e.id})`}),t=w(t,n++,"radialGradient",b),J(t,{id:e.id,fx:e.x1,fy:e.y1,fr:e.r1,cx:e.x2,cy:e.y2,r:e.r2})}else t=w(t,n++,"linearGradient",b),J(t,{id:e.id,x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2});for(i=0,r=e.stops.length;i{r=t.mark(e,s,r,i),++o}),S(e,1+o)}function Si(t,e,n,i,r){let o=t._svg,s;if(!o&&(s=e.ownerDocument,o=Y(s,i,b),t._svg=o,t.mark&&(o.__data__=t,o.__values__={fill:"default"},i==="g"))){const l=Y(s,"path",b);o.appendChild(l),l.__data__=t;const a=Y(s,"g",b);o.appendChild(a),a.__data__=t;const h=Y(s,"path",b);o.appendChild(h),h.__data__=t,h.__values__={fill:"default"}}return(o.ownerSVGElement!==r||Uo(o,n))&&e.insertBefore(o,n?n.nextSibling:e.firstChild),o}function Uo(t,e){return t.parentNode&&t.parentNode.childNodes.length>1&&t.previousSibling!=e}let q=null,M=null;const Xo={group(t,e,n){const i=q=e.childNodes[2];M=i.__values__,t.foreground(Et,n,this),M=e.__values__,q=e.childNodes[1],t.content(Et,n,this);const r=q=e.childNodes[0];t.background(Et,n,this);const o=n.mark.interactive===!1?"none":null;if(o!==M.events&&(C(i,"pointer-events",o),C(r,"pointer-events",o),M.events=o),n.strokeForeground&&n.stroke){const s=n.fill;C(i,"display",null),this.style(r,n),C(r,"stroke",null),s&&(n.fill=null),M=i.__values__,this.style(i,n),s&&(n.fill=s),q=null}else C(i,"display","none")},image(t,e,n){n.smooth===!1?(oe(e,"image-rendering","optimizeSpeed"),oe(e,"image-rendering","pixelated")):oe(e,"image-rendering",null)},text(t,e,n){const i=xt(n);let r,o,s,l;Z(i)?(o=i.map(a=>X(n,a)),r=o.join(` `),r!==M.text&&(S(e,0),s=e.ownerDocument,l=U(n),o.forEach((a,h)=>{const u=Y(s,"tspan",b);u.__data__=n,u.textContent=a,h&&(u.setAttribute("x",0),u.setAttribute("dy",l)),e.appendChild(u)}),M.text=r)):(o=X(n,i),o!==M.text&&(e.textContent=o,M.text=o)),C(e,"font-family",Tt(n)),C(e,"font-size",N(n)+"px"),C(e,"font-style",n.fontStyle),C(e,"font-variant",n.fontVariant),C(e,"font-weight",n.fontWeight)}};function Et(t,e,n){if(e===M[t])return;n?Yo(q,t,e,n):C(q,t,e),M[t]=e}function oe(t,e,n){n!==M[e]&&(n==null?t.style.removeProperty(e):t.style.setProperty(e,n+""),M[e]=n)}function J(t,e){for(const n in e)C(t,n,e[n])}function C(t,e,n){n!=null?t.setAttribute(e,n):t.removeAttribute(e)}function Yo(t,e,n,i){n!=null?t.setAttributeNS(i,e,n):t.removeAttributeNS(i,e)}function Li(){let t;return typeof window=="undefined"?"":(t=window.location).hash?t.href.slice(0,-t.hash.length):t.href}class mi extends Ct{constructor(e){super(e);this._text=null,this._defs={gradient:{},clipping:{}}}svg(){return this._text}_render(e){const n=nn();n.open("svg",Fi({},bt,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const i=this._bgcolor;return i&&i!=="transparent"&&i!=="none"&&n.open("rect",{width:this._width,height:this._height,fill:i}).close(),n.open("g",Ai,{transform:"translate("+this._origin+")"}),this.mark(n,e),n.close(),this.defs(n),this._text=n.close()+"",this}mark(e,n){const i=O[n.marktype],r=i.tag,o=[bi,i.attr];e.open("g",{class:si(n),"clip-path":n.clip?ke(this,n,n.group):null},xi(n),{"pointer-events":r!=="g"&&n.interactive===!1?"none":null});const s=l=>{const a=this.href(l);if(a&&e.open("a",a),e.open(r,this.attr(n,l,o,r!=="g"?r:null)),r==="text"){const h=xt(l);if(Z(h)){const u={x:0,dy:U(l)};for(let c=0;cthis.mark(e,f)),e.close(),h&&c?(u&&(l.fill=null),l.stroke=c,e.open("path",this.attr(n,l,i.foreground,"bgrect")).close(),u&&(l.fill=u)):e.open("path",this.attr(n,l,i.foreground,"bgfore")).close()}e.close(),a&&e.close()};return i.nested?n.items&&n.items.length&&s(n.items[0]):m(n,s),e.close()}href(e){const n=e.href;let i;if(n){if(i=this._hrefs&&this._hrefs[n])return i;this.sanitizeURL(n).then(r=>{r["xlink:href"]=r.href,r.href=null,(this._hrefs||(this._hrefs={}))[n]=r})}return null}attr(e,n,i,r){const o={},s=(l,a,h,u)=>{o[u||l]=a};return Array.isArray(i)?i.forEach(l=>l(s,n,this)):i(s,n,this),r&&Jo(o,n,e,r,this._defs),o}defs(e){const n=this._defs.gradient,i=this._defs.clipping,r=Object.keys(n).length+Object.keys(i).length;if(r===0)return;e.open("defs");for(const o in n){const s=n[o],l=s.stops;s.gradient==="radial"?(e.open("pattern",{id:St+o,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),e.open("rect",{width:"1",height:"1",fill:"url(#"+o+")"}).close(),e.close(),e.open("radialGradient",{id:o,fx:s.x1,fy:s.y1,fr:s.r1,cx:s.x2,cy:s.y2,r:s.r2})):e.open("linearGradient",{id:o,x1:s.x1,x2:s.x2,y1:s.y1,y2:s.y2});for(let a=0;a!$.svgMarkTypes.includes(o));this._svgRenderer.render(e,$.svgMarkTypes),this._canvasRenderer.render(e,r)}resize(e,n,i,r){return super.resize(e,n,i,r),this._svgRenderer.resize(e,n,i,r),this._canvasRenderer.resize(e,n,i,r),this}background(e){return $.svgOnTop?this._canvasRenderer.background(e):this._svgRenderer.background(e),this}}class Oi extends Fe{constructor(e,n){super(e,n)}initialize(e,n,i){const r=w(w(e,0,"div"),$.svgOnTop?0:1,"div");return super.initialize(r,n,i)}}const $i="canvas",Ii="hybrid",Di="png",Ni="svg",Hi="none",Ko={Canvas:$i,PNG:Di,SVG:Ni,Hybrid:Ii,None:Hi},st={};st[$i]=st[Di]={renderer:ie,headless:ie,handler:Fe},st[Ni]={renderer:rn,headless:mi,handler:gi},st[Ii]={renderer:sn,headless:sn,handler:Oi},st[Hi]={};function Zo(t,e){return t=String(t||"").toLowerCase(),arguments.length>1?(st[t]=e,this):st[t]}function Qo(t,e,n){const i=[],r=new E().union(e),o=t.marktype;return o?qi(t,r,n,i):o==="group"?Bi(t,r,n,i):hn("Intersect scene must be mark node or group item.")}function qi(t,e,n,i){if(ta(t,e,n)){const r=t.items,o=t.marktype,s=r.length;let l=0;if(o==="group")for(;l=0;o--)if(n[o]!=i[o])return!1;for(o=n.length-1;o>=0;o--)if(r=n[o],!an(t[r],e[r],r))return!1;return typeof t===typeof e}function ra(){Pn(),wr()}export{E as Bounds,Fe as CanvasHandler,ie as CanvasRenderer,br as Gradient,be as GroupItem,We as Handler,Oi as HybridHandler,sn as HybridRenderer,we as Item,O as Marks,Ko as RenderType,Ct as Renderer,Sn as ResourceLoader,gi as SVGHandler,rn as SVGRenderer,mi as SVGStringRenderer,_o as Scenegraph,ea as boundClip,_t as boundContext,Ge as boundItem,ti as boundMark,tt as boundStroke,w as domChild,S as domClear,Y as domCreate,Ve as domFind,Xt as font,Tt as fontFamily,N as fontSize,Qo as intersect,ht as intersectBoxLine,Ae as intersectPath,Ee as intersectPoint,Hn as intersectRule,U as lineHeight,nn as markup,oo as multiLineOffset,pe as pathCurves,Vi as pathEqual,dt as pathParse,zn as pathRectangle,Lt as pathRender,Rn as pathSymbols,An as pathTrail,je as point,Zo as renderModule,Pn as resetSVGClipId,ra as resetSVGDefIds,an as sceneEqual,ni as sceneFromJSON,Bt as scenePickVisit,ei as sceneToJSON,m as sceneVisit,Pe as sceneZOrder,Ri as serializeXML,Fo as setHybridRendererOptions,W as textMetrics};export default null;