!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@antv/g"),require("@antv/g-canvas")):"function"==typeof define&&define.amd?define(["exports","@antv/g","@antv/g-canvas"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).G2={},t.window.G,t.window.G.Canvas2D)}(this,function(m,nt,_){"use strict";const E="main-layer",st="label-layer",lt="element",U="view",ct="plot",ut="component",ft="label",ht="area";var N="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function P(t,e,n,r,i){!function t(e,n,r,i,a){for(;r=t.minX&&e.maxY>=t.minY}function Y(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function K(t,e,n,r,i){for(var a,o=[e,n];o.length;)(n=o.pop())-(e=o.pop())<=r||(P(t,a=e+Math.ceil((n-e)/r/2)*r,e,n,i),o.push(e,a,a,n))}(e=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}).prototype.all=function(){return this._all(this.data,[])},e.prototype.search=function(t){var e=this.data,n=[];if(V(t,e))for(var r=this.toBBox,i=[];e;){for(var a=0;athis._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(n,r,e)},e.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries,i=(this._chooseSplitAxis(n,i,r),this._chooseSplitIndex(n,i,r)),r=Y(n.children.splice(i,n.children.length-i));r.height=n.height,r.leaf=n.leaf,B(n,this.toBBox),B(r,this.toBBox),e?t[e-1].children.push(r):this._splitRoot(n,r)},e.prototype._splitRoot=function(t,e){this.data=Y([t,e]),this.data.height=t.height+1,this.data.leaf=!1,B(this.data,this.toBBox)},e.prototype._chooseSplitIndex=function(t,e,n){for(var r,i,a,o,s=1/0,l=1/0,c=e;c<=n-e;c++){var u=F(t,0,c,this.toBBox),f=F(t,c,n,this.toBBox),h=(i=u,h=f,d=o=a=void 0,a=Math.max(i.minX,h.minX),o=Math.max(i.minY,h.minY),d=Math.min(i.maxX,h.maxX),i=Math.min(i.maxY,h.maxY),Math.max(0,d-a)*Math.max(0,i-o)),d=G(u)+G(f);h=t.length?void 0:t)&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function O(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||0=pe[n]&&("m"===n&&2=t.max)break;if(!(48<=(e=s.charCodeAt(t.index))&&e<=57||43===e||45===e||46===e))break}ve(t)}else t.err='[path-util]: Invalid path value "'+s[l]+'" is not a path command'}var Me=function(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""};function Oe(t){var o,s,l,c;return me(t)?se(t):(t=function(t){if(ge(t))return se(t);var e=new Me(t);for(xe(e);e.index>0)/Math.pow(10,9)),w=Math.asin(((c-b)/i*Math.pow(10,9)>>0)/Math.pow(10,9)),x=ef&&(y=w,m=l,o=c,w=x+f*(s&&xv[2]&&(k=(y-l)/(y-v[2]),x={x:b[0]*(1-k)+v[0]*k,y:b[1]*(1-k)+v[1]*k}),v=[g,m,y];return{length:y,point:x=p&&y<=l?{x:o,y:s}:x,min:{x:Math.min.apply(null,w.map(function(t){return t.x})),y:Math.min.apply(null,w.map(function(t){return t.y}))},max:{x:Math.max.apply(null,w.map(function(t){return t.x})),y:Math.max.apply(null,w.map(function(t){return t.y}))}}}function Pe(t){return(c=l=s=0)<=je(t).map(function(t){var e,n,r,i,a,o;return"M"===t[0]?(s=t[1],l=t[2],0):(o=t.slice(1),e=o[0],n=o[1],r=o[2],i=o[3],a=o[4],o=o[5],c=3*((o-l)*(e+r)-(a-s)*(n+i)+n*(s-r)-e*(l-i)+o*(r+s/3)-a*(i+l/3))/20,n=t.slice(-2),s=n[0],l=n[1],c)}).reduce(function(t,e){return t+e},0);var s,l,c}function Ce(t){return t.map(function(t,e,n){var r,i,a,o,n=e&&n[e-1].slice(-2).concat(t.slice(1)),s=e?Ne(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],{bbox:!1}).length:0,n=e?s?(void 0===r&&(r=.5),n=(e=n).slice(0,2),i=e.slice(2,4),a=e.slice(4,6),e=e.slice(6,8),n=Ee(n,i,r),i=Ee(i,a,r),a=Ee(a,e,r),o=Ee(n,i,r),i=Ee(i,a,r),r=Ee(o,i,r),[["C"].concat(n,o,r),["C"].concat(i,a,e)]):[t,t]:[t];return{s:t,ss:n,l:s}})}var Re=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},Ie=function(t){return"function"==typeof t},p=function(t){return null==t},Be={}.toString,Fe=function(t,e){return Be.call(t)==="[object "+e+"]"},De=function(t){return Array.isArray?Array.isArray(t):Fe(t,"Array")},ze=function(t){var e=typeof t;return null!==t&&"object"==e||"function"==e},We=function(t){return"object"==typeof t&&null!==t},Ge=function(t){if(!We(t)||!Fe(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e},qe=function(t){if(De(t))return t.reduce(function(t,e){return Math.max(t,e)},t[0])},He=function(t){if(De(t))return t.reduce(function(t,e){return Math.min(t,e)},t[0])},Ve=function(t){return Fe(t,"String")};var Ye=function(t,e,n){return t>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?En(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?En(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=gn.exec(t))?new Sn(e[1],e[2],e[3],1):(e=mn.exec(t))?new Sn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=yn.exec(t))?En(e[1],e[2],e[3],e[4]):(e=vn.exec(t))?En(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=bn.exec(t))?jn(e[1],e[2]/100,e[3]/100,1):(e=xn.exec(t))?jn(e[1],e[2]/100,e[3]/100,e[4]):wn.hasOwnProperty(t)?_n(wn[t]):"transparent"===t?new Sn(NaN,NaN,NaN,0):null}function _n(t){return new Sn(t>>16&255,t>>8&255,255&t,1)}function En(t,e,n,r){return new Sn(t=r<=0?e=n=NaN:t,e,n,r)}function Sn(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function An(){return"#"+Tn(this.r)+Tn(this.g)+Tn(this.b)}function Ln(){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 Tn(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function jn(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||1<=n?t=e=NaN:e<=0&&(t=NaN),new Pn(t,e,n,r)}function Nn(t){var e,n,r,i,a,o,s,l;return t instanceof Pn?new Pn(t.h,t.s,t.l,t.opacity):(t=t instanceof dn?t:kn(t))?t instanceof Pn?t:(e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=NaN,l=((a=Math.max(e,n,r))+i)/2,(s=a-i)?(o=e===a?(n-r)/s+6*(nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[n++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(n=o=o||{}).COORDINATE="",n.COLOR="",n.PAINT="",n.NUMBER="",n.ANGLE="",n.OPACITY_VALUE="",n.SHADOW_BLUR="",n.LENGTH="",n.PERCENTAGE="",n.LENGTH_PERCENTAGE=" | ",n.LENGTH_PERCENTAGE_12="[ | ]{1,2}",n.LENGTH_PERCENTAGE_14="[ | ]{1,4}",n.LIST_OF_POINTS="",n.PATH="",n.FILTER="",n.Z_INDEX="",n.OFFSET_DISTANCE="",n.DEFINED_PATH="",n.MARKER="",n.TRANSFORM="",n.TRANSFORM_ORIGIN="",n.TEXT="",n.TEXT_TRANSFORM="",(r=s=s||{})[r.kUnknown=0]="kUnknown",r[r.kNumber=1]="kNumber",r[r.kPercentage=2]="kPercentage",r[r.kEms=3]="kEms",r[r.kPixels=4]="kPixels",r[r.kRems=5]="kRems",r[r.kDegrees=6]="kDegrees",r[r.kRadians=7]="kRadians",r[r.kGradians=8]="kGradians",r[r.kTurns=9]="kTurns",r[r.kMilliseconds=10]="kMilliseconds",r[r.kSeconds=11]="kSeconds",r[r.kInteger=12]="kInteger",(e=gr=gr||{})[e.kUNumber=0]="kUNumber",e[e.kUPercent=1]="kUPercent",e[e.kULength=2]="kULength",e[e.kUAngle=3]="kUAngle",e[e.kUTime=4]="kUTime",e[e.kUOther=5]="kUOther",(n=mr=mr||{})[n.kYes=0]="kYes",n[n.kNo=1]="kNo",(r=yr=yr||{})[r.kYes=0]="kYes",r[r.kNo=1]="kNo";function Er(t){var e=1;switch(t){case s.kPixels:case s.kDegrees:case s.kSeconds:break;case s.kMilliseconds:e=.001;break;case s.kRadians:e=180/Math.PI;break;case s.kGradians:e=.9;break;case s.kTurns:e=360}return e}function Sr(t){switch(t){case s.kNumber:case s.kInteger:return"";case s.kPercentage:return"%";case s.kEms:return"em";case s.kRems:return"rem";case s.kPixels:return"px";case s.kDegrees:return"deg";case s.kRadians:return"rad";case s.kGradians:return"grad";case s.kMilliseconds:return"ms";case s.kSeconds:return"s";case s.kTurns:return"turn"}return""}var Ar,Lr,Tr=[{name:"em",unit_type:s.kEms},{name:"px",unit_type:s.kPixels},{name:"deg",unit_type:s.kDegrees},{name:"rad",unit_type:s.kRadians},{name:"grad",unit_type:s.kGradians},{name:"ms",unit_type:s.kMilliseconds},{name:"s",unit_type:s.kSeconds},{name:"rem",unit_type:s.kRems},{name:"turn",unit_type:s.kTurns}],jr=((e=Ar=Ar||{})[e.kUnknownType=0]="kUnknownType",e[e.kUnparsedType=1]="kUnparsedType",e[e.kKeywordType=2]="kKeywordType",e[e.kUnitType=3]="kUnitType",e[e.kSumType=4]="kSumType",e[e.kProductType=5]="kProductType",e[e.kNegateType=6]="kNegateType",e[e.kInvertType=7]="kInvertType",e[e.kMinType=8]="kMinType",e[e.kMaxType=9]="kMaxType",e[e.kClampType=10]="kClampType",e[e.kTransformType=11]="kTransformType",e[e.kPositionType=12]="kPositionType",e[e.kURLImageType=13]="kURLImageType",e[e.kColorType=14]="kColorType",e[e.kUnsupportedColorType=15]="kUnsupportedColorType",function(e){return Tr.find(function(t){return t.name===e}).unit_type}),n=function(){function t(){}t.isAngle=function(t){return t===s.kDegrees||t===s.kRadians||t===s.kGradians||t===s.kTurns},t.isLength=function(t){return t>=s.kEms&&t=Ar.kUnitType&&this.getType()<=Ar.kClampType},t}(),r=function(n){function t(t){var e=n.call(this)||this;return e.colorSpace=void 0,e.colorSpace=t,e}Mr(t,n);var e=t.prototype;return e.getType=function(){return Ar.kColorType},e.to=function(t){return this},t}(n),Nr=((e=Lr=Lr||{})[e.Constant=0]="Constant",e[e.LinearGradient=1]="LinearGradient",e[e.RadialGradient=2]="RadialGradient",function(r){function t(t,e){var n=r.call(this)||this;return n.type=void 0,n.value=void 0,n.type=t,n.value=e,n}Mr(t,r);var e=t.prototype;return e.clone=function(){return new t(this.type,this.value)},e.buildCSSText=function(t,e,n){return n},e.getType=function(){return Ar.kColorType},t}(n)),Pr=function(n){function t(t){var e=n.call(this)||this;return e.value=void 0,e.value=t,e}Mr(t,n);var e=t.prototype;return e.clone=function(){return new t(this.value)},e.getType=function(){return Ar.kKeywordType},e.buildCSSText=function(t,e,n){return n+this.value},t}(n);function Cr(o,s){if("function"!=typeof o||null!=s&&"function"!=typeof s)throw new TypeError("Expected a function");function l(){for(var t=arguments.length,e=new Array(t),n=0;nd[1][2]&&(a[0]=-a[0]),d[0][2]>d[2][0]&&(a[1]=-a[1]),d[1][0]>d[0][1]&&(a[2]=-a[2])}}function mi(t,e,n,r,i){t[0]=e[0]*r+n[0]*i,t[1]=e[1]*r+n[1]*i,t[2]=e[2]*r+n[2]*i}var yi=tt();function vi(t,l){var c,u;t&&t.length&&(u=c=0,l?(c=l.parsedStyle.defX||0,u=l.parsedStyle.defY||0,l.resetLocalTransform(),l.setLocalPosition(c,u)):l=new Xo({}),t.forEach(function(t){var e,n,r,i,a,o,s=t.t,t=t.d;"scale"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1,1],l.scaleLocal(o[0],o[1],1)):"scalex"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1],l.scaleLocal(o[0],1,1)):"scaley"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1],l.scaleLocal(1,o[0],1)):"scalez"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1],l.scaleLocal(1,1,o[0])):"scale3d"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1,1,1],l.scaleLocal(o[0],o[1],o[2])):"translate"===s?(o=t||[Hr,Hr],l.translateLocal(o[0].value,o[1].value,0)):"translatex"===s?(o=t||[Hr],l.translateLocal(o[0].value,0,0)):"translatey"===s?(o=t||[Hr],l.translateLocal(0,o[0].value,0)):"translatez"===s?(o=t||[Hr],l.translateLocal(0,0,o[0].value)):"translate3d"===s?(o=t||[Hr,Hr,Hr],l.translateLocal(o[0].value,o[1].value,o[2].value)):"rotate"===s?(o=t||[Vr],l.rotateLocal(0,0,_a(o[0]))):"rotatex"===s?(o=t||[Vr],l.rotateLocal(_a(o[0]),0,0)):"rotatey"===s?(o=t||[Vr],l.rotateLocal(0,_a(o[0]),0)):"rotatez"===s?(o=t||[Vr],l.rotateLocal(0,0,_a(o[0]))):"rotate3d"!==s&&("skew"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[0,0],l.setLocalSkew(oi(o[0]),oi(o[1]))):"skewx"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[0],l.setLocalSkew(oi(o[0]),l.getLocalSkew()[1])):"skewy"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[0],l.setLocalSkew(l.getLocalSkew()[0],oi(o[0]))):"matrix"===s?(e=(o=t.map(function(t){return t.value}))[0],n=o[1],r=o[2],i=o[3],a=o[4],o=o[5],l.setLocalTransform(dt(yi,e,n,0,0,r,i,0,0,0,0,1,0,a+c,o+u,0,1))):"matrix3d"===s&&(dt.apply(Rt,[yi].concat(t.map(function(t){return t.value}))),yi[12]+=c,yi[13]+=u,l.setLocalTransform(yi)))})),l.getLocalTransform()}bi={linearGradient:/^(linear\-gradient)/i,repeatingLinearGradient:/^(repeating\-linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,repeatingRadialGradient:/^(repeating\-radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},xi="";var bi,xi,b,wi=function(t){return xi=t,Oi()};function Mi(t){throw new Error(xi+": "+t)}function Oi(){var t=Pi(ki);return 0Math.PI/2?Math.PI-o:o,a=a>Math.PI/2?Math.PI-a:a,{xExtra:Math.cos(r/2-o)*(e/2*(1/Math.sin(r/2)))-e/2||0,yExtra:Math.cos(a-r/2)*(e/2*(1/Math.sin(r/2)))-e/2||0})}function Hi(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}(r=b=b||{}).GROUP="g",r.CIRCLE="circle",r.ELLIPSE="ellipse",r.IMAGE="image",r.RECT="rect",r.LINE="line",r.POLYLINE="polyline",r.POLYGON="polygon",r.TEXT="text",r.PATH="path",r.HTML="html",r.MESH="mesh";function Vi(t,e,n,r,i,a,o,s){var l,c,u;return e=Math.abs(e),n=Math.abs(n),r=oi(r=Ke(r,360)),t.x===o.x&&t.y===o.y?{x:t.x,y:t.y,ellipticalArcAngle:0}:0===e||0===n?{x:0,y:0,ellipticalArcAngle:0}:(u=(t.x-o.x)/2,c=(t.y-o.y)/2,u={x:Math.cos(r)*u+Math.sin(r)*c,y:-Math.sin(r)*u+Math.cos(r)*c},1<(c=Math.pow(u.x,2)/Math.pow(e,2)+Math.pow(u.y,2)/Math.pow(n,2))&&(e=Math.sqrt(c)*e,n=Math.sqrt(c)*n),c=(c=(Math.pow(e,2)*Math.pow(n,2)-Math.pow(e,2)*Math.pow(u.y,2)-Math.pow(n,2)*Math.pow(u.x,2))/(Math.pow(e,2)*Math.pow(u.y,2)+Math.pow(n,2)*Math.pow(u.x,2)))<0?0:c,i=(i!==a?1:-1)*Math.sqrt(c),c=e*u.y/n*i,i*=-n*u.x/e,t={x:Math.cos(r)*c-Math.sin(r)*i+(t.x+o.x)/2,y:Math.sin(r)*c+Math.cos(r)*i+(t.y+o.y)/2},l=Yi({x:1,y:0},o={x:(u.x-c)/e,y:(u.y-i)/n}),o=Yi(o,{x:(-u.x-c)/e,y:(-u.y-i)/n}),!a&&0=u[n],f[n]-=i?1:0,i?t.ss:[t.s]}).flat()});return r[0].length===r[1].length?r:t(r[0],r[1],c)}(h,d):t)[0])!==Pe(t[1])?(r=t[0],e=r.slice(1).map(function(t,e,n){return(e?n[e-1].slice(-2):r[0].slice(1)).concat(t.slice(1))}).map(function(n){return n.map(function(t,e){return n[n.length-e-2*(1-e%2)]})}).reverse(),[["M"].concat(e[0].slice(0,2))].concat(e.map(function(t){return["C"].concat(t.slice(2))}))):se(t[0]);return[h,(i=t[1],a=h,c=i.length-1,u=[],f=0,s=(o=i).length,l=s-1,(d=o.map(function(t,r){return o.map(function(t,e){var n=r+e;return 0===e||o[n]&&"M"===o[n][0]?(e=o[n],["M"].concat(e.slice(-2))):(s<=n&&(n-=l),o[n])})})).forEach(function(t,n){i.slice(1).forEach(function(t,e){f+=Se(i[(n+e)%c].slice(-2),a[e%c].slice(-2))}),u[n]=f,f=0}),d[u.indexOf(Math.min.apply(null,u))]),function(t){return t}]}function Wa(t,e){var n,r,i=Ve(t)?t.split(" ").map(function(t){var t=t.split(","),e=t[0],t=t[1];return[Number(e),Number(t)]}):t,a=[],o=0,s=cr.length(i),t=(i.forEach(function(t,e){i[e+1]&&((n=[0,0])[0]=o/s,r=Dn.length(t[0],t[1],i[e+1][0],i[e+1][1]),o+=r,n[1]=o/s,a.push(n))}),Math.min.apply(Math,i.map(function(t){return t[0]}))),l=Math.min.apply(Math,i.map(function(t){return t[1]}));return e&&(e.parsedStyle.defX=t,e.parsedStyle.defY=l),{points:i,totalLength:s,segments:a}}function Ga(t,e){return[t.points,e.points,function(t){return t}]}var qa=null;function Ha(t){return function(e){var n=0;return t.map(function(t){return t===qa?e[n++]:t})}}function Va(t){return t}var Ya={matrix:["NNNNNN",[qa,qa,0,0,qa,qa,0,0,0,0,1,0,qa,qa,0,1],Va],matrix3d:["NNNNNNNNNNNNNNNN",Va],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Ha([qa,qa,new qr(1)]),Va],scalex:["N",Ha([qa,new qr(1),new qr(1)]),Ha([qa,new qr(1)])],scaley:["N",Ha([new qr(1),qa,new qr(1)]),Ha([new qr(1),qa])],scalez:["N",Ha([new qr(1),new qr(1),qa])],scale3d:["NNN",Va],skew:["Aa",null,Va],skewx:["A",null,Ha([qa,Vr])],skewy:["A",null,Ha([Vr,qa])],translate:["Tt",Ha([qa,qa,Hr]),Va],translatex:["T",Ha([qa,Hr,Hr]),Ha([qa,Hr])],translatey:["T",Ha([Hr,qa,Hr]),Ha([Hr,qa])],translatez:["L",Ha([Hr,Hr,qa])],translate3d:["TTL",Va]};function $a(t){if("none"!==(t=(t||"none").toLowerCase().trim()))for(var e,n=/\s*(\w+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];var i=e.index+e[0].length,a=e[1],o=Ya[a];if(!o)return[];var s=e[2].split(","),l=o[0];if(l.length=t[0]&&n[1]<=r[1]&&e[1]>=t[1]&&n[2]<=r[2]&&e[2]>=t[2]},t.intersection=function(t){var e,n,r,i;return this.intersects(t)?(e=new m,i=[0,0,0],n=this.getMin(),r=t.getMin(),i[0]=Math.max(n[0],r[0]),i[1]=Math.max(n[1],r[1]),i[2]=Math.max(n[2],r[2]),n=i,r=[0,0,0],i=this.getMax(),t=t.getMax(),r[0]=Math.min(i[0],t[0]),r[1]=Math.min(i[1],t[1]),r[2]=Math.min(i[2],t[2]),e.setMinMax(n,r),e):null},t.getNegativeFarPoint=function(t){return 273===t.pnVertexFlag?ti([0,0,0],this.min):272===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:257===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:256===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:17===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:16===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:1===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]},t.getPositiveFarPoint=function(t){return 273===t.pnVertexFlag?ti([0,0,0],this.max):272===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:257===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:256===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:17===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:16===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:1===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]},m}(),wo=function(){function t(t,e){this.distance=void 0,this.normal=void 0,this.pnVertexFlag=void 0,this.distance=t||0,this.normal=e||Ft(0,1,0),this.updatePNVertexFlag()}var e=t.prototype;return e.updatePNVertexFlag=function(){this.pnVertexFlag=(Number(0<=this.normal[0])<<8)+(Number(0<=this.normal[1])<<4)+Number(0<=this.normal[2])},e.distanceToPoint=function(t){return Ht(t,this.normal)-this.distance},e.normalize=function(){var t,e,n,r=1/Kt(this.normal);t=this.normal,e=this.normal,n=r,t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,this.distance*=r},e.intersectsLine=function(t,e,n){var r,i,a=this.distanceToPoint(t),a=a/(a-this.distanceToPoint(e)),o=0<=a&&a<=1;return o&&n&&(n=n,e=e,a=a,r=(t=t)[0],i=t[1],t=t[2],n[0]=r+a*(e[0]-r),n[1]=i+a*(e[1]-i),n[2]=t+a*(e[2]-t)),o},t}(),Mo=(0,function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;e<6;e++)this.planes.push(new wo)}return t.prototype.extractFromVPMatrix=function(t){var e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],c=t[8],u=t[9],f=t[10],h=t[11],d=t[12],p=t[13],g=t[14],t=t[15];zt(this.planes[0].normal,i-e,l-a,h-c),this.planes[0].distance=t-d,zt(this.planes[1].normal,i+e,l+a,h+c),this.planes[1].distance=t+d,zt(this.planes[2].normal,i+n,l+o,h+u),this.planes[2].distance=t+p,zt(this.planes[3].normal,i-n,l-o,h-u),this.planes[3].distance=t-p,zt(this.planes[4].normal,i-r,l-s,h-f),this.planes[4].distance=t-g,zt(this.planes[5].normal,i+r,l+s,h+f),this.planes[5].distance=t+g,this.planes.forEach(function(t){t.normalize(),t.updatePNVertexFlag()})},t}()),Oo=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}var e=t.prototype;return e.clone=function(){return new t(this.x,this.y)},e.copyFrom=function(t){this.x=t.x,this.y=t.y},t}(),ko=function(){function t(t,e,n,r){this.x=void 0,this.y=void 0,this.width=void 0,this.height=void 0,this.left=void 0,this.right=void 0,this.top=void 0,this.bottom=void 0,this.x=t,this.y=e,this.width=n,this.height=r,this.left=t,this.right=t+n,this.top=e,this.bottom=e+r}return t.prototype.toJSON=function(){},t}(),_o=function(){function t(){this.parser=Da,this.parserWithCSSDisabled=Da,this.mixer=za}var e=t.prototype;return e.calculator=function(t,e,n){return n instanceof Pr&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new ko(0,0,0,0)}:n},e.postProcessor=function(t,e){var n;t.nodeName===b.PATH&&-1===e.indexOf("transform")&&(n=(e=t.parsedStyle).defX,e=e.defY,t.setLocalPosition(void 0===n?0:n,void 0===e?0:e))},t}(),Eo=function(){function t(){this.parser=Wa,this.mixer=Ga}return t.prototype.postProcessor=function(t,e){var n;t.nodeName!==b.POLYGON&&t.nodeName!==b.POLYLINE||-1!==e.indexOf("transform")||(n=(e=t.parsedStyle).defX,e=e.defY,t.setLocalPosition(n,e))},t}(),So=function(i){function t(){for(var t,e=arguments.length,n=new Array(e),r=0;r"].calculator(null,null,{value:e.textTransform},n,null),e.clipPath&&x.CSSPropertySyntaxFactory[""].calculator("clipPath",o,e.clipPath,n,this),e.offsetPath&&x.CSSPropertySyntaxFactory[""].calculator("offsetPath",i,e.offsetPath,n,this),e.anchor&&(n.parsedStyle.anchor=Ea(e.anchor,2)),e.transform&&(n.parsedStyle.transform=$a(e.transform)),e.transformOrigin&&(n.parsedStyle.transformOrigin=ao(e.transformOrigin)),e.markerStart&&(n.parsedStyle.markerStart=x.CSSPropertySyntaxFactory[""].calculator(null,e.markerStart,e.markerStart,null,null)),e.markerEnd&&(n.parsedStyle.markerEnd=x.CSSPropertySyntaxFactory[""].calculator(null,e.markerEnd,e.markerEnd,null,null)),e.markerMid&&(n.parsedStyle.markerMid=x.CSSPropertySyntaxFactory[""].calculator("",e.markerMid,e.markerMid,null,null)),(n.nodeName!==b.CIRCLE&&n.nodeName!==b.ELLIPSE||p(e.cx)&&p(e.cy))&&(n.nodeName!==b.RECT&&n.nodeName!==b.IMAGE&&n.nodeName!==b.GROUP&&n.nodeName!==b.HTML&&n.nodeName!==b.TEXT&&n.nodeName!==b.MESH||p(e.x)&&p(e.y)&&p(e.z))&&(n.nodeName!==b.LINE||p(e.x1)&&p(e.y1)&&p(e.z1)&&p(e.x2)&&p(e.y2)&&p(e.z2))||x.CSSPropertySyntaxFactory[""].postProcessor(n,s),p(e.zIndex)||x.CSSPropertySyntaxFactory[""].postProcessor(n,s),e.path&&x.CSSPropertySyntaxFactory[""].postProcessor(n,s),e.points&&x.CSSPropertySyntaxFactory[""].postProcessor(n,s),p(e.offsetDistance)||x.CSSPropertySyntaxFactory[""].postProcessor(n,s),e.transform&&x.CSSPropertySyntaxFactory[""].postProcessor(n,s),u&&this.updateGeometry(n)}},e.parseProperty=function(t,e,n){var r,t=ts[t],i=e;return"unset"===(e=""!==e&&!p(e)?e:"unset")||"initial"===e||"inherit"===e?i=zr(e):t&&(r=t.k,t=(t=t.syntax)&&this.getPropertySyntax(t),r&&-1[["cartesian"]],Ls=(As.props={},(t={})=>{var e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)}),Ts=t=>{var{startAngle:t,endAngle:e,innerRadius:n,outerRadius:r}=Ls(t);return[["translate",0,.5],["reflect.y"],["translate",0,-.5],["polar",t,e,n,r]]},js=(Ts.props={},({startAngle:t=0,endAngle:e=6*Math.PI,innerRadius:n=0,outerRadius:r=1})=>[["translate",.5,.5],["reflect.y"],["translate",-.5,-.5],["helix",t,e,n,r]]),Ns=(js.props={},()=>[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5]]),Ps=(Ns.props={transform:!0},t=>{[t={}]=[t],e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};var{startAngle:e,endAngle:t,innerRadius:n,outerRadius:r}=Object.assign(Object.assign({},e),t);return[...Ns(),...Ts({startAngle:e,endAngle:t,innerRadius:n,outerRadius:r})]}),Cs=(Ps.props={},(t={})=>{var e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)}),Rs=t=>{var{startAngle:t,endAngle:e,innerRadius:n,outerRadius:r}=Cs(t);return[["transpose"],["translate",.5,.5],["reflect"],["translate",-.5,-.5],...Ts({startAngle:t,endAngle:e,innerRadius:n,outerRadius:r})]},Is=(Rs.props={},()=>[["parallel",0,1,0,1]]),Bs=(Is.props={},({focusX:t=0,focusY:e=0,distortionX:n=2,distortionY:r=2,visual:i=!1})=>[["fisheye",t,e,n,r,i]]),Fs=(Bs.props={transform:!0},t=>{var{startAngle:t=-Math.PI/2,endAngle:e=3*Math.PI/2,innerRadius:n=0,outerRadius:r=1}=t;return[...Is(),...Ts({startAngle:t,endAngle:e,innerRadius:n,outerRadius:r})]}),Ds=(Fs.props={},({value:e})=>t=>t.map(()=>e)),zs=(Ds.props={},({value:e})=>t=>t.map(e)),Ws=(zs.props={},({value:e})=>t=>t.map(t=>t[e])),Gs=(Ws.props={},({value:t})=>()=>t);function qs(t,e){return t.parent===e.parent?1:2}function Hs(t,e){return t+e.x}function Vs(t,e){return Math.max(t,e.y)}function Ys(){var s=qs,l=1,c=1,u=!1;function e(e){var r,i=0,t=(e.eachAfter(function(t){var e,n=t.children;n?(t.x=(e=n).reduce(Hs,0)/e.length,t.y=1+n.reduce(Vs,0)):(t.x=r?i+=s(t,r):0,t.y=0,r=t)}),function(t){for(var e;e=t.children;)t=e[0];return t}(e)),n=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(e),a=t.x-s(t,n)/2,o=n.x+s(n,t)/2;return e.eachAfter(u?function(t){t.x=(t.x-e.x)*l,t.y=(e.y-t.y)*c}:function(t){t.x=(t.x-a)/(o-a)*l,t.y=(1-(e.y?t.y/e.y:1))*c})}return e.separation=function(t){return arguments.length?(s=t,e):s},e.size=function(t){return arguments.length?(u=!1,l=+t[0],c=+t[1],e):u?null:[l,c]},e.nodeSize=function(t){return arguments.length?(u=!0,l=+t[0],c=+t[1],e):u?[l,c]:null},e}function $s(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;0<=--r;)e+=n[r].value;else e=1;t.value=e}function Us(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=Xs)):void 0===e&&(e=Ks);for(var n,r,i,a,o,t=new Js(t),s=[t];n=s.pop();)if((i=e(n.data))&&(o=(i=Array.from(i)).length))for(n.children=i,a=o-1;0<=a;--a)s.push(r=i[a]=new Js(i[a])),r.parent=n,r.depth=n.depth+1;return t.eachBefore(Qs)}function Ks(t){return t.children}function Xs(t){return Array.isArray(t)?t[1]:null}function Zs(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function Qs(t){for(var e=0;t.height=e,(t=t.parent)&&t.height<++e;);}function Js(t){this.data=t,this.depth=this.height=0,this.parent=null}function tl(t){return null==t?null:el(t)}function el(t){if("function"!=typeof t)throw new Error;return t}function nl(){return 0}function rl(t){return function(){return t}}Gs.props={},Js.prototype=Us.prototype={constructor:Js,count:function(){return this.eachAfter($s)},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,a=this,o=[a],s=[],l=-1;a=o.pop();)if(s.push(a),n=a.children)for(r=0,i=n.length;r(t=(1664525*t+1013904223)%il)/il}();return t.x=r/2,t.y=i/2,n?t.eachBefore(vl(n)).eachAfter(bl(a,.5,e)).eachBefore(xl(1)):t.eachBefore(vl(ml)).eachAfter(bl(nl,1,e)).eachAfter(bl(a,t.r/Math.min(r,i),e)).eachBefore(xl(Math.min(r,i)/(2*t.r))),t}return e.radius=function(t){return arguments.length?(n=tl(t),e):n},e.size=function(t){return arguments.length?(r=+t[0],i=+t[1],e):[r,i]},e.padding=function(t){return arguments.length?(a="function"==typeof t?t:rl(+t),e):a},e}function vl(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function bl(o,s,l){return function(t){if(e=t.children){var e,n,r,i=e.length,a=o(t)*s||0;if(a)for(n=0;n{t=m(t,e,n),e=(t=""+t).length;return"/"===(t=Tl(t,e-1)&&!Tl(t,e-2)?t.slice(0,-1):t)[0]?t:"/"+t}),g=p.map(Ll);var d=new Set(p).add("");for(const r of g)d.has(r)||(d.add(r),p.push(r),g.push(Ll(r)),c.push(_l));u=(t,e)=>p[e],f=(t,e)=>g[e]}for(r=0,e=c.length;rn.x&&(n=t),t.depth>r.depth&&(r=t)}),s=e===n?1:h(e,n)/2,i=s-e.x,a=l/(n.x+s+i),o=c/(r.depth||1),t.eachBefore(function(t){t.x=(t.x+i)*a,t.y=t.depth*o})),t}function f(t){var e=t.children,n=t.parent.children,r=t.i?n[t.i-1]:null;if(e){for(var i,a=0,o=0,s=t.children,l=s.length;0<=--l;)(i=s[l]).z+=a,i.m+=a,a+=i.s+(o+=i.c);e=(e[0].z+e[e.length-1].z)/2;r?(t.z=r.z+h(t._,r._),t.m=t.z-e):t.z=e}else r&&(t.z=r.z+h(t._,r._));t.parent.A=function(t,e,n){if(e){for(var r,i=t,a=t,o=e,s=i.parent.children[0],l=i.m,c=a.m,u=o.m,f=s.m;o=Pl(o),i=Nl(i),o&&i;)s=Nl(s),(a=Pl(a)).a=t,0<(r=o.z+u-i.z-l+h(o._,i._))&&(function(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(t,e,n){return t.a.parent===e.parent?t.a:n}(o,t,n),t,r),l+=r,c+=r),u+=o.m,l+=i.m,f+=s.m,c+=a.m;o&&!Pl(a)&&(a.t=o,a.m+=u-c),i&&!Nl(s)&&(s.t=i,s.m+=l-f,n=t)}return n}(t,r,t.parent.A||n[0])}function d(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function p(t){t.x*=l,t.y=t.depth*c}return e.separation=function(t){return arguments.length?(h=t,e):h},e.size=function(t){return arguments.length?(u=!1,l=+t[0],c=+t[1],e):u?null:[l,c]},e.nodeSize=function(t){return arguments.length?(u=!0,l=+t[0],c=+t[1],e):u?[l,c]:null},e}function Il(t,e,n,r,i){for(var a,o=t.children,s=-1,l=o.length,c=t.value&&(i-n)/t.value;++s>>1;m[h]{const n=d?Kl(l,a[e]):0;var r=p?Kl(c,o[e]):0,e=g&&s?(Kl(u,s[e])/2+ +s[e])*n:0,[t,i]=t;return[t+f*n+e,i+h*r]}:t=>t}function Zl(t){return parseFloat(t)/100}function Ql(t,e,n,r){const{x:i,y:a}=n,{width:o,height:s}=r.getOptions();return[t,Array.from(t,t=>{var e=i[t],t=a[t];return[["string"==typeof e?Zl(e)*o:+e,"string"==typeof t?Zl(t)*s:+t]]})]}function Jl(e){return"function"==typeof e?e:t=>t[e]}function tc(t,e){return Array.from(t,Jl(e))}function ec(t,e){var{source:e=t=>t.source,target:n=t=>t.target,value:r=t=>t.value}=e,{links:t,nodes:i}=t;const a=tc(t,e),o=tc(t,n),s=tc(t,r);return{links:t.map((t,e)=>({target:o[e],source:a[e],value:s[e]})),nodes:i||Array.from(new Set([...a,...o]),t=>({key:t}))}}function nc(t,e){return t.getBandWidth(t.invert(e))}const rc=()=>(t,e,n,i)=>{const{x:a,y:o,y1:s,series:l,size:r}=n,c=e.x,u=e.series,[f]=i.getSize(),h=r?r.map(t=>+t/f):null,d=r?(t,e,n)=>{t+=e/2,e=h[n];return[t-e/2,t+e/2]}:(t,e,n)=>[t,t+e];return[t,Array.from(t,t=>{var e=nc(c,a[t]),n=e*(u?nc(u,null===l||void 0===l?void 0:l[t]):1),e=(+(null===l||void 0===l?void 0:l[t])||0)*e,e=+a[t]+e,[e,n]=d(e,n,t),r=+o[t],t=+s[t];return[[e,r],[n,r],[n,t],[e,t]].map(t=>i.map(t))})]};rc.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,channels:[...Hl({shapes:["rect","hollow","funnel","pyramid"]}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size"}],preInference:[...Ul(),{type:"maybeZeroY1"},{type:"maybeZeroX"}],postInference:[...Yl()],interaction:{shareTooltip:!0}};const ic=()=>(t,e,n,r)=>{const{x:i,x1:a,y:o,y1:s}=n;return[t,Array.from(t,t=>{return[[+i[t],+o[t]],[+a[t],+o[t]],[+a[t],+s[t]],[+i[t],+s[t]]].map(t=>r.map(t))})]};function ac(t,e){return null==t||null==e?NaN:t>>1;o(t[i],e)<0?n=1+i:r=i}while(nac(n(t),e),(t,e)=>n(t)-e):(a=n===ac||n===function(t,e){return null==t||null==e?NaN:e-i(t[r],e)?r-1:r},right:function(t,e,n=0,r=t.length){if(n>>1;o(t[i],e)<=0?n=1+i:r=i}while(n=t&&++r;else{let t=-1;for(var i of e)null!=(i=n(i,++t,e))&&(i=+i)>=i&&++r}return r}function dc(t,e){t=function(e,n){let r=0,i,a=0,o=0;if(void 0===n)for(var t of e)null!=t&&(t=+t)>=t&&(i=t-a,a+=i/++r,o+=i*(t-a));else{let t=-1;for(var s of e)null!=(s=n(s,++t,e))&&(s=+s)>=s&&(i=s-a,a+=i/++r,o+=i*(s-a))}if(1=t&&(r=i=t):(r>t&&(r=t),i=a&&(r=i=a):(r>a&&(r=a),i=h.length)return f(e);var r=new mc,i=h[n++];let a=-1;for(const l of e){var o=i(l,++a,e),s=r.get(o);s?s.push(l):r.set(o,[l])}for(const[c,e]of r)r.set(c,t(e,n));return u(r)}(t,0)}function Oc(e,...i){if("function"!=typeof e[Symbol.iterator])throw new TypeError("values is not iterable");e=Array.from(e);let[n]=i;var t,r;return n&&2!==n.length||1e),1e.map(t)),t.sort((t,e)=>{for(const r of i){var n=_c(r[t],r[e]);if(n)return n}})):(n=e.map(n),t.sort((t,e)=>_c(n[t],n[e]))),r=e,Array.from(t,t=>r[t])):e.sort(kc(n))}function kc(r=ac){if(r===ac)return _c;if("function"!=typeof r)throw new TypeError("compare is not a function");return(t,e)=>{var n=r(t,e);return n||0===n?n:(0===r(e,e))-(0===r(t,t))}}function _c(t,e){return(null==t||!(t<=t))-(null==e||!(e<=e))||(tt}const Ac=Math.sqrt(50),Lc=Math.sqrt(10),Tc=Math.sqrt(2);function jc(t,e,n){var r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),r=r/Math.pow(10,i),r=r>=Ac?10:r>=Lc?5:r>=Tc?2:1;let a,o,s;return i<0?(s=Math.pow(10,-i)/r,a=Math.round(t*s),o=Math.round(e*s),a/se&&--o,s=-s):(s=Math.pow(10,i)*r,a=Math.round(t/s),o=Math.round(e/s),a*se&&--o),o=l)if(l<=o&&v===pc){const n=Nc(s,l,u);isFinite(n)&&(0l;)--d;(h||d=t)&&(r=t);else{let t=-1;for(var i of e)null!=(i=n(i,++t,e))&&(r=i)&&(r=i)}return r}function Ic(t,e){let n,r=-1,i=-1;if(void 0===e)for(const o of t)++i,null!=o&&(n=o)&&(n=o,r=i);else for(var a of t)null!=(a=e(a,++i,t))&&(n=a)&&(n=a,r=i);return r}function Bc(e,n){let r;if(void 0===n)for(const t of e)null!=t&&(r>t||void 0===r&&t>=t)&&(r=t);else{let t=-1;for(var i of e)null!=(i=n(i,++t,e))&&(r>i||void 0===r&&i>=i)&&(r=i)}return r}function Fc(t,e){let n,r=-1,i=-1;if(void 0===e)for(const o of t)++i,null!=o&&(n>o||void 0===n&&o>=o)&&(n=o,r=i);else for(var a of t)null!=(a=e(a,++i,t))&&(n>a||void 0===n&&a>=a)&&(n=a,r=i);return r}function Dc(n,r,i=0,a=1/0,o){if(r=Math.floor(r),i=Math.floor(Math.max(0,i)),a=Math.floor(Math.min(n.length-1,a)),i<=r&&r<=a)for(o=void 0===o?_c:kc(o);i=t&&(yield t);else{let t=-1;for(var r of e)null!=(r=n(r,++t,e))&&(r=+r)>=r&&(yield r)}}(t,n))).length)&&!isNaN(e=+e))return e<=0||n<2?Bc(t):1<=e?Rc(t):(n=(n-1)*e,(r=Rc(Dc(t,e=Math.floor(n)).subarray(0,e+1)))+(Bc(t.subarray(e+1))-r)*(n-e))}function Gc(n,t,r=lc){var i,e,a;if(!isNaN(t=+t))return i=Float64Array.from(n,(t,e)=>lc(r(n[e],e,n))),t<=0?Fc(i):1<=t?Ic(i):(e=Uint32Array.from(n,(t,e)=>e),a=i.length-1,Dc(e,t=Math.floor(a*t),0,a,(t,e)=>_c(i[t],i[e])),0<=(t=function(e,n){let r,i=!1;if(1===n.length){let t;for(const o of e){var a=n(o);(i?0i[t]))?t:-1)}function qc(e,n){let r=0,i=0;if(void 0===n)for(var t of e)null!=t&&(t=+t)>=t&&(++r,i+=t);else{let t=-1;for(var a of e)null!=(a=n(a,++t,e))&&(a=+a)>=a&&(++r,i+=a)}if(r)return i/r}function Hc(t,e){return Wc(t,.5,e)}function Vc(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function Yc(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)),a=new Array(i);++rt).filter(t=>"transpose"===t).length%2!=0}function Kc(t){t=t.getOptions().transformations;return t.some(([t])=>"polar"===t)}function Xc(t){t=t.getOptions().transformations;return t.some(([t])=>"reflect"===t)&&t.some(([t])=>t.startsWith("transpose"))}function Zc(t){t=t.getOptions().transformations;return t.some(([t])=>"helix"===t)}function Qc(t){t=t.getOptions().transformations;return t.some(([t])=>"parallel"===t)}function Jc(t){t=t.getOptions().transformations;return t.some(([t])=>"fisheye"===t)}function tu(t){return Zc(t)||Kc(t)}function eu(t){var t=t.getOptions()["transformations"],[,,,t,e]=t.find(t=>"polar"===t[0]);return[+t,+e]}function nu(t,e=!0){var t=t.getOptions()["transformations"],[,t,n]=t.find(t=>"polar"===t[0]);return e?[180*+t/Math.PI,180*+n/Math.PI]:[t,n]}const ru=(t,e,n,r)=>{var i;const{series:a,x:o,y:s}=n;var{x:n,y:e}=e;if(void 0===o||void 0===s)throw new Error("Missing encode for x or y channel.");var t=a?Array.from(bc(t,t=>a[t]).values()):[t],l=t.map(t=>t[0]).filter(t=>void 0!==t);const c=((null==(i=null==n?void 0:n.getBandWidth)?void 0:i.call(n))||0)/2,u=((null==(i=null==e?void 0:e.getBandWidth)?void 0:i.call(e))||0)/2;return[l,Array.from(t,t=>t.map(t=>r.map([+o[t]+c,+s[t]+u]))),t]},iu=(t,e,n,i)=>{const a=Object.entries(n).filter(([t])=>t.startsWith("position")).map(([,t])=>t);if(0===a.length)throw new Error("Missing encode for position channel.");return[t,Array.from(t,e=>{var t=a.map(t=>+t[e]),n=i.map(t),r=[];for(let t=0;t(t,e,n,r)=>{return(Qc(r)?iu:ru)(t,e,n,r)};au.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,channels:[...Hl({shapes:["line","smooth"]}),{name:"x"},{name:"y"},{name:"position",independent:!0},{name:"size"},{name:"series",scale:"identity"}],preInference:[...Ul(),{type:"maybeSeries"},{type:"maybeGradient"}],postInference:[...Yl(),{type:"maybeTitle",channel:"color"},{type:"maybeTooltip",channel:["position"]}],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const ou=g=>(t,e,n,o)=>{const{x:r,y:i,x1:a,y1:s,size:l,dx:c,dy:u}=n,[f,h]=o.getSize(),d=Xl(e,n,g),p=t=>{var e=+((null===c||void 0===c?void 0:c[t])||0),n=+((null===u||void 0===u?void 0:u[t])||0);return[(a?(+r[t]+ +a[t])/2:+r[t])+e,(s?(+i[t]+ +s[t])/2:+i[t])+n]};return[t,l?Array.from(t,t=>{var[e,n]=p(t),r=+l[t],i=r/f,r=r/h,a=[e-i,n-r],e=[e+i,n+r];return[o.map(d(a,t)),o.map(d(e,t))]}):Array.from(t,t=>[o.map(d(p(t),t))])]};ou.props={defaultShape:"hollow",defaultLabelShape:"label",composite:!1,channels:[...Hl({shapes:["hollow","hollowDiamond","hollowHexagon","hollowSquare","hollowTriangleDown","hollowTriangle","hollowBowtie","point","plus","diamond","square","triangle","hexagon","cross","bowtie","hyphen","line","tick","triangleDown"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size",scale:"sqrt"},{name:"dx",scale:"identity"},{name:"dy",scale:"identity"}],preInference:[...Ul(),{type:"maybeZeroY"},{type:"maybeZeroX"}],postInference:[{type:"maybeSize"},...Vl()]};const su=s=>{var{cartesian:t=!1}=s;return t?Ql:(t,e,n,r)=>{const{x:i,y:a}=n,o=Xl(e,n,s);return[t,Array.from(t,t=>{var e=[+i[t],+a[t]];return[r.map(o(e,t))]})]}};su.props={defaultShape:"text",defaultLabelShape:"label",composite:!1,channels:[...Hl({shapes:["text","badge"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"text",scale:"identity"},{name:"fontSize"},{name:"rotate"}],preInference:[...Ul(),{type:"maybeTuple"},{type:"maybeVisualPosition"}],postInference:[...Vl()]};const lu=()=>(t,e,n,i)=>{const{x:a,y:o}=n,s=e.x,l=e.y;return[t,Array.from(t,t=>{var e=s.getBandWidth(s.invert(+a[t])),n=l.getBandWidth(l.invert(+o[t])),r=+a[t],t=+o[t];return[[r,t],[r+e,t],[r+e,t+n],[r,t+n]].map(t=>i.map(t))})]};lu.props={defaultShape:"cell",defaultLabelShape:"label",composite:!1,channels:[...Hl({shapes:["cell","hollow"]}),{name:"x",required:!0,scale:"band"},{name:"y",required:!0,scale:"band"}],preInference:[...Ul(),{type:"maybeZeroX"},{type:"maybeZeroY"},{type:"maybeZeroPadding"}],postInference:[...Vl()]};const cu=()=>(t,e,n,a)=>{var r;const{x:o,y:s,y1:l,series:i}=n;var{x:n,y:e}=e,t=i?Array.from(bc(t,t=>i[t]).values()):[t],c=t.map(t=>t[0]).filter(t=>void 0!==t);const u=((null==(r=null==n?void 0:n.getBandWidth)?void 0:r.call(n))||0)/2,f=((null==(r=null==e?void 0:e.getBandWidth)?void 0:r.call(e))||0)/2;return[c,Array.from(t,e=>{var n=e.length,r=new Array(2*n);for(let t=0;t(t,e,n,r)=>{const{x:i,y:a,x1:o=i,y1:s=a}=n,l=Xl(e,n,c);e=t.map(t=>[r.map(l([+i[t],+a[t]],t)),r.map(l([+o[t],+s[t]],t))]);return[t,e]};uu.props={defaultShape:"link",defaultLabelShape:"label",composite:!1,channels:[...Hl({shapes:["link","arc","vhv","smooth"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Ul(),{type:"maybeIdentityY"},{type:"maybeIdentityX"}],postInference:[...Vl()]};const fu=s=>{var t=s["cartesian"];return t?Ql:(t,e,n,r)=>{const{x:i,y:a}=n,o=Xl(e,n,s);return[t,Array.from(t,t=>{var e=[+i[t],+a[t]];return[r.map(o(e,t))]})]}};fu.props={defaultShape:"image",defaultLabelShape:"label",composite:!1,channels:[...Hl({shapes:["image"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"src",scale:"identity"},{name:"size"}],preInference:[...Ul(),{type:"maybeTuple"},{type:"maybeVisualPosition"}],postInference:[...Vl()]};const hu=()=>(t,e,n,a)=>{const o=Object.entries(n).filter(([t])=>t.startsWith("x")).map(([,t])=>t),s=Object.entries(n).filter(([t])=>t.startsWith("y")).map(([,t])=>t);n=t.map(e=>{var n=[];for(let t=0;t(t,e,n,s)=>{const{x:l,y:c,y1:u,y2:f,y3:h,y4:d,series:p}=n,g=e.x,m=e.series;return[t,Array.from(t,t=>{var e=g.getBandWidth(g.invert(+l[t])),n=e*(m?m.getBandWidth(m.invert(+(null===p||void 0===p?void 0:p[t]))):1),e=(+(null===p||void 0===p?void 0:p[t])||0)*e,e=+l[t]+e+n/2,[t,r,i,a,o]=[+c[t],+u[t],+f[t],+h[t],+d[t]];return[[e-n/2,o],[e+n/2,o],[e,o],[e,a],[e-n/2,a],[e+n/2,a],[e+n/2,r],[e-n/2,r],[e-n/2,i],[e+n/2,i],[e,r],[e,t],[e-n/2,t],[e+n/2,t]].map(t=>s.map(t))})]},pu=(du.props={defaultShape:"box",defaultLabelShape:"label",composite:!1,channels:[...Hl({shapes:["box"]}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"}],preInference:[...Ul(),{type:"maybeZeroX"}],postInference:[...Yl()],interaction:{shareTooltip:!0}},()=>(t,e,n,i)=>{const{x:a,y:o,size:s,rotate:l}=n,[c,u]=i.getSize();n=t.map(t=>{var e=+l[t]/180*Math.PI,n=+s[t],r=n/c,n=n/u,r=r*Math.cos(e),n=-n*Math.sin(e);return[i.map([+a[t]-r/2,+o[t]-n/2]),i.map([+a[t]+r/2,+o[t]+n/2])]});return[t,n]});pu.props={defaultShape:"vector",defaultLabelShape:"label",composite:!1,channels:[...Hl({shapes:["vector"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"rotate",required:!0,scale:"identity"},{name:"size",required:!0}],preInference:[...Ul()],postInference:[...Vl()]};const gu=()=>(t,e,n,r)=>{const i=n["y"];return[t,Array.from(t,t=>{return[[0,i[t]],[1,i[t]]].map(t=>r.map(t))})]};gu.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,channels:[...$l({shapes:["line"]}),{name:"y",required:!0}],preInference:[...Ul(),{type:"maybeTupleY"}],postInference:[]};const mu=()=>(t,e,n,r)=>{const i=n["x"];return[t,Array.from(t,t=>{return[[i[t],1],[i[t],0]].map(t=>r.map(t))})]};mu.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,channels:[...$l({shapes:["line"]}),{name:"x",required:!0}],preInference:[...Ul(),{type:"maybeTupleX"}],postInference:[]};const yu=(...t)=>uu(...t);function vu(t,e,n,r){if(e)return()=>[0,1];const{[t]:i,[t+"1"]:a}=n;return t=>{var e=(null==(e=r.getBandWidth)?void 0:e.call(r,r.invert(+a[t])))||0;return[i[t],a[t]+e]}}function bu(t={}){const{extendX:r=!1,extendY:s=!1}=t;return(t,e,n,i)=>{const a=vu("x",r,n,e.x),o=vu("y",s,n,e.y);return[t,Array.from(t,t=>{var[e,n]=a(t),[t,r]=o(t);return[[e,t],[n,t],[n,r],[e,r]].map(t=>i.map(t))})]}}yu.props={defaultShape:"connector",defaultLabelShape:"label",composite:!1,channels:[...$l({shapes:["connector"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Ul()],postInference:[]};const xu=()=>bu();xu.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,channels:[...$l({shapes:["range"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Ul()],postInference:[]};const wu=()=>bu({extendY:!0});wu.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,channels:[...$l({shapes:["range"]}),{name:"x",required:!0}],preInference:[...Ul()],postInference:[]};const Mu=()=>bu({extendX:!0});function Ou(t){return t.target.depth}function ku(t,e){return t.sourceLinks.length?t.depth:e-1}function _u(t){return function(){return t}}function Eu(t,e){return Au(t.source,e.source)||t.index-e.index}function Su(t,e){return Au(t.target,e.target)||t.index-e.index}function Au(t,e){return t.y0-e.y0}function Lu(t){return t.value}function Tu(t){return t.index}function ju(t){return t.nodes}function Nu(t){return t.links}function Pu(t,e){t=t.get(e);if(t)return t;throw new Error("missing: "+e)}function Cu({nodes:t}){for(const n of t){let t=n.y0,e=t;for(const r of n.sourceLinks)r.y0=t+r.width/2,t+=r.width;for(const i of n.targetLinks)i.y1=e+i.width/2,e+=i.width}}function Ru(){let x=0,w=0,M=1,O=1,k=24,_=8,E,S=Tu,A=ku,L,T,j,N=ju,P=Nu,C=6;function e(e){e={nodes:N(e),links:P(e)};{var{nodes:i,links:t}=e;i.forEach((t,e)=>{t.index=e,t.sourceLinks=[],t.targetLinks=[]});const g=new Map(i.map(t=>[S(t),t]));if(t.forEach((t,e)=>{t.index=e;let{source:n,target:r}=t;"object"!=typeof n&&(n=t.source=Pu(g,n)),"object"!=typeof r&&(r=t.target=Pu(g,r)),n.sourceLinks.push(t),r.targetLinks.push(t)}),null!=j)for(var{sourceLinks:n,targetLinks:r}of i)n.sort(j),r.sort(j)}t=e.nodes;for(const m of t)m.value=void 0===m.fixedValue?Math.max($c(m.sourceLinks,Lu),$c(m.targetLinks,Lu)):m.fixedValue;{var a=e.nodes,o=a.length;let t=new Set(a),n=new Set,r=0;for(;t.size;){if(t.forEach(t=>{t.depth=r;for(var{target:e}of t.sourceLinks)n.add(e)}),++r>o)throw new Error("circular link");t=n,n=new Set}if(L){var s,l=Math.max(Rc(a,t=>t.depth)+1,0);for(let t=0;t{t.height=r;for(var{source:e}of t.targetLinks)n.add(e)}),++r>c)throw new Error("circular link");t=n,n=new Set}}var u=function({nodes:t}){var e=Math.max(Rc(t,t=>t.depth)+1,0),n=(M-x-k)/(e-1),r=new Array(e).fill(0).map(()=>[]);for(const a of t){var i=Math.max(0,Math.min(e-1,Math.floor(A.call(null,a,e))));a.layer=i,a.x0=x+i*n,a.x1=a.x0+k,r[i]?r[i].push(a):r[i]=[a]}if(T)for(const o of r)o.sort(T);return r}(e),t=(E=Math.min(_,(O-w)/(Rc(u,t=>t.length)-1)),u),f=Bc(t,t=>(O-w-(t.length-1)*E)/$c(t,Lu));for(const y of t){let e=w;for(const v of y){v.y0=e,v.y1=e+v.value*f,e=v.y1+E;for(const b of v.sourceLinks)b.width=b.value*f}e=(O-e+E)/(y.length+1);for(let t=0;t>1,r=t[n];a(t,r.y0-E,n-1,e),i(t,r.y1+E,1+n,e),a(t,O,t.length-1,e),i(t,w,0,e)}function i(t,e,n,r){for(;nt.nodes,links:t=>t.links,nodeSort:void 0,linkSort:void 0,iterations:6},Bu={left:function(t){return t.depth},right:function(t,e){return e-1-t.height},center:function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?Bc(t.sourceLinks,Ou)-1:0},justify:ku};const Fu=f=>t=>{var{nodeId:e,nodeSort:n,nodeAlign:r,nodeWidth:i,nodePadding:a,nodeDepth:o,nodes:s,links:l,linkSort:c,iterations:u}=Object.assign({},Iu,f),l=Ru().nodeSort(n).linkSort(c).links(l).nodes(s).nodeWidth(i).nodePadding(a).nodeDepth(o).nodeAlign("string"==(c=typeof(n=r))?Bu[n]||ku:"function"==c?n:ku).iterations(u).extent([[0,0],[1,1]]),s=("function"==typeof e&&l.nodeId(e),l(t)),{nodes:i,links:a}=s;return{nodes:i.map(t=>{var{x0:e,x1:n,y0:r,y1:i}=t;return Object.assign(Object.assign({},t),{x:[e,n,n,e],y:[r,r,i,i]})}),links:a.map(t=>{var{source:e,target:n}=t,e=e.x1,n=n.x0,r=t.width/2;return Object.assign(Object.assign({},t),{x:[e,e,n,n],y:[t.y0+r,t.y0-r,t.y1+r,t.y1-r]})})}};function Du(t){return t}function zu(t){return t.replace(/( |^)[a-z]/g,t=>t.toUpperCase())}function Wu(t=""){throw new Error(t)}function Gu(t,e){var n,r,e=e["attributes"],i=new Set(["id","className"]);for([n,r]of Object.entries(e))i.has(n)||t.attr(n,r)}function qu(t){return null!=t&&!Number.isNaN(t)}function at(t,e){return Hu(t,e)||{}}function Hu(t,n){t=Object.entries(t||{}).filter(([t])=>t.startsWith(n)).map(([t,e])=>[Xe(t.replace(n,"").trim()),e]).filter(([t])=>!!t);return 0===t.length?null:Object.fromEntries(t)}function Vu(t,...n){return Object.fromEntries(Object.entries(t).filter(([e])=>n.every(t=>!e.startsWith(t))))}function Yu(t,e){return void 0===t?null:"number"==typeof t?t:(t=+t.replace("%",""),Number.isNaN(t)?null:t/100*e)}function $u(t){return!("object"!=typeof t||t instanceof Date||null===t||Array.isArray(t))}function Uu(t){return null===t||!1===t}function Ku(t,e,n={},r=!1){return Uu(t)||Array.isArray(t)&&r?t:(r=at(t,e),it(n,r))}function Xu(t,e={}){return!Uu(t)&&!Array.isArray(t)&&Zu(t)?it(e,t):t}function Zu(t){var e;return 0===Object.keys(t).length||({title:t,items:e}=t,void 0!==t)||void 0!==e}function Qu(t,e){return"object"==typeof t?at(t,e):t}Fu.props={};const Ju=v=>{const b={nodeId:t=>t.key,nodeWidth:.02,nodePadding:.02},x={type:"polygon",axis:!1,legend:!1,encode:{shape:"polygon",x:"x",y:"y"},scale:{x:{type:"identity"},y:{type:"identity"}},style:{stroke:"#000"}},w={type:"polygon",axis:!1,legend:!1,encode:{shape:"ribbon",x:"x",y:"y"},style:{fillOpacity:.5,stroke:void 0}},M={textAlign:t=>t.x[0]<.5?"start":"end",position:t=>t.x[0]<.5?"right":"left",fontSize:10};return()=>{var{data:t,encode:e={},scale:n,style:r={},layout:i={},nodeLabels:a=[],linkLabels:o=[],animate:s={},tooltip:l={}}=v,{links:t,nodes:c}=ec(t,e),u=at(e,"node"),e=at(e,"link"),{key:f=t=>t.key,color:h=f}=u,{links:i,nodes:t}=Fu(Object.assign(Object.assign(Object.assign({},b),{nodeId:Jl(f)}),i))({links:t,nodes:c});const d=at(r,"label"),{text:p=f,spacing:g=5}=d,m=rt(d,["text","spacing"]),y=Jl(f);c=Ku(l,"node",{title:y,items:[{field:"value"}]},!0),f=Ku(l,"link",{title:"",items:[t=>({name:"source",value:y(t.source)}),t=>({name:"target",value:y(t.target)})]});return[it({},x,{data:t,encode:Object.assign(Object.assign({},u),{color:h}),scale:n,style:at(r,"node"),labels:[Object.assign(Object.assign(Object.assign({},M),{text:p,dx:t=>t.x[0]<.5?g:-g}),m),...a],tooltip:c,animate:Qu(s,"node"),axis:!1}),it({},w,{data:i,encode:e,labels:o,style:Object.assign({fill:e.color?void 0:"#aaa",strokeWidth:0},at(r,"link")),tooltip:f,animate:Qu(s,"link")})]}},tf=(Ju.props={},t=>(t,e,n,r)=>[t,t.map(()=>[[0,0]])]);tf.props={defaultShape:"path",defaultLabelShape:"label",composite:!1,channels:[...Hl({shapes:["path","hollow"]}),{name:"d",scale:"identity"}],preInference:[...Ul()],postInference:[]};const ef=t=>t?parseInt(t):0;function nf(t){var{height:t,width:e,padding:n=0,paddingLeft:r=n,paddingRight:i=n,paddingTop:a=n,paddingBottom:n=n,margin:o=0,marginLeft:s=o,marginRight:l=o,marginTop:c=o,marginBottom:o=o,inset:u=0,insetLeft:f=u,insetRight:h=u,insetTop:d=u,insetBottom:u=u}=t,p=t=>"auto"===t?30:t;return{width:e-p(r)-p(i)-s-l-f-h,height:t-p(a)-p(n)-c-o-d-u}}function rf(t,e,n){const r=n["value"];var o,i,a,s,l,c,u,f,h,d,n=function(t,e){var n={treemapBinary:zl,treemapDice:Ml,treemapSlice:Il,treemapSliceDice:Wl,treemapSquarify:Dl,treemapResquarify:Gl};if(e="treemapSquarify"===t?n[t].ratio(e):n[t])return e;throw new TypeError("Invalid tile method!")}(e.tile,e.ratio),p=(t=t,p=e.path,(Array.isArray(t)?"function"==typeof p?Al().path(p):Al():Us)(t));function g(t){return t.x0=t.y0=0,t.x1=a,t.y1=s,t.eachBefore(m),l=[0],i&&t.eachBefore(wl),t}function m(t){var e=l[t.depth],n=t.x0+e,r=t.y0+e,i=t.x1-e,a=t.y1-e;ie.ignoreParentValue&&t.children?0:Jl(r)(t)).sort(e.sort):p.count(),o=Dl,i=!1,s=a=1,l=[0],d=h=f=u=c=nl,g.round=function(t){return arguments.length?(i=!!t,g):i},g.size=function(t){return arguments.length?(a=+t[0],s=+t[1],g):[a,s]},g.tile=function(t){return arguments.length?(o=el(t),g):o},g.padding=function(t){return arguments.length?g.paddingInner(t).paddingOuter(t):g.paddingInner()},g.paddingInner=function(t){return arguments.length?(c="function"==typeof t?t:rl(+t),g):c},g.paddingOuter=function(t){return arguments.length?g.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):g.paddingTop()},g.paddingTop=function(t){return arguments.length?(u="function"==typeof t?t:rl(+t),g):u},g.paddingRight=function(t){return arguments.length?(f="function"==typeof t?t:rl(+t),g):f},g.paddingBottom=function(t){return arguments.length?(h="function"==typeof t?t:rl(+t),g):h},g.paddingLeft=function(t){return arguments.length?(d="function"==typeof t?t:rl(+t),g):d},g.tile(n).size(e.size).round(e.round).paddingInner(e.paddingInner).paddingOuter(e.paddingOuter).paddingTop(e.paddingTop).paddingRight(e.paddingRight).paddingBottom(e.paddingBottom).paddingLeft(e.paddingLeft)(p),p.descendants().map(t=>Object.assign(t,{x:[t.x0,t.x1],y:[t.y0,t.y1]})).filter("function"==typeof e.layer?e.layer:t=>t.height===e.layer)}const af=f=>t=>{var{width:t,height:e}=nf(t),{data:n,encode:r={},scale:i,style:a={},layout:o={},labels:s=[],tooltip:l={}}=f,c=rt(f,["data","encode","scale","style","layout","labels","tooltip"]),u={tile:"treemapSquarify",ratio:.5*(1+Math.sqrt(5)),size:[t,e],round:!1,ignoreParentValue:!0,padding:0,paddingInner:0,paddingOuter:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,sort:(t,e)=>e.value-t.value,layer:0},t={type:"rect",axis:!1,encode:{x:"x",y:"y",color:t=>t.data.parent.name},scale:{x:{domain:[0,t],range:[0,1]},y:{domain:[0,e],range:[0,1]}},style:{stroke:"#fff"}},e=rf(n,it({},u,o),r),n=at(a,"label");return[it({},t,Object.assign(Object.assign({data:e,encode:r,scale:i,style:a,labels:[Object.assign(Object.assign({},{fontSize:10,text:t=>t.data.name,position:"inside",fill:"#000",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>t.x1-t.x0}),n),...s]},c),{tooltip:Xu(l,{title:t=>t.data.name,items:[{field:"value"}]}),axis:!1}))]},of=(af.props={},f=>t=>{var{width:t,height:e}=nf(t),{data:n,encode:r={},scale:i={},style:a={},layout:o={},labels:s=[],tooltip:l={}}=f,c=rt(f,["data","encode","scale","style","layout","labels","tooltip"]),u={type:"point",axis:!1,legend:!1,scale:{x:{domain:[0,t]},y:{domain:[0,e]},size:{type:"identity"}},encode:{x:"x",y:"y",size:"r",shape:"point"},style:{fill:r.color?void 0:t=>0===t.height?"#ddd":"#fff",stroke:r.color?void 0:t=>0===t.height?"":"#000"}},n=((t,e,n)=>{const r=n["value"];n=(De(t)?Al().path(e.path):Us)(t);return r?n.sum(t=>Jl(r)(t)).sort(e.sort):n.count(),yl().size(e.size).padding(e.padding)(n),n.descendants()})(n,it({},{size:[t,e],padding:0,sort:(t,e)=>e.value-t.value},o),it({},u.encode,r)),t=at(a,"label");return[it({},u,Object.assign(Object.assign({data:n,encode:r,scale:i,style:a,labels:[Object.assign(Object.assign({},{text:"",position:"inside",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>2*t.r}),t),...s]},c),{tooltip:Xu(l,{title:t=>t.data.name,items:[{field:"value"}]}),axis:!1}))]});function sf(t,e){return Bc(t,t=>e[t])}function lf(t,e){return Rc(t,t=>e[t])}function cf(t,e){const n=2.5*uf(t,e)-1.5*hf(t,e);return Bc(t,t=>e[t]>=n?e[t]:NaN)}function uf(t,e){return Wc(t,.25,t=>e[t])}function ff(t,e){return Wc(t,.5,t=>e[t])}function hf(t,e){return Wc(t,.75,t=>e[t])}function df(t,e){const n=2.5*hf(t,e)-1.5*uf(t,e);return Rc(t,t=>e[t]<=n?e[t]:NaN)}function pf(){return(t,e)=>{var n=e["encode"],{y:n,x:r}=n;const i=n["value"],a=r["value"];return[Array.from(bc(t,t=>a[+t]).values()).flatMap(t=>{const e=cf(t,i),n=df(t,i);return t.filter(t=>i[t]n)}),e]}}of.props={};const gf=f=>()=>{var t,{data:e,encode:n,style:r={},tooltip:i={},animate:a}=f,o=rt(f,["data","encode","style","tooltip","transform","animate"]),{point:s=!0}=r,r=rt(r,["point"]),l=n["y"],l={y:l,y1:l,y2:l,y3:l,y4:l},c={y1:uf,y2:ff,y3:hf},u=Ku(i,"box",{items:[{channel:"y",name:"min"},{channel:"y1",name:"q1"},{channel:"y2",name:"q2"},{channel:"y3",name:"q3"},{channel:"y4",name:"max"}]},!0),i=Ku(i,"point",{title:{channel:"x"},items:[{name:"outlier",channel:"y"}]});return s?(s=at(r,"box"),t=at(r,"point"),[Object.assign({type:"box",data:e,transform:[Object.assign(Object.assign({type:"groupX",y:cf},c),{y4:df})],encode:Object.assign(Object.assign({},n),l),style:s,tooltip:u,animate:Qu(a,"box")},o),{type:"point",data:e,transform:[{type:pf}],encode:n,style:Object.assign({},t),tooltip:i,animate:Qu(a,"point")}]):[Object.assign({type:"box",data:e,transform:[Object.assign(Object.assign({type:"groupX",y:sf},c),{y4:lf})],encode:Object.assign(Object.assign({},n),l),style:r,tooltip:u},o)]},mf=(gf.props={},s=>{var t=s["cartesian"];return t?Ql:(t,e,n,r)=>{const{x:i,y:a}=n,o=Xl(e,n,s);return[t,Array.from(t,t=>{var e=[+i[t],+a[t]];return[r.map(o(e,t))]})]}});function yf(t,e,n,r){if(!isNaN(e)&&!isNaN(n)){var i,a,o,s,l,c,u,f,h,d=t._root,p={data:r},g=t._x0,m=t._y0,y=t._x1,v=t._y1;if(d){for(;d.length;)if((c=e>=(a=(g+y)/2))?g=a:y=a,(u=n>=(o=(m+v)/2))?m=o:v=o,!(d=(i=d)[f=u<<1|c]))return i[f]=p,t;if(s=+t._x.call(null,d.data),l=+t._y.call(null,d.data),e===s&&n===l)p.next=d,i?i[f]=p:t._root=p;else{for(;i=i?i[f]=new Array(4):t._root=new Array(4),(c=e>=(a=(g+y)/2))?g=a:y=a,(u=n>=(o=(m+v)/2))?m=o:v=o,(f=u<<1|c)==(h=(o<=l)<<1|a<=s););i[h]=d,i[f]=p}}else t._root=p}return t}function vf(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function bf(t){return t[0]}function xf(t){return t[1]}function wf(t,e,n){e=new Mf(null==e?bf:e,null==n?xf:n,NaN,NaN,NaN,NaN);return null==t?e:e.addAll(t)}function Mf(t,e,n,r,i,a){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=a,this._root=void 0}function Of(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}mf.props={defaultShape:"shape",defaultLabelShape:"label",composite:!1,channels:[{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Ul(),{type:"maybeTuple"},{type:"maybeVisualPosition"},{type:"maybeFunctionAttribute"}]};ho=wf.prototype=Mf.prototype;function kf(t){return function(){return t}}function _f(t){return 1e-6*(t()-.5)}function Ef(t){return t.index}function Sf(t,e){t=t.get(e);if(t)return t;throw new Error("node not found: "+e)}function Af(c){var u,f,a,o,h,d,s=Ef,n=function(t){return 1/Math.min(o[t.source.index],o[t.target.index])},r=kf(30),p=1;function e(t){for(var e=0,n=c.length;e[s(t,e,a),t])),i=0;for(o=new Array(e);id||(l=r.y0)>p||(o=r.x1)=(s=(d+g)/2))?d=s:g=s,(c=o>=(s=(p+m)/2))?p=s:m=s,!(h=(e=h)[u=c<<1|l]))return this;if(!h.length)break;(e[u+1&3]||e[u+2&3]||e[u+3&3])&&(n=e,f=u)}for(;h.data!==t;)if(!(h=(r=h).next))return this;(i=h.next)&&delete h.next,r?i?r.next=i:delete r.next:e?(i?e[u]=i:delete e[u],(h=e[0]||e[1]||e[2]||e[3])&&h===(e[3]||e[2]||e[1]||e[0])&&!h.length&&(n?n[f]=h:this._root=h)):this._root=i}}return this},ho.removeAll=function(t){for(var e=0,n=t.length;e{}};function Tf(){for(var t,e=0,n=arguments.length,r={};ei._time&&(a=i._time),(n=i)._next):(r=i._next,i._next=null,n?n._next=r:Pf=r);Cf=n,Xf(a),zf=0}}function Kf(){var t=Gf.now(),e=t-Df;Ff(t=(1664525*t+1013904223)%Zf)/Zf}();function i(){h(),n.call("tick",a),ot.id}=n,I=(r=kf(-30),d=(h=1)/0,p=.81,g.initialize=function(t,e){i=t,c=e,B()},g.strength=function(t){return arguments.length?(r="function"==typeof t?t:kf(+t),B(),g):r},g.distanceMin=function(t){return arguments.length?(h=t*t,g):Math.sqrt(h)},g.distanceMax=function(t){return arguments.length?(d=t*t,g):Math.sqrt(d)},g.theta=function(t){return arguments.length?(p=t*t,g):Math.sqrt(p)},g);function g(t){var e,n=i.length,r=wf(i,Qf,Jf).visitAfter(F);for(u=t,e=0;e()=>{var{data:t,encode:e={},scale:n,style:r={},layout:i={},nodeLabels:a=[],linkLabels:o=[],animate:s={},tooltip:l={}}=g;const{nodeKey:c=t=>t.id,linkKey:u=t=>t.id}=e,f=rt(e,["nodeKey","linkKey"]);var e=Object.assign({nodeKey:c,linkKey:u},f),h=at(e,"node"),d=at(e,"link"),{links:t,nodes:p}=ec(t,e),{nodesData:t,linksData:p}=rh({links:t,nodes:p},it({},{joint:!0},i),e),i=Ku(l,"link",{items:[t=>({name:"source",value:Jl(u)(t.source)}),t=>({name:"target",value:Jl(u)(t.target)})]}),e=Ku(l,"node",{items:[t=>({name:"key",value:Jl(c)(t)})]},!0);return[it({},{type:"link",axis:!1,legend:!1,encode:{x:[t=>t.source.x,t=>t.target.x],y:[t=>t.source.y,t=>t.target.y]},style:{stroke:"#999",strokeOpacity:.6}},{data:p,encode:d,labels:o,style:at(r,"link"),tooltip:i,animate:Qu(s,"link")}),it({},{type:"point",axis:!1,legend:!1,encode:{x:"x",y:"y",size:5,color:"group",shape:"point"},scale:{color:{type:"ordinal"}},style:{stroke:"#fff"}},{data:t,encode:Object.assign({},h),scale:n,style:at(r,"node"),tooltip:e,labels:[Object.assign(Object.assign({},{text:""}),at(r,"label")),...a],animate:Qu(s,"link")})]},ah=(ih.props={},f=>u=>t=>{const{field:e="value",nodeSize:n,separation:r,sortBy:i,as:a=["x","y"]}=u,[o,s]=a;var t=Us(t,t=>t.children).sum(t=>t[e]).sort(i),l=f();l.size([1,1]),n&&l.nodeSize(n),r&&l.separation(r),l(t);const c=[];t.each(t=>{t[o]=t.x,t[s]=t.y,t.name=t.data.name,c.push(t)});l=t.links();return l.forEach(t=>{t[o]=[t.source[o],t.target[o]],t[s]=[t.source[s],t.target[s]]}),{nodes:c,edges:l}}),oh=t=>ah(Ys)(t),sh=(oh.props={},t=>ah(Rl)(t)),lh=(sh.props={},u=>{const f={sortBy:(t,e)=>e.value-t.value},h={axis:!1,legend:!1,type:"point",encode:{x:"x",y:"y",size:2,shape:"point"}},d={type:"link",encode:{x:"x",y:"y",shape:"smooth"}},p={text:"",fontSize:10};return()=>{var{data:t,encode:e={},scale:n={},style:r={},layout:i={},nodeLabels:a=[],linkLabels:o=[],animate:s={},tooltip:l={}}=u,c=null==e?void 0:e.value,{nodes:i,edges:c}=sh(Object.assign(Object.assign(Object.assign({},f),i),{field:c}))(t),t=Ku(l,"node",{title:"name",items:["value"]},!0),l=Ku(l,"link",{title:"",items:[t=>({name:"source",value:t.source.name}),t=>({name:"target",value:t.target.name})]});return[it({},d,{data:c,encode:at(e,"link"),scale:at(n,"link"),labels:o,style:Object.assign({stroke:"#999"},at(r,"link")),tooltip:l,animate:Qu(s,"link")}),it({},h,{data:i,scale:at(n,"node"),encode:at(e,"node"),labels:[Object.assign(Object.assign({},p),at(r,"label")),...a],style:Object.assign({},at(r,"node")),tooltip:t,animate:Qu(s,"node")})]}});lh.props={};var ch={},uh={},fh=34,hh=10,dh=13;function ph(t){return new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'}).join(",")+"}")}function gh(t){var n=Object.create(null),r=[];return t.forEach(function(t){for(var e in t)e in n||r.push(n[e]=e)}),r}function mh(t,e){var t=t+"",n=t.length;return n=i?s=!0:(e=r.charCodeAt(a++))===hh?l=!0:e===dh&&(l=!0,r.charCodeAt(a)===hh)&&++a,r.slice(n+1,t-1).replace(/""/g,'"')}for(;a{const{value:n,format:r=n.split(".").pop(),delimiter:i=",",autoType:a=!0}=t;return()=>ue(void 0,void 0,void 0,function*(){var t,e=yield fetch(n);if("csv"===r)return t=yield e.text(),vh(i).parse(t,a?bh:Du);if("json"===r)return yield e.json();throw new Error(`Unknown format: ${r}.`)})};wh.props={};const Mh=t=>{const{fields:n,key:r="key",value:i="value"}=t;return t=>{var e;return(e=n)&&0!==Object.keys(e).length?t.flatMap(e=>n.map(t=>Object.assign(Object.assign({},e),{[r]:t,[i]:e[t]}))):t}};Mh.props={};const Oh=t=>{const{callback:e=function(t){return null!=t&&!Number.isNaN(t)}}=t;return t=>t.filter(e)},kh=(Oh.props={},t=>{const e=t["callback"];return t=>Array.isArray(t)?[...t].sort(e):t});kh.props={};const _h=t=>{const e=t["fields"];return t=>t.map(t=>{return[n,t=[]]=[t,e],t.reduce((t,e)=>(e in n&&(t[e]=n[e]),t),{});var n})};_h.props={};const Eh=r=>t=>{return r&&0!==Object.keys(r).length?t.map(t=>Object.entries(t).reduce((t,[e,n])=>(t[r[e]||e]=n,t),{})):t};Eh.props={};const Sh=t=>{var r,{fields:t=[]}=t;r=!0;const e=t.map(t=>{var e,n;return Array.isArray(t)?([e,n=r]=t,[e,n]):[t,r]});return t=>{return[...t].sort((r,i)=>e.reduce((t,[e,n=!0])=>0!==t?t:n?r[e]i[e]?-1:+(r[e]!==i[e]),0))}},Ah=(Sh.props={},t=>{const e=t["value"];return()=>e}),Lh=(Ah.props={},t=>{const{callback:e=Du}=t;return t=>e(t)}),Th=(Lh.props={},t=>{const{callback:e=Du}=t;return t=>Array.isArray(t)?t.map(e):t});Th.props={};var jh=Object.freeze({__proto__:null,weight:function(t,e){return e.value-t.value},frequency:function(t,e){return e.frequency-t.frequency},id:function(t,e){return(""+t.id).localeCompare(""+e.id)},name:function(t,e){return(""+t.name).localeCompare(""+e.name)}});const Nh={y:0,thickness:.05,weight:!1,marginRatio:.1,id:t=>t.id,source:t=>t.source,target:t=>t.target,sourceWeight:t=>t.value||1,targetWeight:t=>t.value||1,sortBy:null};function Ph(t){const{y:c,thickness:u,weight:f,marginRatio:h,id:d,source:p,target:g,sourceWeight:m,targetWeight:y,sortBy:v}=Object.assign(Object.assign({},Nh),t);return function(t){var e=t.nodes.map(t=>Object.assign({},t)),t=t.edges.map(t=>Object.assign({},t));{var n=e,r=t;r.forEach(t=>{t.source=p(t),t.target=g(t),t.sourceWeight=m(t),t.targetWeight=y(t)});const i=bc(r,t=>t.source),a=bc(r,t=>t.target);n.forEach(t=>{t.id=d(t);var e=i.has(t.id)?i.get(t.id):[],n=a.has(t.id)?a.get(t.id):[];t.frequency=e.length+n.length,t.value=$c(e,t=>t.sourceWeight)+$c(n,t=>t.targetWeight)})}if(r=e,(n="function"==typeof v?v:jh[v])&&r.sort(n),!(n=(r=e).length))throw Wu("Invalid nodes: it's empty!");if(f){const o=h/(2*n),s=r.reduce((t,e)=>t+e.value,0);r.reduce((t,e)=>{e.weight=e.value/s,e.width=e.weight*(1-h),e.height=u;var n=o+t,r=n+e.width,i=c-u/2,a=i+u;return e.x=[n,r,r,n],e.y=[i,i,a,a],t+e.width+2*o},0)}else{const l=1/n;r.forEach((t,e)=>{t.x=(e+.5)*l,t.y=c})}return function(t,e){const r=new Map(t.map(t=>[t.id,t]));if(!f)return e.forEach(t=>{var e=p(t),n=g(t),e=r.get(e),n=r.get(n);e&&n&&(t.x=[e.x,n.x],t.y=[e.y,n.y])});e.forEach(t=>{t.x=[0,0,0,0],t.y=[c,c,c,c]});const s=bc(e,t=>t.source),l=bc(e,t=>t.target);t.forEach(n=>{const{width:r,value:i,id:t}=n;var e=s.get(t)||[],a=l.get(t)||[];let o=0;e.map(t=>{var e=t.sourceWeight/i*r;t.x[0]=n.x[0]+o,t.x[1]=n.x[0]+o+e,o+=e}),a.forEach(t=>{var e=t.targetWeight/i*r;t.x[3]=n.x[0]+o,t.x[2]=n.x[0]+o+e,o+=e})})}(e,t),{nodes:e,edges:t}}}const Ch=e=>t=>Ph(e)(t),Rh=(Ch.props={},Math.PI/180),Ih=64,Bh=2048;function Fh(t){return t.text}function Dh(){return"serif"}function zh(){return"normal"}function Wh(t){return t.value}function Gh(){return 90*~~(2*Math.random())}function qh(){return 1}function Hh(){}function Vh(t,o,r,s){if(!o.sprite){var l=t.context,c=t.ratio;l.clearRect(0,0,(Ih<<5)/c,Bh/c);let i=0,a=0,n=0;var u,f,h,d,e=r.length;for(--s;++s>5<<5,e=~~Math.max(Math.abs(f+h),Math.abs(f-h))):t=t+31>>5<<5,e>n&&(n=e),i+t>=Ih<<5&&(i=0,a+=n,n=0),a+e>=Bh)break;l.translate((i+(t>>1))/c,(a+(e>>1))/c),o.rotate&&l.rotate(o.rotate*Rh),l.fillText(o.text,0,0),o.padding&&(l.lineWidth=2*o.padding,l.strokeText(o.text,0,0)),l.restore(),o.width=t,o.height=e,o.xoff=i,o.yoff=a,o.x1=t>>1,o.y1=e>>1,o.x0=-o.x1,o.y0=-o.y1,o.hasText=!0,i+=t}for(var p=l.getImageData(0,0,(Ih<<5)/c,Bh/c).data,g=[];0<=--s;)if((o=r[s]).hasText){var m=o.width,y=m>>5;let n=o.y1-o.y0;for(let t=0;t>5),b=p[(a+e)*(Ih<<5)+(i+t)<<2]?1<<31-t%32:0;g[v]|=b,r|=b}r?t=e:(o.y0++,n--,e--,a++)}o.y1=o.y0+t,o.sprite=g.slice(0,(o.y1-o.y0)*y)}}}function Yh(t){const e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function $h(t){var e=[];let n=-1;for(;++n>2),t.width=(Ih<<5)/e,t.height=Bh/e,(t=t.getContext("2d")).fillStyle=t.strokeStyle="red",t.textAlign="center",{context:t,ratio:e}),l=S.board||$h((b[0]>>5)*b[1]),c=M.length,u=[],f=M.map(function(t,e,n){return t.text=r.call(this,t,e,n),t.font=i.call(this,t,e,n),t.style=_.call(this,t,e,n),t.weight=g.call(this,t,e,n),t.rotate=m.call(this,t,e,n),t.size=~~p.call(this,t,e,n),t.padding=y.call(this,t,e,n),t}).sort(function(t,e){return e.size-t.size});var t,e;let h=-1,d=S.board?[{x:0,y:0},{x:a,y:o}]:void 0;function n(){for(var t,e,n,r=Date.now();Date.now()-r>1,i.y=o*(w()+.5)>>1,Vh(s,i,f,h),i.hasText&&function(i,t,e){var n=t.x,r=t.y,a=Math.sqrt(b[0]*b[0]+b[1]*b[1]),o=x(b),s=w()<.5?1:-1;let l,c=-s,u,f;for(;(l=o(c+=s))&&(u=~~l[0],f=~~l[1],!(Math.min(Math.abs(u),Math.abs(f))>=a));)if(t.x=n+u,t.y=r+f,!(t.x+t.x0<0||t.y+t.y0<0||t.x+t.x1>b[0]||t.y+t.y1>b[1])&&(!e||!function(t,n,r){var i=t.sprite,a=t.width>>5,e=t.x-(a<<4),o=127&e,s=32-o,l=t.y1-t.y0;let c=(t.y+t.y0)*(r>>=5)+(e>>5),u;for(let e=0;e>>o:0))&n[c+t])return 1;c+=r}}(t,i,b[0]))&&(!e||function(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0e[0].y&&t.y+t.y0>5,p=b[0]>>5,g=t.x-(d<<4),m=127&g,y=32-m,v=t.y1-t.y0;let n,r=(t.y+t.y0)*p+(g>>5);for(let e=0;e>>m:0);r+=p}return delete t.sprite,1}return}(l,i,d)&&(v.call(null,"word",{cloud:S,word:i}),u.push(i),d?S.hasImage||(t=d,e=i,n=void 0,n=t[0],t=t[1],e.x+e.x0t.x&&(t.x=e.x+e.x1),e.y+e.y1>t.y&&(t.y=e.y+e.y1)):d=[{x:i.x+i.x0,y:i.y+i.y0},{x:i.x+i.x1,y:i.y+i.y1}],i.x-=b[0]>>1,i.y-=b[1]>>1)}S._tags=u,S._bounds=d,h>=c&&(S.stop(),v.call(null,"end",{cloud:S,words:u,bounds:d}))}return O&&clearInterval(O),O=setInterval(n,0),n(),S},S.stop=function(){return O&&(clearInterval(O),O=null),S},S.createMask=t=>{var e=document.createElement("canvas"),[n,r]=b;if(n&&r){var i=n>>5,a=$h((n>>5)*r),e=(e.width=n,e.height=r,e.getContext("2d")),o=(e.drawImage(t,0,0,t.width,t.height,0,0,n,r),e.getImageData(0,0,n,r).data);for(let e=0;e>5),l=e*n+t<<2,l=250<=o[l]&&250<=o[1+l]&&250<=o[2+l]?1<<31-t%32:0;a[s]|=l}S.board=a,S.hasImage=!0}},S.timeInterval=function(t){k=null==t?1/0:t},S.words=function(t){M=t},S.size=function(t=[]){b=[+t[0],+t[1]]},S.text=function(t){r=Kh(t)},S.font=function(t){i=Kh(t)},S.fontWeight=function(t){g=Kh(t)},S.rotate=function(t){m=Kh(t)},S.spiral=function(t){x=Xh[t]||t},S.fontSize=function(t){p=Kh(t)},S.padding=function(t){y=Kh(t)},S.random=function(t){w=Kh(t)},S.on=function(t){v=Kh(t)},S}const Qh={size:[500,500],fontSize:[14,28]};function Jh(r){return new Promise((t,e)=>{if(r instanceof HTMLImageElement)t(r);else if("string"==typeof r){const n=new Image;n.crossOrigin="anonymous",n.src=r,n.onload=()=>t(n),void(n.onerror=()=>{console.error(`'image ${r} load failed !!!'`),e()})}else e()})}const td=h=>f=>ue(void 0,void 0,void 0,function*(){var i,a,t=Object.assign({},Qh,h),e=Zh(),e=(i=e,a=t,yield{set(t,e,n){return void 0!==a[t]&&(e=e?e.call(null,a[t]):a[t],n?n.call(null,e):"function"==typeof i[t]?i[t](e):i[t]=e),this},setAsync(e,n,r){return ue(this,void 0,void 0,function*(){var t;return void 0!==a[e]&&(t=n?yield n.call(null,a[e]):a[e],r?r.call(null,t):"function"==typeof i[e]?i[e](t):i[e]=t),this})}}.set("fontSize",t=>{var e=f.map(t=>t.value),n=t,t=[Bc(e),Rc(e)];if("function"==typeof n)return n;if(Array.isArray(n)){const[r,i]=n;if(!t)return()=>(i+r)/2;const[a,o]=t;return o===a?()=>(i+r)/2:({value:t})=>(i-r)/(o-a)*(t-a)+r}return()=>n}).set("font").set("fontStyle").set("fontWeight").set("padding").set("rotate").set("size").set("spiral").set("timeInterval").set("random").set("text").set("on").setAsync("imageMask",Jh,e.createMask),e.words([...f]),e.start());const[r,o]=t.size;var t=[{x:0,y:0},{x:r,y:o}],{_bounds:e=t,_tags:t,hasImage:n}=e,t=t.map(t=>{var{x:e,y:n}=t,t=rt(t,["x","y"]);return Object.assign(Object.assign({},t),{x:e+r/2,y:n+o/2})}),[{x:e,y:s},{x:l,y:c}]=e,u={text:"",value:0,opacity:0,fontSize:0};return t.push(Object.assign(Object.assign({},u),{x:n?0:e,y:n?0:s}),Object.assign(Object.assign({},u),{x:n?r:l,y:n?o:c})),t});function ed(e){return"string"==typeof e?t=>t[e]:e}td.props={};const nd=t=>{const{join:e,on:n,select:i=[],as:a=i,unknown:o=NaN}=t;var[t,r]=n;const s=ed(r),l=ed(t),c=xc(e,([t])=>t,t=>s(t));return t=>t.map(t=>{const r=c.get(l(t));return Object.assign(Object.assign({},t),i.reduce((t,e,n)=>(t[a[n]]=r?r[e]:o,t),{}))})},rd=(nd.props={},t=>{const{start:e,end:n}=t;return t=>t.slice(e,n)});rd.props={};var id,ad,od,sd,yo={exports:{}},r={exports:{}};function ld(t){return 1-Math.abs(t)}id=(n=r).exports,n.exports.isNumber=function(t){return"number"==typeof t},n.exports.findMin=function(t){if(0===t.length)return 1/0;for(var e=t[0],n=1;n{const{field:r,groupBy:n,as:e=["y","size"],min:i,max:a,size:o=10,width:s}=t,[l,c]=e;return t=>{return Array.from(bc(t,e=>n.map(t=>e[t]).join("-")).values()).map(t=>{var e=cd.create(t.map(t=>t[r]),{min:i,max:a,size:o,width:s}),n=e.map(t=>t.x),e=e.map(t=>t.y);return Object.assign(Object.assign({},t[0]),{[l]:n,[c]:e})})}};ud.props={};var fd={exports:{}};function hd(t){for(var e=new Array(t),n=0;n=p[d-1].fx){var E=!1;if(x.fx>_.fx?(md(w,1+f,b,-f,_),w.fx=t(w),w.fx<_.fx?y(w):E=!0):(md(w,1-f*c,b,f*c,_),w.fx=t(w),w.fxn[t].radius+vd)return!1;return!0});let o=0,s=0,l;var c=[];if(12*d.radius&&(e=2*d.radius),(null===r||r.width>e)&&(r={circle:d,width:e,p1:f,p2:i})}null!==r&&(c.push(r),o+=xd(r.circle.radius,r.width),i=f)}}else{let t=a[0];for(l=1;lMath.abs(t.radius-a[l].radius)){e=!0;break}e?o=s=0:(o=t.radius*t.radius*Math.PI,c.push({circle:t,p1:{x:t.x,y:t.y+t.radius},p2:{x:t.x-vd,y:t.y+t.radius},width:2*t.radius}))}return s/=2,t&&(t.area=o+s,t.arcArea=o,t.polygonArea=s,t.arcs=c,t.innerPoints=n,t.intersectionPoints=e),o+s}function xd(t,e){return t*t*Math.acos(1-e/t)-(t-e)*Math.sqrt(e*(2*t-e))}function wd(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))}function Md(t,e,n){var r;return t+e<=n?0:n<=Math.abs(t-e)?Math.PI*Math.min(t,e)*Math.min(t,e):(r=e-(n*n-t*t+e*e)/(2*n),xd(t,t-(n*n-e*e+t*t)/(2*n))+xd(e,r))}function Od(t,e){var n,r,i=wd(t,e),a=t.radius,o=e.radius;return a+o<=i||i<=Math.abs(a-o)?[]:(o=(a*a-o*o+i*i)/(2*i),a=Math.sqrt(a*a-o*o),n=t.x+o*(e.x-t.x)/i,o=t.y+o*(e.y-t.y)/i,[{x:n+(r=-(e.y-t.y)*(a/i)),y:o-(e=-(e.x-t.x)*(a/i))},{x:n-r,y:o+e}])}function kd(t,e){(e=e||{}).maxIterations=e.maxIterations||500;var n=e.initialLayout||Sd;const i=e.lossFunction||Ad,a=n(t=function(t){t=t.slice();var e=[],n={};let r,i,a,o;for(r=0;re=Math.min(a[l].size,a[c].size)&&(t=0),o[l].push({set:c,size:n.size,weight:t}),o[c].push({set:l,size:n.size,weight:t})}var u=[];for(s in o)if(o.hasOwnProperty(s)){let e=0;for(let t=0;t=Math.min(a[e].size,a[n].size)?i=1:t.size<=1e-10&&(i=-1),l[e][n]=l[n][e]=i}),{distances:s,constraints:l}}(t,r,i);let m=s.distances;function l(t,r){{var i=t,a=r,o=m,s=y;let e=0,n;for(n=0;n{const{sets:e="sets",size:n="size",as:r=["key","path"],padding:o=0}=t,[s,l]=r;return t=>{t=t.map(t=>Object.assign(Object.assign({},t),{sets:t[e],size:t[n],[s]:t.sets.join("&")}));t.sort((t,e)=>t.sets.length-e.sets.length);const i=kd(t);let a;return t.map(t=>{const r=t[e];return Object.assign(Object.assign({},t),{[l]:({width:t,height:e})=>{a=a||function(t,e,n,r){var i=[],a=[];for(const g in t)t.hasOwnProperty(g)&&(a.push(g),i.push(t[g]));e-=2*r,n-=2*r;var o=(l=Ld(i)).xRange,s=l.yRange;if(o.max==o.min||s.max==s.min)return console.log("not scaling solution: zero size detected"),t;var l=e/(o.max-o.min),c=n/(s.max-s.min),u=Math.min(c,l),f=(e-(o.max-o.min)*u)/2,h=(n-(s.max-s.min)*u)/2,d={};for(let t=0;ts;a.push("\nA",s,s,0,l?1:0,1,o.p1.x,o.p1.y)}return a.join(" ")}(r.map(t=>a[t]));return/[zZ]$/.test(n)||(n+=" Z"),n}})})}};Td.props={};const jd=u=>c=>ue(void 0,void 0,void 0,function*(){var{width:t,height:e}=nf(c),{data:n,encode:r={},scale:i,style:a={},layout:o={}}=u,s=rt(u,["data","encode","scale","style","layout"]),l={size:[t,e]},t={axis:!1,type:"text",encode:{x:"x",y:"y",text:"text",rotate:"rotate",fontSize:"size"},scale:{x:{domain:[0,t],range:[0,1]},y:{domain:[0,e],range:[0,1]},fontSize:{type:"identity"},rotate:{type:"identity"}},style:{textAlign:"center"}},e=function(t,e){const{text:n="text",value:r="value"}=e;return t.map(t=>Object.assign(Object.assign({},t),{text:t[n],value:t[r]}))}(n,r),n=yield td(Object.assign(Object.assign({},l),o))(e);return[it({},t,Object.assign(Object.assign({data:n,encode:r,scale:i,style:a},s),{axis:!1}))]});function Nd(t,...e){return e.reduce((e,n)=>t=>e(n(t)),t)}function Pd(e,n){return n-e?t=>(t-e)/(n-e):t=>.5}function Cd(t,e,n,r,i){let a=n||0,o=r||t.length;for(var s=i||(t=>t);ae?o=l:a=l+1}return a}jd.props={};const Rd=Math.sqrt(50),Id=Math.sqrt(10),Bd=Math.sqrt(2);function Fd(t,e,n){e=(e-t)/Math.max(0,n),t=Math.floor(Math.log(e)/Math.LN10),n=e/10**t;return 0<=t?(n>=Rd?10:n>=Id?5:n>=Bd?2:1)*10**t:-(10**-t)/(n>=Rd?10:n>=Id?5:n>=Bd?2:1)}function Dd(t,e,n){n=Math.abs(e-t)/Math.max(0,n);let r=10**Math.floor(Math.log(n)/Math.LN10);n/=r;return n>=Rd?r*=10:n>=Id?r*=5:n>=Bd&&(r*=2),e{t=[t,e];let r=0,i=t.length-1,a=t[r],o=t[i],s;return o{let n=e;for(;n&&r(t)%e!=0;)s(t,-1),--n;return t},l=(t,e)=>{e&&i(t,e),n(t)};const c=(t,e)=>{t=new Date(+t-1);return l(t,e),s(t,e),l(t),t};return{ceil:c,floor:(t,e)=>{t=new Date(+t);return l(t,e),t},range:(t,e,n,r)=>{for(var i=[],a=Math.floor(n),o=r?c(t,n):c(t);+o<+e;s(o,a),l(o))i.push(new Date(+o));return i},duration:t}}a=Hd(1,t=>t,(t,e=1)=>{t.setTime(+t+e)},t=>t.getTime()),po=Hd(1e3,t=>{t.setMilliseconds(0)},(t,e=1)=>{t.setTime(+t+1e3*e)},t=>t.getSeconds()),go=Hd(6e4,t=>{t.setSeconds(0,0)},(t,e=1)=>{t.setTime(+t+6e4*e)},t=>t.getMinutes()),i=Hd(Wd,t=>{t.setMinutes(0,0,0)},(t,e=1)=>{t.setTime(+t+Wd*e)},t=>t.getHours()),vo=Hd(Gd,t=>{t.setHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+Gd*e)},t=>t.getDate()-1);const Vd=Hd(2592e6,t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e=1)=>{var n=t.getMonth();t.setMonth(n+e)},t=>t.getMonth());bo=Hd(qd,t=>{t.setDate(t.getDate()-t.getDay()%7),t.setHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+qd*e)},t=>{var e=Vd.floor(t),t=new Date(+t);return Math.floor((+t-+e)/qd)}),_o=Hd(31536e6,t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e=1)=>{var n=t.getFullYear();t.setFullYear(n+e)},t=>t.getFullYear());const Yd={millisecond:a,second:po,minute:go,hour:i,day:vo,week:bo,month:Vd,year:_o};Eo=Hd(1,t=>t,(t,e=1)=>{t.setTime(+t+e)},t=>t.getTime()),So=Hd(1e3,t=>{t.setUTCMilliseconds(0)},(t,e=1)=>{t.setTime(+t+1e3*e)},t=>t.getUTCSeconds()),Ao=Hd(6e4,t=>{t.setUTCSeconds(0,0)},(t,e=1)=>{t.setTime(+t+6e4*e)},t=>t.getUTCMinutes()),Lo=Hd(Wd,t=>{t.setUTCMinutes(0,0,0)},(t,e=1)=>{t.setTime(+t+Wd*e)},t=>t.getUTCHours()),To=Hd(Gd,t=>{t.setUTCHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+Gd*e)},t=>t.getUTCDate()-1);const $d=Hd(2592e6,t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e=1)=>{var n=t.getUTCMonth();t.setUTCMonth(n+e)},t=>t.getUTCMonth());var jo=Hd(qd,t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7)%7),t.setUTCHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+qd*e)},t=>{var e=$d.floor(t),t=new Date(+t);return Math.floor((+t-+e)/qd)}),o=Hd(31536e6,t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e=1)=>{var n=t.getUTCFullYear();t.setUTCFullYear(n+e)},t=>t.getUTCFullYear());const Ud={millisecond:Eo,second:So,minute:Ao,hour:Lo,day:To,week:jo,month:$d,year:o};function Kd(t,e,n,r,i){var t=+t,e=+e,{tickIntervals:i,year:a,millisecond:o}=function(t){var{year:t,month:e,week:n,day:r,hour:i,minute:a,second:o,millisecond:s}=t?Ud:Yd;return{tickIntervals:[[o,1],[o,5],[o,15],[o,30],[a,1],[a,5],[a,15],[a,30],[i,1],[i,3],[i,6],[i,12],[r,1],[r,2],[n,1],[e,1],[e,3],[t,1]],year:t,millisecond:s}}(i),s=([t,e])=>t.duration*e,n=r?(e-t)/r:n||5,l=r||(e-t)/n,c=i.length,u=Cd(i,l,0,c,s);let f;return f=u===c?[a,Dd(t/a.duration,e/a.duration,n)]:u?([c,a]=l/s(i[u-1]){var a=et=>-e(-t),pp=(t,e)=>{const n=Math.log(t);t=t===Math.E?Math.log:10===t?Math.log10:2===t?Math.log2:t=>Math.log(t)/n;return e?dp(t):t},gp=(e,t)=>{var n=e===Math.E?Math.exp:t=>e**t;return t?dp(n):n},mp=(t,e,n,r)=>{var i=t<0,a=pp(r,i),r=gp(r,i),i=e{t.prototype.rescale=function(){this.initRange(),this.nice();var[t]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t))},t.prototype.initRange=function(){var t=this.options["interpolator"];this.options.range=e(t)},t.prototype.composeOutput=function(t,e){var n,{domain:r,interpolator:i,round:a}=this.getOptions(),r=o(r.map(t)),a=a?(n=i,t=>{t=n(t);return ip(t)?Math.round(t):t}):i;this.output=Nd(a,r,e,t)},t.prototype.invert=void 0}}var vp,mo={exports:{}},is={exports:{}},bp=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||0<=t.length&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))},xp=Array.prototype.concat,wp=Array.prototype.slice,Mp=is.exports=function(t){for(var e=[],n=0,r=t.length;nt=>e*(1-t)+n*t,Cp=(t,e)=>{if("number"==typeof t&&"number"==typeof e)return Pp(t,e);if("string"!=typeof t||"string"!=typeof e)return()=>t;{var n=t,r=e;const l=Np(n),c=Np(r);return null===l||null===c?l?()=>n:()=>r:e=>{var n=new Array(4);for(let t=0;t<4;t+=1){var r=l[t],i=c[t];n[t]=r*(1-e)+i*e}var[t,a,o,s]=n;return`rgba(${Math.round(t)}, ${Math.round(a)}, ${Math.round(o)}, ${s})`}}},Rp=(t,e)=>{const n=Pp(t,e);return t=>Math.round(n(t))};function Ip({map:t,initKey:e},n){e=e(n);return t.has(e)?t.get(e):n}function Bp(t){return"object"==typeof t?t.valueOf():t}class Fp extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=Bp,null!==t)for(var[e,n]of t)this.set(e,n)}get(t){return super.get(Ip({map:this.map,initKey:this.initKey},t))}has(t){return super.has(Ip({map:this.map,initKey:this.initKey},t))}set(t,e){return super.set(([{map:t,initKey:n},r]=[{map:this.map,initKey:this.initKey},t],n=n(r),t.has(n)?t.get(n):(t.set(n,r),r)),e);var n,r}delete(t){return super.delete(([{map:t,initKey:e},n]=[{map:this.map,initKey:this.initKey},t],e=e(n),t.has(e)&&(n=t.get(e),t.delete(e)),n));var e,n}}class Dp{constructor(t){this.options=sp({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=sp({},this.options,t),this.rescale(t)}rescale(t){}}const zp=Symbol("defaultUnknown");function Wp(e,n,r){for(let t=0;t""+t:"object"==typeof t?t=>JSON.stringify(t):t=>t}class Hp extends Dp{getDefaultOptions(){return{domain:[],range:[],unknown:zp}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&Wp(this.domainIndexMap,this.getDomain(),this.domainKey),Gp({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&Wp(this.rangeIndexMap,this.getRange(),this.rangeKey),Gp({value:this.rangeKey(t),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(t){var[e]=this.options.domain,[n]=this.options.range;this.domainKey=qp(e),this.rangeKey=qp(n),this.rangeIndexMap?(t&&!t.range||this.rangeIndexMap.clear(),t&&!t.domain&&!t.compare||(this.domainIndexMap.clear(),this.sortedDomain=void 0)):(this.rangeIndexMap=new Map,this.domainIndexMap=new Map)}clone(){return new Hp(this.options)}getRange(){return this.options.range}getDomain(){var t,e;return this.sortedDomain||({domain:t,compare:e}=this.options,this.sortedDomain=e?[...t].sort(e):t),this.sortedDomain}}function Vp(t){const{domain:e,range:n,paddingOuter:r,paddingInner:i,flex:a,round:o,align:s}=t;var l=e.length,c=0<(c=(t=l)-(u=a).length)?[...u,...new Array(c).fill(1)]:c<0?u.slice(0,t):u,[t,u]=n,u=u-t,f=u/(2/l*r+1-1/l*i);const h=f*i/l;f-=l*h;const d=function(t){const e=Math.min(...t);return t.map(t=>t/e)}(c),p=f/d.reduce((t,e)=>t+e);var c=new Fp(e.map((t,e)=>{e=d[e]*p;return[t,o?Math.floor(e):e]})),g=new Fp(e.map((t,e)=>{e=d[e]*p+h;return[t,o?Math.floor(e):e]})),f=Array.from(g.values()).reduce((t,e)=>t+e),t=t+(u-(f-f/l*i))*s;let m=o?Math.round(t):t;var y=new Array(l);for(let t=0;tl+e*o),{valueStep:o,valueBandWidth:s,adjustedRange:t}}({align:t,range:n,round:r,flex:i,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:e});this.valueStep=r,this.valueBandWidth=n,this.adjustedRange=t}}const $p=(t,e,n)=>{let r,i,a=t,o=e;if(a===o&&0{var s=t<0?0:Math.round(t);if(Number.isNaN(n)||Number.isNaN(r)||"number"!=typeof n||"number"!=typeof r||!s)return[];if(r-n<1e-15||1===s)return[n];var l,c,u,f,h,d,p,g={score:-2,lmin:0,lmax:0,lstep:0};let m=1;for(;m<1/0;){for(let t=0;t{var[t,r]=t,[e,i]=e;let a,o;return Nd(o=t{const i=Math.min(r.length,t.length)-1,a=new Array(i),o=new Array(i);var n=r[0]>r[i],s=n?[...r].reverse():r,l=n?[...t].reverse():t;for(let t=0;t{var e=Cd(r,t,1,i)-1,n=a[e];return Nd(o[e],n)(t)}},n0=(t,e,n,r)=>{return(2Math.min(Math.max(r,t),i)}return lp}composeOutput(t,e){var{domain:n,range:r,round:i,interpolate:a}=this.options,n=n0(n.map(t),r,a,i);this.output=Nd(n,e,t)}composeInput(t,e,n){var{domain:r,range:i}=this.options,i=n0(i,r.map(t),Pp);this.input=Nd(e,n,i)}}class i0 extends r0{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:Cp,tickMethod:$p,tickCount:5}}chooseTransforms(){return[lp,lp]}clone(){return new i0(this.options)}}class a0 extends Yp{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:zp,paddingInner:1,paddingOuter:0}}constructor(t){super(t)}getPaddingInner(){return 1}clone(){return new a0(this.options)}update(t){super.update(t)}getPaddingOuter(){return this.options.padding}}const o0=t=>t<0?-Math.sqrt(-t):Math.sqrt(t);class s0 extends r0{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,exponent:2,interpolate:Cp,tickMethod:$p,tickCount:5}}constructor(t){super(t)}chooseTransforms(){var t,e,n,r=this.options["exponent"];return 1===r?[lp,lp]:(t=.5===r?o0:(e=r,t=>t<0?-((-t)**e):t**e),n=r,[t,t=>t<0?-((-t)**(1/n)):t**(1/n)])}clone(){return new s0(this.options)}}class l0 extends s0{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:Cp,tickMethod:$p,tickCount:5,exponent:.5}}constructor(t){super(t)}update(t){super.update(t)}clone(){return new l0(this.options)}}class c0 extends Dp{getDefaultOptions(){return{domain:[.5],range:[0,1]}}constructor(t){super(t)}map(t){return hp(t)?(t=Cd(this.thresholds,t,0,this.n),this.options.range[t]):this.options.unknown}invert(t){var e=this.options["range"],e=e.indexOf(t),t=this.thresholds;return[t[e-1],t[e]]}clone(){return new c0(this.options)}rescale(){var{domain:t,range:e}=this.options;this.n=Math.min(t.length,e.length-1),this.thresholds=t}}const u0=(t,e,n,r=10)=>{var i=t<0,a=gp(r,i),o=pp(r,i),s=et-e),[]);for(let t=1;t{var a=e+t,t=>new Date(t)]}chooseNice(){return Xd}getTickMethodOptions(){var{domain:t,tickCount:e,tickInterval:n,utc:r}=this.options;return[t[0],t[t.length-1],e,n,r]}getFormatter(){const{mask:a,utc:t}=this.options,o=t?Ud:Yd,s=t?_0:lp;return t=>{var e=s(t),t=a||function(t,e){var{second:e,minute:n,hour:r,day:i,week:a,month:o,year:s}=e;return e.floor(t){var[t,e]=t;return Nd(Pp(0,1),Pd(t,e))})],A0);let L0=S0=class extends i0{getDefaultOptions(){return{domain:[0,.5,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:lp,tickMethod:$p,tickCount:5}}constructor(t){super(t)}clone(){return new S0(this.options)}};function T0(r,i){return Object.entries(r).reduce((t,[e,n])=>(t[e]=i(n,e,r),t),{})}function j0(t){return t.map((t,e)=>e)}function N0(t){return t[t.length-1]}function P0(t,e){const n=[[],[]];return t.forEach(t=>{n[e(t)?0:1].push(t)}),n}function C0(n,t=n.length){if(1===t)return n.map(t=>[t]);const r=[];for(let e=0;e{r.push([n[e],...t])});return r}function R0([t,e],[n,r]){return[t-n,e-r]}function I0([t,e],[n,r]){return[t+n,e+r]}function B0([t,e],[n,r]){return Math.sqrt(Math.pow(t-n,2)+Math.pow(e-r,2))}function F0([t,e]){return Math.atan2(e,t)}function D0([t,e]){return F0([t,e])+Math.PI/2}function z0(t,e){t=F0(t),e=F0(e);return ta[t]);const s=new i0({domain:[r,o],range:[0,100]}),l=t=>s.map(a[t]);r={between:t=>`${e[t]} ${l(t)}%`,start:t=>0===t?`${e[t]} ${l(t)}%`:`${e[t-1]} ${l(t)}%, ${e[t]} ${l(t)}%`,end:t=>t===e.length-1?`${e[t]} ${l(t)}%`:`${e[t]} ${l(t)}%, ${e[t+1]} ${l(t)}%`};return`linear-gradient(${n}deg, ${t.sort((t,e)=>l(t)-l(e)).map(r[i]||r.between).join(",")})`}function V0(t){var[t,e,n,r]=t;return[r,t,e,n]}function Y0(t,e,n){var[e,r,,i]=Uc(t)?V0(e):e,[n,a]=n,t=t.getCenter(),o=D0(R0(e,t)),r=D0(R0(r,t)),n=r===o&&n!==a?r+2*Math.PI:r;return{startAngle:o,endAngle:0<=n-o?n:2*Math.PI+n,innerRadius:B0(i,t),outerRadius:B0(e,t)}}function $0(t,e,n,r){var i=t["defaultColor"],t=t[e]||{},e=t[n]||t[r];return Object.assign({defaultColor:i},e)}function U0(t){var{colorAttribute:t,opacityAttribute:t=t}=t;return t+"Opacity"}function K0(t,e){return Kc(t)?(e=e["transform"],`translate(${(t=t.getCenter())[0]}, ${t[1]}) `+(e||"")):""}function X0(t){var e,n,r;return 1===t.length?t[0]:([[t,e],[n,r]]=t,[(t+n)/2,(e+r)/2])}function ot(t){return new Z0([t],null,t,t.ownerDocument)}L0=S0=function(t,e,n,r){var i,a=arguments.length,o=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;0<=s;s--)(i=t[s])&&(o=(a<3?i(o):3{const[e,n,r]=t,i=Nd(Pp(0,.5),Pd(e,n)),a=Nd(Pp(.5,1),Pd(n,r));return t=>(e>r?tthis.createElement(t),n=[];if(null!==this._data){for(let t=0;tt,r=()=>null){var i=[],a=[],o=new Set(this._elements),s=[],l=new Set,c=new Map(this._elements.map((t,e)=>[n(t.__data__,e),t])),u=new Map(this._facetElements.map((t,e)=>[n(t.__data__,e),t])),f=bc(this._elements,t=>r(t.__data__));for(let t=0;tt,e=t=>t,n=t=>t.remove(),r=t=>t,i=t=>t.remove()){t=t(this._enter),e=e(this._update),n=n(this._exit),r=r(this._merge),i=i(this._split);return e.merge(t).merge(n).merge(r).merge(i)}remove(){for(let t=0;tt.finished)).then(()=>{this._elements[t].remove()})):this._elements[t].remove()}return new Z0([],null,this._parent,this._document,void 0,this._transitions)}each(e){for(let t=0;tr:r;return this.each(function(t,e){void 0!==r&&(this[n]=i.call(this,t,e))})}style(n,r){const i="function"!=typeof r?()=>r:r;return this.each(function(t,e){void 0!==r&&(this.style[n]=i.call(this,t,e))})}transition(t){const n="function"!=typeof t?()=>t:t,r=this["_transitions"];return this.each(function(t,e){r[e]=n.call(this,t,e)})}on(t,e){return this.each(function(){this.addEventListener(t,e)}),this}call(t,...e){return t.call(this._parent,this,...e),this}node(){return this._elements[0]}nodes(){return this._elements}transitions(){return this._transitions}parent(){return this._parent}}Z0.registry={g:nt.Group,rect:nt.Rect,circle:nt.Circle,path:nt.Path,text:nt.Text,ellipse:nt.Ellipse,image:nt.Image,line:nt.Line,polygon:nt.Polygon,polyline:nt.Polyline,html:nt.HTML};const Q0=t=>{const u=t["radius"],f=rt(t,["shape","radius"]);var t=at(f,"pointer"),e=at(f,"pin");const h=t["shape"],d=rt(t,["shape"]),p=e["shape"],g=rt(e,["shape"]);return(t,e,n,r)=>{var t=t.map(t=>n.invert(t)),[i,a,o]=function(t,e){var[,...t]=(t=t.getOptions()["transformations"]).find(t=>t[0]===e);return t}(n,"polar");const s=n.clone();var l=e["color"],i=Rs({startAngle:i,endAngle:a,innerRadius:o,outerRadius:u});i.push(["cartesian"]),s.update({transformations:i});const c=t.map(t=>s.map(t));var[a,o]=X0(c),[i,t]=n.getCenter(),a=Object.assign(Object.assign({x1:a,y1:o,x2:i,y2:t,stroke:l},d),f),o=Object.assign(Object.assign({cx:i,cy:t,stroke:l},g),f),i=ot(new nt.Group);return Uu(h)||("function"==typeof h?i.append(()=>h(c,e,s,r)):i.append("line").call(j,a).node()),Uu(p)||("function"==typeof p?i.append(()=>p(c,e,s,r)):i.append("circle").call(j,o).node()),i.node()}},J0=f=>{const h={coordinate:{type:"radial",innerRadius:.9,outerRadius:1,startAngle:-1.1*Math.PI,endAngle:.1*Math.PI},axis:{x:!1},legend:!1,tooltip:!1,encode:{x:"x",y:"y",color:"color"},scale:{color:{range:["#30BF78","#D0D0D0"]}}},d={style:{shape:Q0,lineWidth:4,pointerLineCap:"round",pinR:10,pinFill:"#fff",radius:.6}},p={type:"text",style:{x:"50%",y:"60%",textAlign:"center",textBaseline:"middle",fontSize:20,fontWeight:800,fill:"#888"}};return()=>{var t,{data:e={},scale:n={},style:r={},animate:i={}}=f,a=rt(f,["data","scale","style","animate","transform"]),{targetData:e,totalData:n,target:o,total:s,scale:l}=function(t,e){const{name:n="score",target:r,total:i,percent:a,thresholds:o=[]}=t;var t=a||r,s=a?1:i,e=Object.assign({y:{domain:[0,s]}},e);return o.length?{targetData:[{x:n,y:t,color:"target"}],totalData:o.map((t,e)=>({x:n,y:1<=e?t-o[e-1]:t,color:e})),target:t,total:s,scale:e}:{targetData:[{x:n,y:t,color:"target"}],totalData:[{x:n,y:t,color:"target"},{x:n,y:s-t,color:"total"}],target:t,total:s,scale:e}}(e,n),c=at(r,"text"),u=(t=["pointer","pin"],Object.fromEntries(Object.entries(r).filter(([e])=>t.find(t=>e.startsWith(t)))));return[it({},h,Object.assign({type:"interval",transform:[{type:"stackY"}],data:n,scale:l,style:at(r,"arc"),animate:"object"==typeof i?at(i,"arc"):i},a)),it({},h,d,Object.assign({type:"point",data:e,scale:l,style:u,animate:"object"==typeof i?at(i,"indicator"):i},a)),it({},p,{style:Object.assign({text:([n,{target:r,total:e}]=[c,{target:o,total:s}],(n=n.content)?n(r,e):r.toString())},c),animate:"object"==typeof i?at(i,"text"):i})]}},t1=(J0.props={},()=>(i,t,e,a)=>{const{x:o,series:s}=e,l=Object.entries(e).filter(([t])=>t.startsWith("y")).map(([,t])=>t),c=Object.entries(e).filter(([t])=>t.startsWith("size")).map(([,t])=>t);if(void 0===o||void 0===l||void 0===c)throw new Error("Missing encode for x or y or size channel.");const u=t.x,f=t.series;e=Array.from(i,n=>{var t=u.getBandWidth(u.invert(+o[n])),e=t*(f?f.getBandWidth(f.invert(+(null===s||void 0===s?void 0:s[n]))):1),t=(+(null===s||void 0===s?void 0:s[n])||0)*t;const r=+o[n]+t+e/2;return[...l.map((t,e)=>[r+ +c[e][n]/i.length,+l[e][n]]),...l.map((t,e)=>[r-+c[e][n]/i.length,+l[e][n]]).reverse()].map(t=>a.map(t))});return[i,e]});t1.props={defaultShape:"density",defaultLabelShape:"label",composite:!1,channels:[...Hl({shapes:["density"]}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"size",required:!0},{name:"series",scale:"band"},{name:"size",required:!0,scale:"identity"}],preInference:[...Ul(),{type:"maybeZeroY1"},{type:"maybeZeroX"}],postInference:[...Yl()],interaction:{shareTooltip:!0}};const e1=t=>(t,e,n,r)=>{const{x:i,y:a,size:o,color:s}=n;return[[0],[Array.from(t,t=>{var e=o?+o[t]:40;return[...r.map([+i[t],+a[t]]),s[t],e]})]]};e1.props={defaultShape:"heatmap",defaultLabelShape:"label",composite:!1,channels:[...Hl({shapes:["heatmap"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"color",scale:"identity",required:!0},{name:"size"}],preInference:[...Ul(),{type:"maybeZeroY"},{type:"maybeZeroX"}],postInference:[...Vl()]};const n1=()=>["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"],r1=(n1.props={},()=>["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"]),i1=(r1.props={},t=>new Yp(t)),a1=(i1.props={},t=>new i0(t)),o1=(a1.props={},t=>new Hp(t)),s1=(o1.props={},t=>new Jp(t)),l1=(s1.props={},t=>new a0(t)),c1=(l1.props={},t=>new E0(t)),u1=(c1.props={},t=>new f0(t)),f1=(u1.props={},t=>new s0(t)),h1=(f1.props={},t=>new c0(t)),d1=(h1.props={},t=>new p0(t)),p1=(d1.props={},t=>new h0(t)),g1=(p1.props={},t=>new l0(t)),m1=(g1.props={},t=>new A0(t)),y1=(m1.props={},t=>new Up(t));function v1(t){return function(){return t}}y1.props={};const b1=Math.abs,x1=Math.atan2,w1=Math.cos,M1=Math.max,O1=Math.min,k1=Math.sin,_1=Math.sqrt,E1=1e-12,S1=Math.PI,A1=S1/2,L1=2*S1;function T1(t){return 1<=t?A1:t<=-1?-A1:Math.asin(t)}const j1=Math.PI,N1=2*j1,P1=1e-6,C1=N1-P1;function R1(n){this._+=n[0];for(let t=1,e=n.length;tP1&&(Math.abs(h*c-u*f)>P1&&i?(o=c*c+u*u,r=(n=n-s)*n+(s=r-l)*s,l=Math.sqrt(o),a=Math.sqrt(d),d=(o=i*Math.tan((j1-Math.acos((o+d-r)/(2*l*a)))/2))/a,r=o/l,Math.abs(d-1)>P1&&this._append`L${t+d*f},${e+d*h}`,this._append`A${i},${i},0,0,${+(f*sP1||Math.abs(this._y1-c)>P1)&&this._append`L${l},${c}`,n&&((f=f<0?f%N1+N1:f)>C1?this._append`A${n},${n},0,1,${u},${t-o},${e-s}A${n},${n},0,1,${u},${this._x1=l},${this._y1=c}`:f>P1&&this._append`A${n},${n},0,${+(f>=j1)},${u},${this._x1=t+n*Math.cos(i)},${this._y1=e+n*Math.sin(i)}`)}rect(t,e,n,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function B1(){return new I1}function F1(n){let r=3;return n.digits=function(t){if(!arguments.length)return r;if(null==t)r=null;else{var e=Math.floor(t);if(!(0<=e))throw new RangeError("invalid digits: "+t);r=e}return n},()=>new I1(r)}function D1(t){return t.innerRadius}function z1(t){return t.outerRadius}function W1(t){return t.startAngle}function G1(t){return t.endAngle}function q1(t){return t&&t.padAngle}function H1(t,e,n,r,i,a,o){var s=t-n,l=e-r,o=(o?a:-a)/_1(s*s+l*l),l=o*l,o=-o*s,s=t+l,t=e+o,e=n+l,n=r+o,r=(s+e)/2,c=(t+n)/2,u=e-s,f=n-t,h=u*u+f*f,a=i-a,s=s*n-e*t,n=(f<0?-1:1)*_1(M1(0,a*a*h-s*s)),e=(s*f-u*n)/h,t=(-s*u-f*n)/h,d=(s*f+u*n)/h,s=(-s*u+f*n)/h,u=e-r,f=t-c,n=d-r,h=s-c;return n*n+h*hE1?E>L1-E1?(R.moveTo(O*w1(k),O*k1(k)),R.arc(0,0,O,k,_,!S),M>E1&&(R.moveTo(M*w1(_),M*k1(_)),R.arc(0,0,M,_,k,S))):(r=e=k,i=n=_,o=a=E,h=(u=C.apply(this,arguments)/2)>E1&&(j?+j.apply(this,arguments):_1(M*M+O*O)),w=x=s=O1(b1(O-M)/2,+T.apply(this,arguments)),h>E1&&(f=T1(h/M*k1(u)),h=T1(h/O*k1(u)),(a-=2*f)>E1?(r+=f*=S?1:-1,i-=f):(a=0,r=i=(k+_)/2),(o-=2*h)>E1?(e+=h*=S?1:-1,n-=h):(o=0,e=n=(k+_)/2)),u=O*w1(e),f=O*k1(e),h=M*w1(i),k=M*k1(i),s>E1&&(d=O*w1(n),p=O*k1(n),g=M*w1(r),m=M*k1(r),EE1?w>E1?(l=H1(g,m,u,f,O,w,S),c=H1(d,p,h,k,O,w,S),R.moveTo(l.cx+l.x01,l.cy+l.y01),wE1&&a>E1?x>E1?(l=H1(h,k,d,p,M,-x,S),c=H1(u,f,g,m,M,-x,S),R.lineTo(l.cx+l.x01,l.cy+l.y01),xE1&&(r=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,i=3*t._l01_a*(t._l01_a+t._l12_a),a=(a*r-t._x0*t._l12_2a+t._x2*t._l01_2a)/i,o=(o*r-t._y0*t._l12_2a+t._y2*t._l01_2a)/i),t._l23_a>E1&&(r=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,i=3*t._l23_a*(t._l23_a+t._l12_a),s=(s*r+t._x1*t._l23_2a-e*t._l12_2a)/i,l=(l*r+t._y1*t._l23_2a-n*t._l12_2a)/i),t._context.bezierCurveTo(a,o,s,l,t._x2,t._y2)}function lg(t,e){this._context=t,this._alpha=e}tg.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}},ag.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:ig(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:ig(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}},function e(n){function t(t){return new ag(t,n)}return t.tension=function(t){return e(+t)},t}(0),og.prototype={areaStart:rg,areaEnd:rg,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:ig(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}},function e(n){function t(t){return new og(t,n)}return t.tension=function(t){return e(+t)},t}(0),lg.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){var n,r;switch(t=+t,e=+e,this._point&&(n=this._x2-t,r=this._y2-e,this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))),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:sg(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 cg=function e(n){function t(t){return n?new lg(t,n):new ag(t,0)}return t.alpha=function(t){return e(+t)},t}(.5);function ug(t,e){this._context=t,this._alpha=e}ug.prototype={areaStart:rg,areaEnd:rg,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){var n,r;switch(t=+t,e=+e,this._point&&(n=this._x2-t,r=this._y2-e,this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))),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:sg(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 fg=function e(n){function t(t){return n?new ug(t,n):new og(t,0)}return t.alpha=function(t){return e(+t)},t}(.5);function hg(t){this._context=t}function dg(t){return new hg(t)}function pg(t,e){this._context=t,this._t=e}function gg(t){return new pg(t,.5)}function mg(t){return new pg(t,0)}function yg(t){return new pg(t,1)}function vg(t,e,n){return Math.max(e,Math.min(t,n))}function bg(t,e,n,r={}){var{inset:i=0,radius:a=0,insetLeft:o=i,insetTop:s=i,insetRight:l=i,insetBottom:c=i,radiusBottomLeft:u=a,radiusBottomRight:f=a,radiusTopLeft:h=a,radiusTopRight:d=a,minWidth:p=-1/0,maxWidth:g=1/0}=r,r=rt(r,["inset","radius","insetLeft","insetTop","insetRight","insetBottom","radiusBottomLeft","radiusBottomRight","radiusTopLeft","radiusTopRight","minWidth","maxWidth"]);if(!Kc(n)&&!Zc(n)){var m=!!Uc(n),[y,,v]=m?V0(t):t;const[O,w]=y;var[v,y]=R0(v,y),b=(0{const{colorAttribute:S,first:A=!0,last:L=!0}=E,T=rt(E,["colorAttribute","opacityAttribute","first","last"]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=$0(r,i,a,o),{defaultColor:i,radius:a=0}=r,o=rt(r,["defaultColor","radius"]),r=o.lineWidth||1,{stroke:s,radius:a=a,radiusTopLeft:l=a,radiusTopRight:c=a,radiusBottomRight:u=a,radiusBottomLeft:f=a,innerRadius:h=0,innerRadiusTopLeft:d=h,innerRadiusTopRight:p=h,innerRadiusBottomRight:g=h,innerRadiusBottomLeft:h=h,lineWidth:r="stroke"===S||s?r:0,inset:m=0,insetLeft:y=m,insetRight:v=m,insetBottom:b=m,insetTop:x=m,minWidth:w,maxWidth:M}=T,O=rt(T,["stroke","radius","radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft","innerRadius","innerRadiusTopLeft","innerRadiusTopRight","innerRadiusBottomRight","innerRadiusBottomLeft","lineWidth","inset","insetLeft","insetRight","insetBottom","insetTop","minWidth","maxWidth"]),{color:i=i,opacity:k}=e;const _=[A?l:d,A?c:p,L?u:g,L?f:h];l=["radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft"],Uc(n)&&l.push(l.shift()),d=Object.assign(Object.assign({radius:a},Object.fromEntries(l.map((t,e)=>[t,_[e]]))),{inset:m,insetLeft:y,insetRight:v,insetBottom:b,insetTop:x,minWidth:w,maxWidth:M});return ot(bg(t,e,n,d)).call(j,o).style("fill","transparent").style(S,i).style(U0(E),k).style("lineWidth",r).style("stroke",void 0===s?i:s).call(j,O).node()}},wg=(xg.props={defaultEnterAnimation:"scaleInY",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},t=>xg(Object.assign({colorAttribute:"fill"},t))),Mg=(wg.props=Object.assign(Object.assign({},xg.props),{defaultMarker:"square"}),t=>xg(Object.assign({colorAttribute:"stroke"},t)));Mg.props=Object.assign(Object.assign({},xg.props),{defaultMarker:"hollowSquare"});const Og=t=>{const{adjustPoints:c=function(t,e,n){var[t,r,i,a]=t;if(Uc(n)){const o=[(e?e[0]:r)[0],r[1]],s=[(e?e[3]:i)[0],i[1]];return[t,o,s,a]}const o=[r[0],(e?e[0]:r)[1]],s=[i[0],(e?e[3]:i)[1]];return[t,o,s,a]}}=t,u=rt(t,["adjustPoints"]);return(t,e,n,r,i)=>{var{index:a,mark:o,shape:s,defaultShape:l}=e,r=$0(r,o,s,l),o=r["defaultColor"],s=rt(r,["defaultColor"]),l=i[a+1],r=c(t,l,n),[i,a,t,l]=!!Uc(n)?V0(r):r,{color:n=o,opacity:r}=e,e=Z1().curve(dg)([i,a,t,l]);return ot(new nt.Path({})).call(j,s).style("path",e).style("fill",n).style("fillOpacity",r).call(j,u).node()}};function kg(t,e,n){var[t,r,i,a]=t;if(Uc(n)){const o=[e?e[0][0]:(r[0]+i[0])/2,r[1]],s=[e?e[3][0]:(r[0]+i[0])/2,i[1]];return[t,o,s,a]}const o=[r[0],e?e[0][1]:(r[1]+i[1])/2],s=[i[0],e?e[3][1]:(r[1]+i[1])/2];return[t,o,s,a]}Og.props={defaultMarker:"square"};const _g=t=>Og(Object.assign({adjustPoints:kg},t));function Eg(t){const e="function"==typeof t?t:t.render;return class extends nt.CustomElement{connectedCallback(){this.draw()}attributeChangedCallback(){this.draw()}draw(){e(this)}}}_g.props={defaultMarker:"square"};const Sg=Eg(t=>{var{d1:e,d2:n,style1:r,style2:i}=t.attributes;ot(t).maybeAppend("line",()=>new nt.Path({})).style("d",e).call(j,r),ot(t).maybeAppend("line1",()=>new nt.Path({})).style("d",n).call(j,i)});const Ag=t=>{const{curve:f,gradient:h=!1,gradientColor:d="between",defined:p=t=>!Number.isNaN(t)&&null!=t,connect:g=!1}=t,m=rt(t,["curve","gradient","gradientColor","defined","connect"]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=$0(r,i,a,o),{defaultColor:i,lineWidth:a}=r,o=rt(r,["defaultColor","lineWidth"]),{color:r=i,size:i=a,seriesColor:a,seriesX:s,seriesY:l}=e,a=h&&a?H0(a,s,l,h,d):r,s=K0(n,e),l=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},o),a&&{stroke:a}),i&&{lineWidth:i}),s&&{transform:s}),m);let c;if(Kc(n)){const u=n.getCenter();c=n=>ng(Z1().curve(J1)).angle((t,e)=>D0(R0(n[e],u))).radius((t,e)=>B0(n[e],u)).defined(([t,e])=>p(t)&&p(e)).curve(f)(n)}else c=Z1().x(t=>t[0]).y(t=>t[1]).defined(([t,e])=>p(t)&&p(e)).curve(f);var[r,e]=function(t,e){var n=[],r=[];let i=!1,a=null;for(const o of t)e(o[0])&&e(o[1])?(n.push(o),i&&(i=!1,r.push([a,o])),a=o):i=!0;return[n,r]}(t,p),o=at(l,"connect"),a=!!e.length;return(!a||g&&!Object.keys(o).length?ot(new nt.Path({})).style("d",c(r)||[]).call(j,l):a&&!g?ot(new nt.Path({})).style("d",c(t)).call(j,l):ot(new Sg).style("style1",Object.assign(Object.assign({},l),o)).style("style2",l).style("d1",e.map(c).join(",")).style("d2",c(t))).node()}},Lg=(Ag.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},a=>(t,e,n,r)=>{var i=Kc(n)?dg:U1;return Ag(Object.assign({curve:i},a))(t,e,n,r)}),Tg=(Lg.props=Object.assign(Object.assign({},Ag.props),{defaultMarker:"line"}),t=>{const{alpha:a=.5}=t,o=rt(t,["alpha"]);return(t,e,n,r)=>{var i=Kc(n)?fg:cg;return Ag(Object.assign({curve:i.alpha(a)},o))(t,e,n,r)}}),jg=(Tg.props=Object.assign(Object.assign({},Ag.props),{defaultMarker:"smooth"}),t=>Ag(Object.assign({curve:yg},t))),Ng=(jg.props=Object.assign(Object.assign({},Ag.props),{defaultMarker:"hv"}),t=>Ag(Object.assign({curve:mg},t))),Pg=(Ng.props=Object.assign(Object.assign({},Ag.props),{defaultMarker:"vh"}),t=>Ag(Object.assign({curve:gg},t)));Pg.props=Object.assign(Object.assign({},Ag.props),{defaultMarker:"hvh"});const Cg=M=>(e,t,n,r)=>{var i,a,o,s,l,c,u,f,h,{mark:t,shape:d,defaultShape:p,seriesSize:g,color:m}=t,r=$0(r,t,d,p),t=r["defaultColor"],d=rt(r,["defaultColor"]),y=B1();for(let t=0;t[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"]],vs=(ds.style=["fill"],ds.bind(void 0)),Ro=(vs.style=["stroke","lineWidth"],(t,e,n)=>[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]]),ss=(Ro.style=["fill"],Ro.bind(void 0)),Po=(ss.style=["fill"],Ro.bind(void 0)),as=(Po.style=["stroke","lineWidth"],(t,e,n)=>{var r=.618*n;return[["M",t-r,e],["L",t,e-n],["L",t+r,e],["L",t,e+n],["Z"]]}),Rg=(as.style=["fill"],as.bind(void 0)),os=(Rg.style=["stroke","lineWidth"],(t,e,n)=>{var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]}),Bl=(os.style=["fill"],os.bind(void 0)),e=(Bl.style=["stroke","lineWidth"],(t,e,n)=>{var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]}),ho=(e.style=["fill"],e.bind(void 0)),n=(ho.style=["stroke","lineWidth"],(t,e,n)=>{var r=n/2*Math.sqrt(3);return[["M",t,e-n],["L",t+r,e-n/2],["L",t+r,e+n/2],["L",t,e+n],["L",t-r,e+n/2],["L",t-r,e-n/2],["Z"]]}),r=(n.style=["fill"],n.bind(void 0)),rs=(r.style=["stroke","lineWidth"],(t,e,n)=>{var r=n-1.5;return[["M",t-n,e-r],["L",t+n,e+r],["L",t+n,e-r],["L",t-n,e+r],["Z"]]}),yo=(rs.style=["fill"],rs.bind(void 0)),so=(yo.style=["stroke","lineWidth"],(t,e,n)=>[["M",t,e+n],["L",t,e-n]]),a=(so.style=["stroke","lineWidth"],(t,e,n)=>[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]]),po=(a.style=["stroke","lineWidth"],(t,e,n)=>[["M",t-n/2,e-n],["L",t+n/2,e-n],["M",t,e-n],["L",t,e+n],["M",t-n/2,e+n],["L",t+n/2,e+n]]),go=(po.style=["stroke","lineWidth"],(t,e,n)=>[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]),i=(go.style=["stroke","lineWidth"],(t,e,n)=>[["M",t-n,e],["L",t+n,e]]),vo=(i.style=["stroke","lineWidth"],(t,e,n)=>[["M",t-n,e],["L",t+n,e]]),bo=(vo.style=["stroke","lineWidth"],vo.bind(void 0)),_o=(bo.style=["stroke","lineWidth"],(t,e,n)=>[["M",t-n,e],["A",n/2,n/2,0,1,1,t,e],["A",n/2,n/2,0,1,0,t+n,e]]),Eo=(_o.style=["stroke","lineWidth"],(t,e,n)=>[["M",t-n-1,e-2.5],["L",t,e-2.5],["L",t,e+2.5],["L",t+n+1,e+2.5]]),So=(Eo.style=["stroke","lineWidth"],(t,e,n)=>[["M",t-n-1,e+2.5],["L",t,e+2.5],["L",t,e-2.5],["L",t+n+1,e-2.5]]),Ao=(So.style=["stroke","lineWidth"],(t,e,n)=>[["M",t-(n+1),e+2.5],["L",t-n/2,e+2.5],["L",t-n/2,e-2.5],["L",t+n/2,e-2.5],["L",t+n/2,e+2.5],["L",t+n+1,e+2.5]]),Lo=(Ao.style=["stroke","lineWidth"],(t,e,n)=>[["M",t-5,e+2.5],["L",t-5,e],["L",t,e],["L",t,e-3],["L",t,e+3],["L",t+6.5,e+3]]);Lo.style=["stroke","lineWidth"];const Ig=new Map([["bowtie",rs],["cross",a],["dash",bo],["diamond",as],["dot",vo],["hexagon",n],["hollowBowtie",yo],["hollowDiamond",Rg],["hollowHexagon",r],["hollowPoint",vs],["hollowSquare",Po],["hollowTriangle",Bl],["hollowTriangleDown",ho],["hv",Eo],["hvh",Ao],["hyphen",i],["line",so],["plus",go],["point",ds],["rect",ss],["smooth",_o],["square",Ro],["tick",po],["triangleDown",e],["triangle",os],["vh",So],["vhv",Lo]]);const l=u=>{const{colorAttribute:f,symbol:t,mode:h="auto"}=u,d=rt(u,["colorAttribute","symbol","mode"]),p=Ig.get(t)||Ig.get("point");return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=$0(r,i,a,o),{defaultColor:i,lineWidth:a}=r,o=rt(r,["defaultColor","lineWidth"]),r=d.stroke?a||1:a,{color:a=i,transform:i,opacity:s}=e,[l,c]=X0(t),t=function(t,e,n,r){var i;if(1!==e.length)return n=n["size"],"fixed"!==t&&("normal"===t||Jc(r))?([[t,r],[e,i]]=e,e=Math.abs((e-t)/2),t=Math.abs((i-r)/2),Math.max(0,(e+t)/2)):n}(h,t,e,n)||d.r||o.r;return ot(new nt.Path).call(j,o).style("fill","transparent").style("d",p(l,c,t)).style("lineWidth",r).style("transform",i).style("stroke",a).style(U0(u),s).style(f,a).call(j,d).node()}},Bg=(l.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},t=>l(Object.assign({colorAttribute:"fill",symbol:"bowtie"},t))),Fg=(Bg.props=Object.assign({defaultMarker:"bowtie"},l.props),t=>l(Object.assign({colorAttribute:"stroke",symbol:"cross"},t))),Dg=(Fg.props=Object.assign({defaultMarker:"cross"},l.props),t=>l(Object.assign({colorAttribute:"fill",symbol:"diamond"},t))),zg=(Dg.props=Object.assign({defaultMarker:"diamond"},l.props),t=>l(Object.assign({colorAttribute:"fill",symbol:"hexagon"},t))),Wg=(zg.props=Object.assign({defaultMarker:"hexagon"},l.props),t=>l(Object.assign({colorAttribute:"stroke",symbol:"bowtie"},t))),Gg=(Wg.props=Object.assign({defaultMarker:"hollowBowtie"},l.props),t=>l(Object.assign({colorAttribute:"stroke",symbol:"diamond"},t))),qg=(Gg.props=Object.assign({defaultMarker:"hollowDiamond"},l.props),t=>l(Object.assign({colorAttribute:"stroke",symbol:"hexagon"},t))),Hg=(qg.props=Object.assign({defaultMarker:"hollowHexagon"},l.props),t=>l(Object.assign({colorAttribute:"stroke",symbol:"point"},t))),Vg=(Hg.props=Object.assign({defaultMarker:"hollowPoint"},l.props),t=>l(Object.assign({colorAttribute:"stroke",symbol:"square"},t))),Yg=(Vg.props=Object.assign({defaultMarker:"hollowSquare"},l.props),t=>l(Object.assign({colorAttribute:"stroke",symbol:"triangle"},t))),$g=(Yg.props=Object.assign({defaultMarker:"hollowTriangle"},l.props),t=>l(Object.assign({colorAttribute:"stroke",symbol:"triangle-down"},t))),Ug=($g.props=Object.assign({defaultMarker:"hollowTriangleDown"},l.props),t=>l(Object.assign({colorAttribute:"stroke",symbol:"hyphen"},t))),Kg=(Ug.props=Object.assign({defaultMarker:"hyphen"},l.props),t=>l(Object.assign({colorAttribute:"stroke",symbol:"line"},t))),Xg=(Kg.props=Object.assign({defaultMarker:"line"},l.props),t=>l(Object.assign({colorAttribute:"stroke",symbol:"plus"},t))),Zg=(Xg.props=Object.assign({defaultMarker:"plus"},l.props),t=>l(Object.assign({colorAttribute:"fill",symbol:"point"},t))),Qg=(Zg.props=Object.assign({defaultMarker:"point"},l.props),t=>l(Object.assign({colorAttribute:"fill",symbol:"square"},t))),Jg=(Qg.props=Object.assign({defaultMarker:"square"},l.props),t=>l(Object.assign({colorAttribute:"stroke",symbol:"tick"},t))),tm=(Jg.props=Object.assign({defaultMarker:"tick"},l.props),t=>l(Object.assign({colorAttribute:"fill",symbol:"triangle"},t))),em=(tm.props=Object.assign({defaultMarker:"triangle"},l.props),t=>l(Object.assign({colorAttribute:"fill",symbol:"triangle-down"},t))),nm=(em.props=Object.assign({defaultMarker:"triangleDown"},l.props),t=>{const{arrow:h=!0,arrowSize:d="40%"}=t,p=rt(t,["arrow","arrowSize"]);return(t,e,n,r)=>{var i,a,o,s,{mark:l,shape:c,defaultShape:u,transform:f}=e,r=$0(r,l,c,u),l=r["defaultColor"],c=rt(r,["defaultColor"]),{color:u=l}=e,[r,e]=t,t=B1();return t.moveTo(...r),t.lineTo(...e),h&&([o,s]=(r=r,i=e,a="string"==typeof(a=(a={arrowSize:d})["arrowSize"])?+parseFloat(a)/100*B0(r,i):a,o=Math.PI/6,r=Math.atan2(i[1]-r[1],i[0]-r[0]),s=Math.PI/2-r-o,r-=o,[[i[0]-a*Math.sin(s),i[1]-a*Math.cos(s)],[i[0]-a*Math.cos(r),i[1]-a*Math.sin(r)]]),t.moveTo(...e),t.lineTo(...o),t.moveTo(...e),t.lineTo(...s)),ot(new nt.Path).call(j,c).style("d",t.toString()).style("stroke",u||l).style("transform",f).call(j,p).node()}});function rm(t){am(t,!0)}function im(t){am(t,!1)}function am(t,e){var n=e?"visible":"hidden";!function e(t,n){n(t),t.children&&t.children.forEach(function(t){t&&e(t,n)})}(t,function(t){t.attr("visibility",n)})}nm.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};ce(lm,om=nt.Group);var om,sm=lm;function lm(){for(var t=[],e=0;eu[0]&&t=o.length)return null;o[r].setLocalPosition(0,0),this.prepareFollowingPage(t);i=O(this.getFollowingPageDiff(t),2),o=i[0],r=i[1],this.playState="running",i=Py(a,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-o,", ").concat(-r,")")}],n);return jy(i,function(){e.innerCurrPage=t,e.playState="idle",e.setVisiblePages([t]),e.updatePageInfo()}),i},mb.prototype.prev=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;return!t&&n<=0?null:(t=t?(n-1+e)%e:Ye(n-1,0,e),this.goTo(t))},mb.prototype.next=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;return!t&&e-1<=n?null:(t=t?(n+1)%e:Ye(n+1,0,e),this.goTo(t))},mb.prototype.renderClipPath=function(t){var e=this.pageShape,n=e.pageWidth,e=e.pageHeight;n&&e?(this.clipPath=t.maybeAppendByClassName(pb.clipPath,"rect").styles({width:n,height:e}),this.contentGroup.attr("clipPath",this.clipPath.node())):this.contentGroup.style.clipPath=void 0},mb.prototype.setVisiblePages=function(n){this.playWindow.children.forEach(function(t,e){(n.includes(e)?rm:im)(t)})},mb.prototype.adjustControllerLayout=function(){var t=this.prevBtnGroup,e=this.nextBtnGroup,n=this.pageInfoGroup,r=this.attributes,i=r.orientation,r=r.controllerPadding,a=n.getBBox(),o=a.width,a=(a.height,O("horizontal"===i?[-180,0]:[-90,90],2)),s=a[0],a=a[1],s=(t.setLocalEulerAngles(s),e.setLocalEulerAngles(a),t.getBBox()),a=s.width,s=s.height,l=e.getBBox(),c=l.width,l=l.height,c=Math.max(a,o,c),i="horizontal"===i?{offset:[[0,0],[a/2+r,0],[a+o+2*r,0]],textAlign:"start"}:{offset:[[c/2,-s-r],[c/2,0],[c/2,l+r]],textAlign:"center"},a=O(i.offset,3),o=O(a[0],2),s=o[0],c=o[1],l=O(a[1],2),r=l[0],o=l[1],l=O(a[2],2),a=l[0],l=l[1],i=i.textAlign,u=n.querySelector("text");u&&(u.style.textAlign=i),t.setLocalPosition(s,c),n.setLocalPosition(r,o),e.setLocalPosition(a,l)},mb.prototype.updatePageInfo=function(){var t,e=this.currPage,n=this.pageViews,r=this.attributes.formatter;n.length<2||(null!=(t=this.pageInfoGroup.querySelector(pb.pageInfo.class))&&t.attr("text",r(e+1,n.length)),this.adjustControllerLayout())},mb.prototype.getFollowingPageDiff=function(t){var e,n,r,i=this.currPage;return i===t?[0,0]:(e=this.attributes.orientation,n=(r=this.pageShape).pageWidth,r=r.pageHeight,t=t]*>/,e2={tr:document.createElement("tbody"),tbody:Jb,thead:Jb,tfoot:Jb,td:e2,th:e2,"*":document.createElement("div")});var e=t2.test(t)&&RegExp.$1,e=(e&&e in e2||(e="*"),e2[e]),t=(t="string"==typeof t?t.replace(/(^\s*)|(\s*$)/g,""):t,e.innerHTML=""+t,e.childNodes[0]);return t&&e.contains(t)&&e.removeChild(t),t}function a2(t){return{CONTAINER:"".concat(t=void 0===t?"":t,"tooltip"),TITLE:"".concat(t,"tooltip-title"),LIST:"".concat(t,"tooltip-list"),LIST_ITEM:"".concat(t,"tooltip-list-item"),NAME:"".concat(t,"tooltip-list-item-name"),MARKER:"".concat(t,"tooltip-list-item-marker"),NAME_LABEL:"".concat(t,"tooltip-list-item-name-label"),VALUE:"".concat(t,"tooltip-list-item-value"),CROSSHAIR_X:"".concat(t,"tooltip-crosshair-x"),CROSSHAIR_Y:"".concat(t,"tooltip-crosshair-y")}}var o2={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};ce(f2,s2=To),Object.defineProperty(f2.prototype,"HTMLTooltipElement",{get:function(){return this.element},enumerable:!1,configurable:!0}),f2.prototype.getContainer=function(){return this.element},Object.defineProperty(f2.prototype,"position",{set:function(t){var t=O(t,2),e=t[0],t=t[1];this.attributes.x=e,this.attributes.y=t,this.updatePosition()},enumerable:!1,configurable:!0}),Object.defineProperty(f2.prototype,"elementSize",{get:function(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}},enumerable:!1,configurable:!0}),Object.defineProperty(f2.prototype,"HTMLTooltipItemsElements",{get:function(){var t=this.attributes,e=t.data,o=t.template;return e.map(function(t,e){var n,r=t.name,r=void 0===r?"":r,i=t.color,i=void 0===i?"black":i,a=t.index,t=rt(t,["name","color","index"]),r=y({name:r,color:i,index:null!=a?a:e},t);return i2((i=o.item,n=r,i&&n?i.replace(/\\?\{([^{}]+)\}/g,function(t,e){return"\\"===t.charAt(0)?t.slice(1):void 0===n[e]?"":n[e]}):i))})},enumerable:!1,configurable:!0}),f2.prototype.render=function(t,e){this.renderHTMLTooltipElement(),this.updatePosition()},f2.prototype.destroy=function(){var t;null!=(t=this.element)&&t.remove(),s2.prototype.destroy.call(this)},f2.prototype.show=function(t,e){var n,r=this;void 0!==t&&void 0!==e&&(n=this.element.style.transition,this.element.style.transition="none",this.position=[null!=t?t:+this.attributes.x,null!=e?e:+this.attributes.y],setTimeout(function(){r.element.style.transition=n},10)),this.element.style.visibility="visible"},f2.prototype.hide=function(){this.element.style.visibility="hidden"},f2.prototype.initShape=function(){var t=this.attributes.template;this.element=i2(t.container),this.id&&this.element.setAttribute("id",this.id)},f2.prototype.renderCustomContent=function(){var t;(void 0===this.prevCustomContentKey||this.prevCustomContentKey!==this.attributes.contentKey)&&(this.prevCustomContentKey=this.attributes.contentKey,t=this.attributes.content)&&("string"==typeof t?this.element.innerHTML=t:this.element.replaceChildren(t))},f2.prototype.renderHTMLTooltipElement=function(){var r,t=this.attributes,e=t.template,n=t.title,i=t.enterable,a=t.style,t=t.content,o=a2(e.prefixCls),s=this.element;this.element.style.pointerEvents=i?"auto":"none",t?this.renderCustomContent():(n?(s.innerHTML=e.title,s.getElementsByClassName(o.TITLE)[0].innerHTML=n):null!=(t=null==(i=s.getElementsByClassName(o.TITLE))?void 0:i[0])&&t.remove(),e=this.HTMLTooltipItemsElements,(n=document.createElement("ul")).className=o.LIST,n.replaceChildren.apply(n,v([],O(e),!1)),(i=this.element.querySelector(".".concat(o.LIST)))?i.replaceWith(n):s.appendChild(n)),r=s,Object.entries(a).forEach(function(t){var t=O(t,2),e=t[0],n=t[1];v([r],O(r.querySelectorAll(e)),!1).filter(function(t){return t.matches(e)}).forEach(function(t){t&&(t.style.cssText+=Object.entries(n).reduce(function(t,e){return"".concat(t).concat(e.join(":"),";")},""))})})},f2.prototype.getRelativeOffsetFromCursor=function(t){var e=this.attributes,n=e.position,i=e.offset,e=(t||n).split("-"),a={left:[-1,0],right:[1,0],top:[0,-1],bottom:[0,1]},t=this.elementSize,o=t.width,s=t.height,l=[-o/2,-s/2];return e.forEach(function(t){var e=O(l,2),n=e[0],e=e[1],t=O(a[t],2),r=t[0],t=t[1];l=[n+(o/2+i[0])*r,e+(s/2+i[1])*t]}),l},f2.prototype.setOffsetPosition=function(t){var t=O(t,2),e=t[0],t=t[1],n=this.attributes,r=n.x,i=n.y,i=void 0===i?0:i,n=n.container,a=n.x,n=n.y;this.element.style.left="".concat(+(void 0===r?0:r)+a+e,"px"),this.element.style.top="".concat(+i+n+t,"px")},f2.prototype.updatePosition=function(){this.setOffsetPosition(this.autoPosition(this.getRelativeOffsetFromCursor()))},f2.prototype.autoPosition=function(t){var e,n,r,i,a,o,s,t=O(t,2),l=t[0],t=t[1],c=this.attributes,u=c.x,f=c.y,h=c.bounding,c=c.position;return h?(e=(n=this.element).offsetWidth,n=n.offsetHeight,f=(u=O([+u+l,+f+t],2))[0],u=u[1],r={left:"right",right:"left",top:"bottom",bottom:"top"},s=h.x,i=h.y,a={left:f'),title:'
'),item:'
  • \n \n \n {name}\n \n {value}\n
  • ')},style:(t=a2(t=void 0===(t=n)?"":t),(r={})[".".concat(t.CONTAINER)]={position:"absolute",visibility:"visible","z-index":8,transition:"visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1)","background-color":"rgba(255, 255, 255, 0.96)","box-shadow":"0 6px 12px 0 rgba(0, 0, 0, 0.12)","border-radius":"4px",color:"rgba(0, 0, 0, 0.65)","font-size":"12px","line-height":"20px",padding:"12px","min-width":"120px","max-width":"360px","font-family":"Roboto-Regular"},r[".".concat(t.TITLE)]={color:"rgba(0, 0, 0, 0.45)"},r[".".concat(t.LIST)]={margin:"0px","list-style-type":"none",padding:"0px"},r[".".concat(t.LIST_ITEM)]={"list-style-type":"none",display:"flex","line-height":"2em","align-items":"center","justify-content":"space-between","white-space":"nowrap"},r[".".concat(t.MARKER)]={width:"8px",height:"8px","border-radius":"50%",display:"inline-block","margin-right":"4px"},r[".".concat(t.NAME)]={display:"flex","align-items":"center","max-width":"216px"},r[".".concat(t.NAME_LABEL)]=y({flex:1},o2),r[".".concat(t.VALUE)]=y({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},o2),r[".".concat(t.CROSSHAIR_X)]={position:"absolute",width:"1px","background-color":"rgba(0, 0, 0, 0.25)"},r[".".concat(t.CROSSHAIR_Y)]={position:"absolute",height:"1px","background-color":"rgba(0, 0, 0, 0.25)"},r)})||this).prevCustomContentKey=e.attributes.contentKey,e.initShape(),e.render(e.attributes,e),e}ce(d2,h2=nt.Group),Object.defineProperty(d2.prototype,"margin",{get:function(){return this.$margin},set:function(t){this.$margin=ty(t)},enumerable:!1,configurable:!0}),Object.defineProperty(d2.prototype,"padding",{get:function(){return this.$padding},set:function(t){this.$padding=ty(t)},enumerable:!1,configurable:!0}),d2.prototype.getBBox=function(){var t=this.attributes,e=t.x,e=void 0===e?0:e,n=t.y,n=void 0===n?0:n,r=t.width,t=t.height,i=O(this.$margin,4),a=i[0],o=i[1],s=i[2],i=i[3];return new gm(e-i,n-a,r+i+o,t+a+s)},d2.prototype.appendChild=function(t,e){return t.isMutationObserved=!0,h2.prototype.appendChild.call(this,t,e),t},d2.prototype.getAvailableSpace=function(){var t=this.attributes,e=t.width,t=t.height,n=O(this.$padding,4),r=n[0],i=n[1],a=n[2],n=n[3],o=O(this.$margin,4),s=o[0],o=o[3];return new gm(n+o,r+s,e-n-i,t-r-a)},d2.prototype.layout=function(){var t,e,n,r;if(this.attributes.display&&this.isConnected&&!this.children.some(function(t){return!t.isConnected}))try{t=this.getAvailableSpace(),e=this.children.map(function(t){return t.getBBox()}),n=this.attributes;var i=0!==e.length&&(null==(r=n.display in(r={flex:Rm,grid:Im})?r[n.display]:null)?void 0:r.call(null,t,e,n))||[];this.children.forEach(function(t,e){var e=i[e],n=e.x,e=e.y;t.attr({x:n,y:e})})}catch(t){}},d2.prototype.bindEvents=function(){var e=this;this.layoutEvents.forEach(function(t){e.addEventListener(t,function(t){t.target.isMutationObserved=!0,e.layout()})})},d2.prototype.attributeChangedCallback=function(t,e,n){"margin"===t?this.margin=n:"padding"===t&&(this.padding=n),this.layout()};var h2,mo=d2;function d2(t){var e=h2.call(this,t)||this,t=(e.layoutEvents=[nt.ElementEvent.BOUNDS_CHANGED,nt.ElementEvent.INSERTED,nt.ElementEvent.REMOVED],e.$margin=ty(0),e.$padding=ty(0),t.style||{}),n=t.margin,t=t.padding,t=void 0===t?0:t;return e.margin=void 0===n?0:n,e.padding=t,e.isMutationObserved=!0,e.bindEvents(),e}function p2(r,t,e,n){var[[t,i],[a,o]]=t,[s,l]=function(t){var{min:[t,e],max:[n,r]}=t.getLocalBounds();let i=0,a=0;return 0{var{min:t,max:e}=r.getLocalBounds(),n=u[0]+(u[1]-c[1])*+u[1]/(u[0]-c[0]);return e[0]{var e=t.attributes,{labelTransform:n,labelTransformOrigin:r,x:i,y:a,x0:o=i,y0:s=a,background:l,connector:c,startMarker:u,endMarker:f,coordCenter:h}=e,e=rt(e,["class","transform","rotate","labelTransform","labelTransformOrigin","x","y","x0","y0","background","connector","startMarker","endMarker","coordCenter"]),d=at(e,"background"),p=d["padding"],d=rt(d,["padding"]),g=at(e,"connector"),{points:m=[]}=g,g=rt(g,["points"]),o=[[+o,+s],[+i,+a]],s=ot(t).maybeAppend("text","text").style("zIndex",0).call(j,Object.assign({textBaseline:"middle",transform:n,transformOrigin:r},e)).node(),i=p2(ot(t).maybeAppend("background","rect").style("zIndex",-1).call(j,function(t,e=[]){var[e=0,n=0,r=e,i=n]=e,a=t.parentNode,o=a.getEulerAngles(),{min:t,halfExtents:s}=(a.setEulerAngles(0),t.getLocalBounds()),[t,l]=t,[s,c]=s;return a.setEulerAngles(o),{x:t-i,y:l-e,width:2*s+i+n,height:2*c+e+r}}(s,p)).call(j,l?d:{}).node(),o,m,h),a=u&&new py({id:"startMarker",style:Object.assign({x:0,y:0},at(e,"startMarker"))}),n=f&&new py({id:"endMarker",style:Object.assign({x:0,y:0},at(e,"endMarker"))});ot(t).maybeAppend("connector","path").style("zIndex",0).style("path",i).style("markerStart",a).style("markerEnd",n).call(j,c?g:{})}),m2=t=>{const l=rt(t,[]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=rt($0(r,i,a,o),[]),{color:i,text:a="",fontSize:o,rotate:e=0,transform:s=""}=e,a={text:String(a),stroke:i,fill:i,fontSize:o},[[i,o]]=t;return ot(new g2).style("x",i).style("y",o).call(j,r).style("transform",s+`rotate(${+e})`).style("coordCenter",n.getCenter()).call(j,a).call(j,l).node()}};m2.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const y2=Eg(t=>{var e=rt(t.attributes,["class","x","y"]);const n=at(e,"marker"),{size:s=24}=n,r=()=>{var t=s/2,e=t/Math.sqrt(2),n=t*Math.sqrt(2),[r,i]=[-e,e-n],[a,o]=[0,0],[e,n]=[e,e-n];return[["M",r,i],["A",t,t,0,1,1,e,n],["L",a,o],["Z"]]};var[i,a]=function(t){var{min:t,max:e}=t.getLocalBounds();return[.5*(t[0]+e[0]),.5*(t[1]+e[1])]}(ot(t).maybeAppend("marker",()=>new py({})).call(t=>t.node().update(Object.assign({symbol:r},n))).node());ot(t).maybeAppend("text","text").style("x",i).style("y",a).call(j,e)}),v2=t=>{const s=rt(t,[]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=$0(r,i,a,o),i=r["defaultColor"],a=rt(r,["defaultColor"]),{color:o,text:r=""}=e,e={text:String(r),stroke:o||i,fill:o||i},[[r,o]]=t;return ot(new y2).call(j,a).style("x",r).style("y",o).call(j,e).call(j,s).node()}},b2=(v2.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},Eg(t=>{var{areaPath:e,connectPath:n,areaStyle:r,connectStyle:i}=t.attributes;ot(t).maybeAppend("connect-path",()=>new nt.Path({})).style("d",n).call(j,i),ot(t).maybeAppend("area-path",()=>new nt.Path({})).style("d",e).call(j,r)}));const x2=t=>{const{curve:u,gradient:l=!1,defined:f=t=>!Number.isNaN(t)&&null!=t,connect:h=!1}=t,d=rt(t,["curve","gradient","defined","connect"]);return(t,e,c,n)=>{var{mark:r,shape:i,defaultShape:a}=e,n=$0(n,r,i,a),r=n["defaultColor"],i=rt(n,["defaultColor"]),{color:a=r,seriesColor:n,seriesX:r,seriesY:o}=e,e=K0(c,e),n=l&&n?H0(n,r,o,l):a;const s=Object.assign(Object.assign(Object.assign(Object.assign({},i),{stroke:n,fill:n}),e&&{transform:e}),d);var[r,o]=function(e,n){var r=[],i=[],a=[];let o=!1,s=null;var l=e.length/2;for(let t=0;t!n(t))?o=!0:(r.push(f),i.push(h),o&&s&&(o=!1,[c,u]=s,a.push([c,f,u,h])),s=[f,h])}return[r.concat(i),a]}(t,f),a=at(s,"connect"),i=!!o.length,n=t=>ot(new nt.Path({})).style("d",t).call(j,s).node();return Kc(c)?(e=t=>{const n=c.getCenter(),r=t.slice(0,t.length/2),i=t.slice(t.length/2);return t=Q1().curve(J1),e=t.curve,a=t.lineX0,o=t.lineX1,s=t.lineY0,l=t.lineY1,t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return ng(a())},delete t.lineX0,t.lineEndAngle=function(){return ng(o())},delete t.lineX1,t.lineInnerRadius=function(){return ng(s())},delete t.lineY0,t.lineOuterRadius=function(){return ng(l())},delete t.lineY1,t.curve=function(t){return arguments.length?e(eg(t)):e()._curve},t.angle((t,e)=>D0(R0(r[e],n))).outerRadius((t,e)=>B0(r[e],n)).innerRadius((t,e)=>B0(i[e],n)).defined((t,e)=>[...r[e],...i[e]].every(f)).curve(u)(i);var e,a,o,s,l},!i||h&&!Object.keys(a).length?n(e(r)):i&&!h?n(e(t)):ot(new b2).style("areaStyle",s).style("connectStyle",Object.assign(Object.assign({},a),d)).style("areaPath",e(t)).style("connectPath",o.map(e).join("")).node()):(e=t=>{const n=t.slice(0,t.length/2),r=t.slice(t.length/2);return(Uc(c)?Q1().y((t,e)=>n[e][1]).x1((t,e)=>n[e][0]).x0((t,e)=>r[e][0]).defined((t,e)=>[...n[e],...r[e]].every(f)):Q1().x((t,e)=>n[e][0]).y1((t,e)=>n[e][1]).y0((t,e)=>r[e][1]).defined((t,e)=>[...n[e],...r[e]].every(f))).curve(u)(n)},!i||h&&!Object.keys(a).length?n(e(r)):i&&!h?n(e(t)):ot(new b2).style("areaStyle",s).style("connectStyle",Object.assign(Object.assign({},a),d)).style("areaPath",e(t)).style("connectPath",o.map(e).join("")).node())}},w2=(x2.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},a=>(t,e,n,r)=>{var i=Kc(n)?dg:U1;return x2(Object.assign({curve:i},a))(t,e,n,r)}),M2=(w2.props=Object.assign(Object.assign({},x2.props),{defaultMarker:"square"}),t=>{const{alpha:a=.5}=t,o=rt(t,["alpha"]);return(t,e,n,r)=>{var i=Kc(n)?fg:cg;return x2(Object.assign({curve:i.alpha(a)},o))(t,e,n,r)}}),O2=(M2.props=Object.assign(Object.assign({},x2.props),{defaultMarker:"smooth"}),i=>(t,e,n,r)=>x2(Object.assign({curve:gg},i))(t,e,n,r)),k2=(O2.props=Object.assign(Object.assign({},x2.props),{defaultMarker:"hvh"}),i=>(t,e,n,r)=>x2(Object.assign({curve:mg},i))(t,e,n,r)),_2=(k2.props=Object.assign(Object.assign({},x2.props),{defaultMarker:"vh"}),i=>(t,e,n,r)=>x2(Object.assign({curve:yg},i))(t,e,n,r)),E2=(_2.props=Object.assign(Object.assign({},x2.props),{defaultMarker:"hv"}),i=>{const{arrow:a=!1}=i;return(t,e,n,r)=>nm(Object.assign(Object.assign({},i),{arrow:a}))(t,e,n,r)}),S2=(E2.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},t=>{const s=rt(t,[]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=$0(r,i,a,o),i=r["defaultColor"],a=rt(r,["defaultColor"]),{color:o=i,transform:r}=e,[e,i]=t,t=B1();return t.moveTo(e[0],e[1]),t.bezierCurveTo(e[0]/2+i[0]/2,e[1],e[0]/2+i[0]/2,i[1],i[0],i[1]),ot(new nt.Path).call(j,a).style("d",t.toString()).style("stroke",o).style("transform",r).call(j,s).node()}});S2.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const A2=t=>{const{cornerRatio:u=1/3}=t,f=rt(t,["cornerRatio"]);return(t,e,n,r)=>{var i,a,{mark:o,shape:s,defaultShape:l}=e,r=$0(r,o,s,l),o=r["defaultColor"],s=rt(r,["defaultColor"]),{color:l=o,transform:r}=e,[e,o]=t,c=(t=e,e=o,o=n,n=u,a=B1(),Kc(o)?(i=B0(t,c=o.getCenter()),i=(B0(e,c)-i)*n+i,a.moveTo(t[0],t[1]),q0(a,t,e,c,i)):Uc(o)?(a.moveTo(t[0],t[1]),a.lineTo(t[0]+(e[0]-t[0])*n,t[1]),a.lineTo(t[0]+(e[0]-t[0])*n,e[1])):(a.moveTo(t[0],t[1]),a.lineTo(t[0],t[1]+(e[1]-t[1])*n),a.lineTo(e[0],t[1]+(e[1]-t[1])*n)),a.lineTo(e[0],e[1]),a);return ot(new nt.Path).call(j,s).style("d",c.toString()).style("stroke",l).style("transform",r).call(j,f).node()}},L2=(A2.props={defaultMarker:"vhv",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},t=>{const s=rt(t,[]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=$0(r,i,a,o),i=r["defaultColor"],a=rt(r,["defaultColor"]),{color:o=i,transform:r}=e,[e,i]=t,t=B1();return t.moveTo(e[0],e[1]),Kc(n)?(n=n.getCenter(),t.quadraticCurveTo(n[0],n[1],i[0],i[1])):q0(t,e,i,G0(e,i),B0(e,i)/2),ot(new nt.Path).call(j,a).style("d",t.toString()).style("stroke",o).style("transform",r).call(j,s).node()}}),T2=(L2.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},t=>{const u=rt(t,[]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=$0(r,i,a,o),i=r["defaultColor"],a=rt(r,["defaultColor"]),{color:o=i,src:r="",size:e=32,transform:i=""}=e,{width:s=e,height:e=e}=u,[[t,l]]=t,[n,c]=n.getSize(),s="string"==typeof s?Zl(s)*n:s,e="string"==typeof e?Zl(e)*c:e,n=t-Number(s)/2,c=l-Number(e)/2;return ot(new nt.Image).call(j,a).style("x",n).style("y",c).style("img",r).style("stroke",o).style("transform",i).call(j,u).style("width",s).style("height",e).node()}});T2.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const j2=t=>{const l=rt(t,[]);return(t,e,n,r)=>{var{mark:e,shape:i,defaultShape:a,color:o,transform:s}=e,r=$0(r,e,i,a),e=r["defaultColor"],i=rt(r,["defaultColor"]),a=function(i,t){const a=B1();if(Kc(t)){const o=t.getCenter();t=[...i,i[0]];const s=t.map(t=>B0(t,o));return t.forEach((t,e)=>{var n,r;0===e?a.moveTo(t[0],t[1]):(n=s[e],r=i[e-1],void 0!==(e=s[e-1])&&Math.abs(n-e)<1e-10?q0(a,r,t,o,n):a.lineTo(t[0],t[1]))}),a.closePath(),a}return n=a,i.forEach((t,e)=>0===e?n.moveTo(t[0],t[1]):n.lineTo(t[0],t[1])),n.closePath(),n;var n}(t,n);return ot(new nt.Path).call(j,i).style("d",a.toString()).style("stroke",o||e).style("fill",o||e).style("transform",s).call(j,l).node()}};j2.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const N2=t=>{const l=rt(t,[]);return(t,e,n,r)=>{var{mark:e,shape:i,defaultShape:a,color:o,transform:s}=e,r=$0(r,e,i,a),e=r["defaultColor"],i=rt(r,["defaultColor"]),a=function(t,e){var n,[t,r,i,a]=t,o=B1();return Kc(e)?(n=B0(e=e.getCenter(),t),o.moveTo(t[0],t[1]),o.quadraticCurveTo(e[0],e[1],i[0],i[1]),q0(o,i,a,e,n),o.quadraticCurveTo(e[0],e[1],r[0],r[1]),q0(o,r,t,e,n),o.closePath()):(o.moveTo(t[0],t[1]),o.bezierCurveTo(t[0]/2+i[0]/2,t[1],t[0]/2+i[0]/2,i[1],i[0],i[1]),o.lineTo(a[0],a[1]),o.bezierCurveTo(a[0]/2+r[0]/2,a[1],a[0]/2+r[0]/2,r[1],r[0],r[1]),o.lineTo(t[0],t[1]),o.closePath()),o}(t,n);return ot(new nt.Path).call(j,i).style("d",a.toString()).style("fill",o||e).style("stroke",o||e).style("transform",s).call(j,l).node()}};N2.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const P2=t=>{const m=rt(t,[]);return(t,e,n,r)=>{var i,a,o,s,l,c,u,{mark:e,shape:f,defaultShape:h,color:d,transform:p}=e,r=$0(r,e,f,h),{defaultColor:e,fill:f=e,stroke:h=e}=r,e=rt(r,["defaultColor","fill","stroke"]),g=(r=t,t=n,n=B1(),Kc(t)?([i,a]=t=t.getCenter(),o=F0(R0(r[0],t)),s=F0(R0(r[1],t)),g=B0(t,r[2]),l=B0(t,r[3]),c=B0(t,r[8]),u=B0(t,r[10]),t=B0(t,r[11]),n.moveTo(...r[0]),n.arc(i,a,g,o,s),n.arc(i,a,g,s,o,!0),n.moveTo(...r[2]),n.lineTo(...r[3]),n.moveTo(...r[4]),n.arc(i,a,l,o,s),n.lineTo(...r[6]),n.arc(i,a,u,s,o,!0),n.closePath(),n.moveTo(...r[8]),n.arc(i,a,c,o,s),n.arc(i,a,c,s,o,!0),n.moveTo(...r[10]),n.lineTo(...r[11]),n.moveTo(...r[12]),n.arc(i,a,t,o,s),n.arc(i,a,t,s,o,!0)):(n.moveTo(...r[0]),n.lineTo(...r[1]),n.moveTo(...r[2]),n.lineTo(...r[3]),n.moveTo(...r[4]),n.lineTo(...r[5]),n.lineTo(...r[6]),n.lineTo(...r[7]),n.closePath(),n.moveTo(...r[8]),n.lineTo(...r[9]),n.moveTo(...r[10]),n.lineTo(...r[11]),n.moveTo(...r[12]),n.lineTo(...r[13])),n);return ot(new nt.Path).call(j,e).style("d",g.toString()).style("stroke",h).style("fill",d||f).style("transform",p).call(j,m).node()}};P2.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const C2=t=>{const m=rt(t,[]);return(t,e,n,r)=>{var i,a,o,s,l,c,u,{mark:e,shape:f,defaultShape:h,color:d,transform:p}=e,r=$0(r,e,f,h),{defaultColor:e,fill:f=e,stroke:h=e}=r,e=rt(r,["defaultColor","fill","stroke"]),g=(r=t,t=n,n=4,u=B1(),Kc(t)?([i,a]=t=t.getCenter(),o=B0(t,r[3]),s=B0(t,r[8]),g=B0(t,r[10]),l=(t=F0(R0(r[2],t)))-(c=Math.asin(n/s)),t+=c,u.moveTo(...r[2]),u.lineTo(...r[3]),u.moveTo(Math.cos(l)*o+i,Math.sin(l)*o+a),u.arc(i,a,o,l,t),u.lineTo(Math.cos(t)*g+i,Math.sin(t)*g+a),u.arc(i,a,g,t,l,!0),u.lineTo(Math.cos(l)*o+i,Math.sin(l)*o+a),u.closePath(),u.moveTo(...r[10]),u.lineTo(...r[11]),c=(l+t)/2,u.moveTo(Math.cos(c)*(s+n/2)+i,Math.sin(c)*(s+n/2)+a),u.arc(Math.cos(c)*s+i,Math.sin(c)*s+a,n/2,c,2*Math.PI+c)):(u.moveTo(...r[2]),u.lineTo(...r[3]),u.lineTo(r[3][0]-n,r[3][1]),u.lineTo(r[10][0]-n,r[10][1]),u.lineTo(r[10][0]+n,r[10][1]),u.lineTo(r[3][0]+n,r[3][1]),u.lineTo(...r[3]),u.closePath(),u.moveTo(...r[10]),u.lineTo(...r[11]),u.moveTo(r[3][0]+n/2,r[8][1]),u.arc(r[3][0],r[8][1],n/2,0,2*Math.PI)),u.closePath(),u);return ot(new nt.Path).call(j,e).style("d",g.toString()).style("stroke",h).style("fill",d||f).style("transform",p).call(j,m).node()}};C2.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const R2=t=>{const{arrow:c,arrowSize:u=4}=t,f=rt(t,["arrow","arrowSize"]);return(t,e,n,r)=>{var i,a,{mark:o,shape:s,defaultShape:l}=e,r=$0(r,o,s,l),{defaultColor:o,lineWidth:s}=r,l=rt(r,["defaultColor","lineWidth"]),{color:r=o,size:o=s}=e,s=c?(s=u,i=Object.assign({fill:f.stroke||r,stroke:f.stroke||r},at(f,"arrow")),new nt.Path({style:Object.assign({path:`M ${s},${s} L -${s},0 L ${s},-${s} L 0,0 Z`,anchor:"0.5 0.5",transformOrigin:"center"},i)})):null,t=(i=t,Kc(t=n)?(t=t.getCenter(),V1()({startAngle:0,endAngle:2*Math.PI,outerRadius:B0(i[0],t),innerRadius:B0(i[1],t)})):Z1().x(t=>t[0]).y(t=>t[1])(i)),n=(n=n,e=e.transform,Kc(n)?([n,a]=n.getCenter(),`translate(${n}, ${a}) `+(e||"")):e);return ot(new nt.Path({})).call(j,l).style("d",t).style("stroke",r).style("lineWidth",o).style("transform",n).style("markerEnd",s).call(j,f).node()}};function I2(t,e,n){return[["M",t,e],["L",t+2*n,e-n],["L",t+2*n,e+n],["Z"]]}R2.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const B2=Eg(t=>{var e=t.attributes,{points:n,endMarker:r=!0}=e,e=rt(e,["points","class","endMarker","direction"]),i=at(e,"endMarker"),n=(n=n,Z1().x(t=>t[0]).y(t=>t[1])(n));ot(t).maybeAppend("connector","path").style("path",n).style("markerEnd",r?new py({className:"marker",style:Object.assign(Object.assign({},i),{symbol:I2})}):null).call(j,e)});const F2=t=>{const{offset:s=0,connectLength1:l}=t,c=rt(t,["offset","connectLength1"]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=$0(r,i,a,o),{defaultColor:i,connectLength1:a=l}=r,o=rt(r,["defaultColor","connectLength1"]),{color:r,transform:e}=e,n=function(t,e,n,r=0){var[[e,i],[a,o]]=e;if(Uc(t)){const l=n;var t=e+l,s=t+r;return[[t,i],[s,i],[s,o],[a+l,o]]}const l=-n;return t=i+l,[[e,t],[e,s=t+-r],[a,s],[a,o+l]]}(n,t,s,a);return ot(new B2).call(j,o).style("points",n).style("stroke",r||i).style("transform",e).call(j,c).node()}};function D2(t){return t.replace(/-(\w)/g,function(t,e){return e.toUpperCase()})}function z2(t,e,a,n){var r=a["bounds"];const[[o,s],[i,l]]=r,c=i-o,u=l-s;r=t=>{var{x:e,y:n}=t,r=Yu(a.x,c),i=Yu(a.y,u);return Object.assign(Object.assign({},t),{x:(r||e)+o,y:(i||n)+s})};return r("left"===t?{x:0,y:u/2,textAnchor:"start",textBaseline:"middle"}:"right"===t?{x:c,y:u/2,textAnchor:"end",textBaseline:"middle"}:"top"===t?{x:c/2,y:0,textAnchor:"center",textBaseline:"top"}:"bottom"===t?{x:c/2,y:u,textAnchor:"center",textBaseline:"bottom"}:"top-left"===t?{x:0,y:0,textAnchor:"start",textBaseline:"top"}:"top-right"===t?{x:c,y:0,textAnchor:"end",textBaseline:"top"}:"bottom-left"===t?{x:0,y:u,textAnchor:"start",textBaseline:"bottom"}:"bottom-right"===t?{x:c,y:u,textAnchor:"end",textBaseline:"bottom"}:{x:c/2,y:u/2,textAnchor:"center",textBaseline:"middle"})}function W2(r,i,t,e){var{y:t,y1:n,autoRotate:a,rotateToAlignArc:o}=t;const s=e.getCenter(),{innerRadius:l,outerRadius:c,startAngle:u,endAngle:f}=Y0(e,i,[t,n]),h="inside"===r?(u+f)/2:f;e=q2(h,a,o),t=(()=>{var[t,e]=i,n=l+.5*(c-l),[n,t]="inside"===r?G2(s,h,n):G0(t,e);return{x:n,y:t}})();return Object.assign(Object.assign({},t),{textAlign:"inside"===r?"center":"start",textBaseline:"middle",rotate:e})}function G2(t,e,n){return[t[0]+Math.sin(e)*n,t[1]-Math.cos(e)*n]}function q2(t,e,n){return e?(e=n?0:Math.sin(t)<0?90:-90,t/Math.PI*180+e):0}function H2(t,e,n,r){var{y:n,y1:i,autoRotate:a,rotateToAlignArc:o,radius:s=.5,offset:l=0}=n,e=Y0(r,e,[n,i]),{startAngle:n,endAngle:i}=e,r=r.getCenter(),n=(n+i)/2,i={textAlign:"center",textBaseline:"middle",rotate:q2(n,a,o)},{innerRadius:a,outerRadius:o}=e,[e,r]=G2(r,n,a+(o-a)*s+l);return Object.assign({x:e,y:r},i)}function V2(t,e,n){var n=n["bounds"],[n]=n;return{x:n[0],y:n[1]}}function Y2(t,e,n,r){var i=n["bounds"];return 1===i.length?V2(0,0,n):(Xc(r)?W2:tu(r)?H2:z2)(t,e,n,r)}function $2(t,e,n){var{innerRadius:n,outerRadius:t}=Y0(n,t,[e.y,e.y1]);return n+(t-n)}function U2(t,e,n){var{startAngle:n,endAngle:t}=Y0(n,t,[e.y,e.y1]);return(n+t)/2}function K2(t,e,n,r){var{autoRotate:i,rotateToAlignArc:a,offset:o=0,connector:s=!0,connectorLength:l=o,connectorLength2:c=0,connectorDistance:u=0}=n,f=r.getCenter(),h=U2(e,n,r),d=0Math.abs(t[1]-o[e][1])),i=(l=t=>[a[t][0],(a[t][1]+o[t][1])/2])(e=Math.max(Math.min(e,i-2),1)),s=l(e-1),l=F0(R0(l(e+1),s))/Math.PI*180;return{x:i[0],y:i[1],transform:`rotate(${l})`,textAlign:"center",textBaseline:"middle"}},bottom:Y2,bottomLeft:Y2,bottomRight:Y2,inside:Y2,left:Y2,outside:function(t,e,n,r){var i=n["bounds"];return 1===i.length?V2(0,0,n):(Xc(r)?W2:tu(r)?K2:z2)(t,e,n,r)},right:Y2,spider:function(t,e,n,r){var i,a,o,s,l,c;return tu(r)?({connectorLength:c,connectorLength2:i,connectorDistance:a}=n,o=rt(K2(0,e,n,r),[]),s=r.getCenter(),l=$2(e,n,r),e=U2(e,n,r),n=l+c+i,r=0"polar"===t[0]);if(t)return Math.max(e,n)/2*t[4]}return 0}(r)+o,o=D0([n-l[0],s-l[1]]),n=0(t,e,n,r)=>{var{text:i,transform:a="",transformOrigin:o}=e,s=rt(e,["text","x","y","transform","transformOrigin"]),t=Z2(t,e,n,r,l),{rotate:e=0,transform:r=""}=t,t=rt(t,["rotate","transform"]);return ot(new g2).call(j,t).style("text",""+i).style("labelTransform",(r+` rotate(${+e}) `+a).trim()).style("labelTransformOrigin",o).style("coordCenter",n.getCenter()).call(j,s).node()},J2=(Q2.props={defaultMarker:"point"},t=>{const s=t["colorAttribute"],l=rt(t,["arrow","colorAttribute"]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=rt($0(r,i,a,o),["stroke"]),{d:i,color:a}=e,[o,e]=n.getSize();return ot(new nt.Path).call(j,r).style("d","function"==typeof i?i({width:o,height:e}):i).style(s,a).call(j,l).node()}}),tx=(J2.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},t=>J2(Object.assign({colorAttribute:"fill"},t))),ex=(tx.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},t=>J2(Object.assign({fill:"none",colorAttribute:"stroke"},t))),nx=(ex.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},t=>{const c=rt(t,[]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o,transform:s}=e,r=$0(r,i,a,o),i=r["defaultColor"],a=rt(r,["defaultColor"]),{color:o=i}=e,[r,...e]=t;const l=B1();return l.moveTo(...r),e.forEach(([t,e])=>{l.lineTo(t,e)}),l.closePath(),ot(new nt.Path).call(j,a).style("d",l.toString()).style("stroke",o||i).style("fill",o||i).style("fillOpacity",.4).style("transform",s).call(j,c).node()}});function rx(t){var n,r,i,a=t||1;function o(t,e){++n>a&&(i=r,s(1),++n),r[t]=e}function s(t){n=0,r=Object.create(null),t||(i=Object.create(null))}return s(),{clear:s,has:function(t){return void 0!==r[t]||void 0!==i[t]},get:function(t){var e=r[t];return void 0!==e?e:void 0!==(e=i[t])?(o(t,e),e):void 0},set:function(t,e){void 0!==r[t]?r[t]=e:o(t,e)}}}function ix(t,e,n){t=t?t():document.createElement("canvas");return t.width=e,t.height=n,t}nx.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},rx(3);const ax=function(n,r,t=16){const i=rx(t);return(...t)=>{var e=r(...t);i.get(e);return i.has(e)?i.get(e):(t=n(...t),i.set(e,t),t)}}((t,e,n)=>{var n=ix(n,2*t,2*t),r=n.getContext("2d"),i=t,a=t;return 1===e?(r.beginPath(),r.arc(i,a,t,0,2*Math.PI,!1),r.fillStyle="rgba(0,0,0,1)",r.fill()):((e=r.createRadialGradient(i,a,t*e,i,a,t)).addColorStop(0,"rgba(0,0,0,1)"),e.addColorStop(1,"rgba(0,0,0,0)"),r.fillStyle=e,r.fillRect(0,0,2*t,2*t)),n},t=>""+t);function ox(t,e,n,r,i,a,o){a=Object.assign({blur:.85,minOpacity:0,opacity:.6,maxOpacity:1,gradient:[[.25,"rgb(0,0,255)"],[.55,"rgb(0,255,0)"],[.85,"yellow"],[1,"rgb(255,0,0)"]]},a);a.minOpacity*=255,a.opacity*=255,a.maxOpacity*=255;var s=ix(o,t,e).getContext("2d"),l=function(t,e){const n=(e=ix(e,256,1).getContext("2d")).createLinearGradient(0,0,256,1);return("string"==typeof(t=t)?t.split(" ").map(t=>{var[t,e]=t.split(":");return[+t,e]}):t).forEach(([t,e])=>{n.addColorStop(t,e)}),e.fillStyle=n,e.fillRect(0,0,256,1),e.getImageData(0,0,256,1).data}(a.gradient,o);s.clearRect(0,0,t,e);{var c=s,u=n,f=r,h=i,d=o,p=(n=a)["blur"];let t=h.length;for(;t--;){var{x:g,y:m,value:y,radius:v}=h[t],y=Math.min(y,f),g=g-v,m=m-v,v=ax(v,1-p,d);c.globalAlpha=Math.max((y-u)/(f-u),.001),c.drawImage(v,g,m)}}r=function(t,e,n,r,i){var{minOpacity:a,opacity:o,maxOpacity:s,useGradientOpacity:l}=i,c=(i=t.getImageData(0,0,e,n)).data,u=c.length;for(let t=3;t{const{gradient:h,opacity:d,maxOpacity:p,minOpacity:g,blur:m,useGradientOpacity:y}=t,v=rt(t,["gradient","opacity","maxOpacity","minOpacity","blur","useGradientOpacity"]);return(t,e,n,r,i,a)=>{var o,s,{mark:e,shape:l,defaultShape:c,transform:u}=e,r=rt($0(r,e,l,c),[]),e=a["createCanvas"],[l,c]=n.getSize(),a=t.map(t=>({x:t[0],y:t[1],value:t[2],radius:t[3]})),n=Bc(t,t=>t[2]),t=Rc(t,t=>t[2]),f={gradient:h,opacity:d,minOpacity:g,maxOpacity:p,blur:m,useGradientOpacity:y},n=l&&c?ox(l,c,n,t,a,(o=f,s=t=>void 0===t,Object.assign({},o),Object.keys(o).reduce((t,e)=>{var n=o[e];return s(n,e)||(t[e]=n),t},{})),e):{canvas:null};return ot(new nt.Image).call(j,r).style("x",0).style("y",0).style("width",l).style("height",c).style("src",n.canvas).style("transform",u).call(j,v).node()}},lx=(sx.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},t=>{const a=t["render"],o=rt(t,["render"]);return(t,e,n,r)=>{var[[t,i]]=t;return a(Object.assign(Object.assign({},o),{x:t,y:i}))}}),u=(lx.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},{BLACK:"#000",WHITE:"#fff",STROKE:"#416180"}),cx=t=>{var e={defaultColor:"#5B8FF9",defaultCategory10:"category10",defaultCategory20:"category20",defaultSize:1,elementActiveStroke:u.BLACK,enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},viewFill:"transparent",plotFill:"transparent",mainFill:"transparent",contentFill:"transparent",line:{line:{fill:"",strokeOpacity:1,lineWidth:1}},point:{point:{r:3,fillOpacity:.95,lineWidth:0},hollow:{r:3,strokeOpacity:.95,lineWidth:1},plus:{r:3,strokeOpacity:.95,lineWidth:3},diamond:{r:3,strokeOpacity:.95,lineWidth:1}},interval:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},area:{area:{fillOpacity:.85,lineWidth:0}},polygon:{polygon:{fillOpacity:.95}},cell:{cell:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},rect:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},link:{link:{fill:"",strokeOpacity:1}},vector:{vector:{fillOpacity:1}},box:{box:{fillOpacity:.95,stroke:u.BLACK,lineWidth:1}},text:{text:{fill:"#1D2129",fontSize:12,strokeWidth:0,connectorStroke:u.STROKE,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:u.STROKE,backgroundFillOpacity:.15,backgroundPadding:[2,4],startMarkerSymbol:"circle",startMarkerSize:4,endMarkerSymbol:"circle",endMarkerSize:4},badge:{fill:"#1D2129",fillOpacity:.65,strokeWidth:0,fontSize:10,textAlign:"center",textBaseline:"middle",markerFill:u.STROKE,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:u.STROKE,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:u.STROKE,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:u.STROKE,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:u.STROKE,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:u.STROKE,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:u.STROKE,endMarkerFillOpacity:.95}},interaction:{active:{line:{line:{lineWidth:3}},interval:{rect:{stroke:u.BLACK}},area:{area:{fillOpacity:.5}}},inactive:{area:{area:{fillOpacity:.3}}},selected:{},disabled:{}},axis:{arrow:!1,gridLineDash:[0,0],gridLineWidth:.5,gridStroke:u.BLACK,gridStrokeOpacity:.05,labelAlign:"horizontal",labelFill:u.BLACK,labelFillOpacity:.65,labelFontSize:12,labelFontWeight:"lighter",labelSpacing:8,line:!1,lineLineWidth:.5,lineStroke:u.BLACK,lineStrokeOpacity:.45,tickLength:4,tickLineWidth:1,tickStroke:u.BLACK,tickStrokeOpacity:.25,titleFill:u.BLACK,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:12,titleTransformOrigin:"center"},axisTop:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"top",titleSpacing:0,titleTextBaseline:"middle"},axisBottom:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,labelAutoRotate:!0,tickDirection:"positive",titlePosition:"bottom",titleSpacing:10,titleTextBaseline:"bottom"},axisLeft:{gridDirection:"negative",labelAutoRotate:!1,labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"left",titleSpacing:10,titleTextBaseline:"middle",titleTransform:"translate(50%, 0) rotate(-90)",titleTransformOrigin:"center"},axisRight:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,labelAutoRotate:!1,tickDirection:"negative",titlePosition:"right",titleSpacing:0,titleTextBaseline:"top",titleTransform:"translate(-50%, 0) rotate(-90)",titleTransformOrigin:"center"},axisLinear:{girdClosed:!0,gridConnect:"arc",gridDirection:"negative",gridType:"surround",titlePosition:"top",titleSpacing:0},axisRadar:{girdClosed:!0,gridStrokeOpacity:.3,gridType:"surround",label:!1,tick:!1,titlePosition:"start"},legend:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:u.BLACK,itemLabelFillOpacity:.65,itemLabelFontSize:12,itemLabelFontWeight:"normal",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[5,8],itemValueFill:u.BLACK,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"normal",navButtonFill:u.BLACK,navButtonFillOpacity:.65,navPageNumFill:u.BLACK,navPageNumFillOpacity:.45,navPageNumFontSize:12,padding:8,title:!1,titleFill:u.BLACK,titleFillOpacity:.45,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4},continuousLegend:{handleHeight:12,handleLabelFill:u.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal",handleMarkerFill:u.BLACK,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:u.BLACK,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:u.BLACK,labelFillOpacity:.45,labelFontSize:12,labelFontWeight:"normal",labelSpacing:8,tick:!0},label:{fill:u.BLACK,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:u.BLACK,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:u.WHITE,fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},slider:{trackSize:16,trackFill:u.STROKE,trackFillOpacity:1,selectionFill:"#5B8FF9",selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:u.BLACK,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:u.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},scrollbar:{padding:[2,2,2,2],trackSize:10,isRound:!0,slidable:!0,scrollable:!0,trackFill:"#e5e5e5",trackFillOpacity:0,thumbFill:"#000",thumbFillOpacity:.15,thumbHighlightedFillOpacity:.2},title:{titleFill:u.BLACK,titleFillOpacity:.85,titleFontSize:14,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:u.BLACK,subtitleFillOpacity:.65,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}};return Object.assign({},e,t)},f=(cx.props={},{BLACK:"#fff",WHITE:"#000",STROKE:"#416180"}),ux=t=>{var e={defaultColor:"#5B8FF9",defaultCategory10:"category10",defaultCategory20:"category20",defaultSize:1,elementActiveStroke:f.BLACK,enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},viewFill:"#141414",plotFill:"transparent",mainFill:"transparent",contentFill:"transparent",line:{line:{fill:"",strokeOpacity:1,lineWidth:1}},point:{point:{r:3,fillOpacity:.95,lineWidth:0},hollow:{r:3,strokeOpacity:.95,lineWidth:1},plus:{r:3,strokeOpacity:.95,lineWidth:3},diamond:{r:3,strokeOpacity:.95,lineWidth:1}},interval:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},area:{area:{fillOpacity:.85,lineWidth:0}},polygon:{polygon:{fillOpacity:.95}},cell:{cell:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},rect:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},link:{link:{fill:"",strokeOpacity:1}},vector:{vector:{fillOpacity:1}},box:{box:{fillOpacity:.95,stroke:f.BLACK,lineWidth:1}},text:{text:{fill:f.BLACK,fillOpacity:.65,fontSize:12,strokeWidth:0,connectorStroke:f.STROKE,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:f.STROKE,backgroundFillOpacity:.15,backgroundPadding:[2,4],startMarkerSymbol:"circle",startMarkerSize:4,endMarkerSymbol:"circle",endMarkerSize:4},badge:{fill:"#1D2129",fillOpacity:.65,strokeWidth:0,fontSize:10,textAlign:"center",textBaseline:"middle",markerFill:f.STROKE,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:f.STROKE,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:f.STROKE,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:f.STROKE,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:f.STROKE,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:f.STROKE,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:f.STROKE,endMarkerFillOpacity:.95}},interaction:{active:{line:{line:{lineWidth:3}},interval:{rect:{stroke:f.BLACK}},area:{area:{fillOpacity:.5}}},inactive:{area:{area:{fillOpacity:.3}}},selected:{},disabled:{}},axis:{arrow:!1,gridLineDash:[0,0],gridLineWidth:.5,gridStroke:f.BLACK,gridStrokeOpacity:.05,labelAlign:"horizontal",labelFill:f.BLACK,labelFillOpacity:.65,labelFontSize:12,labelFontWeight:"lighter",labelSpacing:8,lineLineWidth:.5,lineStroke:f.BLACK,lineStrokeOpacity:.45,tickLength:4,tickLineWidth:1,tickStroke:f.BLACK,tickStrokeOpacity:.25,titleFill:f.BLACK,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:12,titleTransformOrigin:"center"},axisTop:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"top",titleSpacing:0,titleTextBaseline:"middle"},axisBottom:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"bottom",titleSpacing:10,titleTextBaseline:"bottom"},axisLeft:{gridDirection:"negative",labelAutoRotate:!1,labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"left",titleSpacing:10,titleTextBaseline:"middle",titleTransform:"translate(50%, 0) rotate(-90)",titleTransformOrigin:"center"},axisRight:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"right",titleSpacing:0,titleTextBaseline:"top",titleTransform:"translate(-50%, 0) rotate(-90)",titleTransformOrigin:"center"},axisLinear:{girdClosed:!0,gridConnect:"arc",gridDirection:"negative",gridType:"surround",titlePosition:"top",titleTextBaseline:"bottom"},axisRadar:{girdClosed:!0,gridStrokeOpacity:.3,gridType:"surround",label:!1,tick:!1,titlePosition:"start"},legend:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:f.BLACK,itemLabelFillOpacity:.65,itemLabelFontSize:12,itemLabelFontWeight:"normal",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[5,8],itemValueFill:f.BLACK,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"normal",navButtonFill:f.BLACK,navButtonFillOpacity:.45,navPageNumFill:f.BLACK,navPageNumFillOpacity:.45,navPageNumFontSize:12,padding:8,title:!1,titleFill:f.BLACK,titleFillOpacity:.45,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4},continuousLegend:{handleHeight:12,handleLabelFill:f.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal",handleMarkerFill:f.BLACK,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:f.BLACK,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:f.BLACK,labelFillOpacity:.45,labelFontSize:12,labelFontWeight:"normal"},label:{fill:f.BLACK,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:f.BLACK,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:f.WHITE,fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},slider:{trackSize:16,trackFill:f.STROKE,trackFillOpacity:1,selectionFill:"#5B8FF9",selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:f.BLACK,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:f.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},scrollbar:{},title:{titleFill:f.BLACK,titleFillOpacity:.85,titleFontSize:14,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:f.BLACK,subtitleFillOpacity:.65,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}};return Object.assign({},e,t)},fx=(ux.props={},{BLACK:"#000",WHITE:"#fff",STROKE:"#888"}),hx=t=>{var e={defaultColor:"#4e79a7",defaultCategory10:"tableau10",defaultCategory20:"tableau10",defaultSize:1,elementActiveStroke:fx.BLACK,enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},viewFill:"transparent",plotFill:"transparent",mainFill:"transparent",contentFill:"transparent",line:{line:{fill:"",strokeOpacity:1,lineWidth:1,connectStroke:"#aaa"}},point:{point:{r:3,fillOpacity:.95,lineWidth:0},hollow:{r:3,strokeOpacity:.95,lineWidth:1},plus:{r:3,strokeOpacity:.95,lineWidth:3},diamond:{r:3,strokeOpacity:.95,lineWidth:1}},interval:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},area:{area:{fillOpacity:.85,lineWidth:0,connectFill:fx.BLACK,connectFillOpacity:.1}},polygon:{polygon:{fillOpacity:.95}},cell:{cell:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},rect:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},link:{link:{fill:"",strokeOpacity:1}},vector:{vector:{fillOpacity:1}},box:{box:{fillOpacity:.95,stroke:"#1D2129",lineWidth:1}},text:{text:{fill:"#1D2129",fontSize:10,strokeWidth:0,connectorStroke:fx.STROKE,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:fx.STROKE,backgroundFillOpacity:.15,backgroundPadding:[2,4],startMarkerSymbol:"circle",startMarkerSize:4,endMarkerSymbol:"circle",endMarkerSize:4},badge:{fill:"#1D2129",fillOpacity:.65,strokeWidth:0,fontSize:10,textAlign:"center",textBaseline:"middle",markerFill:fx.STROKE,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:fx.STROKE,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:fx.STROKE,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:fx.STROKE,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:fx.STROKE,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:fx.STROKE,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:fx.STROKE,endMarkerFillOpacity:.95}},interaction:{active:{line:{line:{lineWidth:3}},interval:{rect:{stroke:fx.BLACK}},area:{area:{fillOpacity:.5}}},inactive:{area:{area:{fillOpacity:.3}}},selected:{},disabled:{}},axis:{arrow:!1,gridLineDash:[0,0],gridLineWidth:1,gridStroke:"#ddd",gridStrokeOpacity:1,labelAlign:"horizontal",labelAutoRotate:!1,labelFill:fx.BLACK,labelFillOpacity:1,labelFontSize:10,labelFontWeight:"normal",labelSpacing:4,line:!0,lineLineWidth:1,lineStroke:"#888",lineStrokeOpacity:1,tickLength:5,tickLineWidth:1,tickStroke:fx.STROKE,tickStrokeOpacity:1,titleFill:fx.BLACK,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold",titleSpacing:12,titleTransformOrigin:"center"},axisTop:{gridDirection:"positive",labelDirection:"negative",tickDirection:"negative",titlePosition:"top",titleSpacing:0,titleTextBaseline:"middle",labelSpacing:4},axisBottom:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"bottom",titleSpacing:4,titleTextBaseline:"bottom"},axisLeft:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"left",titleSpacing:4,titleTextBaseline:"middle",titleTransform:"translate(50%, 0) rotate(-90) translate(0, -50%)",titleTransformOrigin:"center"},axisRight:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"right",titleSpacing:0,titleTextBaseline:"top",titleTransform:"translate(-50%, 0) rotate(-90)",titleTransformOrigin:"center"},axisLinear:{girdClosed:!0,gridConnect:"arc",gridDirection:"negative",gridType:"surround",titlePosition:"top",titleTextBaseline:"bottom"},axisRadar:{girdClosed:!0,gridStrokeOpacity:.3,gridType:"surround",label:!1,tick:!1,titlePosition:"start"},legend:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:fx.BLACK,itemLabelFillOpacity:1,itemLabelFontSize:10,itemLabelFontWeight:"normal",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[5,4],itemValueFill:fx.BLACK,itemValueFillOpacity:1,itemValueFontSize:10,itemValueFontWeight:"normal",navButtonFill:fx.BLACK,navButtonFillOpacity:.45,navButtonSize:6,navPageNumFill:fx.BLACK,navPageNumFillOpacity:.45,navPageNumFontSize:10,padding:8,title:!1,titleFill:fx.BLACK,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold",titleSpacing:4},continuousLegend:{handleHeight:12,handleLabelFill:fx.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:10,handleLabelFontWeight:"normal",handleMarkerFill:fx.BLACK,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:fx.BLACK,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:fx.BLACK,labelFillOpacity:.45,labelFontSize:10,labelFontWeight:"normal",title:!1},label:{fill:fx.BLACK,fillOpacity:.65,fontSize:10,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:fx.BLACK,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:fx.WHITE,fontSize:10,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},slider:{trackSize:16,trackFill:fx.STROKE,trackFillOpacity:.05,selectionFill:"#4e79a7",selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:fx.BLACK,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:fx.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:10,handleLabelFontWeight:"normal"},scrollbar:{},title:{titleFill:fx.BLACK,titleFillOpacity:.85,titleFontSize:14,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:fx.BLACK,subtitleFillOpacity:.65,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}};return Object.assign({},e,t)};function dx(t,e){var n;return(e=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0?null:[1<(n=t.slice(0,e)).length?n[0]+n.slice(2):n,+t.slice(e+1)]}hx.props={};var px,gx=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function mx(t){var e;if(e=gx.exec(t))return new yx({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]});throw new Error("invalid format: "+t)}function yx(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+""}function vx(t,e){var n,e=dx(t,e);return e?(n=e[0],(e=e[1])<0?"0."+new Array(-e).join("0")+n:n.length>e+1?n.slice(0,e+1)+"."+n.slice(e+1):n+new Array(e-n.length+2).join("0")):t+""}mx.prototype=yx.prototype,yx.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};var bx={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return 1e21<=Math.abs(t=Math.round(t))?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},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)=>vx(100*t,e),r:vx,s:function(t,e){var n,r,i=dx(t,e);return i?(n=i[0],(i=(i=i[1])-(px=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1)===(r=n.length)?n:rMath.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function xx(t){return t}var wx,Mx=Array.prototype.map,Ox=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function kx(t){var e,s,l,M=void 0===t.grouping||void 0===t.thousands?xx:(s=Mx.call(t.grouping,Number),l=t.thousands+"",function(t,e){for(var n=t.length,r=[],i=0,a=s[0],o=0;0e));)a=s[i=(i+1)%s.length];return r.reverse().join(l)}),r=void 0===t.currency?"":t.currency[0]+"",i=void 0===t.currency?"":t.currency[1]+"",O=void 0===t.decimal?".":t.decimal+"",k=void 0===t.numerals?xx:(e=Mx.call(t.numerals,String),function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}),a=void 0===t.percent?"%":t.percent+"",_=void 0===t.minus?"−":t.minus+"",E=void 0===t.nan?"NaN":t.nan+"";function o(t){var c=(t=mx(t)).fill,u=t.align,f=t.sign,e=t.symbol,h=t.zero,d=t.width,p=t.comma,g=t.precision,m=t.trim,y=t.type,v=("n"===y?(p=!0,y="g"):bx[y]||(void 0===g&&(g=12),m=!0,y="g"),(h||"0"===c&&"="===u)&&(h=!0,c="0",u="="),"$"===e?r:"#"===e&&/[boxX]/.test(y)?"0"+y.toLowerCase():""),b="$"===e?i:/[%p]/.test(y)?a:"",x=bx[y],w=/[defgprs%]/.test(y);function n(t){var e,n,r,i=v,a=b;if("c"===y)a=x(t)+a,t="";else{var o=(t=+t)<0||1/t<0;if(t=isNaN(t)?E:x(Math.abs(t),g),m&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r>1)+i+t+a+l.slice(s);break;default:t=l+i+t+a}return k(t)}return g=void 0===g?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),n.toString=function(){return t+""},n}return{format:o,formatPrefix:function(t,e){var n=o(((t=mx(t)).type="f",t)),e=3*Math.max(-8,Math.min(8,Math.floor((t=e,((t=dx(Math.abs(t)))?t[1]:NaN)/3)))),r=Math.pow(10,-e),i=Ox[8+e/3];return function(t){return n(r*t)+i}}}}function _x(t,e,n){return t.querySelector(e)?ot(t).select(e):ot(t).append(n)}function Ex(t){return Array.isArray(t)?t.join(", "):""+(t||"")}function Sx(t,e){var n={display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"};if(e)return Object.assign(Object.assign({},n),e);let{flexDirection:r,justifyContent:i,alignItems:a}=n;e={top:["row","flex-start","center"],bottom:["row","flex-start","center"],left:["colunm","center","center"],right:["colunm","center","center"],center:["column","center","center"]};return t in e&&([r,i,a]=e[t]),{display:"flex",flexDirection:r,justifyContent:i,alignItems:a}}Wo=kx({thousands:",",grouping:[3],currency:["$",""]}),wx=Wo.format,Wo.formatPrefix;class Ax extends mo{get child(){var t;return null==(t=this.children)?void 0:t[0]}update(t){var e,t=(this.attr(t),t)["subOptions"];null!=(e=this.child)&&e.update(t)}}class Lx extends Ax{update(t){var e,t=t["subOptions"];null!=(e=this.child)&&e.update(t)}}function Tx(t,e){return null==(t=t.filter(t=>t.getOptions().name===e))?void 0:t[0]}function jx(t,e,n){var t=t["bbox"],{position:e="top",size:r,length:i}=e,e=["top","bottom","center"].includes(e),[t,a]=e?[t.height,t.width]:[t.width,t.height],{defaultSize:n,defaultLength:o}=n.props,r=r||n||t,n=i||o||a,[t,i]=e?[n,r]:[r,n];return{orientation:e?"horizontal":"vertical",width:t,height:i,size:r,length:n}}function Nx(t){const n=["arrow","crosshairs","grid","handle","handleLabel","indicator","label","line","tick","tip","title","trunc"];var e=t["style"],t=rt(t,["style"]);const r={};return Object.entries(t).forEach(([t,e])=>{n.includes(t)?r["show"+Qe(t)]=e:r[t]=e}),Object.assign(Object.assign({},r),e)}function Px(t){var{innerWidth:t,innerHeight:e}=t.getOptions();return[t,e]}function Cx(t){return"number"!=typeof t||Math.abs(t)<1e-15?t:parseFloat(t.toFixed(15))}function Rx(a,t,e,n,r,i,o,s){void 0===e&&void 0===i||a.update(Object.assign(Object.assign({},e&&{tickCount:e}),i&&{tickMethod:i})),e=t,t=i;var l,t=(i=a).getTicks?i.getTicks():t?([c,l]=pc(e,t=>+t),i=i.getOptions()["tickCount"],t(c,l,i)):e,c=r?t.filter(r):t;const u=t=>!(t instanceof Date)&&"object"==typeof t&&t?t:String(t),f=n||(null==(l=a.getFormatter)?void 0:l.call(a))||u,h=function(t,e){var{innerWidth:e,innerHeight:n,insetTop:r,insetBottom:i,insetLeft:a,insetRight:o}=e.getOptions(),[t,r,i]="left"===t||"right"===t?[r,i,n]:[a,o,e];const s=new i0({domain:[0,1],range:[t/i,1-r/i]});return t=>s.map(t)}(o,s),d=function(r,i){const{width:a,height:o}=i.getOptions();return t=>{var e,n;return Jc(i)?(e=i.map("bottom"===r?[t,1]:[0,t]),"bottom"===r?(n=e[0],new i0({domain:[0,a],range:[0,1]}).map(n)):"left"===r?(n=e[1],new i0({domain:[0,o],range:[0,1]}).map(n)):t):t}}(o,s);return Kc(s)||Uc(s)?c.map((t,e,n)=>{var r,i=(null==(i=a.getBandWidth)?void 0:i.call(a,t))/2||0,i=h(a.map(t)+i);return{value:Xc(s)&&"center"===o||Uc(s)&&(null==(r=a.getTicks)?void 0:r.call(a))&&["top","bottom","center","outer"].includes(o)?1-i:i,label:u(f(Cx(t),e,n)),id:String(e)}}):c.map((t,e,n)=>{var r=(null==(r=a.getBandWidth)?void 0:r.call(a,t))/2||0;return{value:d(h(a.map(t)+r)),label:u(f(Cx(t),e,n)),id:String(e)}})}function Ix(t,e,n){var r;return!(Kc(r=e)&&Uc(r)||Qc(e))&&(void 0===t?!!n.getTicks:t)}function Bx(t,e,n,r,i,a){n=function(t,e){var n=t.axis;let r=t.axisLinear;return["top","right","bottom","left"].includes(e)&&(r=t["axis"+zu(e)]),Object.assign({},n,r)}(n,i);return"center"===i?Object.assign(Object.assign(Object.assign(Object.assign({},n),{labelDirection:"right"===r?"negative":"positive"}),"center"===r?{labelTransform:"translate(50%,0)"}:null),{tickDirection:"right"===r?"negative":"positive",labelSpacing:"center"===r?0:4,titleSpacing:"vertical"===(i=a)||i===-Math.PI/2?10:0,tick:"center"!==r&&void 0}):n}var Fx,us=s=>i=>{const{labelFormatter:a,labelFilter:o=()=>!0}=i;return t=>{var[e]=t["scales"];const r=(null==(n=e.getTicks)?void 0:n.call(e))||e.getOptions().domain;var n="string"==typeof a?wx(a):a,n=Object.assign(Object.assign({},i),{labelFormatter:n,labelFilter:(t,e,n)=>o(r[e],e,r),scale:e});return s(n)(t)}};const Dx=us(t=>{const{direction:o="left",important:s={},labelFormatter:l,orientation:c,position:u,size:f,style:h={},title:d,tickCount:p,tickFilter:g,tickMethod:m,transform:y,indexBBox:v}=t,b=rt(t,["direction","important","labelFormatter","order","orientation","position","size","style","title","tickCount","tickFilter","tickMethod","transform","indexBBox"]);return({scales:[t],value:e,coordinate:n,theme:r})=>{var e=e["bbox"],i=t.getOptions()["domain"],r=Bx(0,0,r,o,u,c),r=Object.assign(Object.assign(Object.assign({},r),h),b),a=function(t,e){var[e,n]=Px(e);return t.includes("bottom")||t.includes("top")?n:e}(u,n),e=function(t,e,n,r){var{x:n,y:i,width:a,height:o}=n;if("bottom"===t)return{startPos:[n,i],endPos:[n+a,i]};if("left"===t)return{startPos:[n+a,i],endPos:[n+a,i+o]};if("right"===t)return{endPos:[n,i+o],startPos:[n,i]};if("top"===t)return{startPos:[n,i+o],endPos:[n+a,i+o]};if("center"===t){if("vertical"===e)return{startPos:[n+a,i],endPos:[n+a,i+o]};if("horizontal"===e)return{startPos:[n,i+o],endPos:[n+a,i+o]};if("number"==typeof e){var[t,s]=r.getCenter(),[l,c]=eu(r);const[u,f]=nu(r);var r=Math.min(a,o)/2,a=l*r,o=c*r,[l,c]=[t+n,s+i],[r,e]=[Math.cos(e),Math.sin(e)];return{startPos:[l+o*r,c+o*e],endPos:[l+a*r,c+a*e],gridClosed:f-u==360,gridCenter:[t+n,i+s],gridControlAngles:new Array(3).fill(0).map((t,e,n)=>(f-u)/(n.length-1)*e)}}}return{}}(u,c,e,n),i=Rx(t,i,p,l,g,m,u,n),i=v?i.map((t,e)=>{e=v.get(e);return!e||e[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:e[1]})}):i,i=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},r),{type:"linear",data:i,crossSize:f,titleText:Ex(d),labelOverlap:function(t=[],e){if(0{e&&i.push(t)};return a({type:"rotate",optionalAngles:[0,15,30,45,60,90]},t),a({type:"ellipsis",minLength:20},n),a({type:"hide"},e),a({type:"wrap",wordWrapWidth:100,maxLines:3,recoveryWhenFail:!0},r),i}(y,r),grid:Ix(r.grid,n,t),gridLength:a,line:!0,indexBBox:v}),r.line?null:{lineOpacity:0}),e),s);return i.labelOverlap.find(t=>"hide"===t.type)&&(i.crossSize=!1),new fb({className:"axis",style:Nx(i)})}}),zx=us(t=>{const{position:o,labelFormatter:s,tickFilter:l,tickCount:c,tickMethod:u,important:f={},style:e={}}=t,h=rt(t,["order","size","position","orientation","labelFormatter","tickFilter","tickCount","tickMethod","important","style"]),{title:d,grid:p=!1}=e;return({scales:[t],value:e,coordinate:n,theme:r})=>{var e=e["bbox"],i=t.getOptions()["domain"],t=Rx(t,i,c,s,l,u,o,n),[i,a]=eu(n),e=function(t,e,n,r,i){var{x:e,y:a,width:o,height:s}=e,e=[e+o/2,a+s/2],a=Math.min(o,s)/2,[o,s]=nu(i),[l,c]=Px(i),e={center:e,radius:a,startAngle:o,endAngle:s,titleFillOpacity:0,titlePosition:"inner",line:!1,tick:!0,gridLength:(r-n)*(Math.min(l,c)/2)};return"inner"===t?(Px(i),Object.assign(Object.assign({},e),{labelAlign:"perpendicular",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",gridDirection:"negative"})):Object.assign(Object.assign({},e),{labelAlign:"parallel",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",gridDirection:"positive"})}(o,e,i,a,n),i=r["axis"];return new fb({style:Nx(it({},i,e,Object.assign(Object.assign({type:"arc",data:t,titleText:Ex(d),grid:p},h),f)))})}}),Wx=(Dx.props={defaultPosition:"center",defaultSize:45,defaultOrder:0},zx.props={defaultPosition:"outer",defaultOrientation:"vertical",defaultSize:45,defaultOrder:0},e=>(...t)=>Dx(Object.assign({},{crossPadding:50},e))(...t)),Gx=(Wx.props=Object.assign(Object.assign({},Dx.props),{defaultPosition:"bottom"}),e=>(...t)=>Dx(Object.assign({},{crossPadding:10},e))(...t));Gx.props=Object.assign(Object.assign({},Dx.props),{defaultPosition:"left"});const qx=a=>{const{important:o={}}=a,s=rt(a,["important"]);return t=>{var e,{theme:n,coordinate:r,value:i}=t;return Dx(Object.assign(Object.assign(Object.assign({},s),(e=a.orientation,(e%=2*Math.PI)==Math.PI/2?{titleTransform:"translate(0, 50%)"}:e>-Math.PI/2&&eMath.PI/2&&e<3*Math.PI/2?{titleTransform:"translate(-50%, 0)"}:{})),{important:Object.assign(Object.assign({},function(t,e,n,r){const i=t["radar"];var[{name:t}]=r["scales"];const[a,o]=nu(n);var{axisRadar:r={}}=e;return Object.assign(Object.assign({},r),{grid:"position"===t,gridConnect:"line",gridControlAngles:new Array(i.count).fill(0).map((t,e)=>{return(o-a)/i.count*e})})}(a,n,r,i)),o)}))(t)}};function Hx(t,e,n,r,i={}){const a=(null==(e=null==(e=e["shape."+t])?void 0:e.props)?void 0:e.defaultMarker)||function(t){if(Re(t))return t[t.length-1]}(t.split("."));return()=>function(t,e){var{fill:n,stroke:r,lineWidth:i,color:a}=e,o=rt(e,["d","fill","strokeWidth","path","stroke","lineWidth","color"]);const s=Ig.get(t)||Ig.get("point");return(...t)=>{return new nt.Path({style:Object.assign(Object.assign({},o),{path:s(...t),stroke:s.style.includes("stroke")?a||r:"",fill:s.style.includes("fill")?a||n:"",lineWidth:s.style.includes("lineWidth")?i||2:0})})}}(a,i)(0,0,6)}function Vx(t,{scales:e,library:n,markState:r}){var i=Tx(e,"shape");const[a,o]=function(t,e){const n=Tx(t,"shape");var r=Tx(t,"color");const i=[];for(const[l,c]of e){var a=l.type,o=(0<(null==r?void 0:r.getOptions().domain.length)?null==r?void 0:r.getOptions().domain:c.data).map((t,e)=>{return n?n.map(t||"point"):(null==(t=null===l||void 0===l?void 0:l.style)?void 0:t.shape)||c.defaultShape||"point"});"string"==typeof a&&i.push([a,o])}if(0===i.length)return["point",["point"]];if(1===i.length)return i[0];if(!n)return i[0];const s=n.getOptions()["range"];return i.map(([t,e])=>{let n=0;for(let t=0;te[0]-t[0])[0][1]}(e,r),s=t["itemMarker"];return i&&!s?(t,e)=>Hx(a+"."+o[e],n,0,0,{color:t.color}):"function"==typeof s?s:(t,e)=>Hx(s||a+"."+o[e],n,0,0,{color:t.color})}function Yx(t,e){var{labelFormatter:n=t=>""+t}=t,r=e["scales"],e={itemMarker:Vx(t,e),itemMarkerSize:(t=Tx(t=r,"size"))?2*t.map(NaN):8,itemMarkerOpacity:function(t){if(t=Tx(t,"opacity")){const n=t.getOptions()["range"];return(t,e)=>n[e]}}(r)};const i="string"==typeof n?wx(n):n,a=Tx(r,"color");t=r.find(t=>0({id:t,label:i(t),color:a.map(t)}))})}qx.props=Object.assign(Object.assign({},Dx.props),{defaultPosition:"center"});const $x=l=>{const{position:c,title:u}=l,f=rt(l,["labelFormatter","layout","order","orientation","position","size","title"]),{gridCol:h,gridRow:d}=f;return t=>{var{value:e,theme:n}=t,r=e["bbox"],{width:i,height:a}=function(t,e,n){var r;if("center"===(r=e["position"])){r=t["bbox"];const{width:i,height:a}=r;return{width:i,height:a}}const{width:i,height:a}=jx(t,e,n);return{width:i,height:a}}(e,l,$x),e=Sx(c,null==(e=null==(e=null==(e=e.scales)?void 0:e[0])?void 0:e.guide)?void 0:e.layout),[o,s]=function(t,e,n){var[r,i]=[e||100,n||100];switch(t){case"top":case"bottom":case"top-left":case"top-right":case"bottom-left":case"bottom-right":return[1,i];case"left":case"right":return[r,1];default:return[e,n]}}(c,d,h),i=Object.assign({orientation:["right","left","center"].includes(c)?"vertical":"horizontal",width:i,height:a,gridCol:null!==h&&void 0!==h?h:s,gridRow:null!==d&&void 0!==d?d:o,rowPadding:0,colPadding:8,titleText:Ex(u)},Yx(l,t)),{legend:a={}}=n,s=Nx(Object.assign({},a,i,f)),o=new Lx({style:Object.assign(Object.assign({x:r.x,y:r.y,width:r.width,height:r.height},e),{subOptions:s})});return o.appendChild(new Ib({className:"legend-category",style:s})),o}};function Ux(t,e,n){var r=e["size"],t=jx(t,e,n),r=(e=r,n=Jx.props.defaultLegendSize,Math.min(e,n));return e=r,r=(n=t).orientation,n.size=e,"horizontal"===(r=r)||0===r?n.height=e:n.width=e,n}function Kx(t,e,n,r,i){var a,e=e.thresholds,o=(a=r,t=>({value:t/a,label:String(t)}));return Object.assign(Object.assign({},t),{color:i,data:[n,...e,r].map(o)})}function Xx(t){var t=t.getOptions()["domain"],[t,e]=[t[0],N0(t)];return[t,e]}function Zx(t,e,n,r,i){const a=t["length"],o=e||(e=n||r,n=(n=i).defaultColor,i=e.getOptions(),(e=e.clone()).update(Object.assign(Object.assign({},i),{range:[nt.parseColor(n).toString()]})),e);const[s,l]=Xx(o);return Object.assign(Object.assign({},t),{data:o.getTicks().map(t=>({value:t})),color:new Array(a).fill(0).map((t,e)=>{var e=(l-s)/(a-1)*e+s,n=o.map(e);const i=r?r.map(e):1;return n.replace(/rgb[a]*\(([\d]{1,3}) *, *([\d]{1,3}) *, *([\d]{1,3})[\S\s]*\)/,(t,e,n,r)=>`rgba(${e}, ${n}, ${r}, ${i})`)})})}function Qx(t,e,n,r,i){var a=Tx(t,"color"),e=Ux(e,n,r);if(a instanceof c0){var n=a.getOptions()["range"],[r,o]=Xx(a);if(a instanceof h0||a instanceof p0)return Kx(e,a,r,o,n);{r=e;o=a;const s=[-1/0,...o.thresholds,1/0].map((t,e)=>({value:e,label:t}));return Object.assign(Object.assign({},r),{data:s,color:n,labelFilter:(t,e)=>0{const{labelFormatter:u,layout:f,position:h,title:d,style:p}=c,g=rt(c,["labelFormatter","layout","order","orientation","position","size","title","style"]);return({scales:t,value:e,theme:n})=>{var r=e["bbox"],{x:r,y:i,width:a,height:o}=r,s=Sx(h,f),{continuousLegend:l={}}=n,l=Nx(Object.assign({},l,Object.assign(Object.assign({titleText:Ex(d),titleFontSize:12,handle:!1,indicator:!1,labelAlign:"value",labelFormatter:"string"==typeof u?t=>wx(u)(t.label):u},Qx(t,e,c,Jx,n)),p),g)),t=new Ax({style:Object.assign(Object.assign({x:r,y:i,width:a,height:o},s),{subOptions:l})});return t.appendChild(new r2({style:l})),t}},tw=(Jx.props={defaultPosition:"top",defaultOrientation:"vertical",defaultOrder:1,defaultSize:60,defaultLength:300,defaultLegendSize:60},e=>(...t)=>Jx(Object.assign({},{block:!0},e))(...t)),ew=(tw.props=Object.assign(Object.assign({},Jx.props),{defaultPosition:"top",defaultOrientation:"horizontal"}),n=>t=>{var e=t["scales"],e=Tx(e,"size");return Jx(Object.assign({},{type:"size",tick:!1,data:e.getOptions().domain.map((t,e)=>({value:t,label:String(t)})),labelFilter:(t,e,n)=>0===e||e===n.length-1},n))(t)}),nw=(ew.props=Object.assign(Object.assign({},Jx.props),{defaultPosition:"top",defaultOrientation:"horizontal"}),t=>ew(Object.assign({},{block:!0},t)));function rw(t,e,n,r){switch(r){case"center":return{x:t+n/2,y:e,textAlign:"middle"};case"right":return{x:t+n,y:e,textAlign:"right"};default:return{x:t,y:e,textAlign:"left"}}}nw.props=Object.assign(Object.assign({},Jx.props),{defaultPosition:"top",defaultOrientation:"horizontal"});Fx={render(t,e){const{y:n,width:r,title:i,subtitle:a}=t,o=t.style,{spacing:s=2,align:l="left"}=o,c=rt(o,["spacing","align"]);t=at(c,"title");const u=at(c,"subtitle"),f=_x(e,".title","text").attr("className","title").call(j,Object.assign(Object.assign(Object.assign({},rw(0,n,r,l)),{fontSize:14,textBaseline:"top",text:i}),t)).node().getLocalBounds();_x(e,".sub-title","text").attr("className","sub-title").call(t=>{if(!a)return t.node().remove();t.node().attr(Object.assign(Object.assign(Object.assign({},rw(0,f.max[1]+s,r,l)),{fontSize:12,textBaseline:"top",text:a}),u))})}};const iw=class extends nt.CustomElement{constructor(t){super(t),this.descriptor=Fx}connectedCallback(){var t,e;null!=(e=(t=this.descriptor).render)&&e.call(t,this.attributes,this)}update(t={}){var e;this.attr(it({},this.attributes,t)),null!=(e=(t=this.descriptor).render)&&e.call(t,this.attributes,this)}},aw=a=>({value:t,theme:e})=>{var{x:t,y:n,width:r,height:i}=t.bbox;return new iw({style:it({},{style:e.title},Object.assign({x:t,y:n,width:r,height:i},a))})};function ow(t){return t.getBandWidth}function sw(t,e,n){if(!ow(t))return t.invert(e);var r=t["adjustedRange"],i=t.getOptions()["domain"],a=n?-1:0;const o=t.getStep();var t=n?r:r.map(t=>t+o),n=uc(t,e);return r=n+a,t=0,e=i.length-1,i[Math.min(e,Math.max(t,r))]}function lw(t,e,n){if(!e)return t.getOptions().domain;if(!ow(t))return o=Oc(e),n?([i]=o,r=t.getOptions()["range"],[r,a]=r,a=a{var[t,n]=a.invert(t);return[sw(o,t,e),sw(s,n,e)]},t=i([t,e],!0),e=i([n,r],!1);return[lw(o,[t[0],e[0]]),lw(s,[t[1],e[1]])]}function uw(t,e){var[t,n]=t;return[e.map(t),e.map(n)+((t=e).getStep?t.getStep():0)]}aw.props={defaultPosition:"top",defaultOrder:2,defaultSize:36};const fw=t=>{const{orientation:f,labelFormatter:h,style:d}=t,p=rt(t,["orientation","labelFormatter","size","style","position"]);return({scales:[n],value:t,theme:e,coordinate:r})=>{var t=t["bbox"],{x:t,y:i,width:a,height:o}=t,{slider:e={}}=e;const s=(null==(c=n.getFormatter)?void 0:c.call(n))||(t=>t.toString()),l="string"==typeof h?wx(h):h;var c="horizontal"===f;const u=Uc(r)&&c;return new Uy({className:"slider",style:Object.assign({},e,Object.assign(Object.assign({x:t,y:i,trackLength:c?a:o,orientation:f,formatter:t=>{var e=l||s,t=u?1-t:t;return e(sw(n,t,!0))}},d),p))})}},hw=(fw.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1},t=>fw(Object.assign(Object.assign({},t),{orientation:"horizontal"}))),dw=(hw.props=Object.assign(Object.assign({},fw.props),{defaultPosition:"bottom"}),t=>fw(Object.assign(Object.assign({},t),{orientation:"vertical"}))),pw=(dw.props=Object.assign(Object.assign({},fw.props),{defaultPosition:"left"}),t=>{const{orientation:s,style:l}=t,c=rt(t,["orientation","labelFormatter","style"]);return({scales:[t],value:e,theme:n})=>{var e=e["bbox"],{x:e,y:r,width:i,height:a}=e,{scrollbar:n={}}=n,{ratio:t,range:o}=t.getOptions(),i="horizontal"===s?i:a,a=i/t,[t,o]=o,t=tpw(Object.assign(Object.assign({},t),{orientation:"horizontal"}))),mw=(gw.props=Object.assign(Object.assign({},pw.props),{defaultPosition:"bottom"}),t=>pw(Object.assign(Object.assign({},t),{orientation:"vertical"})));mw.props=Object.assign(Object.assign({},pw.props),{defaultPosition:"left"});class yw{constructor(t){this.$value=t}static of(t){return new yw(t)}call(t,...e){return this.$value=t(this.$value,...e),this}value(){return this.$value}}function vw(t,e,n){return yw.of({}).call(bw,t).call(bw,e).call(bw,n).value()}function bw(t,e){for(var[n,r]of Object.entries(e))void 0!==r&&(t[n]=e[n]);return t}function xw(t,e){var n={};for(const i of e){var r=t.style[i];r&&(n[i]=r)}return n}const ww=["fill","stroke","fillOpacity","strokeOpacity","opacity","lineWidth"],Mw=u=>{return(t,e,n,r,i)=>{const[a]=t;var t=a.getBoundingClientRect()["height"],{transform:o="",fillOpacity:s=1,strokeOpacity:l=1,opacity:c=1}=a.style,[r,t]=Uc(r)?[[0,t],"scale(1, 0.0001)"]:[[0,0],"scale(0.0001, 1)"],t=[{transform:(o+" "+t).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:(o+" "+t).trimStart(),fillOpacity:s,strokeOpacity:l,opacity:c,offset:.01},{transform:(o+" scale(1, 1)").trimStart(),fillOpacity:s,strokeOpacity:l,opacity:c}],o=(a.setOrigin(r),a.animate(t,vw(i,n,u)));return o.finished.then(()=>a.setOrigin(0,0)),o}},Ow=u=>{return(t,e,n,r,i)=>{const[a]=t;var t=a.getBoundingClientRect()["height"],{transform:o="",fillOpacity:s=1,strokeOpacity:l=1,opacity:c=1}=a.style,[r,t]=Uc(r)?[[0,t],"scale(1, 0.0001)"]:[[0,0],"scale(0.0001, 1)"],s=[{transform:(o+" scale(1, 1)").trimStart()},{transform:(o+" "+t).trimStart(),fillOpacity:s,strokeOpacity:l,opacity:c,offset:.99},{transform:(o+" "+t).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}],l=(a.setOrigin(r),a.animate(s,vw(i,n,u)));return l.finished.then(()=>a.setOrigin(0,0)),l}},kw=u=>{return(t,e,n,r,i)=>{const[a]=t;var t=a.getBoundingClientRect()["height"],{transform:o="",fillOpacity:s=1,strokeOpacity:l=1,opacity:c=1}=a.style,[r,t]=Uc(r)?[[0,0],"scale(0.0001, 1)"]:[[0,t],"scale(1, 0.0001)"],t=[{transform:(o+" "+t).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:(o+" "+t).trimStart(),fillOpacity:s,strokeOpacity:l,opacity:c,offset:.01},{transform:(o+" scale(1, 1)").trimStart(),fillOpacity:s,strokeOpacity:l,opacity:c}],o=(a.setOrigin(r),a.animate(t,vw(i,n,u)));return o.finished.then(()=>a.setOrigin(0,0)),o}},_w=u=>{return(t,e,n,r,i)=>{const[a]=t;var t=a.getBoundingClientRect()["height"],{transform:o="",fillOpacity:s=1,strokeOpacity:l=1,opacity:c=1}=a.style,[r,t]=Uc(r)?[[0,0],"scale(0.0001, 1)"]:[[0,t],"scale(1, 0.0001)"],s=[{transform:(o+" scale(1, 1)").trimStart()},{transform:(o+" "+t).trimStart(),fillOpacity:s,strokeOpacity:l,opacity:c,offset:.99},{transform:(o+" "+t).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}],l=(a.setOrigin(r),a.animate(s,vw(i,n,u)));return l.finished.then(()=>a.setOrigin(0,0)),l}},Ew=l=>(t,e,n,r,i)=>{var[t]=t,{fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=t.style;return t.animate([{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:a,strokeOpacity:o,opacity:s}],vw(i,n,l))},Sw=(Ew.props={},l=>(t,e,n,r,i)=>{var[t]=t,{fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=t.style;return t.animate([{fillOpacity:a,strokeOpacity:o,opacity:s},{fillOpacity:0,strokeOpacity:0,opacity:0}],vw(i,n,l))});function Aw(t){var{min:t,max:e}=t.getLocalBounds(),[t,n]=t,[e,r]=e;return[t,n,e-t,r-n]}function Lw(t,e){var[n,r,i,t]=Aw(t),a=Math.ceil(Math.sqrt(e/(t/i))),o=[],s=t/Math.ceil(e/a);let l=0,c=e;for(;0{Gu(b,n)},b.style.transform="scale(1, 1)",b.style.transform="none",v}}Sw.props={};const Cw=g=>(t,e,n,r,i)=>{[a="pack"]=[g.split];var a="function"==typeof a?a:Lw,i=vw(i,n,g),n=t["length"],o=e["length"];if(1===n&&1===o||1{return Pw(t,new nt.Path({style:Object.assign({path:d[e]},xw(l,ww))}),t,u)})}}if(1{return Pw(t,t,new nt.Path({style:{path:p[e],fill:f.style.fill}}),h)}),e]}}return null},Rw=(Cw.props={},b=>{return nt.CSS.registerProperty({name:"waveInArcAngle",inherits:!1,initialValue:"",interpolable:!0,syntax:nt.PropertySyntax.NUMBER}),(t,e,n,r,i)=>{const[a]=t;if(!Kc(r))return Mw(b)(t,e,n,r,i);const o=r.getCenter();var{__data__:t,style:e}=a,{radius:e=0,inset:s=0,fillOpacity:l=1,strokeOpacity:c=1,opacity:u=1}=e,{points:t,y:f,y1:h}=t;const d=V1().cornerRadius(e).padAngle(s*Math.PI/180),p=Y0(r,t,[f,h]),{startAngle:g,endAngle:m}=p,y=new nt.Path({}),v=t=>{y.attr({d:d(t),transform:`translate(${o[0]}, ${o[1]})`});t=nt.convertToPath(y);return y.style.transform="",t};e=[{waveInArcAngle:g+1e-4,fillOpacity:0,strokeOpacity:0,opacity:0},{waveInArcAngle:g+1e-4,fillOpacity:l,strokeOpacity:c,opacity:u,offset:.01},{waveInArcAngle:m,fillOpacity:l,strokeOpacity:c,opacity:u}],s=a.animate(e,vw(i,n,b));return s.onframe=function(){a.style.path=v(Object.assign(Object.assign({},p),{endAngle:Number(a.style.waveInArcAngle)}))},s.onfinish=function(){a.style.path=v(Object.assign(Object.assign({},p),{endAngle:m}))},s}}),Iw=(Rw.props={},c=>{return(t,e,n,r,i)=>{const[a]=t;var{transform:t="",fillOpacity:o=1,strokeOpacity:s=1,opacity:l=1}=a.style,t=[{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:o,strokeOpacity:s,opacity:l,offset:.01},{transform:(t+" scale(1)").trimStart(),fillOpacity:o,strokeOpacity:s,opacity:l}],{width:o,height:s}=a.getBoundingClientRect(),l=(a.setOrigin([o/2,s/2]),a.animate(t,vw(i,n,c)));return l.finished.then(()=>a.setOrigin(0,0)),l}}),Bw=c=>{return(t,e,n,r,i)=>{const[a]=t;var{transform:t="",fillOpacity:o=1,strokeOpacity:s=1,opacity:l=1}=a.style,o=[{transform:(t+" scale(1)").trimStart()},{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:o,strokeOpacity:s,opacity:l,offset:.99},{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}],{width:s,height:l}=a.getBoundingClientRect(),t=(a.setOrigin([s/2,l/2]),a.animate(o,vw(i,n,c)));return t.finished.then(()=>a.setOrigin(0,0)),t}},Fw=o=>(t,e,n,r,i)=>{var[t]=t,a=(null==(a=t.getTotalLength)?void 0:a.call(t))||0;return t.animate([{lineDash:[0,a]},{lineDash:[a,0]}],vw(i,n,o))},Dw=(Fw.props={},l=>(t,e,n,r,i)=>{const[a]=t;var{height:t,width:o}=a.getBoundingClientRect();const s=new nt.Path({style:{path:`M0,0L${o},0L${o},${t}L0,${t}Z`}});a.appendChild(s),a.style.clipPath=s;o=Mw(l)([s],e,n,r,i);return o.finished.then(()=>{s.remove(),a.style.clipPath=null}),o}),zw=(Dw.props={},l=>(t,e,n,r,i)=>{const[a]=t;var{height:t,width:o}=a.getBoundingClientRect();const s=new nt.Path({style:{path:`M0,0L${o},0L${o},${t}L0,${t}Z`}});a.appendChild(s),a.style.clipPath=s;o=kw(l)([s],e,n,r,i);return o.finished.then(()=>{s.remove(),a.style.clipPath=null}),o}),Ww=(zw.props={},{visibility:"visible",opacity:1,fillOpacity:1,strokeOpacity:1});function Gw(t,e,n,r){t.style[e]=n,r&&t.children.forEach(t=>Gw(t,e,n,r))}function qw(t){Gw(t,"visibility","hidden",!0)}function Hw(t){Gw(t,"visibility","visible",!0)}function Vw(t){return ot(t).selectAll("."+lt).nodes().filter(t=>!t.__removed__)}function Yw(t,e){return $w(t,e).flatMap(({container:t})=>Vw(t))}function $w(e,t){return t.filter(t=>t!==e&&t.options.parentKey===e.options.key)}function Uw(t){return ot(t).select("."+ct).node()}function Kw(t,e){var{offsetX:e,offsetY:n}=e,{min:[t,r],max:[i,a]}=t.getRenderBounds();return et.__data__.color}function Qw(t){const e=t.scale["x"];return t=>{t=t.__data__.x;return e.invert(t)}}function Jw(t){t=Array.isArray(t)?t:[t];const r=new Map(t.flatMap(e=>{return Array.from(e.markState.keys()).map(t=>[e.key+","+t.key,t.data])}));return t=>{var{index:t,markKey:e,viewKey:n}=t.__data__;return r.get(n+","+e)[t]}}function t5(s,l=(t,e)=>t,c=(t,e,n)=>t.setAttribute(e,n)){const u="__states__",f="__ordinal__",i=t=>{var{[u]:e=[],[f]:n={}}=t,e=e.reduce((t,e)=>Object.assign(Object.assign({},t),s[e]),n);if(0!==Object.keys(e).length){for(var[r,i]of Object.entries(e)){a=t,o=r;var a=null!=(a=t.style[o])?a:Ww[o],o=l(i,t);c(t,r,o),r in n||(n[r]=a)}t[f]=n}},a=t=>{t[u]||(t[u]=[])};return{setState:(t,...e)=>{a(t),t[u]=[...e],i(t)},removeState:(t,...e)=>{a(t);for(const r of e){var n=t[u].indexOf(r);-1!==n&&t[u].splice(n,1)}i(t)},hasState:(t,e)=>(a(t),-1!==t[u].indexOf(e))}}function e5(t,e){var n=(Array.isArray(t)?t:[t]).flatMap(e=>e.marks.map(t=>[e.key+","+t.key,t.state])),r={};for(const i of e){const[l,c]=Array.isArray(i)?i:[i,{}];r[l]=n.reduce((t,e)=>{const[a,n={}]=e;e=void 0===(e=n[l])||"object"==typeof e&&0===Object.keys(e).length?c:n[l];for(const[r,o]of Object.entries(e)){const s=t[r];t[r]=(t,e,n,r)=>{var i=r.__data__.viewKey+","+r.__data__.markKey;return a!==i?null===s||void 0===s?void 0:s(t,e,n,r):"function"!=typeof o?o:o(t,e,n,r)}}return t},{})}return r}function n5(t,r){const i=new Map(t.map((t,e)=>[t,e])),a=r?t.map(r):t;return(t,e)=>{var n;return"function"!=typeof t?t:(n=i.get(e),t(r?r(e):e,n,a,e))}}function r5(t){var{link:e=!1,valueof:l=(t,e)=>t}=t,c=rt(t,["link","valueof","coordinate"]);if(!e)return[()=>{},()=>{}];const u=t=>t.__data__.points;return[t=>{if(!(t.length<=1)){var e=Oc(t,(t,e)=>{t=t.__data__.x,e=e.__data__.x;return t-e});for(let t=1;t{var[,t,n]=t,[e,,,r]=e;return[t,e,r,n]})(u(s),u(r)),r=(n.moveTo(...r),n.lineTo(...i),n.lineTo(...a),n.lineTo(...o),n.closePath(),T0(c,t=>l(t,s))),{fill:i=s.getAttribute("fill")}=r,a=rt(r,["fill"]),o=new nt.Path({className:"element-link",style:Object.assign({d:n.toString(),fill:i,zIndex:-2},a)});null!=(r=s.link)&&r.remove(),s.parentNode.appendChild(o),s.link=o}}},t=>{var e;null!=(e=t.link)&&e.remove(),t.link=null}]}function i5(n,t,e){var r,i,a,o=t=>{var e=n.style["transform"];return e?e+" "+t:t};return Kc(e)?(a=n.__data__["points"],[a,i]=Uc(e)?V0(a):a,r=R0(a,a=e.getCenter()),i=R0(i,a),a=F0(r)+z0(r,i)/2,o(`translate(${t*Math.cos(a)}, ${t*Math.sin(a)})`)):Uc(e)?o(`translate(${t}, 0)`):o(`translate(0, ${-t})`)}function a5(t){var{background:e,scale:s,coordinate:l,valueof:c}=t,u=rt(t,["background","scale","coordinate","valueof"]);const f="element-background";if(!e)return[()=>{},()=>{}];const r=(t,e,n)=>{var r=t.invert(e),e=e+t.getBandWidth(r)/2,t=t.getStep(r)/2,r=t*n;return[e-t+r,e+t-r]},h=(t,e)=>{var n=s["x"];return ow(n)?(t=t["__data__"],t=t["x"],[n,t]=r(n,t,e),[n,t]):[0,1]},d=(t,e)=>{var n=s["y"];return ow(n)?(t=t["__data__"],t=t["y"],[n,t]=r(n,t,e),[n,t]):[0,1]},p=(t,e)=>{var n=e["padding"],[r,i]=h(t,n),[n,a]=d(t,n),t=t["__data__"],{y:t,y1:o}=t;return bg([[r,n],[i,n],[i,a],[r,a]].map(t=>l.map(t)),{y:t,y1:o},l,e)},g=(t,e)=>{var n,r,{transform:i="scale(1.2, 1.2)",transformOrigin:a="center center",stroke:o=""}=e,e=rt(e,["transform","transformOrigin","stroke"]),i=Object.assign({transform:i,transformOrigin:a,stroke:o},e),s=t.cloneNode(!0);for([n,r]of Object.entries(i))s.style[n]=r;return s};return[e=>{e.background&&e.background.remove();var t=T0(u,t=>c(t,e)),{fill:n="#CCD6EC",fillOpacity:r=.3,zIndex:i=-2,padding:a=.001,strokeWidth:o=0}=t,t=rt(t,["fill","fillOpacity","zIndex","padding","strokeWidth"]),t=Object.assign(Object.assign({},t),{fill:n,fillOpacity:r,zIndex:i,padding:a,strokeWidth:o}),n=((()=>{var{x:t,y:e}=s;return[t,e].some(ow)})()?p:g)(e,t);n.className=f,e.parentNode.appendChild(n),e.background=n},t=>{var e;null!=(e=t.background)&&e.remove(),t.background=null},t=>t.className===f]}function o5(t,e){t=t.getRootNode().defaultView.getContextService().getDomElement();null!=t&&t.style&&(t.style.cursor=e)}function s5(t,e,r){return t.find(n=>Object.entries(e).every(([t,e])=>r(n)[t]===e))}function l5(e,{elements:t,datum:a,groupKey:o=t=>t,link:n=!1,background:r=!1,delay:i=60,scale:s,coordinate:l,emitter:c,state:u={}}){const f=t(e),h=new Set(f),d=bc(f,o);t=n5(f,a);const[p,g]=r5(Object.assign({elements:f,valueof:t,link:n,coordinate:l},at(u.active,"link"))),[m,y,v]=a5(Object.assign({scale:s,coordinate:l,background:r,valueof:t},at(u.active,"background"))),{setState:b,removeState:x,hasState:w}=t5(it(u,{active:Object.assign({},(null==(n=u.active)?void 0:n.offset)&&{transform:(...t)=>{var e=u.active.offset(...t),[,t]=t;return i5(f[t],e,l)}})}),t);let M;const O=t=>{var{target:e,nativeEvent:t=!0}=t;if(h.has(e)){M&&clearTimeout(M);var n=o(e),n=d.get(n),r=new Set(n);for(const i of f)r.has(i)?w(i,"active")||b(i,"active"):(b(i,"inactive"),g(i)),i!==e&&y(i);m(e),p(n),t&&c.emit("element:highlight",{nativeEvent:t,data:{data:a(e),group:n.map(a)}})}},k=(t=!0)=>{for(const e of f)x(e,"active","inactive"),y(e),g(e);t&&c.emit("element:unhighlight",{nativeEvent:t})},_=t=>{t=t.target;r&&!v(t)||(r||h.has(t))&&(0{k(),M=null},i)):k())},E=()=>{k()},S=(e.addEventListener("pointerover",O),e.addEventListener("pointerout",_),e.addEventListener("pointerleave",E),t=>{t=t.nativeEvent;t||k(!1)}),A=t=>{var e=t["nativeEvent"];!e&&(e=t.data["data"],t=s5(f,e,a))&&O({target:t,nativeEvent:!1})};return c.on("element:highlight",A),c.on("element:unhighlight",S),()=>{e.removeEventListener("pointerover",O),e.removeEventListener("pointerout",_),e.removeEventListener("pointerleave",E),c.off("element:highlight",A),c.off("element:unhighlight",S);for(const t of f)y(t),g(t)}}function c5(t){var{delay:s,createGroup:l,background:c=!1,link:u=!1}=t,f=rt(t,["delay","createGroup","background","link"]);return(t,e,n)=>{var{container:t,view:r,options:i}=t,{scale:a,coordinate:o}=r;return l5(Uw(t),Object.assign({elements:Vw,datum:Jw(r),groupKey:l?l(r):void 0,coordinate:o,scale:a,state:e5(i,[["active",c?{}:{lineWidth:"1",stroke:"#000"}],"inactive"]),background:c,link:u,delay:s,emitter:n},f))}}function u5(t){return c5(Object.assign(Object.assign({},t),{createGroup:Qw}))}function f5(t){return c5(Object.assign(Object.assign({},t),{createGroup:Zw}))}function h5(e,{elements:t,datum:h,groupKey:d=t=>t,link:p=!1,single:g=!1,coordinate:n,background:r=!1,scale:i,emitter:m,state:a={}}){const y=t(e),v=new Set(y),b=bc(y,d);t=n5(y,h);const[x,w]=r5(Object.assign({link:p,elements:y,valueof:t,coordinate:n},at(a.selected,"link"))),[M,O]=a5(Object.assign({background:r,coordinate:n,scale:i,valueof:t},at(a.selected,"background"))),{setState:k,removeState:o,hasState:_}=t5(it(a,{selected:Object.assign({},(null==(r=a.selected)?void 0:r.offset)&&{transform:(...t)=>{var e=a.selected.offset(...t),[,t]=t;return i5(y[t],e,n)}})}),t),E=(t=!0)=>{for(const e of y)o(e,"selected","unselected"),w(e),O(e);t&&m.emit("element:unselect",{nativeEvent:!0})},s=t=>{var{target:e,nativeEvent:n=!0}=t;if(!v.has(e))return E();if(g){var[r,i,a=!0]=[t,e,n];if(_(i,"selected"))E();else{var o=d(i),o=b.get(o),s=new Set(o);for(const l of y)s.has(l)?k(l,"selected"):(k(l,"unselected"),w(l)),l!==i&&O(l);x(o),M(i),a&&m.emit("element:select",Object.assign(Object.assign({},r),{nativeEvent:a,data:{data:[h(i),...o.map(h)]}}))}}else{var[r,a,o=!0]=[t,e,n];t=d(a),t=b.get(t);const c=new Set(t);if(_(a,"selected")){if(!y.some(t=>!c.has(t)&&_(t,"selected")))return E();for(const u of t)k(u,"unselected"),w(u),O(u)}else{e=t.some(t=>_(t,"selected"));for(const f of y)c.has(f)?k(f,"selected"):_(f,"selected")||k(f,"unselected");!e&&p&&x(t),M(a)}o&&m.emit("element:select",Object.assign(Object.assign({},r),{nativeEvent:o,data:{data:y.filter(t=>_(t,"selected")).map(h)}}))}},l=(e.addEventListener("click",s),t=>{var{nativeEvent:t,data:e}=t;if(!t)for(const r of g?e.data.slice(0,1):e.data){var n=s5(y,r,h);s({target:n,nativeEvent:!1})}}),c=()=>{E(!1)};return m.on("element:select",l),m.on("element:unselect",c),()=>{for(const t of y)w(t);e.removeEventListener("click",s),m.off("element:select",l),m.off("element:unselect",c)}}function d5(t){var{createGroup:s,background:l=!1,link:c=!1}=t,u=rt(t,["createGroup","background","link"]);return(t,e,n)=>{var{container:t,view:r,options:i}=t,{coordinate:a,scale:o}=r;return h5(Uw(t),Object.assign({elements:Vw,datum:Jw(r),groupKey:s?s(r):void 0,coordinate:a,scale:o,state:e5(i,[["selected",l?{}:{lineWidth:"1",stroke:"#000"}],"unselected"]),background:l,link:c,emitter:n},u))}}function p5(t){return d5(Object.assign(Object.assign({},t),{createGroup:Qw}))}function g5(t){return d5(Object.assign(Object.assign({},t),{createGroup:Zw}))}function m5(t){var{wait:k=20,leading:_,trailing:E=!1,labelFormatter:S=t=>""+t}=t,A=rt(t,["wait","leading","trailing","labelFormatter"]);return t=>{const{options:e,view:n,container:r,update:i}=t,{markState:a,scale:o,coordinate:s}=n;t=function(t,e,r){var[t]=Array.from(t.entries()).filter(([t])=>t.type===e).map(([t])=>{const n=t["encode"];return Object.fromEntries(r.map(t=>{var e=n[t];return[t,e?e.value:void 0]}))});return t}(a,"line",["x","y","series"]);if(!t)return;const{y:h,x:d,series:l=[]}=t;t=h.map((t,e)=>e);const c=Oc(t.map(t=>d[t])),u=it({},e),f=u.marks.find(t=>"line"===t.type);t=Rc(xc(t,t=>Rc(t,t=>+h[t])/Bc(t,t=>+h[t]),t=>l[t]).values());it(f,{scale:{y:{domain:[1/t,t]}}});const p=Uw(r),g=r.getElementsByClassName(lt);const m=bc(r.getElementsByClassName(ft),t=>t.__data__.key.split("-")[0]),y=new nt.Line({style:Object.assign({x1:0,y1:0,x2:0,y2:p.getAttribute("height"),stroke:"black",lineWidth:1},at(A,"rule"))}),v=new nt.Text({style:Object.assign({x:0,y:p.getAttribute("height"),text:"",fontSize:10},at(A,"label"))}),b=(y.append(v),p.appendChild(y),(t,e,n)=>{var[t]=t.invert(n),n=e.invert(t);return c[fc(c,n)]}),x=(t,e)=>{y.setAttribute("x1",t[0]),y.setAttribute("x2",t[0]),v.setAttribute("text",S(e))};let w;var M;const O=un(t=>{t=Kw(p,t);if(t){var{scale:e,coordinate:n}=w,{x:e,y:r}=e,i=b(n,e,t);x(t,i);for(const u of g){var{seriesIndex:a,key:o}=u.__data__,s=a[oc(t=>d[+t]).center(a,i)],l=[0,r.map(1)],s=[0,r.map(h[s]/h[a[0]])],[,a]=n.map(l),[,l]=n.map(s),c=a-l,s=(u.setAttribute("transform",`translate(0, ${c})`),m.get(o)||[]);for(const f of s)f.setAttribute("dy",c)}}},k,{leading:_,trailing:E});return M=[0,0],ue(this,void 0,void 0,function*(){var t=o["x"];const n=b(s,t,M);x(M,n);t=function(t){var{transform:e=[]}=t,n=e.find(t=>"normalizeY"===t.type);return n||(e.push(n={type:"normalizeY"}),t.transform=e,n)}(f);t.groupBy="color",t.basis=(t,e)=>{return e[t[oc(t=>d[+t]).center(t,n)]]};for(const e of u.marks)e.animate=!1;t=yield i(u);w=t.view}),p.addEventListener("pointerenter",O),p.addEventListener("pointermove",O),p.addEventListener("pointerleave",O),()=>{y.remove(),p.removeEventListener("pointerenter",O),p.removeEventListener("pointermove",O),p.removeEventListener("pointerleave",O)}}}function y5({wait:l=30,leading:c,trailing:u=!1}){return t=>{const{options:r,update:i,container:e}=t,a=Uw(e),o=it({},r);for(const s of o.marks)s.animate=!1;const n=un(t=>{var e,n,t=Kw(a,t);t?([t,e]=t,(n=function(t){var{coordinate:e={}}=t,{transform:n=[]}=e,r=n.find(t=>"fisheye"===t.type);return r||(n.push(r={type:"fisheye"}),e.transform=n,t.coordinate=e,r)}(o)).focusX=t,n.focusY=e,n.visual=!0,i(o)):i(r)},l,{leading:c,trailing:u});return a.addEventListener("pointerenter",n),a.addEventListener("pointermove",n),a.addEventListener("pointerleave",n),()=>{a.removeEventListener("pointerenter",n),a.removeEventListener("pointermove",n),a.removeEventListener("pointerleave",n)}}}const $=new Proxy({BEFORE_RENDER:"beforerender",AFTER_RENDER:"afterrender",BEFORE_PAINT:"beforepaint",AFTER_PAINT:"afterpaint",BEFORE_CHANGE_DATA:"beforechangedata",AFTER_CHANGE_DATA:"afterchangedata",BEFORE_CLEAR:"beforeclear",AFTER_CLEAR:"afterclear",BEFORE_DESTROY:"beforedestroy",AFTER_DESTROY:"afterdestroy",BEFORE_CHANGE_SIZE:"beforechangesize",AFTER_CHANGE_SIZE:"afterchangesize",POINTER_TAP:"pointertap",POINTER_DOWN:"pointerdown",POINTER_UP:"pointerup",POINTER_OVER:"pointerover",POINTER_OUT:"pointerout",POINTER_MOVE:"pointermove",POINTER_ENTER:"pointerenter",POINTER_LEAVE:"pointerleave",POINTER_UPOUTSIDE:"pointerupoutside",DRAG_START:"dragstart",DRAG:"drag",DRAG_END:"dragend",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"DROP",CLICK:"click",DBLCLICK:"dblclick"},{get(t,e){if(e in t)return t[e]},set(){return!0}});function v5(t,e){t=t.__data__;const{markKey:n,index:r,seriesIndex:i}=t;t=e.markState;const a=Array.from(t.keys()).find(t=>t.key===n);if(a)return i?i.map(t=>a.data[t]):a.data[r]}function b5(i,a,o,s=t=>!0){return t=>{var e,n,r;s(t)&&(o.emit("plot:"+i,t),r=t["target"],r)&&({className:e,markType:n}=r,"plot"!==e)&&("element"===e?(r=Object.assign(Object.assign({},t),{nativeEvent:!0,data:{data:v5(r,a)}}),o.emit("element:"+i,r),o.emit(n+":"+i,r)):o.emit(e+":"+i,t))}}function x5(){return(t,e,n)=>{const{container:r,view:i}=t,a=b5($.CLICK,i,n,t=>1===t.detail),o=b5($.DBLCLICK,i,n,t=>2===t.detail),s=b5($.POINTER_TAP,i,n),l=b5($.POINTER_DOWN,i,n),c=b5($.POINTER_UP,i,n),u=b5($.POINTER_OVER,i,n),f=b5($.POINTER_OUT,i,n),h=b5($.POINTER_MOVE,i,n),d=b5($.POINTER_ENTER,i,n),p=b5($.POINTER_LEAVE,i,n),g=b5($.POINTER_UPOUTSIDE,i,n),m=b5($.DRAG_START,i,n),y=b5($.DRAG,i,n),v=b5($.DRAG_END,i,n),b=b5($.DRAG_ENTER,i,n),x=b5($.DRAG_LEAVE,i,n),w=b5($.DRAG_OVER,i,n),M=b5($.DROP,i,n);return r.addEventListener("click",a),r.addEventListener("click",o),r.addEventListener("pointertap",s),r.addEventListener("pointerdown",l),r.addEventListener("pointerup",c),r.addEventListener("pointerover",u),r.addEventListener("pointerout",f),r.addEventListener("pointermove",h),r.addEventListener("pointerenter",d),r.addEventListener("pointerleave",p),r.addEventListener("pointerupoutside",g),r.addEventListener("dragstart",m),r.addEventListener("drag",y),r.addEventListener("dragend",v),r.addEventListener("dragenter",b),r.addEventListener("dragleave",x),r.addEventListener("dragover",w),r.addEventListener("drop",M),()=>{r.removeEventListener("click",a),r.removeEventListener("click",o),r.removeEventListener("pointertap",s),r.removeEventListener("pointerdown",l),r.removeEventListener("pointerup",c),r.removeEventListener("pointerover",u),r.removeEventListener("pointerout",f),r.removeEventListener("pointermove",h),r.removeEventListener("pointerenter",d),r.removeEventListener("pointerleave",p),r.removeEventListener("pointerupoutside",g),r.removeEventListener("dragstart",m),r.removeEventListener("drag",y),r.removeEventListener("dragend",v),r.removeEventListener("dragenter",b),r.removeEventListener("dragleave",x),r.removeEventListener("dragover",w),r.removeEventListener("drop",M)}}}function w5(t,e){return e?"string"==typeof e?document.querySelector(e):e:t.getRootNode().defaultView.getConfig().container}function M5({root:t,data:e,x:n,y:r,render:i,event:a,single:o,position:s="right-bottom",enterable:l=!1,mount:c,bounding:u}){var f,h,d=t.getRootNode().defaultView.getConfig().container,o=o?w5(t,c):t,c=u||function(t){var{min:[t,e],max:[n,r]}=t.getBounds();return{x:t,y:e,width:n-t,height:r-e}}(t),d=(u=o,t=(t=d).getBoundingClientRect(),u=u.getBoundingClientRect(),{x:t.x-u.x,y:t.y-u.y}),{tooltipElement:p=(t=o,u=n,p=r,f=s,h=l,c=c,d=d,u=new u2({className:"tooltip",style:{x:u,y:p,container:d,data:[],bounding:c,position:f,enterable:h,title:"",offset:[10,10],template:{prefixCls:"g2-"},style:{".g2-tooltip":{},".g2-tooltip-title":{overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"}}}}),t.appendChild(u.HTMLTooltipElement),u)}=o,{items:d,title:c=""}=e;p.update(Object.assign({x:n,y:r,data:d,title:c,position:s,enterable:l},void 0!==i&&{content:i(a,{items:d,title:c})})),o.tooltipElement=p}function O5({root:t,single:e,emitter:n,nativeEvent:r=!0,mount:i}){e=(e?w5(t,i):t).tooltipElement;e&&(e.hide(),r)&&n.emit("tooltip:hide",{nativeEvent:r})}function k5(t){var e=t["tooltipElement"];e&&(e.destroy(),t.tooltipElement=void 0)}function _5(t){var e=t["value"];return Object.assign(Object.assign({},t),{value:void 0===e?"undefined":e})}function E5(t,e){var{color:t,series:n}=t,{color:e,series:r}=e,i=t=>t&&t.invert&&!(t instanceof Jp)&&!(t instanceof Up);return i(n)?n.invert(r):r&&r!==e?r:!i(t)||(n=t.invert(e),Array.isArray(n))?null:n}function S5(t){var e=t.getAttribute("fill"),n=t.getAttribute("stroke"),t=t["__data__"],{color:t=e&&"transparent"!==e?e:n}=t;return t}function A5(t,e=t=>t){t=new Map(t.map(t=>[e(t),t]));return Array.from(t.values())}function L5(n,s,l,t=n.map(t=>t.__data__)){const e=t=>t instanceof Date?+t:t;var r=A5(t.map(t=>t.title),e).filter(qu),t=t.flatMap((r,t)=>{const i=n[t],{items:e=[],title:a}=r;t=e.filter(qu);const o=void 0!==l?l:e.length<=1;return t.map(t=>{var{color:e=S5(i),name:n}=t,t=rt(t,["color","name"]),n=o?E5(s,r)||n:n||E5(s,r);return Object.assign(Object.assign({},t),{color:e,name:n||a})})}).map(_5);return Object.assign(Object.assign({},0`(${e(t.name)}, ${e(t.value)}, ${e(t.color)})`)})}function T5(t){t.ruleY&&(t.ruleY.remove(),t.ruleY=void 0)}function j5(t,e){return Array.from(t.values()).some(t=>{return null==(t=t.interaction)?void 0:t[e]})}function N5(t,e){return void 0===t?e:t}function P5(t){var{title:t,items:e}=t;return 0===e.length&&void 0===t}function C5(S,t){var{elements:e,sort:A,filter:L,scale:T,coordinate:j,crosshairs:N,render:P,groupName:C,emitter:R,wait:n=50,leading:r=!0,trailing:i=!1,startX:I=0,startY:B=0,body:F=!0,single:D=!0,position:z,enterable:W,mount:G,bounding:q,style:a={}}=t,t=rt(t,["elements","sort","filter","scale","coordinate","crosshairs","render","groupName","emitter","wait","leading","trailing","startX","startY","body","single","position","enterable","mount","bounding","style"]),e=e(S);const H=Uc(j),V=Kc(j);a=it(a,t);const{innerWidth:Y,innerHeight:Q}=j.getOptions(),$=[],U=[];for(const u of e){var o=u["__data__"],o=o["seriesX"];(o?$:U).push(u)}$.sort((t,e)=>{const n=H?0:1;var r=t=>t.getBounds().min[n];return H?r(e)-r(t):r(t)-r(e)});const J=new Map($.map(t=>{var e=t["__data__"];const n=e["seriesX"];return[t,[Oc(n.map((t,e)=>e),t=>n[+t]),n]]})),tt=at(a,"crosshairs");t=T.x;const K=null!=t&&t.getBandWidth?t.getBandWidth()/2:0,X=t=>{var[t]=j.invert(t);return t-K},et=(t,e)=>{const n=H?1:0,r=t[n];return e.filter(t=>{var[t,e]=(t=>{var{min:t,max:e}=t.getLocalBounds();return Oc([t[n],e[n]])})(t);return r>=t&&r<=e})},s=un(t=>{var e=Kw(S,t);if(e){var n=S.getRenderBounds();const g=n.min[0],m=n.min[1],y=[e[0]-I,e[1]-B];y;var n=et(y,U),r=[],i=[];for(const b of $){var[a,o]=J.get(b),a=((t,e,n)=>{var t=X(t),[r,i]=Oc([n[0],n[n.length-1]]);return tn[+t]).center)(e,t)]})(y,a,o);if(null!==a){r.push(b);o=((t,n)=>{t=t.__data__;return Object.fromEntries(Object.entries(t).filter(([t])=>t.startsWith("series")&&"series"!==t).map(([t,e])=>{e=e[n];return[Xe(t.replace("series","")),e]}))})(b,a);const{x:g,y:m}=o;a=j.map([(g||0)+K,m||0]);i.push([o,a])}}var s=Array.from(new Set(i.map(t=>t[0].x)));const v=s[Fc(s,t=>Math.abs(t-X(y)))];var s=i.filter(t=>t[0].x===v),l=[...s.map(t=>t[0]),...n.map(t=>t.__data__)],n=[...r,...n],l=L5(n,T,C,l);if(A&&l.items.sort((t,e)=>A(t)-A(e)),L&&(l.items=l.items.filter(L)),0===n.length||P5(l))Z();else{if(F&&M5({root:S,data:l,x:e[0]+g,y:e[1]+m,render:P,event:t,single:D,position:z,enterable:W,mount:G,bounding:q}),N){n=s.map(t=>t[1]);{l=S;e=n;s=Object.assign(Object.assign({},tt),{width:Y,height:Q,startX:I,startY:B,transposed:H,polar:V});var c,{height:n,width:u,startX:f,startY:h,transposed:d,polar:p}=s,s=rt(s,["height","width","startX","startY","transposed","polar"]);const x=Object.assign({lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},s),w=(s=e.map(t=>t[1]),e=e.map(t=>t[0]),qc(s)),M=qc(e),[O,k,_,E]=p?(s=f+u/2,e=h+n/2,p=Math.min(u,n)/2,c=F0(R0([M,w],[s,e])),[s,s+p*Math.cos(c),e,e+p*Math.sin(c)]):d?[f,f+u,w+h,w+h]:[M+f,M+f,h,h+n];(e=l.ruleY||(s=new nt.Line({style:Object.assign({x1:O,x2:k,y1:_,y2:E},x)}),l.appendChild(s),s)).style.x1=O,e.style.x2=k,e.style.y1=_,e.style.y2=E,l.ruleY=e}}R.emit("tooltip:show",Object.assign(Object.assign({},t),{nativeEvent:!0,data:{data:{x:sw(T.x,X(y),!0)}}}))}}},n,{leading:r,trailing:i}),Z=()=>{O5({root:S,single:D,emitter:R,mount:G}),N&&T5(S)},l=({nativeEvent:t,data:e})=>{var n,r;t||(t=e.data["x"],e=T["x"],e=e.map(t),[t,e]=j.map([e,.5]),[n,r]=S.getRenderBounds()["min"],s({offsetX:t+n,offsetY:e+r}))},c=()=>{O5({root:S,single:D,emitter:R,nativeEvent:!1,mount:G})};return R.on("tooltip:show",l),R.on("tooltip:hide",c),S.addEventListener("pointerenter",s),S.addEventListener("pointermove",s),S.addEventListener("pointerleave",Z),()=>{S.removeEventListener("pointerenter",s),S.removeEventListener("pointermove",s),S.removeEventListener("pointerleave",Z),R.off("tooltip:show",l),R.off("tooltip:hide",c),k5(S),N&&T5(S)}}function R5(a,{elements:t,scale:o,render:s,groupName:l,sort:c,filter:u,emitter:f,wait:e=50,leading:n=!0,trailing:r=!1,groupKey:h=t=>t,single:d=!0,position:p,enterable:g,datum:m,view:y,mount:v,bounding:b}){const x=t(a),w=new Set(x),M=bc(x,h),O=un(t=>{var e,n,r,i=t["target"];!w.has(i)||(e=h(i),e=1===(e=M.get(e)).length?function(n){var{title:t,items:e=[]}=t=n["__data__"],e=e.filter(qu).map(t=>{var{color:e=S5(n)}=t,t=rt(t,["color"]);return Object.assign(Object.assign({},t),{color:e})}).map(_5);return Object.assign(Object.assign({},t&&{title:t}),{items:e})}(e[0]):L5(e,o,l),c&&e.items.sort((t,e)=>c(t)-c(e)),u&&(e.items=e.items.filter(u)),P5(e))?O5({root:a,single:d,emitter:f,mount:v}):({offsetX:n,offsetY:r}=t,M5({root:a,data:e,x:n,y:r,render:s,event:t,single:d,position:p,enterable:g,mount:v,bounding:b}),f.emit("tooltip:show",Object.assign(Object.assign({},t),{nativeEvent:!0,data:{data:v5(i,y)}})))},e,{leading:n,trailing:r}),i=t=>{t=t.target;w.has(t)&&O5({root:a,single:d,emitter:f,mount:v})},k=({nativeEvent:t,data:e})=>{var n,r,i;t||(t=s5(x,e.data,m))&&({x:e,y:n,width:r,height:i}=t.getBBox(),O({target:t,offsetX:e+r/2,offsetY:n+i/2}))},_=({nativeEvent:t}={})=>{t||O5({root:a,single:d,emitter:f,nativeEvent:!1,mount:v})};return f.on("tooltip:show",k),f.on("tooltip:hide",_),a.addEventListener("pointerover",O),a.addEventListener("pointermove",O),a.addEventListener("pointerout",i),()=>{a.removeEventListener("pointerover",O),a.removeEventListener("pointermove",O),a.removeEventListener("pointerout",i),f.off("tooltip:show",k),f.off("tooltip:hide",_),k5(a)}}function I5(t){const{shared:f,crosshairs:h,series:d,item:p=()=>({}),facet:g=!1}=t,m=rt(t,["shared","crosshairs","series","name","item","facet"]);return(e,t,n)=>{var{container:r,view:i}=e;const{scale:a,markState:o,coordinate:s}=i;var l=j5(o,"seriesTooltip"),c=j5(o,"crosshairs"),r=Uw(r),l=N5(d,l);if(l&&Array.from(o.values()).some(t=>{var e;return(null==(e=t.interaction)?void 0:e.seriesTooltip)&&t.tooltip})&&!g)return C5(r,Object.assign(Object.assign({},m),{elements:Vw,scale:a,coordinate:s,crosshairs:N5(h,c),item:p,emitter:n}));if(l&&g){l=t.filter(t=>t!==e&&t.options.parentKey===e.options.key);const u=Yw(e,t),a=l[0].view.scale;t=r.getBounds(),l=t.min[0],t=t.min[1];return C5(r.parentNode.parentNode,Object.assign(Object.assign({},m),{elements:()=>u,scale:a,coordinate:s,crosshairs:N5(h,c),item:p,startX:l,startY:t,emitter:n}))}return R5(r,Object.assign(Object.assign({},m),{datum:Jw(i),elements:Vw,scale:a,coordinate:s,groupKey:f?Qw(i):void 0,item:p,emitter:n,view:i}))}}const B5="legend-category",F5="items-item",D5="legend-category-item-marker",z5="legend-category-item-label";function W5(t){return t.getElementsByClassName(D5)[0]}function G5(t){return t.getElementsByClassName(z5)[0]}function q5(t){return t.getElementsByClassName(F5)}function H5(t){return t.getElementsByClassName(B5)}function V5(t){let e=t.parentNode;for(;e&&!e.__data__;)e=e.parentNode;return e.__data__}function Y5(t,{legends:e,marker:i,label:a,datum:o,filter:r,emitter:s,channel:l,state:n={}}){const c=new Map,u=new Map,f=new Map;var{unselected:n={markerStroke:"#aaa",markerFill:"#aaa",labelFill:"#aaa"}}=n,h={unselected:at(n,"marker")},n={unselected:at(n,"label")};const{setState:d,removeState:p}=t5(h,void 0),{setState:g,removeState:m}=t5(n,void 0),y=Array.from(e(t));let v=y.map(o);const b=()=>{for(const r of y){var t=o(r),e=i(r),n=a(r);(v.includes(t)?(p(e,"unselected"),m):(d(e,"unselected"),g))(n,"unselected")}};for(const _ of y){var x=()=>{o5(t,"pointer")},w=()=>{o5(t,"default")},M=n=>ue(this,void 0,void 0,function*(){var t=o(_),e=v.indexOf(t),{nativeEvent:t=!0}=(-1===e?v.push(t):v.splice(e,1),0===v.length&&v.push(...y.map(o)),yield r(v),b(),n);t&&(v.length===y.length?s.emit("legend:reset",{nativeEvent:t}):s.emit("legend:filter",Object.assign(Object.assign({},n),{nativeEvent:t,data:{channel:l,values:v}})))});_.addEventListener("click",M),_.addEventListener("pointerenter",x),_.addEventListener("pointerout",w),c.set(_,M),u.set(_,x),f.set(_,w)}const O=n=>ue(this,void 0,void 0,function*(){var t,e=n["nativeEvent"];e||(e=n["data"],{channel:e,values:t}=e,e===l&&(v=t,yield r(v),b()))}),k=e=>ue(this,void 0,void 0,function*(){var t=e["nativeEvent"];t||(v=y.map(o),yield r(v),b())});return s.on("legend:filter",O),s.on("legend:reset",k),()=>{for(const t of y)t.removeEventListener("click",c.get(t)),t.removeEventListener("pointerenter",u.get(t)),t.removeEventListener("pointerout",f.get(t)),s.off("legend:filter",O),s.off("legend:reset",k)}}function $5(){return(t,e,r)=>{const{container:i,view:a,options:o,update:s}=t;t=H5(i);const l=(r,i)=>ue(this,void 0,void 0,function*(){var t=a["scale"];const{[r]:n}=t;t=o.marks,t=t.map(t=>{var{transform:e=[]}=t,e=[{type:"filter",[r]:i},...e];return it({},t,{transform:e,scale:{[r]:{domain:n.getOptions().domain}}})}),t=Object.assign(Object.assign({},o),{marks:t});return s(t)}),n=t.map(t=>{const{name:e,domain:n}=V5(t).scales[0];return Y5(i,{legends:q5,marker:W5,label:G5,datum:t=>{t=t.__data__,t=t.index;return n[t]},filter:t=>l(e,t),state:t.attributes.state,channel:e,emitter:r})});return()=>{n.forEach(t=>t())}}}function U5(){return(t,e,a)=>{const{container:n,view:r,options:i}=t;t=H5(n);const o=Vw(n);var s=e5(i,["active","inactive"]),l=n5(o,Jw(r));const c=[];for(const d of t){const p=t=>{var e=d.attributes["data"],t=t["__data__"],t=t["index"];return e[t].label},g=V5(d).scales[0].name,m=q5(d),y=(t=>{var{scale:{[t]:t}}=r;return t})(g),v=bc(o,t=>y.invert(t.__data__[g]));var{state:u={}}=d.attributes,{inactive:u={}}=u;const{setState:b,removeState:x}=t5(s,l);var f={inactive:at(u,"marker")},u={inactive:at(u,"label")};const{setState:w,removeState:M}=t5(f),{setState:O,removeState:k}=t5(u),_=t=>{for(const r of m){var e=W5(r),n=G5(r);(r===t||null===t?(M(e,"inactive"),k):(w(e,"inactive"),O))(n,"inactive")}},E=(t,e)=>{var n=p(e),r=new Set(v.get(n));for(const i of o)r.has(i)?b(i,"active"):b(i,"inactive");_(e);var{nativeEvent:e=!0}=t;e&&a.emit("legend:highlight",Object.assign(Object.assign({},t),{nativeEvent:e,data:{channel:g,value:n}}))},S=new Map;for(const j of m){var h=t=>{E(t,j)};j.addEventListener("pointerover",h),S.set(j,h)}const A=t=>{for(const e of o)x(e,"inactive","active");_(null);var{nativeEvent:t=!0}=t;t&&a.emit("legend:unhighlight",{nativeEvent:t})},L=t=>{var{nativeEvent:t,data:e}=t;if(!t){const{channel:n,value:r}=e;n===g&&(t=m.find(t=>p(t)===r))&&E({nativeEvent:!1},t)}},T=t=>{t=t.nativeEvent;t||A({nativeEvent:!1})};d.addEventListener("pointerleave",A),a.on("legend:highlight",L),a.on("legend:unhighlight",T);c.push(()=>{d.removeEventListener(A),a.off("legend:highlight",L),a.off("legend:unhighlight",T);for(var[t,e]of S)t.removeEventListener(e)})}return()=>c.forEach(t=>t())}}function K5(t,e){for(var[n,r]of Object.entries(e))t.style(n,r)}const X5=Eg(t=>{const e=t.attributes,{x:n,y:r,width:i,height:a,class:o,handleSize:s=10,document:l}=e,c=rt(e,["x","y","width","height","class","renders","handleSize","document"]);if(l&&void 0!==i&&void 0!==a&&void 0!==n&&void 0!==r){var u=s/2,f=(t,e,n)=>{t.handle||(t.handle=n.createElement("rect"),t.append(t.handle));n=t.handle;return n.attr(e),n},h=at(Vu(c,"handleNW","handleNE"),"handleN"),{render:d=f}=h,h=rt(h,["render"]),p=at(c,"handleE"),{render:g=f}=p,p=rt(p,["render"]),m=at(Vu(c,"handleSE","handleSW"),"handleS"),{render:y=f}=m,m=rt(m,["render"]),v=at(c,"handleW"),{render:b=f}=v,v=rt(v,["render"]),x=at(c,"handleNW"),{render:w=f}=x,x=rt(x,["render"]),M=at(c,"handleNE"),{render:O=f}=M,M=rt(M,["render"]),k=at(c,"handleSE"),{render:_=f}=k,k=rt(k,["render"]),E=at(c,"handleSW"),{render:f=f}=E,E=rt(E,["render"]);var S=i=>()=>{return new(Eg(t=>{return e=i,n=(t=t).id,r=rt(t.attributes,["x","y"]),(e=e(t,Object.assign({x:0,y:0},r),l)).id=n,void(e.style.draggable=!0);var e,n,r}))({})},t=ot(t).attr("className",o).style("x",n).style("y",r).style("draggable",!0);t.maybeAppend("selection","rect").style("draggable",!0).style("fill","transparent").call(K5,Object.assign({width:i,height:a},Vu(c,"handle"))),t.maybeAppend("handle-n",S(d)).style("x",u).style("y",-u).style("width",i-s).style("height",s).style("fill","transparent").call(K5,h),t.maybeAppend("handle-e",S(g)).style("x",i-u).style("y",u).style("width",s).style("height",a-s).style("fill","transparent").call(K5,p),t.maybeAppend("handle-s",S(y)).style("x",u).style("y",a-u).style("width",i-s).style("height",s).style("fill","transparent").call(K5,m),t.maybeAppend("handle-w",S(b)).style("x",-u).style("y",u).style("width",s).style("height",a-s).style("fill","transparent").call(K5,v),t.maybeAppend("handle-nw",S(w)).style("x",-u).style("y",-u).style("width",s).style("height",s).style("fill","transparent").call(K5,x),t.maybeAppend("handle-ne",S(O)).style("x",i-u).style("y",-u).style("width",s).style("height",s).style("fill","transparent").call(K5,M),t.maybeAppend("handle-se",S(_)).style("x",i-u).style("y",a-u).style("width",s).style("height",s).style("fill","transparent").call(K5,k),t.maybeAppend("handle-sw",S(f)).style("x",-u).style("y",a-u).style("width",s).style("height",s).style("fill","transparent").call(K5,E)}});function Z5(l,t){var{brushed:a=()=>{},brushended:e=()=>{},brushcreated:o=()=>{},extent:s=function(t){var{width:t,height:e}=t.getBBox();return[0,0,t,e]}(l),brushRegion:c=(t,e,n,r,i)=>[t,e,n,r],reverse:u=!1,fill:n="#777",fillOpacity:r="0.3",stroke:i="#fff",selectedHandles:f=["handle-n","handle-e","handle-s","handle-w","handle-nw","handle-ne","handle-se","handle-sw"]}=t,h=rt(t,["brushed","brushended","brushcreated","extent","brushRegion","reverse","fill","fillOpacity","stroke","selectedHandles"]);let d=null,p=null,g=null,m=null,y=null,v=!1;const[b,x,w,M]=s,O=(o5(l,"crosshair"),l.style.draggable=!0,(t,e)=>{if(m&&m.remove(),y&&y.remove(),d=[t,e],u)return I();B()}),I=()=>{y=new nt.Path({style:Object.assign(Object.assign({},h),{fill:n,fillOpacity:r,stroke:i,pointerEvents:"none"})}),m=new X5({style:{x:0,y:0,width:0,height:0,draggable:!0,document:l.ownerDocument},className:"mask"}),l.appendChild(y),l.appendChild(m)},B=()=>{m=new X5({style:Object.assign(Object.assign({document:l.ownerDocument,x:0,y:0},h),{fill:n,fillOpacity:r,stroke:i,draggable:!0}),className:"mask"}),l.appendChild(m)},k=(t=!0)=>{m&&m.remove(),y&&y.remove(),d=null,p=null,g=null,v=!1,m=null,y=null,e(t)},_=(t,e,n=!0)=>{var[t,e,r,i]=function(t,e,n,r,i){var[i,a,o,s]=i;return[Math.max(i,Math.min(t,n)),Math.max(a,Math.min(e,r)),Math.min(o,Math.max(t,n)),Math.min(s,Math.max(e,r))]}(t[0],t[1],e[0],e[1],s),[t,e,r,i]=c(t,e,r,i,s);return(u?D:F)(t,e,r,i),a(t,e,r,i,n),[t,e,r,i]},F=(t,e,n,r)=>{m.style.x=t,m.style.y=e,m.style.width=n-t,m.style.height=r-e},D=(t,e,n,r)=>{y.style.d=` M${b},${x}L${w},${x}L${w},${M}L${b},${M}Z M${t},${e}L${t},${r}L${n},${r}L${n},${e}Z `,m.style.x=t,m.style.y=e,m.style.width=n-t,m.style.height=r-e},E={"handle-n":{vector:[0,1,0,0],cursor:"ns-resize"},"handle-e":{vector:[0,0,1,0],cursor:"ew-resize"},"handle-s":{vector:[0,0,0,1],cursor:"ns-resize"},"handle-w":{vector:[1,0,0,0],cursor:"ew-resize"},"handle-nw":{vector:[1,1,0,0],cursor:"nwse-resize"},"handle-ne":{vector:[0,1,1,0],cursor:"nesw-resize"},"handle-se":{vector:[0,0,1,1],cursor:"nwse-resize"},"handle-sw":{vector:[1,0,0,1],cursor:"nesw-resize"}},S=t=>L(t)||A(t),A=t=>{t=t.id;return-1!==f.indexOf(t)&&new Set(Object.keys(E)).has(t)},L=t=>t===m.getElementById("selection"),T=t=>{var e=t["target"],[t,n]=Xw(l,t);m&&S(e)?S(e)&&(g=[t,n]):(O(t,n),v=!0)},j=t=>{var e,n,r,i,a,o,s=t["target"],t=Xw(l,t);if(d)return g?L(s)?(e=(t,e,n,r,i)=>t+e{var e,n,r,i;g?(g=null,{x:e,y:r,width:n,height:i}=m.style,d=[e,r],p=[e+n,r+i]):(p=Xw(l,t),[e,n,r,i]=_(d,p),v=!1,o(e,n,r,i,t))},P=t=>{t=t.target;m&&!S(t)&&k()},C=t=>{t=t.target;m&&S(t)&&!v?L(t)?o5(l,"move"):A(t)&&o5(l,E[t.id].cursor):o5(l,"crosshair")},R=()=>{o5(l,"default")};return l.addEventListener("dragstart",T),l.addEventListener("drag",j),l.addEventListener("dragend",N),l.addEventListener("click",P),l.addEventListener("pointermove",C),l.addEventListener("pointerleave",R),{mask:m,move(t,e,n,r,i=!0){m||O(t,e),d=[t,e],p=[n,r],_([t,e],[n,r],i)},remove(){m&&k(!1)},destroy(){m&&k(!1),o5(l,"default"),l.removeEventListener("dragstart",T),l.removeEventListener("drag",j),l.removeEventListener("dragend",N),l.removeEventListener("click",P),l.removeEventListener("pointermove",C),l.removeEventListener("pointerleave",R)}}}function Q5(e,t,n){return t.filter(t=>{return t!==e&&({interaction:t={}}=t.options,Object.values(t).find(t=>t.brushKey===n))})}function J5(t,e){var{elements:n,selectedHandles:r,siblings:i=t=>[],datum:a,brushRegion:o,extent:s,reverse:l,scale:c,coordinate:u,series:f=!1,key:d=t=>t,bboxOf:h=t=>{var{x:t,y:e,width:n,height:r}=t.style;return{x:t,y:e,width:n,height:r}},state:p={},emitter:g}=e,e=rt(e,["elements","selectedHandles","siblings","datum","brushRegion","extent","reverse","scale","coordinate","series","key","bboxOf","state","emitter"]);const m=n(t),y=i(t),v=y.flatMap(n);i=n5(m,a),n=at(e,"mask");const{setState:b,removeState:x}=t5(p,i),w=new Map,{width:M,height:O,x:k=0,y:_=0}=h(t);a=s||[0,0,M,O];const E=()=>{for(const t of[...m,...v])x(t,"active","inactive")},S=(t,e,n,r)=>{var i;for(const u of y)null!=(i=u.brush)&&i.remove();var a=new Set;for(const f of m){var{min:o,max:s}=f.getLocalBounds(),[o,l]=o,[s,c]=s;!function(t,e){var[t,n,r,i]=t,[e,a,o,s]=e;return!(r{for(const t of m)x(t,"inactive");for(const e of w.values())e.remove();w.clear()},L=(t,e,n,r)=>{var i;for(const o of m){var a=w.get(o)||(a=o,i=void 0,(i=a.cloneNode()).__data__=a.__data__,a.parentNode.appendChild(i),w.set(a,i),i);a.style.clipPath=new nt.Rect({style:{x:t+k,y:e+_,width:n-t,height:r-e}}),b(o,"inactive"),b(a,"active")}},T=Z5(t,Object.assign(Object.assign({},n),{extent:a,brushRegion:o,reverse:l,selectedHandles:r,brushended:t=>{var e=f?A:E;t&&g.emit("brush:remove",{nativeEvent:!0}),e()},brushed:(t,e,n,r,i)=>{var a=cw(t,e,n,r,c,u);i&&g.emit("brush:highlight",{nativeEvent:!0,data:{selection:a}}),(f?L:S)(t,e,n,r)}})),j=({nativeEvent:t,data:e})=>{var n,r;t||(t=e["selection"],[e,t,n,r]=function(t,e,n){var{x:e,y:r}=e,[t,i]=t,t=uw(t,e),e=uw(i,r),i=[t[0],e[0]],r=[t[1],e[1]],[t,e]=n.map(i),[i,n]=n.map(r);return[t,e,i,n]}(t,c,u),T.move(e,t,n,r,!1))},N=(g.on("brush:highlight",j),()=>T.remove()),P=(g.on("brush:remove",N),T.destroy.bind(T));return T.destroy=()=>{g.off("brush:highlight",j),g.off("brush:remove",N),P()},T}function tM(t){var{facet:g,brushKey:m}=t,y=rt(t,["facet","brushKey"]);return(t,e,n)=>{var r,i,a,o,{container:s,view:l,options:c}=t,s=Uw(s),u={maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",reverse:!1},f=["active",["inactive",{opacity:.5}]],{scale:h,coordinate:d}=l;if(g)return r=(o=s.getBounds()).min[0],i=o.min[1],a=o.max[0],o=o.max[1],J5(s.parentNode.parentNode,Object.assign(Object.assign({elements:()=>Yw(t,e),datum:Jw($w(t,e).map(t=>t.view)),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:[r,i,a,o],state:e5($w(t,e).map(t=>t.options),f),emitter:n,scale:h,coordinate:d,selectedHandles:void 0},u),y));const p=J5(s,Object.assign(Object.assign({elements:Vw,key:t=>t.__data__.key,siblings:()=>{return Q5(t,e,m).map(t=>Uw(t.container))},datum:Jw([l,...Q5(t,e,m).map(t=>t.view)]),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:void 0,state:e5([c,...Q5(t,e,m).map(t=>t.options)],f),emitter:n,scale:h,coordinate:d,selectedHandles:void 0},u),y));return s.brush=p,()=>p.destroy()}}function eM(t,e,n,r,i){var[,i,,a]=i;return[t,i,n,a]}function nM(t){return tM(Object.assign(Object.assign({},t),{brushRegion:eM,selectedHandles:["handle-e","handle-w"]}))}function rM(t,e,n,r,i){var[i,,a]=i;return[i,e,a,r]}function iM(t){return tM(Object.assign(Object.assign({},t),{brushRegion:rM,selectedHandles:["handle-n","handle-s"]}))}const aM="axis",oM="axis-hot-area";function sM(t){return t.getElementsByClassName(aM)}function lM(t){return t.getElementsByClassName("axis-line")[0]}function cM(t){return t.getElementsByClassName("axis-main-group")[0].getLocalBounds()}function uM(t,e){var{cross:n,offsetX:i}=e,e=rt(e,["cross","offsetX","offsetY"]),r=cM(t),[t]=lM(t).getLocalBounds().min;const[a,o]=r.min,[s,l]=r.max;r=2*(s-a);return{brushRegion:rM,hotZone:new nt.Rect({className:oM,style:Object.assign({x:n?a:t-r/2,width:n?r/2:r,y:o,height:l-o},e)}),extent:n?(t,e,n,r)=>[-1/0,e,1/0,r]:(t,e,n,r)=>[Math.floor(a-i),e,Math.ceil(s-i),r]}}function fM(t,e){var{offsetY:i,cross:n=!1}=e,e=rt(e,["offsetY","offsetX","cross"]),r=cM(t),[,t]=lM(t).getLocalBounds().min;const[a,o]=r.min,[s,l]=r.max;r=l-o;return{brushRegion:eM,hotZone:new nt.Rect({className:oM,style:Object.assign({x:a,width:s-a,y:n?o:t-r,height:n?r:2*r},e)}),extent:n?(t,e,n,r)=>[t,-1/0,n,1/0]:(t,e,n,r)=>[t,Math.floor(o-i),n,Math.ceil(l-i)]}}function hM(t,e){var{axes:n,elements:r,points:i,horizontal:s,datum:a,offsetY:o,offsetX:l,reverse:c=!1,state:u={},emitter:f,coordinate:h}=e,e=rt(e,["axes","elements","points","horizontal","datum","offsetY","offsetX","reverse","state","emitter","coordinate"]);const d=r(t),p=n(t),{setState:g,removeState:m}=t5(u,n5(d,a)),y=new Map;var v=at(e,"mask");const b=p.map(t=>t.attributes.scale),x=t=>2{w.clear();for(let t=0;t{var n=[];for(const r of d)(t=>Array.from(y.values()).every(([n,r,i,a])=>t.some(([t,e])=>n<=t&&t<=i&&r<=e&&e<=a)))(i(r))?(g(r,"active"),n.push(r)):g(r,"inactive");w.set(t,((t,e)=>{const n=b[e],{name:r}=n.getOptions(),i=t.map(t=>{const e=t.__data__;return n.invert(e[r])});return x(lw(n,i))})(n,t)),e&&f.emit("brushAxis:highlight",{nativeEvent:!0,data:{selection:(()=>{if(!k)return Array.from(w.values());var t,e,n=[];for([t,e]of w){var r=b[t].getOptions()["name"];"x"===r?n[0]=e:n[1]=e}return n})()}})}),k=p.some(s)&&p.some(t=>!s(t)),_=[];for(let a=0;a{t=t.nativeEvent;t||_.forEach(t=>t.remove())},A=(t,e,n)=>{var{height:r,width:i}=h.getOptions(),e=e.clone();return s(n)?e.update({range:[0,i]}):e.update({range:[r,0]}),e.map(t)},L=t=>{var e=t["nativeEvent"];if(!e){var n=t.data["selection"];for(let t=0;t<_.length;t++){var r,i=n[t],a=_[t],o=p[t];i?(r=b[t],a.move(...((t,e,n)=>{var[t,r]=t,t=A(t,e,n),e=A(r,e,n)+((r=e).getStep?r.getStep():0);return s(n)?[t,-1/0,e,1/0]:[-1/0,t,1/0,e]})(i,r,o),!1)):a.remove()}}};return f.on("brushAxis:remove",S),f.on("brushAxis:highlight",L),()=>{_.forEach(t=>t.destroy()),f.off("brushAxis:remove",S),f.off("brushAxis:highlight",L)}}function dM(l){return(t,e,n)=>{var{container:t,view:r,options:i}=t,{x:a,y:o}=Uw(t).getBBox(),s=r["coordinate"];return hM(t,Object.assign({elements:Vw,axes:sM,offsetY:o,offsetX:a,points:t=>t.__data__.points,horizontal:t=>{var{startPos:[t,e],endPos:[n,r]}=t.attributes;return t!==n&&e===r},datum:Jw(r),state:e5(i,["active",["inactive",{opacity:.5}]]),coordinate:s,emitter:n},l))}}function pM(t,e){var{filter:a,reset:n,brushRegion:r,extent:i,reverse:o,emitter:s,selection:l}=e,e=at(rt(e,["filter","reset","brushRegion","extent","reverse","emitter","scale","coordinate","selection","series"]),"mask"),{width:c,height:u}=t.getBBox(),i=i||[0,0,c,u];const f=function(e=300){let n=null;return t=>{t=t.timeStamp;return null!==n&&t-n{t||(t=e["selection"],a(t,{nativeEvent:!1}))};return s.on("brush:filter",p),()=>{h.destroy(),s.off("brush:filter",p),t.removeEventListener("click",d)}}function gM(t){var{hideX:h=!0,hideY:d=!0}=t,p=rt(t,["hideX","hideY"]);return(t,e,a)=>{const{container:n,view:r,options:o,update:s}=t;t=Uw(n);let l=!1,c=!1,u=r;var{scale:i,coordinate:f}=r;return pM(t,Object.assign(Object.assign({brushRegion:(t,e,n,r)=>[t,e,n,r],selection:(t,e,n,r)=>{var{scale:i,coordinate:a}=u;return cw(t,e,n,r,i,a)},filter:(r,i)=>ue(this,void 0,void 0,function*(){if(!c){c=!0;const[e,n]=r;var t=o["marks"],t=t.map(t=>it({axis:Object.assign(Object.assign({},h&&{x:{transform:[{type:"hide"}]}}),d&&{y:{transform:[{type:"hide"}]}})},t,{scale:{x:{domain:e},y:{domain:n}}})),t=(a.emit("brush:filter",Object.assign(Object.assign({},i),{data:{selection:[e,n]}})),Object.assign(Object.assign({},o),{marks:t,clip:!0})),t=yield s(t);u=t.view,c=!1,l=!0}}),reset:t=>{var e,n;!c&&l&&(e=r["scale"],{x:e,y:n}=e,e=e.getOptions().domain,n=n.getOptions().domain,a.emit("brush:filter",Object.assign(Object.assign({},t),{data:{selection:[e,n]}})),l=!1,u=r,s(o))},extent:void 0,emitter:a,scale:i,coordinate:f},{maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",unhighlightedOpacity:.5,reverse:!1}),p))}}function mM(t){return gM(Object.assign(Object.assign({hideX:!0},t),{brushRegion:eM}))}function yM(t){return gM(Object.assign(Object.assign({hideY:!0},t),{brushRegion:rM}))}const vM="slider";function bM(t){return[t[0],t[t.length-1]]}function xM({channelDomain:E,className:S=vM,prefix:A="slider",setValue:L=(t,e)=>t.setValues(e),hasState:T=!1,wait:j=50,leading:N=!0,trailing:P=!1}){return(t,e,c)=>{const{container:n,view:r,options:u,update:f}=t;t=n.getElementsByClassName(S);if(!t.length)return()=>{};let h=!1;const{scale:i,coordinate:a}=r,{x:o,y:s}=i,l=Uc(a);const d=new Map,p=new Set;E=E||{x:o.getOptions().domain,y:s.getOptions().domain};for(const y of t){const v=y.attributes["orientation"],[b,x]=(m=v,g=void 0,g="vertical"===m?"y":"x",m="vertical"===m?"x":"y",l?[m,g]:[g,m]),w=""+A+Qe(b)+":filter",M="x"===b,O=o.getOptions()["ratio"],k=s.getOptions()["ratio"],_=t=>{var e,n;return t.data?(e=t.data["selection"],[e=bM(E.x),n=bM(E.y)]=e,M?[lw(o,e,O),lw(s,n,k)]:[lw(s,n,k),lw(o,e,O)]):(n=t.detail["value"],[function(t,e,n){var[t,r]=t;return lw(e,[sw(e,(n=n?t=>1-t:t=>t)(t),!0),sw(e,n(r),!1)])}(n,i[b],l&&"horizontal"===v),E[x]])};var g=un(l=>ue(this,void 0,void 0,function*(){var t,e,n,r,i,a,o,s;h||(h=!0,{nativeEvent:t=!0}=l,[e,s]=_(l),E[b]=e,E[x]=s,[n,r,i,a=!1]=[u,{[b]:{domain:e},[x]:{domain:s}},A,T],o=(o=n["marks"]).map(t=>it({axis:{x:{transform:[{type:"hide"}]},y:{transform:[{type:"hide"}]}}},t,{scale:r,[i]:Object.assign(Object.assign({},t[i].x&&{x:Object.assign({preserve:!0},a&&{ratio:null})}),t[i].y&&{y:Object.assign({preserve:!0},a&&{ratio:null})}),animate:!1})),n=Object.assign(Object.assign({},n),{marks:o,clip:!0,animate:!1}),t&&(o=M?e:s,s=M?s:e,c.emit(w,Object.assign(Object.assign({},l),{nativeEvent:t,data:{selection:[bM(o),bM(s)]}}))),yield f(n),h=!1)}),j,{leading:N,trailing:P}),m=t=>{var e,n=t["nativeEvent"];n||(n=t["data"],t=n["selection"],[t,e]=t,y.dispatchEvent(new nt.CustomEvent("valuechange",{data:n,nativeEvent:!1})),n=M?uw(t,o):uw(e,s),L(y,n))};c.on(w,m),y.addEventListener("valuechange",g),d.set(y,g),p.add([w,m])}return()=>{for(var[t,e]of d)t.removeEventListener("valuechange",e);for(var[n,r]of p)c.off(n,r)}}}const wM="g2-scrollbar";function MM(o={}){return(t,e,n)=>{var r,{view:i,container:a}=t;return a.getElementsByClassName(wM).length?(a=i["scale"],{x:i,y:a}=a,r={x:i.getOptions().domain,y:a.getOptions().domain},i.update({domain:i.getOptions().expectedDomain}),a.update({domain:a.getOptions().expectedDomain}),xM(Object.assign(Object.assign({},o),{channelDomain:r,className:wM,prefix:"scrollbar",hasState:!0,setValue:(t,e)=>t.setValue(e[0])}))(t,e,n)):()=>{}}}const OM={backgroundColor:"rgba(0,0,0,0.75)",color:"#fff",width:"max-content",padding:"1px 4px",fontSize:"12px",borderRadius:"2.5px",boxShadow:"0 3px 6px -4px rgba(0,0,0,0.12), 0 6px 16px 0 rgba(0,0,0,0.08), 0 9px 28px 8px rgba(0,0,0,0.05)"};function kM(t){return"text"===t.nodeName&&!!t.isOverflowing()}function _M(t){var{offsetX:h=8,offsetY:d=8}=t,r=rt(t,["offsetX","offsetY"]);return t=>{const s=t["container"],[l,c]=s.getBounds().min,u=at(r,"tip"),f=new Set,e=t=>{var e,n,r,i,a,o=t["target"];kM(o)?({offsetX:e,offsetY:n}=t,e=e+h-l,n=n+d-c,o.tip?(o.tip.style.x=e,o.tip.style.y=n):(i=o.style["text"],a=new nt.HTML({className:"poptip",style:{innerHTML:(r="div",i=i,a=Object.assign(Object.assign({},OM),u),`<${r} style="${Object.entries(a).map(([t,e])=>t.replace(/([A-Z])/g,"-$1").toLowerCase()+":"+e).join(";")}">${i}`),x:e,y:n}}),s.appendChild(a),o.tip=a,f.add(a))):t.stopPropagation()},n=t=>{var e=t["target"];kM(e)?e.tip&&(e.tip.remove(),e.tip=null,f.delete(e.tip)):t.stopPropagation()};return s.addEventListener("pointerover",e),s.addEventListener("pointerout",n),()=>{s.removeEventListener("pointerover",e),s.removeEventListener("pointerout",n),f.forEach(t=>t.remove())}}}function EM(n){return(t,...e)=>it({},n(t,...e),t)}function SM(n){return(t,...e)=>it({},t,n(t,...e))}function AM(t,e){var n;return t?Array.isArray(t)?t:({value:n=e}=t,t=rt(t,["value"]),Object.assign(Object.assign({},t),{value:n})):e}const LM=()=>t=>{var e=t["children"];if(!Array.isArray(e))return[];const{x:o=0,y:s=0,width:l,height:c,data:u}=t;return e.map(t=>{var{data:e,x:n,y:r,width:i,height:a}=t,t=rt(t,["data","x","y","width","height"]);return Object.assign(Object.assign({},t),{data:AM(e,u),x:null!=n?n:o,y:null!=r?r:s,width:null!=i?i:l,height:null!=a?a:c})})},TM=(LM.props={},()=>e=>{var n=e["children"];if(!Array.isArray(n))return[];var{direction:t="row",ratio:r=n.map(()=>1),padding:i=0,data:a}=e,[o,s,l,c]="col"===t?["y","height","width","x"]:["x","width","height","y"];const u=r.reduce((t,e)=>t+e),f=e[s]-i*(n.length-1);var h=r.map(t=>f*(t/u)),d=[];let p=e[o]||0;for(let t=0;tt=>{var e=t["children"],t=rt(t,["children"]);if(!Array.isArray(e))return[];const{data:s,scale:l={},axis:c={},legend:u={},encode:f={},transform:h=[]}=t,n=rt(t,["data","scale","axis","legend","encode","transform"]);t=e.map(t=>{var{data:e,scale:n={},axis:r={},legend:i={},encode:a={},transform:o=[]}=t,t=rt(t,["data","scale","axis","legend","encode","transform"]);return Object.assign({data:AM(e,s),scale:it({},l,n),encode:it({},f,a),transform:[...h,...o],axis:!(!r||!c)&&it({},c,r),legend:!(!i||!u)&&it({},u,i)},t)});return[Object.assign(Object.assign({},n),{marks:t,type:"standardView"})]}),NM=(jM.props={},()=>t=>{var{width:e,height:n,paddingLeft:r,paddingRight:i,paddingTop:a,paddingBottom:o,padding:s,inset:l,insetLeft:c,insetTop:u,insetRight:f,insetBottom:h,margin:d,marginLeft:p,marginBottom:g,marginTop:m,marginRight:y,data:v,coordinate:b,theme:x,component:w,interaction:M,x:O,y:k,key:_,frame:E,title:S,labelTransform:A,parentKey:L,clip:T,viewStyle:j}=t,t=rt(t,["width","height","paddingLeft","paddingRight","paddingTop","paddingBottom","padding","inset","insetLeft","insetTop","insetRight","insetBottom","margin","marginLeft","marginBottom","marginTop","marginRight","data","coordinate","theme","component","interaction","x","y","key","frame","title","labelTransform","parentKey","clip","viewStyle"]);return[{type:"standardView",x:O,y:k,key:_,width:e,height:n,padding:s,paddingLeft:r,paddingRight:i,paddingTop:a,inset:l,insetLeft:c,insetTop:u,insetRight:f,insetBottom:h,paddingBottom:o,theme:x,coordinate:b,component:w,interaction:M,frame:E,title:S,labelTransform:A,margin:d,marginLeft:p,marginBottom:g,marginTop:m,marginRight:y,parentKey:L,clip:T,style:j,marks:[Object.assign(Object.assign({},t),{key:_+"-0",data:v})]}]}),PM=(NM.props={},EM(t=>{const{encode:e,data:i,scale:a,shareSize:o=!1}=t;var{x:t,y:n}=e,r=(e,t)=>{if(void 0===e||!o)return{};const n=bc(i,t=>t[e]);var t=(null==(t=null===a||void 0===a?void 0:a[t])?void 0:t.domain)||Array.from(n.keys()),r=t.map(t=>n.has(t)?n.get(t).length:1);return{domain:t,flex:r}};return{scale:{x:Object.assign(Object.assign({paddingOuter:0,paddingInner:.1,guide:void 0===t?null:{position:"top"}},void 0===t&&{paddingInner:0}),r(t,"x")),y:Object.assign(Object.assign({range:[0,1],paddingOuter:0,paddingInner:.1,guide:void 0===n?null:{position:"right"}},void 0===n&&{paddingInner:0}),r(n,"y"))}}})),CM=EM(t=>{const{data:e,scale:n}=t;var r=[t];let i,a,o;for(;r.length;){const{children:h,encode:d={},scale:n={},legend:p={}}=r.shift();var s=d["color"],l=n["color"],c=p["color"];void 0!==s&&(i=s),void 0!==l&&(a=l),void 0!==c&&(o=c),Array.isArray(h)&&r.push(...h)}var t="string"==typeof i?i:"",[u,f]=void 0!==(u=null==(u=null===n||void 0===n?void 0:n.color)?void 0:u.domain)?[u]:void 0===i?[void 0]:(u="function"==typeof i?i:t=>t[i],(u=e.map(u)).some(t=>"number"==typeof t)?[pc(u)]:[Array.from(new Set(u)),"ordinal"]);return{encode:{color:i},scale:{color:it({},a,{domain:u,type:f})},legend:{color:it({title:t},o)}}}),RM=EM(()=>({animate:{enterType:"fadeIn"}})),IM=SM(()=>({frame:!1,encode:{shape:"hollow"},style:{lineWidth:0}})),BM=SM(()=>({type:"cell"})),FM=SM(c=>{var t=c["data"];return{data:{type:"inline",value:t,transform:[{type:"custom",callback:()=>{var{data:t,encode:e}=c;const{x:n,y:r}=e,i=n?Array.from(new Set(t.map(t=>t[n]))):[],a=r?Array.from(new Set(t.map(t=>t[r]))):[];if(i.length&&a.length){var o=[];for(const s of i)for(const l of a)o.push({[n]:s,[r]:l});return o}return i.length?i.map(t=>({[n]:t})):a.length?a.map(t=>({[r]:t})):void 0}}]}}}),DM=SM((t,c=function(t){t=t.points;return W0(t)},w=function(a){return(t,e)=>{var{rowIndex:t,rowValuesLength:n,columnIndex:r,columnValuesLength:i}=t;return t!==n-1?zM(a,e):(t=e.length?void 0:null,it({title:r===i-1&&void 0,grid:t},a))}},M=function(r){return(t,e)=>{var{rowIndex:t,columnIndex:n}=t;return 0!==n?zM(r,e):(n=e.length?void 0:null,it({title:0===t&&void 0,grid:n},r))}},O={})=>{const{data:e,encode:n,children:u,scale:r,x:k=0,y:_=0,shareData:f=!1,key:E}=t,S=e["value"],{x:A,y:L}=n;t=r.color;const T=t["domain"];return{children:(t,e,n)=>{const{x:r,y:i}=e,{paddingLeft:m,paddingTop:y}=n,a=r.getOptions()["domain"],o=i.getOptions()["domain"];e=j0(t);const s=t.map(c);n=t.map(({x:t,y:e})=>[r.invert(t),i.invert(e)]);const l=n.map(([n,r])=>t=>{var{[A]:t,[L]:e}=t,t=void 0===A||t===n,e=void 0===L||e===r;return t&&e}).map(t=>S.filter(t)),v=f?Rc(l,t=>t.length):void 0,b=n.map(([t,e])=>({columnField:A,columnIndex:a.indexOf(t),columnValue:t,columnValuesLength:a.length,rowField:L,rowIndex:o.indexOf(e),rowValue:e,rowValuesLength:o.length})),x=b.map(t=>Array.isArray(u)?u:[u(t)].flat(1));return e.flatMap(c=>{const[u,f,h,d]=s[c],p=b[c],g=l[c];return x[c].map(t=>{var{scale:e,key:n,facet:r=!0,axis:i={}}=t,t=rt(t,["scale","key","facet","axis","legend"]),a=(null==(a=null==e?void 0:e.y)?void 0:a.guide)||i.y,o=(null==(o=null==e?void 0:e.x)?void 0:o.guide)||i.x,s={x:{tickCount:A?5:void 0},y:{tickCount:L?5:void 0}},r=r?g:0===g.length?[]:S,l={color:{domain:T}},o={x:WM(o,w)(p,r),y:WM(a,M)(p,r)};return Object.assign(Object.assign({key:n+"-"+c,data:r,x:u+m+k,y:f+y+_,parentKey:E,width:h,height:d,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!!r.length,dataDomain:v,scale:it(s,e,l),axis:it({},i,o),legend:!1},t),O)})})}}});function zM(t,e){return e.length?it({title:!1,tick:null,label:null},t):it({title:!1,tick:null,label:null,grid:null},t)}function WM(t,e){return"function"==typeof t?t:null===t?()=>null:e(t)}const GM=()=>t=>{return[yw.of(t).call(BM).call(CM).call(RM).call(PM).call(IM).call(FM).call(DM).value()]},qM=(GM.props={},EM(t=>({scale:{x:{guide:null,paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),HM=SM(t=>{const{data:w,children:c,x:M=0,y:O=0,key:k}=t;return{children:(t,e,n)=>{const{x:r,y:i}=e,{paddingLeft:y,paddingTop:v}=n,a=r.getOptions()["domain"],o=i.getOptions()["domain"];e=j0(t);const s=t.map(({points:t})=>W0(t)),l=t.map(({x:t,y:e})=>[r.invert(t),i.invert(e)]),b=l.map(([t,e])=>({columnField:t,columnIndex:a.indexOf(t),columnValue:t,columnValuesLength:a.length,rowField:e,rowIndex:o.indexOf(e),rowValue:e,rowValuesLength:o.length})),x=b.map(t=>Array.isArray(c)?c:[c(t)].flat(1));return e.flatMap(c=>{const[u,f,h,d]=s[c],[p,g]=l[c],m=b[c];return x[c].map(t=>{var n,r,{scale:e,key:i,encode:a,axis:o}=t,t=rt(t,["scale","key","encode","axis"]),s=null==(s=null==e?void 0:e.y)?void 0:s.guide,l=null==(l=null==e?void 0:e.x)?void 0:l.guide,l={x:("function"==typeof(r=l)?r:null===r?()=>null:(t,e)=>{var{rowIndex:t,rowValuesLength:n}=t;if(t!==n-1)return zM(r,e)})(m,w),y:("function"==typeof(n=s)?n:null===n?()=>null:(t,e)=>{t=t.columnIndex;if(0!==t)return zM(n,e)})(m,w)};return Object.assign({data:w,parentKey:k,key:i+"-"+c,x:u+y+M,y:f+v+O,width:h,height:d,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!0,scale:it({x:{facet:!1},y:{facet:!1}},e),axis:it({x:{tickCount:5},y:{tickCount:5}},o,l),legend:!1,encode:it({},a,{x:p,y:g})},t)})})}}}),VM=SM(t=>{var e=t["encode"],t=rt(t,["encode"]),{position:n=[],x:r=n,y:i=[...n].reverse()}=e,n=rt(e,["position","x","y"]),a=[];for(const o of[r].flat(1))for(const s of[i].flat(1))a.push({$x:o,$y:s});return Object.assign(Object.assign({},t),{data:a,encode:Object.assign(Object.assign({},n),{x:"$x",y:"$y"}),scale:Object.assign(Object.assign({},1===[r].flat(1).length&&{x:{paddingInner:0}}),1===[i].flat(1).length&&{y:{paddingInner:0}})})});const YM=()=>t=>{return[yw.of(t).call(BM).call(CM).call(HM).call(VM).call(RM).call(IM).call(qM).value()]},$M=EM(t=>({scale:{x:{guide:{type:"axisArc"},paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}})),UM=EM(t=>({coordinate:{type:"polar"}})),KM=t=>{var e=t["encode"],t=rt(t,["encode"]),e=e["position"];return Object.assign(Object.assign({},t),{encode:{x:e}})};function XM(t){return t=>null}function ZM(t){var t=t["points"],[t,e,n,r]=t,i=B0(t,r),t=R0(t,r),r=z0(t,R0(e,n)),e=1/Math.sin(r/2),i=i/(1+e),a=i*Math.sqrt(2),[n,o]=n,t=D0(t)+r/2,r=i*e;return[n+r*Math.sin(t)-a/2,o+r*Math.cos(t)-a/2,a,a]}const QM=()=>t=>{return[yw.of(t).call(BM).call(KM).call(CM).call(UM).call(FM).call(DM,ZM,XM,XM,{frame:!1}).call(RM).call(IM).call($M).value()]};const JM=()=>t=>{const{children:e=[],duration:a=1e3,iterationCount:l=1,direction:c="normal",easing:o="ease-in-out-sine"}=t,u=e.length;if(!Array.isArray(e)||0===u)return[];const n=e[0]["key"],f=e.map(t=>Object.assign(Object.assign({},t),{key:n})).map(t=>{for(var e=a,n=o,r=[t];r.length;){var i=r.pop(),i=(i.animate=it({enter:{duration:e},update:{duration:e,easing:n,type:"morphing",fill:"both"},exit:{type:"fadeOut",duration:e}},i.animate||{}),i)["children"];Array.isArray(i)&&r.push(...i)}return t});return function*(){let t=0,e;for(;"infinite"===l||t(t,e)=>{var n=e["encode"],n=n["y1"];return void 0!==n?[t,e]:[t,it({},e,{encode:{y1:eO(rO(t,0))}})]};function sO(t,e,n){const r=n["encode"];if(null===t)return[e];n=t;const i=(Array.isArray(n)?n:[n]).map(t=>{return[t,null==(t=R(r,t))?void 0:t[0]]}).filter(([,t])=>qu(t));return Array.from(bc(e,e=>i.map(([,t])=>t[e]).join("-")).values())}function lO(t){var a,r;return Array.isArray(t)?(a=t,(i,t,e)=>(n,r)=>a.reduce((t,e)=>0!==t?t:ac(i[n][e],i[r][e]),0)):"function"==typeof t?(r=t,(e,t,n)=>gO(t=>r(e[t]))):"series"===t?fO:"value"===t?hO:"sum"===t?dO:"maxIndex"===t?pO:()=>null}function cO(t,e){for(const n of t)n.sort(e)}function uO(t,e){return(null==e?void 0:e.domain)||Array.from(new Set(t))}function fO(t,e,n){return gO(t=>n[t])}function hO(t,e,n){return gO(t=>e[t])}function dO(t,n,e){t=j0(t),t=Array.from(bc(t,t=>e[+t]).entries());const r=new Map(t.map(([t,e])=>[t,e.reduce((t,e)=>t+ +n[e])]));return gO(t=>r.get(e[t]))}function pO(t,n,e){t=j0(t),t=Array.from(bc(t,t=>e[+t]).entries());const r=new Map(t.map(([t,e])=>[t,Ic(e,t=>n[t])]));return gO(t=>r.get(e[t]))}function gO(n){return(t,e)=>ac(n(t),n(e))}oO.props={};const mO=(t={})=>{const{groupBy:L="x",orderBy:T=null,reverse:j=!1,y:N="y",y1:P="y1",series:C=!0}=t;return(t,e)=>{var{data:n,encode:r,style:i={}}=e,[a,o]=R(r,"y"),[s,l]=R(r,"y1"),[r]=C?iO(r,"series","color"):R(r,"color"),c=sO(L,t,e),n=lO(T)(n,a,r),u=(n&&cO(c,n),new Array(t.length)),f=new Array(t.length),h=new Array(t.length),d=[],p=[];for(const _ of c){j&&_.reverse();var g=s?+s[_[0]]:0,m=[],y=[];for(const E of _){var v=h[E]=+a[E]-g;v<0?y.push(E):0<=v&&m.push(E)}var b=0O.has(e),last:(t,e)=>k.has(e)},i)})]}};function yO(t){t=t.type;return"string"==typeof t&&["stackY","dodgeX","groupX"].includes(t)}mO.props={};const vO=a=>(t,e,n)=>{var{encode:r,transform:i=[]}=e;return i.some(yO)||({x:i,y:r}=r,void 0===i)||void 0===r?[t,e]:(i=a["series"],r=i?["x","series"]:"x",mO({groupBy:r})(t,e,n))},bO=(vO.props={},(t={})=>{const{channel:s="x"}=t;return(t,e)=>{const n=e["encode"];var r=e["tooltip"];if(Uu(r))return[t,e];r=r.title;if(void 0!==r)return[t,e];var i=Object.keys(n).filter(t=>t.startsWith(s)).filter(t=>!n[t].inferred).map(t=>R(n,t)).filter(([t])=>t).map(t=>t[0]);if(0===i.length)return[t,e];var a=[];for(const o of t)a[o]={value:i.map(t=>t[o]).join(", ")};return[t,it({},e,{tooltip:{title:a}})]}}),xO=(bO.props={},()=>(t,e)=>{var n=e["encode"],n=n["x"];return void 0!==n?[t,e]:[t,it({},e,{encode:{x:eO(rO(t,0))},scale:{x:{guide:null}}})]}),wO=(xO.props={},()=>(t,e)=>{var n=e["encode"],n=n["y"];return void 0!==n?[t,e]:[t,it({},e,{encode:{y:eO(rO(t,0))},scale:{y:{guide:null}}})]}),MO=(wO.props={},()=>(t,e)=>{var n=e["encode"],n=n["size"];return void 0!==n?[t,e]:[t,it({},e,{encode:{size:nO(rO(t,3))}})]}),OO=(MO.props={},()=>(t,e)=>{var n=e["encode"],r=n["key"],n=rt(n,["key"]);if(void 0!==r)return[t,e];const i=Object.values(n).map(({value:t})=>t);r=t.map(e=>i.filter(Array.isArray).map(t=>t[e]).join("-"));return[t,it({},e,{encode:{key:tO(r)}})]}),kO=(OO.props={},()=>(t,e)=>{var n=e["encode"],{series:r,color:i}=n;return void 0!==r||void 0===i?[t,e]:([r,i]=R(n,"color"),[t,it({},e,{encode:{series:tO(r,i)}})])}),_O=(kO.props={},()=>(t,e)=>{var n=e["data"];return!Array.isArray(n)||n.some(aO)?[t,e]:[t,it({},e,{encode:{y:tO(n)}})]}),EO=(_O.props={},()=>(t,e)=>{var n=e["data"];return!Array.isArray(n)||n.some(aO)?[t,e]:[t,it({},e,{encode:{x:tO(n)}})]}),SO=(EO.props={},()=>(t,e)=>{var n=e["encode"],r=n["y1"];return r?[t,e]:([r]=R(n,"y"),[t,it({},e,{encode:{y1:tO([...r])}})])}),AO=(SO.props={},()=>(t,e)=>{var n=e["encode"],r=n["x1"];return r?[t,e]:([r]=R(n,"x"),[t,it({},e,{encode:{x1:tO([...r])}})])}),LO=(AO.props={},t=>{const i=t["channel"];return(t,e)=>{const{encode:a,tooltip:n}=e;var r;return Uu(n)||({items:r=[]}=n,!r)||0Object.keys(a).filter(t=>t.startsWith(e)).map(t=>{var{field:e,value:n,inferred:r=!1,aggregate:i}=a[t];return r?null:i&&n?{channel:t}:e?{field:e}:n?{channel:t}:null}).filter(t=>null!==t)),[t,it({},e,{tooltip:{items:r}})])}}),TO=(LO.props={},()=>(t,e)=>[t,it({scale:{x:{padding:0},y:{padding:0}}},e)]),jO=(TO.props={},()=>(t,e)=>{var{style:n={}}=e,r=rt(e,["data","style"]),{x:i,y:a}=n,n=rt(n,["x","y"]);return null==i||null==a?[t,e]:[[0],it({},r,{data:[0],cartesian:!0,encode:{x:tO([i||0]),y:tO([a||0])},scale:{x:{type:"identity",independent:!0,guide:null},y:{type:"identity",independent:!0,guide:null}},style:n})]}),NO=(jO.props={},()=>(t,e)=>{var{style:n={}}=e;return[t,it({},e,{style:Object.assign(Object.assign({},n),Object.fromEntries(Object.entries(n).filter(([,t])=>"function"==typeof t).map(([t,e])=>[t,()=>e])))})]}),PO=(NO.props={},()=>(t,e)=>{var n,r=e["data"];return!Array.isArray(r)||r.some(aO)?[t,e]:(n=(r=Array.isArray(r[0])?r:[r]).map(t=>t[0]),r=r.map(t=>t[1]),[t,it({},e,{encode:{x:tO(n),y:tO(r)}})])}),CO=(PO.props={},()=>(t,e)=>{var{style:n={}}=e,n=n["gradient"];return n?[t,it({},e,{encode:{series:nO(rO(t,void 0))}})]:[t,e]}),RO=(CO.props={},(t={})=>{const{groupBy:c="x",reverse:u=!1,orderBy:f,padding:h}=t;return rt(t,["groupBy","reverse","orderBy","padding"]),(t,e)=>{var{data:n,encode:r,scale:i}=e,i=i["series"],[a]=R(r,"y"),[r]=iO(r,"series","color"),o=uO(r,i),i=sO(c,t,e),n=lO(f)(n,a,r),s=(n&&cO(i,n),new Array(t.length));for(const l of i){u&&l.reverse();for(let t=0;t{const{groupBy:p=["x"],reducer:g=(t,e)=>e[t[0]],orderBy:m=null,reverse:y=!1,duration:v}=t;return(n,t)=>{const e=t["encode"];var r=(Array.isArray(p)?p:[p]).map(t=>[t,R(e,t)[0]]);if(0===r.length)return[n,t];let i=[n];for(const[,f]of r){var a=[];for(const n of i){var o=Array.from(bc(n,t=>f[t]).values());a.push(...o)}i=a}if(m){const[h]=R(e,m);h&&i.sort((t,e)=>g(t,h)-g(e,h)),y&&i.reverse()}r=(v||3e3)/i.length;const[s]=v?[rO(n,r)]:iO(e,"enterDuration",rO(n,r));var[l]=iO(e,"enterDelay",rO(n,0)),c=new Array(n.length);for(let t=0,e=0;t+s[t]);for(const d of n)c[d]=+l[d]+e;e+=u}return[n,it({},t,{encode:{enterDuration:nO(s),enterDelay:nO(c)}})]}});IO.props={};const BO=(t={})=>{const{groupBy:p="x",basis:g="max"}=t;return(e,t)=>{const{encode:n,tooltip:r}=t;var i=rt(n,["x"]),a=Object.entries(i).filter(([t])=>t.startsWith("y")).map(([t])=>[t,R(n,t)[0]]),[,o]=a.find(([t])=>"y"===t),s=a.map(([t])=>[t,new Array(e.length)]),i=sO(p,e,t),l="function"==typeof(h=g)?h:{min:(t,e)=>Bc(t,t=>e[+t]),max:(t,e)=>Rc(t,t=>e[+t]),first:(t,e)=>e[t[0]],last:(t,e)=>e[t[t.length-1]],mean:(t,e)=>qc(t,t=>e[+t]),median:(t,e)=>Hc(t,t=>e[+t]),sum:(t,e)=>$c(t,t=>e[+t]),deviation:(t,e)=>dc(t,t=>e[+t])}[h]||Rc;for(const e of i){var c=l(e,o);for(const d of e)for(let t=0;t[t,tO(e,R(n,t)[1])]))},!h&&n.y0&&{tooltip:{items:[{channel:"y0"}]}}))]}};function FO(t,e,n){return null===t?[-.5,.5]:(t=uO(t,e),[-(e=new Yp({domain:t,range:[0,1],padding:n}).getBandWidth())/2,e/2])}function DO(t,e,n){return e*(1-t)+n*t}BO.props={};const zO=(t={})=>{const{padding:e=0,paddingX:l=e,paddingY:c=e,random:u=Math.random}=t;return(t,e)=>{var{encode:n,scale:r}=e,{x:r,y:i}=r,[a]=R(n,"x"),[n]=R(n,"y");const o=FO(a,r,l),s=FO(n,i,c);a=t.map(()=>DO(u(),...s)),r=t.map(()=>DO(u(),...o));return[t,it({scale:{x:{padding:.5},y:{padding:.5}}},e,{encode:{dy:tO(a),dx:tO(r)}})]}},WO=(zO.props={},(t={})=>{const{padding:a=0,random:o=Math.random}=t;return(t,e)=>{var{encode:n,scale:r}=e,r=r["x"],[n]=R(n,"x");const i=FO(n,r,a);n=t.map(()=>DO(o(),...i));return[t,it({scale:{x:{padding:.5}}},e,{encode:{dx:tO(n)}})]}}),GO=(WO.props={},(t={})=>{const{groupBy:g="x"}=t;return(e,t)=>{const n=t["encode"];var r=rt(n,["x"]);const i=Object.entries(r).filter(([t])=>t.startsWith("y")).map(([t])=>[t,R(n,t)[0]]);var a=i.map(([t])=>[t,new Array(e.length)]),o=sO(g,e,t),s=new Array(o.length);for(let t=0;ti.map(([,t])=>+t[e])));s[t]=(l+c)/2}var u=Math.max(...s);for(let t=0;t[t,tO(e,R(n,t)[1])]))})]}}),qO=(GO.props={},(t={})=>{const{groupBy:u="x",series:f=!0}=t;return(t,e)=>{var n=e["encode"];const[r]=R(n,"y");var[,i]=R(n,"y1"),n=(f?iO(n,"series","color"):R(n,"color"),sO(u,t,e)),a=new Array(t.length);for(const c of n){var o=c.map(t=>+r[t]);for(let n=0;ne!==n));a[s]=r[s]>l?l:r[s]}}return[t,it({},e,{encode:{y1:tO(a,i)}})]}});function HO(t,e){return[t[0]]}function VO(t,e){return[t[t.length-1]]}function YO(t,e){return[t[Ic(t,t=>e[t])]]}function $O(t,e){return[t[Fc(t,t=>e[t])]]}qO.props={};const UO=(t={})=>{const{groupBy:a="series",channel:o,selector:s}=t;return(t,e)=>{var n=e["encode"],t=sO(a,t,e);const[r]=R(n,o),i="function"==typeof(n=s)?n:{first:HO,last:VO,max:YO,min:$O}[n]||HO;return[t.flatMap(t=>i(t,r)),e]}},KO=(UO.props={},(t={})=>{var e=t["selector"],t=rt(t,["selector"]);return UO(Object.assign({channel:"x",selector:e},t))}),XO=(KO.props={},(t={})=>{var e=t["selector"],t=rt(t,["selector"]);return UO(Object.assign({channel:"y",selector:e},t))});function ZO(e){return t=>null===t?e:e+" of "+t}function QO(){return[(t,e)=>qc(t,t=>+e[t]),ZO("mean")]}function JO(){return[(t,e)=>Hc(t,t=>+e[t]),ZO("median")]}function tk(){return[(t,e)=>Rc(t,t=>+e[t]),ZO("max")]}function ek(){return[(t,e)=>Bc(t,t=>+e[t]),ZO("min")]}function nk(){return[(t,e)=>t.length,ZO("count")]}function rk(){return[(t,e)=>$c(t,t=>+e[t]),ZO("sum")]}function ik(){return[(t,e)=>e[t[0]],ZO("first")]}function ak(){return[(t,e)=>e[t[t.length-1]],ZO("last")]}XO.props={};const ok=(t={})=>{const i=t["groupBy"],a=rt(t,["groupBy"]);return(t,e)=>{const{data:s,encode:l}=e,c=i(t,e);if(!c)return[t,e];var t=Object.entries(a).map(([t,e])=>{const[n,r]=function(t){if("function"==typeof t)return[t,null];var e={mean:QO,max:tk,count:nk,first:ik,last:ak,sum:rk,min:ek,median:JO}[t];if(e)return e();throw new Error(`Unknown reducer: ${t}.`)}(e),[i,a]=R(l,t);e=e;var e=(o=a)||((e=e["from"])?([,e]=R(l,e),e):o),o=c.map(t=>n(t,null!==i&&void 0!==i?i:s));return[t,Object.assign(Object.assign({},(t=o,o=(null==r?void 0:r(e))||e,t=tO(t,o),Object.assign(Object.assign({},t),{constant:!1}))),{aggregate:!0})]}),n=Object.keys(l).map(t=>{const[e,n]=R(l,t);return[t,tO(c.map(t=>e[t[0]]),n)]}),r=c.map(t=>s[t[0]]);return[j0(c),it({},e,{data:r,encode:Object.fromEntries([...n,...t])})]}},sk=(ok.props={},(t={})=>{const{channels:n=["x","y"]}=t,e=rt(t,["channels"]);return ok(Object.assign(Object.assign({},e),{groupBy:(t,e)=>sO(n,t,e)}))}),lk=(sk.props={},(t={})=>sk(Object.assign(Object.assign({},t),{channels:["x","color","series"]}))),ck=(lk.props={},(t={})=>sk(Object.assign(Object.assign({},t),{channels:["y","color","series"]}))),uk=(ck.props={},(t={})=>sk(Object.assign(Object.assign({},t),{channels:["color"]})));function fk(t,e,n){var{reverse:r,slice:i,channel:a}=n,n=rt(n,["reverse","slice","channel"]),{encode:o,scale:s={}}=e,s=null==(s=s[a])?void 0:s.domain;const[l]=R(o,a);var c,n=function(t,e,n){const{by:r=t,reducer:i="max"}=e,[a]=R(n,r);if("function"==typeof i)return t=>i(t,a);if("max"===i)return t=>Rc(t,t=>+a[t]);if("min"===i)return t=>Bc(t,t=>+a[t]);if("sum"===i)return t=>$c(t,t=>+a[t]);if("median"===i)return t=>Hc(t,t=>+a[t]);if("mean"===i)return t=>qc(t,t=>+a[t]);if("first"===i)return t=>a[t[0]];if("last"===i)return t=>a[t[t.length-1]];throw new Error("Unknown reducer: "+i)}(a,n,o),o=function(t,e,n){if(!Array.isArray(n))return t;const r=new Set(n);return t.filter(t=>r.has(e[t]))}(t,l,s),n=(s=o,o=t=>l[t],(2!==(c=n).length?Oc(xc(s,c,o),([t,e],[n,r])=>ac(e,r)||ac(t,n)):Oc(bc(s,o),([t,e],[n,r])=>c(e,r)||ac(t,n))).map(([t])=>t)),s=(r&&n.reverse(),"number"==typeof i?[0,i]:i),o=i?n.slice(...s):n;return[t,it(e,{scale:{[a]:{domain:o}}})]}uk.props={};const hk=(t={})=>{const{reverse:o=!1,slice:s,channel:l,ordinal:c=!0}=t,u=rt(t,["reverse","slice","channel","ordinal"]);return(t,e)=>{if(c)return fk(t,e,Object.assign({reverse:o,slice:s,channel:l},u));{var n=Object.assign({reverse:o,slice:s,channel:l},u);var{reverse:n,channel:r}=n,i=e["encode"];const[a]=R(i,r);return i=Oc(t,t=>a[t]),n&&i.reverse(),[i,e]}}},dk=(hk.props={},(t={})=>hk(Object.assign(Object.assign({},t),{channel:"x"}))),pk=(dk.props={},(t={})=>hk(Object.assign(Object.assign({},t),{channel:"color"}))),gk=(pk.props={},(t={})=>hk(Object.assign(Object.assign({},t),{channel:"y"})));gk.props={};const mk=(t={})=>{const{field:o,channel:s="y",reducer:l="sum"}=t;return(t,e)=>{var{data:n,encode:r}=e;const[i]=R(r,"x");var a,n=o?(n=n,"string"==typeof(a=o)?n.map(t=>t[a]):n.map(a)):R(r,s)[0],r=wc(t,function(e,n){if("function"==typeof e)return t=>e(t,n);if("sum"===e)return t=>$c(t,t=>+n[t]);throw new Error("Unknown reducer: "+e)}(l,n),t=>i[t]).map(t=>t[1]);return[t,it({},e,{scale:{x:{flex:r}}})]}};function yk(t,e,n){var r=t.length;if(0===r)return[];var{innerWidth:i,innerHeight:a}=n;let l=Math.ceil(Math.sqrt(e/(a/i))),c=i/l,u=Math.ceil(e/l),o=u*c;for(;o>a;)l+=1,c=i/l,u=Math.ceil(e/l),o=u*c;const f=a-u*c,h=u<=1?0:f/(u-1),[d,p]=u<=1?[(i-r*c)/(r-1),(a-c)/2]:[0,0];return t.map((t,e)=>{var[t,n,r,i]=W0(t),a=e%l,e=Math.floor(e/l),o=a*c,s=(u-e-1)*c+f,r=c/r,i=c/i;return`translate(${o-t+d*a}, ${s-n-h*e-p}) scale(${r}, ${i})`})}mk.props={};const vk=()=>(t,e)=>[t,it({},e,{modifier:yk,axis:!1})],bk=(vk.props={},"thresholds");function xk(t){var e,[n,r]=pc(t);return Math.min(200,(n=n,r=r,e=hc(t=t),t=dc(t),e&&t?Math.ceil((r-n)*Math.cbrt(e)/(3.49*t)):1))}const wk=(t={})=>{const{groupChannels:s=["color"],binChannels:l=["x","y"]}=t,c=rt(t,["groupChannels","binChannels"]),u={};return ok(Object.assign(Object.assign(Object.assign({},Object.fromEntries(Object.entries(c).filter(([t])=>!t.startsWith(bk)))),Object.fromEntries(l.flatMap(e=>{var t=([t])=>+u[e].get(t).split(",")[1];return[[t.from=e,([t])=>+u[e].get(t).split(",")[0]],[e+"1",t]]}))),{groupBy:(t,e)=>{const n=e["encode"],i=l.map(t=>{var[t]=R(n,t);return t}),a=at(c,bk),o=t.filter(e=>i.every(t=>qu(t[e]))),r=[...s.map(t=>{var[t]=R(n,t);return t}).filter(qu).map(e=>t=>e[t]),...l.map((t,e)=>{const n=i[e];e=a[t]||xk(n),e=Cc().thresholds(e).value(t=>+n[t])(o);const r=new Map(e.flatMap(t=>{var{x0:e,x1:n}=t;const r=e+","+n;return t.map(t=>[t,r])}));return u[t]=r,t=>r.get(t)})];return Array.from(bc(o,e=>r.map(t=>t(e)).join("-")).values())}}))},Mk=(wk.props={},(t={})=>{var e=t["thresholds"];return wk(Object.assign(Object.assign({},t),{thresholdsX:e,groupChannels:["color"],binChannels:["x"]}))});function Ok(e,n,r,t){var a=e.length;if(a<=t||0===t)return e;var o,s=t=>+n[e[t]],l=t=>+r[e[t]],c=[],u=(a-2)/(t-2);let f=0,h,d;c.push(f);for(let i=0;ih&&(h=o,d=r);c.push(d),f=d}return c.push(a-1),c.map(t=>e[t])}function kk(t){if("function"==typeof t)return t;if("lttb"===t)return Ok;var e={first:t=>[t[0]],last:t=>[t[t.length-1]],min:(t,e,n)=>[t[Fc(t,t=>n[t])]],max:(t,e,n)=>[t[Ic(t,t=>n[t])]],median:(t,e,n)=>{return[t[Gc(t,.5,t=>n[t])]]}};const i=e[t]||e.median;return(t,e,n,r)=>{return function(t,e){var n=t.length,r=[];let i=0;for(;ii(t,e,n))}}Mk.props={};const _k=(t={})=>{const{strategy:e="median",thresholds:a=2e3,groupBy:o=["series","color"]}=t,s=kk(e);return(t,e)=>{var n=e["encode"],t=sO(o,t,e);const[r]=R(n,"x"),[i]=R(n,"y");return[t.flatMap(t=>s(t,r,i,a)),e]}},Ek=(_k.props={},(s={})=>(t,e)=>{const{encode:i,data:n}=e,r=Object.entries(s).map(([t,e])=>{const[n]=R(i,t);if(!n)return null;if("function"==typeof e)return t=>e(n[t]);const r=Array.isArray(e)?e:[e];return 0===r.length?null:t=>r.includes(n[t])}).filter(qu);if(0===r.length)return[t,e];const a=t.filter(e=>r.every(t=>t(e))),o=a.map((t,e)=>e);t=Object.entries(i).map(([t,e])=>[t,Object.assign(Object.assign({},e),{value:o.map(t=>e.value[a[t]])})]);return[o,it({},e,{encode:Object.fromEntries(t),data:a.map(t=>n[t])})]});function Sk(t){var{min:t,max:e}=t;return[[t[0],t[1]],[e[0],e[1]]]}function Ak(t,e){var[t,n]=t,[e,r]=e;return t>=e[0]&&t<=r[0]&&n>=e[1]&&n<=r[1]}Ek.props={};const Lk=t=>{const r=t["priority"];return(t,e)=>{const n=[];return r&&t.sort(r),t.forEach(t=>{Hw(t);const i=t.getLocalBounds();n.some(t=>{var e=Sk(i),t=Sk(t.getLocalBounds()),[e,n]=e,[t,r]=t;return e[0]t[0]&&e[1]t[1]})?qw(t):n.push(t)}),t}};function Tk(){const n=new Map;return[t=>n.get(t),(t,e)=>n.set(t,e)]}const jk=t=>{const{maxIterations:M=10,maxError:O=.1,padding:k=1}=t;return i=>{var e=i.length;if(!(e<=1)){const[g,m]=Tk(),[y,v]=Tk();var a,o,s,l,[c,t]=Tk(),[u,n]=Tk();for(const b of i){var{min:r,max:f}=function(t){var t=t.cloneNode(!0),{min:e,max:n}=((e=t.getElementById("connector"))&&t.removeChild(e),t.getRenderBounds());return t.destroy(),{min:e,max:n}}(b);const[x,g]=r;var[r,f]=f;m(b,g),v(b,g),t(b,f-g),n(b,[x,r])}for(let t=0;tac(y(t),y(e)));let r=0;for(let n=0;n{return Ck(e,"object"==typeof(t=t)?t:nt.parseColor(t))})]}const Ik=t=>{const{threshold:n=4.5,palette:r=["#000","#fff"]}=t;return(t,e)=>(t.forEach(t=>{var e=t.attr("dependentElement").parsedStyle.fill;Ck(t.parsedStyle.fill,e)(t,e)=>(t.forEach(t=>{Hw(t);var e=t.attr("bounds");!function(t,e){var[t,n]=t;return!(Ak(t,e)&&Ak(n,e))}(Sk(t.getLocalBounds()),e)||qw(t)}),t);var T=1e-6,Fk=1e-12,S=Math.PI,Dk=S/2,zk=S/4,Wk=2*S,Gk=180/S,qk=S/180,Hk=Math.abs,Vk=Math.atan,Yk=Math.atan2,A=Math.cos,$k=Math.ceil,Uk=Math.exp,Kk=Math.log,Xk=Math.pow,L=Math.sin,Zk=Math.sign||function(t){return 0S&&(t-=Math.round(t/Wk)*Wk),[t,e]}function v3(t,e,n){return(t%=Wk)?e||n?m3(x3(t),w3(e,n)):x3(t):e||n?w3(e,n):y3}function b3(n){return function(t,e){return Hk(t+=n)>S&&(t-=Math.round(t/Wk)*Wk),[t,e]}}function x3(t){var e=b3(t);return e.invert=b3(-t),e}function w3(t,e){var i=A(t),a=L(t),o=A(e),s=L(e);function n(t,e){var n=A(e),r=A(t)*n,t=L(t)*n,n=L(e),e=n*i+r*a;return[Yk(t*o-e*s,r*i-n*a),e3(e*o+t*s)]}return n.invert=function(t,e){var n=A(e),r=A(t)*n,t=L(t)*n,n=L(e),e=n*o-t*s;return[Yk(t*o+n*s,r*i+e*a),e3(e*i-r*a)]},n}function M3(t,e){(e=u3(e))[0]-=t,g3(e);t=t3(-e[1]);return((-e[2]<0?-t:t)+Wk-T)%Wk}function O3(){var r,e=[];return{point:function(t,e,n){r.push([t,e,n])},lineStart:function(){e.push(r=[])},lineEnd:n3,rejoin:function(){1T?Vk((L(l)*(a=A(i))*L(r)-L(i)*(r=A(l))*L(n))/(r*a*o)):(l+i)/2,c.point(d,h),c.lineEnd(),c.lineStart(),c.point(s,h),u=0),c.point(f=t,h=e),d=s},lineEnd:function(){c.lineEnd(),f=h=NaN},clean:function(){return 2-u}}},function(t,e,n,r){var i;null==t?(i=n*Dk,r.point(-S,i),r.point(0,i),r.point(S,i),r.point(S,0),r.point(S,-i),r.point(0,-i),r.point(-S,-i),r.point(-S,0),r.point(-S,i)):Hk(t[0]-e[0])>T?(t=t[0]T;function m(t,e){return A(t)*A(e)>g}function y(t,e,n){var r,i,a,o,s,l,c,u=[1,0,0],f=h3(u3(t),u3(e)),h=f3(f,f),d=f[0],p=h-d*d;return p?(r=h3(u,f),d3(u=p3(u,g*h/p),p3(f,-g*d/p)),(p=(f=f3(u,h=r))*f-(d=f3(h,h))*(f3(u,u)-1))<0?void 0:(d3(p=p3(h,(-f-(r=Qk(p)))/d),u),p=c3(p),n?(i=t[0],a=e[0],o=t[1],e=e[1],aT}).map(u)).concat(Yc($k(s/g)*g,o,g).filter(function(t){return Hk(t%y)>T}).map(f))}var n,r,i,a,o,s,l,c,u,f,h,d,p,g,m,y,v}var z3,W3,G3,q3,H3=t=>t,V3=new gc,Y3=new gc,$3={point:n3,lineStart:n3,lineEnd:n3,polygonStart:function(){$3.lineStart=U3,$3.lineEnd=Z3},polygonEnd:function(){$3.lineStart=$3.lineEnd=$3.point=n3,V3.add(Hk(Y3)),Y3=new gc},result:function(){var t=V3/2;return V3=new gc,t}};function U3(){$3.point=K3}function K3(t,e){$3.point=X3,z3=G3=t,W3=q3=e}function X3(t,e){Y3.add(q3*t-G3*e),G3=t,q3=e}function Z3(){X3(z3,W3)}var Q3=$3,J3=1/0,t4=J3,e4=-J3,n4=e4;var r4,i4,a4,o4,s4={point:function(t,e){tT&&0<--r);return[t/(.8707+(i=n*n)*(i*(i*i*i*(.003971-.001529*i)-.013791)-.131979)),n]},A6.invert=f6(e3),L6.invert=f6(function(t){return 2*Vk(t)}),T6.invert=function(t,e){return[-e,2*Vk(Uk(t))-Dk]};var j6=Object.freeze({__proto__:null,geoAlbersUsa:function(){var e,n,i,a,o,r,s=c6(),l=l6().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=l6().rotate([157,0]).center([-3,19.9]).parallels([8,18]),u={point:function(t,e){r=[t,e]}};function f(t){var e=t[0],t=t[1];return r=null,i.point(e,t),r||(a.point(e,t),r)||(o.point(e,t),r)}function h(){return e=n=null,f}return f.invert=function(t){var e=s.scale(),n=s.translate(),r=(t[0]-n[0])/e,n=(t[1]-n[1])/e;return(.12<=n&&n<.234&&-.425<=r&&r<-.214?l:.166<=n&&n<.234&&-.214<=r&&r<-.115?c:s).invert(t)},f.stream=function(t){return e&&n===t?e:(r=[s.stream(n=t),l.stream(t),c.stream(t)],i=r.length,e={point:function(t,e){for(var n=-1;++nfunction(t){if(!t||!t.type)return null;var e={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featureCollection"}[t.type];if(!e)return null;return"geometry"===e?{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:t}]}:"feature"===e?{type:"FeatureCollection",features:[t]}:"featureCollection"===e?t:void 0}(t).features)}}function P6(t,e,n,r){var i,a,o,s,l,c,{outline:e=(e=e.filter(R6),e.find(t=>t.sphere)?{type:"Sphere"}:N6(e.filter(t=>!t.sphere).flatMap(t=>t.data.value)))}=r,{size:r="fitExtent"}=r;"fitExtent"===r?(i=t,o=e,{x:c,y:l,width:a,height:s}=c=n,i.fitExtent([[c,l],[a,s]],o)):"fitWidth"===r&&(i=t,c=e,{width:l,height:a}=l=n,[[l,c],[s,o]]=V4(i.fitWidth(l,c)).bounds(c),o=Math.ceil(o-c),c=Math.min(Math.ceil(s-l),o),s=i.scale()*(c-1)/c,[l,c]=i.translate(),c+=(a-o)/2,i.scale(s).translate([l,c]).precision(.2))}function C6(t){var e=t["data"];return Array.isArray(e)?Object.assign(Object.assign({},t),{data:{value:e}}):(e=e["type"],"graticule10"===e?Object.assign(Object.assign({},t),{data:{value:[D3()]}}):"sphere"===e?Object.assign(Object.assign({},t),{sphere:!0,data:{value:[{type:"Sphere"}]}}):t)}function R6(t){return"geoPath"===t.type}ls=()=>t=>{var{children:e,coordinate:n={}}=t;if(!Array.isArray(e))return[];const{type:r="equalEarth"}=n,h=rt(n,["type"]),d=function(t){if("function"==typeof t)return t;var e="geo"+Qe(t);if(e=j6[e])return e;throw new Error("Unknown coordinate: "+t)}(r),p=e.map(C6);let g;return[Object.assign(Object.assign({},t),{type:"view",scale:{x:{type:"identity"},y:{type:"identity"}},axis:!1,coordinate:{type:function(){return[["custom",(t,e,n,r)=>{const i=d();var a,o,s,l={x:t,y:e,width:n,height:r},c=(P6(i,p,l,h),i),l=h;for([o,s]of Object.entries(l))null!=(a=c[o])&&a.call(c,s);g=V4(i);const u=new i0({domain:[t,t+n]}),f=new i0({domain:[e,e+r]});return{transform:t=>{return t=t,(t=i(t))?([t,e]=t,[u.map(t),f.map(e)]):null;var e},untransform:t=>{return(t=t)?([t,e]=t,t=[u.invert(t),f.invert(e)],i.invert(t)):null;var e}}}]]}},children:p.flatMap(t=>{var e,n,r;return R6(t)?({style:n,tooltip:r={}}=e=t,Object.assign(Object.assign({},e),{type:"path",tooltip:Xu(r,{title:"id",items:[{channel:"color"}]}),style:Object.assign(Object.assign({},n),{d:t=>g(t)||[]})})):t})})]},ls.props={},rs=()=>t=>{var{data:e,scale:n,encode:r,style:i,animate:a,key:o,state:s}=t,t=rt(t,["type","data","scale","encode","style","animate","key","state"]);return[Object.assign(Object.assign({type:"geoView"},t),{children:[{type:"geoPath",key:o+"-0",data:{value:e},scale:n,encode:r,style:i,animate:a,state:s}]})]};rs.props={};const I6={"composition.geoView":ls,"composition.geoPath":rs};function B6(){return Object.assign({"data.fetch":wh,"data.inline":Ah,"data.sortBy":Sh,"data.sort":kh,"data.filter":Oh,"data.pick":_h,"data.rename":Eh,"data.fold":Mh,"data.slice":rd,"data.custom":Lh,"data.map":Th,"data.cluster":oh,"data.tree":sh,"data.sankey":Fu,"data.arc":Ch,"data.wordCloud":td,"data.join":nd,"data.kde":ud,"data.venn":Td,"transform.maybeZeroY1":oO,"transform.maybeZeroX":xO,"transform.maybeStackY":vO,"transform.maybeTitle":bO,"transform.maybeSeries":kO,"transform.maybeZeroPadding":TO,"transform.stackY":mO,"transform.binX":Mk,"transform.bin":wk,"transform.dodgeX":RO,"transform.jitter":zO,"transform.jitterX":WO,"transform.symmetryY":GO,"transform.diffY":qO,"transform.stackEnter":IO,"transform.normalizeY":BO,"transform.select":UO,"transform.selectX":KO,"transform.selectY":XO,"transform.groupX":lk,"transform.groupY":ck,"transform.groupColor":uk,"transform.group":sk,"transform.maybeSize":MO,"transform.maybeZeroY":wO,"transform.maybeKey":OO,"transform.sortX":dk,"transform.sortY":gk,"transform.sortColor":pk,"transform.flexX":mk,"transform.maybeTupleY":_O,"transform.maybeTupleX":EO,"transform.maybeIdentityY":SO,"transform.maybeIdentityX":AO,"transform.maybeTuple":PO,"transform.maybeVisualPosition":jO,"transform.maybeFunctionAttribute":NO,"transform.maybeGradient":CO,"transform.maybeTooltip":LO,"transform.pack":vk,"transform.sample":_k,"transform.filter":Ek,"coordinate.cartesian":As,"coordinate.polar":Ts,"coordinate.helix":js,"coordinate.transpose":Ns,"coordinate.theta":Ps,"coordinate.parallel":Is,"coordinate.fisheye":Bs,"coordinate.radial":Rs,"coordinate.radar":Fs,"encode.constant":Ds,"encode.field":Ws,"encode.transform":zs,"encode.column":Gs,"mark.interval":rc,"mark.rect":ic,"mark.line":au,"mark.point":ou,"mark.text":su,"mark.cell":lu,"mark.area":cu,"mark.link":uu,"mark.image":fu,"mark.polygon":hu,"mark.box":du,"mark.vector":pu,"mark.lineX":mu,"mark.lineY":gu,"mark.connector":yu,"mark.range":xu,"mark.rangeX":wu,"mark.rangeY":Mu,"mark.sankey":Ju,"mark.path":tf,"mark.treemap":af,"mark.pack":of,"mark.boxplot":gf,"mark.shape":mf,"mark.forceGraph":ih,"mark.gauge":J0,"mark.tree":lh,"mark.wordCloud":jd,"mark.density":t1,"mark.heatmap":e1,"palette.category10":n1,"palette.category20":r1,"scale.linear":a1,"scale.ordinal":o1,"scale.band":i1,"scale.identity":s1,"scale.point":l1,"scale.time":c1,"scale.log":u1,"scale.pow":f1,"scale.sqrt":g1,"scale.threshold":h1,"scale.quantile":d1,"scale.quantize":p1,"scale.sequential":m1,"scale.constant":y1,"shape.interval.rect":wg,"shape.interval.hollow":Mg,"shape.interval.funnel":Og,"shape.interval.pyramid":_g,"shape.rect.rect":wg,"shape.rect.hollow":Mg,"shape.cell.cell":wg,"shape.cell.hollow":Mg,"shape.line.line":Lg,"shape.line.hv":jg,"shape.line.vh":Ng,"shape.line.hvh":Pg,"shape.line.trail":Cg,"shape.line.smooth":Tg,"shape.point.bowtie":Bg,"shape.point.cross":Fg,"shape.point.diamond":Dg,"shape.point.hexagon":zg,"shape.point.hollowBowtie":Wg,"shape.point.hollowDiamond":Gg,"shape.point.hollowHexagon":qg,"shape.point.hollow":Hg,"shape.point.hollowSquare":Vg,"shape.point.hollowTriangle":Yg,"shape.point.hollowTriangleDown":$g,"shape.point.hyphen":Ug,"shape.point.line":Kg,"shape.point.plus":Xg,"shape.point.point":Zg,"shape.point.square":Qg,"shape.point.tick":Jg,"shape.point.triangle":tm,"shape.point.triangleDown":em,"shape.text.text":m2,"shape.area.area":w2,"shape.area.smooth":M2,"shape.area.hvh":O2,"shape.area.vh":k2,"shape.area.hv":_2,"shape.link.smooth":S2,"shape.link.vhv":A2,"shape.link.arc":L2,"shape.link.link":E2,"shape.image.image":T2,"shape.polygon.polygon":j2,"shape.polygon.ribbon":N2,"shape.box.box":P2,"shape.box.violin":C2,"shape.vector.vector":nm,"shape.label.label":Q2,"shape.text.badge":v2,"shape.lineX.line":R2,"shape.lineY.line":R2,"shape.shape.shape":lx,"shape.connector.connector":F2,"shape.range.range":wg,"shape.rangeX.range":wg,"shape.rangeY.range":wg,"shape.path.path":tx,"shape.path.hollow":ex,"shape.density.density":nx,"shape.heatmap.heatmap":sx,"theme.classic":cx,"theme.classicDark":ux,"theme.academy":hx,"component.axisX":Wx,"component.axisY":Gx,"component.axisRadar":qx,"component.axisLinear":Dx,"component.axisArc":zx,"component.legendCategory":$x,"component.legendContinuous":Jx,"component.legendContinuousBlock":tw,"component.legendContinuousBlockSize":nw,"component.legendContinuousSize":ew,"component.title":aw,"component.sliderX":hw,"component.sliderY":dw,"component.scrollbarX":gw,"component.scrollbarY":mw,"animation.scaleInX":Mw,"animation.scaleOutX":Ow,"animation.scaleInY":kw,"animation.scaleOutY":_w,"animation.waveIn":Rw,"animation.fadeIn":Ew,"animation.fadeOut":Sw,"animation.zoomIn":Iw,"animation.zoomOut":Bw,"animation.pathIn":Fw,"animation.morphing":Cw,"animation.growInX":Dw,"animation.growInY":zw,"interaction.elementHighlight":c5,"interaction.elementHighlightByX":u5,"interaction.elementHighlightByColor":f5,"interaction.elementSelect":d5,"interaction.elementSelectByX":p5,"interaction.elementSelectByColor":g5,"interaction.fisheye":y5,"interaction.chartIndex":m5,"interaction.tooltip":I5,"interaction.legendFilter":$5,"interaction.legendHighlight":U5,"interaction.brushHighlight":tM,"interaction.brushXHighlight":nM,"interaction.brushYHighlight":iM,"interaction.brushAxisHighlight":dM,"interaction.brushFilter":gM,"interaction.brushXFilter":mM,"interaction.brushYFilter":yM,"interaction.sliderFilter":xM,"interaction.scrollbarFilter":MM,"interaction.poptip":_M,"interaction.event":x5,"composition.spaceLayer":LM,"composition.spaceFlex":TM,"composition.mark":NM,"composition.view":jM,"composition.facetRect":GM,"composition.repeatMatrix":YM,"composition.facetCircle":QM,"composition.timingKeyframe":JM,"labelTransform.overlapHide":Lk,"labelTransform.overlapDodgeY":jk,"labelTransform.overflowHide":Bk,"labelTransform.contrastReverse":Ik},I6)}const F6=[["legendCategory",[[["color","discrete"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","discrete"]],[["color","discrete"],["opacity","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"]],[["color","discrete"],["opacity","constant"],["size","constant"]],[["color","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"]],[["color","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["shape","discrete"]],[["color","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"]],[["color","discrete"],["opacity","constant"]],[["color","discrete"],["shape","constant"]],[["color","constant"],["shape","discrete"]],[["color","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"]],[["color","discrete"]]]],["legendContinuousSize",[[["color","continuous"],["opacity","continuous"],["size","continuous"]],[["color","constant"],["opacity","continuous"],["size","continuous"]],[["color","continuous"],["size","continuous"]],[["color","constant"],["size","continuous"]],[["size","continuous"],["opacity","continuous"]],[["size","continuous"]]]],["legendContinuousBlockSize",[[["color","distribution"],["opacity","distribution"],["size","distribution"]],[["color","distribution"],["size","distribution"]]]],["legendContinuousBlock",[[["color","distribution"],["opacity","continuous"]],[["color","distribution"]]]],["legendContinuous",[[["color","continuous"],["opacity","continuous"]],[["color","continuous"]],[["opacity","continuous"]]]]];function D6(t,e,n){for(;t{return"string"!=typeof t?t:n[t=e+"."+t]||Wu("Unknown Component: "+t)};return[t=>{var e=t["type"],t=rt(t,["type"]);return r(e)(Object.assign({},t))},r]}function p_(t,e){var{coordinate:n={}}=t,t=rt(t,["coordinate"]),{type:r,transform:i=[]}=n,n=rt(n,["type","transform"]);if(!r)return Object.assign(Object.assign({},t),{coordinates:i});var[,e]=d_("coordinate",e),{transform:e=!1}=e(r).props||{};if(e)throw new Error(`Unknown coordinate: ${r}.`);return Object.assign(Object.assign({},t),{coordinates:[Object.assign({type:r},n),...i]})}function g_(t,e){return t.filter(t=>t.type===e)}function m_(t){return 0>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?I_(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?I_(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=__.exec(t))?new D_(e[1],e[2],e[3],1):(e=E_.exec(t))?new D_(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=S_.exec(t))?I_(e[1],e[2],e[3],e[4]):(e=A_.exec(t))?I_(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=L_.exec(t))?V_(e[1],e[2]/100,e[3]/100,1):(e=T_.exec(t))?V_(e[1],e[2]/100,e[3]/100,e[4]):j_.hasOwnProperty(t)?R_(j_[t]):"transparent"===t?new D_(NaN,NaN,NaN,0):null}function R_(t){return new D_(t>>16&255,t>>8&255,255&t,1)}function I_(t,e,n,r){return new D_(t=r<=0?e=n=NaN:t,e,n,r)}function B_(t){return(t=t instanceof M_?t:C_(t))?new D_((t=t.rgb()).r,t.g,t.b,t.opacity):new D_}function F_(t,e,n,r){return 1===arguments.length?B_(t):new D_(t,e,n,null==r?1:r)}function D_(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function z_(){return"#"+H_(this.r)+H_(this.g)+H_(this.b)}function W_(){var t=G_(this.opacity);return(1===t?"rgb(":"rgba(")+q_(this.r)+`, ${q_(this.g)}, `+q_(this.b)+(1===t?")":`, ${t})`)}function G_(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function q_(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function H_(t){return((t=q_(t))<16?"0":"")+t.toString(16)}function V_(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||1<=n?t=e=NaN:e<=0&&(t=NaN),new $_(t,e,n,r)}function Y_(t){var e,n,r,i,a,o,s,l;return t instanceof $_?new $_(t.h,t.s,t.l,t.opacity):(t=t instanceof M_?t:C_(t))?t instanceof $_?t:(e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=NaN,l=((a=Math.max(e,n,r))+i)/2,(s=a-i)?(o=e===a?(n-r)/s+6*(n()=>t;function cE(e,n){return function(t){return e+t*n}}function uE(a){return 1==(a=+a)?fE:function(t,e){return e-t?(n=t,r=e,i=a,n=Math.pow(n,i),r=Math.pow(r,i)-n,i=1/i,function(t){return Math.pow(n+t*r,i)}):lE(isNaN(t)?e:t);var n,r,i}}function fE(t,e){var n=e-t;return n?cE(t,n):lE(isNaN(t)?e:t)}!function t(e){var o=uE(e);function n(e,t){var n=o((e=F_(e)).r,(t=F_(t)).r),r=o(e.g,t.g),i=o(e.b,t.b),a=fE(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=r(t),e.b=i(t),e.opacity=a(t),e+""}}return n.gamma=t,n}(1);hE=function(s){var l=s.length-1;return function(t){var e,n=t<=0?t=0:1<=t?l-(t=1):Math.floor(t*l),r=s[n],i=s[n+1],a=0dE(t[t.length-1]),so=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(h),go=i(so),ds=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(h),ss=i(ds),_o=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(h),Ro=i(_o),po=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(h),e=i(po),os=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(h),So=i(os),Lo=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(h),jo=i(Lo),o=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(h),is=i(o),To=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(h),Wo=i(To),mo=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(h),us=i(mo),ls=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(h),rs=i(ls),Bl=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(h),Eo=i(Bl),ho=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(h),gE=i(ho),mE=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(h),yE=i(mE),vE=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(h),bE=i(vE),xE=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(h),wE=i(xE),ME=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(h),OE=i(ME),kE=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(h),_E=i(kE),EE=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(h),SE=i(EE),AE=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(h),LE=i(AE),TE=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(h),jE=i(TE),NE=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(h),PE=i(NE),CE=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(h),RE=i(CE),IE=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(h),BE=i(IE),FE=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(h),DE=i(FE),zE=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(h),WE=i(zE),GE=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(h),qE=i(GE),HE=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(h),i=i(HE);var VE=Ao(oE(300,.5,0),oE(-240,.5,1)),YE=Ao(oE(-100,.75,.35),oE(80,1.5,.8)),Ao=Ao(oE(260,.75,.35),oE(80,1.5,.8)),$E=oE();var UE=F_(),KE=Math.PI/3,XE=2*Math.PI/3;function ZE(e){var n=e.length;return function(t){return e[Math.max(0,Math.min(n-1,Math.floor(t*n)))]}}var QE=ZE(h("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),JE=ZE(h("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),tS=ZE(h("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),eS=ZE(h("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),nS=Object.freeze({__proto__:null,schemeCategory10:a,schemeAccent:bo,schemeDark2:as,schemePaired:vo,schemePastel1:n,schemePastel2:yo,schemeSet1:Rg,schemeSet2:r,schemeSet3:vs,schemeTableau10:Po,interpolateBrBG:go,schemeBrBG:so,interpolatePRGn:ss,schemePRGn:ds,interpolatePiYG:Ro,schemePiYG:_o,interpolatePuOr:e,schemePuOr:po,interpolateRdBu:So,schemeRdBu:os,interpolateRdGy:jo,schemeRdGy:Lo,interpolateRdYlBu:is,schemeRdYlBu:o,interpolateRdYlGn:Wo,schemeRdYlGn:To,interpolateSpectral:us,schemeSpectral:mo,interpolateBuGn:rs,schemeBuGn:ls,interpolateBuPu:Eo,schemeBuPu:Bl,interpolateGnBu:gE,schemeGnBu:ho,interpolateOrRd:yE,schemeOrRd:mE,interpolatePuBuGn:bE,schemePuBuGn:vE,interpolatePuBu:wE,schemePuBu:xE,interpolatePuRd:OE,schemePuRd:ME,interpolateRdPu:_E,schemeRdPu:kE,interpolateYlGnBu:SE,schemeYlGnBu:EE,interpolateYlGn:LE,schemeYlGn:AE,interpolateYlOrBr:jE,schemeYlOrBr:TE,interpolateYlOrRd:PE,schemeYlOrRd:NE,interpolateBlues:RE,schemeBlues:CE,interpolateGreens:BE,schemeGreens:IE,interpolateGreys:DE,schemeGreys:FE,interpolatePurples:WE,schemePurples:zE,interpolateReds:qE,schemeReds:GE,interpolateOranges:i,schemeOranges:HE,interpolateCividis:function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-2710.57*t)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-67.37*t)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-2475.67*t)))))))+")"},interpolateCubehelixDefault:VE,interpolateRainbow:function(t){(t<0||1new Date(i.map(t))):t.map(t=>i.map(t))}(e,r,t);return sS({type:t})?(n=e,t=r,t=Math.round(n.length*r),n.slice(0,t)):e}(c,o=function(t,e,n){var r=n["domain"];if(void 0!==r)return r;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":case"quantize":case"threshold":return fS(function(t,e){var{zero:e=!1}=e;let n=1/0,r=-1/0;for(const i of t)for(const a of i)qu(a)&&(n=Math.min(n,+a),r=Math.max(r,+a));return n===1/0?[]:e?[Math.min(0,n),r]:[n,r]}(e,n),n);case"band":case"ordinal":case"point":return hS(e);case"quantile":return function(t){return hS(t).sort()}(e);case"sequential":return fS(function(t){let e=1/0,n=-1/0;for(const r of t)for(const i of r)qu(i)&&(e=Math.min(e,+i),n=Math.max(n,+i));return e===1/0?[]:[e<0?-n:e,n]}(e),n);default:return[]}}(c,e,n),n),Object.assign(Object.assign(Object.assign({},n),function(t,e,n,r){switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":return function(t){var{interpolate:e=Cp,nice:n=!1,tickCount:r=5}=t;return Object.assign(Object.assign({},t),{interpolate:e,nice:n,tickCount:r})}(n);case"band":case"point":return function(t,e,n,r){if(void 0!==r.padding||void 0!==r.paddingInner||void 0!==r.paddingOuter)return Object.assign(Object.assign({},r),{unknown:NaN});var t=function(t,e,n){return"enterDelay"===e||"enterDuration"===e?0:"band"!==t?"point"===t?.5:0:v_(n)?0:.1}(t,e,n),{paddingInner:e=t,paddingOuter:n=t}=r;return Object.assign(Object.assign({},r),{paddingInner:e,paddingOuter:n,padding:t,unknown:NaN})}(t,e,r,n);case"sequential":return function(t){const{palette:e="ylGnBu",offset:n}=t,r=Qe(e),i=nS["interpolate"+r];if(i)return{interpolator:n?t=>i(n(t)):i};throw new Error("Unknown palette: "+r)}(n);default:return n}}(c,t,n,r)),{domain:s,range:function(t,e,n,r,i,a,o){var s=r["range"];if("string"==typeof s)return s.split("-");if(void 0!==s)return s;var{rangeMin:l,rangeMax:c}=r;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":var u=lS(n,r,i,a,o),[u,f]=function(t,e){return"enterDelay"===t?[0,1e3]:"enterDuration"==t?[300,1e3]:t.startsWith("y")||t.startsWith("position")?[1,0]:"color"===t?[e[0],N0(e)]:"opacity"!==t&&"size"===t?[1,10]:[0,1]}(e,u);return[l||u,c||f];case"band":case"point":return[l||0,c||1];case"ordinal":return lS(n,r,i,a,o);case"sequential":return;case"constant":return[n[0][0]];default:return[]}}(c,t,e,n,s,i,a),expectedDomain:o,guide:l,name:t,type:c}))}function iS(t,e){var[e]=d_("scale",e),n=t["relations"],[n]=function(o){if(!o||!Array.isArray(o))return[Du,Du];let s,l;return[t=>{s=t.map.bind(t),l=null==(e=t.invert)?void 0:e.bind(t);const r=o.filter(([t])=>"function"==typeof t);var e=o.filter(([t])=>"function"!=typeof t);const i=new Map(e);if(t.map=t=>{for(var[e,n]of r)if(e(t))return n;return i.has(t)?i.get(t):s(t)},l){const n=new Map(e.map(([t,e])=>[e,t])),a=new Map(r.map(([t,e])=>[e,t]));t.invert=t=>a.has(t)?t:n.has(t)?n.get(t):l(t)}return t},t=>(null!==s&&(t.map=s),null!==l&&(t.invert=l),t)]}(n);return n(e(t))}function aS(t,n){var t=t.filter(({name:t,facet:e=!0})=>e&&t===n),e=t.flatMap(t=>t.domain),r=t.every(oS)?pc(e):t.every(sS)?Array.from(new Set(e)):null;if(null!==r)for(const i of t)i.domain=r}function oS(t){t=t.type;return"string"==typeof t&&["linear","log","pow","time"].includes(t)}function sS(t){t=t.type;return"string"==typeof t&&["band","point","ordinal"].includes(t)}function lS(t,e,n,r,i){var[i]=d_("palette",i),{defaultCategory10:r,defaultCategory20:a}=r,t=(t=t.flat(),Array.from(new Set(t)).length<=r.length?r:a),{palette:r=t,offset:a}=e;try{return i({type:r})}catch(t){e=function(t,n,r=t=>t){if(!t)return null;const e=Qe(t),i=nS["scheme"+e],a=nS["interpolate"+e];if(!i&&!a)return null;if(i){if(!i.some(Array.isArray))return i;t=i[n.length];if(t)return t}return n.map((t,e)=>a(r(e/n.length)))}(r,n,a);if(e)return e;throw new Error(`Unknown Component: ${r} `)}}function cS(t){return(t=t).startsWith("x")||t.startsWith("y")||t.startsWith("position")||t.startsWith("size")?"point":"ordinal"}function uS(t,e){return"color"!==t||e?"linear":"sequential"}function fS(t,e){var n,r;return 0===t.length?t:({domainMin:e,domainMax:n}=e,[t,r]=t,[null!=e?e:t,null!=n?n:r])}function hS(t){return Array.from(new Set(t.flat()))}function dS(t){return gS(t,t=>{t=typeof t;return"string"==t||"boolean"==t})}function pS(t){return gS(t,t=>t instanceof Date)}function gS(t,e){for(const n of t)if(n.some(e))return!0;return!1}const mS={linear:"linear",identity:"identity",log:"log",pow:"pow",sqrt:"sqrt",sequential:"sequential"},yS={threshold:"threshold",quantize:"quantize",quantile:"quantile"},vS={ordinal:"ordinal",band:"band",point:"point"},bS={constant:"constant"};function xS(t,e,n){const{component:r=[],coordinates:d=[],title:i}=e,[,p]=d_("component",n),g=t.filter(({guide:t})=>null!==t);var a,e=function(t,e,n){const[,o]=d_("component",n),s=t["coordinates"];function i(t,e,n,r){[e,t,i=[]]=[e,t,s];var i,a,e="x"===e?y_(i)?t+"Y":t+"X":"y"===e?y_(i)?t+"X":t+"Y":null;if(r&&e)return i=o(e)["props"],{defaultPosition:t,defaultSize:i,defaultOrder:a}=i,Object.assign(Object.assign({position:t,size:i,order:a,type:e},r),{scales:[n]})}return e.filter(t=>t.slider||t.scrollbar).flatMap(t=>{var{slider:e,scrollbar:n,name:r}=t;return[i("slider",r,t,e),i("scrollbar",r,t,n)]}).filter(t=>!!t)}(e,t,n);const m=[...r,...e];return i&&(t=p("title")["props"],{defaultPosition:n,defaultOrientation:e,defaultOrder:t,defaultSize:a}=t,m.push(Object.assign({type:"title",position:n,orientation:e,order:t,size:a},"string"==typeof i?{title:i}:i))),function(t,e){t=t.filter(t=>{return!!((t=t)&&t.type&&("function"==typeof t.type||({type:t,domain:n,range:r,interpolator:e}=t,n=n&&0"string"!=typeof t.type||["shape","size","color","opacity"].includes(t.name)).filter(t=>!("constant"===t.type&&"size"===t.name)),n=e.filter(t=>!t.field),r=e.filter(t=>!!t.field),i=new Map(Array.from(bc(r,t=>t.field)).map(([t,e])=>[t,[...e,...n.filter(t=>"constant"===t.type)]]).concat([[void 0,n]]).filter(([,t])=>t.some(t=>"constant"!==t.type)));if(0===i.size)return[];t=Array.from(i).map(([,t])=>{var e,n,r=function(e){if(1===e.length)return[e];var n=[];for(let t=1;t<=e.length;t++)n.push(...C0(e,t));return n}(t).sort((t,e)=>e.length-t.length).map(t=>({combination:t,option:t.map(t=>{return[t.name,"string"!=typeof(t=(t=t).type)?null:t in mS?"continuous":t in vS?"discrete":t in yS?"distribution":t in bS?"constant":null]})}));const i=t=>t.sort((t,e)=>t[0].localeCompare(e[0]));for([e,n]of F6)for(const{option:a,combination:o}of r)if(n.some(t=>ln(i(t),i(a))))return[e,o];return null}).filter(qu);return t}(t),...function(t,n){return t.map(t=>{var e=t["name"];if(!(0{var n=p(t)["props"],{defaultPosition:r,defaultOrientation:i,defaultSize:a,defaultOrder:o}=n,{guide:n,field:s}=Object.assign({},...e);for(const h of Array.isArray(n)?n:[n]){var l,c,[u,f]=function(t,e,n,r,i,a,o){var[s]=MS(o),e=[r.position||e,null!=s?s:n];if("string"==typeof t&&t.startsWith("axis"))return function(t,e,n,r,i){n=n[0].name;{var a,o;if("axisRadar"===t)return r=r.filter(t=>t.name.startsWith("position")),a=OS(n),n===r.slice(-1)[0].name||null===a?[null,null]:([o,s]=MS(i),["center",(s-o)/(r.length-1)*a+o])}{var s;if("axisY"===t&&function(t){return 0iS(t,r)),s={bbox:s,scales:o,library:r};return a(t)({coordinate:e,library:r,markState:i,scales:l,theme:n,value:s})}function MS(t){var e,n=g_(t,"polar");return n.length?(n=n[n.length-1],{startAngle:n,endAngle:e}=Ls(n),[n,e]):(n=g_(t,"radial")).length?(e=n[n.length-1],{startAngle:t,endAngle:n}=Cs(e),[t,n]):[-Math.PI/2,Math.PI/2*3]}function OS(t){t=/position(\d*)/g.exec(t);return t?+t[1]:null}function kS(t,e,n,r,i,a){var[a]=d_("scale",a),o=t["type"];if("string"==typeof o&&o.startsWith("axis")&&["left","right","bottom","top"].includes(r)){t.transform=t.transform||[{type:"hide"}];var{labelFormatter:o,scales:s,title:l,tickCount:c,tickMethod:u,tickFilter:f}=t;const p="left"===r||"right"===r;var r=function(t,e,n){var{axis:n,["axis"+zu(e)]:e}=n;return it({},n,e,t.style)}(t,r,i),{tickLength:i=0,labelSpacing:h=0,titleSpacing:d=0}=r,r=rt(r,["tickLength","labelSpacing","titleSpacing"]),[s]=s,c=(void 0!==c&&(s.tickCount=c),void 0!==u&&(s.tickMethod=u),a(s));const g=function(t,e,n){n=_S(t,n),n=n.map(t=>{return"number"==typeof t?(e=t,Math.abs(e)<1e-15?e:parseFloat(e.toFixed(15))):t;var e}),e=e?"string"==typeof e?wx(e):e:t.getFormatter?t.getFormatter():t=>""+t;return n.map(e)}(c,o,f),m=at(r,"label"),y=g.map((n,r)=>{var t=Object.fromEntries(Object.entries(m).map(([t,e])=>[t,"function"==typeof e?e(n,r):e]));return p||(t.transform="none"),ES(n,t)});u=Rc(y,t=>t.width),a=i+h,o=(p?t.size=u+a:!function(t,e,n,r,i){var a=$c(e,t=>t.width);if(no.map(t)+function(t,e){if(!t.getBandWidth)return 0;t=t.getBandWidth(e)/2;return t}(o,t)),c=s.map((t,e)=>e),u=-r[0],f=n+r[1],h=(t,e)=>{e=e.width;return[t-e/2,t+e/2]};for(let t=0;tt.height),t.size=s+a):(t.size=u+a,t.style=Object.assign(Object.assign({},t.style),{labelTransform:"rotate(90)"})),g.map((t,e)=>e));t.indexBBox=new Map(o.map(t=>[t,[g[t],y[t]]])),!1!==l&&null!=l&&(i=at(r,"title"),h=ES(Array.isArray(l)?l.join(","):l,i),p?t.size+=d+h.width:t.size+=d+h.height)}}function _S(t,e){t=t.getTicks?t.getTicks():t.getOptions().domain;return e?t.filter(e):t}function ES(t,e){t=(t=t)instanceof nt.DisplayObject?t:new nt.Text({style:{text:""+t}}),t.attr(Object.assign(Object.assign({},e),{visibility:"none"})),e=t.getBBox();return e}function SS(t,e,n,r,i,a,o){var s=bc(t,t=>t.position),{padding:t,paddingLeft:i=t,paddingRight:l=t,paddingBottom:c=t,paddingTop:t=t}=i,u={paddingBottom:c,paddingLeft:i,paddingTop:t,paddingRight:l};for(const d of r){var f="padding"+zu(D2(d)),h=u[f];if(void 0===h||"auto"===h)if(s.has(d)){const t=s.get(d);"auto"===h&&t.forEach(t=>kS(t,e,n,d,a,o));h=t.reduce((t,{size:e})=>t+e,0);u[f]=h}else u[f]=30}return u}function AS(t,I,e){var B=bc(t,t=>t.position),{paddingLeft:t,paddingRight:e,paddingTop:n,paddingBottom:F,marginLeft:r,marginTop:i,marginBottom:D,marginRight:z,innerHeight:a,innerWidth:o,height:s,width:W}=e,t=t+r,r=n+i,n=e+z,i=F+D,G={top:[t,0,o,r,"vertical",!0,ac],right:[W-n,r,n,a,"horizontal",!1,ac],bottom:[t,s-i,o,i,"vertical",!1,ac],left:[0,r,t,a,"horizontal",!0,ac],"top-left":[t,0,o,r,"vertical",!0,ac],"top-right":[t,0,o,r,"vertical",!0,ac],"bottom-left":[t,s-i,o,i,"vertical",!1,ac],"bottom-right":[t,s-i,o,i,"vertical",!1,ac],center:[t,r,o,a,"center",null,null],inner:[t,r,o,a,"center",null,null],outer:[t,r,o,a,"center",null,null]};for(const[C,t]of B.entries()){var l=G[C],[c,q]=P0(t,t=>"string"==typeof t.type&&("center"===C||!(!t.type.startsWith("axis")||!["inner","outer"].includes(C))));if(c.length){p=d=h=f=u=void 0;var u=c,f=I,h=l,d=C,[u,p]=P0(u,t=>!("string"!=typeof t.type||!t.type.startsWith("axis"))),c=(y=m=g=c=void 0,u),g=f,m=h,y=d;if("center"===y)if(!function(t){return Qc(t)&&Kc(t)}(g)){if(Kc(g)){u=void 0;d=void 0;v=void 0;b=void 0;x=void 0;w=void 0;u=c;d=m;var[v,b,x,w]=d;for(const tt of u)tt.bbox={x:v,y:b,width:x,height:w}}else if(Qc(g)){d=void 0;u=void 0;M=void 0;O=void 0;d=c;u=g;var M=m;var O=c[0].orientation;"horizontal"===O?function(e,t,n){const[r,i,a]=n,o=new Array(e.length+1).fill(0),s=t.map(o),l=s.filter((t,e)=>e%2==1).map(t=>t+i);for(let t=0;te%2==0).map(t=>t+r);for(let t=0;tnull===l||void 0===l?void 0:l(t.order,e.order)),s?u+p:u);for(let t=0,e=y;te=>ue(this,void 0,void 0,function*(){var t=yield n(e);return r(t)}),Du)}([rt(n,["transform"]),...r].map(t))(e);return[Array.isArray(n)?j0(n):[],Object.assign(Object.assign({},i),{data:n})]})}function jS(t,e,n){var r=e["encode"];if(!r)return[t,e];var i,a,o={};for([i,a]of Object.entries(r))if(Array.isArray(a))for(let t=0;t{var e,n;return function(t){if("object"!=typeof t||t instanceof Date||null===t)return;t=t.type;return qu(t)}(t)?t:(e=i,{type:"function"==typeof(n=t)?"transform":"string"==typeof n&&function(t,e){return Array.isArray(t)&&t.some(t=>void 0!==t[e])}(e,n)?"field":"constant",value:t})}),[t,Object.assign(Object.assign({},e),{encode:a})]):[t,e]}function PS(t,e,n){var r=e["encode"];return r?(r=T0(r,(t,e)=>{var n=t["type"];return"constant"!==n||(n=e).startsWith("x")||n.startsWith("y")||n.startsWith("position")||"enterDelay"===n||"enterDuration"===n||"updateDelay"===n||"updateDuration"===n||"exitDelay"===n||"exitDuration"===n?t:Object.assign(Object.assign({},t),{constant:!0})}),[t,Object.assign(Object.assign({},e),{encode:r})]):[t,e]}function CS(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];n=n.library;const a=function(t){const[n]=d_("encode",t);return(t,e)=>void 0===e||void 0===t?null:Object.assign(Object.assign({},e),{type:"column",value:n(e)(t),field:function(t){var{type:t,value:e}=t;return"field"===t&&"string"==typeof e?e:null}(e)})}(n);n=T0(r,t=>a(i,t));return[t,Object.assign(Object.assign({},e),{encode:n})]}function RS(t,e,n){var{tooltip:r={}}=e;return Uu(r)?[t,e]:Array.isArray(r)?[t,Object.assign(Object.assign({},e),{tooltip:{items:r}})]:$u(r)&&Zu(r)?[t,Object.assign(Object.assign({},e),{tooltip:r})]:[t,Object.assign(Object.assign({},e),{tooltip:{items:[r]}})]}function IS(g,t,e){const{data:m,encode:y,tooltip:n={}}=t;var r,i,a,o;return Uu(n)?[g,t]:(r=e=>{if(!e)return e;if("string"==typeof e)return g.map(t=>({name:e,value:m[t][e]}));if($u(e)){var{field:t,channel:n,color:r,name:i=t,valueFormatter:a=t=>t}=e,o="string"==typeof a?wx(a):a,s=n&&y[n],a=s&&y[n].field,l=i||a||n,c=[];for(const d of g){var u=t?m[d][t]:s?y[n].value[d]:null;c[d]={name:l,color:r,value:o(u)}}return c}if("function"!=typeof e)return e;var f=[];for(const p of g){var h=e(m[p],p,m,y);$u(h)?f[p]=h:f[p]={value:h}}return f},{title:o,items:i=[]}=n,a=rt(n,["title","items"]),o=Object.assign({title:r(o),items:Array.isArray(i)?i.map(r):[]},a),[g,Object.assign(Object.assign({},t),{tooltip:o})])}function BS(l,t,e){var n,r=t["encode"],i=rt(t,["encode"]);return r?(n=(r=Object.entries(r)).filter(([,t])=>{t=t.value;return Array.isArray(t[0])}).flatMap(([n,t])=>{var r=[[n,new Array(l.length).fill(void 0)]];const i=t["value"],a=rt(t,["value"]);for(let e=0;e[t,Object.assign({type:"column",value:e},a)])}),r=Object.fromEntries([...r,...n]),[l,Object.assign(Object.assign({},i),{encode:r})]):[l,t]}function FS(t,e,n){const{axis:r={},legend:i={},slider:a={},scrollbar:o={}}=e,s=(t,e)=>{return"boolean"==typeof t?t?{}:null:void 0===(t=t[e])||t?t:null};var l="object"==typeof r?Array.from(new Set(["x","y",...Object.keys(r)])):["x","y"];return it(e,{scale:Object.assign(Object.assign({},Object.fromEntries(l.map(t=>{var e=s(o,t);return[t,Object.assign({guide:s(r,t),slider:s(a,t),scrollbar:e},e&&{ratio:void 0===e.ratio?.5:e.ratio})]}))),{color:{guide:s(i,"color")},size:{guide:s(i,"size")},shape:{guide:s(i,"shape")},opacity:{guide:s(i,"opacity")}})}),[t,e]}function DS(t,e,n){var r=e["animate"];return r||void 0===r||it(e,{animate:{enter:{type:null},exit:{type:null},update:{type:null}}}),[t,e]}function zS(l,c,u){return ue(this,void 0,void 0,function*(){var[t,e]=yield function(s,l,c){return ue(this,void 0,void 0,function*(){var t=c["library"],[t]=d_("transform",t),{preInference:e=[],postInference:n=[]}=l,{transform:r=[]}=s,e=[LS,TS,jS,NS,PS,CS,BS,DS,FS,RS,...e.map(t),...r.map(t),...n.map(t),IS];let i=[],a=s;for(const o of e)[i,a]=yield o(i,a,c);return[i,a]})}(l,c,{library:u});const{encode:n,scale:h,data:r,tooltip:i}=e;if(!1===Array.isArray(r))return null;const a=c["channels"],o=wc(Object.entries(n).filter(([,t])=>qu(t)),t=>t.map(([t,e])=>Object.assign({name:t},e)),([t])=>{const e=null==(n=/([^\d]+)\d*$/.exec(t))?void 0:n[1];var n=a.find(t=>t.name===e);return null!=n&&n.independent?t:e});var s=a.filter(t=>{const{name:e,required:n}=t;if(o.find(([t])=>t===e))return!0;if(n)throw new Error(`Missing encoding for channel: ${e}.`);return!1}).flatMap(t=>{const{name:e,scale:c,scaleKey:u,range:f}=t;return o.filter(([t])=>t.startsWith(e)).map(([t,e],n)=>{var r=e.some(t=>t.visual),i=e.some(t=>t.constant),a=h[t]||{},{independent:o=!1,key:s=u||t,type:i=i?"constant":r?"identity":c}=a,r=rt(a,["independent","key","type"]),a="constant"===i,l=a?void 0:f;return{name:t,values:e,scaleKey:o||a?Symbol("independent"):s,scale:Object.assign({type:i,range:l},r)}})});return[e,Object.assign(Object.assign({},c),{index:t,channels:s,tooltip:i})]})}function WS(W,G,q,H){var V,Y;return ue(this,void 0,void 0,function*(){const[n]=d_("composition",q);var[t]=d_("interaction",q);const r=new Set(Object.keys(q).map(t=>{return null==(t=/mark\.(.*)/.exec(t))?void 0:t[1]}).filter(qu)),i=t=>{t=t.type;if("function"==typeof t){var{props:e={}}=t,{composite:e=!0}=e;if(e)return"mark"}return"string"==typeof t&&r.has(t)?"mark":t};const a=t=>"standardView"===i(t);var e=t=>{var e;return a(t)?[t]:(e=i(t),n({type:e})(t))},o=[];const s=new Map;for(var l=new Map,c=[W],u=[];c.length;){var f=c.shift();if(a(f)){var h=l.get(f),[h,d]=h?VS(h,f,q):yield qS(f,q),p=(s.set(h,f),o.push(h),d.flatMap(e).map(t=>p_(t,q)));if(c.push(...p),p.every(a)){var g=yield Promise.all(p.map(t=>HS(t,q)));aS(h=(h=g).flatMap(t=>Array.from(t.values())).flatMap(t=>t.channels.map(t=>t.scale)),"x"),aS(h,"y");for(let t=0;tt.key).join(t=>t.append("g").attr("className",U).attr("id",t=>t.key).call(GS).each(function(t){YS(t,ot(this),v,q,H),m.set(t,this)}),t=>t.call(GS).each(function(t){YS(t,ot(this),v,q,H),y.set(t,this)}),t=>t.each(function(){for(const t of this.nameInteraction.values())t.destroy()}).remove());var b=t=>Array.from(t.entries()).map(([t,e])=>({view:t,container:e,options:s.get(t),update:function(h,d,p){return f=>ue(this,void 0,void 0,function*(){var t,[e,n]=yield qS(f,d),r=(YS(e,h,[],d,p),h),i=f,a=e,o=p,[s]=d_("interaction",s=d),l=(l=r.node()).nameInteraction,c=QS(i).find(([t])=>"tooltip"===t);(l=l.get("tooltip"))&&(null!=(t=l.destroy)&&t.call(l),c[1])&&(t=s(Object.assign({type:"tooltip"},c[1])),l={options:i,view:a,container:r.node(),update:t=>Promise.resolve(t)},t(l,[],o.emitter));for(const u of n)WS(u,h,d,p);return{options:f,view:e}})}(ot(e),q,H)})),x=b(m);for(const T of x){const W=T["options"];var w=new Map;T.container.nameInteraction=w;for(const j of QS(W)){var[M,O]=j;O&&(O=t(Object.assign({type:M},O))(T,x,H.emitter),w.set(M,{destroy:O}))}}var k=b(y);for(const N of k){const{options:W,container:P}=N;var _=P.nameInteraction;for(const C of QS(W)){var[E,S]=C,A=_.get(E);A&&null!=(V=A.destroy)&&V.call(A),S&&(A=t(Object.assign({type:E},S))(N,k,H.emitter),_.set(E,{destroy:A}))}}const{width:F,height:D}=W;var L=[];for(const R of u){var z=new Promise(e=>ue(this,void 0,void 0,function*(){for(const t of R)yield WS(Object.assign({width:F,height:D},t),G,q,H);e()}));L.push(z)}H.views=o,null!=(Y=H.animations)&&Y.forEach(t=>null==t?void 0:t.cancel()),H.animations=v,H.emitter.emit($.AFTER_PAINT);b=v.filter(qu).map(XS).map(t=>t.finished);return Promise.all([...b,...L])})}function GS(t){t.style("transform",t=>`translate(${t.layout.x}, ${t.layout.y})`)}function qS(e,n){return ue(this,void 0,void 0,function*(){var t=function(t){var{coordinate:e={},interaction:n={},style:r={},marks:i}=t,t=rt(t,["coordinate","interaction","style","marks"]),a=i.map(t=>t.coordinate||{}),o=i.map(t=>t.interaction||{}),s=i.map(t=>t.viewStyle||{}),a=[...a,e].reduceRight((t,e)=>it(t,e),{}),e=[n,...o].reduce((t,e)=>it(t,e),{}),n=[...s,r].reduce((t,e)=>it(t,e),{});return Object.assign(Object.assign({},t),{marks:i,coordinate:a,interaction:e,style:n})}(yield function(c,u){return ue(this,void 0,void 0,function*(){var[t,e]=d_("mark",u);const n=c["marks"];for(var r=[],i=[...n];i.length;){var[a]=i.splice(0,1),a=yield JS(a,u);const{type:s=Wu("G2Mark type is required."),key:l}=a;var{props:o={}}=e(s),{composite:o=!0}=o;if(o){const n=yield t(a)(c);o=Array.isArray(n)?n:[n];i.unshift(...o.map((t,e)=>Object.assign(Object.assign({},t),{key:l+"-"+e})))}else r.push(a)}return Object.assign(Object.assign({},c),{marks:r})})}(e,n)),t=(e.interaction=t.interaction,e.coordinate=t.coordinate,p_(t,n));return VS(yield HS(t,n),t,n)})}function HS(p,g){return ue(this,void 0,void 0,function*(){var[t]=d_("theme",g),[,e]=d_("mark",g),{theme:n,marks:r,coordinates:i=[]}=p,a=t(ZS(n)),o=new Map;for(const f of r){var s,l=f["type"],{props:l={}}=e(l),l=yield zS(f,l,g);l&&([l,s]=l,o.set(l,s))}for(const h of bc(Array.from(o.values()).flatMap(t=>t.channels),({scaleKey:t})=>t).values()){var c=h.reduce((t,{scale:e})=>it(t,e),{}),u=h[0]["values"],u=Array.from(new Set(u.map(t=>t.field).filter(qu)));const p=it({guide:{title:0===u.length?void 0:u},field:u[0]},c);u=h[0]["name"];const d=rS(u,h.flatMap(({values:t})=>t.map(t=>t.value)),p,i,a,g);h.forEach(t=>t.scale=d)}return o})}function VS(t,e,n){var[r]=d_("mark",n),[i]=d_("theme",n),[a]=d_("labelTransform",n);const{key:o,frame:s=!1,theme:l,clip:c,style:u={},labelTransform:f=[]}=e;var h,d,i=i(ZS(l)),p=Array.from(t.values()),g=Array.from(new Set(p.flatMap(t=>t.channels.map(t=>t.scale)))),g=xS(function(t,e,n){for(var[r]of n.entries())if("cell"===r.type)return t.filter(t=>"shape"!==t.name);if(1!==e.length||t.some(t=>"shape"===t.name))return t;n=e[0].defaultShape;if(!["point","line","rect","hollow"].includes(n))return t;e=(null==(e=t.find(t=>"color"===t.name))?void 0:e.field)||null,e={field:e,name:"shape",type:"constant",domain:[],range:[{point:"point",line:"hyphen",rect:"square",hollow:"hollow"}[n]]};return[...t,e]}(Array.from(g),p,t),e,n),m=function(t,e,n,r){var{width:i,height:a,x:o=0,y:s=0,inset:l=0,insetLeft:c=l,insetTop:u=l,insetBottom:f=l,insetRight:l=l,margin:h=0,marginLeft:d=h,marginBottom:p=h,marginTop:g=h,marginRight:h=h,padding:m,paddingBottom:y=m,paddingLeft:v=m,paddingRight:b=m,paddingTop:m=m}=e,x=(t,e,n)=>"auto"===t?Math.min(n,e):e,{paddingLeft:w,paddingRight:M}=SS(t,a,[0,0],["left","right"],e,n,r),v=x(v,w,1/3*(O=i-d-h)),w=x(b,M,1/3*O),{paddingTop:M,paddingBottom:O}=SS(t,b=O-v-w,[v,w],["bottom","top"],e,n,r),e=x(y,O,1/3*(t=a-p-g)),n=x(m,M,1/3*t);return{width:i,height:a,insetLeft:c,insetTop:u,insetBottom:f,insetRight:l,innerWidth:b,innerHeight:t-e-n,paddingLeft:v,paddingRight:w,paddingTop:n,paddingBottom:e,marginLeft:d,marginBottom:p,marginTop:g,marginRight:h,x:o,y:s}}(g,e,i,n),y=function(t,e,n){var[n]=d_("coordinate",n),{innerHeight:r,innerWidth:i,insetLeft:a,insetTop:o,insetRight:s,insetBottom:l,marginLeft:c,marginTop:u}=t,{coordinates:e=[]}=e,e=(e=e).find(t=>"cartesian"===t.type)?e:[...e,{type:"cartesian"}];return new f_(Object.assign(Object.assign({},t),{x:a+c,y:o+u,width:i-a-s,height:r-l-o,transformations:e.map(n).flat()}))}(m,e,n),p=s?it({mainLineWidth:1,mainStroke:"#000"},u):u,v=(AS(g,y,m),{}),b=[];for([h,d]of t.entries()){const{children:M,dataDomain:O,modifier:k,key:_}=h,{index:E,channels:S,tooltip:A}=d;var x=T0(Object.fromEntries(S.map(({name:t,scale:e})=>[t,e])),t=>iS(t,n));Object.assign(v,x);const L=function(t,e){var n={};for(const s of t){var{values:r,name:i}=s;const l=e[i];for(const c of r){var{name:a,value:o}=c;n[a]=o.map(t=>l.map(t))}}return n}(S,x),[T,j,N]=function([e,n,t]){if(t)return[e,n,t];var r=[],i=[];for(let t=0;tqu(t)&&qu(e))&&(r.push(a),i.push(o))}return[r,i]}(r(h)(E,x,L,y));var w=O||T.length;const P=k?k(j,w,m):[],C=t=>{var e;return null==(e=null==(e=A.title)?void 0:e[t])?void 0:e.value},R=e=>A.items.map(t=>t[e]);w=T.map((t,e)=>{var n=Object.assign({points:j[e],transform:P[e],index:t,markKey:_,viewKey:o},A&&{title:C(t),items:R(t)});for(const[r,i]of Object.entries(L))n[r]=i[t],N&&(n["series"+Qe(r)]=N[e].map(t=>i[t]));return N&&(n.seriesIndex=N[e]),N&&A&&(n.seriesItems=N[e].map(t=>R(t)),n.seriesTitle=N[e].map(t=>C(t))),n}),w=(d.data=w,d.index=T,null==M?void 0:M(w,x,m));b.push(...w||[])}return[{layout:m,theme:i,coordinate:y,components:g,markState:t,key:o,clip:c,scale:v,style:p,labelTransform:$S(f.map(a))},b]}function YS(Z,Q,J,tt,et){ue(this,void 0,void 0,function*(){const{components:I,theme:n,layout:t,markState:r,coordinate:i,key:e,style:B,clip:a}=Z,{width:F,height:D}=t,z=rt(t,["x","y","width","height"]),o=["view","plot","main","content"];var s=o.map((t,e)=>e);const l=o.map(t=>Hu(Object.assign({},n,B),t)),W=["a","margin","padding","inset"].map(t=>at(z,t)),c=t=>t.style("x",t=>p[t].x).style("y",t=>p[t].y).style("width",t=>p[t].width).style("height",t=>p[t].height).each(function(t){var e,n,r=ot(this),t=l[t];for([e,n]of Object.entries(t))r.style(e,n)});let u=0,f=0,h=F,d=D;const p=s.map(t=>{var{left:t=0,top:e=0,bottom:n=0,right:r=0}=W[t];return u+=t,f+=e,h-=t+r,d-=e+n,{x:u,y:f,width:h,height:d}}),g=(Q.selectAll(r8(ht)).data(s.filter(t=>qu(l[t])),t=>o[t]).join(t=>t.append("rect").attr("className",ht).style("zIndex",-2).call(c),t=>t.call(c),t=>t.remove()),function(t){let e=-1/0,n=1/0;for(var[r,i]of t){var{animate:r={}}=r,i=i["data"],{enter:r={},update:a={},exit:o={}}=r,{type:s,duration:l=300,delay:c=0}=a,{type:u,duration:f=300,delay:h=0}=r,{type:d,duration:p=300,delay:g=0}=o;for(const _ of i){var{updateType:m=s,updateDuration:y=l,updateDelay:v=c,enterType:b=u,enterDuration:x=f,enterDelay:w=h,exitDuration:M=p,exitDelay:O=g,exitType:k=d}=_;void 0!==m&&!m||(e=Math.max(e,y+v),n=Math.min(n,v)),void 0!==k&&!k||(e=Math.max(e,M+O),n=Math.min(n,O)),void 0!==b&&!b||(e=Math.max(e,x+w),n=Math.min(n,w))}}return e===-1/0?null:[n,e-n]}(r)),m=!!g&&{duration:g[1]};var y,v,b,s=Q.selectAll(r8(ut)).data(I,(t,e)=>t.type+"-"+e).join(t=>t.append("g").style("zIndex",({zIndex:t})=>t||-1).attr("className",ut).append(t=>wS(it({animate:m},t),i,n,tt,r)),t=>t.transition(function(t){var{preserve:e=!1}=t;if(!e)return e=wS(it({animate:m},t),i,n,tt,r)["attributes"],[t]=this.childNodes,t.update(e)})).transitions();J.push(...s.flat().filter(qu));const x=Q.selectAll(r8(ct)).data([t],()=>e).join(t=>t.append("rect").style("zIndex",0).style("fill","transparent").attr("className",ct).call(t8).call(n8,Array.from(r.keys())).call(i8,a),t=>t.call(n8,Array.from(r.keys())).call(t=>{if(!g)return t8(t);{const[l,c]=g;t.transition(function(t){var{x:e,y:n,width:r,height:i}=this.style,{paddingLeft:t,paddingTop:a,innerWidth:o,innerHeight:s}=t;return this.animate([{x:e,y:n,width:r,height:i},{x:t,y:a,width:o,height:s}],{delay:l,duration:c,fill:"both"})})}}).call(i8,a)).transitions();J.push(...x.flat());for([y,v]of r.entries()){var G=v["data"];const{key:e,class:q,type:A}=y;var w=Q.select("#"+e);const L=function(s,t,e,n,l){const[c]=d_("shape",n),u=s["data"],{defaultShape:f,data:r}=t,h=r.map(t=>t.points),{theme:d,coordinate:p}=e,{type:g,style:m={}}=s;return t=>{var{shape:e=f}=m,{shape:e=e,points:n,seriesIndex:r,index:i}=t,t=rt(t,["shape","points","seriesIndex","index"]),t=Object.assign(Object.assign({},t),{shape:e,mark:g,defaultShape:f,index:i});const a=r?r.map(t=>u[t]):u[i],o=r||i;r=T0(m,t=>US(t,a,o,u));return c(Object.assign(Object.assign({},r),{type:e8(s,e)}))(n,t,p,d,h,l)}}(y,v,Z,tt,et),H=(M=y,b=v,KS("enter",M,b,Z,tt)),T=(M=y,b=v,KS("update",M,b,Z,tt)),V=(M=y,b=v,KS("exit",M,b,Z,tt));var M=function(t,e,n,r){t=t.node().parentElement;return t.findAll(t=>void 0!==t.style.facet&&t.style.facet===n&&t!==e.node()).flatMap(t=>t.getElementsByClassName(r))}(Q,w,q,"element");const x=w.selectAll(r8(lt)).selectFacetAll(M).data(G,t=>t.key,t=>t.groupKey).join(t=>t.append(L).attr("className",lt).attr("markType",A).transition(function(t){return H(t,[this])}),e=>e.call(t=>{const l=t.parent(),c=function(n){const r=new Map;return t=>{var e;return r.has(t)?r.get(t):(e=n(t),r.set(t,e),e)}}(t=>{var[t,e]=t.getBounds().min;return[t,e]});e.transition(function(t,e){n=this,r=l,s=c,n.__facet__&&(i=n.parentNode.parentNode,o=r.parentNode,[i,a]=s(i),[s,o]=s(o),i=`translate(${i-s}, ${a-o})`,s=n.style.transform,a="none"===(a=s)||void 0===a?"":s,n.style.transform=(a+" "+i).trimStart(),r.append(n));var n,r,i,a,o=L(t,e),s=T(t,[this],[o]);return null===s&&(this.nodeName===o.nodeName?Gu(this,o):this.parentNode.replaceChild(o,this)),s})}),t=>t.each(function(){this.__removed__=!0}).transition(function(t){return V(t,[this])}).remove(),t=>t.append(L).attr("className",lt).attr("markType",A).transition(function(t){var e=this["__fromElements__"],t=T(t,e,[this]);return new Z0(e,null,this.parentNode).transition(t).remove(),t}),t=>t.transition(function(t){var e=new Z0([],this.__toData__,this.parentNode).append(L).attr("className",lt).attr("markType",A).nodes();return T(t,[this],e)}).remove()).transitions();J.push(...x.flat())}{var O=Z,k=Q,_=tt,E,S;const[Y]=d_("labelTransform",_),{markState:$,labelTransform:j}=O,U=k.select(r8(st)).node(),N=new Map,P=new Map,K=Array.from($.entries()).flatMap(([t,e])=>{var{labels:n=[],key:r}=t;const i=function(t,e,n,r){const[s]=d_("shape",r),l=t["data"],{data:i,defaultLabelShape:c}=e,u=i.map(t=>t.points),{theme:f,coordinate:h}=n;return t=>{const{index:e,points:n}=t,r=l[e];var{formatter:i=t=>""+t,style:a}=t,t=rt(t,["formatter","transform","style"]),t=T0(Object.assign(Object.assign({},t),a),t=>US(t,r,e,l)),{shape:a=c,text:o}=t,t=rt(t,["shape","text"]),i="string"==typeof i?wx(i):i,i=Object.assign(Object.assign({},t),{text:i(o,r,e,l)});return s(Object.assign({type:"label."+a},t))(n,i,h,f,u)}}(t,e,O,_),a=k.select("#"+r).selectAll(r8(lt)).nodes().filter(t=>!t.__removed__);return n.flatMap((e,n)=>{const r=rt(e,["transform"]);return a.flatMap(t=>{t=function(n,r,i){const{seriesIndex:t,seriesKey:a,points:o,key:e,index:s}=i.__data__,l=function(t){const e=t.cloneNode(),n=t.getAnimations(),r=(e.style.visibility="hidden",n.forEach(t=>{t=t.effect.getKeyframes();e.attr(t[t.length-1])}),t.parentNode.appendChild(e),e.getLocalBounds()),{min:i,max:a}=(e.destroy(),r);return[i,a]}(i);if(!t)return[Object.assign(Object.assign({},n),{key:e+"-"+r,bounds:l,index:s,points:o,dependentElement:i})];var c=function(t){t=t.selector;if(!t)return null;if("function"==typeof t)return t;if("first"===t)return t=>[t[0]];if("last"===t)return t=>[t[t.length-1]];throw new Error("Unknown selector: "+t)}(n),u=t.filter((t,e)=>o[e].every(qu)).map((t,e)=>Object.assign(Object.assign({},n),{key:a[e]+"-"+r,bounds:[o[e]],index:t,points:o,dependentElement:i}));return c?c(u):u}(r,n,t);return t.forEach(t=>{N.set(t,i),P.set(t,e)}),t})})}),C=ot(U).selectAll(r8(ft)).data(K,t=>t.key).join(t=>t.append(t=>N.get(t)(t)).attr("className",ft),t=>t.each(function(t){Gu(this,N.get(t)(t))}),t=>t.remove()).nodes(),X=bc(C,t=>P.get(t.__data__)),R=O["coordinate"];for([E,S]of X){var{transform:E=[]}=E;$S(E.map(Y))(S,R)}j&&j(C,R)}})}function $S(r){return(t,e)=>{for(const n of r)t=n(t,e);return t}}function US(t,e,n,r){return"function"==typeof t?t(e,n,r):"string"==typeof t&&void 0!==e[t]?e[t]:t}function KS(o,t,e,n,r){var[,i]=d_("shape",r);const[s]=d_("animation",r);r=e.defaultShape;const{theme:a,coordinate:l}=n;e=`default${Qe(o)}Animation`;const{[e]:c}=i(e8(t,r)).props,{[o]:u={}}=a,f=(null==(n=t.animate)?void 0:n[o])||{};return(t,e,n)=>{var{[o+"Type"]:t,[o+"Delay"]:r,[o+"Duration"]:i,[o+"Easing"]:a}=t,t=Object.assign({type:t||c},f);return t.type?(t=s(t)(e,n,{delay:r,duration:i,easing:a},l,u),Array.isArray(t)?t:[t]):null}}function XS(t){return t.finished.then(()=>{t.cancel()}),t}function ZS(t={}){var e;return"string"==typeof t?{type:t}:({type:e="classic"}=t,t=rt(t,["type"]),Object.assign(Object.assign({},t),{type:e}))}function QS(t){var{interaction:t={}}=t;return Object.entries(it({event:!0,tooltip:!0,sliderFilter:!0,legendFilter:!0,scrollbarFilter:!0},t))}function JS(r,i){return ue(this,void 0,void 0,function*(){var t={library:i},e=r["data"],n=rt(r,["data"]);return null==e?r:([,{data:e}]=yield TS(0,{data:e},t),Object.assign({data:e},n))})}function t8(t){t.style("x",t=>t.paddingLeft).style("y",t=>t.paddingTop).style("width",t=>t.innerWidth).style("height",t=>t.innerHeight)}function e8(t,e){t=t.type;return"string"==typeof e?t+"."+e:e}function n8(t,e){const n=t=>void 0!==t.class?""+t.class:"";0===t.nodes().length||(t.selectAll(r8(E)).data(e,t=>t.key).join(t=>t.append("g").attr("className",E).attr("id",t=>t.key).style("facet",n).style("fill","transparent").style("zIndex",t=>{return null!=(t=t.zIndex)?t:0}),t=>t.style("facet",n).style("fill","transparent").style("zIndex",t=>{return null!=(t=t.zIndex)?t:0}),t=>t.remove()),t.select(r8(st)).node())||t.append("g").attr("className",st).style("zIndex",0)}function r8(...t){return t.map(t=>"."+t).join("")}function i8(t,i){t.node()&&t.style("clipPath",t=>{var e,n,r;return i?({paddingTop:t,paddingLeft:e,innerWidth:n,innerHeight:r}=t,new nt.Rect({style:{x:e,y:t,width:n,height:r}})):null})}function a8(t){for(var t=it({},t),e=new Map([[t,null]]),n=new Map([[null,-1]]),r=[t];r.length;){var i,a,o=r.shift(),{children:s=[]}=(void 0===o.key&&(a=e.get(o),i=n.get(o),a=null===a?"0":a.key+"-"+i,o.key=a),o);if(Array.isArray(s))for(let t=0;t{},r=t=>{throw t}){const{width:i=640,height:a=480,theme:o}=t,s=(o||Wu('ChartOptions.theme is required, such as `const chart = new Chart({ theme: "classic"})`.'),a8(t)),{canvas:l=(t=i,f=a,h=new _.Renderer,h.registerPlugin(new _s),new nt.Canvas({width:t,height:f,container:document.createElement("div"),renderer:h})),library:c=B6(),emitter:u=new Es}=e;var f,h;e.canvas=l,e.library=c,e.emitter=u,l.resize(i,a),u.emit($.BEFORE_RENDER);const d=ot(l.document.documentElement);return l.ready.then(()=>WS(Object.assign(Object.assign({},s),{width:i,height:a}),d,c,e)).then(()=>{l.requestAnimationFrame(()=>{u.emit($.AFTER_RENDER),null!=n&&n()})}).catch(t=>{null!=r&&r(t)}),"string"==typeof(t=l.getConfig().container)?document.getElementById(t):t}function s8(t,e={},n=!1){var r,{canvas:e,emitter:i}=e;e&&(null!=(r=(r=e).getRoot().querySelectorAll("."+U))&&r.forEach(t=>{var{nameInteraction:t=new Map}=t;0<(null==t?void 0:t.size)&&Array.from(null==t?void 0:t.values()).forEach(t=>{null!=t&&t.destroy()})}),n?e.destroy():e.destroyChildren()),i.off()}function l8(t,{name:e,key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):this.attr(n,t)}}function c8(t,{name:e,key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):Array.isArray(t)?this.attr(n,t):(t=[...this.attr(n)||[],t],this.attr(n,t))}}function u8(t,{name:e,key:r=e}){t.prototype[e]=function(t,e){var n;return 0===arguments.length?this.attr(r):1===arguments.length&&"string"!=typeof t?this.attr(r,t):((n=this.attr(r)||{})[t]=1===arguments.length||e,this.attr(r,n))}}function g(r){return t=>{for(const n of r){var e=n["type"];"value"===e?l8(t,n):"array"===e?c8(t,n):"object"===e?u8(t,n):"node"===e?function(t,{name:n,ctor:r}){t.prototype[n]=function(t){var e=this.append(r);return"mark"===n&&(e.type=t),e}}(t,n):"container"===e?function(t,{name:e,ctor:n}){t.prototype[e]=function(){return this.type=null,this.append(n)}}(t,n):"mix"===e&&function(t,{name:r}){t.prototype[r]=function(t){var e,n;return 0===arguments.length?this.attr(r):Array.isArray(t)?this.attr(r,{items:t}):$u(t)&&(void 0!==t.title||void 0!==t.items)||null===t||!1===t?this.attr(r,t):({items:n=[]}=e=this.attr(r)||{},n.push(t),e.items=n,this.attr(r,e))}}(t,n)}return t}}function f8(t){return Object.entries(t).map(([t,e])=>({type:"node",name:t,ctor:e}))}function h8(t,e){for(var n=[t];n.length;){var r=n.shift(),r=(e&&e(r),r.children||[]);for(const i of r)n.push(i)}}class d8{constructor(t={},e){this.parentNode=null,this.children=[],this.index=0,this.type=e,this.value=t}map(t=t=>t){t=t(this.value);return this.value=t,this}attr(e,n){return 1===arguments.length?this.value[e]:this.map(t=>(t[e]=n,t))}append(t){t=new t({});return t.children=[],this.push(t),t}push(t){return t.parentNode=this,t.index=this.children.length,this.children.push(t),this}remove(){var t,e=this.parentNode;return e&&(e=e["children"],t=e.findIndex(t=>t===this),e.splice(t,1)),this}getNodeByKey(e){let n=null;return h8(this,t=>{e===t.attr("key")&&(n=t)}),n}getNodesByType(e){const n=[];return h8(this,t=>{e===t.type&&n.push(t)}),n}getNodeByType(e){let n=null;return h8(this,t=>{n||e===t.type&&(n=t)}),n}call(t,...e){return t(this.map(),...e),this}getRoot(){let t=this;for(;t&&t.parentNode;)t=t.parentNode;return t}}class p8 extends d8{changeData(t){var e=this.getRoot();if(e)return this.attr("data",t),null==e?void 0:e.render()}getMark(){var t,e=null==(e=this.getRoot())?void 0:e.getView();if(e)return e=e["markState"],t=Array.from(e.keys()).find(t=>t.key===this.attr("key")),e.get(t)}getScale(){var t=null==(t=this.getRoot())?void 0:t.getView();return!t||null==t?void 0:t.scale}getScaleByChannel(t){var e=null==(e=this.getRoot())?void 0:e.getView();return!e||null==(e=null==e?void 0:e.scale)?void 0:e[t]}getGroup(){var t=this.attr("key");if(t)return this.getRoot().getContext().canvas.getRoot().getElementById(t)}}a=[{name:"encode",type:"object"},{name:"scale",type:"object"},{name:"data",type:"value"},{name:"transform",type:"array"},{name:"style",type:"object"},{name:"animate",type:"object"},{name:"coordinate",type:"object"},{name:"interaction",type:"object"},{name:"label",type:"array",key:"labels"},{name:"axis",type:"object"},{name:"legend",type:"object"},{name:"slider",type:"object"},{name:"scrollbar",type:"object"},{name:"state",type:"object"},{name:"tooltip",type:"mix"}];let g8=class extends p8{constructor(){super({})}},m8=(g8=t([g(a)],g8),class extends p8{constructor(){super({},"interval")}}),y8=(m8=t([g(a)],m8),class extends p8{constructor(){super({},"rect")}}),v8=(y8=t([g(a)],y8),class extends p8{constructor(){super({},"point")}}),b8=(v8=t([g(a)],v8),class extends p8{constructor(){super({},"area")}}),x8=(b8=t([g(a)],b8),class extends p8{constructor(){super({},"line")}}),w8=(x8=t([g(a)],x8),class extends p8{constructor(){super({},"cell")}}),M8=(w8=t([g(a)],w8),class extends p8{constructor(){super({},"vector")}}),O8=(M8=t([g(a)],M8),class extends p8{constructor(){super({},"link")}}),k8=(O8=t([g(a)],O8),class extends p8{constructor(){super({},"polygon")}});k8=t([g(a)],k8);bo=t([g(a)],class extends p8{constructor(){super({},"image")}});let _8=class extends p8{constructor(){super({},"text")}},E8=(_8=t([g(a)],_8),class extends p8{constructor(){super({},"box")}}),S8=(E8=t([g(a)],E8),class extends p8{constructor(){super({},"lineX")}}),A8=(S8=t([g(a)],S8),class extends p8{constructor(){super({},"lineY")}}),L8=(A8=t([g(a)],A8),class extends p8{constructor(){super({},"range")}}),T8=(L8=t([g(a)],L8),class extends p8{constructor(){super({},"rangeX")}}),j8=(T8=t([g(a)],T8),class extends p8{constructor(){super({},"rangeY")}}),N8=(j8=t([g(a)],j8),class extends p8{constructor(){super({},"connector")}}),P8=(N8=t([g(a)],N8),class extends p8{constructor(){super({},"shape")}}),C8=(P8=t([g(a)],P8),class extends p8{constructor(){super({},"sankey")}}),R8=(C8=t([g([...a,{name:"layout",type:"value"}])],C8),class extends p8{constructor(){super({},"treemap")}}),I8=(R8=t([g([...a,{name:"layout",type:"value"}])],R8),class extends p8{constructor(){super({},"boxplot")}}),B8=(I8=t([g(a)],I8),class extends p8{constructor(){super({},"density")}}),F8=(B8=t([g(a)],B8),class extends p8{constructor(){super({},"heatmap")}}),D8=(F8=t([g(a)],F8),class extends p8{constructor(){super({},"path")}}),z8=(D8=t([g(a)],D8),class extends p8{constructor(){super({},"pack")}}),W8=(z8=t([g([...a,{name:"layout",type:"value"}])],z8),class extends p8{constructor(){super({},"forceGraph")}}),G8=(W8=t([g([...a,{name:"layout",type:"value"}])],W8),class extends p8{constructor(){super({},"tree")}}),q8=(G8=t([g([...a,{name:"layout",type:"value"}])],G8),class extends p8{constructor(){super({},"wordCloud")}}),H8=(q8=t([g([...a,{name:"layout",type:"object"}])],q8),class extends p8{constructor(){super({},"gauge")}});H8=t([g(a)],H8);const V8={mark:g8,interval:m8,rect:y8,point:v8,area:b8,line:x8,cell:w8,vector:M8,link:O8,polygon:k8,image:bo,text:_8,box:E8,lineX:S8,lineY:A8,range:L8,rangeX:T8,rangeY:j8,connector:N8,sankey:C8,treemap:R8,boxplot:I8,density:B8,heatmap:F8,path:D8,shape:P8,pack:z8,forceGraph:W8,tree:G8,wordCloud:q8,gauge:H8};class Y8 extends d8{changeData(e){var t,n=this.getRoot();if(n)return this.attr("data",e),null!=(t=this.children)&&t.length&&this.children.forEach(t=>{t.attr("data",e)}),null==n?void 0:n.render()}getView(){var t=this.getRoot().getContext()["views"];if(null!=t&&t.length)return t.find(t=>t.key===this._key)}getScale(){var t;return null==(t=this.getView())?void 0:t.scale}getScaleByChannel(t){var e=this.getScale();if(e)return e[t]}getCoordinate(){var t;return null==(t=this.getView())?void 0:t.coordinate}getTheme(){var t;return null==(t=this.getView())?void 0:t.theme}getGroup(){var t=this._key;if(t)return this.getRoot().getContext().canvas.getRoot().getElementById(t)}show(){var t=this.getGroup();t&&!t.isVisible()&&Hw(t)}hide(){var t=this.getGroup();t&&t.isVisible()&&qw(t)}}let $8=class extends Y8{constructor(t={},e="view"){super(t,e)}},U8=($8=t([g([{type:"value",name:"data"},{type:"value",name:"coordinate"},{type:"object",name:"interaction"},{type:"object",name:"theme"},{type:"object",name:"style"},{type:"object",name:"scale"},{type:"object",name:"axis"},{type:"object",name:"legend"},...f8(V8)])],$8),class extends Y8{constructor(){super({},"spaceLayer")}}),K8=(U8=t([g([{type:"value",name:"data"},...f8(V8)])],U8),class extends Y8{constructor(){super({},"spaceFlex")}}),X8=(K8=t([g([{type:"value",name:"data"},...f8(V8)])],K8),class extends Y8{constructor(){super({},"facetRect")}}),Z8=(X8=t([g([{type:"value",name:"data"},{type:"array",name:"transform"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"legend"},{type:"object",name:"axis"},...f8(V8)])],X8),class extends Y8{constructor(){super({},"facetCircle")}}),Q8=(Z8=t([g([{type:"value",name:"data"},{type:"array",name:"transform"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"legend"},{type:"object",name:"axis"},...f8(V8)])],Z8),class extends Y8{constructor(){super({},"repeatMatrix")}}),J8=(Q8=t([g([{type:"value",name:"data"},{type:"array",name:"transform"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"encode"},{type:"object",name:"legend"},...f8(V8)])],Q8),class extends Y8{constructor(){super({},"timingKeyframe")}}),tA=(J8=t([g([...f8(V8)])],J8),class extends Y8{constructor(){super({},"geoView")}}),eA=(tA=t([g([{type:"value",name:"data"},{type:"value",name:"coordinate"},{type:"object",name:"interaction"},{type:"object",name:"theme"},{type:"object",name:"style"},{type:"object",name:"scale"},{type:"object",name:"legend"},...f8(V8)])],tA),class extends Y8{constructor(){super({},"geoPath")}});eA=t([g([{type:"value",name:"data"},{type:"value",name:"coordinate"},{type:"object",name:"interaction"},{type:"object",name:"theme"},{type:"object",name:"style"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"legend"},{type:"object",name:"state"},...f8(V8)])],eA);const nA={view:$8,spaceLayer:U8,spaceFlex:K8,facetRect:X8,facetCircle:Z8,repeatMatrix:Q8,timingKeyframe:J8,geoView:tA,geoPath:eA};for(const fA of Object.values(nA))g(f8(nA))(fA);const rA=B6();const iA=["width","height","padding","paddingLeft","paddingRight","paddingBottom","paddingTop","inset","insetLeft","insetRight","insetTop","insetBottom","margin","marginLeft","marginRight","marginTop","marginBottom","autoFit","theme","title"];function aA(t){return Object.assign(Object.assign({},t.value),{type:t.type})}function oA(t,e){var n,r=t["autoFit"];return r?(r=e,e=getComputedStyle(r),n=r.clientWidth||ef(e.width),r=r.clientHeight||ef(e.height),{width:n-(ef(e.paddingLeft)+ef(e.paddingRight)),height:r-(ef(e.paddingTop)+ef(e.paddingBottom))}):({width:n=640,height:r=480}=t,{width:n,height:r})}function sA(t){var t=function(t){if(null!==t.type)return t;var e=t.children[t.children.length-1];for(const n of iA)e.attr(n,t.attr(n));return e}(t),e=[t],n=new Map;for(n.set(t,aA(t));e.length;){const t=e.pop();var r=n.get(t),{children:i=[]}=t;for(const s of i){var a=aA(s),{children:o=[]}=r;o.push(a),e.push(s),n.set(s,a),r.children=o}}return n.get(t)}function lA(t,e,n){var t=t["type"],{type:n=n||t}=e;if("view"===n)return e;if("string"!=typeof n)return e;if(t=n,!new Set(Object.keys(V8)).has(t))return e;var r={type:"view"},i=Object.assign({},e);for(const a of iA)void 0!==i[a]&&(r[a]=i[a],delete i[a]);return Object.assign(Object.assign({},r),{children:[i]})}function cA(t){var e=t["type"],t=rt(t,["type","children"]);if("string"==typeof e)return(e=new(function(t){var e=Object.assign(Object.assign({},V8),nA)[t];if(e)return e;throw new Error(`Unknown mark: ${t}.`)}(e))).value=t,e}function uA(t,e,n){for(var r,i,a=[[null,t,lA(t,e,n)]];a.length;){var[o,s,l]=a.shift();if(s)if(l){r=s,g=void 0,g=(i=l).type,i=rt(i,["type","children"]),r.type===g||void 0===g?r.value=it(r.value,i):"string"==typeof g&&(r.type=g,r.value=i);var c=l["children"],u=s["children"];if(Array.isArray(c)&&Array.isArray(u)){var f=Math.max(c.length,u.length);for(let t=0;t({type:"container",name:t,ctor:e})))];m.Chart=class extends $8{constructor(t){var t=t||{},{container:e,canvas:n,renderer:r,plugins:i}=t;super(rt(t,["container","canvas","renderer","plugins"]),"view"),this._hasBindAutoFit=!1,this._rendering=!1,this._trailing=!1,this._trailingResolve=null,this._trailingReject=null,this._previousDefinedType=null,this._onResize=nn(()=>{this.forceFit()},300),this._renderer=r||new _.Renderer,this._plugins=i||[],this._container=void 0===(t=e)?document.createElement("div"):"string"==typeof t?document.getElementById(t):t,this._emitter=new Es,this._context={library:rA,emitter:this._emitter,canvas:n}}render(){if(this._rendering)return this._addToTrailing();this._context.canvas||this._createCanvas(),this._bindAutoFit(),this._rendering=!0;var t=new Promise((t,e)=>o8(this._computedOptions(),this._context,this._createResolve(t),this._createReject(e))),[e,n,r]=function(){let n,r;return[new Promise((t,e)=>{r=t,n=e}),r,n]}();return t.then(n).catch(r).then(()=>this._renderTrailing()),e}options(t){var e;return 0===arguments.length?sA(this):(e=t["type"],e&&(this._previousDefinedType=e),uA(this,t,this._previousDefinedType),this)}getContainer(){return this._container}getContext(){return this._context}on(t,e,n){return this._emitter.on(t,e,n),this}once(t,e){return this._emitter.once(t,e),this}emit(t,...e){return this._emitter.emit(t,...e),this}off(t,e){return this._emitter.off(t,e),this}clear(){this.options();this.emit($.BEFORE_CLEAR),this._reset(),s8(0,this._context,!1),this.emit($.AFTER_CLEAR)}destroy(){var t,e;this.options();this.emit($.BEFORE_DESTROY),this._unbindAutoFit(),this._reset(),s8(0,this._context,!0),t=this._container,(e=t.parentNode)&&e.removeChild(t),this.emit($.AFTER_DESTROY)}forceFit(){this.options.autoFit=!0;var{width:t,height:e}=oA(this.options(),this._container);if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit($.BEFORE_CHANGE_SIZE);t=this.render();return t.then(()=>{this.emit($.AFTER_CHANGE_SIZE)}),t}changeSize(t,e){if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit($.BEFORE_CHANGE_SIZE),this.width(t),this.height(e);t=this.render();return t.then(()=>{this.emit($.AFTER_CHANGE_SIZE)}),t}_reset(){this.type="view",this.value={},this.children=[]}_renderTrailing(){this._trailing&&(this._trailing=!1,this.render().then(()=>{var t=this._trailingResolve.bind(this);this._trailingResolve=null,t(this)}).catch(t=>{var e=this._trailingReject.bind(this);this._trailingReject=null,e(t)}))}_createResolve(t){return()=>{this._rendering=!1,t(this)}}_createReject(e){return t=>{this._rendering=!1,e(t)}}_computedOptions(){var t=this.options(),{key:e="G2_CHART_KEY"}=t,{width:n,height:r}=oA(t,this._container);return this._width=n,this._height=r,this._key=e,Object.assign(Object.assign({key:this._key},t),{width:n,height:r})}_createCanvas(){var{width:t,height:e}=oA(this.options(),this._container);this._plugins.push(new _s),this._plugins.forEach(t=>this._renderer.registerPlugin(t)),this._context.canvas=new nt.Canvas({container:this._container,width:t,height:e,renderer:this._renderer})}_addToTrailing(){null!=(t=this._trailingResolve)&&t.call(this,this),this._trailing=!0;var t=new Promise((t,e)=>{this._trailingResolve=t,this._trailingReject=e});return t}_bindAutoFit(){var t=this.options()["autoFit"];this._hasBindAutoFit?t||this._unbindAutoFit():t&&(this._hasBindAutoFit=!0,window.addEventListener("resize",this._onResize))}_unbindAutoFit(){this._hasBindAutoFit&&(this._hasBindAutoFit=!1,window.removeEventListener("resize",this._onResize))}},m.Chart=t([g(vo)],m.Chart),nt.runtime.enableCSSParsing=!1,m.AREA_CLASS_NAME=ht,m.COMPONENT_CLASS_NAME=ut,m.ChartEvent=$,m.CompositionNode=Y8,m.ELEMENT_CLASS_NAME=lt,m.LABEL_CLASS_NAME=ft,m.LABEL_LAYER_CLASS_NAME=st,m.MAIN_LAYER_CLASS_NAME=E,m.MarkNode=p8,m.PLOT_CLASS_NAME=ct,m.VIEW_CLASS_NAME=U,m.createLibrary=B6,m.register=function(t,e){Object.assign(rA,{[t]:e})},m.render=o8,m.renderToMountedElement=function(t,e={},n=()=>{},r=t=>{throw t}){var{width:i=640,height:a=480}=t,t=a8(t);const{library:o=B6(),group:s=new nt.Group,emitter:l=new Es}=e;null!==s&&void 0!==s&&s.parentElement||Wu("renderToMountedElement can't render chart to unmounted group.");var c=ot(s);return e.group=s,e.library=o,(e.emitter=l).emit($.BEFORE_RENDER),WS(Object.assign(Object.assign({},t),{width:i,height:a}),c,o,e).then(()=>{s.ownerDocument.defaultView.requestAnimationFrame(()=>{l.emit($.AFTER_RENDER),null!=n&&n()})}).catch(t=>{null!=r&&r(t)}),s},Object.defineProperty(m,"__esModule",{value:!0})});