const Jn=Object.freeze(Object.defineProperty({__proto__:null,get Base(){return oe},get Circle(){return uC},get Ellipse(){return fC},get Image(){return pC},get Line(){return dC},get Marker(){return xC},get Path(){return zs},get Polygon(){return EC},get Polyline(){return kC},get Rect(){return OC},get Text(){return RC}},Symbol.toStringTag,{value:"Module"})),ta=Object.freeze(Object.defineProperty({__proto__:null,get Base(){return Jt},get Circle(){return $C},get Dom(){return jC},get Ellipse(){return qC},get Image(){return QC},get Line(){return JC},get Marker(){return e1},get Path(){return i1},get Polygon(){return a1},get Polyline(){return s1},get Rect(){return u1},get Text(){return g1}},Symbol.toStringTag,{value:"Module"}));var fo=function(i,r){return fo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},fo(i,r)};function E(i,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");fo(i,r);function t(){this.constructor=i}i.prototype=r===null?Object.create(r):(t.prototype=r.prototype,new t)}var w=function(){return w=Object.assign||function(r){for(var t,e=1,n=arguments.length;e0&&a[a.length-1])&&(h[0]===6||h[0]===2)){t=0;continue}if(h[0]===3&&(!a||h[1]>a[0]&&h[1]=i.length&&(i=void 0),{value:i&&i[e++],done:!i}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function Y(i,r){var t=typeof Symbol=="function"&&i[Symbol.iterator];if(!t)return i;var e=t.call(i),n,a=[],o;try{for(;(r===void 0||r-- >0)&&!(n=e.next()).done;)a.push(n.value)}catch(s){o={error:s}}finally{try{n&&!n.done&&(t=e.return)&&t.call(e)}finally{if(o)throw o.error}}return a}function Ci(){for(var i=0,r=0,t=arguments.length;r-1:!1},Qt=function(i,r){if(!Wt(i))return i;for(var t=[],e=0;et?t:i},Ra=function(i,r){var t=r.toString(),e=t.indexOf(".");if(e===-1)return Math.round(i);var n=t.substr(e+1).length;return n>20&&(n=20),parseFloat(i.toFixed(n))},U=function(i){return gr(i,"Number")},fp=1e-5;function xt(i,r,t){return t===void 0&&(t=fp),Math.abs(i-r)r?(e&&(clearTimeout(e),e=null),s=u,o=i.apply(n,a),e||(n=a=null)):!e&&t.trailing!==!1&&(e=setTimeout(l,c)),o};return h.cancel=function(){clearTimeout(e),s=0,e=n=a=null},h},Tp=function(i){return Wt(i)?Array.prototype.slice.call(i):[]};var Qi={};const qe=function(i){return i=i||"g",Qi[i]?Qi[i]+=1:Qi[i]=1,i+Qi[i]},Ye=function(){};function Gt(i){return I(i)?0:Wt(i)?i.length:Object.keys(i).length}var Ki;const Ji=ia(function(i,r){r===void 0&&(r={});var t=r.fontSize,e=r.fontFamily,n=r.fontWeight,a=r.fontStyle,o=r.fontVariant;return Ki||(Ki=document.createElement("canvas").getContext("2d")),Ki.font=[a,o,n,t+"px",e].join(" "),Ki.measureText(N(i)?i:"").width},function(i,r){return r===void 0&&(r={}),Ci([i],es(r)).join("")}),Lp=function(i,r,t,e){e===void 0&&(e="...");var n=16,a=Ji(e,t),o=N(i)?i:ra(i),s=r,l=[],h,u;if(Ji(i,t)<=r)return i;for(;h=o.substr(0,n),u=Ji(h,t),!(u+a>s&&u>s);)if(l.push(h),s-=u,o=o.substr(n),!o)return l.join("");for(;h=o.substr(0,1),u=Ji(h,t),!(u+a>s);)if(l.push(h),s-=u,o=o.substr(1),!o)return l.join("");return""+l.join("")+e};var Ep=function(){function i(){this.map={}}return i.prototype.has=function(r){return this.map[r]!==void 0},i.prototype.get=function(r,t){var e=this.map[r];return e===void 0?t:e},i.prototype.set=function(r,t){this.map[r]=t},i.prototype.clear=function(){this.map={}},i.prototype.delete=function(r){delete this.map[r]},i.prototype.size=function(){return Object.keys(this.map).length},i}(),st;(function(i){i.FORE="fore",i.MID="mid",i.BG="bg"})(st||(st={}));var F;(function(i){i.TOP="top",i.TOP_LEFT="top-left",i.TOP_RIGHT="top-right",i.RIGHT="right",i.RIGHT_TOP="right-top",i.RIGHT_BOTTOM="right-bottom",i.LEFT="left",i.LEFT_TOP="left-top",i.LEFT_BOTTOM="left-bottom",i.BOTTOM="bottom",i.BOTTOM_LEFT="bottom-left",i.BOTTOM_RIGHT="bottom-right",i.RADIUS="radius",i.CIRCLE="circle",i.NONE="none"})(F||(F={}));var dt;(function(i){i.AXIS="axis",i.GRID="grid",i.LEGEND="legend",i.TOOLTIP="tooltip",i.ANNOTATION="annotation",i.SLIDER="slider",i.SCROLLBAR="scrollbar",i.OTHER="other"})(dt||(dt={}));var Br={FORE:3,MID:2,BG:1},tt;(function(i){i.BEFORE_RENDER="beforerender",i.AFTER_RENDER="afterrender",i.BEFORE_PAINT="beforepaint",i.AFTER_PAINT="afterpaint",i.BEFORE_CHANGE_DATA="beforechangedata",i.AFTER_CHANGE_DATA="afterchangedata",i.BEFORE_CLEAR="beforeclear",i.AFTER_CLEAR="afterclear",i.BEFORE_DESTROY="beforedestroy",i.BEFORE_CHANGE_SIZE="beforechangesize",i.AFTER_CHANGE_SIZE="afterchangesize"})(tt||(tt={}));var Ne;(function(i){i.BEFORE_DRAW_ANIMATE="beforeanimate",i.AFTER_DRAW_ANIMATE="afteranimate",i.BEFORE_RENDER_LABEL="beforerenderlabel",i.AFTER_RENDER_LABEL="afterrenderlabel"})(Ne||(Ne={}));var It;(function(i){i.MOUSE_ENTER="plot:mouseenter",i.MOUSE_DOWN="plot:mousedown",i.MOUSE_MOVE="plot:mousemove",i.MOUSE_UP="plot:mouseup",i.MOUSE_LEAVE="plot:mouseleave",i.TOUCH_START="plot:touchstart",i.TOUCH_MOVE="plot:touchmove",i.TOUCH_END="plot:touchend",i.TOUCH_CANCEL="plot:touchcancel",i.CLICK="plot:click",i.DBLCLICK="plot:dblclick",i.CONTEXTMENU="plot:contextmenu",i.LEAVE="plot:leave",i.ENTER="plot:enter"})(It||(It={}));var Pn;(function(i){i.ACTIVE="active",i.INACTIVE="inactive",i.SELECTED="selected",i.DEFAULT="default"})(Pn||(Pn={}));var Ar=["color","shape","size"],Z="_origin",sl=1,ll=1,hl=.25,ju={};function Bp(i){var r=ju[i];if(!r)throw new Error("G engine '".concat(i,"' is not exist, please register it at first."));return r}function Uu(i,r){ju[i]=r}function xr(i,r,t){if(i){if(typeof i.addEventListener=="function")return i.addEventListener(r,t,!1),{remove:function(){i.removeEventListener(r,t,!1)}};if(typeof i.attachEvent=="function")return i.attachEvent("on"+r,t),{remove:function(){i.detachEvent("on"+r,t)}}}}var ai,Ga,qu,po;function kp(){ai=document.createElement("table"),Ga=document.createElement("tr"),qu=/^\s*<(\w+|!)[^>]*>/,po={tr:document.createElement("tbody"),tbody:ai,thead:ai,tfoot:ai,td:Ga,th:Ga,"*":document.createElement("div")}}function Xe(i){ai||kp();var r=qu.test(i)&&RegExp.$1;(!r||!(r in po))&&(r="*");var t=po[r];i=typeof i=="string"?i.replace(/(^\s*)|(\s*$)/g,""):i,t.innerHTML=""+i;var e=t.childNodes[0];return e&&t.contains(e)&&t.removeChild(e),e}function Rt(i,r,t){var e;try{e=window.getComputedStyle?window.getComputedStyle(i,null)[r]:i.style[r]}catch{}finally{e=e===void 0?t:e}return e}function Ip(i,r){var t=Rt(i,"height",r);return t==="auto"&&(t=i.offsetHeight),parseFloat(t)}function Pp(i,r){var t=Ip(i,r),e=parseFloat(Rt(i,"borderTopWidth"))||0,n=parseFloat(Rt(i,"paddingTop"))||0,a=parseFloat(Rt(i,"paddingBottom"))||0,o=parseFloat(Rt(i,"borderBottomWidth"))||0,s=parseFloat(Rt(i,"marginTop"))||0,l=parseFloat(Rt(i,"marginBottom"))||0;return t+e+o+n+a+s+l}function Fp(i,r){var t=Rt(i,"width",r);return t==="auto"&&(t=i.offsetWidth),parseFloat(t)}function Op(i,r){var t=Fp(i,r),e=parseFloat(Rt(i,"borderLeftWidth"))||0,n=parseFloat(Rt(i,"paddingLeft"))||0,a=parseFloat(Rt(i,"paddingRight"))||0,o=parseFloat(Rt(i,"borderRightWidth"))||0,s=parseFloat(Rt(i,"marginRight"))||0,l=parseFloat(Rt(i,"marginLeft"))||0;return t+e+o+n+a+l+s}function bt(i,r){if(i)for(var t in r)r.hasOwnProperty(t)&&(i.style[t]=r[t]);return i}function Dp(i){var r=getComputedStyle(i);return{width:(i.clientWidth||parseInt(r.width,10))-parseInt(r.paddingLeft,10)-parseInt(r.paddingRight,10),height:(i.clientHeight||parseInt(r.height,10))-parseInt(r.paddingTop,10)-parseInt(r.paddingBottom,10)}}function ul(i){return typeof i=="number"&&!isNaN(i)}function cl(i,r,t,e){var n=t,a=e;if(r){var o=Dp(i);n=o.width?o.width:n,a=o.height?o.height:a}return{width:Math.max(ul(n)?n:sl,sl),height:Math.max(ul(a)?a:ll,ll)}}function Rp(i){var r=i.parentNode;r&&r.removeChild(i)}var Yp="*",Zu=function(){function i(){this._events={}}return i.prototype.on=function(r,t,e){return this._events[r]||(this._events[r]=[]),this._events[r].push({callback:t,once:!!e}),this},i.prototype.once=function(r,t){return this.on(r,t,!0)},i.prototype.emit=function(r){for(var t=this,e=[],n=1;n2&&(t.push([n].concat(o.splice(0,2))),s="l",n=n==="m"?"l":"L"),s==="o"&&o.length===1&&t.push([n,o[0]]),s==="r")t.push([n].concat(o));else for(;o.length>=r[s]&&(t.push([n].concat(o.splice(0,r[s]))),!!r[s]););return i}),t},go=function(i,r){for(var t=[],e=0,n=i.length;n-2*!r>e;e+=2){var a=[{x:+i[e-2],y:+i[e-1]},{x:+i[e],y:+i[e+1]},{x:+i[e+2],y:+i[e+3]},{x:+i[e+4],y:+i[e+5]}];r?e?n-4===e?a[3]={x:+i[0],y:+i[1]}:n-2===e&&(a[2]={x:+i[0],y:+i[1]},a[3]={x:+i[2],y:+i[3]}):a[0]={x:+i[n-2],y:+i[n-1]}:n-4===e?a[3]=a[2]:e||(a[0]={x:+i[e],y:+i[e+1]}),t.push(["C",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return t},tn=function(i,r,t,e,n){var a=[];if(n===null&&e===null&&(e=t),i=+i,r=+r,t=+t,e=+e,n!==null){var o=Math.PI/180,s=i+t*Math.cos(-e*o),l=i+t*Math.cos(-n*o),h=r+t*Math.sin(-e*o),u=r+t*Math.sin(-n*o);a=[["M",s,h],["A",t,t,0,+(n-e>180),0,l,u]]}else a=[["M",i,r],["m",0,-e],["a",t,e,0,1,1,0,2*e],["a",t,e,0,1,1,0,-2*e],["z"]];return a},yo=function(i){if(i=Tr(i),!i||!i.length)return[["M",0,0]];var r=[],t=0,e=0,n=0,a=0,o=0,s,l;i[0][0]==="M"&&(t=+i[0][1],e=+i[0][2],n=t,a=e,o++,r[0]=["M",t,e]);for(var h=i.length===3&&i[0][0]==="M"&&i[1][0].toUpperCase()==="R"&&i[2][0].toUpperCase()==="Z",u=void 0,c=void 0,f=o,v=i.length;f1&&(S=Math.sqrt(S),t=S*t,e=S*e);var b=t*t,A=e*e,L=(a===o?-1:1)*Math.sqrt(Math.abs((b*A-b*x*x-A*m*m)/(b*x*x+A*m*m)));d=L*t*x/e+(i+s)/2,y=L*-e*m/t+(r+l)/2,p=Math.asin(((r-y)/e).toFixed(9)),g=Math.asin(((l-y)/e).toFixed(9)),p=ig&&(p=p-Math.PI*2),!o&&g>p&&(g=g-Math.PI*2)}var k=g-p;if(Math.abs(k)>u){var B=g,O=s,R=l;g=p+u*(o&&g>p?1:-1),s=d+t*Math.cos(g),l=y+e*Math.sin(g),f=Qu(s,l,t,e,n,0,o,O,R,[g,B,d,y])}k=g-p;var H=Math.cos(p),z=Math.sin(p),_=Math.cos(g),K=Math.sin(g),nt=Math.tan(k/4),ht=4/3*t*nt,Q=4/3*e*nt,ut=[i,r],vt=[i+ht*z,r-Q*H],te=[s+ht*K,l-Q*_],mr=[s,l];if(vt[0]=2*ut[0]-vt[0],vt[1]=2*ut[1]-vt[1],h)return[vt,te,mr].concat(f);f=[vt,te,mr].concat(f).join().split(",");for(var qi=[],ee=0,Ur=f.length;ee7){m[x].shift();for(var S=m[x];S.length;)o[x]="A",e&&(s[x]="A"),m.splice(x++,0,["C"].concat(S.splice(0,6)));m.splice(x,1),u=Math.max(t.length,e&&e.length||0)}},v=function(m,x,S,b,A){m&&x&&m[A][0]==="M"&&x[A][0]!=="M"&&(x.splice(A,0,["M",b.x,b.y]),S.bx=0,S.by=0,S.x=m[A][1],S.y=m[A][2],u=Math.max(t.length,e&&e.length||0))};u=Math.max(t.length,e&&e.length||0);for(var p=0;p1?1:l<0?0:l;for(var h=l/2,u=12,c=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],f=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],v=0,p=0;p0&&v<1&&l.push(v);continue}var g=c*c-4*f*u,d=Math.sqrt(g);if(!(g<0)){var y=(-c+d)/(2*u);y>0&&y<1&&l.push(y);var C=(-c-d)/(2*u);C>0&&C<1&&l.push(C)}}for(var m=l.length,x=m,S;m--;)v=l[m],S=1-v,h[0][m]=S*S*S*i+3*S*S*v*t+3*S*v*v*n+v*v*v*o,h[1][m]=S*S*S*r+3*S*S*v*e+3*S*v*v*a+v*v*v*s;return h[0][x]=i,h[1][x]=r,h[0][x+1]=o,h[1][x+1]=s,h[0].length=h[1].length=x+2,{min:{x:Math.min.apply(0,h[0]),y:Math.min.apply(0,h[1])},max:{x:Math.max.apply(0,h[0]),y:Math.max.apply(0,h[1])}}},Xp=function(i,r,t,e,n,a,o,s){if(!(Math.max(i,t)Math.max(n,o)||Math.max(r,e)Math.max(a,s))){var l=(i*e-r*t)*(n-o)-(i-t)*(n*s-a*o),h=(i*e-r*t)*(a-s)-(r-e)*(n*s-a*o),u=(i-t)*(a-s)-(r-e)*(n-o);if(!!u){var c=l/u,f=h/u,v=+c.toFixed(2),p=+f.toFixed(2);if(!(v<+Math.min(i,t).toFixed(2)||v>+Math.max(i,t).toFixed(2)||v<+Math.min(n,o).toFixed(2)||v>+Math.max(n,o).toFixed(2)||p<+Math.min(r,e).toFixed(2)||p>+Math.max(r,e).toFixed(2)||p<+Math.min(a,s).toFixed(2)||p>+Math.max(a,s).toFixed(2)))return{x:c,y:f}}}},Ee=function(i,r,t){return r>=i.x&&r<=i.x+i.width&&t>=i.y&&t<=i.y+i.height},Ju=function(i,r,t,e,n){if(n)return[["M",+i+ +n,r],["l",t-n*2,0],["a",n,n,0,0,1,n,n],["l",0,e-n*2],["a",n,n,0,0,1,-n,n],["l",n*2-t,0],["a",n,n,0,0,1,-n,-n],["l",0,n*2-e],["a",n,n,0,0,1,n,-n],["z"]];var a=[["M",i,r],["l",t,0],["l",0,e],["l",-t,0],["z"]];return a.parsePathArray=Ku,a},xo=function(i,r,t,e){return i===null&&(i=r=t=e=0),r===null&&(r=i.y,t=i.width,e=i.height,i=i.x),{x:i,y:r,width:t,w:t,height:e,h:e,x2:i+t,y2:r+e,cx:i+t/2,cy:r+e/2,r1:Math.min(t,e)/2,r2:Math.max(t,e)/2,r0:Math.sqrt(t*t+e*e)/2,path:Ju(i,r,t,e),vb:[i,r,t,e].join(" ")}},zp=function(i,r){return i=xo(i),r=xo(r),Ee(r,i.x,i.y)||Ee(r,i.x2,i.y)||Ee(r,i.x,i.y2)||Ee(r,i.x2,i.y2)||Ee(i,r.x,r.y)||Ee(i,r.x2,r.y)||Ee(i,r.x,r.y2)||Ee(i,r.x2,r.y2)||(i.xr.x||r.xi.x)&&(i.yr.y||r.yi.y)},gl=function(i,r,t,e,n,a,o,s){P(i)||(i=[i,r,t,e,n,a,o,s]);var l=Np.apply(null,i);return xo(l.min.x,l.min.y,l.max.x-l.min.x,l.max.y-l.min.y)},dl=function(i,r,t,e,n,a,o,s,l){var h=1-l,u=Math.pow(h,3),c=Math.pow(h,2),f=l*l,v=f*l,p=u*i+c*3*l*t+h*3*l*l*n+v*o,g=u*r+c*3*l*e+h*3*l*l*a+v*s,d=i+2*l*(t-i)+f*(n-2*t+i),y=r+2*l*(e-r)+f*(a-2*e+r),C=t+2*l*(n-t)+f*(o-2*n+t),m=e+2*l*(a-e)+f*(s-2*a+e),x=h*i+l*t,S=h*r+l*e,b=h*n+l*o,A=h*a+l*s,L=90-Math.atan2(d-C,y-m)*180/Math.PI;return{x:p,y:g,m:{x:d,y},n:{x:C,y:m},start:{x,y:S},end:{x:b,y:A},alpha:L}},Wp=function(i,r,t){var e=gl(i),n=gl(r);if(!zp(e,n))return t?0:[];for(var a=pl.apply(0,i),o=pl.apply(0,r),s=~~(a/8),l=~~(o/8),h=[],u=[],c={},f=t?0:[],v=0;v=0&&A<=1&&L>=0&&L<=1&&(t?f+=1:f.push({x:b.x,y:b.y,t1:A,t2:L}))}}return f},$p=function(i,r,t){i=mo(i),r=mo(r);for(var e,n,a,o,s,l,h,u,c,f,v=t?0:[],p=0,g=i.length;p=3&&(c.length===3&&f.push("Q"),f=f.concat(c[1])),c.length===2&&f.push("L"),f=f.concat(c[c.length-1]),f});return u}var qp=function(i,r,t){if(t===1)return[[].concat(i)];var e=[];if(r[0]==="L"||r[0]==="C"||r[0]==="Q")e=e.concat(Up(i,r,t));else{var n=[].concat(i);n[0]==="M"&&(n[0]="L");for(var a=0;a<=t-1;a++)e.push(n)}return e},Zp=function(i,r){if(i.length===1)return i;var t=i.length-1,e=r.length-1,n=t/e,a=[];if(i.length===1&&i[0][0]==="M"){for(var o=0;o=0;l--)o=a[l].index,a[l].type==="add"?i.splice(o,0,[].concat(i[o])):i.splice(o,1)}e=i.length;var c=n-e;if(e0)t=Ha(t,i[e-1],1);else{i[e]=r[e];break}i[e]=["Q"].concat(t.reduce(function(n,a){return n.concat(a)},[]));break;case"T":i[e]=["T"].concat(t[0]);break;case"C":if(t.length<3)if(e>0)t=Ha(t,i[e-1],2);else{i[e]=r[e];break}i[e]=["C"].concat(t.reduce(function(n,a){return n.concat(a)},[]));break;case"S":if(t.length<2)if(e>0)t=Ha(t,i[e-1],1);else{i[e]=r[e];break}i[e]=["S"].concat(t.reduce(function(n,a){return n.concat(a)},[]));break;default:i[e]=r[e]}return i};const as=Object.freeze(Object.defineProperty({__proto__:null,catmullRomToBezier:go,fillPath:Zp,fillPathByDiff:tc,formatPath:wo,intersection:_p,parsePathArray:Ku,parsePathString:Tr,pathToAbsolute:yo,pathToCurve:mo,rectPath:Ju},Symbol.toStringTag,{value:"Module"}));var Ni=function(){function i(r,t){this.bubbles=!0,this.target=null,this.currentTarget=null,this.delegateTarget=null,this.delegateObject=null,this.defaultPrevented=!1,this.propagationStopped=!1,this.shape=null,this.fromShape=null,this.toShape=null,this.propagationPath=[],this.type=r,this.name=r,this.originalEvent=t,this.timeStamp=t.timeStamp}return i.prototype.preventDefault=function(){this.defaultPrevented=!0,this.originalEvent.preventDefault&&this.originalEvent.preventDefault()},i.prototype.stopPropagation=function(){this.propagationStopped=!0},i.prototype.toString=function(){var r=this.type;return"[Event (type="+r+")]"},i.prototype.save=function(){},i.prototype.restore=function(){},i}();function rc(i,r){var t=i.indexOf(r);t!==-1&&i.splice(t,1)}var yl=typeof window<"u"&&typeof window.document<"u";function ic(i,r){if(i.isCanvas())return!0;for(var t=r.getParent(),e=!1;t;){if(t===i){e=!0;break}t=t.getParent()}return e}function Si(i){return i.cfg.visible&&i.cfg.capture}var na=function(i){E(r,i);function r(t){var e=i.call(this)||this;e.destroyed=!1;var n=e.getDefaultCfg();return e.cfg=ot(n,t),e}return r.prototype.getDefaultCfg=function(){return{}},r.prototype.get=function(t){return this.cfg[t]},r.prototype.set=function(t,e){this.cfg[t]=e},r.prototype.destroy=function(){this.cfg={destroyed:!0},this.off(),this.destroyed=!0},r}(Zu),ml=globalThis&&globalThis.__spreadArray||function(i,r,t){if(t||arguments.length===2)for(var e=0,n=r.length,a;e"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new ng:typeof navigator<"u"?Cl(navigator.userAgent):ug()}function lg(i){return i!==""&&sg.reduce(function(r,t){var e=t[0],n=t[1];if(r)return r;var a=n.exec(i);return!!a&&[e,a]},!1)}function Cl(i){var r=lg(i);if(!r)return null;var t=r[0],e=r[1];if(t==="searchbot")return new ig;var n=e[1]&&e[1].split(".").join("_").split("_").slice(0,3);n?n.length0&&(n=1/Math.sqrt(n)),i[0]=r[0]*n,i[1]=r[1]*n,i}function mg(i,r){return i[0]*r[0]+i[1]*r[1]}function xg(i,r,t){var e=r[0],n=r[1];return i[0]=t[0]*e+t[3]*n+t[6],i[1]=t[1]*e+t[4]*n+t[7],i}function Co(i,r){var t=i[0],e=i[1],n=r[0],a=r[1],o=Math.sqrt(t*t+e*e)*Math.sqrt(n*n+a*a),s=o&&(t*n+e*a)/o;return Math.acos(Math.min(Math.max(s,-1),1))}function wg(i,r){return i[0]===r[0]&&i[1]===r[1]}var kr=ac;(function(){var i=yg();return function(r,t,e,n,a,o){var s,l;for(t||(t=2),e||(e=0),n?l=Math.min(n*t+e,r.length):l=r.length,s=e;s=0;return t?n?Math.PI*2-e:e:n?e:Math.PI*2-e}function Ml(i,r){var t=[],e=i[0],n=i[1],a=i[2],o=i[3],s=i[4],l=i[5],h=i[6],u=i[7],c=i[8],f=r[0],v=r[1],p=r[2],g=r[3],d=r[4],y=r[5],C=r[6],m=r[7],x=r[8];return t[0]=f*e+v*o+p*h,t[1]=f*n+v*s+p*u,t[2]=f*a+v*l+p*c,t[3]=g*e+d*o+y*h,t[4]=g*n+d*s+y*u,t[5]=g*a+d*l+y*c,t[6]=C*e+m*o+x*h,t[7]=C*n+m*s+x*u,t[8]=C*a+m*l+x*c,t}function xe(i,r){var t=[],e=r[0],n=r[1];return t[0]=i[0]*e+i[3]*n+i[6],t[1]=i[1]*e+i[4]*n+i[7],t}function oa(i){var r=[],t=i[0],e=i[1],n=i[2],a=i[3],o=i[4],s=i[5],l=i[6],h=i[7],u=i[8],c=u*o-s*h,f=-u*a+s*l,v=h*a-o*l,p=t*c+e*f+n*v;return p?(p=1/p,r[0]=c*p,r[1]=(-u*e+n*h)*p,r[2]=(s*e-n*o)*p,r[3]=f*p,r[4]=(u*t-n*l)*p,r[5]=(-s*t+n*a)*p,r[6]=v*p,r[7]=(-h*t+e*l)*p,r[8]=(o*t-e*a)*p,r):null}var Kr=ct,Va="matrix",Sg=["zIndex","capture","visible","type"],bg=["repeat"],Ag=":",Tg="*";function Lg(i){for(var r=[],t=0;to.delay&&M(r.toAttrs,function(s,l){a.call(o.toAttrs,l)&&(delete o.toAttrs[l],delete o.fromAttrs[l])})}),i}var lc=function(i){E(r,i);function r(t){var e=i.call(this,t)||this;e.attrs={};var n=e.getDefaultAttrs();return ot(n,t.attrs),e.attrs=n,e.initAttrs(n),e.initAnimate(),e}return r.prototype.getDefaultCfg=function(){return{visible:!0,capture:!0,zIndex:0}},r.prototype.getDefaultAttrs=function(){return{matrix:this.getDefaultMatrix(),opacity:1}},r.prototype.onCanvasChange=function(t){},r.prototype.initAttrs=function(t){},r.prototype.initAnimate=function(){this.set("animable",!0),this.set("animating",!1)},r.prototype.isGroup=function(){return!1},r.prototype.getParent=function(){return this.get("parent")},r.prototype.getCanvas=function(){return this.get("canvas")},r.prototype.attr=function(){for(var t,e=[],n=0;n0?a=kg(a,x):n.addAnimator(this),a.push(x),this.set("animations",a),this.set("_pause",{isPaused:!1})}},r.prototype.stopAnimate=function(t){var e=this;t===void 0&&(t=!0);var n=this.get("animations");M(n,function(a){t&&(a.onFrame?e.attr(a.onFrame(1)):e.attr(a.toAttrs)),a.callback&&a.callback()}),this.set("animating",!1),this.set("animations",[])},r.prototype.pauseAnimate=function(){var t=this.get("timeline"),e=this.get("animations"),n=t.getTime();return M(e,function(a){a._paused=!0,a._pauseTime=n,a.pauseCallback&&a.pauseCallback()}),this.set("_pause",{isPaused:!0,pauseTime:n}),this},r.prototype.resumeAnimate=function(){var t=this.get("timeline"),e=t.getTime(),n=this.get("animations"),a=this.get("_pause").pauseTime;return M(n,function(o){o.startTime=o.startTime+(e-a),o._paused=!1,o._pauseTime=null,o.resumeCallback&&o.resumeCallback()}),this.set("_pause",{isPaused:!1}),this.set("animations",n),this},r.prototype.emitDelegation=function(t,e){var n=this,a=e.propagationPath;this.getEvents();var o;t==="mouseenter"?o=e.fromShape:t==="mouseleave"&&(o=e.toShape);for(var s=function(c){var f=a[c],v=f.get("name");if(v){if((f.isGroup()||f.isCanvas&&f.isCanvas())&&o&&ic(f,o))return"break";P(v)?M(v,function(p){n.emitDelegateEvent(f,p,e)}):l.emitDelegateEvent(f,v,e)}},l=this,h=0;h0)});l.length>0?(M(l,function(u){var c=u.getBBox();o.push(c.minX,c.maxX),s.push(c.minY,c.maxY)}),t=Yt(o),e=Lt(o),n=Yt(s),a=Lt(s)):(t=0,e=0,n=0,a=0);var h={x:t,y:n,minX:t,minY:n,maxX:e,maxY:a,width:e-t,height:a-n};return h},r.prototype.getCanvasBBox=function(){var t=1/0,e=-1/0,n=1/0,a=-1/0,o=[],s=[],l=this.getChildren().filter(function(u){return u.get("visible")&&(!u.isGroup()||u.isGroup()&&u.getChildren().length>0)});l.length>0?(M(l,function(u){var c=u.getCanvasBBox();o.push(c.minX,c.maxX),s.push(c.minY,c.maxY)}),t=Yt(o),e=Lt(o),n=Yt(s),a=Lt(s)):(t=0,e=0,n=0,a=0);var h={x:t,y:n,minX:t,minY:n,maxX:e,maxY:a,width:e-t,height:a-n};return h},r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return t.children=[],t},r.prototype.onAttrChange=function(t,e,n){if(i.prototype.onAttrChange.call(this,t,e,n),t==="matrix"){var a=this.getTotalMatrix();this._applyChildrenMarix(a)}},r.prototype.applyMatrix=function(t){var e=this.getTotalMatrix();i.prototype.applyMatrix.call(this,t);var n=this.getTotalMatrix();n!==e&&this._applyChildrenMarix(n)},r.prototype._applyChildrenMarix=function(t){var e=this.getChildren();M(e,function(n){n.applyMatrix(t)})},r.prototype.addShape=function(){for(var t=[],e=0;e=0;s--){var l=t[s];if(Si(l)&&(l.isGroup()?o=l.getShape(e,n,a):l.isHit(e,n)&&(o=l)),o)break}return o},r.prototype.add=function(t){var e=this.getCanvas(),n=this.getChildren(),a=this.get("timeline"),o=t.getParent();o&&Ig(o,t,!1),t.set("parent",this),e&&hc(t,e),a&&uc(t,a),n.push(t),t.onCanvasChange("add"),this._applyElementMatrix(t)},r.prototype._applyElementMatrix=function(t){var e=this.getTotalMatrix();e&&t.applyMatrix(e)},r.prototype.getChildren=function(){return this.get("children")},r.prototype.sort=function(){var t=this.getChildren();M(t,function(e,n){return e[Mo]=n,e}),t.sort(Pg(function(e,n){return e.get("zIndex")-n.get("zIndex")})),this.onCanvasChange("sort")},r.prototype.clear=function(){if(this.set("clearing",!0),!this.destroyed){for(var t=this.getChildren(),e=t.length-1;e>=0;e--)t[e].destroy();this.set("children",[]),this.onCanvasChange("clear"),this.set("clearing",!1)}},r.prototype.destroy=function(){this.get("destroyed")||(this.clear(),i.prototype.destroy.call(this))},r.prototype.getFirst=function(){return this.getChildByIndex(0)},r.prototype.getLast=function(){var t=this.getChildren();return this.getChildByIndex(t.length-1)},r.prototype.getChildByIndex=function(t){var e=this.getChildren();return e[t]},r.prototype.getCount=function(){var t=this.getChildren();return t.length},r.prototype.contain=function(t){var e=this.getChildren();return e.indexOf(t)>-1},r.prototype.removeChild=function(t,e){e===void 0&&(e=!0),this.contain(t)&&t.remove(e)},r.prototype.findAll=function(t){var e=[],n=this.getChildren();return M(n,function(a){t(a)&&e.push(a),a.isGroup()&&(e=e.concat(a.findAll(t)))}),e},r.prototype.find=function(t){var e=null,n=this.getChildren();return M(n,function(a){if(t(a)?e=a:a.isGroup()&&(e=a.find(t)),e)return!1}),e},r.prototype.findById=function(t){return this.find(function(e){return e.get("id")===t})},r.prototype.findByClassName=function(t){return this.find(function(e){return e.get("className")===t})},r.prototype.findAllByName=function(t){return this.findAll(function(e){return e.get("name")===t})},r}(lc),Dr=0,oi=0,Jr=0,fc=1e3,Dn,si,Rn=0,fr=0,sa=0,Ai=typeof performance=="object"&&performance.now?performance:Date,vc=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(i){setTimeout(i,17)};function pc(){return fr||(vc(Fg),fr=Ai.now()+sa)}function Fg(){fr=0}function So(){this._call=this._time=this._next=null}So.prototype=gc.prototype={constructor:So,restart:function(i,r,t){if(typeof i!="function")throw new TypeError("callback is not a function");t=(t==null?pc():+t)+(r==null?0:+r),!this._next&&si!==this&&(si?si._next=this:Dn=this,si=this),this._call=i,this._time=t,bo()},stop:function(){this._call&&(this._call=null,this._time=1/0,bo())}};function gc(i,r,t){var e=new So;return e.restart(i,r,t),e}function Og(){pc(),++Dr;for(var i=Dn,r;i;)(r=fr-i._time)>=0&&i._call.call(null,r),i=i._next;--Dr}function bl(){fr=(Rn=Ai.now())+sa,Dr=oi=0;try{Og()}finally{Dr=0,Rg(),fr=0}}function Dg(){var i=Ai.now(),r=i-Rn;r>fc&&(sa-=r,Rn=i)}function Rg(){for(var i,r=Dn,t,e=1/0;r;)r._call?(e>r._time&&(e=r._time),i=r,r=r._next):(t=r._next,r._next=null,r=i?i._next=t:Dn=t);si=i,bo(e)}function bo(i){if(!Dr){oi&&(oi=clearTimeout(oi));var r=i-fr;r>24?(i<1/0&&(oi=setTimeout(bl,i-Ai.now()-sa)),Jr&&(Jr=clearInterval(Jr))):(Jr||(Rn=Ai.now(),Jr=setInterval(Dg,fc)),Dr=1,vc(bl))}}function ls(i,r,t){i.prototype=r.prototype=t,t.constructor=i}function dc(i,r){var t=Object.create(i.prototype);for(var e in r)t[e]=r[e];return t}function Xi(){}var Ti=.7,Yn=1/Ti,Ir="\\s*([+-]?\\d+)\\s*",Li="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",fe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Yg=/^#([0-9a-f]{3,8})$/,Gg=new RegExp(`^rgb\\(${Ir},${Ir},${Ir}\\)$`),Hg=new RegExp(`^rgb\\(${fe},${fe},${fe}\\)$`),Vg=new RegExp(`^rgba\\(${Ir},${Ir},${Ir},${Li}\\)$`),Ng=new RegExp(`^rgba\\(${fe},${fe},${fe},${Li}\\)$`),Xg=new RegExp(`^hsl\\(${Li},${fe},${fe}\\)$`),zg=new RegExp(`^hsla\\(${Li},${fe},${fe},${Li}\\)$`),Al={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};ls(Xi,Ei,{copy(i){return Object.assign(new this.constructor,this,i)},displayable(){return this.rgb().displayable()},hex:Tl,formatHex:Tl,formatHex8:Wg,formatHsl:$g,formatRgb:Ll,toString:Ll});function Tl(){return this.rgb().formatHex()}function Wg(){return this.rgb().formatHex8()}function $g(){return yc(this).formatHsl()}function Ll(){return this.rgb().formatRgb()}function Ei(i){var r,t;return i=(i+"").trim().toLowerCase(),(r=Yg.exec(i))?(t=r[1].length,r=parseInt(r[1],16),t===6?El(r):t===3?new Ht(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):t===8?rn(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):t===4?rn(r>>12&15|r>>8&240,r>>8&15|r>>4&240,r>>4&15|r&240,((r&15)<<4|r&15)/255):null):(r=Gg.exec(i))?new Ht(r[1],r[2],r[3],1):(r=Hg.exec(i))?new Ht(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=Vg.exec(i))?rn(r[1],r[2],r[3],r[4]):(r=Ng.exec(i))?rn(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=Xg.exec(i))?Il(r[1],r[2]/100,r[3]/100,1):(r=zg.exec(i))?Il(r[1],r[2]/100,r[3]/100,r[4]):Al.hasOwnProperty(i)?El(Al[i]):i==="transparent"?new Ht(NaN,NaN,NaN,0):null}function El(i){return new Ht(i>>16&255,i>>8&255,i&255,1)}function rn(i,r,t,e){return e<=0&&(i=r=t=NaN),new Ht(i,r,t,e)}function _g(i){return i instanceof Xi||(i=Ei(i)),i?(i=i.rgb(),new Ht(i.r,i.g,i.b,i.opacity)):new Ht}function Ao(i,r,t,e){return arguments.length===1?_g(i):new Ht(i,r,t,e==null?1:e)}function Ht(i,r,t,e){this.r=+i,this.g=+r,this.b=+t,this.opacity=+e}ls(Ht,Ao,dc(Xi,{brighter(i){return i=i==null?Yn:Math.pow(Yn,i),new Ht(this.r*i,this.g*i,this.b*i,this.opacity)},darker(i){return i=i==null?Ti:Math.pow(Ti,i),new Ht(this.r*i,this.g*i,this.b*i,this.opacity)},rgb(){return this},clamp(){return new Ht(or(this.r),or(this.g),or(this.b),Gn(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Bl,formatHex:Bl,formatHex8:jg,formatRgb:kl,toString:kl}));function Bl(){return`#${ir(this.r)}${ir(this.g)}${ir(this.b)}`}function jg(){return`#${ir(this.r)}${ir(this.g)}${ir(this.b)}${ir((isNaN(this.opacity)?1:this.opacity)*255)}`}function kl(){const i=Gn(this.opacity);return`${i===1?"rgb(":"rgba("}${or(this.r)}, ${or(this.g)}, ${or(this.b)}${i===1?")":`, ${i})`}`}function Gn(i){return isNaN(i)?1:Math.max(0,Math.min(1,i))}function or(i){return Math.max(0,Math.min(255,Math.round(i)||0))}function ir(i){return i=or(i),(i<16?"0":"")+i.toString(16)}function Il(i,r,t,e){return e<=0?i=r=t=NaN:t<=0||t>=1?i=r=NaN:r<=0&&(i=NaN),new ne(i,r,t,e)}function yc(i){if(i instanceof ne)return new ne(i.h,i.s,i.l,i.opacity);if(i instanceof Xi||(i=Ei(i)),!i)return new ne;if(i instanceof ne)return i;i=i.rgb();var r=i.r/255,t=i.g/255,e=i.b/255,n=Math.min(r,t,e),a=Math.max(r,t,e),o=NaN,s=a-n,l=(a+n)/2;return s?(r===a?o=(t-e)/s+(t0&&l<1?0:o,new ne(o,s,l,i.opacity)}function Ug(i,r,t,e){return arguments.length===1?yc(i):new ne(i,r,t,e==null?1:e)}function ne(i,r,t,e){this.h=+i,this.s=+r,this.l=+t,this.opacity=+e}ls(ne,Ug,dc(Xi,{brighter(i){return i=i==null?Yn:Math.pow(Yn,i),new ne(this.h,this.s,this.l*i,this.opacity)},darker(i){return i=i==null?Ti:Math.pow(Ti,i),new ne(this.h,this.s,this.l*i,this.opacity)},rgb(){var i=this.h%360+(this.h<0)*360,r=isNaN(i)||isNaN(this.s)?0:this.s,t=this.l,e=t+(t<.5?t:1-t)*r,n=2*t-e;return new Ht(Na(i>=240?i-240:i+120,n,e),Na(i,n,e),Na(i<120?i+240:i-120,n,e),this.opacity)},clamp(){return new ne(Pl(this.h),nn(this.s),nn(this.l),Gn(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const i=Gn(this.opacity);return`${i===1?"hsl(":"hsla("}${Pl(this.h)}, ${nn(this.s)*100}%, ${nn(this.l)*100}%${i===1?")":`, ${i})`}`}}));function Pl(i){return i=(i||0)%360,i<0?i+360:i}function nn(i){return Math.max(0,Math.min(1,i||0))}function Na(i,r,t){return(i<60?r+(t-r)*i/60:i<180?t:i<240?r+(t-r)*(240-i)/60:r)*255}const hs=i=>()=>i;function qg(i,r){return function(t){return i+t*r}}function Zg(i,r,t){return i=Math.pow(i,t),r=Math.pow(r,t)-i,t=1/t,function(e){return Math.pow(i+e*r,t)}}function Qg(i){return(i=+i)==1?mc:function(r,t){return t-r?Zg(r,t,i):hs(isNaN(r)?t:r)}}function mc(i,r){var t=r-i;return t?qg(i,t):hs(isNaN(i)?r:i)}const Fl=function i(r){var t=Qg(r);function e(n,a){var o=t((n=Ao(n)).r,(a=Ao(a)).r),s=t(n.g,a.g),l=t(n.b,a.b),h=mc(n.opacity,a.opacity);return function(u){return n.r=o(u),n.g=s(u),n.b=l(u),n.opacity=h(u),n+""}}return e.gamma=i,e}(1);function xc(i,r){r||(r=[]);var t=i?Math.min(r.length,i.length):0,e=r.slice(),n;return function(a){for(n=0;nt&&(a=r.slice(t,a),s[o]?s[o]+=a:s[++o]=a),(e=e[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:To(e,n)})),t=Xa.lastIndex;return th.length?(l=Tr(a[s]),h=Tr(n[s]),h=tc(h,l),h=wo(h,l),r.fromAttrs.path=h,r.toAttrs.path=l):r.pathFormatted||(l=Tr(a[s]),h=Tr(n[s]),h=wo(h,l),r.fromAttrs.path=h,r.toAttrs.path=l,r.pathFormatted=!0),e[s]=[];for(var u=0;u0){for(var s=r.animators.length-1;s>=0;s--){if(e=r.animators[s],e.destroyed){r.removeAnimator(s);continue}if(!e.isAnimatePaused()){n=e.get("animations");for(var l=n.length-1;l>=0;l--)a=n[l],t=Rd(e,a,o),t&&(n.splice(l,1),t=!1,a.callback&&a.callback())}n.length===0&&r.removeAnimator(s)}var h=r.canvas.get("autoDraw");h||r.canvas.draw()}})},i.prototype.addAnimator=function(r){this.animators.push(r)},i.prototype.removeAnimator=function(r){this.animators.splice(r,1)},i.prototype.isAnimating=function(){return!!this.animators.length},i.prototype.stop=function(){this.timer&&this.timer.stop()},i.prototype.stopAllAnimations=function(r){r===void 0&&(r=!0),this.animators.forEach(function(t){t.stopAnimate(r)}),this.animators=[],this.canvas.draw()},i.prototype.getTime=function(){return this.current},i}(),Gd=40,zl=0,Wl=["mousedown","mouseup","dblclick","mouseout","mouseover","mousemove","mouseleave","mouseenter","touchstart","touchmove","touchend","dragenter","dragover","dragleave","drop","contextmenu","mousewheel"];function $l(i,r,t){t.name=r,t.target=i,t.currentTarget=i,t.delegateTarget=i,i.emit(r,t)}function Hd(i,r,t){if(t.bubbles){var e=void 0,n=!1;if(r==="mouseenter"?(e=t.fromShape,n=!0):r==="mouseleave"&&(n=!0,e=t.toShape),i.isCanvas()&&n)return;if(e&&ic(i,e)){t.bubbles=!1;return}t.name=r,t.currentTarget=i,t.delegateTarget=i,i.emit(r,t)}}var Vd=function(){function i(r){var t=this;this.draggingShape=null,this.dragging=!1,this.currentShape=null,this.mousedownShape=null,this.mousedownPoint=null,this._eventCallback=function(e){var n=e.type;t._triggerEvent(n,e)},this._onDocumentMove=function(e){var n=t.canvas,a=n.get("el");if(a!==e.target&&(t.dragging||t.currentShape)){var o=t._getPointInfo(e);t.dragging&&t._emitEvent("drag",e,o,t.draggingShape)}},this._onDocumentMouseUp=function(e){var n=t.canvas,a=n.get("el");if(a!==e.target&&t.dragging){var o=t._getPointInfo(e);t.draggingShape&&t._emitEvent("drop",e,o,null),t._emitEvent("dragend",e,o,t.draggingShape),t._afterDrag(t.draggingShape,o,e)}},this.canvas=r.canvas}return i.prototype.init=function(){this._bindEvents()},i.prototype._bindEvents=function(){var r=this,t=this.canvas.get("el");M(Wl,function(e){t.addEventListener(e,r._eventCallback)}),document&&(document.addEventListener("mousemove",this._onDocumentMove),document.addEventListener("mouseup",this._onDocumentMouseUp))},i.prototype._clearEvents=function(){var r=this,t=this.canvas.get("el");M(Wl,function(e){t.removeEventListener(e,r._eventCallback)}),document&&(document.removeEventListener("mousemove",this._onDocumentMove),document.removeEventListener("mouseup",this._onDocumentMouseUp))},i.prototype._getEventObj=function(r,t,e,n,a,o){var s=new Ni(r,t);return s.fromShape=a,s.toShape=o,s.x=e.x,s.y=e.y,s.clientX=e.clientX,s.clientY=e.clientY,s.propagationPath.push(n),s},i.prototype._getShape=function(r,t){return this.canvas.getShape(r.x,r.y,t)},i.prototype._getPointInfo=function(r){var t=this.canvas,e=t.getClientByEvent(r),n=t.getPointByEvent(r);return{x:n.x,y:n.y,clientX:e.x,clientY:e.y}},i.prototype._triggerEvent=function(r,t){var e=this._getPointInfo(t),n=this._getShape(e,t),a=this["_on"+r],o=!1;if(a)a.call(this,e,n,t);else{var s=this.currentShape;r==="mouseenter"||r==="dragenter"||r==="mouseover"?(this._emitEvent(r,t,e,null,null,n),n&&this._emitEvent(r,t,e,n,null,n),r==="mouseenter"&&this.draggingShape&&this._emitEvent("dragenter",t,e,null)):r==="mouseleave"||r==="dragleave"||r==="mouseout"?(o=!0,s&&this._emitEvent(r,t,e,s,s,null),this._emitEvent(r,t,e,null,s,null),r==="mouseleave"&&this.draggingShape&&this._emitEvent("dragleave",t,e,null)):this._emitEvent(r,t,e,n,null,null)}if(o||(this.currentShape=n),n&&!n.get("destroyed")){var l=this.canvas,h=l.get("el");h.style.cursor=n.attr("cursor")||l.get("cursor")}},i.prototype._onmousedown=function(r,t,e){e.button===zl&&(this.mousedownShape=t,this.mousedownPoint=r,this.mousedownTimeStamp=e.timeStamp),this._emitEvent("mousedown",e,r,t,null,null)},i.prototype._emitMouseoverEvents=function(r,t,e,n){var a=this.canvas.get("el");e!==n&&(e&&(this._emitEvent("mouseout",r,t,e,e,n),this._emitEvent("mouseleave",r,t,e,e,n),(!n||n.get("destroyed"))&&(a.style.cursor=this.canvas.get("cursor"))),n&&(this._emitEvent("mouseover",r,t,n,e,n),this._emitEvent("mouseenter",r,t,n,e,n)))},i.prototype._emitDragoverEvents=function(r,t,e,n,a){n?(n!==e&&(e&&this._emitEvent("dragleave",r,t,e,e,n),this._emitEvent("dragenter",r,t,n,e,n)),a||this._emitEvent("dragover",r,t,n)):e&&this._emitEvent("dragleave",r,t,e,e,n),a&&this._emitEvent("dragover",r,t,n)},i.prototype._afterDrag=function(r,t,e){r&&(r.set("capture",!0),this.draggingShape=null),this.dragging=!1;var n=this._getShape(t,e);n!==r&&this._emitMouseoverEvents(e,t,r,n),this.currentShape=n},i.prototype._onmouseup=function(r,t,e){if(e.button===zl){var n=this.draggingShape;this.dragging?(n&&this._emitEvent("drop",e,r,t),this._emitEvent("dragend",e,r,n),this._afterDrag(n,r,e)):(this._emitEvent("mouseup",e,r,t),t===this.mousedownShape&&this._emitEvent("click",e,r,t),this.mousedownShape=null,this.mousedownPoint=null)}},i.prototype._ondragover=function(r,t,e){e.preventDefault();var n=this.currentShape;this._emitDragoverEvents(e,r,n,t,!0)},i.prototype._onmousemove=function(r,t,e){var n=this.canvas,a=this.currentShape,o=this.draggingShape;if(this.dragging)o&&this._emitDragoverEvents(e,r,a,t,!1),this._emitEvent("drag",e,r,o);else{var s=this.mousedownPoint;if(s){var l=this.mousedownShape,h=e.timeStamp,u=h-this.mousedownTimeStamp,c=s.clientX-r.clientX,f=s.clientY-r.clientY,v=c*c+f*f;u>120||v>Gd?l&&l.get("draggable")?(o=this.mousedownShape,o.set("capture",!1),this.draggingShape=o,this.dragging=!0,this._emitEvent("dragstart",e,r,o),this.mousedownShape=null,this.mousedownPoint=null):!l&&n.get("draggable")?(this.dragging=!0,this._emitEvent("dragstart",e,r,null),this.mousedownShape=null,this.mousedownPoint=null):(this._emitMouseoverEvents(e,r,a,t),this._emitEvent("mousemove",e,r,t)):(this._emitMouseoverEvents(e,r,a,t),this._emitEvent("mousemove",e,r,t))}else this._emitMouseoverEvents(e,r,a,t),this._emitEvent("mousemove",e,r,t)}},i.prototype._emitEvent=function(r,t,e,n,a,o){var s=this._getEventObj(r,t,e,n,a,o);if(n){s.shape=n,$l(n,r,s);for(var l=n.getParent();l;)l.emitDelegation(r,s),s.propagationStopped||Hd(l,r,s),s.propagationPath.push(l),l=l.getParent()}else{var h=this.canvas;$l(h,r,s)}},i.prototype.destroy=function(){this._clearEvents(),this.canvas=null,this.currentShape=null,this.draggingShape=null,this.mousedownPoint=null,this.mousedownShape=null,this.mousedownTimeStamp=null},i}(),_l="px",jl=nc(),Nd=jl&&jl.name==="firefox",la=function(i){E(r,i);function r(t){var e=i.call(this,t)||this;return e.initContainer(),e.initDom(),e.initEvents(),e.initTimeline(),e}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return t.cursor="default",t.supportCSSTransform=!1,t},r.prototype.initContainer=function(){var t=this.get("container");N(t)&&(t=document.getElementById(t),this.set("container",t))},r.prototype.initDom=function(){var t=this.createDom();this.set("el",t);var e=this.get("container");e.appendChild(t),this.setDOMSize(this.get("width"),this.get("height"))},r.prototype.initEvents=function(){var t=new Vd({canvas:this});t.init(),this.set("eventController",t)},r.prototype.initTimeline=function(){var t=new Yd(this);this.set("timeline",t)},r.prototype.setDOMSize=function(t,e){var n=this.get("el");yl&&(n.style.width=t+_l,n.style.height=e+_l)},r.prototype.changeSize=function(t,e){this.setDOMSize(t,e),this.set("width",t),this.set("height",e),this.onCanvasChange("changeSize")},r.prototype.getRenderer=function(){return this.get("renderer")},r.prototype.getCursor=function(){return this.get("cursor")},r.prototype.setCursor=function(t){this.set("cursor",t);var e=this.get("el");yl&&e&&(e.style.cursor=t)},r.prototype.getPointByEvent=function(t){var e=this.get("supportCSSTransform");if(e){if(Nd&&!I(t.layerX)&&t.layerX!==t.offsetX)return{x:t.layerX,y:t.layerY};if(!I(t.offsetX))return{x:t.offsetX,y:t.offsetY}}var n=this.getClientByEvent(t),a=n.x,o=n.y;return this.getPointByClient(a,o)},r.prototype.getClientByEvent=function(t){var e=t;return t.touches&&(t.type==="touchend"?e=t.changedTouches[0]:e=t.touches[0]),{x:e.clientX,y:e.clientY}},r.prototype.getPointByClient=function(t,e){var n=this.get("el"),a=n.getBoundingClientRect();return{x:t-a.left,y:e-a.top}},r.prototype.getClientByPoint=function(t,e){var n=this.get("el"),a=n.getBoundingClientRect();return{x:t+a.left,y:e+a.top}},r.prototype.draw=function(){},r.prototype.removeDom=function(){var t=this.get("el");t.parentNode.removeChild(t)},r.prototype.clearEvents=function(){var t=this.get("eventController");t.destroy()},r.prototype.isCanvas=function(){return!0},r.prototype.getParent=function(){return null},r.prototype.destroy=function(){var t=this.get("timeline");this.get("destroyed")||(this.clear(),t&&t.stop(),this.clearEvents(),this.removeDom(),i.prototype.destroy.call(this))},r}(cc),ha=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.isGroup=function(){return!0},r.prototype.isEntityGroup=function(){return!1},r.prototype.clone=function(){for(var t=i.prototype.clone.call(this),e=this.getChildren(),n=0;n=t&&n.minY<=e&&n.maxY>=e},r.prototype.afterAttrsChange=function(t){i.prototype.afterAttrsChange.call(this,t),this.clearCacheBBox()},r.prototype.getBBox=function(){var t=this.cfg.bbox;return t||(t=this.calculateBBox(),this.set("bbox",t)),t},r.prototype.getCanvasBBox=function(){var t=this.cfg.canvasBBox;return t||(t=this.calculateCanvasBBox(),this.set("canvasBBox",t)),t},r.prototype.applyMatrix=function(t){i.prototype.applyMatrix.call(this,t),this.set("canvasBBox",null)},r.prototype.calculateCanvasBBox=function(){var t=this.getBBox(),e=this.getTotalMatrix(),n=t.minX,a=t.minY,o=t.maxX,s=t.maxY;if(e){var l=xe(e,[t.minX,t.minY]),h=xe(e,[t.maxX,t.minY]),u=xe(e,[t.minX,t.maxY]),c=xe(e,[t.maxX,t.maxY]);n=Math.min(l[0],h[0],u[0],c[0]),o=Math.max(l[0],h[0],u[0],c[0]),a=Math.min(l[1],h[1],u[1],c[1]),s=Math.max(l[1],h[1],u[1],c[1])}var f=this.attrs;if(f.shadowColor){var v=f.shadowBlur,p=v===void 0?0:v,g=f.shadowOffsetX,d=g===void 0?0:g,y=f.shadowOffsetY,C=y===void 0?0:y,m=n-p+d,x=o+p+d,S=a-p+C,b=s+p+C;n=Math.min(n,m),o=Math.max(o,x),a=Math.min(a,S),s=Math.max(s,b)}return{x:n,y:a,minX:n,minY:a,maxX:o,maxY:s,width:o-n,height:s-a}},r.prototype.clearCacheBBox=function(){this.set("bbox",null),this.set("canvasBBox",null)},r.prototype.isClipShape=function(){return this.get("isClipShape")},r.prototype.isInShape=function(t,e){return!1},r.prototype.isOnlyHitBox=function(){return!1},r.prototype.isHit=function(t,e){var n=this.get("startArrowShape"),a=this.get("endArrowShape"),o=[t,e,1];o=this.invertFromMatrix(o);var s=o[0],l=o[1],h=this._isInBBox(s,l);return this.isOnlyHitBox()?h:!!(h&&!this.isClipped(s,l)&&(this.isInShape(s,l)||n&&n.isHit(s,l)||a&&a.isHit(s,l)))},r}(lc),Tc=new Map;function Kt(i,r){Tc.set(i,r)}function ca(i){return Tc.get(i)}function Lc(i){var r=i.attr(),t=r.x,e=r.y,n=r.width,a=r.height;return{x:t,y:e,width:n,height:a}}function Ec(i){var r=i.attr(),t=r.x,e=r.y,n=r.r;return{x:t-n,y:e-n,width:n*2,height:n*2}}function Tt(i,r,t,e){var n=i-t,a=r-e;return Math.sqrt(n*n+a*a)}function En(i,r){return Math.abs(i-r)<.001}function zr(i,r){var t=Yt(i),e=Yt(r),n=Lt(i),a=Lt(r);return{x:t,y:e,width:n-t,height:a-e}}function fa(i){return(i+Math.PI*2)%(Math.PI*2)}const wt={box:function(i,r,t,e){return zr([i,t],[r,e])},length:function(i,r,t,e){return Tt(i,r,t,e)},pointAt:function(i,r,t,e,n){return{x:(1-n)*i+n*t,y:(1-n)*r+n*e}},pointDistance:function(i,r,t,e,n,a){var o=(t-i)*(n-i)+(e-r)*(a-r);if(o<0)return Tt(i,r,n,a);var s=(t-i)*(t-i)+(e-r)*(e-r);return o>s?Tt(t,e,n,a):this.pointToLine(i,r,t,e,n,a)},pointToLine:function(i,r,t,e,n,a){var o=[t-i,e-r];if(wg(o,[0,0]))return Math.sqrt((n-i)*(n-i)+(a-r)*(a-r));var s=[-o[1],o[0]];oc(s,s);var l=[n-i,a-r];return Math.abs(mg(l,s))},tangentAngle:function(i,r,t,e){return Math.atan2(e-r,t-i)}};var Xd=1e-4;function Bc(i,r,t,e,n,a){var o,s=1/0,l=[t,e],h=20;a&&a>200&&(h=a/10);for(var u=1/h,c=u/10,f=0;f<=h;f++){var v=f*u,p=[n.apply(null,i.concat([v])),n.apply(null,r.concat([v]))],g=Tt(l[0],l[1],p[0],p[1]);g=0&&g=0?[n]:[]}function ql(i,r,t,e){return 2*(1-e)*(r-i)+2*e*(t-r)}function kc(i,r,t,e,n,a,o){var s=Fe(i,t,n,o),l=Fe(r,e,a,o),h=wt.pointAt(i,r,t,e,o),u=wt.pointAt(t,e,n,a,o);return[[i,r,h.x,h.y,s,l],[s,l,u.x,u.y,n,a]]}function Bo(i,r,t,e,n,a,o){if(o===0)return(Tt(i,r,t,e)+Tt(t,e,n,a)+Tt(i,r,n,a))/2;var s=kc(i,r,t,e,n,a,.5),l=s[0],h=s[1];return l.push(o-1),h.push(o-1),Bo.apply(null,l)+Bo.apply(null,h)}const Ic={box:function(i,r,t,e,n,a){var o=Ul(i,t,n)[0],s=Ul(r,e,a)[0],l=[i,n],h=[r,a];return o!==void 0&&l.push(Fe(i,t,n,o)),s!==void 0&&h.push(Fe(r,e,a,s)),zr(l,h)},length:function(i,r,t,e,n,a){return Bo(i,r,t,e,n,a,3)},nearestPoint:function(i,r,t,e,n,a,o,s){return Bc([i,t,n],[r,e,a],o,s,Fe)},pointDistance:function(i,r,t,e,n,a,o,s){var l=this.nearestPoint(i,r,t,e,n,a,o,s);return Tt(l.x,l.y,o,s)},interpolationAt:Fe,pointAt:function(i,r,t,e,n,a,o){return{x:Fe(i,t,n,o),y:Fe(r,e,a,o)}},divide:function(i,r,t,e,n,a,o){return kc(i,r,t,e,n,a,o)},tangentAngle:function(i,r,t,e,n,a,o){var s=ql(i,t,n,o),l=ql(r,e,a,o),h=Math.atan2(l,s);return fa(h)}};function Oe(i,r,t,e,n){var a=1-n;return a*a*a*i+3*r*n*a*a+3*t*n*n*a+e*n*n*n}function Zl(i,r,t,e,n){var a=1-n;return 3*(a*a*(r-i)+2*a*n*(t-r)+n*n*(e-t))}function za(i,r,t,e){var n=-3*i+9*r-9*t+3*e,a=6*i-12*r+6*t,o=3*r-3*i,s=[],l,h,u;if(En(n,0))En(a,0)||(l=-o/a,l>=0&&l<=1&&s.push(l));else{var c=a*a-4*n*o;En(c,0)?s.push(-a/(2*n)):c>0&&(u=Math.sqrt(c),l=(-a+u)/(2*n),h=(-a-u)/(2*n),l>=0&&l<=1&&s.push(l),h>=0&&h<=1&&s.push(h))}return s}function Pc(i,r,t,e,n,a,o,s,l){var h=Oe(i,t,n,o,l),u=Oe(r,e,a,s,l),c=wt.pointAt(i,r,t,e,l),f=wt.pointAt(t,e,n,a,l),v=wt.pointAt(n,a,o,s,l),p=wt.pointAt(c.x,c.y,f.x,f.y,l),g=wt.pointAt(f.x,f.y,v.x,v.y,l);return[[i,r,c.x,c.y,p.x,p.y,h,u],[h,u,g.x,g.y,v.x,v.y,o,s]]}function ko(i,r,t,e,n,a,o,s,l){if(l===0)return zd([i,t,n,o],[r,e,a,s]);var h=Pc(i,r,t,e,n,a,o,s,.5),u=h[0],c=h[1];return u.push(l-1),c.push(l-1),ko.apply(null,u)+ko.apply(null,c)}const ci={extrema:za,box:function(i,r,t,e,n,a,o,s){for(var l=[i,o],h=[r,s],u=za(i,t,n,o),c=za(r,e,a,s),f=0;f0?t:t*-1}const Wd={box:function(i,r,t,e){return{x:i-t,y:r-e,width:t*2,height:e*2}},length:function(i,r,t,e){return Math.PI*(3*(t+e)-Math.sqrt((3*t+e)*(t+3*e)))},nearestPoint:function(i,r,t,e,n,a){var o=t,s=e;if(o===0||s===0)return{x:i,y:r};for(var l=n-i,h=a-r,u=Math.abs(l),c=Math.abs(h),f=o*o,v=s*s,p=Math.PI/4,g,d,y=0;y<4;y++){g=o*Math.cos(p),d=s*Math.sin(p);var C=(f-v)*Math.pow(Math.cos(p),3)/o,m=(v-f)*Math.pow(Math.sin(p),3)/s,x=g-C,S=d-m,b=u-C,A=c-m,L=Math.hypot(S,x),k=Math.hypot(A,b),B=L*Math.asin((x*A-S*b)/(L*k)),O=B/Math.sqrt(f+v-g*g-d*d);p+=O,p=Math.min(Math.PI/2,Math.max(0,p))}return{x:i+Ql(g,l),y:r+Ql(d,h)}},pointDistance:function(i,r,t,e,n,a){var o=this.nearestPoint(i,r,t,e,n,a);return Tt(o.x,o.y,n,a)},pointAt:function(i,r,t,e,n){var a=2*Math.PI*n;return{x:i+t*Math.cos(a),y:r+e*Math.sin(a)}},tangentAngle:function(i,r,t,e,n){var a=2*Math.PI*n,o=Math.atan2(e*Math.cos(a),-t*Math.sin(a));return fa(o)}};function $d(i,r,t,e,n,a,o,s){return-1*t*Math.cos(n)*Math.sin(s)-e*Math.sin(n)*Math.cos(s)}function _d(i,r,t,e,n,a,o,s){return-1*t*Math.sin(n)*Math.sin(s)+e*Math.cos(n)*Math.cos(s)}function jd(i,r,t){return Math.atan(-r/i*Math.tan(t))}function Ud(i,r,t){return Math.atan(r/(i*Math.tan(t)))}function Kl(i,r,t,e,n,a){return t*Math.cos(n)*Math.cos(a)-e*Math.sin(n)*Math.sin(a)+i}function Jl(i,r,t,e,n,a){return t*Math.sin(n)*Math.cos(a)+e*Math.cos(n)*Math.sin(a)+r}function qd(i,r,t,e){var n=Math.atan2(e*i,t*r);return(n+Math.PI*2)%(Math.PI*2)}function th(i,r,t){return{x:i*Math.cos(t),y:r*Math.sin(t)}}function eh(i,r,t){var e=Math.cos(t),n=Math.sin(t);return[i*e-r*n,i*n+r*e]}const Zd={box:function(i,r,t,e,n,a,o){for(var s=jd(t,e,n),l=1/0,h=-1/0,u=[a,o],c=-Math.PI*2;c<=Math.PI*2;c+=Math.PI){var f=s+c;ah&&(h=v)}for(var p=Ud(t,e,n),g=1/0,d=-1/0,y=[a,o],c=-Math.PI*2;c<=Math.PI*2;c+=Math.PI){var C=p+c;ad&&(d=m)}return{x:l,y:g,width:h-l,height:d-g}},length:function(i,r,t,e,n,a,o){},nearestPoint:function(i,r,t,e,n,a,o,s,l){var h=eh(s-i,l-r,-n),u=h[0],c=h[1],f=Wd.nearestPoint(0,0,t,e,u,c),v=qd(t,e,f.x,f.y);vo&&(f=th(t,e,o));var p=eh(f.x,f.y,n);return{x:p[0]+i,y:p[1]+r}},pointDistance:function(i,r,t,e,n,a,o,s,l){var h=this.nearestPoint(i,r,t,e,s,l);return Tt(h.x,h.y,s,l)},pointAt:function(i,r,t,e,n,a,o,s){var l=(o-a)*s+a;return{x:Kl(i,r,t,e,n,l),y:Jl(i,r,t,e,n,l)}},tangentAngle:function(i,r,t,e,n,a,o,s){var l=(o-a)*s+a,h=$d(i,r,t,e,n,a,o,l),u=_d(i,r,t,e,n,a,o,l);return fa(Math.atan2(u,h))}};function Fc(i){for(var r=0,t=[],e=0;e1||r<0||i.length<2)return null;var t=Fc(i),e=t.segments,n=t.totalLength;if(n===0)return{x:i[0][0],y:i[0][1]};for(var a=0,o=null,s=0;s=a&&r<=a+c){var f=(r-a)/c;o=wt.pointAt(h[0],h[1],u[0],u[1],f);break}a+=c}return o}function Jd(i,r){if(r>1||r<0||i.length<2)return 0;for(var t=Fc(i),e=t.segments,n=t.totalLength,a=0,o=0,s=0;s=a&&r<=a+c){o=Math.atan2(u[1]-h[1],u[0]-h[0]);break}a+=c}return o}function ty(i,r,t){for(var e=1/0,n=0;n1){var n=iy(r,t);return r*e+n*(e-1)}return r}function iy(i,r){return r?r-i:i*.14}function ny(i,r){var t=va(),e=0;if(I(i)||i==="")return e;if(t.save(),t.font=r,N(i)&&i.includes(` `)){var n=i.split(` `);M(n,function(a){var o=t.measureText(a).width;e1){var n=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=n}M(t,function(a,o){isNaN(a)||(t[o]=+a)}),r[e]=t}),r}function hy(i,r,t,e){var n=[],a=!!e,o,s,l,h,u,c,f;if(a){l=e[0],h=e[1];for(var v=0,p=i.length;v2&&(t.push([n].concat(o.splice(0,2))),s="l",n=n==="m"?"l":"L"),s==="o"&&o.length===1&&t.push([n,o[0]]),s==="r")t.push([n].concat(o));else for(;o.length>=r[s]&&(t.push([n].concat(o.splice(0,r[s]))),!!r[s]););return""}),t}var vy=/[a-z]/;function ih(i,r){return[r[0]+(r[0]-i[0]),r[1]+(r[1]-i[1])]}function Rc(i){var r=Dc(i);if(!r||!r.length)return[["M",0,0]];for(var t=!1,e=0;e=0){t=!0;break}}if(!t)return r;var a=[],o=0,s=0,l=0,h=0,u=0,c=r[0];(c[0]==="M"||c[0]==="m")&&(o=+c[1],s=+c[2],l=o,h=s,u++,a[0]=["M",o,s]);for(var e=u,f=r.length;e1&&(t*=Math.sqrt(v),e*=Math.sqrt(v));var p=t*t*(f*f)+e*e*(c*c),g=p?Math.sqrt((t*t*(e*e)-p)/p):1;a===o&&(g*=-1),isNaN(g)&&(g=0);var d=e?g*t*f/e:0,y=t?g*-e*c/t:0,C=(s+h)/2+Math.cos(n)*d-Math.sin(n)*y,m=(l+u)/2+Math.sin(n)*d+Math.cos(n)*y,x=[(c-d)/t,(f-y)/e],S=[(-1*c-d)/t,(-1*f-y)/e],b=nh([1,0],x),A=nh(x,S);return Io(x,S)<=-1&&(A=Math.PI),Io(x,S)>=1&&(A=0),o===0&&A>0&&(A=A-2*Math.PI),o===1&&A<0&&(A=A+2*Math.PI),{cx:C,cy:m,rx:Po(i,[h,u])?0:t,ry:Po(i,[h,u])?0:e,startAngle:b,endAngle:b+A,xRotation:n,arcFlag:a,sweepFlag:o}}function ah(i,r){return[r[0]+(r[0]-i[0]),r[1]+(r[1]-i[1])]}function Yc(i){i=ly(i);for(var r=[],t=null,e=null,n=null,a=0,o=i.length,s=0;s=r&&i<=t};function gy(i,r,t,e){var n=.001,a={x:t.x-i.x,y:t.y-i.y},o={x:r.x-i.x,y:r.y-i.y},s={x:e.x-t.x,y:e.y-t.y},l=o.x*s.y-o.y*s.x,h=l*l,u=o.x*o.x+o.y*o.y,c=s.x*s.x+s.y*s.y,f=null;if(h>n*u*c){var v=(a.x*s.y-a.y*s.x)/l,p=(a.x*o.y-a.y*o.x)/l;oh(v,0,1)&&oh(p,0,1)&&(f={x:i.x+v*o.x,y:i.y+v*o.y})}return f}var dy=1e-6;function $a(i){return Math.abs(i)0!=$a(s[1]-t)>0&&$a(r-(t-o[1])*(o[0]-s[0])/(o[1]-s[1])-o[0])<0&&(e=!e)}return e}function lh(i){for(var r=[],t=i.length,e=0;e1){var o=i[0],s=i[t-1];r.push({from:{x:s[0],y:s[1]},to:{x:o[0],y:o[1]}})}return r}function my(i,r){var t=!1;return M(i,function(e){if(gy(e.from,e.to,r.from,r.to))return t=!0,!1}),t}function hh(i){var r=i.map(function(e){return e[0]}),t=i.map(function(e){return e[1]});return{minX:Math.min.apply(null,r),maxX:Math.max.apply(null,r),minY:Math.min.apply(null,t),maxY:Math.max.apply(null,t)}}function xy(i,r){return!(r.minX>i.maxX||r.maxXi.maxY||r.maxYMath.PI/2?Math.PI-h:h,u=u>Math.PI/2?Math.PI-u:u;var c={xExtra:Math.cos(l/2-h)*(r/2*(1/Math.sin(l/2)))-r/2||0,yExtra:Math.cos(u-l/2)*(r/2*(1/Math.sin(l/2)))-r/2||0};return c}function My(i){var r=i.attr(),t=r.path,e=r.stroke,n=e?r.lineWidth:0,a=i.get("segments")||Yc(t),o=Cy(a,n),s=o.x,l=o.y,h=o.width,u=o.height,c={minX:s,minY:l,maxX:s+h,maxY:l+u};return c=ps(i,c),{x:c.minX,y:c.minY,width:c.maxX-c.minX,height:c.maxY-c.minY}}function Sy(i){var r=i.attr(),t=r.x1,e=r.y1,n=r.x2,a=r.y2,o=Math.min(t,n),s=Math.max(t,n),l=Math.min(e,a),h=Math.max(e,a),u={minX:o,maxX:s,minY:l,maxY:h};return u=ps(i,u),{x:u.minX,y:u.minY,width:u.maxX-u.minX,height:u.maxY-u.minY}}function by(i){var r=i.attr(),t=r.x,e=r.y,n=r.rx,a=r.ry;return{x:t-n,y:e-a,width:n*2,height:a*2}}Kt("rect",Lc);Kt("image",Lc);Kt("circle",Ec);Kt("marker",Ec);Kt("polyline",ey);Kt("polygon",ry);Kt("text",ay);Kt("path",My);Kt("line",Sy);Kt("ellipse",by);var uh=0,Ay=1/2,Ty=1/2,Ly=.05,da=function(){function i(r){var t=r.xField,e=r.yField,n=r.adjustNames,a=n===void 0?["x","y"]:n,o=r.dimValuesMap;this.adjustNames=a,this.xField=t,this.yField=e,this.dimValuesMap=o}return i.prototype.isAdjust=function(r){return this.adjustNames.indexOf(r)>=0},i.prototype.getAdjustRange=function(r,t,e){var n=this.yField,a=e.indexOf(t),o=e.length,s,l;return!n&&this.isAdjust("y")?(s=0,l=1):o>1?(s=e[a===0?0:a-1],l=e[a===o-1?o-1:a+1],a!==0?s+=(t-s)/2:s-=(l-t)/2,a!==o-1?l-=(l-t)/2:l+=(t-e[o-2])/2):(s=t===0?0:t-.5,l=t===0?1:t+.5),{pre:s,next:l}},i.prototype.adjustData=function(r,t){var e=this,n=this.getDimValues(t);M(r,function(a,o){M(n,function(s,l){e.adjustDim(l,s,a,o)})})},i.prototype.groupData=function(r,t){return M(r,function(e){e[t]===void 0&&(e[t]=uh)}),Ue(r,t)},i.prototype.adjustDim=function(r,t,e,n){},i.prototype.getDimValues=function(r){var t=this,e=t.xField,n=t.yField,a=ot({},this.dimValuesMap),o=[];if(e&&this.isAdjust("x")&&o.push(e),n&&this.isAdjust("y")&&o.push(n),o.forEach(function(l){a&&a[l]||(a[l]=Me(r,l).sort(function(h,u){return h-u}))}),!n&&this.isAdjust("y")){var s="y";a[s]=[uh,1]}return a},i}(),Gc={},Hc=function(i){return Gc[i.toLowerCase()]},ya=function(i,r){if(Hc(i))throw new Error("Adjust type '"+i+"' existed.");Gc[i.toLowerCase()]=r};/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var Fo=function(i,r){return Fo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},Fo(i,r)};function ma(i,r){Fo(i,r);function t(){this.constructor=i}i.prototype=r===null?Object.create(r):(t.prototype=r.prototype,new t)}var ue=function(){return ue=Object.assign||function(r){for(var t,e=1,n=arguments.length;e=0){var p=this.getIntervalOnlyOffset(n,e);v=u+p}else if(!I(h)&&I(l)&&h>=0){var p=this.getDodgeOnlyOffset(n,e);v=u+p}else if(!I(l)&&!I(h)&&l>=0&&h>=0){var p=this.getIntervalAndDodgeOffset(n,e);v=u+p}else{var g=f*o/n,d=s*g,p=1/2*(f-n*g-(n-1)*d)+((e+1)*g+e*d)-1/2*g-1/2*f;v=(u+c)/2+p}return v},r.prototype.getIntervalOnlyOffset=function(t,e){var n=this,a=n.defaultSize,o=n.intervalPadding,s=n.xDimensionLegenth,l=n.groupNum,h=n.dodgeRatio,u=n.maxColumnWidth,c=n.minColumnWidth,f=n.columnWidthRatio,v=o/s,p=(1-(l-1)*v)/l*h/(t-1),g=((1-v*(l-1))/l-p*(t-1))/t;if(g=I(f)?g:1/l/t*f,!I(u)){var d=u/s;g=Math.min(g,d)}if(!I(c)){var y=c/s;g=Math.max(g,y)}g=a?a/s:g,p=((1-(l-1)*v)/l-t*g)/(t-1);var C=((1/2+e)*g+e*p+1/2*v)*l-v/2;return C},r.prototype.getDodgeOnlyOffset=function(t,e){var n=this,a=n.defaultSize,o=n.dodgePadding,s=n.xDimensionLegenth,l=n.groupNum,h=n.marginRatio,u=n.maxColumnWidth,c=n.minColumnWidth,f=n.columnWidthRatio,v=o/s,p=1*h/(l-1),g=((1-p*(l-1))/l-v*(t-1))/t;if(g=f?1/l/t*f:g,!I(u)){var d=u/s;g=Math.min(g,d)}if(!I(c)){var y=c/s;g=Math.max(g,y)}g=a?a/s:g,p=(1-(g*t+v*(t-1))*l)/(l-1);var C=((1/2+e)*g+e*v+1/2*p)*l-p/2;return C},r.prototype.getIntervalAndDodgeOffset=function(t,e){var n=this,a=n.intervalPadding,o=n.dodgePadding,s=n.xDimensionLegenth,l=n.groupNum,h=a/s,u=o/s,c=((1-h*(l-1))/l-u*(t-1))/t,f=((1/2+e)*c+e*u+1/2*h)*l-h/2;return f},r.prototype.getDistribution=function(t){var e=this.adjustDataArray,n=this.cacheMap,a=n[t];return a||(a={},M(e,function(o,s){var l=Me(o,t);l.length||l.push(0),M(l,function(h){a[h]||(a[h]=[]),a[h].push(s)})}),n[t]=a),a},r}(da);function By(i,r){return(r-i)*Math.random()+i}var ky=function(i){ma(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.process=function(t){var e=Xt(t),n=$t(e);return this.adjustData(e,n),e},r.prototype.adjustDim=function(t,e,n){var a=this,o=this.groupData(n,t);return M(o,function(s,l){return a.adjustGroup(s,t,parseFloat(l),e)})},r.prototype.getAdjustOffset=function(t){var e=t.pre,n=t.next,a=(n-e)*Ly;return By(e+a,n-a)},r.prototype.adjustGroup=function(t,e,n,a){var o=this,s=this.getAdjustRange(e,n,a);return M(t,function(l){l[e]=o.getAdjustOffset(s)}),t},r}(da),_a=Ep,Iy=function(i){ma(r,i);function r(t){var e=i.call(this,t)||this,n=t.adjustNames,a=n===void 0?["y"]:n,o=t.height,s=o===void 0?NaN:o,l=t.size,h=l===void 0?10:l,u=t.reverseOrder,c=u===void 0?!1:u;return e.adjustNames=a,e.height=s,e.size=h,e.reverseOrder=c,e}return r.prototype.process=function(t){var e=this,n=e.yField,a=e.reverseOrder,o=n?this.processStack(t):this.processOneDimStack(t);return a?this.reverse(o):o},r.prototype.reverse=function(t){return t.slice(0).reverse()},r.prototype.processStack=function(t){var e=this,n=e.xField,a=e.yField,o=e.reverseOrder,s=o?this.reverse(t):t,l=new _a,h=new _a;return s.map(function(u){return u.map(function(c){var f,v=T(c,n,0),p=T(c,[a]),g=v.toString();if(p=P(p)?p[1]:p,!I(p)){var d=p>=0?l:h;d.has(g)||d.set(g,0);var y=d.get(g),C=p+y;return d.set(g,C),ue(ue({},c),(f={},f[a]=[y,C],f))}return c})})},r.prototype.processOneDimStack=function(t){var e=this,n=this,a=n.xField,o=n.height,s=n.reverseOrder,l="y",h=s?this.reverse(t):t,u=new _a;return h.map(function(c){return c.map(function(f){var v,p=e.size,g=f[a],d=p*2/o;u.has(g)||u.set(g,d/2);var y=u.get(g);return u.set(g,y+d),ue(ue({},f),(v={},v[l]=y,v))})})},r}(da),Py=function(i){ma(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.process=function(t){var e=$t(t),n=this,a=n.xField,o=n.yField,s=this.getXValuesMaxMap(e),l=Math.max.apply(Math,Object.keys(s).map(function(h){return s[h]}));return Et(t,function(h){return Et(h,function(u){var c,f,v=u[o],p=u[a];if(P(v)){var g=(l-s[p])/2;return ue(ue({},u),(c={},c[o]=Et(v,function(y){return g+y}),c))}var d=(l-v)/2;return ue(ue({},u),(f={},f[o]=[d,v+d],f))})})},r.prototype.getXValuesMaxMap=function(t){var e=this,n=this,a=n.xField,o=n.yField,s=Ue(t,function(l){return l[a]});return bp(s,function(l){return e.getDimMaxValue(l,o)})},r.prototype.getDimMaxValue=function(t,e){var n=Et(t,function(o){return T(o,e,[])}),a=$t(n);return Math.max.apply(Math,a)},r}(da);ya("Dodge",Ey);ya("Jitter",ky);ya("Stack",Iy);ya("Symmetric",Py);var ch=function(i,r){return N(r)?r:i.invert(i.scale(r))},zi=function(){function i(r){this.names=[],this.scales=[],this.linear=!1,this.values=[],this.callback=function(){return[]},this._parseCfg(r)}return i.prototype.mapping=function(){for(var r=this,t=[],e=0;e1?1:Number(r),e=i.length-1,n=Math.floor(e*t),a=e*t-n,o=i[n],s=n===e?o:i[n+1];return Vc([ja(o,s,a,0),ja(o,s,a,1),ja(o,s,a,2)])},ln,Xc=function(i){if(i[0]==="#"&&i.length===7)return i;ln||(ln=Gy()),ln.style.color=i;var r=document.defaultView.getComputedStyle(ln,"").getPropertyValue("color"),t=Fy.exec(r),e=t[1].split(/\s*,\s*/).map(function(n){return Number(n)});return r=Vc(e),r},Vy=function(i){var r=N(i)?i.split("-"):i,t=Et(r,function(e){return Nc(e.indexOf("#")===-1?Xc(e):e)});return function(e){return Hy(t,e)}},Ny=function(i){if(Yy(i)){var r,t=void 0;if(i[0]==="l"){var e=Oy.exec(i),n=+e[1]+90;t=e[2],r="linear-gradient("+n+"deg, "}else if(i[0]==="r"){r="radial-gradient(";var e=Dy.exec(i);t=e[4]}var a=t.match(Ry);return M(a,function(o,s){var l=o.split(":");r+=l[1]+" "+l[0]*100+"%",s!==a.length-1&&(r+=", ")}),r+=")",r}return i};const ki={rgb2arr:Nc,gradient:Vy,toRGB:ia(Xc),toCSSGradient:Ny};var Xy=function(i){Wi(r,i);function r(t){var e=i.call(this,t)||this;return e.type="color",e.names=["color"],N(e.values)&&(e.linear=!0),e.gradient=ki.gradient(e.values),e}return r.prototype.getLinearValue=function(t){return this.gradient(t)},r}(zi),zy=function(i){Wi(r,i);function r(t){var e=i.call(this,t)||this;return e.type="opacity",e.names=["opacity"],e}return r}(zi),Wy=function(i){Wi(r,i);function r(t){var e=i.call(this,t)||this;return e.names=["x","y"],e.type="position",e}return r.prototype.mapping=function(t,e){var n=this.scales,a=n[0],o=n[1];return I(t)||I(e)?[]:[P(t)?t.map(function(s){return a.scale(s)}):a.scale(t),P(e)?e.map(function(s){return o.scale(s)}):o.scale(e)]},r}(zi),$y=function(i){Wi(r,i);function r(t){var e=i.call(this,t)||this;return e.type="shape",e.names=["shape"],e}return r.prototype.getLinearValue=function(t){var e=Math.round((this.values.length-1)*t);return this.values[e]},r}(zi),_y=function(i){Wi(r,i);function r(t){var e=i.call(this,t)||this;return e.type="size",e.names=["size"],e}return r}(zi),zc={};function jy(i){return zc[i]}function ge(i,r){zc[i]=r}var gs=function(){function i(r){this.type="base",this.isCategory=!1,this.isLinear=!1,this.isContinuous=!1,this.isIdentity=!1,this.values=[],this.range=[0,1],this.ticks=[],this.__cfg__=r,this.initCfg(),this.init()}return i.prototype.translate=function(r){return r},i.prototype.change=function(r){ot(this.__cfg__,r),this.init()},i.prototype.clone=function(){return this.constructor(this.__cfg__)},i.prototype.getTicks=function(){var r=this;return Et(this.ticks,function(t,e){return rt(t)?t:{text:r.getText(t,e),tickValue:t,value:r.scale(t)}})},i.prototype.getText=function(r,t){var e=this.formatter,n=e?e(r,t):r;return I(n)||!G(n.toString)?"":n.toString()},i.prototype.getConfig=function(r){return this.__cfg__[r]},i.prototype.init=function(){ot(this,this.__cfg__),this.setDomain(),pe(this.getConfig("ticks"))&&(this.ticks=this.calculateTicks())},i.prototype.initCfg=function(){},i.prototype.setDomain=function(){},i.prototype.calculateTicks=function(){var r=this.tickMethod,t=[];if(N(r)){var e=jy(r);if(!e)throw new Error("There is no method to to calculate ticks!");t=e(this)}else G(r)&&(t=r(this));return t},i.prototype.rangeMin=function(){return this.range[0]},i.prototype.rangeMax=function(){return this.range[1]},i.prototype.calcPercent=function(r,t,e){return U(r)?(r-t)/(e-t):NaN},i.prototype.calcValue=function(r,t,e){return t+r*(e-t)},i}(),xa=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="cat",t.isCategory=!0,t}return r.prototype.buildIndexMap=function(){if(!this.translateIndexMap){this.translateIndexMap=new Map;for(var t=0;tthis.max?NaN:this.values[a]},r.prototype.getText=function(t){for(var e=[],n=1;n1?t-1:t}this.translateIndexMap&&(this.translateIndexMap=void 0)},r}(gs),Wc=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,Pe="\\d\\d?",Be="\\d\\d",Uy="\\d{3}",qy="\\d{4}",vi="[^\\s]+",$c=/\[([^]*?)\]/gm;function _c(i,r){for(var t=[],e=0,n=i.length;e-1?n:null}};function $e(i){for(var r=[],t=1;t3?0:(i-i%10!==10?1:0)*i%10]}},Vn=$e({},ds),qc=function(i){return Vn=$e(Vn,i)},vh=function(i){return i.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},kt=function(i,r){for(r===void 0&&(r=2),i=String(i);i.length0?"-":"+")+kt(Math.floor(Math.abs(r)/60)*100+Math.abs(r)%60,4)},Z:function(i){var r=i.getTimezoneOffset();return(r>0?"-":"+")+kt(Math.floor(Math.abs(r)/60),2)+":"+kt(Math.abs(r)%60,2)}},ph=function(i){return+i-1},gh=[null,Pe],dh=[null,vi],yh=["isPm",vi,function(i,r){var t=i.toLowerCase();return t===r.amPm[0]?0:t===r.amPm[1]?1:null}],mh=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(i){var r=(i+"").match(/([+-]|\d\d)/gi);if(r){var t=+r[1]*60+parseInt(r[2],10);return r[0]==="+"?t:-t}return 0}],Jy={D:["day",Pe],DD:["day",Be],Do:["day",Pe+vi,function(i){return parseInt(i,10)}],M:["month",Pe,ph],MM:["month",Be,ph],YY:["year",Be,function(i){var r=new Date,t=+(""+r.getFullYear()).substr(0,2);return+(""+(+i>68?t-1:t)+i)}],h:["hour",Pe,void 0,"isPm"],hh:["hour",Be,void 0,"isPm"],H:["hour",Pe],HH:["hour",Be],m:["minute",Pe],mm:["minute",Be],s:["second",Pe],ss:["second",Be],YYYY:["year",qy],S:["millisecond","\\d",function(i){return+i*100}],SS:["millisecond",Be,function(i){return+i*10}],SSS:["millisecond",Uy],d:gh,dd:gh,ddd:dh,dddd:dh,MMM:["month",vi,fh("monthNamesShort")],MMMM:["month",vi,fh("monthNames")],a:yh,A:yh,ZZ:mh,Z:mh},Nn={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},Zc=function(i){return $e(Nn,i)},Qc=function(i,r,t){if(r===void 0&&(r=Nn.default),t===void 0&&(t={}),typeof i=="number"&&(i=new Date(i)),Object.prototype.toString.call(i)!=="[object Date]"||isNaN(i.getTime()))throw new Error("Invalid Date pass to format");r=Nn[r]||r;var e=[];r=r.replace($c,function(a,o){return e.push(o),"@@@"});var n=$e($e({},Vn),t);return r=r.replace(Wc,function(a){return Ky[a](i,n)}),r.replace(/@@@/g,function(){return e.shift()})};function Kc(i,r,t){if(t===void 0&&(t={}),typeof r!="string")throw new Error("Invalid format in fecha parse");if(r=Nn[r]||r,i.length>1e3)return null;var e=new Date,n={year:e.getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},a=[],o=[],s=r.replace($c,function(x,S){return o.push(vh(S)),"@@@"}),l={},h={};s=vh(s).replace(Wc,function(x){var S=Jy[x],b=S[0],A=S[1],L=S[3];if(l[b])throw new Error("Invalid format. "+b+" specified twice in format");return l[b]=!0,L&&(h[L]=!0),a.push(S),"("+A+")"}),Object.keys(h).forEach(function(x){if(!l[x])throw new Error("Invalid format. "+x+" is required in specified format")}),s=s.replace(/@@@/g,function(){return o.shift()});var u=i.match(new RegExp(s,"i"));if(!u)return null;for(var c=$e($e({},Vn),t),f=1;f11||n.month<0||n.day>31||n.day<1||n.hour>23||n.hour<0||n.minute>59||n.minute<0||n.second>59||n.second<0)return null;return y}var Jc={format:Qc,parse:Kc,defaultI18n:ds,setGlobalDateI18n:qc,setGlobalDateMasks:Zc};const tm=Object.freeze(Object.defineProperty({__proto__:null,default:Jc,assign:$e,format:Qc,parse:Kc,defaultI18n:ds,setGlobalDateI18n:qc,setGlobalDateMasks:Zc},Symbol.toStringTag,{value:"Module"}));function em(i){return function(r,t,e,n){for(var a=I(e)?0:e,o=I(n)?r.length:n;a>>1;i(r[s])>t?o=s:a=s+1}return a}}var xh="format";function tf(i,r){var t=tm[xh]||Jc[xh];return t(i,r)}function Xn(i){return N(i)&&(i.indexOf("T")>0?i=new Date(i).getTime():i=new Date(i.replace(/-/gi,"/")).getTime()),Xu(i)&&(i=i.getTime()),i}var ie=1e3,sr=60*ie,lr=60*sr,we=24*lr,pi=we*31,wh=we*365,ti=[["HH:mm:ss",ie],["HH:mm:ss",ie*10],["HH:mm:ss",ie*30],["HH:mm",sr],["HH:mm",sr*10],["HH:mm",sr*30],["HH",lr],["HH",lr*6],["HH",lr*12],["YYYY-MM-DD",we],["YYYY-MM-DD",we*4],["YYYY-WW",we*7],["YYYY-MM",pi],["YYYY-MM",pi*4],["YYYY-MM",pi*6],["YYYY",we*380]];function rm(i,r,t){var e=(r-i)/t,n=em(function(o){return o[1]})(ti,e)-1,a=ti[n];return n<0?a=ti[0]:n>=ti.length&&(a=Ct(ti)),a}var im=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="timeCat",t}return r.prototype.translate=function(t){t=Xn(t);var e=this.values.indexOf(t);return e===-1&&(U(t)&&t-1){var a=this.values[n],o=this.formatter;return a=o?o(a,e):tf(a,this.mask),a}return t},r.prototype.initCfg=function(){this.tickMethod="time-cat",this.mask="YYYY-MM-DD",this.tickCount=7},r.prototype.setDomain=function(){var t=this.values;M(t,function(e,n){t[n]=Xn(e)}),t.sort(function(e,n){return e-n}),i.prototype.setDomain.call(this)},r}(xa),wa=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.isContinuous=!0,t}return r.prototype.scale=function(t){if(I(t))return NaN;var e=this.rangeMin(),n=this.rangeMax(),a=this.max,o=this.min;if(a===o)return e;var s=this.getScalePercent(t);return e+s*(n-e)},r.prototype.init=function(){i.prototype.init.call(this);var t=this.ticks,e=zt(t),n=Ct(t);ethis.max&&(this.max=n),I(this.minLimit)||(this.min=e),I(this.maxLimit)||(this.max=n)},r.prototype.setDomain=function(){var t=ap(this.values),e=t.min,n=t.max;I(this.min)&&(this.min=e),I(this.max)&&(this.max=n),this.min>this.max&&(this.min=e,this.max=n)},r.prototype.calculateTicks=function(){var t=this,e=i.prototype.calculateTicks.call(this);return this.nice||(e=Qt(e,function(n){return n>=t.min&&n<=t.max})),e},r.prototype.getScalePercent=function(t){var e=this.max,n=this.min;return(t-n)/(e-n)},r.prototype.getInvertPercent=function(t){return(t-this.rangeMin())/(this.rangeMax()-this.rangeMin())},r}(gs),Ca=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="linear",t.isLinear=!0,t}return r.prototype.invert=function(t){var e=this.getInvertPercent(t);return this.min+e*(this.max-this.min)},r.prototype.initCfg=function(){this.tickMethod="wilkinson-extended",this.nice=!1},r}(wa);function De(i,r){var t=Math.E,e;return r>=0?e=Math.pow(t,Math.log(r)/i):e=Math.pow(t,Math.log(-r)/i)*-1,e}function Ut(i,r){return i===1?1:Math.log(r)/Math.log(i)}function ef(i,r,t){I(t)&&(t=Math.max.apply(null,i));var e=t;return M(i,function(n){n>0&&n1&&(e=1),e}var nm=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="log",t}return r.prototype.invert=function(t){var e=this.base,n=Ut(e,this.max),a=this.rangeMin(),o=this.rangeMax()-a,s,l=this.positiveMin;if(l){if(t===0)return 0;s=Ut(e,l/e);var h=1/(n-s)*o;if(t=0?1:-1;return Math.pow(s,n)*l},r.prototype.initCfg=function(){this.tickMethod="pow",this.exponent=2,this.tickCount=5,this.nice=!0},r.prototype.getScalePercent=function(t){var e=this.max,n=this.min;if(e===n)return 0;var a=this.exponent,o=(De(a,t)-De(a,n))/(De(a,e)-De(a,n));return o},r}(wa),om=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="time",t}return r.prototype.getText=function(t,e){var n=this.translate(t),a=this.formatter;return a?a(n,e):tf(n,this.mask)},r.prototype.scale=function(t){var e=t;return(N(e)||Xu(e))&&(e=this.translate(e)),i.prototype.scale.call(this,e)},r.prototype.translate=function(t){return Xn(t)},r.prototype.initCfg=function(){this.tickMethod="time-pretty",this.mask="YYYY-MM-DD",this.tickCount=7,this.nice=!1},r.prototype.setDomain=function(){var t=this.values,e=this.getConfig("min"),n=this.getConfig("max");if((!I(e)||!U(e))&&(this.min=this.translate(this.min)),(!I(n)||!U(n))&&(this.max=this.translate(this.max)),t&&t.length){var a=[],o=1/0,s=o,l=0;M(t,function(h){var u=Xn(h);if(isNaN(u))throw new TypeError("Invalid Time: "+h+" in time scale!");o>u?(s=o,o=u):s>u&&(s=u),l1&&(this.minTickInterval=s-o),I(e)&&(this.min=o),I(n)&&(this.max=l)}},r}(Ca),rf=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="quantize",t}return r.prototype.invert=function(t){var e=this.ticks,n=e.length,a=this.getInvertPercent(t),o=Math.floor(a*(n-1));if(o>=n-1)return Ct(e);if(o<0)return zt(e);var s=e[o],l=e[o+1],h=o/(n-1),u=(o+1)/(n-1);return s+(a-h)/(u-h)*(l-s)},r.prototype.initCfg=function(){this.tickMethod="r-pretty",this.tickCount=5,this.nice=!0},r.prototype.calculateTicks=function(){var t=i.prototype.calculateTicks.call(this);return this.nice||(Ct(t)!==this.max&&t.push(this.max),zt(t)!==this.min&&t.unshift(this.min)),t},r.prototype.getScalePercent=function(t){var e=this.ticks;if(tCt(e))return 1;var n=0;return M(e,function(a,o){if(t>=a)n=o;else return!1}),n/(e.length-1)},r}(wa),sm=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="quantile",t}return r.prototype.initCfg=function(){this.tickMethod="quantile",this.tickCount=5,this.nice=!0},r}(rf),nf={};function Do(i){return nf[i]}function de(i,r){if(Do(i))throw new Error("type '"+i+"' existed.");nf[i]=r}var lm=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="identity",t.isIdentity=!0,t}return r.prototype.calculateTicks=function(){return this.values},r.prototype.scale=function(t){return this.values[0]!==t&&U(t)?t:this.range[0]},r.prototype.invert=function(t){var e=this.range;return te[1]?NaN:this.values[0]},r}(gs);function af(i){var r=i.values,t=i.tickInterval,e=i.tickCount,n=i.showLast;if(U(t)){var a=Qt(r,function(p,g){return g%t===0}),o=Ct(r);return n&&Ct(a)!==o&&a.push(o),a}var s=r.length,l=i.min,h=i.max;if(I(l)&&(l=0),I(h)&&(h=r.length-1),!U(e)||e>=s)return r.slice(l,h+1);if(e<=0||h<=0)return[];for(var u=e===1?s:Math.floor(s/(e-1)),c=[],f=l,v=0;v=h);v++)f=Math.min(l+v*u,h),v===e-1&&n?c.push(r[h]):c.push(r[f]);return c}function hm(i){var r=i.min,t=i.max,e=i.nice,n=i.tickCount,a=new um;return a.domain([r,t]),e&&a.nice(n),a.ticks(n)}var qa=5,Ch=Math.sqrt(50),Mh=Math.sqrt(10),Sh=Math.sqrt(2),um=function(){function i(){this._domain=[0,1]}return i.prototype.domain=function(r){return r?(this._domain=Array.from(r,Number),this):this._domain.slice()},i.prototype.nice=function(r){var t,e;r===void 0&&(r=qa);var n=this._domain.slice(),a=0,o=this._domain.length-1,s=this._domain[a],l=this._domain[o],h;return l0?(s=Math.floor(s/h)*h,l=Math.ceil(l/h)*h,h=Bn(s,l,r)):h<0&&(s=Math.ceil(s*h)/h,l=Math.floor(l*h)/h,h=Bn(s,l,r)),h>0?(n[a]=Math.floor(s/h)*h,n[o]=Math.ceil(l/h)*h,this.domain(n)):h<0&&(n[a]=Math.ceil(s*h)/h,n[o]=Math.floor(l*h)/h,this.domain(n)),this},i.prototype.ticks=function(r){return r===void 0&&(r=qa),cm(this._domain[0],this._domain[this._domain.length-1],r||qa)},i}();function cm(i,r,t){var e,n=-1,a,o,s;if(r=+r,i=+i,t=+t,i===r&&t>0)return[i];if((e=r0)for(i=Math.ceil(i/s),r=Math.floor(r/s),o=new Array(a=Math.ceil(r-i+1));++n=0?(a>=Ch?10:a>=Mh?5:a>=Sh?2:1)*Math.pow(10,n):-Math.pow(10,-n)/(a>=Ch?10:a>=Mh?5:a>=Sh?2:1)}function bh(i,r,t){var e;return t==="ceil"?e=Math.ceil(i/r):t==="floor"?e=Math.floor(i/r):e=Math.round(i/r),e*r}function ys(i,r,t){var e=bh(i,t,"floor"),n=bh(r,t,"ceil");e=Ra(e,t),n=Ra(n,t);for(var a=[],o=Math.max((n-e)/(Math.pow(2,12)-1),t),s=e;s<=n;s=s+o){var l=Ra(s,o);a.push(l)}return{min:e,max:n,ticks:a}}function ms(i,r,t){var e,n=i.minLimit,a=i.maxLimit,o=i.min,s=i.max,l=i.tickCount,h=l===void 0?5:l,u=I(n)?I(r)?o:r:n,c=I(a)?I(t)?s:t:a;if(u>c&&(e=[u,c],c=e[0],u=e[1]),h<=2)return[u,c];for(var f=(c-u)/(h-1),v=[],p=0;p=0&&(l=1),1-s/(o-1)-t+l}function ym(i,r,t){var e=Gt(r),n=_u(r,i),a=1;return 1-n/(e-1)-t+a}function mm(i,r,t,e,n,a){var o=(i-1)/(a-n),s=(r-1)/(Math.max(a,e)-Math.min(t,n));return 2-Math.max(o/s,s/o)}function xm(i,r){return i>=r?2-(i-1)/(r-1):1}function wm(i,r,t,e){var n=r-i;return 1-.5*(Math.pow(r-e,2)+Math.pow(i-t,2))/Math.pow(.1*n,2)}function Cm(i,r,t){var e=r-i;if(t>e){var n=(t-e)/2;return 1-Math.pow(n,2)/Math.pow(.1*e,2)}return 1}function Mm(){return 1}function Sm(i,r,t,e,n,a){t===void 0&&(t=5),e===void 0&&(e=!0),n===void 0&&(n=vm),a===void 0&&(a=[.25,.2,.5,.05]);var o=t<0?0:Math.round(t);if(Number.isNaN(i)||Number.isNaN(r)||typeof i!="number"||typeof r!="number"||!o)return{min:0,max:0,ticks:[]};if(r-i<1e-15||o===1)return{min:i,max:r,ticks:[i]};if(r-i>1e148){var s=t||5,l=(r-i)/s;return{min:i,max:r,ticks:Array(s).fill(null).map(function(vt,te){return tr(i+l*te)})}}for(var h={score:-2,lmin:0,lmax:0,lstep:0},u=1;u<1/0;){for(var c=0;ch.score&&(!e||L<=i&&k>=r)&&(h.lmin=L,h.lmax=k,h.lstep=B,h.score=_)}y+=1}p+=1}}u+=1}var K=tr(h.lmax),nt=tr(h.lmin),ht=tr(h.lstep),Q=Math.floor(gm((K-nt)/ht))+1,ut=new Array(Q);ut[0]=tr(nt);for(var c=1;c0)o=Math.floor(Ut(r,e));else{var l=ef(a,r,n);o=Math.floor(Ut(r,l))}for(var h=s-o,u=Math.ceil(h/t),c=[],f=o;f=0?1:-1;return Math.pow(o,r)*s})}function Lm(i,r){var t=i.length*r;return r===1?i[i.length-1]:r===0?i[0]:t%1!==0?i[Math.ceil(t)-1]:i.length%2===0?(i[t-1]+i[t])/2:i[t]}function Em(i){var r=i.tickCount,t=i.values;if(!t||!t.length)return[];for(var e=t.slice().sort(function(s,l){return s-l}),n=[],a=0;a1&&(n=n*Math.ceil(s)),e&&nwh)for(var l=zn(t),h=Math.ceil(a/wh),u=s;u<=l+h;u=u+h)o.push(Pm(u));else if(a>pi)for(var c=Math.ceil(a/pi),f=Ro(r),v=Fm(r,t),u=0;u<=v+c;u=u+c)o.push(Om(s,u+f));else if(a>we)for(var p=new Date(r),g=p.getFullYear(),d=p.getMonth(),y=p.getDate(),C=Math.ceil(a/we),m=Dm(r,t),u=0;ulr)for(var p=new Date(r),g=p.getFullYear(),d=p.getMonth(),C=p.getDate(),x=p.getHours(),S=Math.ceil(a/lr),b=Rm(r,t),u=0;u<=b+S;u=u+S)o.push(new Date(g,d,C,x+u).getTime());else if(a>sr)for(var A=Ym(r,t),L=Math.ceil(a/sr),u=0;u<=A+L;u=u+L)o.push(r+u*sr);else{var k=a;k=512&&console.warn("Notice: current ticks length("+o.length+') >= 512, may cause performance issues, even out of memory. Because of the configure "tickInterval"(in milliseconds, current is '+a+") is too small, increase the value to solve the problem!"),o}ge("cat",af);ge("time-cat",Im);ge("wilkinson-extended",bm);ge("r-pretty",Bm);ge("time",km);ge("time-pretty",Gm);ge("log",Am);ge("pow",Tm);ge("quantile",Em);ge("d3-linear",fm);de("cat",xa);de("category",xa);de("identity",lm);de("linear",Ca);de("log",nm);de("pow",am);de("time",om);de("timeCat",im);de("quantize",rf);de("quantile",sm);var sf={},lf=function(i){return sf[i.toLowerCase()]},$i=function(i,r){if(lf(i))throw new Error("Attribute type '"+i+"' existed.");sf[i.toLowerCase()]=r};$i("Color",Xy);$i("Opacity",zy);$i("Position",Wy);$i("Shape",$y);$i("Size",_y);var xs=function(){function i(r){this.type="coordinate",this.isRect=!1,this.isHelix=!1,this.isPolar=!1,this.isReflectX=!1,this.isReflectY=!1;var t=r.start,e=r.end,n=r.matrix,a=n===void 0?[1,0,0,0,1,0,0,0,1]:n,o=r.isTransposed,s=o===void 0?!1:o;this.start=t,this.end=e,this.matrix=a,this.originalMatrix=et([],a),this.isTransposed=s}return i.prototype.initial=function(){this.center={x:(this.start.x+this.end.x)/2,y:(this.start.y+this.end.y)/2},this.width=Math.abs(this.end.x-this.start.x),this.height=Math.abs(this.end.y-this.start.y)},i.prototype.update=function(r){ot(this,r),this.initial()},i.prototype.convertDim=function(r,t){var e,n=this[t],a=n.start,o=n.end;return this.isReflect(t)&&(e=[o,a],a=e[0],o=e[1]),a+r*(o-a)},i.prototype.invertDim=function(r,t){var e,n=this[t],a=n.start,o=n.end;return this.isReflect(t)&&(e=[o,a],a=e[0],o=e[1]),(r-a)/(o-a)},i.prototype.applyMatrix=function(r,t,e){e===void 0&&(e=0);var n=this.matrix,a=[r,t,e];return bi(a,a,n),a},i.prototype.invertMatrix=function(r,t,e){e===void 0&&(e=0);var n=this.matrix,a=fg([0,0,0,0,0,0,0,0,0],n),o=[r,t,e];return a&&bi(o,o,a),o},i.prototype.convert=function(r){var t=this.convertPoint(r),e=t.x,n=t.y,a=this.applyMatrix(e,n,1);return{x:a[0],y:a[1]}},i.prototype.invert=function(r){var t=this.invertMatrix(r.x,r.y,1);return this.invertPoint({x:t[0],y:t[1]})},i.prototype.rotate=function(r){var t=this.matrix,e=this.center;return Sr(t,t,[-e.x,-e.y]),os(t,t,r),Sr(t,t,[e.x,e.y]),this},i.prototype.reflect=function(r){return r==="x"?this.isReflectX=!this.isReflectX:this.isReflectY=!this.isReflectY,this},i.prototype.scale=function(r,t){var e=this.matrix,n=this.center;return Sr(e,e,[-n.x,-n.y]),sc(e,e,[r,t]),Sr(e,e,[n.x,n.y]),this},i.prototype.translate=function(r,t){var e=this.matrix;return Sr(e,e,[r,t]),this},i.prototype.transpose=function(){return this.isTransposed=!this.isTransposed,this},i.prototype.getCenter=function(){return this.center},i.prototype.getWidth=function(){return this.width},i.prototype.getHeight=function(){return this.height},i.prototype.getRadius=function(){return this.radius},i.prototype.isReflect=function(r){return r==="x"?this.isReflectX:this.isReflectY},i.prototype.resetMatrix=function(r){this.matrix=r||et([],this.originalMatrix)},i}(),hf=function(i){E(r,i);function r(t){var e=i.call(this,t)||this;return e.isRect=!0,e.type="cartesian",e.initial(),e}return r.prototype.initial=function(){i.prototype.initial.call(this);var t=this.start,e=this.end;this.x={start:t.x,end:e.x},this.y={start:t.y,end:e.y}},r.prototype.convertPoint=function(t){var e,n=t.x,a=t.y;return this.isTransposed&&(e=[a,n],n=e[0],a=e[1]),{x:this.convertDim(n,"x"),y:this.convertDim(a,"y")}},r.prototype.invertPoint=function(t){var e,n=this.invertDim(t.x,"x"),a=this.invertDim(t.y,"y");return this.isTransposed&&(e=[a,n],n=e[0],a=e[1]),{x:n,y:a}},r}(xs),Hm=function(i){E(r,i);function r(t){var e=i.call(this,t)||this;e.isHelix=!0,e.type="helix";var n=t.startAngle,a=n===void 0?1.25*Math.PI:n,o=t.endAngle,s=o===void 0?7.25*Math.PI:o,l=t.innerRadius,h=l===void 0?0:l,u=t.radius;return e.startAngle=a,e.endAngle=s,e.innerRadius=h,e.radius=u,e.initial(),e}return r.prototype.initial=function(){i.prototype.initial.call(this);var t=(this.endAngle-this.startAngle)/(2*Math.PI)+1,e=Math.min(this.width,this.height)/2;this.radius&&this.radius>=0&&this.radius<=1&&(e=e*this.radius),this.d=Math.floor(e*(1-this.innerRadius)/t),this.a=this.d/(Math.PI*2),this.x={start:this.startAngle,end:this.endAngle},this.y={start:this.innerRadius*e,end:this.innerRadius*e+this.d*.99}},r.prototype.convertPoint=function(t){var e,n=t.x,a=t.y;this.isTransposed&&(e=[a,n],n=e[0],a=e[1]);var o=this.convertDim(n,"x"),s=this.a*o,l=this.convertDim(a,"y");return{x:this.center.x+Math.cos(o)*(s+l),y:this.center.y+Math.sin(o)*(s+l)}},r.prototype.invertPoint=function(t){var e,n=this.d+this.y.start,a=ac([0,0],[t.x,t.y],[this.center.x,this.center.y]),o=ss(a,[1,0],!0),s=o*this.a;Lr(a)this.width/e?(s=this.width/e,this.circleCenter={x:this.center.x-(.5-a)*this.width,y:this.center.y-(.5-o)*s*n}):(s=this.height/n,this.circleCenter={x:this.center.x-(.5-a)*s*e,y:this.center.y-(.5-o)*this.height}),this.polarRadius=this.radius,this.radius?this.radius>0&&this.radius<=1?this.polarRadius=s*this.radius:(this.radius<=0||this.radius>s)&&(this.polarRadius=s):this.polarRadius=s,this.x={start:this.startAngle,end:this.endAngle},this.y={start:this.innerRadius*this.polarRadius,end:this.polarRadius}},r.prototype.getRadius=function(){return this.polarRadius},r.prototype.convertPoint=function(t){var e,n=this.getCenter(),a=t.x,o=t.y;return this.isTransposed&&(e=[o,a],a=e[0],o=e[1]),a=this.convertDim(a,"x"),o=this.convertDim(o,"y"),{x:n.x+Math.cos(a)*o,y:n.y+Math.sin(a)*o}},r.prototype.invertPoint=function(t){var e,n=this.getCenter(),a=[t.x-n.x,t.y-n.y],o=this,s=o.startAngle,l=o.endAngle;this.isReflect("x")&&(e=[l,s],s=e[0],l=e[1]);var h=[1,0,0,0,1,0,0,0,1];os(h,h,s);var u=[1,0,0];bi(u,u,h);var c=[u[0],u[1]],f=ss(c,a,l0?p:-p;var g=this.invertDim(v,"y"),d={x:0,y:0};return d.x=this.isTransposed?g:p,d.y=this.isTransposed?p:g,d},r.prototype.getCenter=function(){return this.circleCenter},r.prototype.getOneBox=function(){var t=this.startAngle,e=this.endAngle;if(Math.abs(e-t)>=Math.PI*2)return{minX:-1,maxX:1,minY:-1,maxY:1};for(var n=[0,Math.cos(t),Math.cos(e)],a=[0,Math.sin(t),Math.sin(e)],o=Math.min(t,e);o=0;e--)i.removeChild(r[e])}function Wm(i,r){return!!i.className.match(new RegExp("(\\s|^)"+r+"(\\s|$)"))}function Ii(i){var r=i.start,t=i.end,e=Math.min(r.x,t.x),n=Math.min(r.y,t.y),a=Math.max(r.x,t.x),o=Math.max(r.y,t.y);return{x:e,y:n,minX:e,minY:n,maxX:a,maxY:o,width:a-e,height:o-n}}function $m(i){var r=i.map(function(s){return s.x}),t=i.map(function(s){return s.y}),e=Math.min.apply(Math,r),n=Math.min.apply(Math,t),a=Math.max.apply(Math,r),o=Math.max.apply(Math,t);return{x:e,y:n,minX:e,minY:n,maxX:a,maxY:o,width:a-e,height:o-n}}function Sa(i,r,t,e){var n=i+t,a=r+e;return{x:i,y:r,width:t,height:e,minX:i,minY:r,maxX:isNaN(n)?0:n,maxY:isNaN(a)?0:a}}function hr(i,r,t){return(1-t)*i+r*t}function Pr(i,r,t){return{x:i.x+Math.cos(t)*r,y:i.y+Math.sin(t)*r}}function _m(i,r){var t=r.x-i.x,e=r.y-i.y;return Math.sqrt(t*t+e*e)}var $n=function(i,r,t){return t===void 0&&(t=Math.pow(Number.EPSILON,.5)),[i,r].includes(1/0)?Math.abs(i)===Math.abs(r):Math.abs(i-r)0?M(l,function(h){if(h.get("visible")){if(h.isGroup()&&h.get("children").length===0)return!0;var u=pf(h),c=h.applyToMatrix([u.minX,u.minY,1]),f=h.applyToMatrix([u.minX,u.maxY,1]),v=h.applyToMatrix([u.maxX,u.minY,1]),p=h.applyToMatrix([u.maxX,u.maxY,1]),g=Math.min(c[0],f[0],v[0],p[0]),d=Math.max(c[0],f[0],v[0],p[0]),y=Math.min(c[1],f[1],v[1],p[1]),C=Math.max(c[1],f[1],v[1],p[1]);ga&&(a=d),ys&&(s=C)}}):(n=0,a=0,o=0,s=0),e=Sa(n,o,a-n,s-o)}return t?jm(e,t):e}function Um(i,r){if(!(!i.getClip()&&!r.getClip())){var t=r.getClip();if(!t){i.setClip(null);return}var e={type:t.get("type"),attrs:t.attr()};i.setClip(e)}}function Pt(i){return i+"px"}function gf(i,r,t,e){var n=_m(i,r),a=e/n,o=0;return t==="start"?o=0-a:t==="end"&&(o=1+a),{x:hr(i.x,r.x,o),y:hr(i.y,r.y,o)}}var qm={none:[],point:["x","y"],region:["start","end"],points:["points"],circle:["center","radius","startAngle","endAngle"]},df=function(i){E(r,i);function r(t){var e=i.call(this,t)||this;return e.initCfg(),e}return r.prototype.getDefaultCfg=function(){return{id:"",name:"",type:"",locationType:"none",offsetX:0,offsetY:0,animate:!1,capture:!0,updateAutoRender:!1,animateOption:{appear:null,update:{duration:400,easing:"easeQuadInOut"},enter:{duration:400,easing:"easeQuadInOut"},leave:{duration:350,easing:"easeQuadIn"}},events:null,defaultCfg:{},visible:!0}},r.prototype.clear=function(){},r.prototype.update=function(t){var e=this,n=this.get("defaultCfg")||{};M(t,function(a,o){var s=e.get(o),l=a;s!==a&&(rt(a)&&n[o]&&(l=D({},n[o],a)),e.set(o,l))}),this.updateInner(t),this.afterUpdate(t)},r.prototype.updateInner=function(t){},r.prototype.afterUpdate=function(t){Or(t,"visible")&&(t.visible?this.show():this.hide()),Or(t,"capture")&&this.setCapture(t.capture)},r.prototype.getLayoutBBox=function(){return this.getBBox()},r.prototype.getLocationType=function(){return this.get("locationType")},r.prototype.getOffset=function(){return{offsetX:this.get("offsetX"),offsetY:this.get("offsetY")}},r.prototype.setOffset=function(t,e){this.update({offsetX:t,offsetY:e})},r.prototype.setLocation=function(t){var e=w({},t);this.update(e)},r.prototype.getLocation=function(){var t=this,e={},n=this.get("locationType"),a=qm[n];return M(a,function(o){e[o]=t.get(o)}),e},r.prototype.isList=function(){return!1},r.prototype.isSlider=function(){return!1},r.prototype.init=function(){},r.prototype.initCfg=function(){var t=this,e=this.get("defaultCfg");M(e,function(n,a){var o=t.get(a);if(rt(o)){var s=D({},n,o);t.set(a,s)}})},r}(na),Ke="update_status",Zm=["visible","tip","delegateObject"],Qm=["container","group","shapesMap","isRegister","isUpdating","destroyed"],St=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{container:null,shapesMap:{},group:null,capture:!0,isRegister:!1,isUpdating:!1,isInit:!0})},r.prototype.remove=function(){this.clear();var t=this.get("group");t.remove()},r.prototype.clear=function(){var t=this.get("group");t.clear(),this.set("shapesMap",{}),this.clearOffScreenCache(),this.set("isInit",!0)},r.prototype.getChildComponentById=function(t){var e=this.getElementById(t),n=e&&e.get("component");return n},r.prototype.getElementById=function(t){return this.get("shapesMap")[t]},r.prototype.getElementByLocalId=function(t){var e=this.getElementId(t);return this.getElementById(e)},r.prototype.getElementsByName=function(t){var e=[];return M(this.get("shapesMap"),function(n){n.get("name")===t&&e.push(n)}),e},r.prototype.getContainer=function(){return this.get("container")},r.prototype.updateInner=function(t){this.offScreenRender(),this.get("updateAutoRender")&&this.render()},r.prototype.render=function(){var t=this.get("offScreenGroup");t||(t=this.offScreenRender());var e=this.get("group");this.updateElements(t,e),this.deleteElements(),this.applyOffset(),this.get("eventInitted")||(this.initEvent(),this.set("eventInitted",!0)),this.set("isInit",!1)},r.prototype.show=function(){var t=this.get("group");t.show(),this.set("visible",!0)},r.prototype.hide=function(){var t=this.get("group");t.hide(),this.set("visible",!1)},r.prototype.setCapture=function(t){var e=this.get("group");e.set("capture",t),this.set("capture",t)},r.prototype.destroy=function(){this.removeEvent(),this.remove(),i.prototype.destroy.call(this)},r.prototype.getBBox=function(){return this.get("group").getCanvasBBox()},r.prototype.getLayoutBBox=function(){var t=this.get("group"),e=this.getInnerLayoutBBox(),n=t.getTotalMatrix();return n&&(e=zm(n,e)),e},r.prototype.on=function(t,e,n){var a=this.get("group");return a.on(t,e,n),this},r.prototype.off=function(t,e){var n=this.get("group");return n&&n.off(t,e),this},r.prototype.emit=function(t,e){var n=this.get("group");n.emit(t,e)},r.prototype.init=function(){i.prototype.init.call(this),this.get("group")||this.initGroup(),this.offScreenRender()},r.prototype.getInnerLayoutBBox=function(){return this.get("offScreenBBox")||this.get("group").getBBox()},r.prototype.delegateEmit=function(t,e){var n=this.get("group");e.target=n,n.emit(t,e),cf(n,t,e)},r.prototype.createOffScreenGroup=function(){var t=this.get("group"),e=t.getGroupBase(),n=new e({delegateObject:this.getDelegateObject()});return n},r.prototype.applyOffset=function(){var t=this.get("offsetX"),e=this.get("offsetY");this.moveElementTo(this.get("group"),{x:t,y:e})},r.prototype.initGroup=function(){var t=this.get("container");this.set("group",t.addGroup({id:this.get("id"),name:this.get("name"),capture:this.get("capture"),visible:this.get("visible"),isComponent:!0,component:this,delegateObject:this.getDelegateObject()}))},r.prototype.offScreenRender=function(){this.clearOffScreenCache();var t=this.createOffScreenGroup();return this.renderInner(t),this.set("offScreenGroup",t),this.set("offScreenBBox",pf(t)),t},r.prototype.addGroup=function(t,e){this.appendDelegateObject(t,e);var n=t.addGroup(e);return this.get("isRegister")&&this.registerElement(n),n},r.prototype.addShape=function(t,e){this.appendDelegateObject(t,e);var n=t.addShape(e);return this.get("isRegister")&&this.registerElement(n),n},r.prototype.addComponent=function(t,e){var n=e.id,a=e.component,o=mt(e,["id","component"]),s=new a(w(w({},o),{id:n,container:t,updateAutoRender:this.get("updateAutoRender")}));return s.init(),s.render(),this.get("isRegister")&&this.registerElement(s.get("group")),s},r.prototype.initEvent=function(){},r.prototype.removeEvent=function(){var t=this.get("group");t.off()},r.prototype.getElementId=function(t){var e=this.get("id"),n=this.get("name");return e+"-"+n+"-"+t},r.prototype.registerElement=function(t){var e=t.get("id");this.get("shapesMap")[e]=t},r.prototype.unregisterElement=function(t){var e=t.get("id");delete this.get("shapesMap")[e]},r.prototype.moveElementTo=function(t,e){var n=ws(e);t.attr("matrix",n)},r.prototype.addAnimation=function(t,e,n){var a=e.attr("opacity");I(a)&&(a=1),e.attr("opacity",0),e.animate({opacity:a},n)},r.prototype.removeAnimation=function(t,e,n){e.animate({opacity:0},n)},r.prototype.updateAnimation=function(t,e,n,a){e.animate(n,a)},r.prototype.updateElements=function(t,e){var n=this,a=this.get("animate"),o=this.get("animateOption"),s=t.getChildren().slice(0),l;M(s,function(h){var u=h.get("id"),c=n.getElementById(u),f=h.get("name");if(c)if(h.get("isComponent")){var v=h.get("component"),p=c.get("component"),g=rs(v.cfg,ep(Vi(v.cfg),Qm));p.update(g),c.set(Ke,"update")}else{var d=n.getReplaceAttrs(c,h);a&&o.update?n.updateAnimation(f,c,d,o.update):c.attr(d),h.isGroup()&&n.updateElements(h,c),M(Zm,function(x){c.set(x,h.get(x))}),Um(c,h),l=c,c.set(Ke,"update")}else{e.add(h);var y=e.getChildren();if(y.splice(y.length-1,1),l){var C=y.indexOf(l);y.splice(C+1,0,h)}else y.unshift(h);if(n.registerElement(h),h.set(Ke,"add"),h.get("isComponent")){var v=h.get("component");v.set("container",e)}else h.isGroup()&&n.registerNewGroup(h);if(l=h,a){var m=n.get("isInit")?o.appear:o.enter;m&&n.addAnimation(f,h,m)}}})},r.prototype.clearUpdateStatus=function(t){var e=t.getChildren();M(e,function(n){n.set(Ke,null)})},r.prototype.clearOffScreenCache=function(){var t=this.get("offScreenGroup");t&&t.destroy(),this.set("offScreenGroup",null),this.set("offScreenBBox",null)},r.prototype.getDelegateObject=function(){var t,e=this.get("name"),n=(t={},t[e]=this,t.component=this,t);return n},r.prototype.appendDelegateObject=function(t,e){var n=t.get("delegateObject");e.delegateObject||(e.delegateObject={}),ot(e.delegateObject,n)},r.prototype.getReplaceAttrs=function(t,e){var n=t.attr(),a=e.attr();return M(n,function(o,s){a[s]===void 0&&(a[s]=void 0)}),a},r.prototype.registerNewGroup=function(t){var e=this,n=t.getChildren();M(n,function(a){e.registerElement(a),a.set(Ke,"add"),a.isGroup()&&e.registerNewGroup(a)})},r.prototype.deleteElements=function(){var t=this,e=this.get("shapesMap"),n=[];M(e,function(s,l){!s.get(Ke)||s.destroyed?n.push([l,s]):s.set(Ke,null)});var a=this.get("animate"),o=this.get("animateOption");M(n,function(s){var l=s[0],h=s[1];if(!h.destroyed){var u=h.get("name");if(a&&o.leave){var c=ot({callback:function(){t.removeElement(h)}},o.leave);t.removeAnimation(u,h,c)}else t.removeElement(h)}delete e[l]})},r.prototype.removeElement=function(t){if(t.get("isGroup")){var e=t.get("component");e&&e.destroy()}t.remove()},r}(df),Za="\u2026";function Km(i){for(var r=0,t=0;t0&&i.charCodeAt(r)<128?1:2}function Jm(i,r,t){t===void 0&&(t="tail");var e=i.length,n="";if(t==="tail"){for(var a=0,o=0;a=19968&&s<=40869?a+=2:a+=1}a>t&&(t=a,e=n)}return i[e].getBBox().width}function Yo(i){if(i.length>r0)return i0(i);var r=0;return M(i,function(t){var e=t.getBBox(),n=e.width;r=0?f=Jm(a,c,e):f=t0,f&&(r.attr("text",f),u=!0)}return u?r.set("tip",a):r.set("tip",null),u}function ba(i,r){var t=r.x,e=r.y,n=r.content,a=r.style,o=r.id,s=r.name,l=r.rotate,h=r.maxLength,u=r.autoEllipsis,c=r.isVertical,f=r.ellipsisPosition,v=r.background,p=i.addGroup({id:o+"-group",name:s+"-group",attrs:{x:t,y:e}}),g=p.addShape({type:"text",id:o,name:s,attrs:w({x:0,y:0,text:n},a)}),d=Wn(T(v,"padding",0));if(h&&u){var y=h-(d[1]+d[3]);di(!c,g,y,f)}if(v){var C=T(v,"style",{}),m=g.getCanvasBBox(),x=m.minX,S=m.minY,b=m.width,A=m.height,L=p.addShape("rect",{id:o+"-bg",name:o+"-bg",attrs:w({x:x-d[3],y:S-d[0],width:b+d[1]+d[3],height:A+d[0]+d[2]},C)});L.toBack()}gi(p,t,e),vf(p,l,t,e)}const X={fontFamily:` BlinkMacSystemFont, "Segoe UI", Roboto,"Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", SimSun, "sans-serif"`,textColor:"#2C3542",activeTextColor:"#333333",uncheckedColor:"#D8D8D8",lineColor:"#416180",regionColor:"#CCD7EB",verticalAxisRotate:-Math.PI/4,horizontalAxisRotate:Math.PI/4,descriptionIconStroke:"#fff",descriptionIconFill:"rgba(58, 73, 101, .25)"};var a0=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"annotation",type:"line",locationType:"region",start:null,end:null,style:{},text:null,defaultCfg:{style:{fill:X.textColor,fontSize:12,textAlign:"center",textBaseline:"bottom",fontFamily:X.fontFamily},text:{position:"center",autoRotate:!0,content:null,offsetX:0,offsetY:0,style:{stroke:X.lineColor,lineWidth:1}}}})},r.prototype.renderInner=function(t){this.renderLine(t),this.get("text")&&this.renderLabel(t)},r.prototype.renderLine=function(t){var e=this.get("start"),n=this.get("end"),a=this.get("style");this.addShape(t,{type:"line",id:this.getElementId("line"),name:"annotation-line",attrs:w({x1:e.x,y1:e.y,x2:n.x,y2:n.y},a)})},r.prototype.getLabelPoint=function(t,e,n){var a;return n==="start"?a=0:n==="center"?a=.5:N(n)&&n.indexOf("%")!==-1?a=parseInt(n,10)/100:U(n)?a=n:a=1,(a>1||a<0)&&(a=1),{x:hr(t.x,e.x,a),y:hr(t.y,e.y,a)}},r.prototype.renderLabel=function(t){var e=this.get("text"),n=this.get("start"),a=this.get("end"),o=e.position,s=e.content,l=e.style,h=e.offsetX,u=e.offsetY,c=e.autoRotate,f=e.maxLength,v=e.autoEllipsis,p=e.ellipsisPosition,g=e.background,d=e.isVertical,y=d===void 0?!1:d,C=this.getLabelPoint(n,a,o),m=C.x+h,x=C.y+u,S={id:this.getElementId("line-text"),name:"annotation-line-text",x:m,y:x,content:s,style:l,maxLength:f,autoEllipsis:v,ellipsisPosition:p,background:g,isVertical:y};if(c){var b=[a.x-n.x,a.y-n.y];S.rotate=Math.atan2(b[1],b[0])}ba(t,S)},r}(St),o0=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"annotation",type:"text",locationType:"point",x:0,y:0,content:"",rotate:null,style:{},background:null,maxLength:null,autoEllipsis:!0,isVertical:!1,ellipsisPosition:"tail",defaultCfg:{style:{fill:X.textColor,fontSize:12,textAlign:"center",textBaseline:"middle",fontFamily:X.fontFamily}}})},r.prototype.setLocation=function(t){this.set("x",t.x),this.set("y",t.y),this.resetLocation()},r.prototype.renderInner=function(t){var e=this.getLocation(),n=e.x,a=e.y,o=this.get("content"),s=this.get("style"),l=this.getElementId("text"),h=this.get("name")+"-text",u=this.get("maxLength"),c=this.get("autoEllipsis"),f=this.get("isVertical"),v=this.get("ellipsisPosition"),p=this.get("background"),g=this.get("rotate"),d={id:l,name:h,x:n,y:a,content:o,style:s,maxLength:u,autoEllipsis:c,isVertical:f,ellipsisPosition:v,background:p,rotate:g};ba(t,d)},r.prototype.resetLocation=function(){var t=this.getElementByLocalId("text-group");if(t){var e=this.getLocation(),n=e.x,a=e.y,o=this.get("rotate");gi(t,n,a),vf(t,o,n,a)}},r}(St),s0=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"annotation",type:"arc",locationType:"circle",center:null,radius:100,startAngle:-Math.PI/2,endAngle:Math.PI*3/2,style:{stroke:"#999",lineWidth:1}})},r.prototype.renderInner=function(t){this.renderArc(t)},r.prototype.getArcPath=function(){var t=this.getLocation(),e=t.center,n=t.radius,a=t.startAngle,o=t.endAngle,s=Pr(e,n,a),l=Pr(e,n,o),h=o-a>Math.PI?1:0,u=[["M",s.x,s.y]];if(o-a===Math.PI*2){var c=Pr(e,n,a+Math.PI);u.push(["A",n,n,0,h,1,c.x,c.y]),u.push(["A",n,n,0,h,1,l.x,l.y])}else u.push(["A",n,n,0,h,1,l.x,l.y]);return u},r.prototype.renderArc=function(t){var e=this.getArcPath(),n=this.get("style");this.addShape(t,{type:"path",id:this.getElementId("arc"),name:"annotation-arc",attrs:w({path:e},n)})},r}(St),l0=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"annotation",type:"region",locationType:"region",start:null,end:null,style:{},defaultCfg:{style:{lineWidth:0,fill:X.regionColor,opacity:.4}}})},r.prototype.renderInner=function(t){this.renderRegion(t)},r.prototype.renderRegion=function(t){var e=this.get("start"),n=this.get("end"),a=this.get("style"),o=Ii({start:e,end:n});this.addShape(t,{type:"rect",id:this.getElementId("region"),name:"annotation-region",attrs:w({x:o.x,y:o.y,width:o.width,height:o.height},a)})},r}(St),h0=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"annotation",type:"image",locationType:"region",start:null,end:null,src:null,style:{}})},r.prototype.renderInner=function(t){this.renderImage(t)},r.prototype.getImageAttrs=function(){var t=this.get("start"),e=this.get("end"),n=this.get("style"),a=Ii({start:t,end:e}),o=this.get("src");return w({x:a.x,y:a.y,img:o,width:a.width,height:a.height},n)},r.prototype.renderImage=function(t){this.addShape(t,{type:"image",id:this.getElementId("image"),name:"annotation-image",attrs:this.getImageAttrs()})},r}(St),u0=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"annotation",type:"dataMarker",locationType:"point",x:0,y:0,point:{},line:{},text:{},direction:"upward",autoAdjust:!0,coordinateBBox:null,defaultCfg:{point:{display:!0,style:{r:3,fill:"#FFFFFF",stroke:"#1890FF",lineWidth:2}},line:{display:!0,length:20,style:{stroke:X.lineColor,lineWidth:1}},text:{content:"",display:!0,style:{fill:X.textColor,opacity:.65,fontSize:12,textAlign:"start",fontFamily:X.fontFamily}}}})},r.prototype.renderInner=function(t){T(this.get("line"),"display")&&this.renderLine(t),T(this.get("text"),"display")&&this.renderText(t),T(this.get("point"),"display")&&this.renderPoint(t),this.get("autoAdjust")&&this.autoAdjust(t)},r.prototype.applyOffset=function(){this.moveElementTo(this.get("group"),{x:this.get("x")+this.get("offsetX"),y:this.get("y")+this.get("offsetY")})},r.prototype.renderPoint=function(t){var e=this.getShapeAttrs().point;this.addShape(t,{type:"circle",id:this.getElementId("point"),name:"annotation-point",attrs:e})},r.prototype.renderLine=function(t){var e=this.getShapeAttrs().line;this.addShape(t,{type:"path",id:this.getElementId("line"),name:"annotation-line",attrs:e})},r.prototype.renderText=function(t){var e=this.getShapeAttrs().text,n=e.x,a=e.y,o=e.text,s=mt(e,["x","y","text"]),l=this.get("text"),h=l.background,u=l.maxLength,c=l.autoEllipsis,f=l.isVertival,v=l.ellipsisPosition,p={x:n,y:a,id:this.getElementId("text"),name:"annotation-text",content:o,style:s,background:h,maxLength:u,autoEllipsis:c,isVertival:f,ellipsisPosition:v};ba(t,p)},r.prototype.autoAdjust=function(t){var e=this.get("direction"),n=this.get("x"),a=this.get("y"),o=T(this.get("line"),"length",0),s=this.get("coordinateBBox"),l=t.getBBox(),h=l.minX,u=l.maxX,c=l.minY,f=l.maxY,v=t.findById(this.getElementId("text-group")),p=t.findById(this.getElementId("text")),g=t.findById(this.getElementId("line"));if(!!s){if(v){if(n+h<=s.minX){var d=s.minX-(n+h);gi(v,v.attr("x")+d,v.attr("y"))}if(n+u>=s.maxX){var d=n+u-s.maxX;gi(v,v.attr("x")-d,v.attr("y"))}}if(e==="upward"&&a+c<=s.minY||e!=="upward"&&a+f>=s.maxY){var y=void 0,C=void 0;e==="upward"&&a+c<=s.minY?(y="top",C=1):(y="bottom",C=-1),p.attr("textBaseline",y),g&&g.attr("path",[["M",0,0],["L",0,o*C]]),gi(v,v.attr("x"),(o+2)*C)}}},r.prototype.getShapeAttrs=function(){var t=T(this.get("line"),"display"),e=T(this.get("point"),"style",{}),n=T(this.get("line"),"style",{}),a=T(this.get("text"),"style",{}),o=this.get("direction"),s=t?T(this.get("line"),"length",0):0,l=o==="upward"?-1:1;return{point:w({x:0,y:0},e),line:w({path:[["M",0,0],["L",0,s*l]]},n),text:w({x:0,y:(s+2)*l,text:T(this.get("text"),"content",""),textBaseline:o==="upward"?"bottom":"top"},a)}},r}(St),c0=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"annotation",type:"dataRegion",locationType:"points",points:[],lineLength:0,region:{},text:{},defaultCfg:{region:{style:{lineWidth:0,fill:X.regionColor,opacity:.4}},text:{content:"",style:{textAlign:"center",textBaseline:"bottom",fontSize:12,fill:X.textColor,fontFamily:X.fontFamily}}}})},r.prototype.renderInner=function(t){var e=T(this.get("region"),"style",{});T(this.get("text"),"style",{});var n=this.get("lineLength")||0,a=this.get("points");if(!!a.length){var o=$m(a),s=[];s.push(["M",a[0].x,o.minY-n]),a.forEach(function(h){s.push(["L",h.x,h.y])}),s.push(["L",a[a.length-1].x,a[a.length-1].y-n]),this.addShape(t,{type:"path",id:this.getElementId("region"),name:"annotation-region",attrs:w({path:s},e)});var l=w({id:this.getElementId("text"),name:"annotation-text",x:(o.minX+o.maxX)/2,y:o.minY-n},this.get("text"));ba(t,l)}},r}(St),f0=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"annotation",type:"regionFilter",locationType:"region",start:null,end:null,color:null,shape:[]})},r.prototype.renderInner=function(t){var e=this,n=this.get("start"),a=this.get("end"),o=this.addGroup(t,{id:this.getElementId("region-filter"),capture:!1});M(this.get("shapes"),function(l,h){var u=l.get("type"),c=Xt(l.attr());e.adjustShapeAttrs(c),e.addShape(o,{id:e.getElementId("shape-"+u+"-"+h),capture:!1,type:u,attrs:c})});var s=Ii({start:n,end:a});o.setClip({type:"rect",attrs:{x:s.minX,y:s.minY,width:s.width,height:s.height}})},r.prototype.adjustShapeAttrs=function(t){var e=this.get("color");t.fill&&(t.fill=t.fillStyle=e),t.stroke=t.strokeStyle=e},r}(St),v0=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"annotation",type:"shape",draw:Ye})},r.prototype.renderInner=function(t){var e=this.get("render");G(e)&&e(t)},r}(St),Ms=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{container:null,containerTpl:"
",updateAutoRender:!0,containerClassName:"",parent:null})},r.prototype.getContainer=function(){return this.get("container")},r.prototype.show=function(){var t=this.get("container");t.style.display="",this.set("visible",!0)},r.prototype.hide=function(){var t=this.get("container");t.style.display="none",this.set("visible",!1)},r.prototype.setCapture=function(t){var e=this.getContainer(),n=t?"auto":"none";e.style.pointerEvents=n,this.set("capture",t)},r.prototype.getBBox=function(){var t=this.getContainer(),e=parseFloat(t.style.left)||0,n=parseFloat(t.style.top)||0;return Sa(e,n,t.clientWidth,t.clientHeight)},r.prototype.clear=function(){var t=this.get("container");Cs(t)},r.prototype.destroy=function(){this.removeEvent(),this.removeDom(),i.prototype.destroy.call(this)},r.prototype.init=function(){i.prototype.init.call(this),this.initContainer(),this.initDom(),this.resetStyles(),this.applyStyles(),this.initEvent(),this.initCapture(),this.initVisible()},r.prototype.initCapture=function(){this.setCapture(this.get("capture"))},r.prototype.initVisible=function(){this.get("visible")?this.show():this.hide()},r.prototype.initDom=function(){},r.prototype.initContainer=function(){var t=this.get("container");if(I(t)){t=this.createDom();var e=this.get("parent");N(e)&&(e=document.getElementById(e),this.set("parent",e)),e.appendChild(t),this.get("containerId")&&t.setAttribute("id",this.get("containerId")),this.set("container",t)}else N(t)&&(t=document.getElementById(t),this.set("container",t));this.get("parent")||this.set("parent",t.parentNode)},r.prototype.resetStyles=function(){var t=this.get("domStyles"),e=this.get("defaultStyles");t?t=D({},e,t):t=e,this.set("domStyles",t)},r.prototype.applyStyles=function(){var t=this.get("domStyles");if(!!t){var e=this.getContainer();this.applyChildrenStyles(e,t);var n=this.get("containerClassName");if(n&&Wm(e,n)){var a=t[n];bt(e,a)}}},r.prototype.applyChildrenStyles=function(t,e){M(e,function(n,a){var o=t.getElementsByClassName(a);M(o,function(s){bt(s,n)})})},r.prototype.applyStyle=function(t,e){var n=this.get("domStyles");bt(e,n[t])},r.prototype.createDom=function(){var t=this.get("containerTpl");return Xe(t)},r.prototype.initEvent=function(){},r.prototype.removeDom=function(){var t=this.get("container");t&&t.parentNode&&t.parentNode.removeChild(t)},r.prototype.removeEvent=function(){},r.prototype.updateInner=function(t){Or(t,"domStyles")&&(this.resetStyles(),this.applyStyles()),this.resetPosition()},r.prototype.resetPosition=function(){},r}(df),p0=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"annotation",type:"html",locationType:"point",x:0,y:0,containerTpl:'
',alignX:"left",alignY:"top",html:"",zIndex:7})},r.prototype.render=function(){var t=this.getContainer(),e=this.get("html");Cs(t);var n=G(e)?e(t):e;if(zu(n))t.appendChild(n);else if(N(n)||U(n)){var a=Xe(""+n);a&&t.appendChild(a)}this.resetPosition()},r.prototype.resetPosition=function(){var t=this.getContainer(),e=this.getLocation(),n=e.x,a=e.y,o=this.get("alignX"),s=this.get("alignY"),l=this.get("offsetX"),h=this.get("offsetY"),u=Op(t),c=Pp(t),f={x:n,y:a};o==="middle"?f.x-=Math.round(u/2):o==="right"&&(f.x-=Math.round(u)),s==="middle"?f.y-=Math.round(c/2):s==="bottom"&&(f.y-=Math.round(c)),l&&(f.x+=l),h&&(f.y+=h),bt(t,{position:"absolute",left:f.x+"px",top:f.y+"px",zIndex:this.get("zIndex")})},r}(Ms);const g0=Object.freeze(Object.defineProperty({__proto__:null,Line:a0,Text:o0,Arc:s0,Region:l0,Image:h0,DataMarker:u0,DataRegion:c0,RegionFilter:f0,Shape:v0,Html:p0},Symbol.toStringTag,{value:"Module"}));function li(i,r,t){var e=r+"Style",n=null;return M(t,function(a,o){i[o]&&a[e]&&(n||(n={}),ot(n,a[e]))}),n}var yf=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"axis",ticks:[],line:{},tickLine:{},subTickLine:null,title:null,label:{},verticalFactor:1,verticalLimitLength:null,overlapOrder:["autoRotate","autoEllipsis","autoHide"],tickStates:{},optimize:{},defaultCfg:{line:{style:{lineWidth:1,stroke:X.lineColor}},tickLine:{style:{lineWidth:1,stroke:X.lineColor},alignTick:!0,length:5,displayWithLabel:!0},subTickLine:{style:{lineWidth:1,stroke:X.lineColor},count:4,length:2},label:{autoRotate:!0,autoHide:!1,autoEllipsis:!1,style:{fontSize:12,fill:X.textColor,fontFamily:X.fontFamily,fontWeight:"normal"},offset:10,offsetX:0,offsetY:0},title:{autoRotate:!0,spacing:5,position:"center",style:{fontSize:12,fill:X.textColor,textBaseline:"middle",fontFamily:X.fontFamily,textAlign:"center"},iconStyle:{fill:X.descriptionIconFill,stroke:X.descriptionIconStroke},description:""},tickStates:{active:{labelStyle:{fontWeight:500},tickLineStyle:{lineWidth:2}},inactive:{labelStyle:{fill:X.uncheckedColor}}},optimize:{enable:!0,threshold:400}},theme:{}})},r.prototype.renderInner=function(t){this.get("line")&&this.drawLine(t),this.drawTicks(t),this.get("title")&&this.drawTitle(t)},r.prototype.isList=function(){return!0},r.prototype.getItems=function(){return this.get("ticks")},r.prototype.setItems=function(t){this.update({ticks:t})},r.prototype.updateItem=function(t,e){ot(t,e),this.clear(),this.render()},r.prototype.clearItems=function(){var t=this.getElementByLocalId("label-group");t&&t.clear()},r.prototype.setItemState=function(t,e,n){t[e]=n,this.updateTickStates(t)},r.prototype.hasState=function(t,e){return!!t[e]},r.prototype.getItemStates=function(t){var e=this.get("tickStates"),n=[];return M(e,function(a,o){t[o]&&n.push(o)}),n},r.prototype.clearItemsState=function(t){var e=this,n=this.getItemsByState(t);M(n,function(a){e.setItemState(a,t,!1)})},r.prototype.getItemsByState=function(t){var e=this,n=this.getItems();return Qt(n,function(a){return e.hasState(a,t)})},r.prototype.getSidePoint=function(t,e){var n=this,a=n.getSideVector(e,t);return{x:t.x+a[0],y:t.y+a[1]}},r.prototype.getTextAnchor=function(t){var e;return xt(t[0],0)?e="center":t[0]>0?e="start":t[0]<0&&(e="end"),e},r.prototype.getTextBaseline=function(t){var e;return xt(t[1],0)?e="middle":t[1]>0?e="top":t[1]<0&&(e="bottom"),e},r.prototype.processOverlap=function(t){},r.prototype.drawLine=function(t){var e=this.getLinePath(),n=this.get("line");this.addShape(t,{type:"path",id:this.getElementId("line"),name:"axis-line",attrs:ot({path:e},n.style)})},r.prototype.getTickLineItems=function(t){var e=this,n=[],a=this.get("tickLine"),o=a.alignTick,s=a.length,l=1,h=t.length;return h>=2&&(l=t[1].value-t[0].value),M(t,function(u){var c=u.point;o||(c=e.getTickPoint(u.value-l/2));var f=e.getSidePoint(c,s);n.push({startPoint:c,tickValue:u.value,endPoint:f,tickId:u.id,id:"tickline-"+u.id})}),n},r.prototype.getSubTickLineItems=function(t){var e=[],n=this.get("subTickLine"),a=n.count,o=t.length;if(o>=2)for(var s=0;s0){var n=Gt(e);if(n>t.threshold){var a=Math.ceil(n/t.threshold),o=e.filter(function(s,l){return l%a===0});this.set("ticks",o),this.set("originalTicks",e)}}},r.prototype.getLabelAttrs=function(t,e,n){var a=this.get("label"),o=a.offset,s=a.offsetX,l=a.offsetY,h=a.rotate,u=a.formatter,c=this.getSidePoint(t.point,o),f=this.getSideVector(o,c),v=u?u(t.name,t,e):t.name,p=a.style;p=G(p)?T(this.get("theme"),["label","style"],{}):p;var g=ot({x:c.x+s,y:c.y+l,text:v,textAlign:this.getTextAnchor(f),textBaseline:this.getTextBaseline(f)},p);return h&&(g.matrix=vr(c,h)),g},r.prototype.drawLabels=function(t){var e=this,n=this.get("ticks"),a=this.addGroup(t,{name:"axis-label-group",id:this.getElementId("label-group")});M(n,function(f,v){e.addShape(a,{type:"text",name:"axis-label",id:e.getElementId("label-"+f.id),attrs:e.getLabelAttrs(f,v,n),delegateObject:{tick:f,item:f,index:v}})}),this.processOverlap(a);var o=a.getChildren(),s=T(this.get("theme"),["label","style"],{}),l=this.get("label"),h=l.style,u=l.formatter;if(G(h)){var c=o.map(function(f){return T(f.get("delegateObject"),"tick")});M(o,function(f,v){var p=f.get("delegateObject").tick,g=u?u(p.name,p,v):p.name,d=ot({},s,h(g,v,c));f.attr(d)})}},r.prototype.getTitleAttrs=function(){var t=this.get("title"),e=t.style,n=t.position,a=t.offset,o=t.spacing,s=o===void 0?0:o,l=t.autoRotate,h=e.fontSize,u=.5;n==="start"?u=0:n==="end"&&(u=1);var c=this.getTickPoint(u),f=this.getSidePoint(c,a||s+h/2),v=ot({x:f.x,y:f.y,text:t.text},e),p=t.rotate,g=p;if(I(p)&&l){var d=this.getAxisVector(c),y=[1,0];g=ss(d,y,!0)}if(g){var C=vr(f,g);v.matrix=C}return v},r.prototype.drawTitle=function(t){var e,n=this.getTitleAttrs(),a=this.addShape(t,{type:"text",id:this.getElementId("title"),name:"axis-title",attrs:n});!((e=this.get("title"))===null||e===void 0)&&e.description&&this.drawDescriptionIcon(t,a,n.matrix)},r.prototype.drawDescriptionIcon=function(t,e,n){var a=this.addGroup(t,{name:"axis-description",id:this.getElementById("description")}),o=e.getBBox(),s=o.maxX,l=o.maxY,h=o.height,u=this.get("title").iconStyle,c=4,f=h/2,v=f/6,p=s+c,g=l-h/2,d=[p+f,g-f],y=d[0],C=d[1],m=[y+f,C+f],x=m[0],S=m[1],b=[y,S+f],A=b[0],L=b[1],k=[p,C+f],B=k[0],O=k[1],R=[p+f,g-h/4],H=R[0],z=R[1],_=[H,z+v],K=_[0],nt=_[1],ht=[K,nt+v],Q=ht[0],ut=ht[1],vt=[Q,ut+f*3/4],te=vt[0],mr=vt[1];this.addShape(a,{type:"path",id:this.getElementId("title-description-icon"),name:"axis-title-description-icon",attrs:w({path:[["M",y,C],["A",f,f,0,0,1,x,S],["A",f,f,0,0,1,A,L],["A",f,f,0,0,1,B,O],["A",f,f,0,0,1,y,C],["M",H,z],["L",K,nt],["M",Q,ut],["L",te,mr]],lineWidth:v,matrix:n},u)}),this.addShape(a,{type:"rect",id:this.getElementId("title-description-rect"),name:"axis-title-description-rect",attrs:{x:p,y:g-h/2,width:h,height:h,stroke:"#000",fill:"#000",opacity:0,matrix:n,cursor:"pointer"}})},r.prototype.applyTickStates=function(t,e){var n=this.getItemStates(t);if(n.length){var a=this.get("tickStates"),o=this.getElementId("label-"+t.id),s=e.findById(o);if(s){var l=li(t,"label",a);l&&s.attr(l)}var h=this.getElementId("tickline-"+t.id),u=e.findById(h);if(u){var c=li(t,"tickLine",a);c&&u.attr(c)}}},r.prototype.updateTickStates=function(t){var e=this.getItemStates(t),n=this.get("tickStates"),a=this.get("label"),o=this.getElementByLocalId("label-"+t.id),s=this.get("tickLine"),l=this.getElementByLocalId("tickline-"+t.id);if(e.length){if(o){var h=li(t,"label",n);h&&o.attr(h)}if(l){var u=li(t,"tickLine",n);u&&l.attr(u)}}else o&&o.attr(a.style),l&&l.attr(s.style)},r}(St);function Ss(i,r,t,e){var n=r.getChildren(),a=!1;return M(n,function(o){var s=di(i,o,t,e);a=a||s}),a}function d0(){return mf}function y0(i,r,t){return Ss(i,r,t,"head")}function mf(i,r,t){return Ss(i,r,t,"tail")}function m0(i,r,t){return Ss(i,r,t,"middle")}const x0=Object.freeze(Object.defineProperty({__proto__:null,getDefault:d0,ellipsisHead:y0,ellipsisTail:mf,ellipsisMiddle:m0},Symbol.toStringTag,{value:"Module"}));function w0(i){var r=i.attr("matrix");return r&&r[0]!==1}function xf(i){var r=w0(i)?Xm(i.attr("matrix")):0;return r%360}function Go(i,r,t,e){var n=!1,a=xf(r),o=Math.abs(i?t.attr("y")-r.attr("y"):t.attr("x")-r.attr("x")),s=(i?t.attr("y")>r.attr("y"):t.attr("x")>r.attr("x"))?r.getBBox():t.getBBox();if(i){var l=Math.abs(Math.cos(a));$n(l,0,Math.PI/180)?n=s.width+e>o:n=s.height/l+e>o}else{var l=Math.abs(Math.sin(a));$n(l,0,Math.PI/180)?n=s.width+e>o:n=s.height/l+e>o}return n}function Pi(i,r,t,e){var n=(e==null?void 0:e.minGap)||0,a=r.getChildren().slice().filter(function(v){return v.get("visible")});if(!a.length)return!1;var o=!1;t&&a.reverse();for(var s=a.length,l=a[0],h=l,u=1;u1){f=Math.ceil(f);for(var g=0;g2){var o=n[0],s=n[n.length-1];o.get("visible")||(o.show(),Pi(i,r,!1,e)&&(a=!0)),s.get("visible")||(s.show(),Pi(i,r,!0,e)&&(a=!0))}return a}const T0=Object.freeze(Object.defineProperty({__proto__:null,getDefault:C0,reserveFirst:M0,reserveLast:S0,reserveBoth:b0,equidistance:Cf,equidistanceWithReverseBoth:A0},Symbol.toStringTag,{value:"Module"}));function L0(i,r){M(i,function(t){var e=t.attr("x"),n=t.attr("y"),a=vr({x:e,y:n},r);t.attr("matrix",a)})}function Mf(i,r,t,e){var n=r.getChildren();if(!n.length||!i&&n.length<2)return!1;var a=Yo(n),o=!1;if(i)o=!!t&&a>t;else{var s=Math.abs(n[1].attr("x")-n[0].attr("x"));o=a>s}if(o){var l=e(t,a);L0(n,l)}return o}function E0(){return Sf}function Sf(i,r,t,e){return Mf(i,r,t,function(){return U(e)?e:i?X.verticalAxisRotate:X.horizontalAxisRotate})}function B0(i,r,t){return Mf(i,r,t,function(e,n){if(!e)return i?X.verticalAxisRotate:X.horizontalAxisRotate;if(i)return-Math.acos(e/n);var a=0;return e>n?a=Math.PI/4:(a=Math.asin(e/n),a>Math.PI/4&&(a=Math.PI/4)),a})}const k0=Object.freeze(Object.defineProperty({__proto__:null,getDefault:E0,fixedAngle:Sf,unfixedAngle:B0},Symbol.toStringTag,{value:"Module"})),bf=Object.freeze(Object.defineProperty({__proto__:null,autoHide:T0,autoRotate:k0,autoEllipsis:x0},Symbol.toStringTag,{value:"Module"}));var I0=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{type:"line",locationType:"region",start:null,end:null})},r.prototype.getLinePath=function(){var t=this.get("start"),e=this.get("end"),n=[];return n.push(["M",t.x,t.y]),n.push(["L",e.x,e.y]),n},r.prototype.getInnerLayoutBBox=function(){var t=this.get("start"),e=this.get("end"),n=i.prototype.getInnerLayoutBBox.call(this),a=Math.min(t.x,e.x,n.x),o=Math.min(t.y,e.y,n.y),s=Math.max(t.x,e.x,n.maxX),l=Math.max(t.y,e.y,n.maxY);return{x:a,y:o,minX:a,minY:o,maxX:s,maxY:l,width:s-a,height:l-o}},r.prototype.isVertical=function(){var t=this.get("start"),e=this.get("end");return xt(t.x,e.x)},r.prototype.isHorizontal=function(){var t=this.get("start"),e=this.get("end");return xt(t.y,e.y)},r.prototype.getTickPoint=function(t){var e=this,n=e.get("start"),a=e.get("end"),o=a.x-n.x,s=a.y-n.y;return{x:n.x+o*t,y:n.y+s*t}},r.prototype.getSideVector=function(t){var e=this.getAxisVector(),n=oc([0,0],e),a=this.get("verticalFactor"),o=[n[1],n[0]*-1];return qt([0,0],o,t*a)},r.prototype.getAxisVector=function(){var t=this.get("start"),e=this.get("end");return[e.x-t.x,e.y-t.y]},r.prototype.processOverlap=function(t){var e=this,n=this.isVertical(),a=this.isHorizontal();if(!(!n&&!a)){var o=this.get("label"),s=this.get("title"),l=this.get("verticalLimitLength"),h=o.offset,u=l,c=0,f=0;s&&(c=s.style.fontSize,f=s.spacing),u&&(u=u-h-f-c);var v=this.get("overlapOrder");if(M(v,function(d){o[d]&&e.canProcessOverlap(d)&&e.autoProcessOverlap(d,o[d],t,u)}),s&&I(s.offset)){var p=t.getCanvasBBox(),g=n?p.width:p.height;s.offset=h+g+f+c/2}}},r.prototype.canProcessOverlap=function(t){var e=this.get("label");return t==="autoRotate"?I(e.rotate):!0},r.prototype.autoProcessOverlap=function(t,e,n,a){var o=this,s=this.isVertical(),l=!1,h=bf[t];if(e===!0)this.get("label"),l=h.getDefault()(s,n,a);else if(G(e))l=e(s,n,a);else if(rt(e)){var u=e;h[u.type]&&(l=h[u.type](s,n,a,u.cfg))}else h[e]&&(l=h[e](s,n,a));if(t==="autoRotate"){if(l){var c=n.getChildren(),f=this.get("verticalFactor");M(c,function(p){var g=p.attr("textAlign");if(g==="center"){var d=f>0?"end":"start";p.attr("textAlign",d)}})}}else if(t==="autoHide"){var v=n.getChildren().slice(0);M(v,function(p){p.get("visible")||(o.get("isRegister")&&o.unregisterElement(p),p.remove())})}},r}(yf),P0=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{type:"circle",locationType:"circle",center:null,radius:null,startAngle:-Math.PI/2,endAngle:Math.PI*3/2})},r.prototype.getLinePath=function(){var t=this.get("center"),e=t.x,n=t.y,a=this.get("radius"),o=a,s=this.get("startAngle"),l=this.get("endAngle"),h=[];if(Math.abs(l-s)===Math.PI*2)h=[["M",e,n-o],["A",a,o,0,1,1,e,n+o],["A",a,o,0,1,1,e,n-o],["Z"]];else{var u=this.getCirclePoint(s),c=this.getCirclePoint(l),f=Math.abs(l-s)>Math.PI?1:0,v=s>l?0:1;h=[["M",e,n],["L",u.x,u.y],["A",a,o,0,f,v,c.x,c.y],["L",e,n]]}return h},r.prototype.getTickPoint=function(t){var e=this.get("startAngle"),n=this.get("endAngle"),a=e+(n-e)*t;return this.getCirclePoint(a)},r.prototype.getSideVector=function(t,e){var n=this.get("center"),a=[e.x-n.x,e.y-n.y],o=this.get("verticalFactor"),s=Lr(a);return qt(a,a,o*t/s),a},r.prototype.getAxisVector=function(t){var e=this.get("center"),n=[t.x-e.x,t.y-e.y];return[n[1],-1*n[0]]},r.prototype.getCirclePoint=function(t,e){var n=this.get("center");return e=e||this.get("radius"),{x:n.x+Math.cos(t)*e,y:n.y+Math.sin(t)*e}},r.prototype.canProcessOverlap=function(t){var e=this.get("label");return t==="autoRotate"?I(e.rotate):!0},r.prototype.processOverlap=function(t){var e=this,n=this.get("label"),a=this.get("title"),o=this.get("verticalLimitLength"),s=n.offset,l=o,h=0,u=0;a&&(h=a.style.fontSize,u=a.spacing),l&&(l=l-s-u-h);var c=this.get("overlapOrder");if(M(c,function(v){n[v]&&e.canProcessOverlap(v)&&e.autoProcessOverlap(v,n[v],t,l)}),a&&I(a.offset)){var f=t.getCanvasBBox().height;a.offset=s+f+u+h/2}},r.prototype.autoProcessOverlap=function(t,e,n,a){var o=this,s=!1,l=bf[t];if(a>0)if(e===!0)s=l.getDefault()(!1,n,a);else if(G(e))s=e(!1,n,a);else if(rt(e)){var h=e;l[h.type]&&(s=l[h.type](!1,n,a,h.cfg))}else l[e]&&(s=l[e](!1,n,a));if(t==="autoRotate"){if(s){var u=n.getChildren(),c=this.get("verticalFactor");M(u,function(v){var p=v.attr("textAlign");if(p==="center"){var g=c>0?"end":"start";v.attr("textAlign",g)}})}}else if(t==="autoHide"){var f=n.getChildren().slice(0);M(f,function(v){v.get("visible")||(o.get("isRegister")&&o.unregisterElement(v),v.remove())})}},r}(yf),bs=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"crosshair",type:"base",line:{},text:null,textBackground:{},capture:!1,defaultCfg:{line:{style:{lineWidth:1,stroke:X.lineColor}},text:{position:"start",offset:10,autoRotate:!1,content:null,style:{fill:X.textColor,textAlign:"center",textBaseline:"middle",fontFamily:X.fontFamily}},textBackground:{padding:5,style:{stroke:X.lineColor}}}})},r.prototype.renderInner=function(t){this.get("line")&&this.renderLine(t),this.get("text")&&(this.renderText(t),this.renderBackground(t))},r.prototype.renderText=function(t){var e=this.get("text"),n=e.style,a=e.autoRotate,o=e.content;if(!I(o)){var s=this.getTextPoint(),l=null;if(a){var h=this.getRotateAngle();l=vr(s,h)}this.addShape(t,{type:"text",name:"crosshair-text",id:this.getElementId("text"),attrs:w(w(w({},s),{text:o,matrix:l}),n)})}},r.prototype.renderLine=function(t){var e=this.getLinePath(),n=this.get("line"),a=n.style;this.addShape(t,{type:"path",name:"crosshair-line",id:this.getElementId("line"),attrs:w({path:e},a)})},r.prototype.renderBackground=function(t){var e=this.getElementId("text"),n=t.findById(e),a=this.get("textBackground");if(a&&n){var o=n.getBBox(),s=Wn(a.padding),l=a.style,h=this.addShape(t,{type:"rect",name:"crosshair-text-background",id:this.getElementId("text-background"),attrs:w({x:o.x-s[3],y:o.y-s[0],width:o.width+s[1]+s[3],height:o.height+s[0]+s[2],matrix:n.attr("matrix")},l)});h.toBack()}},r}(St),Af=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{type:"line",locationType:"region",start:null,end:null})},r.prototype.getRotateAngle=function(){var t=this.getLocation(),e=t.start,n=t.end,a=this.get("text").position,o=Math.atan2(n.y-e.y,n.x-e.x),s=a==="start"?o-Math.PI/2:o+Math.PI/2;return s},r.prototype.getTextPoint=function(){var t=this.getLocation(),e=t.start,n=t.end,a=this.get("text"),o=a.position,s=a.offset;return gf(e,n,o,s)},r.prototype.getLinePath=function(){var t=this.getLocation(),e=t.start,n=t.end;return[["M",e.x,e.y],["L",n.x,n.y]]},r}(bs),F0=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{type:"circle",locationType:"circle",center:null,radius:100,startAngle:-Math.PI/2,endAngle:Math.PI*3/2})},r.prototype.getRotateAngle=function(){var t=this.getLocation(),e=t.startAngle,n=t.endAngle,a=this.get("text").position,o=a==="start"?e+Math.PI/2:n-Math.PI/2;return o},r.prototype.getTextPoint=function(){var t=this.get("text"),e=t.position,n=t.offset,a=this.getLocation(),o=a.center,s=a.radius,l=a.startAngle,h=a.endAngle,u=e==="start"?l:h,c=this.getRotateAngle()-Math.PI,f=Pr(o,s,u),v=Math.cos(c)*n,p=Math.sin(c)*n;return{x:f.x+v,y:f.y+p}},r.prototype.getLinePath=function(){var t=this.getLocation(),e=t.center,n=t.radius,a=t.startAngle,o=t.endAngle,s=null;if(o-a===Math.PI*2){var l=e.x,h=e.y;s=[["M",l,h-n],["A",n,n,0,1,1,l,h+n],["A",n,n,0,1,1,l,h-n],["Z"]]}else{var u=Pr(e,n,a),c=Pr(e,n,o),f=Math.abs(o-a)>Math.PI?1:0,v=a>o?0:1;s=[["M",u.x,u.y],["A",n,n,0,f,v,c.x,c.y]]}return s},r}(bs),Fi="g2-crosshair",Ho=Fi+"-line",Vo=Fi+"-text",ei;const O0=(ei={},ei[""+Fi]={position:"relative"},ei[""+Ho]={position:"absolute",backgroundColor:"rgba(0, 0, 0, 0.25)"},ei[""+Vo]={position:"absolute",color:X.textColor,fontFamily:X.fontFamily},ei);var D0=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"crosshair",type:"html",locationType:"region",start:{x:0,y:0},end:{x:0,y:0},capture:!1,text:null,containerTpl:'
',crosshairTpl:'
',textTpl:'{content}',domStyles:null,containerClassName:Fi,defaultStyles:O0,defaultCfg:{text:{position:"start",content:null,align:"center",offset:10}}})},r.prototype.render=function(){this.resetText(),this.resetPosition()},r.prototype.initCrossHair=function(){var t=this.getContainer(),e=this.get("crosshairTpl"),n=Xe(e);t.appendChild(n),this.applyStyle(Ho,n),this.set("crosshairEl",n)},r.prototype.getTextPoint=function(){var t=this.getLocation(),e=t.start,n=t.end,a=this.get("text"),o=a.position,s=a.offset;return gf(e,n,o,s)},r.prototype.resetText=function(){var t=this.get("text"),e=this.get("textEl");if(t){var n=t.content;if(!e){var a=this.getContainer(),o=Nu(this.get("textTpl"),t);e=Xe(o),a.appendChild(e),this.applyStyle(Vo,e),this.set("textEl",e)}e.innerHTML=n}else e&&e.remove()},r.prototype.isVertical=function(t,e){return t.x===e.x},r.prototype.resetPosition=function(){var t=this.get("crosshairEl");t||(this.initCrossHair(),t=this.get("crosshairEl"));var e=this.get("start"),n=this.get("end"),a=Math.min(e.x,n.x),o=Math.min(e.y,n.y);this.isVertical(e,n)?bt(t,{width:"1px",height:Pt(Math.abs(n.y-e.y))}):bt(t,{height:"1px",width:Pt(Math.abs(n.x-e.x))}),bt(t,{top:Pt(o),left:Pt(a)}),this.alignText()},r.prototype.alignText=function(){var t=this.get("textEl");if(t){var e=this.get("text").align,n=t.clientWidth,a=this.getTextPoint();switch(e){case"center":a.x=a.x-n/2;break;case"right":a.x=a.x-n}bt(t,{top:Pt(a.y),left:Pt(a.x)})}},r.prototype.updateInner=function(t){Or(t,"text")&&this.resetText(),i.prototype.updateInner.call(this,t)},r}(Ms);const Th=Object.freeze(Object.defineProperty({__proto__:null,Line:Af,Circle:F0,Base:bs,Html:D0},Symbol.toStringTag,{value:"Module"}));var Tf=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"grid",line:{},alternateColor:null,capture:!1,items:[],closed:!1,defaultCfg:{line:{type:"line",style:{lineWidth:1,stroke:X.lineColor}}}})},r.prototype.getLineType=function(){var t=this.get("line")||this.get("defaultCfg").line;return t.type},r.prototype.renderInner=function(t){this.drawGrid(t)},r.prototype.getAlternatePath=function(t,e){var n=this.getGridPath(t),a=e.slice(0).reverse(),o=this.getGridPath(a,!0),s=this.get("closed");return s?n=n.concat(o):(o[0][0]="L",n=n.concat(o),n.push(["Z"])),n},r.prototype.getPathStyle=function(){return this.get("line").style},r.prototype.drawGrid=function(t){var e=this,n=this.get("line"),a=this.get("items"),o=this.get("alternateColor"),s=null;M(a,function(l,h){var u=l.id||h;if(n){var c=e.getPathStyle();c=G(c)?c(l,h,a):c;var f=e.getElementId("line-"+u),v=e.getGridPath(l.points);e.addShape(t,{type:"path",name:"grid-line",id:f,attrs:ot({path:v},c)})}if(o&&h>0){var p=e.getElementId("region-"+u),g=h%2===0;if(N(o))g&&e.drawAlternateRegion(p,t,s.points,l.points,o);else{var d=g?o[1]:o[0];e.drawAlternateRegion(p,t,s.points,l.points,d)}}s=l})},r.prototype.drawAlternateRegion=function(t,e,n,a,o){var s=this.getAlternatePath(n,a);this.addShape(e,{type:"path",id:t,name:"grid-region",attrs:{path:s,fill:o}})},r}(St);function R0(i,r,t,e){var n=t-i,a=e-r;return Math.sqrt(n*n+a*a)}var Y0=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{type:"circle",center:null,closed:!0})},r.prototype.getGridPath=function(t,e){var n=this.getLineType(),a=this.get("closed"),o=[];if(t.length)if(n==="circle"){var s=this.get("center"),l=t[0],h=R0(s.x,s.y,l.x,l.y),u=e?0:1;a?(o.push(["M",s.x,s.y-h]),o.push(["A",h,h,0,0,u,s.x,s.y+h]),o.push(["A",h,h,0,0,u,s.x,s.y-h]),o.push(["Z"])):M(t,function(c,f){f===0?o.push(["M",c.x,c.y]):o.push(["A",h,h,0,0,u,c.x,c.y])})}else M(t,function(c,f){f===0?o.push(["M",c.x,c.y]):o.push(["L",c.x,c.y])}),a&&o.push(["Z"]);return o},r}(Tf),G0=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{type:"line"})},r.prototype.getGridPath=function(t){var e=[];return M(t,function(n,a){a===0?e.push(["M",n.x,n.y]):e.push(["L",n.x,n.y])}),e},r}(Tf),Lf=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"legend",layout:"horizontal",locationType:"point",x:0,y:0,offsetX:0,offsetY:0,title:null,background:null})},r.prototype.getLayoutBBox=function(){var t=i.prototype.getLayoutBBox.call(this),e=this.get("maxWidth"),n=this.get("maxHeight"),a=t.width,o=t.height;return e&&(a=Math.min(a,e)),n&&(o=Math.min(o,n)),Sa(t.minX,t.minY,a,o)},r.prototype.setLocation=function(t){this.set("x",t.x),this.set("y",t.y),this.resetLocation()},r.prototype.resetLocation=function(){var t=this.get("x"),e=this.get("y"),n=this.get("offsetX"),a=this.get("offsetY");this.moveElementTo(this.get("group"),{x:t+n,y:e+a})},r.prototype.applyOffset=function(){this.resetLocation()},r.prototype.getDrawPoint=function(){return this.get("currentPoint")},r.prototype.setDrawPoint=function(t){return this.set("currentPoint",t)},r.prototype.renderInner=function(t){this.resetDraw(),this.get("title")&&this.drawTitle(t),this.drawLegendContent(t),this.get("background")&&this.drawBackground(t)},r.prototype.drawBackground=function(t){var e=this.get("background"),n=t.getBBox(),a=Wn(e.padding),o=w({x:0,y:0,width:n.width+a[1]+a[3],height:n.height+a[0]+a[2]},e.style),s=this.addShape(t,{type:"rect",id:this.getElementId("background"),name:"legend-background",attrs:o});s.toBack()},r.prototype.drawTitle=function(t){var e=this.get("currentPoint"),n=this.get("title"),a=n.spacing,o=n.style,s=n.text,l=this.addShape(t,{type:"text",id:this.getElementId("title"),name:"legend-title",attrs:w({text:s,x:e.x,y:e.y},o)}),h=l.getBBox();this.set("currentPoint",{x:e.x,y:h.maxY+a})},r.prototype.resetDraw=function(){var t=this.get("background"),e={x:0,y:0};if(t){var n=Wn(t.padding);e.x=n[3],e.y=n[0]}this.set("currentPoint",e)},r}(St),Qa={marker:{style:{inactiveFill:"#000",inactiveOpacity:.45,fill:"#000",opacity:1,size:12}},text:{style:{fill:"#ccc",fontSize:12}}},un={fill:X.textColor,fontSize:12,textAlign:"start",textBaseline:"middle",fontFamily:X.fontFamily,fontWeight:"normal",lineHeight:12},Ka="navigation-arrow-right",Ja="navigation-arrow-left",Lh={right:90*Math.PI/180,left:(360-90)*Math.PI/180,up:0,down:180*Math.PI/180},H0=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.currentPageIndex=1,t.totalPagesCnt=1,t.pageWidth=0,t.pageHeight=0,t.startX=0,t.startY=0,t.onNavigationBack=function(){var e=t.getElementByLocalId("item-group");if(t.currentPageIndex>1){t.currentPageIndex-=1,t.updateNavigation();var n=t.getCurrentNavigationMatrix();t.get("animate")?e.animate({matrix:n},100):e.attr({matrix:n})}},t.onNavigationAfter=function(){var e=t.getElementByLocalId("item-group");if(t.currentPageIndexd&&(d=A),v==="horizontal"?(y&&yx&&(x=O.width)}),S=x,x+=f,h&&(x=Math.min(h,x),S=Math.min(h,S)),this.pageWidth=x,this.pageHeight=u-Math.max(d.height,v+b);var k=Math.floor(this.pageHeight/(v+b));M(l,function(B,O){O!==0&&O%k===0&&(C+=1,y.x+=x,y.y=o),n.moveElementTo(B,y),B.getParent().setClip({type:"rect",attrs:{x:y.x,y:y.y,width:x,height:v}}),y.y+=v+b}),this.totalPagesCnt=C,this.moveElementTo(g,{x:a+S/2-d.width/2-d.minX,y:u-d.height-d.minY})}this.pageHeight&&this.pageWidth&&e.getParent().setClip({type:"rect",attrs:{x:this.startX,y:this.startY,width:this.pageWidth,height:this.pageHeight}}),s==="horizontal"&&this.get("maxRow")?this.totalPagesCnt=Math.ceil(C/this.get("maxRow")):this.totalPagesCnt=C,this.currentPageIndex>this.totalPagesCnt&&(this.currentPageIndex=1),this.updateNavigation(g),e.attr("matrix",this.getCurrentNavigationMatrix())},r.prototype.drawNavigation=function(t,e,n,a){var o={x:0,y:0},s=this.addGroup(t,{id:this.getElementId("navigation-group"),name:"legend-navigation"}),l=T(a.marker,"style",{}),h=l.size,u=h===void 0?12:h,c=mt(l,["size"]),f=this.drawArrow(s,o,Ja,e==="horizontal"?"up":"left",u,c);f.on("click",this.onNavigationBack);var v=f.getBBox();o.x+=v.width+2;var p=this.addShape(s,{type:"text",id:this.getElementId("navigation-text"),name:"navigation-text",attrs:w({x:o.x,y:o.y+u/2,text:n,textBaseline:"middle"},T(a.text,"style"))}),g=p.getBBox();o.x+=g.width+2;var d=this.drawArrow(s,o,Ka,e==="horizontal"?"down":"right",u,c);return d.on("click",this.onNavigationAfter),s},r.prototype.updateNavigation=function(t){var e=D({},Qa,this.get("pageNavigator")),n=e.marker.style,a=n.fill,o=n.opacity,s=n.inactiveFill,l=n.inactiveOpacity,h=this.currentPageIndex+"/"+this.totalPagesCnt,u=t?t.getChildren()[1]:this.getElementByLocalId("navigation-text"),c=t?t.findById(this.getElementId(Ja)):this.getElementByLocalId(Ja),f=t?t.findById(this.getElementId(Ka)):this.getElementByLocalId(Ka);u.attr("text",h),c.attr("opacity",this.currentPageIndex===1?l:o),c.attr("fill",this.currentPageIndex===1?s:a),c.attr("cursor",this.currentPageIndex===1?"not-allowed":"pointer"),f.attr("opacity",this.currentPageIndex===this.totalPagesCnt?l:o),f.attr("fill",this.currentPageIndex===this.totalPagesCnt?s:a),f.attr("cursor",this.currentPageIndex===this.totalPagesCnt?"not-allowed":"pointer");var v=c.getBBox().maxX+2;u.attr("x",v),v+=u.getBBox().width+2,this.updateArrowPath(f,{x:v,y:0})},r.prototype.drawArrow=function(t,e,n,a,o,s){var l=e.x,h=e.y,u=this.addShape(t,{type:"path",id:this.getElementId(n),name:n,attrs:w({size:o,direction:a,path:[["M",l+o/2,h],["L",l,h+o],["L",l+o,h+o],["Z"]],cursor:"pointer"},s)});return u.attr("matrix",vr({x:l+o/2,y:h+o/2},Lh[a])),u},r.prototype.updateArrowPath=function(t,e){var n=e.x,a=e.y,o=t.attr(),s=o.size,l=o.direction,h=vr({x:n+s/2,y:a+s/2},Lh[l]);t.attr("path",[["M",n+s/2,a],["L",n,a+s],["L",n+s,a+s],["Z"]]),t.attr("matrix",h)},r.prototype.getCurrentNavigationMatrix=function(){var t=this,e=t.currentPageIndex,n=t.pageWidth,a=t.pageHeight,o=this.get("layout"),s=o==="horizontal"?{x:0,y:a*(1-e)}:{x:n*(1-e),y:0};return ws(s)},r.prototype.applyItemStates=function(t,e){var n=this.getItemStates(t),a=n.length>0;if(a){var o=e.getChildren(),s=this.get("itemStates");M(o,function(l){var h=l.get("name"),u=h.split("-")[2],c=li(t,u,s);c&&(l.attr(c),u==="marker"&&!(l.get("isStroke")&&l.get("isFill"))&&(l.get("isStroke")&&l.attr("fill",null),l.get("isFill")&&l.attr("stroke",null)))})}},r.prototype.getLimitItemWidth=function(){var t=this.get("itemWidth"),e=this.get("maxItemWidth");return e?t&&(e=t<=e?t:e):t&&(e=t),e},r}(Lf),V0=1.4,Eh=.4,N0=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{type:"continue",min:0,max:100,value:null,colors:[],track:{},rail:{},label:{},handler:{},slidable:!0,tip:null,step:null,maxWidth:null,maxHeight:null,defaultCfg:{label:{align:"rail",spacing:5,formatter:null,style:{fontSize:12,fill:X.textColor,textBaseline:"middle",fontFamily:X.fontFamily}},handler:{size:10,style:{fill:"#fff",stroke:"#333"}},track:{},rail:{type:"color",size:20,defaultLength:100,style:{fill:"#DCDEE2"}},title:{spacing:5,style:{fill:X.textColor,fontSize:12,textAlign:"start",textBaseline:"top"}}}})},r.prototype.isSlider=function(){return!0},r.prototype.getValue=function(){return this.getCurrentValue()},r.prototype.getRange=function(){return{min:this.get("min"),max:this.get("max")}},r.prototype.setRange=function(t,e){this.update({min:t,max:e})},r.prototype.setValue=function(t){var e=this.getValue();this.set("value",t);var n=this.get("group");this.resetTrackClip(),this.get("slidable")&&this.resetHandlers(n),this.delegateEmit("valuechanged",{originValue:e,value:t})},r.prototype.initEvent=function(){var t=this.get("group");this.bindSliderEvent(t),this.bindRailEvent(t),this.bindTrackEvent(t)},r.prototype.drawLegendContent=function(t){this.drawRail(t),this.drawLabels(t),this.fixedElements(t),this.resetTrack(t),this.resetTrackClip(t),this.get("slidable")&&this.resetHandlers(t)},r.prototype.bindSliderEvent=function(t){this.bindHandlersEvent(t)},r.prototype.bindHandlersEvent=function(t){var e=this;t.on("legend-handler-min:drag",function(n){var a=e.getValueByCanvasPoint(n.x,n.y),o=e.getCurrentValue(),s=o[1];sa&&(s=a),e.setValue([s,a])})},r.prototype.bindRailEvent=function(t){},r.prototype.bindTrackEvent=function(t){var e=this,n=null;t.on("legend-track:dragstart",function(a){n={x:a.x,y:a.y}}),t.on("legend-track:drag",function(a){if(!!n){var o=e.getValueByCanvasPoint(n.x,n.y),s=e.getValueByCanvasPoint(a.x,a.y),l=e.getCurrentValue(),h=l[1]-l[0],u=e.getRange(),c=s-o;c<0?l[0]+c>u.min?e.setValue([l[0]+c,l[1]+c]):e.setValue([u.min,u.min+h]):c>0&&(c>0&&l[1]+co&&(c=o),c0&&this.changeRailLength(a,s,n[s]-v)}},r.prototype.changeRailLength=function(t,e,n){var a=t.getBBox(),o;e==="height"?o=this.getRailPath(a.x,a.y,a.width,n):o=this.getRailPath(a.x,a.y,n,a.height),t.attr("path",o)},r.prototype.changeRailPosition=function(t,e,n){var a=t.getBBox(),o=this.getRailPath(e,n,a.width,a.height);t.attr("path",o)},r.prototype.fixedHorizontal=function(t,e,n,a){var o=this.get("label"),s=o.align,l=o.spacing,h=n.getBBox(),u=t.getBBox(),c=e.getBBox(),f=h.height;this.fitRailLength(u,c,h,n),h=n.getBBox(),s==="rail"?(t.attr({x:a.x,y:a.y+f/2}),this.changeRailPosition(n,a.x+u.width+l,a.y),e.attr({x:a.x+u.width+h.width+l*2,y:a.y+f/2})):s==="top"?(t.attr({x:a.x,y:a.y}),e.attr({x:a.x+h.width,y:a.y}),this.changeRailPosition(n,a.x,a.y+u.height+l)):(this.changeRailPosition(n,a.x,a.y),t.attr({x:a.x,y:a.y+h.height+l}),e.attr({x:a.x+h.width,y:a.y+h.height+l}))},r.prototype.fixedVertail=function(t,e,n,a){var o=this.get("label"),s=o.align,l=o.spacing,h=n.getBBox(),u=t.getBBox(),c=e.getBBox();if(this.fitRailLength(u,c,h,n),h=n.getBBox(),s==="rail")t.attr({x:a.x,y:a.y}),this.changeRailPosition(n,a.x,a.y+u.height+l),e.attr({x:a.x,y:a.y+u.height+h.height+l*2});else if(s==="right")t.attr({x:a.x+h.width+l,y:a.y}),this.changeRailPosition(n,a.x,a.y),e.attr({x:a.x+h.width+l,y:a.y+h.height});else{var f=Math.max(u.width,c.width);t.attr({x:a.x,y:a.y}),this.changeRailPosition(n,a.x+f+l,a.y),e.attr({x:a.x,y:a.y+h.height})}},r}(Lf),Se="g2-tooltip",be="g2-tooltip-title",Oi="g2-tooltip-list",Aa="g2-tooltip-list-item",Ta="g2-tooltip-marker",La="g2-tooltip-value",Ef="g2-tooltip-name",As="g2-tooltip-crosshair-x",Ts="g2-tooltip-crosshair-y";const X0=Object.freeze(Object.defineProperty({__proto__:null,CONTAINER_CLASS:Se,TITLE_CLASS:be,LIST_CLASS:Oi,LIST_ITEM_CLASS:Aa,MARKER_CLASS:Ta,VALUE_CLASS:La,NAME_CLASS:Ef,CROSSHAIR_X:As,CROSSHAIR_Y:Ts},Symbol.toStringTag,{value:"Module"}));var le;const z0=(le={},le[""+Se]={position:"absolute",visibility:"visible",zIndex: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)",backgroundColor:"rgba(255, 255, 255, 0.9)",boxShadow:"0px 0px 10px #aeaeae",borderRadius:"3px",color:"rgb(87, 87, 87)",fontSize:"12px",fontFamily:X.fontFamily,lineHeight:"20px",padding:"10px 10px 6px 10px"},le[""+be]={marginBottom:"4px"},le[""+Oi]={margin:"0px",listStyleType:"none",padding:"0px"},le[""+Aa]={listStyleType:"none",marginBottom:"4px"},le[""+Ta]={width:"8px",height:"8px",borderRadius:"50%",display:"inline-block",marginRight:"8px"},le[""+La]={display:"inline-block",float:"right",marginLeft:"30px"},le[""+As]={position:"absolute",width:"1px",backgroundColor:"rgba(0, 0, 0, 0.25)"},le[""+Ts]={position:"absolute",height:"1px",backgroundColor:"rgba(0, 0, 0, 0.25)"},le);function W0(i,r,t,e,n){var a={left:in.x+n.width,top:rn.y+n.height};return a}function $0(i,r,t,e,n,a){var o=i,s=r;switch(a){case"left":o=i-e-t,s=r-n/2;break;case"right":o=i+t,s=r-n/2;break;case"top":o=i-e/2,s=r-n-t;break;case"bottom":o=i-e/2,s=r+t;break;default:o=i+t,s=r-n-t;break}return{x:o,y:s}}function _0(i,r,t,e,n,a,o){var s=$0(i,r,t,e,n,a);if(o){var l=W0(s.x,s.y,e,n,o);a==="auto"?(l.right&&(s.x=Math.max(0,i-e-t)),l.top&&(s.y=Math.max(0,r-n-t))):a==="top"||a==="bottom"?(l.left&&(s.x=o.x),l.right&&(s.x=o.x+o.width-e),a==="top"&&l.top&&(s.y=r+t),a==="bottom"&&l.bottom&&(s.y=r-n-t)):(l.top&&(s.y=o.y),l.bottom&&(s.y=o.y+o.height-n),a==="left"&&l.left&&(s.x=i+t),a==="right"&&l.right&&(s.x=i-e-t))}return s}function j0(i,r){var t=!1;return M(r,function(e){if(Or(i,e))return t=!0,!1}),t}var U0=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"tooltip",type:"html",x:0,y:0,items:[],customContent:null,containerTpl:'
    ',itemTpl:'
  • {name}: {value}
  • `,xCrosshairTpl:'
    ',yCrosshairTpl:'
    ',title:null,showTitle:!0,region:null,crosshairsRegion:null,containerClassName:Se,crosshairs:null,offset:10,position:"right",domStyles:null,defaultStyles:z0})},r.prototype.render=function(){this.get("customContent")?this.renderCustomContent():(this.resetTitle(),this.renderItems()),this.resetPosition()},r.prototype.clear=function(){this.clearCrosshairs(),this.setTitle(""),this.clearItemDoms()},r.prototype.show=function(){var t=this.getContainer();!t||this.destroyed||(this.set("visible",!0),bt(t,{visibility:"visible"}),this.setCrossHairsVisible(!0))},r.prototype.hide=function(){var t=this.getContainer();!t||this.destroyed||(this.set("visible",!1),bt(t,{visibility:"hidden"}),this.setCrossHairsVisible(!1))},r.prototype.getLocation=function(){return{x:this.get("x"),y:this.get("y")}},r.prototype.setLocation=function(t){this.set("x",t.x),this.set("y",t.y),this.resetPosition()},r.prototype.setCrossHairsVisible=function(t){var e=t?"":"none",n=this.get("xCrosshairDom"),a=this.get("yCrosshairDom");n&&bt(n,{display:e}),a&&bt(a,{display:e})},r.prototype.initContainer=function(){if(i.prototype.initContainer.call(this),this.get("customContent")){this.get("container")&&this.get("container").remove();var t=this.getHtmlContentNode();this.get("parent").appendChild(t),this.set("container",t),this.resetStyles(),this.applyStyles()}},r.prototype.updateInner=function(t){this.get("customContent")?this.renderCustomContent():(j0(t,["title","showTitle"])&&this.resetTitle(),Or(t,"items")&&this.renderItems()),i.prototype.updateInner.call(this,t)},r.prototype.initDom=function(){this.cacheDoms()},r.prototype.removeDom=function(){i.prototype.removeDom.call(this),this.clearCrosshairs()},r.prototype.resetPosition=function(){var t=this.get("x"),e=this.get("y"),n=this.get("offset"),a=this.getOffset(),o=a.offsetX,s=a.offsetY,l=this.get("position"),h=this.get("region"),u=this.getContainer(),c=this.getBBox(),f=c.width,v=c.height,p;h&&(p=Ii(h));var g=_0(t,e,n,f,v,l,p);bt(u,{left:Pt(g.x+o),top:Pt(g.y+s)}),this.resetCrosshairs()},r.prototype.renderCustomContent=function(){var t=this.getHtmlContentNode(),e=this.get("parent"),n=this.get("container");n&&n.parentNode===e?e.replaceChild(t,n):e.appendChild(t),this.set("container",t),this.resetStyles(),this.applyStyles()},r.prototype.getHtmlContentNode=function(){var t,e=this.get("customContent");if(e){var n=e(this.get("title"),this.get("items"));zu(n)?t=n:t=Xe(n)}return t},r.prototype.cacheDoms=function(){var t=this.getContainer(),e=t.getElementsByClassName(be)[0],n=t.getElementsByClassName(Oi)[0];this.set("titleDom",e),this.set("listDom",n)},r.prototype.resetTitle=function(){var t=this.get("title"),e=this.get("showTitle");e&&t?this.setTitle(t):this.setTitle("")},r.prototype.setTitle=function(t){var e=this.get("titleDom");e&&(e.innerText=t)},r.prototype.resetCrosshairs=function(){var t=this.get("crosshairsRegion"),e=this.get("crosshairs");if(!t||!e)this.clearCrosshairs();else{var n=Ii(t),a=this.get("xCrosshairDom"),o=this.get("yCrosshairDom");e==="x"?(this.resetCrosshair("x",n),o&&(o.remove(),this.set("yCrosshairDom",null))):e==="y"?(this.resetCrosshair("y",n),a&&(a.remove(),this.set("xCrosshairDom",null))):(this.resetCrosshair("x",n),this.resetCrosshair("y",n)),this.setCrossHairsVisible(this.get("visible"))}},r.prototype.resetCrosshair=function(t,e){var n=this.checkCrosshair(t),a=this.get(t);t==="x"?bt(n,{left:Pt(a),top:Pt(e.y),height:Pt(e.height)}):bt(n,{top:Pt(a),left:Pt(e.x),width:Pt(e.width)})},r.prototype.checkCrosshair=function(t){var e=t+"CrosshairDom",n=t+"CrosshairTpl",a="CROSSHAIR_"+t.toUpperCase(),o=X0[a],s=this.get(e),l=this.get("parent");return s||(s=Xe(this.get(n)),this.applyStyle(o,s),l.appendChild(s),this.set(e,s)),s},r.prototype.renderItems=function(){this.clearItemDoms();var t=this.get("items"),e=this.get("itemTpl"),n=this.get("listDom");n&&(M(t,function(a){var o=ki.toCSSGradient(a.color),s=w(w({},a),{color:o}),l=Nu(e,s),h=Xe(l);n.appendChild(h)}),this.applyChildrenStyles(n,this.get("domStyles")))},r.prototype.clearItemDoms=function(){this.get("listDom")&&Cs(this.get("listDom"))},r.prototype.clearCrosshairs=function(){var t=this.get("xCrosshairDom"),e=this.get("yCrosshairDom");t&&t.remove(),e&&e.remove(),this.set("xCrosshairDom",null),this.set("yCrosshairDom",null)},r}(Ms),q0={opacity:0},Z0={stroke:"#C5C5C5",strokeOpacity:.85},Q0={fill:"#CACED4",opacity:.85};function K0(i){return Et(i,function(r,t){var e=t===0?"M":"L",n=r[0],a=r[1];return[e,n,a]})}function Bf(i){return K0(i)}function J0(i){if(i.length<=2)return Bf(i);var r=[];M(i,function(o){gt(o,r.slice(r.length-2))||r.push(o[0],o[1])});var t=uy(r,!1),e=zt(i),n=e[0],a=e[1];return t.unshift(["M",n,a]),t}function tx(i,r,t,e){e===void 0&&(e=!0);var n=new Ca({values:i}),a=new xa({values:Et(i,function(s,l){return l})}),o=Et(i,function(s,l){return[a.scale(l)*r,t-n.scale(s)*t]});return e?J0(o):Bf(o)}function ex(i,r){var t=new Ca({values:i}),e=t.max<0?t.max:Math.max(0,t.min);return r-t.scale(e)*r}function rx(i,r,t,e){var n=Ci(i),a=ex(e,t);return n.push(["L",r,a]),n.push(["L",0,a]),n.push(["Z"]),n}var ix=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"trend",x:0,y:0,width:200,height:16,smooth:!0,isArea:!1,data:[],backgroundStyle:q0,lineStyle:Z0,areaStyle:Q0})},r.prototype.renderInner=function(t){var e=this.cfg,n=e.width,a=e.height,o=e.data,s=e.smooth,l=e.isArea,h=e.backgroundStyle,u=e.lineStyle,c=e.areaStyle;this.addShape(t,{id:this.getElementId("background"),type:"rect",attrs:w({x:0,y:0,width:n,height:a},h)});var f=tx(o,n,a,s);if(this.addShape(t,{id:this.getElementId("line"),type:"path",attrs:w({path:f},u)}),l){var v=rx(f,n,a,o);this.addShape(t,{id:this.getElementId("area"),type:"path",attrs:w({path:v},c)})}},r.prototype.applyOffset=function(){var t=this.cfg,e=t.x,n=t.y;this.moveElementTo(this.get("group"),{x:e,y:n})},r}(St),kf={fill:"#F7F7F7",stroke:"#BFBFBF",radius:2,opacity:1,cursor:"ew-resize",highLightFill:"#FFF"},Bh=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"handler",x:0,y:0,width:10,height:24,style:kf})},r.prototype.renderInner=function(t){var e=this.cfg,n=e.width,a=e.height,o=e.style,s=o.fill,l=o.stroke,h=o.radius,u=o.opacity,c=o.cursor;this.addShape(t,{type:"rect",id:this.getElementId("background"),attrs:{x:0,y:0,width:n,height:a,fill:s,stroke:l,radius:h,opacity:u,cursor:c}});var f=1/3*n,v=2/3*n,p=1/4*a,g=3/4*a;this.addShape(t,{id:this.getElementId("line-left"),type:"line",attrs:{x1:f,y1:p,x2:f,y2:g,stroke:l,cursor:c}}),this.addShape(t,{id:this.getElementId("line-right"),type:"line",attrs:{x1:v,y1:p,x2:v,y2:g,stroke:l,cursor:c}})},r.prototype.applyOffset=function(){this.moveElementTo(this.get("group"),{x:this.get("x"),y:this.get("y")})},r.prototype.initEvent=function(){this.bindEvents()},r.prototype.bindEvents=function(){var t=this;this.get("group").on("mouseenter",function(){var e=t.get("style").highLightFill;t.getElementByLocalId("background").attr("fill",e),t.draw()}),this.get("group").on("mouseleave",function(){var e=t.get("style").fill;t.getElementByLocalId("background").attr("fill",e),t.draw()})},r.prototype.draw=function(){var t=this.get("container").get("canvas");t&&t.draw()},r}(St),nx={fill:"#416180",opacity:.05},ax={fill:"#5B8FF9",opacity:.15,cursor:"move"},kn=10,ox={width:kn,height:24},sx={textBaseline:"middle",fill:"#000",opacity:.45},lx="sliderchange",hx=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.onMouseDown=function(e){return function(n){t.currentTarget=e;var a=n.originalEvent;a.stopPropagation(),a.preventDefault(),t.prevX=T(a,"touches.0.pageX",a.pageX),t.prevY=T(a,"touches.0.pageY",a.pageY);var o=t.getContainerDOM();o.addEventListener("mousemove",t.onMouseMove),o.addEventListener("mouseup",t.onMouseUp),o.addEventListener("mouseleave",t.onMouseUp),o.addEventListener("touchmove",t.onMouseMove),o.addEventListener("touchend",t.onMouseUp),o.addEventListener("touchcancel",t.onMouseUp)}},t.onMouseMove=function(e){var n=t.cfg.width,a=[t.get("start"),t.get("end")];e.stopPropagation(),e.preventDefault();var o=T(e,"touches.0.pageX",e.pageX),s=T(e,"touches.0.pageY",e.pageY),l=o-t.prevX,h=t.adjustOffsetRange(l/n);t.updateStartEnd(h),t.updateUI(t.getElementByLocalId("foreground"),t.getElementByLocalId("minText"),t.getElementByLocalId("maxText")),t.prevX=o,t.prevY=s,t.draw(),t.emit(lx,[t.get("start"),t.get("end")].sort()),t.delegateEmit("valuechanged",{originValue:a,value:[t.get("start"),t.get("end")]})},t.onMouseUp=function(){t.currentTarget&&(t.currentTarget=void 0);var e=t.getContainerDOM();e&&(e.removeEventListener("mousemove",t.onMouseMove),e.removeEventListener("mouseup",t.onMouseUp),e.removeEventListener("mouseleave",t.onMouseUp),e.removeEventListener("touchmove",t.onMouseMove),e.removeEventListener("touchend",t.onMouseUp),e.removeEventListener("touchcancel",t.onMouseUp))},t}return r.prototype.setRange=function(t,e){this.set("minLimit",t),this.set("maxLimit",e);var n=this.get("start"),a=this.get("end"),o=at(n,t,e),s=at(a,t,e);!this.get("isInit")&&(n!==o||a!==s)&&this.setValue([o,s])},r.prototype.getRange=function(){return{min:this.get("minLimit")||0,max:this.get("maxLimit")||1}},r.prototype.setValue=function(t){var e=this.getRange();if(P(t)&&t.length===2){var n=[this.get("start"),this.get("end")];this.update({start:at(t[0],e.min,e.max),end:at(t[1],e.min,e.max)}),this.get("updateAutoRender")||this.render(),this.delegateEmit("valuechanged",{originValue:n,value:t})}},r.prototype.getValue=function(){return[this.get("start"),this.get("end")]},r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"slider",x:0,y:0,width:100,height:16,backgroundStyle:{},foregroundStyle:{},handlerStyle:{},textStyle:{},defaultCfg:{backgroundStyle:nx,foregroundStyle:ax,handlerStyle:ox,textStyle:sx}})},r.prototype.update=function(t){var e=t.start,n=t.end,a=w({},t);I(e)||(a.start=at(e,0,1)),I(n)||(a.end=at(n,0,1)),i.prototype.update.call(this,a),this.minHandler=this.getChildComponentById(this.getElementId("minHandler")),this.maxHandler=this.getChildComponentById(this.getElementId("maxHandler")),this.trend=this.getChildComponentById(this.getElementId("trend"))},r.prototype.init=function(){this.set("start",at(this.get("start"),0,1)),this.set("end",at(this.get("end"),0,1)),i.prototype.init.call(this)},r.prototype.render=function(){i.prototype.render.call(this),this.updateUI(this.getElementByLocalId("foreground"),this.getElementByLocalId("minText"),this.getElementByLocalId("maxText"))},r.prototype.renderInner=function(t){var e=this.cfg;e.start,e.end;var n=e.width,a=e.height,o=e.trendCfg,s=o===void 0?{}:o,l=e.minText,h=e.maxText,u=e.backgroundStyle,c=u===void 0?{}:u,f=e.foregroundStyle,v=f===void 0?{}:f,p=e.textStyle,g=p===void 0?{}:p,d=D({},kf,this.cfg.handlerStyle);Gt(T(s,"data"))&&(this.trend=this.addComponent(t,w({component:ix,id:this.getElementId("trend"),x:0,y:0,width:n,height:a},s))),this.addShape(t,{id:this.getElementId("background"),type:"rect",attrs:w({x:0,y:0,width:n,height:a},c)}),this.addShape(t,{id:this.getElementId("minText"),type:"text",attrs:w({y:a/2,textAlign:"right",text:l,silent:!1},g)}),this.addShape(t,{id:this.getElementId("maxText"),type:"text",attrs:w({y:a/2,textAlign:"left",text:h,silent:!1},g)}),this.addShape(t,{id:this.getElementId("foreground"),name:"foreground",type:"rect",attrs:w({y:0,height:a},v)});var y=T(d,"width",kn),C=T(d,"height",24);this.minHandler=this.addComponent(t,{component:Bh,id:this.getElementId("minHandler"),name:"handler-min",x:0,y:(a-C)/2,width:y,height:C,cursor:"ew-resize",style:d}),this.maxHandler=this.addComponent(t,{component:Bh,id:this.getElementId("maxHandler"),name:"handler-max",x:0,y:(a-C)/2,width:y,height:C,cursor:"ew-resize",style:d})},r.prototype.applyOffset=function(){this.moveElementTo(this.get("group"),{x:this.get("x"),y:this.get("y")})},r.prototype.initEvent=function(){this.bindEvents()},r.prototype.updateUI=function(t,e,n){var a=this.cfg,o=a.start,s=a.end,l=a.width,h=a.minText,u=a.maxText,c=a.handlerStyle,f=a.height,v=o*l,p=s*l;this.trend&&(this.trend.update({width:l,height:f}),this.get("updateAutoRender")||this.trend.render()),t.attr("x",v),t.attr("width",p-v);var g=T(c,"width",kn);e.attr("text",h),n.attr("text",u);var d=this._dodgeText([v,p],e,n),y=d[0],C=d[1];this.minHandler&&(this.minHandler.update({x:v-g/2}),this.get("updateAutoRender")||this.minHandler.render()),M(y,function(m,x){return e.attr(x,m)}),this.maxHandler&&(this.maxHandler.update({x:p-g/2}),this.get("updateAutoRender")||this.maxHandler.render()),M(C,function(m,x){return n.attr(x,m)})},r.prototype.bindEvents=function(){var t=this.get("group");t.on("handler-min:mousedown",this.onMouseDown("minHandler")),t.on("handler-min:touchstart",this.onMouseDown("minHandler")),t.on("handler-max:mousedown",this.onMouseDown("maxHandler")),t.on("handler-max:touchstart",this.onMouseDown("maxHandler"));var e=t.findById(this.getElementId("foreground"));e.on("mousedown",this.onMouseDown("foreground")),e.on("touchstart",this.onMouseDown("foreground"))},r.prototype.adjustOffsetRange=function(t){var e=this.cfg,n=e.start,a=e.end;switch(this.currentTarget){case"minHandler":{var o=0-n,s=1-n;return Math.min(s,Math.max(o,t))}case"maxHandler":{var o=0-a,s=1-a;return Math.min(s,Math.max(o,t))}case"foreground":{var o=0-n,s=1-a;return Math.min(s,Math.max(o,t))}}},r.prototype.updateStartEnd=function(t){var e=this.cfg,n=e.start,a=e.end;switch(this.currentTarget){case"minHandler":n+=t;break;case"maxHandler":a+=t;break;case"foreground":n+=t,a+=t;break}this.set("start",n),this.set("end",a)},r.prototype._dodgeText=function(t,e,n){var a,o,s=this.cfg,l=s.handlerStyle,h=s.width,u=2,c=T(l,"width",kn),f=t[0],v=t[1],p=!1;f>v&&(a=[v,f],f=a[0],v=a[1],o=[n,e],e=o[0],n=o[1],p=!0);var g=e.getBBox(),d=n.getBBox(),y=g.width>f-u?{x:f+c/2+u,textAlign:"left"}:{x:f-c/2-u,textAlign:"right"},C=d.width>h-v-u?{x:v-c/2-u,textAlign:"right"}:{x:v+c/2+u,textAlign:"left"};return p?[C,y]:[y,C]},r.prototype.draw=function(){var t=this.get("container"),e=t&&t.get("canvas");e&&e.draw()},r.prototype.getContainerDOM=function(){var t=this.get("container"),e=t&&t.get("canvas");return e&&e.get("container")},r}(St),ux={trackColor:"rgba(0,0,0,0)",thumbColor:"rgba(0,0,0,0.15)",size:8,lineCap:"round"},to={default:ux,hover:{thumbColor:"rgba(0,0,0,0.2)"}},cx=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.clearEvents=Ye,t.onStartEvent=function(e){return function(n){t.isMobile=e,n.originalEvent.preventDefault();var a=e?T(n.originalEvent,"touches.0.clientX"):n.clientX,o=e?T(n.originalEvent,"touches.0.clientY"):n.clientY;t.startPos=t.cfg.isHorizontal?a:o,t.bindLaterEvent()}},t.bindLaterEvent=function(){var e=t.getContainerDOM(),n=[];t.isMobile?n=[xr(e,"touchmove",t.onMouseMove),xr(e,"touchend",t.onMouseUp),xr(e,"touchcancel",t.onMouseUp)]:n=[xr(e,"mousemove",t.onMouseMove),xr(e,"mouseup",t.onMouseUp),xr(e,"mouseleave",t.onMouseUp)],t.clearEvents=function(){n.forEach(function(a){a.remove()})}},t.onMouseMove=function(e){var n=t.cfg,a=n.isHorizontal,o=n.thumbOffset;e.preventDefault();var s=t.isMobile?T(e,"touches.0.clientX"):e.clientX,l=t.isMobile?T(e,"touches.0.clientY"):e.clientY,h=a?s:l,u=h-t.startPos;t.startPos=h,t.updateThumbOffset(o+u)},t.onMouseUp=function(e){e.preventDefault(),t.clearEvents()},t.onTrackClick=function(e){var n=t.cfg,a=n.isHorizontal,o=n.x,s=n.y,l=n.thumbLen,h=t.getContainerDOM(),u=h.getBoundingClientRect(),c=e.clientX,f=e.clientY,v=a?c-u.left-o-l/2:f-u.top-s-l/2,p=t.validateRange(v);t.updateThumbOffset(p)},t.onThumbMouseOver=function(){var e=t.cfg.theme.hover.thumbColor;t.getElementByLocalId("thumb").attr("stroke",e),t.draw()},t.onThumbMouseOut=function(){var e=t.cfg.theme.default.thumbColor;t.getElementByLocalId("thumb").attr("stroke",e),t.draw()},t}return r.prototype.setRange=function(t,e){this.set("minLimit",t),this.set("maxLimit",e);var n=this.getValue(),a=at(n,t,e);n!==a&&!this.get("isInit")&&this.setValue(a)},r.prototype.getRange=function(){var t=this.get("minLimit")||0,e=this.get("maxLimit")||1;return{min:t,max:e}},r.prototype.setValue=function(t){var e=this.getRange(),n=this.getValue();this.update({thumbOffset:(this.get("trackLen")-this.get("thumbLen"))*at(t,e.min,e.max)}),this.delegateEmit("valuechange",{originalValue:n,value:this.getValue()})},r.prototype.getValue=function(){return at(this.get("thumbOffset")/(this.get("trackLen")-this.get("thumbLen")),0,1)},r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"scrollbar",isHorizontal:!0,minThumbLen:20,thumbOffset:0,theme:to})},r.prototype.renderInner=function(t){this.renderTrackShape(t),this.renderThumbShape(t)},r.prototype.applyOffset=function(){this.moveElementTo(this.get("group"),{x:this.get("x"),y:this.get("y")})},r.prototype.initEvent=function(){this.bindEvents()},r.prototype.renderTrackShape=function(t){var e=this.cfg,n=e.trackLen,a=e.theme,o=a===void 0?{default:{}}:a,s=D({},to,o).default,l=s.lineCap,h=s.trackColor,u=s.size,c=T(this.cfg,"size",u),f=this.get("isHorizontal")?{x1:0+c/2,y1:c/2,x2:n-c/2,y2:c/2,lineWidth:c,stroke:h,lineCap:l}:{x1:c/2,y1:0+c/2,x2:c/2,y2:n-c/2,lineWidth:c,stroke:h,lineCap:l};return this.addShape(t,{id:this.getElementId("track"),name:"track",type:"line",attrs:f})},r.prototype.renderThumbShape=function(t){var e=this.cfg,n=e.thumbOffset,a=e.thumbLen,o=e.theme,s=D({},to,o).default,l=s.size,h=s.lineCap,u=s.thumbColor,c=T(this.cfg,"size",l),f=this.get("isHorizontal")?{x1:n+c/2,y1:c/2,x2:n+a-c/2,y2:c/2,lineWidth:c,stroke:u,lineCap:h,cursor:"default"}:{x1:c/2,y1:n+c/2,x2:c/2,y2:n+a-c/2,lineWidth:c,stroke:u,lineCap:h,cursor:"default"};return this.addShape(t,{id:this.getElementId("thumb"),name:"thumb",type:"line",attrs:f})},r.prototype.bindEvents=function(){var t=this.get("group");t.on("mousedown",this.onStartEvent(!1)),t.on("mouseup",this.onMouseUp),t.on("touchstart",this.onStartEvent(!0)),t.on("touchend",this.onMouseUp);var e=t.findById(this.getElementId("track"));e.on("click",this.onTrackClick);var n=t.findById(this.getElementId("thumb"));n.on("mouseover",this.onThumbMouseOver),n.on("mouseout",this.onThumbMouseOut)},r.prototype.getContainerDOM=function(){var t=this.get("container"),e=t&&t.get("canvas");return e&&e.get("container")},r.prototype.validateRange=function(t){var e=this.cfg,n=e.thumbLen,a=e.trackLen,o=t;return t+n>a?o=a-n:t+na.x?a.x:r,t=ta.y?a.y:e,n=n=e&&i<=n}function xx(i,r,t){if(N(i))return i.padEnd(r,t);if(P(i)){var e=i.length;if(e=this.minX&&r.maxX<=this.maxX&&r.minY>=this.minY&&r.maxY<=this.maxY},i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height)},i.prototype.add=function(){for(var r=[],t=0;tr.minX&&this.minYr.minY},i.prototype.size=function(){return this.width*this.height},i.prototype.isPointIn=function(r){return r.x>=this.minX&&r.x<=this.maxX&&r.y>=this.minY&&r.y<=this.maxY},i}();function wx(i){return[[i.minX,i.minY],[i.maxX,i.minY],[i.maxX,i.maxY],[i.minX,i.maxY]]}function _i(i){if(i.isPolar&&!i.isTransposed)return(i.endAngle-i.startAngle)*i.getRadius();var r=i.convert({x:0,y:0}),t=i.convert({x:1,y:0});return Math.sqrt(Math.pow(t.x-r.x,2)+Math.pow(t.y-r.y,2))}function Cx(i){if(i.isPolar){var r=i.startAngle,t=i.endAngle;return t-r===Math.PI*2}return!1}function Ba(i,r){var t=i.getCenter();return Math.sqrt(Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2))}function Mx(i,r){var t=!1;if(i)if(i.type==="theta"){var e=i.start,n=i.end;t=Er(r.x,e.x,n.x)&&Er(r.y,e.y,n.y)}else{var a=i.invert(r);t=Er(a.x,0,1)&&Er(a.y,0,1)}return t}function Yr(i,r){var t=i.getCenter();return Math.atan2(r.y-t.y,r.x-t.x)}function Ls(i,r){r===void 0&&(r=0);var t=i.start,e=i.end,n=i.getWidth(),a=i.getHeight();if(i.isPolar){var o=i.startAngle,s=i.endAngle,l=i.getCenter(),h=i.getRadius();return{type:"path",startState:{path:ur(l.x,l.y,h+r,o,o)},endState:function(c){var f=(s-o)*c+o,v=ur(l.x,l.y,h+r,o,f);return{path:v}},attrs:{path:ur(l.x,l.y,h+r,o,s)}}}var u;return i.isTransposed?u={height:a+r*2}:u={width:n+r*2},{type:"rect",startState:{x:t.x-r,y:e.y-r,width:i.isTransposed?n+r*2:0,height:i.isTransposed?0:a+r*2},endState:u,attrs:{x:t.x-r,y:e.y-r,width:n+r*2,height:a+r*2}}}function Sx(i,r){r===void 0&&(r=0);var t=i.start,e=i.end,n=i.getWidth(),a=i.getHeight(),o=Math.min(t.x,e.x),s=Math.min(t.y,e.y);return Bt.fromRange(o-r,s-r,o+n+r,s+a+r)}var bx=/^(?:(?!0000)[0-9]{4}([-/.]+)(?:(?:0?[1-9]|1[0-2])\1(?:0?[1-9]|1[0-9]|2[0-8])|(?:0?[13-9]|1[0-2])\1(?:29|30)|(?:0?[13578]|1[02])\1(?:31))|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)([-/.]+)0?2\2(?:29))(\s+([01]|([01][0-9]|2[0-3])):([0-9]|[0-5][0-9]):([0-9]|[0-5][0-9]))?$/;function Ax(i){var r="linear";return bx.test(i)?r="timeCat":N(i)&&(r="cat"),r}function Ff(i,r,t,e){return r===void 0&&(r={}),r.type?r.type:i.type!=="identity"&&Ar.includes(t)&&["interval"].includes(e)||i.isCategory?"cat":i.type}function Tx(i,r,t){var e=r||[];if(U(i)||I(np(e,i))&&pe(t)){var n=Do("identity");return new n({field:i.toString(),values:[i]})}var a=Me(e,i),o=T(t,"type",Ax(a[0])),s=Do(o);return new s(w({field:i,values:a},t))}function Lx(i,r){if(i.type!=="identity"&&r.type!=="identity"){var t={};for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e]);i.change(t)}}function Di(i){return i.alias||i.field}function Of(i,r,t){var e=i.values,n=e.length,a;if(n===1)a=[.5,1];else{var o=1,s=0;Cx(r)?r.isTransposed?(o=T(t,"widthRatio.multiplePie",1/1.3),s=1/n*o,a=[s/2,1-s/2]):a=[0,1-1/n]:(s=1/n/2,a=[s,1-s])}return a}function Ex(i){var r=i.values.filter(function(t){return!I(t)&&!isNaN(t)});return Math.max.apply(Math,et(et([],Y(r),!1),[I(i.max)?-1/0:i.max],!1))}function Bx(i){var r,t;switch(i){case F.TOP:r={x:0,y:1},t={x:1,y:1};break;case F.RIGHT:r={x:1,y:0},t={x:1,y:1};break;case F.BOTTOM:r={x:0,y:0},t={x:1,y:0};break;case F.LEFT:r={x:0,y:0},t={x:0,y:1};break;default:r=t={x:0,y:0}}return{start:r,end:t}}function kx(i){var r,t;return i.isTransposed?(r={x:0,y:0},t={x:1,y:0}):(r={x:0,y:0},t={x:0,y:1}),{start:r,end:t}}function cn(i,r){var t={start:{x:0,y:0},end:{x:0,y:0}};i.isRect?t=Bx(r):i.isPolar&&(t=kx(i));var e=t.start,n=t.end;return{start:i.convert(e),end:i.convert(n)}}function Df(i){var r=i.start,t=i.end;return r.x===t.x}function Fh(i,r){var t=i.start,e=i.end,n=Df(i);return n?(t.y-e.y)*(r.x-t.x)>0?1:-1:(e.x-t.x)*(t.y-r.y)>0?-1:1}function fn(i,r){var t=T(i,["components","axis"],{});return D({},T(t,["common"],{}),D({},T(t,[r],{})))}function Oh(i,r,t){var e=T(i,["components","axis"],{});return D({},T(e,["common","title"],{}),D({},T(e,[r,"title"],{})),t)}function eo(i){var r=i.x,t=i.y,e=i.circleCenter,n=t.start>t.end,a=i.isTransposed?i.convert({x:n?0:1,y:0}):i.convert({x:0,y:n?0:1}),o=[a.x-e.x,a.y-e.y],s=[1,0],l=a.y>e.y?Co(o,s):Co(o,s)*-1,h=l+(r.end-r.start),u=Math.sqrt(Math.pow(a.x-e.x,2)+Math.pow(a.y-e.y,2));return{center:e,radius:u,startAngle:l,endAngle:h}}function jn(i,r){return Mi(i)?i===!1?!1:{}:T(i,[r])}function Dh(i,r){return T(i,"position",r)}function Rh(i,r){return T(r,["title","text"],Di(i))}var Wr=function(){function i(r,t){this.destroyed=!1,this.facets=[],this.view=r,this.cfg=D({},this.getDefaultCfg(),t)}return i.prototype.init=function(){this.container||(this.container=this.createContainer());var r=this.view.getData();this.facets=this.generateFacets(r)},i.prototype.render=function(){this.renderViews()},i.prototype.update=function(){},i.prototype.clear=function(){this.clearFacetViews()},i.prototype.destroy=function(){this.clear(),this.container&&(this.container.remove(!0),this.container=void 0),this.destroyed=!0,this.view=void 0,this.facets=[]},i.prototype.facetToView=function(r){var t=r.region,e=r.data,n=r.padding,a=n===void 0?this.cfg.padding:n,o=this.view.createView({region:t,padding:a});o.data(e||[]),r.view=o,this.beforeEachView(o,r);var s=this.cfg.eachView;return s&&s(o,r),this.afterEachView(o,r),o},i.prototype.createContainer=function(){var r=this.view.getLayer(st.FORE);return r.addGroup()},i.prototype.renderViews=function(){this.createFacetViews()},i.prototype.createFacetViews=function(){var r=this;return this.facets.map(function(t){return r.facetToView(t)})},i.prototype.clearFacetViews=function(){var r=this;M(this.facets,function(t){t.view&&(r.view.removeView(t.view),t.view=void 0)})},i.prototype.parseSpacing=function(){var r=this.view.viewBBox,t=r.width,e=r.height,n=this.cfg.spacing;return n.map(function(a,o){return U(a)?a/(o===0?t:e):parseFloat(a)/100})},i.prototype.getFieldValues=function(r,t){var e=[],n={};return M(r,function(a){var o=a[t];!I(o)&&!n[o]&&(e.push(o),n[o]=!0)}),e},i.prototype.getRegion=function(r,t,e,n){var a=Y(this.parseSpacing(),2),o=a[0],s=a[1],l=(1+o)/(t===0?1:t)-o,h=(1+s)/(r===0?1:r)-s,u={x:(l+o)*e,y:(h+s)*n},c={x:u.x+l,y:u.y+h};return{start:u,end:c}},i.prototype.getDefaultCfg=function(){return{eachView:void 0,showTitle:!0,spacing:[0,0],padding:10,fields:[]}},i.prototype.getDefaultTitleCfg=function(){var r=this.view.getTheme().fontFamily;return{style:{fontSize:14,fill:"#666",fontFamily:r}}},i.prototype.processAxis=function(r,t){var e=r.getOptions(),n=e.coordinate,a=r.geometries,o=T(n,"type","rect");if(o==="rect"&&a.length){I(e.axes)&&(e.axes={});var s=e.axes,l=Y(a[0].getXYFields(),2),h=l[0],u=l[1],c=jn(s,h),f=jn(s,u);c!==!1&&(e.axes[h]=this.getXAxisOption(h,s,c,t)),f!==!1&&(e.axes[u]=this.getYAxisOption(u,s,f,t))}},i.prototype.getFacetDataFilter=function(r){return function(t){return hp(r,function(e){var n=e.field,a=e.value;return!I(a)&&n?t[n]===a:!0})}},i}(),Rf={},Ix=function(i){return Rf[Xr(i)]},$r=function(i,r){Rf[Xr(i)]=r},yt=function(){function i(r,t){this.context=r,this.cfg=t,r.addAction(this)}return i.prototype.applyCfg=function(r){ot(this,r)},i.prototype.init=function(){this.applyCfg(this.cfg)},i.prototype.destroy=function(){this.context.removeAction(this),this.context=null},i}(),Px=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.execute=function(){this.callback&&this.callback(this.context)},r.prototype.destroy=function(){i.prototype.destroy.call(this),this.callback=null},r}(yt),Yf={};function Fx(i,r){var t=Yf[i],e=null;if(t){var n=t.ActionClass,a=t.cfg;e=new n(r,a),e.name=i,e.init()}return e}function V(i,r,t){Yf[i]={ActionClass:r,cfg:t}}function Ox(i,r){var t=new Px(r);return t.callback=i,t.name="callback",t}function Dx(i,r){var t=[];if(i.length){t.push(["M",i[0].x,i[0].y]);for(var e=1,n=i.length;e=o[h]?1:0,f=u>Math.PI?1:0,v=t.convert(s),p=Ba(t,v);if(p>=.5)if(u===Math.PI*2){var g={x:(s.x+o.x)/2,y:(s.y+o.y)/2},d=t.convert(g);l.push(["A",p,p,0,f,c,d.x,d.y]),l.push(["A",p,p,0,f,c,v.x,v.y])}else l.push(["A",p,p,0,f,c,v.x,v.y]);return l}function Yx(i){M(i,function(r,t){var e=r;if(e[0].toLowerCase()==="a"){var n=i[t-1],a=i[t+1];a&&a[0].toLowerCase()==="a"?n&&n[0].toLowerCase()==="l"&&(n[0]="M"):n&&n[0].toLowerCase()==="a"&&a&&a[0].toLowerCase()==="l"&&(a[0]="M")}})}var Gx=function(i,r,t,e){var n,a=[],o=!!e,s,l,h,u,c,f,v;if(o){n=Y(e,2),h=n[0],u=n[1];for(var p=0,g=i.length;p=r||n.height>=r?n:null}function Nx(i,r){var t=i.event,e=t.target,n=e.getCanvasBBox();return n.width>=r||n.height>=r?e.attr("path"):null}function _e(i){var r=i.event,t,e=r.target;return e&&(t=e.get("element")),t}function Gr(i){var r=i.event,t=r.target,e;return t&&(e=t.get("delegateObject")),e}function Nf(i){var r=i.event.gEvent;return!(r&&r.fromShape&&r.toShape&&r.fromShape.get("element")===r.toShape.get("element"))}function Ri(i){return i&&i.component&&i.component.isList()}function Xf(i){return i&&i.component&&i.component.isSlider()}function Yi(i){var r=i.event,t=r.target;return t&&t.get("name")==="mask"}function Es(i,r){var t=i.event.target;if(t.get("type")==="path"){var e=Nx(i,r);return e?Wx(i.view,e):void 0}var n=Vf(i,r);return n?Bs(i.view,n):null}function zf(i,r,t){var e=Vf(i,t);if(!e)return null;var n=i.view,a=Xo(n,r,{x:e.x,y:e.y}),o=Xo(n,r,{x:e.maxX,y:e.maxY}),s={minX:a.x,minY:a.y,maxX:o.x,maxY:o.y};return Bs(r,s)}function Mt(i){var r=i.geometries,t=[];return M(r,function(e){var n=e.elements;t=t.concat(n)}),i.views&&i.views.length&&M(i.views,function(e){t=t.concat(Mt(e))}),t}function Xx(i,r,t){var e=Mt(i);return e.filter(function(n){return ae(n,r)===t})}function Wf(i,r){var t=i.geometries,e=[];return M(t,function(n){var a=n.getElementsBy(function(o){return o.hasState(r)});e=e.concat(a)}),e}function ae(i,r){var t=i.getModel(),e=t.data,n;return P(e)?n=e[0][r]:n=e[r],n}function zx(i,r){return!(r.minX>i.maxX||r.maxXi.maxY||r.maxY=r.x&&i.y<=r.y&&i.maxY>r.y}function ve(i){var r=i.parent,t=null;return r&&(t=r.views.filter(function(e){return e!==i})),t}function _x(i,r){var t=i.getCoordinate();return t.invert(r)}function Xo(i,r,t){var e=_x(i,t);return r.getCoordinate().convert(e)}function _f(i,r,t,e){var n=!1;return M(i,function(a){if(a[t]===r[t]&&a[e]===r[e])return n=!0,!1}),n}function Hr(i,r){var t=i.getScaleByField(r);return!t&&i.views&&M(i.views,function(e){if(t=Hr(e,r),t)return!1}),t}var jx=function(){function i(r){this.actions=[],this.event=null,this.cacheMap={},this.view=r}return i.prototype.cache=function(){for(var r=[],t=0;t=0&&t.splice(e,1)},i.prototype.getCurrentPoint=function(){var r=this.event;if(r)if(r.target instanceof HTMLElement){var t=this.view.getCanvas(),e=t.getPointByClient(r.clientX,r.clientY);return e}else return{x:r.x,y:r.y};return null},i.prototype.getCurrentShape=function(){return T(this.event,["gEvent","shape"])},i.prototype.isInPlot=function(){var r=this.getCurrentPoint();return r?this.view.isPointInPlot(r):!1},i.prototype.isInShape=function(r){var t=this.getCurrentShape();return t?t.get("name")===r:!1},i.prototype.isInComponent=function(r){var t=$f(this.view),e=this.getCurrentPoint();return e?!!t.find(function(n){var a=n.getBBox();return r?n.get("name")===r&&Gh(a,e):Gh(a,e)}):!1},i.prototype.destroy=function(){M(this.actions.slice(),function(r){r.destroy()}),this.view=null,this.event=null,this.actions=null,this.cacheMap=null},i}(),Ux=function(){function i(r,t){this.view=r,this.cfg=t}return i.prototype.init=function(){this.initEvents()},i.prototype.initEvents=function(){},i.prototype.clearEvents=function(){},i.prototype.destroy=function(){this.clearEvents()},i}();function Hh(i,r,t){var e=i.split(":"),n=e[0],a=r.getAction(n)||Fx(n,r);if(!a)throw new Error("There is no action named ".concat(n));var o=e[1];return{action:a,methodName:o,arg:t}}function Vh(i){var r=i.action,t=i.methodName,e=i.arg;if(r[t])r[t](e);else throw new Error("Action(".concat(r.name,") doesn't have a method called ").concat(t))}var Nt={START:"start",SHOW_ENABLE:"showEnable",END:"end",ROLLBACK:"rollback",PROCESSING:"processing"},qx=function(i){E(r,i);function r(t,e){var n=i.call(this,t,e)||this;return n.callbackCaches={},n.emitCaches={},n.steps=e,n}return r.prototype.init=function(){this.initContext(),i.prototype.init.call(this)},r.prototype.destroy=function(){i.prototype.destroy.call(this),this.steps=null,this.context&&(this.context.destroy(),this.context=null),this.callbackCaches=null,this.view=null},r.prototype.initEvents=function(){var t=this;M(this.steps,function(e,n){M(e,function(a){var o=t.getActionCallback(n,a);o&&t.bindEvent(a.trigger,o)})})},r.prototype.clearEvents=function(){var t=this;M(this.steps,function(e,n){M(e,function(a){var o=t.getActionCallback(n,a);o&&t.offEvent(a.trigger,o)})})},r.prototype.initContext=function(){var t=this.view,e=new jx(t);this.context=e;var n=this.steps;M(n,function(a){M(a,function(o){if(G(o.action))o.actionObject={action:Ox(o.action,e),methodName:"execute"};else if(N(o.action))o.actionObject=Hh(o.action,e,o.arg);else if(P(o.action)){var s=o.action,l=P(o.arg)?o.arg:[o.arg];o.actionObject=[],M(s,function(h,u){o.actionObject.push(Hh(h,e,l[u]))})}})})},r.prototype.isAllowStep=function(t){var e=this.currentStepName,n=this.steps;if(e===t||t===Nt.SHOW_ENABLE)return!0;if(t===Nt.PROCESSING)return e===Nt.START;if(t===Nt.START)return e!==Nt.PROCESSING;if(t===Nt.END)return e===Nt.PROCESSING||e===Nt.START;if(t===Nt.ROLLBACK){if(n[Nt.END])return e===Nt.END;if(e===Nt.START)return!0}return!1},r.prototype.isAllowExecute=function(t,e){if(this.isAllowStep(t)){var n=this.getKey(t,e);return e.once&&this.emitCaches[n]?!1:e.isEnable?e.isEnable(this.context):!0}return!1},r.prototype.enterStep=function(t){this.currentStepName=t,this.emitCaches={}},r.prototype.afterExecute=function(t,e){t!==Nt.SHOW_ENABLE&&this.currentStepName!==t&&this.enterStep(t);var n=this.getKey(t,e);this.emitCaches[n]=!0},r.prototype.getKey=function(t,e){return t+e.trigger+e.action},r.prototype.getActionCallback=function(t,e){var n=this,a=this.context,o=this.callbackCaches,s=e.actionObject;if(e.action&&s){var l=this.getKey(t,e);if(!o[l]){var h=function(u){a.event=u,n.isAllowExecute(t,e)?(P(s)?M(s,function(c){a.event=u,Vh(c)}):(a.event=u,Vh(s)),n.afterExecute(t,e),e.callback&&(a.event=u,e.callback(a))):a.event=null};e.debounce?o[l]=Wu(h,e.debounce.wait,e.debounce.immediate):e.throttle?o[l]=is(h,e.throttle.wait,{leading:e.throttle.leading,trailing:e.throttle.trailing}):o[l]=h}return o[l]}return null},r.prototype.bindEvent=function(t,e){var n=t.split(":");n[0]==="window"?window.addEventListener(n[1],e):n[0]==="document"?document.addEventListener(n[1],e):this.view.on(t,e)},r.prototype.offEvent=function(t,e){var n=t.split(":");n[0]==="window"?window.removeEventListener(n[1],e):n[0]==="document"?document.removeEventListener(n[1],e):this.view.off(t,e)},r}(Ux),jf={};function Zx(i){return jf[Xr(i)]}function it(i,r){jf[Xr(i)]=r}function Qx(i,r,t){var e=Zx(i);if(!e)return null;if(ce(e)){var n=ot(Xt(e),t);return new qx(r,n)}else{var a=e;return new a(r,t)}}function Kx(i){return{title:{autoRotate:!0,position:"center",spacing:i.axisTitleSpacing,style:{fill:i.axisTitleTextFillColor,fontSize:i.axisTitleTextFontSize,lineHeight:i.axisTitleTextLineHeight,textBaseline:"middle",fontFamily:i.fontFamily},iconStyle:{fill:i.axisDescriptionIconFillColor}},label:{autoRotate:!1,autoEllipsis:!1,autoHide:{type:"equidistance",cfg:{minGap:6}},offset:i.axisLabelOffset,style:{fill:i.axisLabelFillColor,fontSize:i.axisLabelFontSize,lineHeight:i.axisLabelLineHeight,fontFamily:i.fontFamily}},line:{style:{lineWidth:i.axisLineBorder,stroke:i.axisLineBorderColor}},grid:{line:{type:"line",style:{stroke:i.axisGridBorderColor,lineWidth:i.axisGridBorder,lineDash:i.axisGridLineDash}},alignTick:!0,animate:!0},tickLine:{style:{lineWidth:i.axisTickLineBorder,stroke:i.axisTickLineBorderColor},alignTick:!0,length:i.axisTickLineLength},subTickLine:null,animate:!0}}function Jx(i){return{title:null,marker:{symbol:"circle",spacing:i.legendMarkerSpacing,style:{r:i.legendCircleMarkerSize,fill:i.legendMarkerColor}},itemName:{spacing:5,style:{fill:i.legendItemNameFillColor,fontFamily:i.fontFamily,fontSize:i.legendItemNameFontSize,lineHeight:i.legendItemNameLineHeight,fontWeight:i.legendItemNameFontWeight,textAlign:"start",textBaseline:"middle"}},itemStates:{active:{nameStyle:{opacity:.8}},unchecked:{nameStyle:{fill:"#D8D8D8"},markerStyle:{fill:"#D8D8D8",stroke:"#D8D8D8"}},inactive:{nameStyle:{fill:"#D8D8D8"},markerStyle:{opacity:.2}}},flipPage:!0,pageNavigator:{marker:{style:{size:i.legendPageNavigatorMarkerSize,inactiveFill:i.legendPageNavigatorMarkerInactiveFillColor,inactiveOpacity:i.legendPageNavigatorMarkerInactiveFillOpacity,fill:i.legendPageNavigatorMarkerFillColor,opacity:i.legendPageNavigatorMarkerFillOpacity}},text:{style:{fill:i.legendPageNavigatorTextFillColor,fontSize:i.legendPageNavigatorTextFontSize}}},animate:!1,maxItemWidth:200,itemSpacing:i.legendItemSpacing,itemMarginBottom:i.legendItemMarginBottom,padding:i.legendPadding}}function Uf(i){var r,t={point:{default:{fill:i.pointFillColor,r:i.pointSize,stroke:i.pointBorderColor,lineWidth:i.pointBorder,fillOpacity:i.pointFillOpacity},active:{stroke:i.pointActiveBorderColor,lineWidth:i.pointActiveBorder},selected:{stroke:i.pointSelectedBorderColor,lineWidth:i.pointSelectedBorder},inactive:{fillOpacity:i.pointInactiveFillOpacity,strokeOpacity:i.pointInactiveBorderOpacity}},hollowPoint:{default:{fill:i.hollowPointFillColor,lineWidth:i.hollowPointBorder,stroke:i.hollowPointBorderColor,strokeOpacity:i.hollowPointBorderOpacity,r:i.hollowPointSize},active:{stroke:i.hollowPointActiveBorderColor,strokeOpacity:i.hollowPointActiveBorderOpacity},selected:{lineWidth:i.hollowPointSelectedBorder,stroke:i.hollowPointSelectedBorderColor,strokeOpacity:i.hollowPointSelectedBorderOpacity},inactive:{strokeOpacity:i.hollowPointInactiveBorderOpacity}},area:{default:{fill:i.areaFillColor,fillOpacity:i.areaFillOpacity,stroke:null},active:{fillOpacity:i.areaActiveFillOpacity},selected:{fillOpacity:i.areaSelectedFillOpacity},inactive:{fillOpacity:i.areaInactiveFillOpacity}},hollowArea:{default:{fill:null,stroke:i.hollowAreaBorderColor,lineWidth:i.hollowAreaBorder,strokeOpacity:i.hollowAreaBorderOpacity},active:{fill:null,lineWidth:i.hollowAreaActiveBorder},selected:{fill:null,lineWidth:i.hollowAreaSelectedBorder},inactive:{strokeOpacity:i.hollowAreaInactiveBorderOpacity}},interval:{default:{fill:i.intervalFillColor,fillOpacity:i.intervalFillOpacity},active:{stroke:i.intervalActiveBorderColor,lineWidth:i.intervalActiveBorder},selected:{stroke:i.intervalSelectedBorderColor,lineWidth:i.intervalSelectedBorder},inactive:{fillOpacity:i.intervalInactiveFillOpacity,strokeOpacity:i.intervalInactiveBorderOpacity}},hollowInterval:{default:{fill:i.hollowIntervalFillColor,stroke:i.hollowIntervalBorderColor,lineWidth:i.hollowIntervalBorder,strokeOpacity:i.hollowIntervalBorderOpacity},active:{stroke:i.hollowIntervalActiveBorderColor,lineWidth:i.hollowIntervalActiveBorder,strokeOpacity:i.hollowIntervalActiveBorderOpacity},selected:{stroke:i.hollowIntervalSelectedBorderColor,lineWidth:i.hollowIntervalSelectedBorder,strokeOpacity:i.hollowIntervalSelectedBorderOpacity},inactive:{stroke:i.hollowIntervalInactiveBorderColor,lineWidth:i.hollowIntervalInactiveBorder,strokeOpacity:i.hollowIntervalInactiveBorderOpacity}},line:{default:{stroke:i.lineBorderColor,lineWidth:i.lineBorder,strokeOpacity:i.lineBorderOpacity,fill:null,lineAppendWidth:10,lineCap:"round",lineJoin:"round"},active:{lineWidth:i.lineActiveBorder},selected:{lineWidth:i.lineSelectedBorder},inactive:{strokeOpacity:i.lineInactiveBorderOpacity}}},e=Kx(i),n=Jx(i);return{background:i.backgroundColor,defaultColor:i.brandColor,subColor:i.subColor,semanticRed:i.paletteSemanticRed,semanticGreen:i.paletteSemanticGreen,padding:"auto",fontFamily:i.fontFamily,columnWidthRatio:1/2,maxColumnWidth:null,minColumnWidth:null,roseWidthRatio:.9999999,multiplePieWidthRatio:1/1.3,colors10:i.paletteQualitative10,colors20:i.paletteQualitative20,sequenceColors:i.paletteSequence,shapes:{point:["hollow-circle","hollow-square","hollow-bowtie","hollow-diamond","hollow-hexagon","hollow-triangle","hollow-triangle-down","circle","square","bowtie","diamond","hexagon","triangle","triangle-down","cross","tick","plus","hyphen","line"],line:["line","dash","dot","smooth"],area:["area","smooth","line","smooth-line"],interval:["rect","hollow-rect","line","tick"]},sizes:[1,10],geometries:{interval:{rect:{default:{style:t.interval.default},active:{style:t.interval.active},inactive:{style:t.interval.inactive},selected:{style:function(a){var o=a.geometry.coordinate;if(o.isPolar&&o.isTransposed){var s=_n(a.getModel(),o),l=s.startAngle,h=s.endAngle,u=(l+h)/2,c=7.5,f=c*Math.cos(u),v=c*Math.sin(u);return{matrix:ct(null,[["t",f,v]])}}return t.interval.selected}}},"hollow-rect":{default:{style:t.hollowInterval.default},active:{style:t.hollowInterval.active},inactive:{style:t.hollowInterval.inactive},selected:{style:t.hollowInterval.selected}},line:{default:{style:t.hollowInterval.default},active:{style:t.hollowInterval.active},inactive:{style:t.hollowInterval.inactive},selected:{style:t.hollowInterval.selected}},tick:{default:{style:t.hollowInterval.default},active:{style:t.hollowInterval.active},inactive:{style:t.hollowInterval.inactive},selected:{style:t.hollowInterval.selected}},funnel:{default:{style:t.interval.default},active:{style:t.interval.active},inactive:{style:t.interval.inactive},selected:{style:t.interval.selected}},pyramid:{default:{style:t.interval.default},active:{style:t.interval.active},inactive:{style:t.interval.inactive},selected:{style:t.interval.selected}}},line:{line:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},dot:{default:{style:w(w({},t.line.default),{lineCap:null,lineDash:[1,1]})},active:{style:w(w({},t.line.active),{lineCap:null,lineDash:[1,1]})},inactive:{style:w(w({},t.line.inactive),{lineCap:null,lineDash:[1,1]})},selected:{style:w(w({},t.line.selected),{lineCap:null,lineDash:[1,1]})}},dash:{default:{style:w(w({},t.line.default),{lineCap:null,lineDash:[5.5,1]})},active:{style:w(w({},t.line.active),{lineCap:null,lineDash:[5.5,1]})},inactive:{style:w(w({},t.line.inactive),{lineCap:null,lineDash:[5.5,1]})},selected:{style:w(w({},t.line.selected),{lineCap:null,lineDash:[5.5,1]})}},smooth:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},hv:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},vh:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},hvh:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},vhv:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}}},polygon:{polygon:{default:{style:t.interval.default},active:{style:t.interval.active},inactive:{style:t.interval.inactive},selected:{style:t.interval.selected}}},point:{circle:{default:{style:t.point.default},active:{style:t.point.active},inactive:{style:t.point.inactive},selected:{style:t.point.selected}},square:{default:{style:t.point.default},active:{style:t.point.active},inactive:{style:t.point.inactive},selected:{style:t.point.selected}},bowtie:{default:{style:t.point.default},active:{style:t.point.active},inactive:{style:t.point.inactive},selected:{style:t.point.selected}},diamond:{default:{style:t.point.default},active:{style:t.point.active},inactive:{style:t.point.inactive},selected:{style:t.point.selected}},hexagon:{default:{style:t.point.default},active:{style:t.point.active},inactive:{style:t.point.inactive},selected:{style:t.point.selected}},triangle:{default:{style:t.point.default},active:{style:t.point.active},inactive:{style:t.point.inactive},selected:{style:t.point.selected}},"triangle-down":{default:{style:t.point.default},active:{style:t.point.active},inactive:{style:t.point.inactive},selected:{style:t.point.selected}},"hollow-circle":{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},"hollow-square":{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},"hollow-bowtie":{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},"hollow-diamond":{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},"hollow-hexagon":{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},"hollow-triangle":{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},"hollow-triangle-down":{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},cross:{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},tick:{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},plus:{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},hyphen:{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},line:{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}}},area:{area:{default:{style:t.area.default},active:{style:t.area.active},inactive:{style:t.area.inactive},selected:{style:t.area.selected}},smooth:{default:{style:t.area.default},active:{style:t.area.active},inactive:{style:t.area.inactive},selected:{style:t.area.selected}},line:{default:{style:t.hollowArea.default},active:{style:t.hollowArea.active},inactive:{style:t.hollowArea.inactive},selected:{style:t.hollowArea.selected}},"smooth-line":{default:{style:t.hollowArea.default},active:{style:t.hollowArea.active},inactive:{style:t.hollowArea.inactive},selected:{style:t.hollowArea.selected}}},schema:{candle:{default:{style:t.hollowInterval.default},active:{style:t.hollowInterval.active},inactive:{style:t.hollowInterval.inactive},selected:{style:t.hollowInterval.selected}},box:{default:{style:t.hollowInterval.default},active:{style:t.hollowInterval.active},inactive:{style:t.hollowInterval.inactive},selected:{style:t.hollowInterval.selected}}},edge:{line:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},vhv:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},smooth:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},arc:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}}},violin:{violin:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},smooth:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},hollow:{default:{style:t.hollowArea.default},active:{style:t.hollowArea.active},inactive:{style:t.hollowArea.inactive},selected:{style:t.hollowArea.selected}},"hollow-smooth":{default:{style:t.hollowArea.default},active:{style:t.hollowArea.active},inactive:{style:t.hollowArea.inactive},selected:{style:t.hollowArea.selected}}}},components:{axis:{common:e,top:{position:"top",grid:null,title:null,verticalLimitLength:1/2},bottom:{position:"bottom",grid:null,title:null,verticalLimitLength:1/2},left:{position:"left",title:null,line:null,tickLine:null,verticalLimitLength:1/3},right:{position:"right",title:null,line:null,tickLine:null,verticalLimitLength:1/3},circle:{title:null,grid:D({},e.grid,{line:{type:"line"}})},radius:{title:null,grid:D({},e.grid,{line:{type:"circle"}})}},legend:{common:n,right:{layout:"vertical",padding:i.legendVerticalPadding},left:{layout:"vertical",padding:i.legendVerticalPadding},top:{layout:"horizontal",padding:i.legendHorizontalPadding},bottom:{layout:"horizontal",padding:i.legendHorizontalPadding},continuous:{title:null,background:null,track:{},rail:{type:"color",size:i.sliderRailHeight,defaultLength:i.sliderRailWidth,style:{fill:i.sliderRailFillColor,stroke:i.sliderRailBorderColor,lineWidth:i.sliderRailBorder}},label:{align:"rail",spacing:4,formatter:null,style:{fill:i.sliderLabelTextFillColor,fontSize:i.sliderLabelTextFontSize,lineHeight:i.sliderLabelTextLineHeight,textBaseline:"middle",fontFamily:i.fontFamily}},handler:{size:i.sliderHandlerWidth,style:{fill:i.sliderHandlerFillColor,stroke:i.sliderHandlerBorderColor}},slidable:!0,padding:n.padding}},tooltip:{showContent:!0,follow:!0,showCrosshairs:!1,showMarkers:!0,shared:!1,enterable:!1,position:"auto",marker:{symbol:"circle",stroke:"#fff",shadowBlur:10,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"rgba(0,0,0,0.09)",lineWidth:2,r:4},crosshairs:{line:{style:{stroke:i.tooltipCrosshairsBorderColor,lineWidth:i.tooltipCrosshairsBorder}},text:null,textBackground:{padding:2,style:{fill:"rgba(0, 0, 0, 0.25)",lineWidth:0,stroke:null}},follow:!1},domStyles:(r={},r["".concat(Se)]={position:"absolute",visibility:"hidden",zIndex:8,transition:"left 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0s, top 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0s",backgroundColor:i.tooltipContainerFillColor,opacity:i.tooltipContainerFillOpacity,boxShadow:i.tooltipContainerShadow,borderRadius:"".concat(i.tooltipContainerBorderRadius,"px"),color:i.tooltipTextFillColor,fontSize:"".concat(i.tooltipTextFontSize,"px"),fontFamily:i.fontFamily,lineHeight:"".concat(i.tooltipTextLineHeight,"px"),padding:"0 12px 0 12px"},r["".concat(be)]={marginBottom:"12px",marginTop:"12px"},r["".concat(Oi)]={margin:0,listStyleType:"none",padding:0},r["".concat(Aa)]={listStyleType:"none",padding:0,marginBottom:"12px",marginTop:"12px",marginLeft:0,marginRight:0},r["".concat(Ta)]={width:"8px",height:"8px",borderRadius:"50%",display:"inline-block",marginRight:"8px"},r["".concat(La)]={display:"inline-block",float:"right",marginLeft:"30px"},r)},annotation:{arc:{style:{stroke:i.annotationArcBorderColor,lineWidth:i.annotationArcBorder},animate:!0},line:{style:{stroke:i.annotationLineBorderColor,lineDash:i.annotationLineDash,lineWidth:i.annotationLineBorder},text:{position:"start",autoRotate:!0,style:{fill:i.annotationTextFillColor,stroke:i.annotationTextBorderColor,lineWidth:i.annotationTextBorder,fontSize:i.annotationTextFontSize,textAlign:"start",fontFamily:i.fontFamily,textBaseline:"bottom"}},animate:!0},text:{style:{fill:i.annotationTextFillColor,stroke:i.annotationTextBorderColor,lineWidth:i.annotationTextBorder,fontSize:i.annotationTextFontSize,textBaseline:"middle",textAlign:"start",fontFamily:i.fontFamily},animate:!0},region:{top:!1,style:{lineWidth:i.annotationRegionBorder,stroke:i.annotationRegionBorderColor,fill:i.annotationRegionFillColor,fillOpacity:i.annotationRegionFillOpacity},animate:!0},image:{top:!1,animate:!0},dataMarker:{top:!0,point:{style:{r:3,stroke:i.brandColor,lineWidth:2}},line:{style:{stroke:i.annotationLineBorderColor,lineWidth:i.annotationLineBorder},length:i.annotationDataMarkerLineLength},text:{style:{textAlign:"start",fill:i.annotationTextFillColor,stroke:i.annotationTextBorderColor,lineWidth:i.annotationTextBorder,fontSize:i.annotationTextFontSize,fontFamily:i.fontFamily}},direction:"upward",autoAdjust:!0,animate:!0},dataRegion:{style:{region:{fill:i.annotationRegionFillColor,fillOpacity:i.annotationRegionFillOpacity},text:{textAlign:"center",textBaseline:"bottom",fill:i.annotationTextFillColor,stroke:i.annotationTextBorderColor,lineWidth:i.annotationTextBorder,fontSize:i.annotationTextFontSize,fontFamily:i.fontFamily}},animate:!0}},slider:{common:{padding:[8,8,8,8],backgroundStyle:{fill:i.cSliderBackgroundFillColor,opacity:i.cSliderBackgroundFillOpacity},foregroundStyle:{fill:i.cSliderForegroundFillColor,opacity:i.cSliderForegroundFillOpacity},handlerStyle:{width:i.cSliderHandlerWidth,height:i.cSliderHandlerHeight,fill:i.cSliderHandlerFillColor,opacity:i.cSliderHandlerFillOpacity,stroke:i.cSliderHandlerBorderColor,lineWidth:i.cSliderHandlerBorder,radius:i.cSliderHandlerBorderRadius,highLightFill:i.cSliderHandlerHighlightFillColor},textStyle:{fill:i.cSliderTextFillColor,opacity:i.cSliderTextFillOpacity,fontSize:i.cSliderTextFontSize,lineHeight:i.cSliderTextLineHeight,fontWeight:i.cSliderTextFontWeight,stroke:i.cSliderTextBorderColor,lineWidth:i.cSliderTextBorder}}},scrollbar:{common:{padding:[8,8,8,8]},default:{style:{trackColor:i.scrollbarTrackFillColor,thumbColor:i.scrollbarThumbFillColor}},hover:{style:{thumbColor:i.scrollbarThumbHighlightFillColor}}}},labels:{offset:12,style:{fill:i.labelFillColor,fontSize:i.labelFontSize,fontFamily:i.fontFamily,stroke:i.labelBorderColor,lineWidth:i.labelBorder},fillColorDark:i.labelFillColorDark,fillColorLight:i.labelFillColorLight,autoRotate:!0},innerLabels:{style:{fill:i.innerLabelFillColor,fontSize:i.innerLabelFontSize,fontFamily:i.fontFamily,stroke:i.innerLabelBorderColor,lineWidth:i.innerLabelBorder},autoRotate:!0},overflowLabels:{style:{fill:i.overflowLabelFillColor,fontSize:i.overflowLabelFontSize,fontFamily:i.fontFamily,stroke:i.overflowLabelBorderColor,lineWidth:i.overflowLabelBorder}},pieLabels:{labelHeight:14,offset:10,labelLine:{style:{lineWidth:i.labelLineBorder}},autoRotate:!0}}}var j={100:"#000",95:"#0D0D0D",85:"#262626",65:"#595959",45:"#8C8C8C",25:"#BFBFBF",15:"#D9D9D9",6:"#F0F0F0"},wr={100:"#FFFFFF",95:"#F2F2F2",85:"#D9D9D9",65:"#A6A6A6",45:"#737373",25:"#404040",15:"#262626",6:"#0F0F0F"},tw=["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"],ew=["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"],rw=["#B8E1FF","#9AC5FF","#7DAAFF","#5B8FF9","#3D76DD","#085EC0","#0047A5","#00318A","#001D70"],qf=function(i){i===void 0&&(i={});var r=i.paletteQualitative10,t=r===void 0?tw:r,e=i.paletteQualitative20,n=e===void 0?ew:e,a=i.brandColor,o=a===void 0?t[0]:a,s={backgroundColor:"transparent",brandColor:o,subColor:"rgba(0,0,0,0.05)",paletteQualitative10:t,paletteQualitative20:n,paletteSemanticRed:"#F4664A",paletteSemanticGreen:"#30BF78",paletteSemanticYellow:"#FAAD14",paletteSequence:rw,fontFamily:`"Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"`,axisLineBorderColor:j[25],axisLineBorder:1,axisLineDash:null,axisTitleTextFillColor:j[65],axisTitleTextFontSize:12,axisTitleTextLineHeight:12,axisTitleTextFontWeight:"normal",axisTitleSpacing:12,axisDescriptionIconFillColor:wr[85],axisTickLineBorderColor:j[25],axisTickLineLength:4,axisTickLineBorder:1,axisSubTickLineBorderColor:j[15],axisSubTickLineLength:2,axisSubTickLineBorder:1,axisLabelFillColor:j[45],axisLabelFontSize:12,axisLabelLineHeight:12,axisLabelFontWeight:"normal",axisLabelOffset:8,axisGridBorderColor:j[15],axisGridBorder:1,axisGridLineDash:null,legendTitleTextFillColor:j[45],legendTitleTextFontSize:12,legendTitleTextLineHeight:21,legendTitleTextFontWeight:"normal",legendMarkerColor:o,legendMarkerSpacing:8,legendMarkerSize:4,legendCircleMarkerSize:4,legendSquareMarkerSize:4,legendLineMarkerSize:5,legendItemNameFillColor:j[65],legendItemNameFontSize:12,legendItemNameLineHeight:12,legendItemNameFontWeight:"normal",legendItemSpacing:24,legendItemMarginBottom:12,legendPadding:[8,8,8,8],legendHorizontalPadding:[8,0,8,0],legendVerticalPadding:[0,8,0,8],legendPageNavigatorMarkerSize:12,legendPageNavigatorMarkerInactiveFillColor:j[100],legendPageNavigatorMarkerInactiveFillOpacity:.45,legendPageNavigatorMarkerFillColor:j[100],legendPageNavigatorMarkerFillOpacity:1,legendPageNavigatorTextFillColor:j[45],legendPageNavigatorTextFontSize:12,sliderRailFillColor:j[15],sliderRailBorder:0,sliderRailBorderColor:null,sliderRailWidth:100,sliderRailHeight:12,sliderLabelTextFillColor:j[45],sliderLabelTextFontSize:12,sliderLabelTextLineHeight:12,sliderLabelTextFontWeight:"normal",sliderHandlerFillColor:j[6],sliderHandlerWidth:10,sliderHandlerHeight:14,sliderHandlerBorder:1,sliderHandlerBorderColor:j[25],annotationArcBorderColor:j[15],annotationArcBorder:1,annotationLineBorderColor:j[25],annotationLineBorder:1,annotationLineDash:null,annotationTextFillColor:j[65],annotationTextFontSize:12,annotationTextLineHeight:12,annotationTextFontWeight:"normal",annotationTextBorderColor:null,annotationTextBorder:0,annotationRegionFillColor:j[100],annotationRegionFillOpacity:.06,annotationRegionBorder:0,annotationRegionBorderColor:null,annotationDataMarkerLineLength:16,tooltipCrosshairsBorderColor:j[25],tooltipCrosshairsBorder:1,tooltipCrosshairsLineDash:null,tooltipContainerFillColor:"rgb(255, 255, 255)",tooltipContainerFillOpacity:.95,tooltipContainerShadow:"0px 0px 10px #aeaeae",tooltipContainerBorderRadius:3,tooltipTextFillColor:j[65],tooltipTextFontSize:12,tooltipTextLineHeight:12,tooltipTextFontWeight:"bold",labelFillColor:j[65],labelFillColorDark:"#2c3542",labelFillColorLight:"#ffffff",labelFontSize:12,labelLineHeight:12,labelFontWeight:"normal",labelBorderColor:null,labelBorder:0,innerLabelFillColor:wr[100],innerLabelFontSize:12,innerLabelLineHeight:12,innerLabelFontWeight:"normal",innerLabelBorderColor:null,innerLabelBorder:0,overflowLabelFillColor:j[65],overflowLabelFontSize:12,overflowLabelLineHeight:12,overflowLabelFontWeight:"normal",overflowLabelBorderColor:wr[100],overflowLabelBorder:1,labelLineBorder:1,labelLineBorderColor:j[25],cSliderRailHieght:16,cSliderBackgroundFillColor:"#416180",cSliderBackgroundFillOpacity:.05,cSliderForegroundFillColor:"#5B8FF9",cSliderForegroundFillOpacity:.15,cSliderHandlerHeight:24,cSliderHandlerWidth:10,cSliderHandlerFillColor:"#F7F7F7",cSliderHandlerFillOpacity:1,cSliderHandlerHighlightFillColor:"#FFF",cSliderHandlerBorderColor:"#BFBFBF",cSliderHandlerBorder:1,cSliderHandlerBorderRadius:2,cSliderTextFillColor:"#000",cSliderTextFillOpacity:.45,cSliderTextFontSize:12,cSliderTextLineHeight:12,cSliderTextFontWeight:"normal",cSliderTextBorderColor:null,cSliderTextBorder:0,scrollbarTrackFillColor:"rgba(0,0,0,0)",scrollbarThumbFillColor:"rgba(0,0,0,0.15)",scrollbarThumbHighlightFillColor:"rgba(0,0,0,0.2)",pointFillColor:o,pointFillOpacity:.95,pointSize:4,pointBorder:1,pointBorderColor:wr[100],pointBorderOpacity:1,pointActiveBorderColor:j[100],pointSelectedBorder:2,pointSelectedBorderColor:j[100],pointInactiveFillOpacity:.3,pointInactiveBorderOpacity:.3,hollowPointSize:4,hollowPointBorder:1,hollowPointBorderColor:o,hollowPointBorderOpacity:.95,hollowPointFillColor:wr[100],hollowPointActiveBorder:1,hollowPointActiveBorderColor:j[100],hollowPointActiveBorderOpacity:1,hollowPointSelectedBorder:2,hollowPointSelectedBorderColor:j[100],hollowPointSelectedBorderOpacity:1,hollowPointInactiveBorderOpacity:.3,lineBorder:2,lineBorderColor:o,lineBorderOpacity:1,lineActiveBorder:3,lineSelectedBorder:3,lineInactiveBorderOpacity:.3,areaFillColor:o,areaFillOpacity:.25,areaActiveFillColor:o,areaActiveFillOpacity:.5,areaSelectedFillColor:o,areaSelectedFillOpacity:.5,areaInactiveFillOpacity:.3,hollowAreaBorderColor:o,hollowAreaBorder:2,hollowAreaBorderOpacity:1,hollowAreaActiveBorder:3,hollowAreaActiveBorderColor:j[100],hollowAreaSelectedBorder:3,hollowAreaSelectedBorderColor:j[100],hollowAreaInactiveBorderOpacity:.3,intervalFillColor:o,intervalFillOpacity:.95,intervalActiveBorder:1,intervalActiveBorderColor:j[100],intervalActiveBorderOpacity:1,intervalSelectedBorder:2,intervalSelectedBorderColor:j[100],intervalSelectedBorderOpacity:1,intervalInactiveBorderOpacity:.3,intervalInactiveFillOpacity:.3,hollowIntervalBorder:2,hollowIntervalBorderColor:o,hollowIntervalBorderOpacity:1,hollowIntervalFillColor:wr[100],hollowIntervalActiveBorder:2,hollowIntervalActiveBorderColor:j[100],hollowIntervalSelectedBorder:3,hollowIntervalSelectedBorderColor:j[100],hollowIntervalSelectedBorderOpacity:1,hollowIntervalInactiveBorderOpacity:.3};return w(w({},s),i)};qf();function qn(i){var r=i.styleSheet,t=r===void 0?{}:r,e=mt(i,["styleSheet"]),n=qf(t);return D({},Uf(n),e)}var iw=qn({}),zo={default:iw};function ro(i){return T(zo,Xr(i),zo.default)}function nw(i,r){zo[Xr(i)]=qn(r)}function Nh(i,r,t){var e=t.translate(i),n=t.translate(r);return xt(e,n)}function aw(i,r){var t=r.coordinate,e=r.getXScale(),n=e.range,a=n[n.length-1],o=n[0],s=t.invert(i),l=s.x;return t.isPolar&&l>(1+a)/2&&(l=o),e.translate(e.invert(l))}function Xh(i,r,t){var e=t.coordinate,n=t.getYScale(),a=n.field,o=e.invert(r),s=n.invert(o.y),l=Ce(i,function(h){var u=h[Z];return u[a][0]<=s&&u[a][1]>=s});return l||i[i.length-1]}var ow=ia(function(i){if(i.isCategory)return 1;for(var r=i.values,t=r.length,e=i.translate(r[0]),n=e,a=0;an&&(n=s)}return(n-e)/(t-1)});function sw(i,r,t){var e=r.getAttribute("position"),n=e.getFields(),a=r.scales,o=G(t)||!t?n[0]:t,s=a[o],l=s?s.getText(i[o]):i[o]||o;return G(t)?t(l,i):l}function lw(i){var r=es(i.attributes);return Qt(r,function(t){return rr(Ar,t.type)})}function Zf(i){var r,t,e=lw(i),n;try{for(var a=$(e),o=a.next();!o.done;o=a.next()){var s=o.value,l=s.getScale(s.type);if(l&&l.isLinear){var h=T(i.scaleDefs,l.field),u=Ff(l,h,s.type,i.type);if(u!=="cat"){n=l;break}}}}catch(v){r={error:v}}finally{try{o&&!o.done&&(t=a.return)&&t.call(a)}finally{if(r)throw r.error}}var c=i.getXScale(),f=i.getYScale();return n||f||c}function hw(i,r){var t=r.field,e=i[t];if(P(e)){var n=e.map(function(a){return r.getText(a)});return n.join("-")}return r.getText(e)}function uw(i,r){var t,e=r.getGroupScales();if(e.length&&(t=e[0]),t){var n=t.field;return t.getText(i[n])}var a=Zf(r);return Di(a)}function Qf(i,r,t){if(r.length===0)return null;var e=t.type,n=t.getXScale(),a=t.getYScale(),o=n.field,s=a.field,l=null;if(e==="heatmap"||e==="point"){for(var h=t.coordinate,u=h.invert(i),c=n.invert(u.x),f=a.invert(u.y),v=1/0,p=0;p=x)if(L)P(l)||(l=[]),l.push(k);else{l=k;break}}P(l)&&(l=Xh(l,i,t))}else{var B=void 0;if(!n.isLinear&&n.type!=="timeCat"){for(var p=0;pn.translate(A)||xn.max||xMath.abs(n.translate(B[Z][o])-x)&&(m=B)}var _=ow(t.getXScale());return!l&&Math.abs(n.translate(m[Z][o])-x)<=_/2&&(l=m),l}function Kf(i,r,t,e){var n,a;t===void 0&&(t=""),e===void 0&&(e=!1);var o=i[Z],s=sw(o,r,t),l=r.tooltipOption,h=r.theme.defaultColor,u=[],c,f;function v(k,B){if(e||!I(B)&&B!==""){var O={title:s,data:o,mappingData:i,name:k,value:B,color:i.color||h,marker:!0};u.push(O)}}if(rt(l)){var p=l.fields,g=l.callback;if(g){var d=p.map(function(k){return i[Z][k]}),y=g.apply(void 0,et([],Y(d),!1)),C=w({data:i[Z],mappingData:i,title:s,color:i.color||h,marker:!0},y);u.push(C)}else{var m=r.scales;try{for(var x=$(p),S=x.next();!S.done;S=x.next()){var b=S.value;if(!I(o[b])){var A=m[b];c=Di(A),f=A.getText(o[b]),v(c,f)}}}catch(k){n={error:k}}finally{try{S&&!S.done&&(a=x.return)&&a.call(x)}finally{if(n)throw n.error}}}}else{var L=Zf(r);f=hw(o,L),c=uw(o,r),v(c,f)}return u}function zh(i,r,t,e){var n,a,o=e.showNil,s=[],l=i.dataArray;if(!pe(l)){i.sort(l);try{for(var h=$(l),u=h.next();!u.done;u=h.next()){var c=u.value,f=Qf(r,c,i);if(f){var v=i.getElementId(f),p=i.elementsMap[v];if(i.type==="heatmap"||p.visible){var g=Kf(f,i,t,o);g.length&&s.push(g)}}}}catch(d){n={error:d}}finally{try{u&&!u.done&&(a=h.return)&&a.call(h)}finally{if(n)throw n.error}}}return s}function Wh(i,r,t,e){var n=e.showNil,a=[],o=i.container,s=o.getShape(r.x,r.y);if(s&&s.get("visible")&&s.get("origin")){var l=s.get("origin").mappingData,h=Kf(l,i,t,n);h.length&&a.push(h)}return a}function Wo(i,r,t){var e,n,a=[],o=i.geometries,s=t.shared,l=t.title,h=t.reversed;try{for(var u=$(o),c=u.next();!c.done;c=u.next()){var f=c.value;if(f.visible&&f.tooltipOption!==!1){var v=f.type,p=void 0;["point","edge","polygon"].includes(v)?p=Wh(f,r,l,t):["area","line","path","heatmap"].includes(v)||s!==!1?p=zh(f,r,l,t):p=Wh(f,r,l,t),p.length&&(h&&p.reverse(),a.push(p))}}}catch(g){e={error:g}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}return a}function cw(i,r,t){var e,n,a=Wo(i,r,t);try{for(var o=$(i.views),s=o.next();!s.done;s=o.next()){var l=s.value;a=a.concat(Wo(l,r,t))}}catch(h){e={error:h}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return a}function fw(i){return!U(i)&&!P(i)}function Is(i){i===void 0&&(i=0);var r=P(i)?i:[i];switch(r.length){case 0:r=[0,0,0,0];break;case 1:r=new Array(4).fill(r[0]);break;case 2:r=et(et([],Y(r),!1),Y(r),!1);break;case 3:r=et(et([],Y(r),!1),[r[1]],!1);break;default:r=r.slice(0,4);break}return r}var Ps={};function _r(i,r){Ps[i]=r}function vw(){return Object.keys(Ps)}function pw(i){return Ps[i]}var gw=function(){function i(r){this.option=this.wrapperOption(r)}return i.prototype.update=function(r){return this.option=this.wrapperOption(r),this},i.prototype.hasAction=function(r){var t=this.option.actions;return ea(t,function(e){return e[0]===r})},i.prototype.create=function(r,t){var e=this.option,n=e.type,a=e.cfg,o=n==="theta",s=w({start:r,end:t},a),l=Nm(o?"polar":n);return this.coordinate=new l(s),this.coordinate.type=n,o&&(this.hasAction("transpose")||this.transpose()),this.execActions(),this.coordinate},i.prototype.adjust=function(r,t){return this.coordinate.update({start:r,end:t}),this.coordinate.resetMatrix(),this.execActions(["scale","rotate","translate"]),this.coordinate},i.prototype.rotate=function(r){return this.option.actions.push(["rotate",r]),this},i.prototype.reflect=function(r){return this.option.actions.push(["reflect",r]),this},i.prototype.scale=function(r,t){return this.option.actions.push(["scale",r,t]),this},i.prototype.transpose=function(){return this.option.actions.push(["transpose"]),this},i.prototype.getOption=function(){return this.option},i.prototype.getCoordinate=function(){return this.coordinate},i.prototype.wrapperOption=function(r){return w({type:"rect",actions:[],cfg:{}},r)},i.prototype.execActions=function(r){var t=this,e=this.option.actions;M(e,function(n){var a,o=Y(n),s=o[0],l=o.slice(1),h=I(r)?!0:r.includes(s);h&&(a=t.coordinate)[s].apply(a,et([],Y(l),!1))})},i}(),At=function(){function i(r,t,e){this.view=r,this.gEvent=t,this.data=e,this.type=t.type}return i.fromData=function(r,t,e){return new i(r,new Ni(t,{}),e)},Object.defineProperty(i.prototype,"target",{get:function(){return this.gEvent.target},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"event",{get:function(){return this.gEvent.originalEvent},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"x",{get:function(){return this.gEvent.x},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"y",{get:function(){return this.gEvent.y},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"clientX",{get:function(){return this.gEvent.clientX},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"clientY",{get:function(){return this.gEvent.clientY},enumerable:!1,configurable:!0}),i.prototype.toString=function(){return"[Event (type=".concat(this.type,")]")},i.prototype.clone=function(){return new i(this.view,this.gEvent,this.data)},i}();function dw(i){var r=i.getController("axis"),t=i.getController("legend"),e=i.getController("annotation"),n=i.getController("slider"),a=i.getController("scrollbar");[r,n,a,t,e].forEach(function(o){o&&o.layout()})}var yw=function(){function i(){this.scales=new Map,this.syncScales=new Map}return i.prototype.createScale=function(r,t,e,n){var a=e,o=this.getScaleMeta(n);if(t.length===0&&o){var s=o.scale,l={type:s.type};s.isCategory&&(l.values=s.values),a=D(l,o.scaleDef,e)}var h=Tx(r,t,a);return this.cacheScale(h,e,n),h},i.prototype.sync=function(r,t){var e=this;this.syncScales.forEach(function(n,a){var o=Number.MAX_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER,l=[];M(n,function(h){var u=e.getScale(h);s=U(u.max)?Math.max(s,u.max):s,o=U(u.min)?Math.min(o,u.min):o,M(u.values,function(c){l.includes(c)||l.push(c)})}),M(n,function(h){var u=e.getScale(h);if(u.isContinuous)u.change({min:o,max:s,values:l});else if(u.isCategory){var c=u.range,f=e.getScaleMeta(h);l&&!T(f,["scaleDef","range"])&&(c=Of(D({},u,{values:l}),r,t)),u.change({values:l,range:c})}})})},i.prototype.cacheScale=function(r,t,e){var n=this.getScaleMeta(e);n&&n.scale.type===r.type?(Lx(n.scale,r),n.scaleDef=t):(n={key:e,scale:r,scaleDef:t},this.scales.set(e,n));var a=this.getSyncKey(n);if(n.syncKey=a,this.removeFromSyncScales(e),a){var o=this.syncScales.get(a);o||(o=[],this.syncScales.set(a,o)),o.push(e)}},i.prototype.getScale=function(r){var t=this.getScaleMeta(r);if(!t){var e=Ct(r.split("-")),n=this.syncScales.get(e);n&&n.length&&(t=this.getScaleMeta(n[0]))}return t&&t.scale},i.prototype.deleteScale=function(r){var t=this.getScaleMeta(r);if(t){var e=t.syncKey,n=this.syncScales.get(e);if(n&&n.length){var a=n.indexOf(r);a!==-1&&n.splice(a,1)}}this.scales.delete(r)},i.prototype.clear=function(){this.scales.clear(),this.syncScales.clear()},i.prototype.removeFromSyncScales=function(r){var t=this;this.syncScales.forEach(function(e,n){var a=e.indexOf(r);if(a!==-1)return e.splice(a,1),e.length===0&&t.syncScales.delete(n),!1})},i.prototype.getSyncKey=function(r){var t=r.scale,e=r.scaleDef,n=t.field,a=T(e,["sync"]);return a===!0?n:a===!1?void 0:a},i.prototype.getScaleMeta=function(r){return this.scales.get(r)},i}(),In=function(){function i(r,t,e,n){r===void 0&&(r=0),t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=0),this.top=r,this.right=t,this.bottom=e,this.left=n}return i.instance=function(r,t,e,n){return r===void 0&&(r=0),t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=0),new i(r,t,e,n)},i.prototype.max=function(r){var t=Y(r,4),e=t[0],n=t[1],a=t[2],o=t[3];return this.top=Math.max(this.top,e),this.right=Math.max(this.right,n),this.bottom=Math.max(this.bottom,a),this.left=Math.max(this.left,o),this},i.prototype.shrink=function(r){var t=Y(r,4),e=t[0],n=t[1],a=t[2],o=t[3];return this.top+=e,this.right+=n,this.bottom+=a,this.left+=o,this},i.prototype.inc=function(r,t){var e=r.width,n=r.height;switch(t){case F.TOP:case F.TOP_LEFT:case F.TOP_RIGHT:this.top+=n;break;case F.RIGHT:case F.RIGHT_TOP:case F.RIGHT_BOTTOM:this.right+=e;break;case F.BOTTOM:case F.BOTTOM_LEFT:case F.BOTTOM_RIGHT:this.bottom+=n;break;case F.LEFT:case F.LEFT_TOP:case F.LEFT_BOTTOM:this.left+=e;break}return this},i.prototype.getPadding=function(){return[this.top,this.right,this.bottom,this.left]},i.prototype.clone=function(){return new(i.bind.apply(i,et([void 0],Y(this.getPadding()),!1)))},i}();function mw(i){var r=i.padding;if(!fw(r))return new(In.bind.apply(In,et([void 0],Y(Is(r)),!1)));var t=i.viewBBox,e=new In,n=[],a=[],o=[];return M(i.getComponents(),function(s){var l=s.type;l===dt.AXIS?n.push(s):[dt.LEGEND,dt.SLIDER,dt.SCROLLBAR].includes(l)?a.push(s):l!==dt.GRID&&l!==dt.TOOLTIP&&o.push(s)}),M(n,function(s){var l=s.component,h=l.getLayoutBBox(),u=new Bt(h.x,h.y,h.width,h.height),c=u.exceed(t);e.max(c)}),M(a,function(s){var l=s.component,h=s.direction,u=l.getLayoutBBox(),c=l.get("padding"),f=new Bt(u.x,u.y,u.width,u.height).expand(c);e.inc(f,h)}),M(o,function(s){var l=s.component,h=s.direction,u=l.getLayoutBBox(),c=new Bt(u.x,u.y,u.width,u.height);e.inc(c,h)}),e}function xw(i,r,t){var e=t.instance();r.forEach(function(n){n.autoPadding=e.max(n.autoPadding.getPadding())})}var Jf=function(i){E(r,i);function r(t){var e=i.call(this,{visible:t.visible})||this;e.views=[],e.geometries=[],e.controllers=[],e.interactions={},e.limitInPlot=!1,e.options={data:[],animate:!0},e.usedControllers=vw(),e.scalePool=new yw,e.layoutFunc=dw,e.isPreMouseInPlot=!1,e.isDataChanged=!1,e.isCoordinateChanged=!1,e.createdScaleKeys=new Map,e.onCanvasEvent=function(m){var x=m.name;if(!x.includes(":")){var S=e.createViewEvent(m);e.doPlotEvent(S),e.emit(x,S)}},e.onDelegateEvents=function(m){var x=m.name;if(!!x.includes(":")){var S=e.createViewEvent(m);e.emit(x,S)}};var n=t.id,a=n===void 0?qe("view"):n,o=t.parent,s=t.canvas,l=t.backgroundGroup,h=t.middleGroup,u=t.foregroundGroup,c=t.region,f=c===void 0?{start:{x:0,y:0},end:{x:1,y:1}}:c,v=t.padding,p=t.appendPadding,g=t.theme,d=t.options,y=t.limitInPlot,C=t.syncViewPadding;return e.parent=o,e.canvas=s,e.backgroundGroup=l,e.middleGroup=h,e.foregroundGroup=u,e.region=f,e.padding=v,e.appendPadding=p,e.options=w(w({},e.options),d),e.limitInPlot=y,e.id=a,e.syncViewPadding=C,e.themeObject=rt(g)?D({},ro("default"),qn(g)):ro(g),e.init(),e}return r.prototype.setLayout=function(t){this.layoutFunc=t},r.prototype.init=function(){this.calculateViewBBox(),this.initEvents(),this.initComponentController(),this.initOptions()},r.prototype.render=function(t,e){t===void 0&&(t=!1),this.emit(tt.BEFORE_RENDER,At.fromData(this,tt.BEFORE_RENDER,e)),this.paint(t),this.emit(tt.AFTER_RENDER,At.fromData(this,tt.AFTER_RENDER,e)),this.visible===!1&&this.changeVisible(!1)},r.prototype.clear=function(){var t=this;this.emit(tt.BEFORE_CLEAR),this.filteredData=[],this.coordinateInstance=void 0,this.isDataChanged=!1,this.isCoordinateChanged=!1;for(var e=this.geometries,n=0;n');B.appendChild(O);var R=cl(B,l,a,o),H=Bp(f),z=new H.Canvas(w({container:O,pixelRatio:v,localRefresh:g,supportCSSTransform:m},R));return e=i.call(this,{parent:null,canvas:z,backgroundGroup:z.addGroup({zIndex:Br.BG}),middleGroup:z.addGroup({zIndex:Br.MID}),foregroundGroup:z.addGroup({zIndex:Br.FORE}),padding:h,appendPadding:u,visible:y,options:b,limitInPlot:A,theme:L,syncViewPadding:k})||this,e.onResize=Wu(function(){e.forceFit()},300),e.ele=B,e.canvas=z,e.width=R.width,e.height=R.height,e.autoFit=l,e.localRefresh=g,e.renderer=f,e.wrapperElement=O,e.updateCanvasStyle(),e.bindAutoFit(),e.initDefaultInteractions(S),e}return r.prototype.initDefaultInteractions=function(t){var e=this;M(t,function(n){e.interaction(n)})},r.prototype.aria=function(t){var e="aria-label";t===!1?this.ele.removeAttribute(e):this.ele.setAttribute(e,t.label)},r.prototype.changeSize=function(t,e){return this.width===t&&this.height===e?this:(this.emit(tt.BEFORE_CHANGE_SIZE),this.width=t,this.height=e,this.canvas.changeSize(t,e),this.render(!0),this.emit(tt.AFTER_CHANGE_SIZE),this)},r.prototype.clear=function(){i.prototype.clear.call(this),this.aria(!1)},r.prototype.destroy=function(){i.prototype.destroy.call(this),this.unbindAutoFit(),this.canvas.destroy(),Rp(this.wrapperElement),this.wrapperElement=null},r.prototype.changeVisible=function(t){return i.prototype.changeVisible.call(this,t),this.wrapperElement.style.display=t?"":"none",this},r.prototype.forceFit=function(){if(!this.destroyed){var t=cl(this.ele,!0,this.width,this.height),e=t.width,n=t.height;this.changeSize(e,n)}},r.prototype.updateCanvasStyle=function(){bt(this.canvas.get("el"),{display:"inline-block",verticalAlign:"middle"})},r.prototype.bindAutoFit=function(){this.autoFit&&window.addEventListener("resize",this.onResize)},r.prototype.unbindAutoFit=function(){this.autoFit&&window.removeEventListener("resize",this.onResize)},r}(Jf),jr=function(){function i(r){this.visible=!0,this.components=[],this.view=r}return i.prototype.clear=function(r){M(this.components,function(t){t.component.destroy()}),this.components=[]},i.prototype.destroy=function(){this.clear()},i.prototype.getComponents=function(){return this.components},i.prototype.changeVisible=function(r){this.visible!==r&&(this.components.forEach(function(t){r?t.component.show():t.component.hide()}),this.visible=r)},i}();function ww(i){for(var r=[],t=function(n){var a=i[n],o=Ce(r,function(s){return s.color===a.color&&s.name===a.name&&s.value===a.value&&s.title===a.title});o||r.push(a)},e=0;e1){var x=h[0],S=Math.abs(t.y-x[0].y);try{for(var b=$(h),A=b.next();!A.done;A=b.next()){var L=A.value,k=Math.abs(t.y-L[0].y);k<=S&&(x=L,S=k)}}catch(B){s={error:B}}finally{try{A&&!A.done&&(l=b.return)&&l.call(b)}finally{if(s)throw s.error}}h=[x]}return ww($t(h))}return[]},r.prototype.layout=function(){},r.prototype.update=function(){if(this.point&&this.showTooltip(this.point),this.tooltip){var t=this.view.getCanvas();this.tooltip.set("region",{start:{x:0,y:0},end:{x:t.get("width"),y:t.get("height")}})}},r.prototype.isCursorEntered=function(t){if(this.tooltip){var e=this.tooltip.getContainer(),n=this.tooltip.get("capture");if(e&&n){var a=e.getBoundingClientRect(),o=a.x,s=a.y,l=a.width,h=a.height;return new Bt(o,s,l,h).isPointIn(t)}}return!1},r.prototype.getTooltipCfg=function(){var t=this.view,e=t.getOptions().tooltip,n=this.processCustomContent(e),a=t.getTheme(),o=T(a,["components","tooltip"],{}),s=T(n,"enterable",o.enterable);return D({},o,n,{capture:!!(s||this.isLocked)})},r.prototype.processCustomContent=function(t){if(Mi(t)||!T(t,"customContent"))return t;var e=t.customContent,n=function(a,o){var s=e(a,o)||"";return N(s)?'
    '+s+"
    ":s};return w(w({},t),{customContent:n})},r.prototype.getTitle=function(t){var e=t[0].title||t[0].name;return this.title=e,e},r.prototype.renderTooltip=function(){var t=this.view.getCanvas(),e={start:{x:0,y:0},end:{x:t.get("width"),y:t.get("height")}},n=this.getTooltipCfg(),a=new Ea(w(w({parent:t.get("el").parentNode,region:e},n),{visible:!1,crosshairs:null}));a.init(),this.tooltip=a},r.prototype.renderTooltipMarkers=function(t,e){var n,a,o=this.getTooltipMarkersGroup(),s=this.view.getRootView(),l=s.limitInPlot;try{for(var h=$(t),u=h.next();!u.done;u=h.next()){var c=u.value,f=c.x,v=c.y;if(l||(o==null?void 0:o.getClip())){var p=Ls(s.getCoordinate()),g=p.type,d=p.attrs;o==null||o.setClip({type:g,attrs:d})}else o==null||o.setClip(void 0);var y=this.view.getTheme(),C=T(y,["components","tooltip","marker"],{}),m=w(w({fill:c.color,symbol:"circle",shadowColor:c.color},G(e)?w(w({},C),e(c)):e),{x:f,y:v});o.addShape("marker",{attrs:m})}}catch(x){n={error:x}}finally{try{u&&!u.done&&(a=h.return)&&a.call(h)}finally{if(n)throw n.error}}},r.prototype.renderCrosshairs=function(t,e){var n=T(e,["crosshairs","type"],"x");n==="x"?(this.yCrosshair&&this.yCrosshair.hide(),this.renderXCrosshairs(t,e)):n==="y"?(this.xCrosshair&&this.xCrosshair.hide(),this.renderYCrosshairs(t,e)):n==="xy"&&(this.renderXCrosshairs(t,e),this.renderYCrosshairs(t,e))},r.prototype.renderXCrosshairs=function(t,e){var n=this.getViewWithGeometry(this.view).getCoordinate(),a,o;if(n.isRect)n.isTransposed?(a={x:n.start.x,y:t.y},o={x:n.end.x,y:t.y}):(a={x:t.x,y:n.end.y},o={x:t.x,y:n.start.y});else{var s=Yr(n,t),l=n.getCenter(),h=n.getRadius();o=ft(l.x,l.y,h,s),a=l}var u=D({start:a,end:o,container:this.getTooltipCrosshairsGroup()},T(e,"crosshairs",{}),this.getCrosshairsText("x",t,e));delete u.type;var c=this.xCrosshair;c?c.update(u):(c=new Af(u),c.init()),c.render(),c.show(),this.xCrosshair=c},r.prototype.renderYCrosshairs=function(t,e){var n=this.getViewWithGeometry(this.view).getCoordinate(),a,o;if(n.isRect){var s=void 0,l=void 0;n.isTransposed?(s={x:t.x,y:n.end.y},l={x:t.x,y:n.start.y}):(s={x:n.start.x,y:t.y},l={x:n.end.x,y:t.y}),a={start:s,end:l},o="Line"}else a={center:n.getCenter(),radius:Ba(n,t),startAngle:n.startAngle,endAngle:n.endAngle},o="Circle";a=D({container:this.getTooltipCrosshairsGroup()},a,T(e,"crosshairs",{}),this.getCrosshairsText("y",t,e)),delete a.type;var h=this.yCrosshair;h?n.isRect&&h.get("type")==="circle"||!n.isRect&&h.get("type")==="line"?(h=new Th[o](a),h.init()):h.update(a):(h=new Th[o](a),h.init()),h.render(),h.show(),this.yCrosshair=h},r.prototype.getCrosshairsText=function(t,e,n){var a=T(n,["crosshairs","text"]),o=T(n,["crosshairs","follow"]),s=this.items;if(a){var l=this.getViewWithGeometry(this.view),h=s[0],u=l.getXScale(),c=l.getYScales()[0],f=void 0,v=void 0;if(o){var p=this.view.getCoordinate().invert(e);f=u.invert(p.x),v=c.invert(p.y)}else f=h.data[u.field],v=h.data[c.field];var g=t==="x"?f:v;return G(a)?a=a(t,g,s,e):a.content=g,{text:a}}},r.prototype.getGuideGroup=function(){if(!this.guideGroup){var t=this.view.foregroundGroup;this.guideGroup=t.addGroup({name:"tooltipGuide",capture:!1})}return this.guideGroup},r.prototype.getTooltipMarkersGroup=function(){var t=this.tooltipMarkersGroup;return t&&!t.destroyed?(t.clear(),t.show()):(t=this.getGuideGroup().addGroup({name:"tooltipMarkersGroup"}),t.toFront(),this.tooltipMarkersGroup=t),t},r.prototype.getTooltipCrosshairsGroup=function(){var t=this.tooltipCrosshairsGroup;return t||(t=this.getGuideGroup().addGroup({name:"tooltipCrosshairsGroup",capture:!1}),t.toBack(),this.tooltipCrosshairsGroup=t),t},r.prototype.findItemsFromView=function(t,e){var n,a;if(t.getOptions().tooltip===!1)return[];var o=this.getTooltipCfg(),s=Wo(t,e,o);try{for(var l=$(t.views),h=l.next();!h.done;h=l.next()){var u=h.value;s=s.concat(this.findItemsFromView(u,e))}}catch(c){n={error:c}}finally{try{h&&!h.done&&(a=l.return)&&a.call(l)}finally{if(n)throw n.error}}return s},r.prototype.getViewWithGeometry=function(t){var e=this;return t.geometries.length?t:Ce(t.views,function(n){return e.getViewWithGeometry(n)})},r.prototype.getItemsAfterProcess=function(t){var e=this.getTooltipCfg().customItems,n=e||function(a){return a};return n(t)},r}(jr),tv={};function ev(i){return tv[i.toLowerCase()]}function _t(i,r){tv[i.toLowerCase()]=r}var Vr={appear:{duration:450,easing:"easeQuadOut"},update:{duration:400,easing:"easeQuadInOut"},enter:{duration:400,easing:"easeQuadInOut"},leave:{duration:350,easing:"easeQuadIn"}},Mw={interval:function(i){return{enter:{animation:i.isRect?i.isTransposed?"scale-in-x":"scale-in-y":"fade-in"},update:{animation:i.isPolar&&i.isTransposed?"sector-path-update":null},leave:{animation:"fade-out"}}},line:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},path:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},point:{appear:{animation:"zoom-in"},enter:{animation:"zoom-in"},leave:{animation:"zoom-out"}},area:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},polygon:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},schema:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},edge:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},label:{appear:{animation:"fade-in",delay:450},enter:{animation:"fade-in"},update:{animation:"position-update"},leave:{animation:"fade-out"}}},$h={line:function(){return{animation:"wave-in"}},area:function(){return{animation:"wave-in"}},path:function(){return{animation:"fade-in"}},interval:function(i){var r;return i.isRect?r=i.isTransposed?"grow-in-x":"grow-in-y":(r="grow-in-xy",i.isPolar&&i.isTransposed&&(r="wave-in")),{animation:r}},schema:function(i){var r;return i.isRect?r=i.isTransposed?"grow-in-x":"grow-in-y":r="grow-in-xy",{animation:r}},polygon:function(){return{animation:"fade-in",duration:500}},edge:function(){return{animation:"fade-in"}}};function Sw(i,r){return{delay:G(i.delay)?i.delay(r):i.delay,easing:G(i.easing)?i.easing(r):i.easing,duration:G(i.duration)?i.duration(r):i.duration,callback:i.callback,repeat:i.repeat}}function rv(i,r,t){var e=Mw[i];return e&&(G(e)&&(e=e(r)),e=D({},Vr,e),t)?e[t]:e}function Fr(i,r,t){var e=T(i.get("origin"),"data",Z),n=r.animation,a=Sw(r,e);if(n){var o=ev(n);o&&o(i,a,t)}else i.animate(t.toAttrs,a)}function bw(i,r,t,e,n){if($h[t]){var a=$h[t](e),o=ev(T(a,"animation",""));if(o){var s=w(w(w({},Vr.appear),a),r);i.stopAnimate(),o(i,s,{coordinate:e,minYPoint:n,toAttrs:null})}}}var Fs="element-background",iv=function(i){E(r,i);function r(t){var e=i.call(this,t)||this;e.labelShape=[],e.states=[];var n=t.shapeFactory,a=t.container,o=t.offscreenGroup,s=t.elementIndex,l=t.visible,h=l===void 0?!0:l;return e.shapeFactory=n,e.container=a,e.offscreenGroup=o,e.visible=h,e.elementIndex=s,e}return r.prototype.draw=function(t,e){e===void 0&&(e=!1),this.model=t,this.data=t.data,this.shapeType=this.getShapeType(t),this.drawShape(t,e),this.visible===!1&&this.changeVisible(!1)},r.prototype.update=function(t){var e=this,n=e.shapeFactory,a=e.shape;if(!!a){this.model=t,this.data=t.data,this.shapeType=this.getShapeType(t),this.setShapeInfo(a,t);var o=this.getOffscreenGroup(),s=n.drawShape(this.shapeType,t,o);s.cfg.data=this.data,s.cfg.origin=t,s.cfg.element=this,this.syncShapeStyle(a,s,this.getStates(),this.getAnimateCfg("update"))}},r.prototype.destroy=function(){var t=this,e=t.shapeFactory,n=t.shape;if(n){var a=this.getAnimateCfg("leave");a?Fr(n,a,{coordinate:e.coordinate,toAttrs:w({},n.attr())}):n.remove(!0)}this.states=[],this.shapeFactory=void 0,this.container=void 0,this.shape=void 0,this.animate=void 0,this.geometry=void 0,this.labelShape=[],this.model=void 0,this.data=void 0,this.offscreenGroup=void 0,this.statesStyle=void 0,i.prototype.destroy.call(this)},r.prototype.changeVisible=function(t){i.prototype.changeVisible.call(this,t),t?(this.shape&&this.shape.show(),this.labelShape&&this.labelShape.forEach(function(e){e.show()})):(this.shape&&this.shape.hide(),this.labelShape&&this.labelShape.forEach(function(e){e.hide()}))},r.prototype.setState=function(t,e){var n=this,a=n.states,o=n.shapeFactory,s=n.model,l=n.shape,h=n.shapeType,u=a.indexOf(t);if(e){if(u>-1)return;a.push(t),(t==="active"||t==="selected")&&(l==null||l.toFront())}else{if(u===-1)return;if(a.splice(u,1),t==="active"||t==="selected"){var c=this.geometry,f=c.sortZIndex,v=c.zIndexReversed,p=v?this.geometry.elements.length-this.elementIndex:this.elementIndex;f?l.setZIndex(p):l.set("zIndex",p)}}var g=o.drawShape(h,s,this.getOffscreenGroup());a.length?this.syncShapeStyle(l,g,a,null):this.syncShapeStyle(l,g,["reset"],null),g.remove(!0);var d={state:t,stateStatus:e,element:this,target:this.container};this.container.emit("statechange",d),cf(this.shape,"statechange",d)},r.prototype.clearStates=function(){var t=this,e=this.states;M(e,function(n){t.setState(n,!1)}),this.states=[]},r.prototype.hasState=function(t){return this.states.includes(t)},r.prototype.getStates=function(){return this.states},r.prototype.getData=function(){return this.data},r.prototype.getModel=function(){return this.model},r.prototype.getBBox=function(){var t=this,e=t.shape,n=t.labelShape,a={x:0,y:0,minX:0,minY:0,maxX:0,maxY:0,width:0,height:0};return e&&(a=e.getCanvasBBox()),n&&n.forEach(function(o){var s=o.getCanvasBBox();a.x=Math.min(s.x,a.x),a.y=Math.min(s.y,a.y),a.minX=Math.min(s.minX,a.minX),a.minY=Math.min(s.minY,a.minY),a.maxX=Math.max(s.maxX,a.maxX),a.maxY=Math.max(s.maxY,a.maxY)}),a.width=a.maxX-a.minX,a.height=a.maxY-a.minY,a},r.prototype.getStatesStyle=function(){if(!this.statesStyle){var t=this,e=t.shapeType,n=t.geometry,a=t.shapeFactory,o=n.stateOption,s=a.defaultShapeType,l=a.theme[e]||a.theme[s];this.statesStyle=D({},l,o)}return this.statesStyle},r.prototype.getStateStyle=function(t,e){var n=this.getStatesStyle(),a=T(n,[t,"style"],{}),o=a[e]||a;return G(o)?o(this):o},r.prototype.getAnimateCfg=function(t){var e=this,n=this.animate;if(n){var a=n[t];return a&&w(w({},a),{callback:function(){var o;G(a.callback)&&a.callback(),(o=e.geometry)===null||o===void 0||o.emit(Ne.AFTER_DRAW_ANIMATE)}})}return null},r.prototype.drawShape=function(t,e){var n;e===void 0&&(e=!1);var a=this,o=a.shapeFactory,s=a.container,l=a.shapeType;if(this.shape=o.drawShape(l,t,s),this.shape){this.setShapeInfo(this.shape,t);var h=this.shape.cfg.name;h?N(h)&&(this.shape.cfg.name=["element",h]):this.shape.cfg.name=["element",this.shapeFactory.geometryType];var u=e?"enter":"appear",c=this.getAnimateCfg(u);c&&((n=this.geometry)===null||n===void 0||n.emit(Ne.BEFORE_DRAW_ANIMATE),Fr(this.shape,c,{coordinate:o.coordinate,toAttrs:w({},this.shape.attr())}))}},r.prototype.getOffscreenGroup=function(){if(!this.offscreenGroup){var t=this.container.getGroupBase();this.offscreenGroup=new t({})}return this.offscreenGroup},r.prototype.setShapeInfo=function(t,e){var n=this;if(t.cfg.origin=e,t.cfg.element=this,t.isGroup()){var a=t.get("children");a.forEach(function(o){n.setShapeInfo(o,e)})}},r.prototype.syncShapeStyle=function(t,e,n,a,o){var s=this,l;if(n===void 0&&(n=[]),o===void 0&&(o=0),!(!t||!e)){var h=t.get("clipShape"),u=e.get("clipShape");if(this.syncShapeStyle(h,u,n,a),t.isGroup())for(var c=t.get("children"),f=e.get("children"),v=0;v=0?a=e:n<=0?a=n:a=0,a},r.prototype.createAttrOption=function(t,e,n){if(I(e)||rt(e))rt(e)&>(Object.keys(e),["values"])?pt(this.attributeOption,t,{fields:e.values}):pt(this.attributeOption,t,e);else{var a={};U(e)?a.values=[e]:a.fields=ri(e),n&&(G(n)?a.callback=n:a.values=n),pt(this.attributeOption,t,a)}},r.prototype.initAttributes=function(){var t=this,e=this,n=e.attributes,a=e.attributeOption,o=e.theme,s=e.shapeType;this.groupScales=[];var l={},h=function(f){if(a.hasOwnProperty(f)){var v=a[f];if(!v)return{value:void 0};var p=w({},v),g=p.callback,d=p.values,y=p.fields,C=y===void 0?[]:y,m=C.map(function(S){var b=t.scales[S];if(!l[S]&&Ar.includes(f)){var A=Ff(b,T(t.scaleDefs,S),f,t.type);A==="cat"&&(t.groupScales.push(b),l[S]=!0)}return b});p.scales=m,f!=="position"&&m.length===1&&m[0].type==="identity"?p.values=m[0].values:!g&&!d&&(f==="size"?p.values=o.sizes:f==="shape"?p.values=o.shapes[s]||[]:f==="color"&&(m.length?p.values=m[0].values.length<=10?o.colors10:o.colors20:p.values=o.colors10));var x=lf(f);n[f]=new x(p)}};for(var u in a){var c=h(u);if(typeof c=="object")return c.value}},r.prototype.processData=function(t){var e,n;this.hasSorted=!1;for(var a=this.getAttribute("position").scales,o=a.filter(function(A){return A.isCategory}),s=this.groupData(t),l=[],h=0,u=s.length;hs&&(s=c)}var f=this.scaleDefs,v={};ot.max&&!T(f,[a,"max"])&&(v.max=s),t.change(v)},r.prototype.beforeMapping=function(t){var e=t;if(this.sortable&&this.sort(e),this.generatePoints)for(var n=0,a=e.length;n1)for(var f=0;f0})}function cv(i,r,t){var e=t.data,n=t.origin,a=t.animateCfg,o=t.coordinate,s=T(a,"update");i.set("data",e),i.set("origin",n),i.set("animateCfg",a),i.set("coordinate",o),i.set("visible",r.get("visible")),(i.getChildren()||[]).forEach(function(l,h){var u=r.getChildByIndex(h);if(!u)i.removeChild(l),l.remove(!0);else{l.set("data",e),l.set("origin",n),l.set("animateCfg",a),l.set("coordinate",o);var c=Pf(l,u);s?Fr(l,s,{toAttrs:c,coordinate:o}):l.attr(c),u.isGroup()&&cv(l,u,t)}}),M(r.getChildren(),function(l,h){h>=i.getCount()&&(l.destroyed||i.add(l))})}var Fw=function(){function i(r){this.shapesMap={};var t=r.layout,e=r.container;this.layout=t,this.container=e}return i.prototype.render=function(r,t,e){return e===void 0&&(e=!1),xi(this,void 0,void 0,function(){var n,a,o,s,l,h,u,c,f=this;return wi(this,function(v){switch(v.label){case 0:if(n={},a=this.createOffscreenGroup(),!r.length)return[3,2];try{for(o=$(r),s=o.next();!s.done;s=o.next())l=s.value,l&&(n[l.id]=this.renderLabel(l,a))}catch(p){u={error:p}}finally{try{s&&!s.done&&(c=o.return)&&c.call(o)}finally{if(u)throw u.error}}return[4,this.doLayout(r,t,n)];case 1:v.sent(),this.renderLabelLine(r,n),this.renderLabelBackground(r,n),this.adjustLabel(r,n),v.label=2;case 2:return h=this.shapesMap,M(n,function(p,g){if(p.destroyed)delete n[g];else{if(h[g]){var d=p.get("data"),y=p.get("origin"),C=p.get("coordinate"),m=p.get("animateCfg"),x=h[g];cv(x,n[g],{data:d,origin:y,animateCfg:m,coordinate:C}),n[g]=x}else{if(f.container.destroyed)return;f.container.add(p);var S=T(p.get("animateCfg"),e?"enter":"appear");S&&Fr(p,S,{toAttrs:w({},p.attr()),coordinate:p.get("coordinate")})}delete h[g]}}),M(h,function(p){var g=T(p.get("animateCfg"),"leave");g?Fr(p,g,{toAttrs:null,coordinate:p.get("coordinate")}):p.remove(!0)}),this.shapesMap=n,a.destroy(),[2]}})})},i.prototype.clear=function(){this.container.clear(),this.shapesMap={}},i.prototype.destroy=function(){this.container.destroy(),this.shapesMap=null},i.prototype.renderLabel=function(r,t){var e=r.id,n=r.elementId,a=r.data,o=r.mappingData,s=r.coordinate,l=r.animate,h=r.content,u=r.capture,c={id:e,elementId:n,capture:u,data:a,origin:w(w({},o),{data:o[Z]}),coordinate:s},f=t.addGroup(w({name:"label",animateCfg:this.animate===!1||l===null||l===!1?!1:D({},this.animate,l)},c)),v;if(h.isGroup&&h.isGroup()||h.isShape&&h.isShape()){var p=h.getCanvasBBox(),g=p.width,d=p.height,y=T(r,"textAlign","left"),C=r.x,m=r.y-d/2;y==="center"?C=C-g/2:(y==="right"||y==="end")&&(C=C-g),Ia(h,C,m),v=h,f.add(h)}else{var x=T(r,["style","fill"]);v=f.addShape("text",w({attrs:w(w({x:r.x,y:r.y,textAlign:r.textAlign,textBaseline:T(r,"textBaseline","middle"),text:r.content},r.style),{fill:dp(x)?r.color:x})},c))}return r.rotate&&hv(v,r.rotate),f},i.prototype.doLayout=function(r,t,e){return xi(this,void 0,void 0,function(){var n,a=this;return wi(this,function(o){switch(o.label){case 0:return this.layout?(n=P(this.layout)?this.layout:[this.layout],[4,Promise.all(n.map(function(s){var l=Tw(T(s,"type",""));if(!!l){var h=[],u=[];return M(e,function(c,f){h.push(c),u.push(t[c.get("elementId")])}),l(r,h,u,a.region,s.cfg)}}))]):[3,2];case 1:o.sent(),o.label=2;case 2:return[2]}})})},i.prototype.renderLabelLine=function(r,t){M(r,function(e){var n=T(e,"coordinate");if(!(!e||!n)){var a=n.getCenter(),o=n.getRadius();if(!!e.labelLine){var s=T(e,"labelLine",{}),l=e.id,h=s.path;if(!h){var u=ft(a.x,a.y,o,e.angle);h=[["M",u.x,u.y],["L",e.x,e.y]]}var c=t[l];c.destroyed||c.addShape("path",{capture:!1,attrs:w({path:h,stroke:e.color?e.color:T(e,["style","fill"],"#000"),fill:null},s.style),id:l,origin:e.mappingData,data:e.data,coordinate:e.coordinate})}}})},i.prototype.renderLabelBackground=function(r,t){M(r,function(e){var n=T(e,"coordinate"),a=T(e,"background");if(!(!a||!n)){var o=e.id,s=t[o];if(!s.destroyed){var l=s.getChildren()[0];if(l){var h=uv(s,e,a.padding),u=h.rotation,c=mt(h,["rotation"]),f=s.addShape("rect",{attrs:w(w({},c),a.style||{}),id:o,origin:e.mappingData,data:e.data,coordinate:e.coordinate});if(f.setZIndex(-1),u){var v=l.getMatrix();f.setMatrix(v)}}}}})},i.prototype.createOffscreenGroup=function(){var r=this.container,t=r.getGroupBase(),e=new t({});return e},i.prototype.adjustLabel=function(r,t){M(r,function(e){if(e){var n=e.id,a=t[n];if(!a.destroyed){var o=a.findAll(function(s){return s.get("type")!=="path"});M(o,function(s){s&&(e.offsetX&&s.attr("x",s.attr("x")+e.offsetX),e.offsetY&&s.attr("y",s.attr("y")+e.offsetY))})}}})},i}();function jh(i){var r=0;return M(i,function(t){r+=t}),r/i.length}var Ds=function(){function i(r){this.geometry=r}return i.prototype.getLabelItems=function(r){var t=this,e=[],n=this.getLabelCfgs(r);return M(r,function(a,o){var s=n[o];if(!s||I(a.x)||I(a.y)){e.push(null);return}var l=P(s.content)?s.content:[s.content];s.content=l;var h=l.length;M(l,function(u,c){if(I(u)||u===""){e.push(null);return}var f=w(w({},s),t.getLabelPoint(s,a,c));f.textAlign||(f.textAlign=t.getLabelAlign(f,c,h)),f.offset<=0&&(f.labelLine=null),e.push(f)})}),e},i.prototype.render=function(r,t){return t===void 0&&(t=!1),xi(this,void 0,void 0,function(){var e,n,a;return wi(this,function(o){switch(o.label){case 0:return e=this.getLabelItems(r),n=this.getLabelsRenderer(),a=this.getGeometryShapes(),[4,n.render(e,a,t)];case 1:return o.sent(),[2]}})})},i.prototype.clear=function(){var r=this.labelsRenderer;r&&r.clear()},i.prototype.destroy=function(){var r=this.labelsRenderer;r&&r.destroy(),this.labelsRenderer=null},i.prototype.getCoordinate=function(){return this.geometry.coordinate},i.prototype.getDefaultLabelCfg=function(r,t){var e=this.geometry,n=e.type,a=e.theme;return n==="polygon"||n==="interval"&&t==="middle"||r<0&&!["line","point","path"].includes(n)?T(a,"innerLabels",{}):T(a,"labels",{})},i.prototype.getThemedLabelCfg=function(r){var t=this.geometry,e=this.getDefaultLabelCfg(),n=t.type,a=t.theme,o;return n==="polygon"||r.offset<0&&!["line","point","path"].includes(n)?o=D({},e,a.innerLabels,r):o=D({},e,a.labels,r),o},i.prototype.setLabelPosition=function(r,t,e,n){},i.prototype.getLabelOffset=function(r){var t=this.getCoordinate(),e=this.getOffsetVector(r);return t.isTransposed?e[0]:e[1]},i.prototype.getLabelOffsetPoint=function(r,t,e){var n=r.offset,a=this.getCoordinate(),o=a.isTransposed,s=o?"x":"y",l=o?1:-1,h={x:0,y:0};return t>0||e===1?h[s]=n*l:h[s]=n*l*-1,h},i.prototype.getLabelPoint=function(r,t,e){var n=this.getCoordinate(),a=r.content.length;function o(d,y,C){C===void 0&&(C=!1);var m=d;return P(m)&&(r.content.length===1?C?m=jh(m):m.length<=2?m=m[d.length-1]:m=jh(m):m=m[y]),m}var s={content:r.content[e],x:0,y:0,start:{x:0,y:0},color:"#fff"},l=P(t.shape)?t.shape[0]:t.shape,h=l==="funnel"||l==="pyramid";if(this.geometry.type==="polygon"){var u=mx(t.x,t.y);s.x=u[0],s.y=u[1]}else this.geometry.type==="interval"&&!h?(s.x=o(t.x,e,!0),s.y=o(t.y,e)):(s.x=o(t.x,e),s.y=o(t.y,e));if(h){var c=T(t,"nextPoints"),f=T(t,"points");if(c){var v=n.convert(f[1]),p=n.convert(c[1]);s.x=(v.x+p.x)/2,s.y=(v.y+p.y)/2}else if(l==="pyramid"){var v=n.convert(f[1]),p=n.convert(f[2]);s.x=(v.x+p.x)/2,s.y=(v.y+p.y)/2}}r.position&&this.setLabelPosition(s,t,e,r.position);var g=this.getLabelOffsetPoint(r,e,a);return s.start={x:s.x,y:s.y},s.x+=g.x,s.y+=g.y,s.color=t.color,s},i.prototype.getLabelAlign=function(r,t,e){var n="center",a=this.getCoordinate();if(a.isTransposed){var o=r.offset;o<0?n="right":o===0?n="center":n="left",e>1&&t===0&&(n==="right"?n="left":n==="left"&&(n="right"))}return n},i.prototype.getLabelId=function(r){var t=this.geometry,e=t.type,n=t.getXScale(),a=t.getYScale(),o=r[Z],s=t.getElementId(r);return e==="line"||e==="area"?s+=" ".concat(o[n.field]):e==="path"&&(s+=" ".concat(o[n.field],"-").concat(o[a.field])),s},i.prototype.getLabelsRenderer=function(){var r=this.geometry,t=r.labelsContainer,e=r.labelOption,n=r.canvasRegion,a=r.animateOption,o=this.geometry.coordinate,s=this.labelsRenderer;return s||(s=new Fw({container:t,layout:T(e,["cfg","layout"],{type:this.defaultLayout})}),this.labelsRenderer=s),s.region=n,s.animate=a?rv("label",o):!1,s},i.prototype.getLabelCfgs=function(r){var t=this,e=this.geometry,n=e.labelOption,a=e.scales,o=e.coordinate,s=n,l=s.fields,h=s.callback,u=s.cfg,c=l.map(function(v){return a[v]}),f=[];return M(r,function(v,p){var g=v[Z],d=t.getLabelText(g,c),y;if(h){var C=l.map(function(A){return g[A]});if(y=h.apply(void 0,et([],Y(C),!1)),I(y)){f.push(null);return}}var m=w(w({id:t.getLabelId(v),elementId:t.geometry.getElementId(v),data:g,mappingData:v,coordinate:o},u),y);G(m.position)&&(m.position=m.position(g,v,p));var x=t.getLabelOffset(m.offset||0),S=t.getDefaultLabelCfg(x,m.position);m=D({},S,m),m.offset=t.getLabelOffset(m.offset||0);var b=m.content;G(b)?m.content=b(g,v,p):br(b)&&(m.content=d[0]),f.push(m)}),f},i.prototype.getLabelText=function(r,t){var e=[];return M(t,function(n){var a=r[n.field];P(a)?a=a.map(function(o){return n.getText(o)}):a=n.getText(a),I(a)||a===""?e.push(null):e.push(a)}),e},i.prototype.getOffsetVector=function(r){r===void 0&&(r=0);var t=this.getCoordinate(),e=0;return U(r)&&(e=r),t.isTransposed?t.applyMatrix(e,0):t.applyMatrix(0,e)},i.prototype.getGeometryShapes=function(){var r=this.geometry,t={};return M(r.elementsMap,function(e,n){t[n]=e.shape}),M(r.getOffscreenGroup().getChildren(),function(e){var n=r.getElementId(e.get("origin").mappingData);t[n]=e}),t},i}();function Uh(i,r,t){if(!i)return t;var e;if(i.callback&&i.callback.length>1){var n=Array(i.callback.length-1).fill("");e=i.mapping.apply(i,et([r],Y(n),!1)).join("")}else e=i.mapping(r).join("");return e||t}var pr={hexagon:function(i,r,t){var e=t/2*Math.sqrt(3);return[["M",i,r-t],["L",i+e,r-t/2],["L",i+e,r+t/2],["L",i,r+t],["L",i-e,r+t/2],["L",i-e,r-t/2],["Z"]]},bowtie:function(i,r,t){var e=t-1.5;return[["M",i-t,r-e],["L",i+t,r+e],["L",i+t,r-e],["L",i-t,r+e],["Z"]]},cross:function(i,r,t){return[["M",i-t,r-t],["L",i+t,r+t],["M",i+t,r-t],["L",i-t,r+t]]},tick:function(i,r,t){return[["M",i-t/2,r-t],["L",i+t/2,r-t],["M",i,r-t],["L",i,r+t],["M",i-t/2,r+t],["L",i+t/2,r+t]]},plus:function(i,r,t){return[["M",i-t,r],["L",i+t,r],["M",i,r-t],["L",i,r+t]]},hyphen:function(i,r,t){return[["M",i-t,r],["L",i+t,r]]},line:function(i,r,t){return[["M",i,r-t],["L",i,r+t]]}},Ow=["line","cross","tick","plus","hyphen"];function Dw(i,r){return G(r)?r(i):D({},i,r)}function Rw(i,r){var t=i.symbol;if(N(t)&&Ow.indexOf(t)!==-1){var e=T(i,"style",{}),n=T(e,"lineWidth",1),a=e.stroke||e.fill||r;i.style=D({},i.style,{lineWidth:n,stroke:a,fill:null})}}function fv(i){var r=i.symbol;N(r)&&pr[r]&&(i.symbol=pr[r])}function io(i){return i.startsWith(F.LEFT)||i.startsWith(F.RIGHT)?"vertical":"horizontal"}function Yw(i,r,t,e,n){var a=t.getScale(t.type);if(a.isCategory){var o=a.field,s=r.getAttribute("color"),l=r.getAttribute("shape"),h=i.getTheme().defaultColor,u=r.coordinate.isPolar;return a.getTicks().map(function(c,f){var v,p=c.text,g=c.value,d=p,y=a.invert(g),C=i.filterFieldData(o,[(v={},v[o]=y,v)]).length===0;M(i.views,function(A){var L;A.filterFieldData(o,[(L={},L[o]=y,L)]).length||(C=!0)});var m=Uh(s,y,h),x=Uh(l,y,"point"),S=r.getShapeMarker(x,{color:m,isInPolar:u}),b=n;return G(b)&&(b=b(d,f,w({name:d,value:y},D({},e,S)))),S=D({},e,S,Ft(w({},b),["style"])),Rw(S,m),b&&b.style&&(S.style=Dw(S.style,b.style)),fv(S),{id:y,name:d,value:y,marker:S,unchecked:C}})}return[]}function Gw(i,r,t){return t.map(function(e,n){var a=r;G(a)&&(a=a(e.name,n,D({},i,e)));var o=G(e.marker)?e.marker(e.name,n,D({},i,e)):e.marker,s=D({},i,a,o);return fv(s),e.marker=s,e})}function qh(i,r){var t=T(i,["components","legend"],{});return D({},T(t,["common"],{}),D({},T(t,[r],{})))}function no(i){return i?!1:i==null||isNaN(i)}function Zh(i){if(P(i))return no(i[1].y);var r=i.y;return P(r)?no(r[0]):no(r)}function Rs(i,r,t){if(r===void 0&&(r=!1),t===void 0&&(t=!0),!i.length||i.length===1&&!t)return[];if(r){for(var e=[],n=0,a=i.length;n=i&&n<=i+t&&a>=r&&a<=r+e}function Gi(i,r){return!(r.minX>i.maxX||r.maxXi.maxY||r.maxY=0&&n<1/2*Math.PI?(s={x:o.minX,y:o.minY},l={x:o.maxX,y:o.maxY}):1/2*Math.PI<=n&&n1&&(t*=Math.sqrt(v),e*=Math.sqrt(v));var p=t*t*(f*f)+e*e*(c*c),g=p?Math.sqrt((t*t*(e*e)-p)/p):1;a===o&&(g*=-1),isNaN(g)&&(g=0);var d=e?g*t*f/e:0,y=t?g*-e*c/t:0,C=(s+h)/2+Math.cos(n)*d-Math.sin(n)*y,m=(l+u)/2+Math.sin(n)*d+Math.cos(n)*y,x=[(c-d)/t,(f-y)/e],S=[(-1*c-d)/t,(-1*f-y)/e],b=Kh([1,0],x),A=Kh(x,S);return _o(x,S)<=-1&&(A=Math.PI),_o(x,S)>=1&&(A=0),o===0&&A>0&&(A=A-2*Math.PI),o===1&&A<0&&(A=A+2*Math.PI),{cx:C,cy:m,rx:Qh(i,[h,u])?0:t,ry:Qh(i,[h,u])?0:e,startAngle:b,endAngle:b+A,xRotation:n,arcFlag:a,sweepFlag:o}}var Qn=Math.sin,Kn=Math.cos,Gs=Math.atan2,pn=Math.PI;function wv(i,r,t,e,n,a,o){var s=r.stroke,l=r.lineWidth,h=t-n,u=e-a,c=Gs(u,h),f=new zs({type:"path",canvas:i.get("canvas"),isArrowShape:!0,attrs:{path:"M"+10*Kn(pn/6)+","+10*Qn(pn/6)+" L0,0 L"+10*Kn(pn/6)+",-"+10*Qn(pn/6),stroke:s,lineWidth:l}});f.translate(n,a),f.rotateAtPoint(n,a,c),i.set(o?"startArrowShape":"endArrowShape",f)}function Cv(i,r,t,e,n,a,o){var s=r.startArrow,l=r.endArrow,h=r.stroke,u=r.lineWidth,c=o?s:l,f=c.d,v=c.fill,p=c.stroke,g=c.lineWidth,d=mt(c,["d","fill","stroke","lineWidth"]),y=t-n,C=e-a,m=Gs(C,y);f&&(n=n-Kn(m)*f,a=a-Qn(m)*f);var x=new zs({type:"path",canvas:i.get("canvas"),isArrowShape:!0,attrs:w(w({},d),{stroke:p||h,lineWidth:g||u,fill:v})});x.translate(n,a),x.rotateAtPoint(n,a,m),i.set(o?"startArrowShape":"endArrowShape",x)}function cr(i,r,t,e,n){var a=Gs(e-r,t-i);return{dx:Kn(a)*n,dy:Qn(a)*n}}function Hs(i,r,t,e,n,a){typeof r.startArrow=="object"?Cv(i,r,t,e,n,a,!0):r.startArrow?wv(i,r,t,e,n,a,!0):i.set("startArrowShape",null)}function Vs(i,r,t,e,n,a){typeof r.endArrow=="object"?Cv(i,r,t,e,n,a,!1):r.endArrow?wv(i,r,t,e,n,a,!1):i.set("startArrowShape",null)}var Jh={fill:"fillStyle",stroke:"strokeStyle",opacity:"globalAlpha"};function Nr(i,r){var t=r.attr();for(var e in t){var n=t[e],a=Jh[e]?Jh[e]:e;a==="matrix"&&n?i.transform(n[0],n[1],n[3],n[4],n[6],n[7]):a==="lineDash"&&i.setLineDash?P(n)&&i.setLineDash(n):(a==="strokeStyle"||a==="fillStyle"?n=eC(i,r,n):a==="globalAlpha"&&(n=n*i.globalAlpha),i[a]=n)}}function jo(i,r,t){for(var e=0;eS?x:S,O=x>S?1:x/S,R=x>S?S/x:1;r.translate(C,m),r.rotate(L),r.scale(O,R),r.arc(0,0,B,b,A,1-k),r.scale(1/O,1/R),r.rotate(-L),r.translate(-C,-m)}break}case"Z":r.closePath();break}if(f==="Z")s=l;else{var H=c.length;s=[c[H-2],c[H-1]]}}}}function bv(i,r){var t=i.get("canvas");t&&(r==="remove"&&(i._cacheCanvasBBox=i.get("cacheCanvasBBox")),i.get("hasChanged")||(i.set("hasChanged",!0),i.cfg.parent&&i.cfg.parent.get("hasChanged")||(t.refreshElement(i,r,t),t.get("autoDraw")&&t.draw())))}function aC(i){var r;if(i.destroyed)r=i._cacheCanvasBBox;else{var t=i.get("cacheCanvasBBox"),e=t&&!!(t.width&&t.height),n=i.getCanvasBBox(),a=n&&!!(n.width&&n.height);e&&a?r=Uw(t,n):e?r=t:a&&(r=n)}return r}function oC(i){if(!i.length)return null;var r=[],t=[],e=[],n=[];return M(i,function(a){var o=aC(a);o&&(r.push(o.minX),t.push(o.minY),e.push(o.maxX),n.push(o.maxY))}),{minX:Yt(r),minY:Yt(t),maxX:Lt(e),maxY:Lt(n)}}function sC(i,r){return!i||!r||!Gi(i,r)?null:{minX:Math.max(i.minX,r.minX),minY:Math.max(i.minY,r.minY),maxX:Math.min(i.maxX,r.maxX),maxY:Math.min(i.maxY,r.maxY)}}var Xs=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.onCanvasChange=function(t){bv(this,t)},r.prototype.getShapeBase=function(){return Jn},r.prototype.getGroupBase=function(){return r},r.prototype._applyClip=function(t,e){e&&(t.save(),Nr(t,e),e.createPath(t),t.restore(),t.clip(),e._afterDraw())},r.prototype.cacheCanvasBBox=function(){var t=this.cfg.children,e=[],n=[];M(t,function(f){var v=f.cfg.cacheCanvasBBox;v&&f.cfg.isInView&&(e.push(v.minX,v.maxX),n.push(v.minY,v.maxY))});var a=null;if(e.length){var o=Yt(e),s=Lt(e),l=Yt(n),h=Lt(n);a={minX:o,minY:l,x:o,y:l,maxX:s,maxY:h,width:s-o,height:h-l};var u=this.cfg.canvas;if(u){var c=u.getViewRange();this.set("isInView",Gi(a,c))}}else this.set("isInView",!1);this.set("cacheCanvasBBox",a)},r.prototype.draw=function(t,e){var n=this.cfg.children,a=e?this.cfg.refresh:!0;n.length&&a&&(t.save(),Nr(t,this),this._applyClip(t,this.getClip()),jo(t,n,e),t.restore(),this.cacheCanvasBBox()),this.cfg.refresh=null,this.set("hasChanged",!1)},r.prototype.skipDraw=function(){this.set("cacheCanvasBBox",null),this.set("hasChanged",!1)},r}(ha),lC=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return w(w({},t),{lineWidth:1,lineAppendWidth:0,strokeOpacity:1,fillOpacity:1})},r.prototype.getShapeBase=function(){return Jn},r.prototype.getGroupBase=function(){return Xs},r.prototype.onCanvasChange=function(t){bv(this,t)},r.prototype.calculateBBox=function(){var t=this.get("type"),e=this.getHitLineWidth(),n=ca(t),a=n(this),o=e/2,s=a.x-o,l=a.y-o,h=a.x+a.width+o,u=a.y+a.height+o;return{x:s,minX:s,y:l,minY:l,width:a.width+e,height:a.height+e,maxX:h,maxY:u}},r.prototype.isFill=function(){return!!this.attrs.fill||this.isClipShape()},r.prototype.isStroke=function(){return!!this.attrs.stroke},r.prototype._applyClip=function(t,e){e&&(t.save(),Nr(t,e),e.createPath(t),t.restore(),t.clip(),e._afterDraw())},r.prototype.draw=function(t,e){var n=this.cfg.clipShape;if(e){if(this.cfg.refresh===!1){this.set("hasChanged",!1);return}var a=this.getCanvasBBox();if(!Gi(e,a)){this.set("hasChanged",!1),this.cfg.isInView&&this._afterDraw();return}}t.save(),Nr(t,this),this._applyClip(t,n),this.drawPath(t),t.restore(),this._afterDraw()},r.prototype.getCanvasViewBox=function(){var t=this.cfg.canvas;return t?t.getViewRange():null},r.prototype.cacheCanvasBBox=function(){var t=this.getCanvasViewBox();if(t){var e=this.getCanvasBBox(),n=Gi(e,t);this.set("isInView",n),n?this.set("cacheCanvasBBox",e):this.set("cacheCanvasBBox",null)}},r.prototype._afterDraw=function(){this.cacheCanvasBBox(),this.set("hasChanged",!1),this.set("refresh",null)},r.prototype.skipDraw=function(){this.set("cacheCanvasBBox",null),this.set("isInView",null),this.set("hasChanged",!1)},r.prototype.drawPath=function(t){this.createPath(t),this.strokeAndFill(t),this.afterDrawPath(t)},r.prototype.fill=function(t){t.fill()},r.prototype.stroke=function(t){t.stroke()},r.prototype.strokeAndFill=function(t){var e=this.attrs,n=e.lineWidth,a=e.opacity,o=e.strokeOpacity,s=e.fillOpacity;this.isFill()&&(!I(s)&&s!==1?(t.globalAlpha=s,this.fill(t),t.globalAlpha=a):this.fill(t)),this.isStroke()&&n>0&&(!I(o)&&o!==1&&(t.globalAlpha=o),this.stroke(t)),this.afterDrawPath(t)},r.prototype.createPath=function(t){},r.prototype.afterDrawPath=function(t){},r.prototype.isInShape=function(t,e){var n=this.isStroke(),a=this.isFill(),o=this.getHitLineWidth();return this.isInStrokeOrPath(t,e,n,a,o)},r.prototype.isInStrokeOrPath=function(t,e,n,a,o){return!1},r.prototype.getHitLineWidth=function(){if(!this.isStroke())return 0;var t=this.attrs;return t.lineWidth+t.lineAppendWidth},r}(ua);const oe=lC;var hC=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return w(w({},t),{x:0,y:0,r:0})},r.prototype.isInStrokeOrPath=function(t,e,n,a,o){var s=this.attr(),l=s.x,h=s.y,u=s.r,c=o/2,f=yv(l,h,t,e);return a&&n?f<=u+c:a?f<=u:n?f>=u-c&&f<=u+c:!1},r.prototype.createPath=function(t){var e=this.attr(),n=e.x,a=e.y,o=e.r;t.beginPath(),t.arc(n,a,o,0,Math.PI*2,!1),t.closePath()},r}(oe);const uC=hC;function gn(i,r,t,e){return i/(t*t)+r/(e*e)}var cC=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return w(w({},t),{x:0,y:0,rx:0,ry:0})},r.prototype.isInStrokeOrPath=function(t,e,n,a,o){var s=this.attr(),l=o/2,h=s.x,u=s.y,c=s.rx,f=s.ry,v=(t-h)*(t-h),p=(e-u)*(e-u);return a&&n?gn(v,p,c+l,f+l)<=1:a?gn(v,p,c,f)<=1:n?gn(v,p,c-l,f-l)>=1&&gn(v,p,c+l,f+l)<=1:!1},r.prototype.createPath=function(t){var e=this.attr(),n=e.x,a=e.y,o=e.rx,s=e.ry;if(t.beginPath(),t.ellipse)t.ellipse(n,a,o,s,0,0,Math.PI*2,!1);else{var l=o>s?o:s,h=o>s?1:o/s,u=o>s?s/o:1;t.save(),t.translate(n,a),t.scale(h,u),t.arc(0,0,l,0,Math.PI*2),t.restore(),t.closePath()}},r}(oe);const fC=cC;function tu(i){return i instanceof HTMLElement&&N(i.nodeName)&&i.nodeName.toUpperCase()==="CANVAS"}var vC=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return w(w({},t),{x:0,y:0,width:0,height:0})},r.prototype.initAttrs=function(t){this._setImage(t.img)},r.prototype.isStroke=function(){return!1},r.prototype.isOnlyHitBox=function(){return!0},r.prototype._afterLoading=function(){if(this.get("toDraw")===!0){var t=this.get("canvas");t?t.draw():this.createPath(this.get("context"))}},r.prototype._setImage=function(t){var e=this,n=this.attrs;if(N(t)){var a=new Image;a.onload=function(){if(e.destroyed)return!1;e.attr("img",a),e.set("loading",!1),e._afterLoading();var o=e.get("callback");o&&o.call(e)},a.crossOrigin="Anonymous",a.src=t,this.set("loading",!0)}else t instanceof Image?(n.width||(n.width=t.width),n.height||(n.height=t.height)):tu(t)&&(n.width||(n.width=Number(t.getAttribute("width"))),n.height||(n.height,Number(t.getAttribute("height"))))},r.prototype.onAttrChange=function(t,e,n){i.prototype.onAttrChange.call(this,t,e,n),t==="img"&&this._setImage(e)},r.prototype.createPath=function(t){if(this.get("loading")){this.set("toDraw",!0),this.set("context",t);return}var e=this.attr(),n=e.x,a=e.y,o=e.width,s=e.height,l=e.sx,h=e.sy,u=e.swidth,c=e.sheight,f=e.img;(f instanceof Image||tu(f))&&(!I(l)&&!I(h)&&!I(u)&&!I(c)?t.drawImage(f,l,h,u,c,n,a,o,s):t.drawImage(f,n,a,o,s))},r}(oe);const pC=vC;function He(i,r,t,e,n,a,o){var s=Math.min(i,t),l=Math.max(i,t),h=Math.min(r,e),u=Math.max(r,e),c=n/2;return a>=s-c&&a<=l+c&&o>=h-c&&o<=u+c?wt.pointToLine(i,r,t,e,a,o)<=n/2:!1}var gC=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return w(w({},t),{x1:0,y1:0,x2:0,y2:0,startArrow:!1,endArrow:!1})},r.prototype.initAttrs=function(t){this.setArrow()},r.prototype.onAttrChange=function(t,e,n){i.prototype.onAttrChange.call(this,t,e,n),this.setArrow()},r.prototype.setArrow=function(){var t=this.attr(),e=t.x1,n=t.y1,a=t.x2,o=t.y2,s=t.startArrow,l=t.endArrow;s&&Hs(this,t,a,o,e,n),l&&Vs(this,t,e,n,a,o)},r.prototype.isInStrokeOrPath=function(t,e,n,a,o){if(!n||!o)return!1;var s=this.attr(),l=s.x1,h=s.y1,u=s.x2,c=s.y2;return He(l,h,u,c,o,t,e)},r.prototype.createPath=function(t){var e=this.attr(),n=e.x1,a=e.y1,o=e.x2,s=e.y2,l=e.startArrow,h=e.endArrow,u={dx:0,dy:0},c={dx:0,dy:0};l&&l.d&&(u=cr(n,a,o,s,e.startArrow.d)),h&&h.d&&(c=cr(n,a,o,s,e.endArrow.d)),t.beginPath(),t.moveTo(n+u.dx,a+u.dy),t.lineTo(o-c.dx,s-c.dy)},r.prototype.afterDrawPath=function(t){var e=this.get("startArrowShape"),n=this.get("endArrowShape");e&&e.draw(t),n&&n.draw(t)},r.prototype.getTotalLength=function(){var t=this.attr(),e=t.x1,n=t.y1,a=t.x2,o=t.y2;return wt.length(e,n,a,o)},r.prototype.getPoint=function(t){var e=this.attr(),n=e.x1,a=e.y1,o=e.x2,s=e.y2;return wt.pointAt(n,a,o,s,t)},r}(oe);const dC=gC;var yC={circle:function(i,r,t){return[["M",i-t,r],["A",t,t,0,1,0,i+t,r],["A",t,t,0,1,0,i-t,r]]},square:function(i,r,t){return[["M",i-t,r-t],["L",i+t,r-t],["L",i+t,r+t],["L",i-t,r+t],["Z"]]},diamond:function(i,r,t){return[["M",i-t,r],["L",i,r-t],["L",i+t,r],["L",i,r+t],["Z"]]},triangle:function(i,r,t){var e=t*Math.sin(.3333333333333333*Math.PI);return[["M",i-t,r+e],["L",i,r-e],["L",i+t,r+e],["Z"]]},"triangle-down":function(i,r,t){var e=t*Math.sin(.3333333333333333*Math.PI);return[["M",i-t,r-e],["L",i+t,r-e],["L",i,r+e],["Z"]]}},mC=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.initAttrs=function(t){this._resetParamsCache()},r.prototype._resetParamsCache=function(){this.set("paramsCache",{})},r.prototype.onAttrChange=function(t,e,n){i.prototype.onAttrChange.call(this,t,e,n),["symbol","x","y","r","radius"].indexOf(t)!==-1&&this._resetParamsCache()},r.prototype.isOnlyHitBox=function(){return!0},r.prototype._getR=function(t){return I(t.r)?t.radius:t.r},r.prototype._getPath=function(){var t=this.attr(),e=t.x,n=t.y,a=t.symbol||"circle",o=this._getR(t),s,l;if(G(a))s=a,l=s(e,n,o),l=Rc(l);else{if(s=r.Symbols[a],!s)return console.warn(a+" marker is not supported."),null;l=s(e,n,o)}return l},r.prototype.createPath=function(t){var e=this._getPath(),n=this.get("paramsCache");Sv(this,t,{path:e},n)},r.Symbols=yC,r}(oe);const xC=mC;function Av(i,r,t){var e=va();return i.createPath(e),e.isPointInPath(r,t)}var wC=1e-6;function ao(i){return Math.abs(i)0!=ao(s[1]-t)>0&&ao(r-(t-o[1])*(o[0]-s[0])/(o[1]-s[1])-o[0])<0&&(e=!e)}return e}function hi(i,r,t,e,n,a,o,s){var l=(Math.atan2(s-r,o-i)+Math.PI*2)%(Math.PI*2);if(ln)return!1;var h={x:i+t*Math.cos(l),y:r+t*Math.sin(l)};return yv(h.x,h.y,o,s)<=a/2}var MC=ct;function SC(i){for(var r=!1,t=i.length,e=0;em?C:m,k=C>m?1:C/m,B=C>m?m/C:1,O=MC(null,[["t",-d,-y],["r",-b],["s",1/k,1/B]]);bi(A,A,O),a=hi(0,0,L,x,S,r,A[0],A[1]);break}if(a)break}}return a}function AC(i){for(var r=i.length,t=[],e=[],n=[],a=0;a0&&e.push(n),{polygons:t,polylines:e}}const dn=w({hasArc:SC,extractPolygons:AC,isPointInStroke:bC},as);function eu(i,r,t){for(var e=!1,n=0;n=u[0]&&t<=u[1]&&(n=(t-u[0])/(u[1]-u[0]),a=c)});var s=o[a];if(I(s)||I(a))return null;var l=s.length,h=o[a+1];return ci.pointAt(s[l-2],s[l-1],h[1],h[2],h[3],h[4],h[5],h[6],n)},r.prototype._calculateCurve=function(){var t=this.attr().path;this.set("curve",dn.pathToCurve(t))},r.prototype._setTcache=function(){var t=0,e=0,n=[],a,o,s,l,h=this.get("curve");if(!!h){if(M(h,function(u,c){s=h[c+1],l=u.length,s&&(t+=ci.length(u[l-2],u[l-1],s[1],s[2],s[3],s[4],s[5],s[6])||0)}),this.set("totalLength",t),t===0){this.set("tCache",[]);return}M(h,function(u,c){s=h[c+1],l=u.length,s&&(a=[],a[0]=e/t,o=ci.length(u[l-2],u[l-1],s[1],s[2],s[3],s[4],s[5],s[6]),e+=o||0,a[1]=e/t,n.push(a))}),this.set("tCache",n)}},r.prototype.getStartTangent=function(){var t=this.getSegments(),e;if(t.length>1){var n=t[0].currentPoint,a=t[1].currentPoint,o=t[1].startTangent;e=[],o?(e.push([n[0]-o[0],n[1]-o[1]]),e.push([n[0],n[1]])):(e.push([a[0],a[1]]),e.push([n[0],n[1]]))}return e},r.prototype.getEndTangent=function(){var t=this.getSegments(),e=t.length,n;if(e>1){var a=t[e-2].currentPoint,o=t[e-1].currentPoint,s=t[e-1].endTangent;n=[],s?(n.push([o[0]-s[0],o[1]-s[1]]),n.push([o[0],o[1]])):(n.push([a[0],a[1]]),n.push([o[0],o[1]]))}return n},r}(oe);const zs=TC;function Lv(i,r,t,e,n){var a=i.length;if(a<2)return!1;for(var o=0;o=s[0]&&t<=s[1]&&(a=(t-s[0])/(s[1]-s[0]),o=l)}),wt.pointAt(e[o][0],e[o][1],e[o+1][0],e[o+1][1],a)},r.prototype._setTcache=function(){var t=this.attr().points;if(!(!t||t.length===0)){var e=this.getTotalLength();if(!(e<=0)){var n=0,a=[],o,s;M(t,function(l,h){t[h+1]&&(o=[],o[0]=n/e,s=wt.length(l[0],l[1],t[h+1][0],t[h+1][1]),n+=s,o[1]=n/e,a.push(o))}),this.set("tCache",a)}}},r.prototype.getStartTangent=function(){var t=this.attr().points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},r.prototype.getEndTangent=function(){var t=this.attr().points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},r}(oe);const kC=BC;function IC(i,r,t,e,n,a,o){var s=n/2;return nr(i-s,r-s,t,n,a,o)||nr(i+t-s,r-s,n,e,a,o)||nr(i+s,r+e-s,t,n,a,o)||nr(i-s,r+s,n,e,a,o)}function PC(i,r,t,e,n,a,o,s){return He(i+n,r,i+t-n,r,a,o,s)||He(i+t,r+n,i+t,r+e-n,a,o,s)||He(i+t-n,r+e,i+n,r+e,a,o,s)||He(i,r+e-n,i,r+n,a,o,s)||hi(i+t-n,r+n,n,1.5*Math.PI,2*Math.PI,a,o,s)||hi(i+t-n,r+e-n,n,0,.5*Math.PI,a,o,s)||hi(i+n,r+e-n,n,.5*Math.PI,Math.PI,a,o,s)||hi(i+n,r+n,n,Math.PI,1.5*Math.PI,a,o,s)}var FC=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return w(w({},t),{x:0,y:0,width:0,height:0,radius:0})},r.prototype.isInStrokeOrPath=function(t,e,n,a,o){var s=this.attr(),l=s.x,h=s.y,u=s.width,c=s.height,f=s.radius;if(f){var p=!1;return n&&(p=PC(l,h,u,c,f,o,t,e)),!p&&a&&(p=Av(this,t,e)),p}else{var v=o/2;if(a&&n)return nr(l-v,h-v,u+v,c+v,t,e);if(a)return nr(l,h,u,c,t,e);if(n)return IC(l,h,u,c,o,t,e)}},r.prototype.createPath=function(t){var e=this.attr(),n=e.x,a=e.y,o=e.width,s=e.height,l=e.radius;if(t.beginPath(),l===0)t.rect(n,a,o,s);else{var h=rC(l),u=h[0],c=h[1],f=h[2],v=h[3];t.moveTo(n+u,a),t.lineTo(n+o-c,a),c!==0&&t.arc(n+o-c,a+c,c,-Math.PI/2,0),t.lineTo(n+o,a+s-f),f!==0&&t.arc(n+o-f,a+s-f,f,0,Math.PI/2),t.lineTo(n+v,a+s),v!==0&&t.arc(n+v,a+s-v,v,Math.PI/2,Math.PI),t.lineTo(n,a+u),u!==0&&t.arc(n+u,a+u,u,Math.PI,Math.PI*1.5),t.closePath()}},r}(oe);const OC=FC;var DC=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return w(w({},t),{x:0,y:0,text:null,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom"})},r.prototype.isOnlyHitBox=function(){return!0},r.prototype.initAttrs=function(t){this._assembleFont(),t.text&&this._setText(t.text)},r.prototype._assembleFont=function(){var t=this.attrs;t.font=ga(t)},r.prototype._setText=function(t){var e=null;N(t)&&t.indexOf(` `)!==-1&&(e=t.split(` `)),this.set("textArr",e)},r.prototype.onAttrChange=function(t,e,n){i.prototype.onAttrChange.call(this,t,e,n),t.startsWith("font")&&this._assembleFont(),t==="text"&&this._setText(e)},r.prototype._getSpaceingY=function(){var t=this.attrs,e=t.lineHeight,n=t.fontSize*1;return e?e-n:n*.14},r.prototype._drawTextArr=function(t,e,n){var a=this.attrs,o=a.textBaseline,s=a.x,l=a.y,h=a.fontSize*1,u=this._getSpaceingY(),c=pa(a.text,a.fontSize,a.lineHeight),f;M(e,function(v,p){f=l+p*(u+h)-c+h,o==="middle"&&(f+=c-h-(c-h)/2),o==="top"&&(f+=c-h),I(v)||(n?t.fillText(v,s,f):t.strokeText(v,s,f))})},r.prototype._drawText=function(t,e){var n=this.attr(),a=n.x,o=n.y,s=this.get("textArr");if(s)this._drawTextArr(t,s,e);else{var l=n.text;I(l)||(e?t.fillText(l,a,o):t.strokeText(l,a,o))}},r.prototype.strokeAndFill=function(t){var e=this.attrs,n=e.lineWidth,a=e.opacity,o=e.strokeOpacity,s=e.fillOpacity;this.isStroke()&&n>0&&(!I(o)&&o!==1&&(t.globalAlpha=a),this.stroke(t)),this.isFill()&&(!I(s)&&s!==1?(t.globalAlpha=s,this.fill(t),t.globalAlpha=a):this.fill(t)),this.afterDrawPath(t)},r.prototype.fill=function(t){this._drawText(t,!0)},r.prototype.stroke=function(t){this._drawText(t,!1)},r}(oe);const RC=DC;function YC(i,r){if(r){var t=oa(r);return xe(t,i)}return i}function Ev(i,r,t){var e=i.getTotalMatrix();if(e){var n=YC([r,t,1],e),a=n[0],o=n[1];return[a,o]}return[r,t]}function ru(i,r,t){if(i.isCanvas&&i.isCanvas())return!0;if(!Si(i)||i.cfg.isInView===!1)return!1;if(i.cfg.clipShape){var e=Ev(i,r,t),n=e[0],a=e[1];if(i.isClipped(n,a))return!1}var o=i.cfg.cacheCanvasBBox||i.getCanvasBBox();return r>=o.minX&&r<=o.maxX&&t>=o.minY&&t<=o.maxY}function Bv(i,r,t){if(!ru(i,r,t))return null;for(var e=null,n=i.getChildren(),a=n.length,o=a-1;o>=0;o--){var s=n[o];if(s.isGroup())e=Bv(s,r,t);else if(ru(s,r,t)){var l=s,h=Ev(s,r,t),u=h[0],c=h[1];l.isInShape(u,c)&&(e=s)}if(e)break}return e}var GC=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return t.renderer="canvas",t.autoDraw=!0,t.localRefresh=!0,t.refreshElements=[],t.clipView=!0,t.quickHit=!1,t},r.prototype.onCanvasChange=function(t){(t==="attr"||t==="sort"||t==="changeSize")&&(this.set("refreshElements",[this]),this.draw())},r.prototype.getShapeBase=function(){return Jn},r.prototype.getGroupBase=function(){return Xs},r.prototype.getPixelRatio=function(){var t=this.get("pixelRatio")||jw();return t>=1?Math.ceil(t):1},r.prototype.getViewRange=function(){return{minX:0,minY:0,maxX:this.cfg.width,maxY:this.cfg.height}},r.prototype.createDom=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return this.set("context",e),t},r.prototype.setDOMSize=function(t,e){i.prototype.setDOMSize.call(this,t,e);var n=this.get("context"),a=this.get("el"),o=this.getPixelRatio();a.width=o*t,a.height=o*e,o>1&&n.scale(o,o)},r.prototype.clear=function(){i.prototype.clear.call(this),this._clearFrame();var t=this.get("context"),e=this.get("el");t.clearRect(0,0,e.width,e.height)},r.prototype.getShape=function(t,e){var n;return this.get("quickHit")?n=Bv(this,t,e):n=i.prototype.getShape.call(this,t,e,null),n},r.prototype._getRefreshRegion=function(){var t=this.get("refreshElements"),e=this.getViewRange(),n;if(t.length&&t[0]===this)n=e;else if(n=oC(t),n){n.minX=Math.floor(n.minX),n.minY=Math.floor(n.minY),n.maxX=Math.ceil(n.maxX),n.maxY=Math.ceil(n.maxY),n.maxY+=1;var a=this.get("clipView");a&&(n=sC(n,e))}return n},r.prototype.refreshElement=function(t){var e=this.get("refreshElements");e.push(t)},r.prototype._clearFrame=function(){var t=this.get("drawFrame");t&&(wp(t),this.set("drawFrame",null),this.set("refreshElements",[]))},r.prototype.draw=function(){var t=this.get("drawFrame");this.get("autoDraw")&&t||this._startDraw()},r.prototype._drawAll=function(){var t=this.get("context"),e=this.get("el"),n=this.getChildren();t.clearRect(0,0,e.width,e.height),Nr(t,this),jo(t,n),this.set("refreshElements",[])},r.prototype._drawRegion=function(){var t=this.get("context"),e=this.get("refreshElements"),n=this.getChildren(),a=this._getRefreshRegion();a?(t.clearRect(a.minX,a.minY,a.maxX-a.minX,a.maxY-a.minY),t.save(),t.beginPath(),t.rect(a.minX,a.minY,a.maxX-a.minX,a.maxY-a.minY),t.clip(),Nr(t,this),iC(this,n,a),jo(t,n,a),t.restore()):e.length&&Mv(e),M(e,function(o){o.get("hasChanged")&&o.set("hasChanged",!1)}),this.set("refreshElements",[])},r.prototype._startDraw=function(){var t=this,e=this.get("drawFrame");e||(e=xp(function(){t.get("localRefresh")?t._drawRegion():t._drawAll(),t.set("drawFrame",null)}),this.set("drawFrame",e))},r.prototype.skipDraw=function(){},r.prototype.removeDom=function(){var t=this.get("el");t.width=0,t.height=0,t.parentNode.removeChild(t)},r}(la),HC="0.5.12";const VC=Object.freeze(Object.defineProperty({__proto__:null,Shape:Jn,version:HC,Canvas:GC,Group:Xs,getArcParams:Zn,Event:Ni,Base:na,AbstractCanvas:la,AbstractGroup:ha,AbstractShape:ua,getBBoxMethod:ca,registerBBox:Kt,getTextHeight:pa,assembleFont:ga,isAllowCapture:Si,multiplyVec2:xe,invert:oa,getOffScreenContext:va,registerEasing:Ac,PathUtil:as},Symbol.toStringTag,{value:"Module"}));var qo={rect:"path",circle:"circle",line:"line",path:"path",marker:"path",text:"text",polyline:"polyline",polygon:"polygon",image:"image",ellipse:"ellipse",dom:"foreignObject"},W={opacity:"opacity",fillStyle:"fill",fill:"fill",fillOpacity:"fill-opacity",strokeStyle:"stroke",strokeOpacity:"stroke-opacity",stroke:"stroke",x:"x",y:"y",r:"r",rx:"rx",ry:"ry",width:"width",height:"height",x1:"x1",x2:"x2",y1:"y1",y2:"y2",lineCap:"stroke-linecap",lineJoin:"stroke-linejoin",lineWidth:"stroke-width",lineDash:"stroke-dasharray",lineDashOffset:"stroke-dashoffset",miterLimit:"stroke-miterlimit",font:"font",fontSize:"font-size",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",fontFamily:"font-family",startArrow:"marker-start",endArrow:"marker-end",path:"d",class:"class",id:"id",style:"style",preserveAspectRatio:"preserveAspectRatio"};function Zt(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function kv(i){var r=qo[i.type],t=i.getParent();if(!r)throw new Error("the type "+i.type+" is not supported by svg");var e=Zt(r);if(i.get("id")&&(e.id=i.get("id")),i.set("el",e),i.set("attrs",{}),t){var n=t.get("el");n||(n=t.createDom(),t.set("el",n)),n.appendChild(e)}return e}function Iv(i,r){var t=i.get("el"),e=Tp(t.children).sort(r),n=document.createDocumentFragment();e.forEach(function(a){n.appendChild(a)}),t.appendChild(n)}function NC(i,r){var t=i.parentNode,e=Array.from(t.childNodes).filter(function(s){return s.nodeType===1&&s.nodeName.toLowerCase()!=="defs"}),n=e[r],a=e.indexOf(i);if(n){if(a>r)t.insertBefore(i,n);else if(a0&&(e?"stroke"in n?this._setColor(t,"stroke",s):"strokeStyle"in n&&this._setColor(t,"stroke",l):this._setColor(t,"stroke",s||l),u&&f.setAttribute(W.strokeOpacity,u),c&&f.setAttribute(W.lineWidth,c))},r.prototype._setColor=function(t,e,n){var a=this.get("el");if(!n){a.setAttribute(W[e],"none");return}if(n=n.trim(),/^[r,R,L,l]{1}[\s]*\(/.test(n)){var o=t.find("gradient",n);o||(o=t.addGradient(n)),a.setAttribute(W[e],"url(#"+o+")")}else if(/^[p,P]{1}[\s]*\(/.test(n)){var o=t.find("pattern",n);o||(o=t.addPattern(n)),a.setAttribute(W[e],"url(#"+o+")")}else a.setAttribute(W[e],n)},r.prototype.shadow=function(t,e){var n=this.attr(),a=e||n,o=a.shadowOffsetX,s=a.shadowOffsetY,l=a.shadowBlur,h=a.shadowColor;(o||s||l||h)&&XC(this,t)},r.prototype.transform=function(t){var e=this.attr(),n=(t||e).matrix;n&&Ui(this)},r.prototype.isInShape=function(t,e){return this.isPointInPath(t,e)},r.prototype.isPointInPath=function(t,e){var n=this.get("el"),a=this.get("canvas"),o=a.get("el").getBoundingClientRect(),s=t+o.left,l=e+o.top,h=document.elementFromPoint(s,l);return!!(h&&h.isEqualNode(n))},r.prototype.getHitLineWidth=function(){var t=this.attrs,e=t.lineWidth,n=t.lineAppendWidth;return this.isStroke()?e+n:0},r}(ua);const Jt=zC;var WC=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="circle",t.canFill=!0,t.canStroke=!0,t}return r.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return w(w({},t),{x:0,y:0,r:0})},r.prototype.createPath=function(t,e){var n=this.attr(),a=this.get("el");M(e||n,function(o,s){s==="x"||s==="y"?a.setAttribute("c"+s,o):W[s]&&a.setAttribute(W[s],o)})},r}(Jt);const $C=WC;var _C=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="dom",t.canFill=!1,t.canStroke=!1,t}return r.prototype.createPath=function(t,e){var n=this.attr(),a=this.get("el");if(M(e||n,function(h,u){W[u]&&a.setAttribute(W[u],h)}),typeof n.html=="function"){var o=n.html.call(this,n);if(o instanceof Element||o instanceof HTMLDocument){for(var s=a.childNodes,l=s.length-1;l>=0;l--)a.removeChild(s[l]);a.appendChild(o)}else a.innerHTML=o}else a.innerHTML=n.html},r}(Jt);const jC=_C;var UC=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="ellipse",t.canFill=!0,t.canStroke=!0,t}return r.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return w(w({},t),{x:0,y:0,rx:0,ry:0})},r.prototype.createPath=function(t,e){var n=this.attr(),a=this.get("el");M(e||n,function(o,s){s==="x"||s==="y"?a.setAttribute("c"+s,o):W[s]&&a.setAttribute(W[s],o)})},r}(Jt);const qC=UC;var ZC=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="image",t.canFill=!1,t.canStroke=!1,t}return r.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return w(w({},t),{x:0,y:0,width:0,height:0})},r.prototype.createPath=function(t,e){var n=this,a=this.attr(),o=this.get("el");M(e||a,function(s,l){l==="img"?n._setImage(a.img):W[l]&&o.setAttribute(W[l],s)})},r.prototype.setAttr=function(t,e){this.attrs[t]=e,t==="img"&&this._setImage(e)},r.prototype._setImage=function(t){var e=this.attr(),n=this.get("el");if(N(t))n.setAttribute("href",t);else if(t instanceof window.Image)e.width||(n.setAttribute("width",t.width),this.attr("width",t.width)),e.height||(n.setAttribute("height",t.height),this.attr("height",t.height)),n.setAttribute("href",t.src);else if(t instanceof HTMLElement&&N(t.nodeName)&&t.nodeName.toUpperCase()==="CANVAS")n.setAttribute("href",t.toDataURL());else if(t instanceof ImageData){var a=document.createElement("canvas");a.setAttribute("width",""+t.width),a.setAttribute("height",""+t.height),a.getContext("2d").putImageData(t,0,0),e.width||(n.setAttribute("width",""+t.width),this.attr("width",t.width)),e.height||(n.setAttribute("height",""+t.height),this.attr("height",t.height)),n.setAttribute("href",a.toDataURL())}},r}(Jt);const QC=ZC;var KC=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="line",t.canFill=!1,t.canStroke=!0,t}return r.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return w(w({},t),{x1:0,y1:0,x2:0,y2:0,startArrow:!1,endArrow:!1})},r.prototype.createPath=function(t,e){var n=this.attr(),a=this.get("el");M(e||n,function(o,s){if(s==="startArrow"||s==="endArrow")if(o){var l=rt(o)?t.addArrow(n,W[s]):t.getDefaultArrow(n,W[s]);a.setAttribute(W[s],"url(#"+l+")")}else a.removeAttribute(W[s]);else W[s]&&a.setAttribute(W[s],o)})},r.prototype.getTotalLength=function(){var t=this.attr(),e=t.x1,n=t.y1,a=t.x2,o=t.y2;return wt.length(e,n,a,o)},r.prototype.getPoint=function(t){var e=this.attr(),n=e.x1,a=e.y1,o=e.x2,s=e.y2;return wt.pointAt(n,a,o,s,t)},r}(Jt);const JC=KC;var yn={circle:function(i,r,t){return[["M",i,r],["m",-t,0],["a",t,t,0,1,0,t*2,0],["a",t,t,0,1,0,-t*2,0]]},square:function(i,r,t){return[["M",i-t,r-t],["L",i+t,r-t],["L",i+t,r+t],["L",i-t,r+t],["Z"]]},diamond:function(i,r,t){return[["M",i-t,r],["L",i,r-t],["L",i+t,r],["L",i,r+t],["Z"]]},triangle:function(i,r,t){var e=t*Math.sin(.3333333333333333*Math.PI);return[["M",i-t,r+e],["L",i,r-e],["L",i+t,r+e],["z"]]},triangleDown:function(i,r,t){var e=t*Math.sin(.3333333333333333*Math.PI);return[["M",i-t,r-e],["L",i+t,r-e],["L",i,r+e],["Z"]]}};const iu={get:function(i){return yn[i]},register:function(i,r){yn[i]=r},remove:function(i){delete yn[i]},getAll:function(){return yn}};var t1=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="marker",t.canFill=!0,t.canStroke=!0,t}return r.prototype.createPath=function(t){var e=this.get("el");e.setAttribute("d",this._assembleMarker())},r.prototype._assembleMarker=function(){var t=this._getPath();return P(t)?t.map(function(e){return e.join(" ")}).join(""):t},r.prototype._getPath=function(){var t=this.attr(),e=t.x,n=t.y,a=t.r||t.radius,o=t.symbol||"circle",s;return G(o)?s=o:s=iu.get(o),s?s(e,n,a):(console.warn(s+" symbol is not exist."),null)},r.symbolsFactory=iu,r}(Jt);const e1=t1;var r1=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="path",t.canFill=!0,t.canStroke=!0,t}return r.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return w(w({},t),{startArrow:!1,endArrow:!1})},r.prototype.createPath=function(t,e){var n=this,a=this.attr(),o=this.get("el");M(e||a,function(s,l){if(l==="path"&&P(s))o.setAttribute("d",n._formatPath(s));else if(l==="startArrow"||l==="endArrow")if(s){var h=rt(s)?t.addArrow(a,W[l]):t.getDefaultArrow(a,W[l]);o.setAttribute(W[l],"url(#"+h+")")}else o.removeAttribute(W[l]);else W[l]&&o.setAttribute(W[l],s)})},r.prototype._formatPath=function(t){var e=t.map(function(n){return n.join(" ")}).join("");return~e.indexOf("NaN")?"":e},r.prototype.getTotalLength=function(){var t=this.get("el");return t?t.getTotalLength():null},r.prototype.getPoint=function(t){var e=this.get("el"),n=this.getTotalLength();if(n===0)return null;var a=e?e.getPointAtLength(t*n):null;return a?{x:a.x,y:a.y}:null},r}(Jt);const i1=r1;var n1=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="polygon",t.canFill=!0,t.canStroke=!0,t}return r.prototype.createPath=function(t,e){var n=this.attr(),a=this.get("el");M(e||n,function(o,s){s==="points"&&P(o)&&o.length>=2?a.setAttribute("points",o.map(function(l){return l[0]+","+l[1]}).join(" ")):W[s]&&a.setAttribute(W[s],o)})},r}(Jt);const a1=n1;var o1=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="polyline",t.canFill=!0,t.canStroke=!0,t}return r.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return w(w({},t),{startArrow:!1,endArrow:!1})},r.prototype.onAttrChange=function(t,e,n){i.prototype.onAttrChange.call(this,t,e,n),["points"].indexOf(t)!==-1&&this._resetCache()},r.prototype._resetCache=function(){this.set("totalLength",null),this.set("tCache",null)},r.prototype.createPath=function(t,e){var n=this.attr(),a=this.get("el");M(e||n,function(o,s){s==="points"&&P(o)&&o.length>=2?a.setAttribute("points",o.map(function(l){return l[0]+","+l[1]}).join(" ")):W[s]&&a.setAttribute(W[s],o)})},r.prototype.getTotalLength=function(){var t=this.attr().points,e=this.get("totalLength");return I(e)?(this.set("totalLength",Oc.length(t)),this.get("totalLength")):e},r.prototype.getPoint=function(t){var e=this.attr().points,n=this.get("tCache");n||(this._setTcache(),n=this.get("tCache"));var a,o;return M(n,function(s,l){t>=s[0]&&t<=s[1]&&(a=(t-s[0])/(s[1]-s[0]),o=l)}),wt.pointAt(e[o][0],e[o][1],e[o+1][0],e[o+1][1],a)},r.prototype._setTcache=function(){var t=this.attr().points;if(!(!t||t.length===0)){var e=this.getTotalLength();if(!(e<=0)){var n=0,a=[],o,s;M(t,function(l,h){t[h+1]&&(o=[],o[0]=n/e,s=wt.length(l[0],l[1],t[h+1][0],t[h+1][1]),n+=s,o[1]=n/e,a.push(o))}),this.set("tCache",a)}}},r.prototype.getStartTangent=function(){var t=this.attr().points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},r.prototype.getEndTangent=function(){var t=this.attr().points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},r}(Jt);const s1=o1;function l1(i){var r=0,t=0,e=0,n=0;return P(i)?i.length===1?r=t=e=n=i[0]:i.length===2?(r=e=i[0],t=n=i[1]):i.length===3?(r=i[0],t=n=i[1],e=i[2]):(r=i[0],t=i[1],e=i[2],n=i[3]):r=t=e=n=i,{r1:r,r2:t,r3:e,r4:n}}var h1=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="rect",t.canFill=!0,t.canStroke=!0,t}return r.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return w(w({},t),{x:0,y:0,width:0,height:0,radius:0})},r.prototype.createPath=function(t,e){var n=this,a=this.attr(),o=this.get("el"),s=!1,l=["x","y","width","height","radius"];M(e||a,function(h,u){l.indexOf(u)!==-1&&!s?(o.setAttribute("d",n._assembleRect(a)),s=!0):l.indexOf(u)===-1&&W[u]&&o.setAttribute(W[u],h)})},r.prototype._assembleRect=function(t){var e=t.x,n=t.y,a=t.width,o=t.height,s=t.radius;if(!s)return"M "+e+","+n+" l "+a+",0 l 0,"+o+" l"+-a+" 0 z";var l=l1(s);P(s)?s.length===1?l.r1=l.r2=l.r3=l.r4=s[0]:s.length===2?(l.r1=l.r3=s[0],l.r2=l.r4=s[1]):s.length===3?(l.r1=s[0],l.r2=l.r4=s[1],l.r3=s[2]):(l.r1=s[0],l.r2=s[1],l.r3=s[2],l.r4=s[3]):l.r1=l.r2=l.r3=l.r4=s;var h=[["M "+(e+l.r1)+","+n],["l "+(a-l.r1-l.r2)+",0"],["a "+l.r2+","+l.r2+",0,0,1,"+l.r2+","+l.r2],["l 0,"+(o-l.r2-l.r3)],["a "+l.r3+","+l.r3+",0,0,1,"+-l.r3+","+l.r3],["l "+(l.r3+l.r4-a)+",0"],["a "+l.r4+","+l.r4+",0,0,1,"+-l.r4+","+-l.r4],["l 0,"+(l.r4+l.r1-o)],["a "+l.r1+","+l.r1+",0,0,1,"+l.r1+","+-l.r1],["z"]];return h.join(" ")},r}(Jt);const u1=h1;var nu=.3,c1={top:"before-edge",middle:"central",bottom:"after-edge",alphabetic:"baseline",hanging:"hanging"},f1={top:"text-before-edge",middle:"central",bottom:"text-after-edge",alphabetic:"alphabetic",hanging:"hanging"},v1={left:"left",start:"left",center:"middle",right:"end",end:"end"},p1=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="text",t.canFill=!0,t.canStroke=!0,t}return r.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return w(w({},t),{x:0,y:0,text:null,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom"})},r.prototype.createPath=function(t,e){var n=this,a=this.attr(),o=this.get("el");this._setFont(),M(e||a,function(s,l){l==="text"?n._setText(""+s):l==="matrix"&&s?Ui(n):W[l]&&o.setAttribute(W[l],s)}),o.setAttribute("paint-order","stroke"),o.setAttribute("style","stroke-linecap:butt; stroke-linejoin:miter;")},r.prototype._setFont=function(){var t=this.get("el"),e=this.attr(),n=e.textBaseline,a=e.textAlign,o=nc();o&&o.name==="firefox"?t.setAttribute("dominant-baseline",f1[n]||"alphabetic"):t.setAttribute("alignment-baseline",c1[n]||"baseline"),t.setAttribute("text-anchor",v1[a]||"left")},r.prototype._setText=function(t){var e=this.get("el"),n=this.attr(),a=n.x,o=n.textBaseline,s=o===void 0?"bottom":o;if(!t)e.innerHTML="";else if(~t.indexOf(` `)){var l=t.split(` `),h=l.length-1,u="";M(l,function(c,f){f===0?s==="alphabetic"?u+=''+c+"":s==="top"?u+=''+c+"":s==="middle"?u+=''+c+"":s==="bottom"?u+=''+c+"":s==="hanging"&&(u+=''+c+""):u+=''+c+""}),e.innerHTML=u}else e.innerHTML=t},r}(Jt);const g1=p1;var d1=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,y1=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,m1=/[\d.]+:(#[^\s]+|[^)]+\))/gi;function Ov(i){var r=i.match(m1);if(!r)return"";var t="";return r.sort(function(e,n){return e=e.split(":"),n=n.split(":"),Number(e[0])-Number(n[0])}),M(r,function(e){e=e.split(":"),t+=''}),t}function x1(i,r){var t=d1.exec(i),e=Jo(ts(parseFloat(t[1])),Math.PI*2),n=t[2],a,o;e>=0&&e<.5*Math.PI?(a={x:0,y:0},o={x:1,y:1}):.5*Math.PI<=e&&e`;t.innerHTML=e},i}(),au=function(){function i(r,t){this.cfg={};var e=Zt("marker"),n=qe("marker_");e.setAttribute("id",n);var a=Zt("path");a.setAttribute("stroke",r.stroke||"none"),a.setAttribute("fill",r.fill||"none"),e.appendChild(a),e.setAttribute("overflow","visible"),e.setAttribute("orient","auto-start-reverse"),this.el=e,this.child=a,this.id=n;var o=r[t==="marker-start"?"startArrow":"endArrow"];return this.stroke=r.stroke||"#000",o===!0?this._setDefaultPath(t,a):(this.cfg=o,this._setMarker(r.lineWidth,a)),this}return i.prototype.match=function(){return!1},i.prototype._setDefaultPath=function(r,t){var e=this.el;t.setAttribute("d","M0,0 L"+10*Math.cos(Math.PI/6)+",5 L0,10"),e.setAttribute("refX",""+10*Math.cos(Math.PI/6)),e.setAttribute("refY",""+5)},i.prototype._setMarker=function(r,t){var e=this.el,n=this.cfg.path,a=this.cfg.d;P(n)&&(n=n.map(function(o){return o.join(" ")}).join("")),t.setAttribute("d",n),e.appendChild(t),a&&e.setAttribute("refX",""+a/r)},i.prototype.update=function(r){var t=this.child;t.attr?t.attr("fill",r):t.setAttribute("fill",r)},i}(),A1=function(){function i(r){this.type="clip",this.cfg={};var t=Zt("clipPath");this.el=t,this.id=qe("clip_"),t.id=this.id;var e=r.cfg.el;return t.appendChild(e),this.cfg=r,this}return i.prototype.match=function(){return!1},i.prototype.remove=function(){var r=this.el;r.parentNode.removeChild(r)},i}(),T1=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,L1=function(){function i(r){this.cfg={};var t=Zt("pattern");t.setAttribute("patternUnits","userSpaceOnUse");var e=Zt("image");t.appendChild(e);var n=qe("pattern_");t.id=n,this.el=t,this.id=n,this.cfg=r;var a=T1.exec(r),o=a[2];e.setAttribute("href",o);var s=new Image;o.match(/^data:/i)||(s.crossOrigin="Anonymous"),s.src=o;function l(){t.setAttribute("width",""+s.width),t.setAttribute("height",""+s.height)}return s.complete?l():(s.onload=l,s.src=s.src),this}return i.prototype.match=function(r,t){return this.cfg===t},i}(),E1=function(){function i(r){var t=Zt("defs"),e=qe("defs_");t.id=e,r.appendChild(t),this.children=[],this.defaultArrow={},this.el=t,this.canvas=r}return i.prototype.find=function(r,t){for(var e=this.children,n=null,a=0;a0&&(v[0][0]="L")),a=a.concat(v)}),a.push(["Z"])}return a}function Pa(i,r,t,e,n){for(var a=lt(i,r,!r,"lineWidth"),o=i.connectNulls,s=i.isInCircle,l=i.points,h=i.showSinglePoint,u=Rs(l,o,h),c=[],f=0,v=u.length;fo&&(o=l),l=e[0]}));var d=this.scales[p];try{for(var y=$(t),C=y.next();!C.done;C=y.next()){var m=C.value,x=this.getDrawCfg(m),S=x.x,b=x.y,A=d.scale(m[Z][p]);this.drawGrayScaleBlurredCircle(S-h.x,b-u.y,n+a,A,g)}}catch(B){o={error:B}}finally{try{C&&!C.done&&(s=y.return)&&s.call(y)}finally{if(o)throw o.error}}var L=g.getImageData(0,0,c,f);this.clearShadowCanvasCtx(),this.colorize(L),g.putImageData(L,0,0);var k=this.getImageShape();k.attr("x",h.x),k.attr("y",u.y),k.attr("width",c),k.attr("height",f),k.attr("img",g.canvas),k.set("origin",this.getShapeInfo(t))},r.prototype.getDefaultSize=function(){var t=this.getAttribute("position"),e=this.coordinate;return Math.min(e.getWidth()/(t.scales[0].ticks.length*4),e.getHeight()/(t.scales[1].ticks.length*4))},r.prototype.clearShadowCanvasCtx=function(){var t=this.getShadowCanvasCtx();t.clearRect(0,0,t.canvas.width,t.canvas.height)},r.prototype.getShadowCanvasCtx=function(){var t=this.shadowCanvas;return t||(t=document.createElement("canvas"),this.shadowCanvas=t),t.width=this.coordinate.getWidth(),t.height=this.coordinate.getHeight(),t.getContext("2d")},r.prototype.getGrayScaleBlurredCanvas=function(){return this.grayScaleBlurredCanvas||(this.grayScaleBlurredCanvas=document.createElement("canvas")),this.grayScaleBlurredCanvas},r.prototype.drawGrayScaleBlurredCircle=function(t,e,n,a,o){var s=this.getGrayScaleBlurredCanvas();o.globalAlpha=a,o.drawImage(s,t-n,e-n)},r.prototype.colorize=function(t){for(var e=this.getAttribute("color"),n=t.data,a=this.paletteCache,o=3;or&&(t=t?r/(1+e/t):0,e=r-t),n+a>r&&(n=n?r/(1+a/n):0,a=r-n),[t||0,e||0,n||0,a||0]}function Yv(i,r,t){var e=[];if(t.isRect){var n=t.isTransposed?{x:t.start.x,y:r[0].y}:{x:r[0].x,y:t.start.y},a=t.isTransposed?{x:t.end.x,y:r[2].y}:{x:r[3].x,y:t.end.y},o=T(i,["background","style","radius"]);if(o){var s=t.isTransposed?Math.abs(r[0].y-r[2].y):r[2].x-r[1].x,l=t.isTransposed?t.getWidth():t.getHeight(),h=Y(Rv(o,Math.min(s,l)),4),u=h[0],c=h[1],f=h[2],v=h[3],p=t.isTransposed&&t.isReflect("y"),g=p?0:1,d=function(b){return p?-b:b};e.push(["M",n.x,a.y+d(u)]),u!==0&&e.push(["A",u,u,0,0,g,n.x+u,a.y]),e.push(["L",a.x-c,a.y]),c!==0&&e.push(["A",c,c,0,0,g,a.x,a.y+d(c)]),e.push(["L",a.x,n.y-d(f)]),f!==0&&e.push(["A",f,f,0,0,g,a.x-f,n.y]),e.push(["L",n.x+v,n.y]),v!==0&&e.push(["A",v,v,0,0,g,n.x,n.y-d(v)])}else e.push(["M",n.x,n.y]),e.push(["L",a.x,n.y]),e.push(["L",a.x,a.y]),e.push(["L",n.x,a.y]),e.push(["L",n.x,n.y]);e.push(["z"])}if(t.isPolar){var y=t.getCenter(),C=_n(i,t),m=C.startAngle,x=C.endAngle;if(t.type!=="theta"&&!t.isTransposed)e=ur(y.x,y.y,t.getRadius(),m,x);else{var S=function(L){return Math.pow(L,2)},u=Math.sqrt(S(y.x-r[0].x)+S(y.y-r[0].y)),c=Math.sqrt(S(y.x-r[2].x)+S(y.y-r[2].y));e=ur(y.x,y.y,u,t.startAngle,t.endAngle,c)}}return e}function R1(i,r,t){var e=t.getWidth(),n=t.getHeight(),a=t.type==="rect",o=[],s=(i[2].x-i[1].x)/2,l=t.isTransposed?s*n/e:s*e/n;return r==="round"?(a?(o.push(["M",i[0].x,i[0].y+l]),o.push(["L",i[1].x,i[1].y-l]),o.push(["A",s,s,0,0,1,i[2].x,i[2].y-l]),o.push(["L",i[3].x,i[3].y+l]),o.push(["A",s,s,0,0,1,i[0].x,i[0].y+l])):(o.push(["M",i[0].x,i[0].y]),o.push(["L",i[1].x,i[1].y]),o.push(["A",s,s,0,0,1,i[2].x,i[2].y]),o.push(["L",i[3].x,i[3].y]),o.push(["A",s,s,0,0,1,i[0].x,i[0].y])),o.push(["z"])):o=js(i),o}function Gv(i,r,t){var e=[];return I(r)?t?e.push(["M",i[0].x,i[0].y],["L",i[1].x,i[1].y],["L",(i[2].x+i[3].x)/2,(i[2].y+i[3].y)/2],["Z"]):e.push(["M",i[0].x,i[0].y],["L",i[1].x,i[1].y],["L",i[2].x,i[2].y],["L",i[3].x,i[3].y],["Z"]):e.push(["M",i[0].x,i[0].y],["L",i[1].x,i[1].y],["L",r[1].x,r[1].y],["L",r[0].x,r[0].y],["Z"]),e}function ii(i,r){return[r,i]}function Y1(i,r,t){var e,n,a,o,s,l,h,u=Y(et([],Y(i),!1),4),c=u[0],f=u[1],v=u[2],p=u[3],g=Y(typeof t=="number"?Array(4).fill(t):t,4),d=g[0],y=g[1],C=g[2],m=g[3];r.isTransposed&&(e=Y(ii(f,p),2),f=e[0],p=e[1]),r.isReflect("y")&&(n=Y(ii(c,f),2),c=n[0],f=n[1],a=Y(ii(v,p),2),v=a[0],p=a[1]),r.isReflect("x")&&(o=Y(ii(c,p),2),c=o[0],p=o[1],s=Y(ii(f,v),2),f=s[0],v=s[1]);var x=[],S=function(b){return Math.abs(b)};return l=Y(Rv([d,y,C,m],Math.min(S(p.x-c.x),S(f.y-c.y))).map(function(b){return S(b)}),4),d=l[0],y=l[1],C=l[2],m=l[3],r.isTransposed&&(h=Y([m,d,y,C],4),d=h[0],y=h[1],C=h[2],m=h[3]),c.yo&&(n=o)}return n}function H1(i,r){if(r){var t=$t(i),e=Me(t,r);return e.length}return i.length}function Us(i){var r=i.theme,t=i.coordinate,e=i.getXScale(),n=e.values,a=i.beforeMappingData,o=n.length,s=_i(i.coordinate),l=i.intervalPadding,h=i.dodgePadding,u=i.maxColumnWidth||r.maxColumnWidth,c=i.minColumnWidth||r.minColumnWidth,f=i.columnWidthRatio||r.columnWidthRatio,v=i.multiplePieWidthRatio||r.multiplePieWidthRatio,p=i.roseWidthRatio||r.roseWidthRatio;if(e.isLinear&&n.length>1){n.sort();var g=G1(n,e);o=(e.max-e.min)/g,n.length>o&&(o=n.length)}var d=e.range,y=1/o,C=1;if(t.isPolar?t.isTransposed&&o>1?C=v:C=p:(e.isLinear&&(y*=d[1]-d[0]),C=f),!I(l)&&l>=0){var m=l/s;y=(1-(o-1)*m)/o}else y*=C;if(i.getAdjust("dodge")){var x=i.getAdjust("dodge"),S=x.dodgeBy,b=H1(a,S);if(!I(h)&&h>=0){var A=h/s;y=(y-A*(b-1))/b}else!I(l)&&l>=0&&(y*=C),y=y/b;y=y>=0?y:0}if(!I(u)&&u>=0){var L=u/s;y>L&&(y=L)}if(!I(c)&&c>=0){var k=c/s;y0&&!T(e,[n,"min"])&&t.change({min:0}),o<=0&&!T(e,[n,"max"])&&t.change({max:0}))}},r.prototype.getDrawCfg=function(t){var e=i.prototype.getDrawCfg.call(this,t);return e.background=this.background,e},r}(Qe),N1=function(i){E(r,i);function r(t){var e=i.call(this,t)||this;e.type="line";var n=t.sortable,a=n===void 0?!1:n;return e.sortable=a,e}return r}($s),Hv=["circle","square","bowtie","diamond","hexagon","triangle","triangle-down"],X1=["cross","tick","plus","hyphen","line"];function qs(i,r,t,e,n){var a,o,s=lt(r,n,!n,"r"),l=i.parsePoints(r.points),h=l[0];if(r.isStack)h=l[1];else if(l.length>1){var u=t.addGroup();try{for(var c=$(l),f=c.next();!f.done;f=c.next()){var v=f.value;u.addShape({type:"marker",attrs:w(w(w({},s),{symbol:pr[e]||e}),v)})}}catch(p){a={error:p}}finally{try{f&&!f.done&&(o=c.return)&&o.call(c)}finally{if(a)throw a.error}}return u}return t.addShape({type:"marker",attrs:w(w(w({},s),{symbol:pr[e]||e}),h)})}Ze("point",{defaultShapeType:"hollow-circle",getDefaultPoints:function(i){return Ys(i)}});M(Hv,function(i){J("point","hollow-".concat(i),{draw:function(r,t){return qs(this,r,t,i,!0)},getMarker:function(r){var t=r.color;return{symbol:pr[i]||i,style:{r:4.5,stroke:t,fill:null}}}})});var z1=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="point",t.shapeType="point",t.generatePoints=!0,t}return r.prototype.getDrawCfg=function(t){var e=i.prototype.getDrawCfg.call(this,t);return w(w({},e),{isStack:!!this.getAdjust("stack")})},r}(Qe);function W1(i){for(var r=i[0],t=1,e=[["M",r.x,r.y]];t2?"weight":"normal",a;if(i.isInCircle){var o={x:0,y:1};return n==="normal"?a=q1(e[0],e[1],o):(t.fill=t.stroke,a=Z1(e,o)),a=this.parsePath(a),r.addShape("path",{attrs:w(w({},t),{path:a})})}else{if(n==="normal")return e=this.parsePoints(e),a=If((e[1].x+e[0].x)/2,e[0].y,Math.abs(e[1].x-e[0].x)/2,Math.PI,Math.PI*2),r.addShape("path",{attrs:w(w({},t),{path:a})});var s=Zo(e[1],e[3]),l=Zo(e[2],e[0]);return a=[["M",e[0].x,e[0].y],["L",e[1].x,e[1].y],s,["L",e[3].x,e[3].y],["L",e[2].x,e[2].y],l,["Z"]],a=this.parsePath(a),t.fill=t.stroke,r.addShape("path",{attrs:w(w({},t),{path:a})})}},getMarker:function(i){return{symbol:"circle",style:{r:4.5,fill:i.color}}}});function Q1(i,r){var t=Zo(i,r),e=[["M",i.x,i.y]];return e.push(t),e}J("edge","smooth",{draw:function(i,r){var t=lt(i,!0,!1,"lineWidth"),e=i.points,n=this.parsePath(Q1(e[0],e[1]));return r.addShape("path",{attrs:w(w({},t),{path:n})})},getMarker:function(i){return{symbol:"circle",style:{r:4.5,fill:i.color}}}});var mn=1/3;function K1(i,r){var t=[];t.push({x:i.x,y:i.y*(1-mn)+r.y*mn}),t.push({x:r.x,y:i.y*(1-mn)+r.y*mn}),t.push(r);var e=[["M",i.x,i.y]];return M(t,function(n){e.push(["L",n.x,n.y])}),e}J("edge","vhv",{draw:function(i,r){var t=lt(i,!0,!1,"lineWidth"),e=i.points,n=this.parsePath(K1(e[0],e[1]));return r.addShape("path",{attrs:w(w({},t),{path:n})})},getMarker:function(i){return{symbol:"circle",style:{r:4.5,fill:i.color}}}});J("interval","funnel",{getPoints:function(i){return i.size=i.size*2,_s(i)},draw:function(i,r){var t=lt(i,!1,!0),e=this.parsePath(Gv(i.points,i.nextPoints,!1)),n=r.addShape("path",{attrs:w(w({},t),{path:e}),name:"interval"});return n},getMarker:function(i){var r=i.color;return{symbol:"square",style:{r:4,fill:r}}}});J("interval","hollow-rect",{draw:function(i,r){var t=lt(i,!0,!1),e=r,n=i==null?void 0:i.background;if(n){e=r.addGroup();var a=gv(i),o=Yv(i,this.parsePoints(i.points),this.coordinate);e.addShape("path",{attrs:w(w({},a),{path:o}),zIndex:-1,name:Fs})}var s=this.parsePath(js(i.points)),l=e.addShape("path",{attrs:w(w({},t),{path:s}),name:"interval"});return n?e:l},getMarker:function(i){var r=i.color,t=i.isInPolar;return t?{symbol:"circle",style:{r:4.5,stroke:r,fill:null}}:{symbol:"square",style:{r:4,stroke:r,fill:null}}}});function J1(i){var r=i.x,t=i.y,e=i.y0;return P(t)?t.map(function(n,a){return{x:P(r)?r[a]:r,y:n}}):[{x:r,y:e},{x:r,y:t}]}J("interval","line",{getPoints:function(i){return J1(i)},draw:function(i,r){var t=lt(i,!0,!1,"lineWidth"),e=Ft(w({},t),["fill"]),n=this.parsePath(js(i.points,!1)),a=r.addShape("path",{attrs:w(w({},e),{path:n}),name:"interval"});return a},getMarker:function(i){var r=i.color;return{symbol:function(t,e,n){return[["M",t,e-n],["L",t,e+n]]},style:{r:5,stroke:r}}}});J("interval","pyramid",{getPoints:function(i){return i.size=i.size*2,_s(i)},draw:function(i,r){var t=lt(i,!1,!0),e=this.parsePath(Gv(i.points,i.nextPoints,!0)),n=r.addShape("path",{attrs:w(w({},t),{path:e}),name:"interval"});return n},getMarker:function(i){var r=i.color;return{symbol:"square",style:{r:4,fill:r}}}});function tM(i){var r,t=i.x,e=i.y,n=i.y0,a=i.size,o,s;P(e)?(r=Y(e,2),o=r[0],s=r[1]):(o=n,s=e);var l=t+a/2,h=t-a/2;return[{x:t,y:o},{x:t,y:s},{x:h,y:o},{x:l,y:o},{x:h,y:s},{x:l,y:s}]}function eM(i){return[["M",i[0].x,i[0].y],["L",i[1].x,i[1].y],["M",i[2].x,i[2].y],["L",i[3].x,i[3].y],["M",i[4].x,i[4].y],["L",i[5].x,i[5].y]]}J("interval","tick",{getPoints:function(i){return tM(i)},draw:function(i,r){var t=lt(i,!0,!1),e=this.parsePath(eM(i.points)),n=r.addShape("path",{attrs:w(w({},t),{path:e}),name:"interval"});return n},getMarker:function(i){var r=i.color;return{symbol:function(t,e,n){return[["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]]},style:{r:5,stroke:r}}}});var rM=function(i,r,t){var e=i.x,n=i.y,a=r.x,o=r.y,s;switch(t){case"hv":s=[{x:a,y:n}];break;case"vh":s=[{x:e,y:o}];break;case"hvh":var l=(a+e)/2;s=[{x:l,y:n},{x:l,y:o}];break;case"vhv":var h=(n+o)/2;s=[{x:e,y:h},{x:a,y:h}];break}return s};function iM(i,r){var t=[];return M(i,function(e,n){var a=i[n+1];if(t.push(e),a){var o=rM(e,a,r);t=t.concat(o)}}),t}function nM(i){return i.map(function(r,t){return t===0?["M",r.x,r.y]:["L",r.x,r.y]})}function aM(i,r){var t=Rs(i.points,i.connectNulls,i.showSinglePoint),e=[];return M(t,function(n){var a=iM(n,r);e=e.concat(nM(a))}),w(w({},lt(i,!0,!1,"lineWidth")),{path:e})}M(["hv","vh","hvh","vhv"],function(i){J("line",i,{draw:function(r,t){var e=aM(r,i),n=t.addShape({type:"path",attrs:e,name:"line"});return n},getMarker:function(r){return dv(r,i)}})});M(X1,function(i){J("point",i,{draw:function(r,t){return qs(this,r,t,i,!0)},getMarker:function(r){var t=r.color;return{symbol:pr[i],style:{r:4.5,stroke:t,fill:null}}}})});J("point","image",{draw:function(i,r){var t,e,n=lt(i,!1,!1,"r").r,a=this.parsePoints(i.points),o=a[0];if(i.isStack)o=a[1];else if(a.length>1){var s=r.addGroup();try{for(var l=$(a),h=l.next();!h.done;h=l.next()){var u=h.value;s.addShape("image",{attrs:{x:u.x-n/2,y:u.y-n,width:n,height:n,img:i.shape[1]}})}}catch(c){t={error:c}}finally{try{h&&!h.done&&(e=l.return)&&e.call(l)}finally{if(t)throw t.error}}return s}return r.addShape("image",{attrs:{x:o.x-n/2,y:o.y-n,width:n,height:n,img:i.shape[1]}})},getMarker:function(i){var r=i.color;return{symbol:"circle",style:{r:4.5,fill:r}}}});M(Hv,function(i){J("point",i,{draw:function(r,t){return qs(this,r,t,i,!1)},getMarker:function(r){var t=r.color;return{symbol:pr[i]||i,style:{r:4.5,fill:t}}}})});function ou(i){var r=P(i)?i:[i],t=r[0],e=r[r.length-1],n=r.length>1?r[1]:t,a=r.length>3?r[3]:e,o=r.length>2?r[2]:n;return{min:t,max:e,min1:n,max1:a,median:o}}function su(i,r,t){var e=t/2,n;if(P(r)){var a=ou(r),o=a.min,s=a.max,l=a.median,h=a.min1,u=a.max1,c=i-e,f=i+e;n=[[c,s],[f,s],[i,s],[i,u],[c,h],[c,u],[f,u],[f,h],[i,h],[i,o],[c,o],[f,o],[c,l],[f,l]]}else{r=I(r)?.5:r;var v=ou(i),o=v.min,s=v.max,l=v.median,h=v.min1,u=v.max1,p=r-e,g=r+e;n=[[o,p],[o,g],[o,r],[h,r],[h,p],[h,g],[u,g],[u,p],[u,r],[s,r],[s,p],[s,g],[l,p],[l,g]]}return n.map(function(d){return{x:d[0],y:d[1]}})}function oM(i){return[["M",i[0].x,i[0].y],["L",i[1].x,i[1].y],["M",i[2].x,i[2].y],["L",i[3].x,i[3].y],["M",i[4].x,i[4].y],["L",i[5].x,i[5].y],["L",i[6].x,i[6].y],["L",i[7].x,i[7].y],["L",i[4].x,i[4].y],["Z"],["M",i[8].x,i[8].y],["L",i[9].x,i[9].y],["M",i[10].x,i[10].y],["L",i[11].x,i[11].y],["M",i[12].x,i[12].y],["L",i[13].x,i[13].y]]}J("schema","box",{getPoints:function(i){var r=i.x,t=i.y,e=i.size;return su(r,t,e)},draw:function(i,r){var t=lt(i,!0,!1),e=this.parsePath(oM(i.points)),n=r.addShape("path",{attrs:w(w({},t),{path:e,name:"schema"})});return n},getMarker:function(i){var r=i.color;return{symbol:function(t,e,n){var a=[e-6,e-3,e,e+3,e+6],o=su(t,a,n);return[["M",o[0].x+1,o[0].y],["L",o[1].x-1,o[1].y],["M",o[2].x,o[2].y],["L",o[3].x,o[3].y],["M",o[4].x,o[4].y],["L",o[5].x,o[5].y],["L",o[6].x,o[6].y],["L",o[7].x,o[7].y],["L",o[4].x,o[4].y],["Z"],["M",o[8].x,o[8].y],["L",o[9].x,o[9].y],["M",o[10].x+1,o[10].y],["L",o[11].x-1,o[11].y],["M",o[12].x,o[12].y],["L",o[13].x,o[13].y]]},style:{r:6,lineWidth:1,stroke:r}}}});function sM(i){var r=P(i)?i:[i],t=r.sort(function(e,n){return n-e});return xx(t,4,t[t.length-1])}function lu(i,r,t){var e=sM(r);return[{x:i,y:e[0]},{x:i,y:e[1]},{x:i-t/2,y:e[2]},{x:i-t/2,y:e[1]},{x:i+t/2,y:e[1]},{x:i+t/2,y:e[2]},{x:i,y:e[2]},{x:i,y:e[3]}]}function lM(i){return[["M",i[0].x,i[0].y],["L",i[1].x,i[1].y],["M",i[2].x,i[2].y],["L",i[3].x,i[3].y],["L",i[4].x,i[4].y],["L",i[5].x,i[5].y],["Z"],["M",i[6].x,i[6].y],["L",i[7].x,i[7].y]]}J("schema","candle",{getPoints:function(i){var r=i.x,t=i.y,e=i.size;return lu(r,t,e)},draw:function(i,r){var t=lt(i,!0,!0),e=this.parsePath(lM(i.points)),n=r.addShape("path",{attrs:w(w({},t),{path:e,name:"schema"})});return n},getMarker:function(i){var r=i.color;return{symbol:function(t,e,n){var a=[e+7.5,e+3,e-3,e-7.5],o=lu(t,a,n);return[["M",o[0].x,o[0].y],["L",o[1].x,o[1].y],["M",o[2].x,o[2].y],["L",o[3].x,o[3].y],["L",o[4].x,o[4].y],["L",o[5].x,o[5].y],["Z"],["M",o[6].x,o[6].y],["L",o[7].x,o[7].y]]},style:{lineWidth:1,stroke:r,fill:r,r:6}}}});function hM(i,r){var t=Math.abs(i[0].x-i[2].x),e=Math.abs(i[0].y-i[2].y),n=Math.min(t,e);r&&(n=at(r,0,Math.min(t,e))),n=n/2;var a=(i[0].x+i[2].x)/2,o=(i[0].y+i[2].y)/2;return{x:a-n,y:o-n,width:n*2,height:n*2}}J("polygon","square",{draw:function(i,r){if(!pe(i.points)){var t=lt(i,!0,!0),e=this.parsePoints(i.points);return r.addShape("rect",{attrs:w(w({},t),hM(e,i.size)),name:"polygon"})}},getMarker:function(i){var r=i.color;return{symbol:"square",style:{r:4,fill:r}}}});J("violin","smooth",{draw:function(i,r){var t=lt(i,!0,!0),e=this.parsePath(pv(i.points));return r.addShape("path",{attrs:w(w({},t),{path:e})})},getMarker:function(i){var r=i.color;return{symbol:"circle",style:{stroke:null,r:4,fill:r}}}});J("violin","hollow",{draw:function(i,r){var t=lt(i,!0,!1),e=this.parsePath(vv(i.points));return r.addShape("path",{attrs:w(w({},t),{path:e})})},getMarker:function(i){var r=i.color;return{symbol:"circle",style:{r:4,fill:null,stroke:r}}}});J("violin","hollow-smooth",{draw:function(i,r){var t=lt(i,!0,!1),e=this.parsePath(pv(i.points));return r.addShape("path",{attrs:w(w({},t),{path:e})})},getMarker:function(i){var r=i.color;return{symbol:"circle",style:{r:4,fill:null,stroke:r}}}});var uM=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getLabelValueDir=function(t){var e="y",n=t.points;return n[0][e]<=n[2][e]?1:-1},r.prototype.getLabelOffsetPoint=function(t,e,n,a){var o,s=i.prototype.getLabelOffsetPoint.call(this,t,e,n),l=this.getCoordinate(),h=l.isTransposed,u=h?"x":"y",c=this.getLabelValueDir(t.mappingData);return s=w(w({},s),(o={},o[u]=s[u]*c,o)),l.isReflect("x")&&(s=w(w({},s),{x:s.x*-1})),l.isReflect("y")&&(s=w(w({},s),{y:s.y*-1})),s},r.prototype.getThemedLabelCfg=function(t){var e=this.geometry,n=this.getDefaultLabelCfg(),a=e.theme;return D({},n,a.labels,t.position==="middle"?{offset:0}:{},t)},r.prototype.setLabelPosition=function(t,e,n,a){var o=this.getCoordinate(),s=o.isTransposed,l=e.points,h=o.convert(l[0]),u=o.convert(l[2]),c=this.getLabelValueDir(e),f,v,p,g,d=P(e.shape)?e.shape[0]:e.shape;if(d==="funnel"||d==="pyramid"){var y=T(e,"nextPoints"),C=T(e,"points");if(y){var m=o.convert(C[0]),x=o.convert(C[1]),S=o.convert(y[0]),b=o.convert(y[1]);s?(f=Math.min(S.y,m.y),p=Math.max(S.y,m.y),v=(x.x+b.x)/2,g=(m.x+S.x)/2):(f=Math.min((x.y+b.y)/2,(m.y+S.y)/2),p=Math.max((x.y+b.y)/2,(m.y+S.y)/2),v=b.x,g=m.x)}else f=Math.min(u.y,h.y),p=Math.max(u.y,h.y),v=u.x,g=h.x}else f=Math.min(u.y,h.y),p=Math.max(u.y,h.y),v=u.x,g=h.x;switch(a){case"right":t.x=v,t.y=(f+p)/2,t.textAlign=T(t,"textAlign",c>0?"left":"right");break;case"left":t.x=g,t.y=(f+p)/2,t.textAlign=T(t,"textAlign",c>0?"left":"right");break;case"bottom":s&&(t.x=(v+g)/2),t.y=p,t.textAlign=T(t,"textAlign","center"),t.textBaseline=T(t,"textBaseline",c>0?"bottom":"top");break;case"middle":s&&(t.x=(v+g)/2),t.y=(f+p)/2,t.textAlign=T(t,"textAlign","center"),t.textBaseline=T(t,"textBaseline","middle");break;case"top":s&&(t.x=(v+g)/2),t.y=f,t.textAlign=T(t,"textAlign","center"),t.textBaseline=T(t,"textBaseline",c>0?"bottom":"top");break}},r}(Ds),xn=Math.PI/2,Vv=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getLabelOffset=function(t){var e=this.getCoordinate(),n=0;if(U(t))n=t;else if(N(t)&&t.indexOf("%")!==-1){var a=e.getRadius();e.innerRadius>0&&(a=a*(1-e.innerRadius)),n=parseFloat(t)*.01*a}return n},r.prototype.getLabelItems=function(t){var e=i.prototype.getLabelItems.call(this,t),n=this.geometry.getYScale();return Et(e,function(a){if(a&&n){var o=n.scale(T(a.data,n.field));return w(w({},a),{percent:o})}return a})},r.prototype.getLabelAlign=function(t){var e=this.getCoordinate(),n;if(t.labelEmit)n=t.angle<=Math.PI/2&&t.angle>=-Math.PI/2?"left":"right";else if(!e.isTransposed)n="center";else{var a=e.getCenter(),o=t.offset;Math.abs(t.x-a.x)<1?n="center":t.angle>Math.PI||t.angle<=0?n=o>0?"left":"right":n=o>0?"right":"left"}return n},r.prototype.getLabelPoint=function(t,e,n){var a=1,o,s=t.content[n];this.isToMiddle(e)?o=this.getMiddlePoint(e.points):(t.content.length===1&&n===0?n=1:n===0&&(a=-1),o=this.getArcPoint(e,n));var l=t.offset*a,h=this.getPointAngle(o),u=t.labelEmit,c=this.getCirclePoint(h,l,o,u);return c.r===0?c.content="":(c.content=s,c.angle=h,c.color=e.color),c.rotate=t.autoRotate?this.getLabelRotate(h,l,u):t.rotate,c.start={x:o.x,y:o.y},c},r.prototype.getArcPoint=function(t,e){return e===void 0&&(e=0),!P(t.x)&&!P(t.y)?{x:t.x,y:t.y}:{x:P(t.x)?t.x[e]:t.x,y:P(t.y)?t.y[e]:t.y}},r.prototype.getPointAngle=function(t){return Yr(this.getCoordinate(),t)},r.prototype.getCirclePoint=function(t,e,n,a){var o=this.getCoordinate(),s=o.getCenter(),l=Ba(o,n);if(l===0)return w(w({},s),{r:l});var h=t;if(o.isTransposed&&l>e&&!a){var u=Math.asin(e/(2*l));h=t+u*2}else l=l+e;return{x:s.x+l*Math.cos(h),y:s.y+l*Math.sin(h),r:l}},r.prototype.getLabelRotate=function(t,e,n){var a=t+xn;return n&&(a-=xn),a&&(a>xn?a=a-Math.PI:a<-xn&&(a=a+Math.PI)),a},r.prototype.getMiddlePoint=function(t){var e=this.getCoordinate(),n=t.length,a={x:0,y:0};return M(t,function(o){a.x+=o.x,a.y+=o.y}),a.x/=n,a.y/=n,a=e.convert(a),a},r.prototype.isToMiddle=function(t){return t.x.length>2},r}(Ds),cM=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.defaultLayout="distribute",t}return r.prototype.getDefaultLabelCfg=function(t,e){var n=i.prototype.getDefaultLabelCfg.call(this,t,e);return D({},n,T(this.geometry.theme,"pieLabels",{}))},r.prototype.getLabelOffset=function(t){return i.prototype.getLabelOffset.call(this,t)||0},r.prototype.getLabelRotate=function(t,e,n){var a;return e<0&&(a=t,a>Math.PI/2&&(a=a-Math.PI),a<-Math.PI/2&&(a=a+Math.PI)),a},r.prototype.getLabelAlign=function(t){var e=this.getCoordinate(),n=e.getCenter(),a;return t.angle<=Math.PI/2&&t.x>=n.x?a="left":a="right",t.offset<=0&&(a==="right"?a="left":a="right"),a},r.prototype.getArcPoint=function(t){return t},r.prototype.getPointAngle=function(t){var e=this.getCoordinate(),n={x:P(t.x)?t.x[0]:t.x,y:t.y[0]},a={x:P(t.x)?t.x[1]:t.x,y:t.y[1]},o,s=Yr(e,n);if(t.points&&t.points[0].y===t.points[1].y)o=s;else{var l=Yr(e,a);s>=l&&(l=l+Math.PI*2),o=s+(l-s)/2}return o},r.prototype.getCirclePoint=function(t,e){var n=this.getCoordinate(),a=n.getCenter(),o=n.getRadius()+e;return w(w({},ft(a.x,a.y,o,t)),{angle:t,r:o})},r}(Vv),hu=4;function fM(i,r,t,e,n,a){var o,s,l=!0,h=e.start,u=e.end,c=Math.min(h.y,u.y),f=Math.abs(h.y-u.y),v,p=0,g=Number.MIN_VALUE,d=r.map(function(A){return A.y>p&&(p=A.y),A.yf&&(f=p-c);l;)for(d.forEach(function(A){var L=(Math.min.apply(g,A.targets)+Math.max.apply(g,A.targets))/2;A.pos=Math.min(Math.max(g,L-A.size/2),f-A.size)}),l=!1,v=d.length;v--;)if(v>0){var y=d[v-1],C=d[v];y.pos+y.size>C.pos&&(y.size+=C.size,y.targets=y.targets.concat(C.targets),y.pos+y.size>f&&(y.pos=f-y.size),d.splice(v,1),l=!0)}v=0,d.forEach(function(A){var L=c+t/2;A.targets.forEach(function(){r[v].y=A.pos+L,L+=t,v++})});var m={};try{for(var x=$(i),S=x.next();!S.done;S=x.next()){var b=S.value;m[b.get("id")]=b}}catch(A){o={error:A}}finally{try{S&&!S.done&&(s=x.return)&&s.call(x)}finally{if(o)throw o.error}}r.forEach(function(A){var L=A.r*A.r,k=Math.pow(Math.abs(A.y-n.y),2);if(L0){var l=14,h=o+n,u=h*2+l*2,c={start:a.start,end:a.end},f=[[],[]];i.forEach(function(v){!v||(v.textAlign==="right"?f[0].push(v):f[1].push(v))}),f.forEach(function(v,p){var g=u/l;v.length>g&&(v.sort(function(d,y){return y["..percent"]-d["..percent"]}),v.splice(g,v.length-g)),v.sort(function(d,y){return d.y-y.y}),fM(r,v,l,c,s,p)})}M(i,function(v){if(v&&v.labelLine){var p=v.offset,g=v.angle,d=ft(s.x,s.y,o,g),y=ft(s.x,s.y,o+p/2,g),C=v.x+T(v,"offsetX",0),m=v.y+T(v,"offsetY",0),x={x:C-Math.cos(g)*hu,y:m-Math.sin(g)*hu};rt(v.labelLine)||(v.labelLine={}),v.labelLine.path=["M ".concat(d.x),"".concat(d.y," Q").concat(y.x),"".concat(y.y," ").concat(x.x),x.y].join(",")}})}}function Nv(i,r,t){var e=i.filter(function(p){return!p.invisible});e.sort(function(p,g){return p.y-g.y});var n=!0,a=t.minY,o=t.maxY,s=Math.abs(a-o),l,h=0,u=Number.MIN_VALUE,c=e.map(function(p){return p.y>h&&(h=p.y),p.ys&&(s=h-a);n;)for(c.forEach(function(p){var g=(Math.min.apply(u,p.targets)+Math.max.apply(u,p.targets))/2;p.pos=Math.min(Math.max(u,g-p.size/2),s-p.size),p.pos=Math.max(0,p.pos)}),n=!1,l=c.length;l--;)if(l>0){var f=c[l-1],v=c[l];f.pos+f.size>v.pos&&(f.size+=v.size,f.targets=f.targets.concat(v.targets),f.pos+f.size>s&&(f.pos=s-f.size),c.splice(l,1),n=!0)}l=0,c.forEach(function(p){var g=a+r/2;p.targets.forEach(function(){e[l].y=p.pos+g,g+=r,l++})})}var uu=4;function pM(i,r){var t=r.getCenter(),e=r.getRadius();if(i&&i.labelLine){var n=i.angle,a=i.offset,o=ft(t.x,t.y,e,n),s=i.x+T(i,"offsetX",0)*(Math.cos(n)>0?1:-1),l=i.y+T(i,"offsetY",0)*(Math.sin(n)>0?1:-1),h={x:s-Math.cos(n)*uu,y:l-Math.sin(n)*uu},u=i.labelLine.smooth,c=[],f=h.x-t.x,v=h.y-t.y,p=Math.atan(v/f);if(f<0&&(p+=Math.PI),u===!1){rt(i.labelLine)||(i.labelLine={});var g=0;(n<0&&n>-Math.PI/2||n>Math.PI*1.5)&&h.y>o.y&&(g=1),n>=0&&no.y&&(g=1),n>=Math.PI/2&&nh.y&&(g=1),(n<-Math.PI/2||n>=Math.PI&&nh.y&&(g=1);var d=a/2>4?4:Math.max(a/2-1,0),y=ft(t.x,t.y,e+d,n),C=ft(t.x,t.y,e+a/2,p),m=0;c.push("M ".concat(o.x," ").concat(o.y)),c.push("L ".concat(y.x," ").concat(y.y)),c.push("A ".concat(t.x," ").concat(t.y," 0 ").concat(m," ").concat(g," ").concat(C.x," ").concat(C.y)),c.push("L ".concat(h.x," ").concat(h.y))}else{var y=ft(t.x,t.y,e+(a/2>4?4:Math.max(a/2-1,0)),n),x=o.xMath.pow(Math.E,-16)&&c.push.apply(c,["C",h.x+x*4,h.y,2*y.x-o.x,2*y.y-o.y,o.x,o.y]),c.push("L ".concat(o.x," ").concat(o.y))}i.labelLine.path=c.join(" ")}}function gM(i,r,t,e){var n,a,o=Qt(i,function(L){return!I(L)}),s=r[0]&&r[0].get("coordinate");if(!!s){var l=s.getCenter(),h=s.getRadius(),u={};try{for(var c=$(r),f=c.next();!f.done;f=c.next()){var v=f.value;u[v.get("id")]=v}}catch(L){n={error:L}}finally{try{f&&!f.done&&(a=c.return)&&a.call(c)}finally{if(n)throw n.error}}var p=T(o[0],"labelHeight",14),g=T(o[0],"offset",0);if(!(g<=0)){var d="left",y="right",C=Ue(o,function(L){return L.xB&&(L.sort(function(O,R){return R.percent-O.percent}),M(L,function(O,R){R+1>B&&(u[O.id].set("visible",!1),O.invisible=!0)})),Nv(L,p,A)}),M(C,function(L,k){M(L,function(B){var O=k===y,R=u[B.id],H=R.getChildByIndex(0);if(H){var z=h+g,_=B.y-l.y,K=Math.pow(z,2),nt=Math.pow(_,2),ht=K-nt>0?K-nt:0,Q=Math.sqrt(ht),ut=Math.abs(Math.cos(B.angle)*z);O?B.x=l.x+Math.max(Q,ut):B.x=l.x-Math.max(Q,ut)}H&&(H.attr("y",B.y),H.attr("x",B.x)),pM(B,s)})})}}}var Ko=4,dM=4,cu=4;function yM(i,r,t){var e=r.getCenter(),n=r.getRadius(),a={x:i.x-(t?cu:-cu),y:i.y},o=ft(e.x,e.y,n+Ko,i.angle),s={x:a.x,y:a.y},l={x:o.x,y:o.y},h=ft(e.x,e.y,n,i.angle),u="";if(a.y!==o.y){var c=t?4:-4;s.y=a.y,i.angle<0&&i.angle>=-Math.PI/2&&(s.x=Math.max(o.x,a.x-c),a.y0&&i.angleo.y?l.y=s.y:(l.y=o.y,l.x=Math.max(l.x,s.x-c))),i.angle>Math.PI/2&&(s.x=Math.min(o.x,a.x-c),a.y>o.y?l.y=s.y:(l.y=o.y,l.x=Math.min(l.x,s.x-c))),i.angle<-Math.PI/2&&(s.x=Math.min(o.x,a.x-c),a.ys.x||L.x===s.x&&L.y>s.y,O=I(L.offsetX)?dM:L.offsetX,R=ft(s.x,s.y,l+Ko,L.angle),H=p+O;L.x=s.x+(B?1:-1)*(l+H),L.y=R.y}}});var g=o.start,d=o.end,y="left",C="right",m=Ue(i,function(L){return L.xx&&(x=Math.min(k,Math.abs(g.y-d.y)))});var S={minX:g.x,maxX:d.x,minY:s.y-x/2,maxY:s.y+x/2};M(m,function(L,k){var B=x/v;L.length>B&&(L.sort(function(O,R){return R.percent-O.percent}),M(L,function(O,R){R>B&&(h[O.id].set("visible",!1),O.invisible=!0)})),Nv(L,v,S)});var b=S.minY,A=S.maxY;M(m,function(L,k){var B=k===C;M(L,function(O){var R=T(h,O&&[O.id]);if(!!R){if(O.yA){R.set("visible",!1);return}var H=R.getChildByIndex(0),z=H.getCanvasBBox(),_={x:B?z.x:z.maxX,y:z.y+z.height/2};Ia(H,O.x-_.x,O.y-_.y),O.labelLine&&yM(O,o,B)}})})}}function xM(i,r,t,e){M(r,function(n){var a=e.minX,o=e.minY,s=e.maxX,l=e.maxY,h=n.getCanvasBBox(),u=h.minX,c=h.minY,f=h.maxX,v=h.maxY,p=h.x,g=h.y,d=h.width,y=h.height,C=p,m=g;(us?C=s-d:f>s&&(C=C-(f-s)),c>l?m=l-y:v>l&&(m=m-(v-l)),(C!==p||m!==g)&&Ia(n,C-p,m-g)})}function wM(i,r,t,e){M(r,function(n,a){var o=n.getCanvasBBox(),s=t[a].getBBox();(o.minXs.maxX||o.maxY>s.maxY)&&n.remove(!0)})}var CM=100,Xv=function(){function i(r){r===void 0&&(r={}),this.bitmap={};var t=r.xGap,e=t===void 0?1:t,n=r.yGap,a=n===void 0?8:n;this.xGap=e,this.yGap=a}return i.prototype.hasGap=function(r){for(var t=!0,e=this.bitmap,n=Math.round(r.minX),a=Math.round(r.maxX),o=Math.round(r.minY),s=Math.round(r.maxY),l=n;l<=a;l+=1){if(!e[l]){e[l]={};continue}if(l===n||l===a){for(var h=o;h<=s;h++)if(e[l][h]){t=!1;break}}else if(e[l][o]||e[l][s]){t=!1;break}}return t},i.prototype.fillGap=function(r){for(var t=this.bitmap,e=Math.round(r.minX),n=Math.round(r.maxX),a=Math.round(r.minY),o=Math.round(r.maxY),s=e;s<=n;s+=1)t[s]||(t[s]={});for(var s=e;s<=n;s+=this.xGap){for(var l=a;l<=o;l+=this.yGap)t[s][l]=!0;t[s][o]=!0}if(this.yGap!==1)for(var s=a;s<=o;s+=1)t[e][s]=!0,t[n][s]=!0;if(this.xGap!==1)for(var s=e;s<=n;s+=1)t[s][a]=!0,t[s][o]=!0},i.prototype.destroy=function(){this.bitmap={}},i}();function MM(i,r,t){t===void 0&&(t=CM);var e=-1,n=i.attr(),a=n.x,o=n.y,s=i.getCanvasBBox(),l=Math.sqrt(s.width*s.width+s.height*s.height),h,u=-e,c=0,f=0,v=function(y){var C=y*.1;return[C*Math.cos(C),C*Math.sin(C)]};if(r.hasGap(s))return r.fillGap(s),!0;for(var p=!1,g=0,d={};Math.min(Math.abs(c),Math.abs(f))4)return[];var r=function(n,a){return[a.x-n.x,a.y-n.y]},t=r(i[0],i[1]),e=r(i[1],i[2]);return[t,e]}function wn(i,r,t){r===void 0&&(r=0),t===void 0&&(t={x:0,y:0});var e=i.x,n=i.y;return{x:(e-t.x)*Math.cos(-r)+(n-t.y)*Math.sin(-r)+t.x,y:(t.x-e)*Math.sin(-r)+(n-t.y)*Math.cos(-r)+t.y}}function vu(i){var r=[{x:i.x,y:i.y},{x:i.x+i.width,y:i.y},{x:i.x+i.width,y:i.y+i.height},{x:i.x,y:i.y+i.height}],t=i.rotation;return t?[wn(r[0],t,r[0]),wn(r[1],t,r[0]),wn(r[2],t,r[0]),wn(r[3],t,r[0])]:r}function pu(i,r){if(i.length>4)return{min:0,max:0};var t=[];return i.forEach(function(e){t.push(TM([e.x,e.y],r))}),{min:Math.min.apply(Math,et([],Y(t),!1)),max:Math.max.apply(Math,et([],Y(t),!1))}}function LM(i,r){return i.max>r.min&&i.mini.x+i.width+t||r.x+r.widthi.y+i.height+t||r.y+r.height"u")){var r;try{r=new Blob([i.toString()],{type:"application/javascript"})}catch{r=new window.BlobBuilder,r.append(i.toString()),r=r.getBlob()}return new IM(URL.createObjectURL(r))}}var FM=function(i){function r(){function h(m,x){return(m[0]||0)*(x[0]||0)+(m[1]||0)*(x[1]||0)+(m[2]||0)*(x[2]||0)}function u(m){if(m.length>4)return[];var x=function(A,L){return[L.x-A.x,L.y-A.y]},S=x(m[0],m[1]),b=x(m[1],m[2]);return[S,b]}function c(m,x,S){x===void 0&&(x=0),S===void 0&&(S={x:0,y:0});var b=m.x,A=m.y;return{x:(b-S.x)*Math.cos(-x)+(A-S.y)*Math.sin(-x)+S.x,y:(S.x-b)*Math.sin(-x)+(A-S.y)*Math.cos(-x)+S.y}}function f(m){var x=[{x:m.x,y:m.y},{x:m.x+m.width,y:m.y},{x:m.x+m.width,y:m.y+m.height},{x:m.x,y:m.y+m.height}],S=m.rotation;return S?[c(x[0],S,x[0]),c(x[1],S,x[0]),c(x[2],S,x[0]),c(x[3],S,x[0])]:x}function v(m,x){if(m.length>4)return{min:0,max:0};var S=[];return m.forEach(function(b){S.push(h([b.x,b.y],x))}),{min:Math.min.apply(null,S),max:Math.max.apply(null,S)}}function p(m,x){return m.max>x.min&&m.minm.x+m.width+S||x.x+x.widthm.y+m.height+S||x.y+x.height=a.height:o.width>=a.width}function HM(i,r,t){var e=!!i.getAdjust("stack");return e||r.every(function(n,a){var o=t[a];return GM(i,n,o)})}function VM(i,r,t){var e=i.coordinate,n=Bt.fromObject(t.getBBox()),a=je(r);e.isTransposed?a.attr({x:n.minX+n.width/2,textAlign:"center"}):a.attr({y:n.minY+n.height/2,textBaseline:"middle"})}function NM(i,r,t){var e;if(t.length!==0){var n=(e=t[0])===null||e===void 0?void 0:e.get("element"),a=n==null?void 0:n.geometry;if(!(!a||a.type!=="interval")){var o=HM(a,r,t);o&&t.forEach(function(s,l){var h=r[l];VM(a,h,s)})}}}function XM(i){var r=500,t=[],e=Math.max(Math.floor(i.length/r),1);return M(i,function(n,a){a%e===0?t.push(n):n.set("visible",!1)}),t}function zM(i,r,t){var e;if(t.length!==0){var n=(e=t[0])===null||e===void 0?void 0:e.get("element"),a=n==null?void 0:n.geometry;if(!(!a||a.type!=="interval")){var o=XM(r),s=Y(a.getXYFields(),1),l=s[0],h=[],u=[],c=Ue(o,function(d){return d.get("data")[l]}),f=Hu(Et(o,function(d){return d.get("data")[l]})),v;o.forEach(function(d){d.set("visible",!0)});var p=function(d){d&&(d.length&&u.push(d.pop()),u.push.apply(u,et([],Y(d),!1)))};for(Gt(f)>0&&(v=f.shift(),p(c[v])),Gt(f)>0&&(v=f.pop(),p(c[v])),M(f.reverse(),function(d){p(c[d])});u.length>0;){var g=u.shift();g.get("visible")&&(Pw(g,h)?g.set("visible",!1):h.push(g))}}}}function WM(i,r){var t=i.getXYFields()[1],e=[],n=r.sort(function(a,o){return a.get("data")[t]-a.get("data")[t]});return n.length>0&&e.push(n.shift()),n.length>0&&e.push(n.pop()),e.push.apply(e,et([],Y(n),!1)),e}function zv(i,r,t){return i.some(function(e){return t(e,r)})}function $M(i,r,t){t===void 0&&(t=0);var e=Math.max(0,Math.min(i.x+i.width+t,r.x+r.width+t)-Math.max(i.x-t,r.x-t)),n=Math.max(0,Math.min(i.y+i.height+t,r.y+r.height+t)-Math.max(i.y-t,r.y-t));return e*n}function mu(i,r){return zv(i,r,function(t,e){var n=je(t),a=je(e);return $M(n.getCanvasBBox(),a.getCanvasBBox(),2)>0})}function _M(i,r,t,e,n){var a,o;if(t.length!==0){var s=(a=t[0])===null||a===void 0?void 0:a.get("element"),l=s==null?void 0:s.geometry;if(!(!l||l.type!=="point")){var h=Y(l.getXYFields(),2),u=h[0],c=h[1],f=Ue(r,function(g){return g.get("data")[u]}),v=[],p=n&&n.offset||((o=i[0])===null||o===void 0?void 0:o.offset)||12;Et(Vi(f).reverse(),function(g){for(var d=WM(l,f[g]);d.length;){var y=d.shift(),C=je(y);if(zv(v,y,function(S,b){return S.get("data")[u]===b.get("data")[u]&&S.get("data")[c]===b.get("data")[c]})){C.set("visible",!1);continue}var m=mu(v,y),x=!1;if(m&&(C.attr("y",C.attr("y")+2*p),x=mu(v,y)),x){C.set("visible",!1);continue}v.push(y)}})}}}function jM(i,r){var t=i.getXYFields()[1],e=[],n=r.sort(function(a,o){return a.get("data")[t]-a.get("data")[t]});return n.length>0&&e.push(n.shift()),n.length>0&&e.push(n.pop()),e.push.apply(e,et([],Y(n),!1)),e}function Wv(i,r,t){return i.some(function(e){return t(e,r)})}function UM(i,r,t){t===void 0&&(t=0);var e=Math.max(0,Math.min(i.x+i.width+t,r.x+r.width+t)-Math.max(i.x-t,r.x-t)),n=Math.max(0,Math.min(i.y+i.height+t,r.y+r.height+t)-Math.max(i.y-t,r.y-t));return e*n}function xu(i,r){return Wv(i,r,function(t,e){var n=je(t),a=je(e);return UM(n.getCanvasBBox(),a.getCanvasBBox(),2)>0})}function qM(i,r,t,e,n){var a,o;if(t.length!==0){var s=(a=t[0])===null||a===void 0?void 0:a.get("element"),l=s==null?void 0:s.geometry;if(!(!l||["path","line","area"].indexOf(l.type)<0)){var h=Y(l.getXYFields(),2),u=h[0],c=h[1],f=Ue(r,function(g){return g.get("data")[u]}),v=[],p=n&&n.offset||((o=i[0])===null||o===void 0?void 0:o.offset)||12;Et(Vi(f).reverse(),function(g){for(var d=jM(l,f[g]);d.length;){var y=d.shift(),C=je(y);if(Wv(v,y,function(S,b){return S.get("data")[u]===b.get("data")[u]&&S.get("data")[c]===b.get("data")[c]})){C.set("visible",!1);continue}var m=xu(v,y),x=!1;if(m&&(C.attr("y",C.attr("y")+2*p),x=xu(v,y)),x){C.set("visible",!1);continue}v.push(y)}})}}}var lo;function ZM(){return lo||(lo=document.createElement("canvas").getContext("2d")),lo}var Cn=ia(function(i,r){r===void 0&&(r={});var t=r.fontSize,e=r.fontFamily,n=r.fontWeight,a=r.fontStyle,o=r.fontVariant,s=ZM();return s.font=[a,o,n,"".concat(t,"px"),e].join(" "),s.measureText(N(i)?i:"").width},function(i,r){return r===void 0&&(r={}),et([i],Y(es(r)),!1).join("")}),QM=function(i,r,t){var e=16,n=Cn("...",t),a;N(i)?a=i:a=ra(i);var o=r,s=[],l,h;if(Cn(i,t)<=r)return i;for(;l=a.substr(0,e),h=Cn(l,t),!(h+n>o&&h>o);)if(s.push(l),o-=h,a=a.substr(e),!a)return s.join("");for(;l=a.substr(0,1),h=Cn(l,t),!(h+n>o);)if(s.push(l),o-=h,a=a.substr(1),!a)return s.join("");return"".concat(s.join(""),"...")};function KM(i,r,t,e,n){if(!(r.length<=0)){var a=(n==null?void 0:n.direction)||["top","right","bottom","left"],o=(n==null?void 0:n.action)||"translate",s=(n==null?void 0:n.margin)||0,l=r[0].get("coordinate");if(!!l){var h=Sx(l,s),u=h.minX,c=h.minY,f=h.maxX,v=h.maxY;M(r,function(p){var g=p.getCanvasBBox(),d=g.minX,y=g.minY,C=g.maxX,m=g.maxY,x=g.x,S=g.y,b=g.width,A=g.height,L=x,k=S;if(a.indexOf("left")>=0&&(d=0&&(y=0&&(d>f?L=f-b:C>f&&(L=L-(C-f))),a.indexOf("bottom")>=0&&(y>v?k=v-A:m>v&&(k=k-(m-v))),L!==x||k!==S){var B=L-x;if(o==="translate")Ia(p,B,k-S);else if(o==="ellipsis"){var O=p.findAll(function(R){return R.get("type")==="text"});O.forEach(function(R){var H=rs(R.attr(),["fontSize","fontFamily","fontWeight","fontStyle","fontVariant"]),z=R.getCanvasBBox(),_=QM(R.attr("text"),z.width-Math.abs(B),H);R.attr("text",_)})}else p.hide()}})}}}function JM(i,r,t){var e={fillOpacity:I(i.attr("fillOpacity"))?1:i.attr("fillOpacity"),strokeOpacity:I(i.attr("strokeOpacity"))?1:i.attr("strokeOpacity"),opacity:I(i.attr("opacity"))?1:i.attr("opacity")};i.attr({fillOpacity:0,strokeOpacity:0,opacity:0}),i.animate(e,r)}function tS(i,r,t){var e={fillOpacity:0,strokeOpacity:0,opacity:0},n=r.easing,a=r.duration,o=r.delay;i.animate(e,a,n,function(){i.remove(!0)},o)}function eS(i,r,t){var e,n=Y(r,2),a=n[0],o=n[1];return i.applyToMatrix([a,o,1]),t==="x"?(i.setMatrix(ct(i.getMatrix(),[["t",-a,-o],["s",.01,1],["t",a,o]])),e=ct(i.getMatrix(),[["t",-a,-o],["s",100,1],["t",a,o]])):t==="y"?(i.setMatrix(ct(i.getMatrix(),[["t",-a,-o],["s",1,.01],["t",a,o]])),e=ct(i.getMatrix(),[["t",-a,-o],["s",1,100],["t",a,o]])):t==="xy"&&(i.setMatrix(ct(i.getMatrix(),[["t",-a,-o],["s",.01,.01],["t",a,o]])),e=ct(i.getMatrix(),[["t",-a,-o],["s",100,100],["t",a,o]])),e}function Zs(i,r,t,e,n){var a=t.start,o=t.end,s=t.getWidth(),l=t.getHeight(),h,u;n==="y"?(h=a.x+s/2,u=e.ya.x?e.x:a.x,u=a.y+l/2):n==="xy"&&(t.isPolar?(h=t.getCenter().x,u=t.getCenter().y):(h=(a.x+o.x)/2,u=(a.y+o.y)/2));var c=eS(i,[h,u],n);i.animate({matrix:c},r)}function rS(i,r,t){var e=t.coordinate,n=t.minYPoint;Zs(i,r,e,n,"x")}function iS(i,r,t){var e=t.coordinate,n=t.minYPoint;Zs(i,r,e,n,"y")}function nS(i,r,t){var e=t.coordinate,n=t.minYPoint;Zs(i,r,e,n,"xy")}function aS(i,r,t){var e=i.getTotalLength();i.attr("lineDash",[e]),i.animate(function(n){return{lineDashOffset:(1-n)*e}},r)}function oS(i,r,t){var e=t.toAttrs,n=e.x,a=e.y;delete e.x,delete e.y,i.attr(e),i.animate({x:n,y:a},r)}function sS(i,r,t){var e=i.getBBox(),n=i.get("origin").mappingData,a=n.points,o=a[0].y-a[1].y>0?e.maxX:e.minX,s=(e.minY+e.maxY)/2;i.applyToMatrix([o,s,1]);var l=ct(i.getMatrix(),[["t",-o,-s],["s",.01,1],["t",o,s]]);i.setMatrix(l),i.animate({matrix:ct(i.getMatrix(),[["t",-o,-s],["s",100,1],["t",o,s]])},r)}function lS(i,r,t){var e=i.getBBox(),n=i.get("origin").mappingData,a=(e.minX+e.maxX)/2,o=n.points,s=o[0].y-o[1].y<=0?e.maxY:e.minY;i.applyToMatrix([a,s,1]);var l=ct(i.getMatrix(),[["t",-a,-s],["s",1,.01],["t",a,s]]);i.setMatrix(l),i.animate({matrix:ct(i.getMatrix(),[["t",-a,-s],["s",1,100],["t",a,s]])},r)}function wu(i,r){var t,e=Zn(i,r),n=e.startAngle,a=e.endAngle;return!xt(n,-Math.PI*.5)&&n<-Math.PI*.5&&(n+=Math.PI*2),!xt(a,-Math.PI*.5)&&a<-Math.PI*.5&&(a+=Math.PI*2),r[5]===0&&(t=Y([a,n],2),n=t[0],a=t[1]),xt(n,Math.PI*1.5)&&(n=Math.PI*-.5),xt(a,Math.PI*-.5)&&!xt(n,a)&&(a=Math.PI*1.5),{startAngle:n,endAngle:a}}function Cu(i){var r;return i[0]==="M"||i[0]==="L"?r=[i[1],i[2]]:(i[0]==="a"||i[0]==="A"||i[0]==="C")&&(r=[i[i.length-2],i[i.length-1]]),r}function Mu(i){var r,t,e,n=i.filter(function(m){return m[0]==="A"||m[0]==="a"});if(n.length===0)return{startAngle:0,endAngle:0,radius:0,innerRadius:0};var a=n[0],o=n.length>1?n[1]:n[0],s=i.indexOf(a),l=i.indexOf(o),h=Cu(i[s-1]),u=Cu(i[l-1]),c=wu(h,a),f=c.startAngle,v=c.endAngle,p=wu(u,o),g=p.startAngle,d=p.endAngle;xt(f,g)&&xt(v,d)?(t=f,e=v):(t=Math.min(f,g),e=Math.max(v,d));var y=a[1],C=n[n.length-1][1];return y=0;h--){var u=this.getFacetsByLevel(t,h);try{for(var c=(e=void 0,$(u)),f=c.next();!f.done;f=c.next()){var v=f.value;this.isLeaf(v)||(v.originColIndex=v.columnIndex,v.columnIndex=this.getRegionIndex(v.children),v.columnValuesLength=o.length)}}catch(p){e={error:p}}finally{try{f&&!f.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}}},r.prototype.getFacetsByLevel=function(t,e){var n=[];return t.forEach(function(a){a.rowIndex===e&&n.push(a)}),n},r.prototype.getRegionIndex=function(t){var e=t[0],n=t[t.length-1];return(n.columnIndex-e.columnIndex)/2+e.columnIndex},r.prototype.isLeaf=function(t){return!t.children||!t.children.length},r.prototype.getRows=function(){return this.cfg.fields.length+1},r.prototype.getChildFacets=function(t,e,n){var a=this,o=this.cfg.fields,s=o.length;if(!(s=v){var d=n.parsePosition([p[l],p[s.field]]);d&&f.push(d)}if(p[l]===c)return!1}),f},r.prototype.parsePercentPosition=function(t){var e=parseFloat(t[0])/100,n=parseFloat(t[1])/100,a=this.view.getCoordinate(),o=a.start,s=a.end,l={x:Math.min(o.x,s.x),y:Math.min(o.y,s.y)},h=a.getWidth()*e+l.x,u=a.getHeight()*n+l.y;return{x:h,y:u}},r.prototype.getCoordinateBBox=function(){var t=this.view.getCoordinate(),e=t.start,n=t.end,a=t.getWidth(),o=t.getHeight(),s={x:Math.min(e.x,n.x),y:Math.min(e.y,n.y)};return{x:s.x,y:s.y,minX:s.x,minY:s.y,maxX:s.x+a,maxY:s.y+o,width:a,height:o}},r.prototype.getAnnotationCfg=function(t,e,n){var a=this,o=this.view.getCoordinate(),s=this.view.getCanvas(),l={};if(I(e))return null;var h=e.start,u=e.end,c=e.position,f=this.parsePosition(h),v=this.parsePosition(u),p=this.parsePosition(c);if(["arc","image","line","region","regionFilter"].includes(t)&&(!f||!v))return null;if(["text","dataMarker","html"].includes(t)&&!p)return null;if(t==="arc"){var g=e;g.start,g.end;var d=mt(g,["start","end"]),y=Yr(o,f),C=Yr(o,v);y>C&&(C=Math.PI*2+C),l=w(w({},d),{center:o.getCenter(),radius:Ba(o,f),startAngle:y,endAngle:C})}else if(t==="image"){var m=e;m.start,m.end;var d=mt(m,["start","end"]);l=w(w({},d),{start:f,end:v,src:e.src})}else if(t==="line"){var x=e;x.start,x.end;var d=mt(x,["start","end"]);l=w(w({},d),{start:f,end:v,text:T(e,"text",null)})}else if(t==="region"){var S=e;S.start,S.end;var d=mt(S,["start","end"]);l=w(w({},d),{start:f,end:v})}else if(t==="text"){var b=this.view.getData(),A=e;A.position;var L=A.content,d=mt(A,["position","content"]),k=L;G(L)&&(k=L(b)),l=w(w(w({},p),d),{content:k})}else if(t==="dataMarker"){var B=e;B.position;var O=B.point,R=B.line,H=B.text,z=B.autoAdjust,_=B.direction,d=mt(B,["position","point","line","text","autoAdjust","direction"]);l=w(w(w({},d),p),{coordinateBBox:this.getCoordinateBBox(),point:O,line:R,text:H,autoAdjust:z,direction:_})}else if(t==="dataRegion"){var K=e,nt=K.start,ht=K.end,Q=K.region,H=K.text,ut=K.lineLength,d=mt(K,["start","end","region","text","lineLength"]);l=w(w({},d),{points:this.getRegionPoints(nt,ht),region:Q,text:H,lineLength:ut})}else if(t==="regionFilter"){var vt=e;vt.start,vt.end;var te=vt.apply,mr=vt.color,d=mt(vt,["start","end","apply","color"]),qi=this.view.geometries,ee=[],Ur=function(se){!se||(se.isGroup()?se.getChildren().forEach(function(Qr){return Ur(Qr)}):ee.push(se))};M(qi,function(se){te?rr(te,se.type)&&M(se.elements,function(Qr){Ur(Qr.shape)}):M(se.elements,function(Qr){Ur(Qr.shape)})}),l=w(w({},d),{color:mr,shapes:ee,start:f,end:v})}else if(t==="shape"){var qr=e,Zi=qr.render,Te=mt(qr,["render"]),Oa=function(tp){if(G(e.render))return Zi(tp,a.view,{parsePosition:a.parsePosition.bind(a)})};l=w(w({},Te),{render:Oa})}else if(t==="html"){var Zr=e,Da=Zr.html;Zr.position;var Te=mt(Zr,["html","position"]),Jv=function(se){return G(Da)?Da(se,a.view):Da};l=w(w(w({},Te),p),{parent:s.get("el").parentNode,html:Jv})}var Le=D({},n,w(w({},l),{top:e.top,style:e.style,offsetX:e.offsetX,offsetY:e.offsetY}));return t!=="html"&&(Le.container=this.getComponentContainer(Le)),Le.animate=this.view.getOptions().animate&&Le.animate&&T(e,"animate",Le.animate),Le.animateOption=D({},Vr,Le.animateOption,e.animateOption),Le},r.prototype.isTop=function(t){return T(t,"top",!0)},r.prototype.getComponentContainer=function(t){return this.isTop(t)?this.foregroundContainer:this.backgroundContainer},r.prototype.getAnnotationTheme=function(t){return T(this.view.getTheme(),["components","annotation",t],{})},r.prototype.updateOrCreate=function(t){var e=this.cache.get(this.getCacheKey(t));if(e){var n=t.type,a=this.getAnnotationTheme(n),o=this.getAnnotationCfg(n,t,a);o&&Ft(o,["container"]),e.component.update(w(w({},o||{}),{visible:!!o})),rr(Sn,t.type)&&e.component.render()}else e=this.createAnnotation(t),e&&(e.component.init(),rr(Sn,t.type)&&e.component.render());return e},r.prototype.syncCache=function(t){var e=this,n=new Map(this.cache);return t.forEach(function(a,o){n.set(o,a)}),n.forEach(function(a,o){Ce(e.option,function(s){return o===e.getCacheKey(s)})||(a.component.destroy(),n.delete(o))}),n},r.prototype.getCacheKey=function(t){return t},r}(jr);function bu(i,r){var t=D({},T(i,["components","axis","common"]),T(i,["components","axis",r]));return T(t,["grid"],{})}function bn(i,r,t,e){var n=[],a=r.getTicks();return i.isPolar&&a.push({value:1,text:"",tickValue:""}),a.reduce(function(o,s,l){var h=s.value;if(e)n.push({points:[i.convert(t==="y"?{x:0,y:h}:{x:h,y:0}),i.convert(t==="y"?{x:1,y:h}:{x:h,y:1})]});else if(l){var u=o.value,c=(u+h)/2;n.push({points:[i.convert(t==="y"?{x:0,y:c}:{x:c,y:0}),i.convert(t==="y"?{x:1,y:c}:{x:c,y:1})]})}return s},a[0]),n}function uo(i,r,t,e,n){var a=r.values.length,o=[],s=t.getTicks();return s.reduce(function(l,h){var u=l?l.value:h.value,c=h.value,f=(u+c)/2;return n==="x"?o.push({points:[i.convert({x:e?c:f,y:0}),i.convert({x:e?c:f,y:1})]}):o.push({points:Et(Array(a+1),function(v,p){return i.convert({x:p/a,y:e?c:f})})}),h},s[0]),o}function Au(i,r){var t=T(r,"grid");if(t===null)return!1;var e=T(i,"grid");return!(t===void 0&&e===null)}var Ie=["container"],Tu=w(w({},Vr),{appear:null}),CS=function(i){E(r,i);function r(t){var e=i.call(this,t)||this;return e.cache=new Map,e.gridContainer=e.view.getLayer(st.BG).addGroup(),e.gridForeContainer=e.view.getLayer(st.FORE).addGroup(),e.axisContainer=e.view.getLayer(st.BG).addGroup(),e.axisForeContainer=e.view.getLayer(st.FORE).addGroup(),e}return Object.defineProperty(r.prototype,"name",{get:function(){return"axis"},enumerable:!1,configurable:!0}),r.prototype.init=function(){},r.prototype.render=function(){this.update()},r.prototype.layout=function(){var t=this,e=this.view.getCoordinate();M(this.getComponents(),function(n){var a=n.component,o=n.direction,s=n.type,l=n.extra,h=l.dim,u=l.scale,c=l.alignTick,f;if(s===dt.AXIS)e.isPolar?h==="x"?f=e.isTransposed?cn(e,o):eo(e):h==="y"&&(f=e.isTransposed?eo(e):cn(e,o)):f=cn(e,o);else if(s===dt.GRID)if(e.isPolar){var v=void 0;e.isTransposed?v=h==="x"?uo(e,t.view.getYScales()[0],u,c,h):bn(e,u,h,c):v=h==="x"?bn(e,u,h,c):uo(e,t.view.getXScale(),u,c,h),f={items:v,center:t.view.getCoordinate().getCenter()}}else f={items:bn(e,u,h,c)};a.update(f)})},r.prototype.update=function(){this.option=this.view.getOptions().axes;var t=new Map;this.updateXAxes(t),this.updateYAxes(t);var e=new Map;this.cache.forEach(function(n,a){t.has(a)?e.set(a,n):n.component.destroy()}),this.cache=e},r.prototype.clear=function(){i.prototype.clear.call(this),this.cache.clear(),this.gridContainer.clear(),this.gridForeContainer.clear(),this.axisContainer.clear(),this.axisForeContainer.clear()},r.prototype.destroy=function(){i.prototype.destroy.call(this),this.gridContainer.remove(!0),this.gridForeContainer.remove(!0),this.axisContainer.remove(!0),this.axisForeContainer.remove(!0)},r.prototype.getComponents=function(){var t=[];return this.cache.forEach(function(e){t.push(e)}),t},r.prototype.updateXAxes=function(t){var e=this.view.getXScale();if(!(!e||e.isIdentity)){var n=jn(this.option,e.field);if(n!==!1){var a=Dh(n,F.BOTTOM),o=st.BG,s="x",l=this.view.getCoordinate(),h=this.getId("axis",e.field),u=this.getId("grid",e.field);if(l.isRect){var c=this.cache.get(h);if(c){var f=this.getLineAxisCfg(e,n,a);Ft(f,Ie),c.component.update(f),t.set(h,c)}else c=this.createLineAxis(e,n,o,a,s),this.cache.set(h,c),t.set(h,c);var v=this.cache.get(u);if(v){var f=this.getLineGridCfg(e,n,a,s);Ft(f,Ie),v.component.update(f),t.set(u,v)}else v=this.createLineGrid(e,n,o,a,s),v&&(this.cache.set(u,v),t.set(u,v))}else if(l.isPolar){var c=this.cache.get(h);if(c){var f=l.isTransposed?this.getLineAxisCfg(e,n,F.RADIUS):this.getCircleAxisCfg(e,n,a);Ft(f,Ie),c.component.update(f),t.set(h,c)}else{if(l.isTransposed){if(br(n))return;c=this.createLineAxis(e,n,o,F.RADIUS,s)}else c=this.createCircleAxis(e,n,o,a,s);this.cache.set(h,c),t.set(h,c)}var v=this.cache.get(u);if(v){var f=l.isTransposed?this.getCircleGridCfg(e,n,F.RADIUS,s):this.getLineGridCfg(e,n,F.CIRCLE,s);Ft(f,Ie),v.component.update(f),t.set(u,v)}else{if(l.isTransposed){if(br(n))return;v=this.createCircleGrid(e,n,o,F.RADIUS,s)}else v=this.createLineGrid(e,n,o,F.CIRCLE,s);v&&(this.cache.set(u,v),t.set(u,v))}}}}},r.prototype.updateYAxes=function(t){var e=this,n=this.view.getYScales();M(n,function(a,o){if(!(!a||a.isIdentity)){var s=a.field,l=jn(e.option,s);if(l!==!1){var h=st.BG,u="y",c=e.getId("axis",s),f=e.getId("grid",s),v=e.view.getCoordinate();if(v.isRect){var p=Dh(l,o===0?F.LEFT:F.RIGHT),g=e.cache.get(c);if(g){var d=e.getLineAxisCfg(a,l,p);Ft(d,Ie),g.component.update(d),t.set(c,g)}else g=e.createLineAxis(a,l,h,p,u),e.cache.set(c,g),t.set(c,g);var y=e.cache.get(f);if(y){var d=e.getLineGridCfg(a,l,p,u);Ft(d,Ie),y.component.update(d),t.set(f,y)}else y=e.createLineGrid(a,l,h,p,u),y&&(e.cache.set(f,y),t.set(f,y))}else if(v.isPolar){var g=e.cache.get(c);if(g){var d=v.isTransposed?e.getCircleAxisCfg(a,l,F.CIRCLE):e.getLineAxisCfg(a,l,F.RADIUS);Ft(d,Ie),g.component.update(d),t.set(c,g)}else{if(v.isTransposed){if(br(l))return;g=e.createCircleAxis(a,l,h,F.CIRCLE,u)}else g=e.createLineAxis(a,l,h,F.RADIUS,u);e.cache.set(c,g),t.set(c,g)}var y=e.cache.get(f);if(y){var d=v.isTransposed?e.getLineGridCfg(a,l,F.CIRCLE,u):e.getCircleGridCfg(a,l,F.RADIUS,u);Ft(d,Ie),y.component.update(d),t.set(f,y)}else{if(v.isTransposed){if(br(l))return;y=e.createLineGrid(a,l,h,F.CIRCLE,u)}else y=e.createCircleGrid(a,l,h,F.RADIUS,u);y&&(e.cache.set(f,y),t.set(f,y))}}}}})},r.prototype.createLineAxis=function(t,e,n,a,o){var s={component:new fx(this.getLineAxisCfg(t,e,a)),layer:n,direction:a===F.RADIUS?F.NONE:a,type:dt.AXIS,extra:{dim:o,scale:t}};return s.component.set("field",t.field),s.component.init(),s},r.prototype.createLineGrid=function(t,e,n,a,o){var s=this.getLineGridCfg(t,e,a,o);if(s){var l={component:new px(s),layer:n,direction:F.NONE,type:dt.GRID,extra:{dim:o,scale:t,alignTick:T(s,"alignTick",!0)}};return l.component.init(),l}},r.prototype.createCircleAxis=function(t,e,n,a,o){var s={component:new vx(this.getCircleAxisCfg(t,e,a)),layer:n,direction:a,type:dt.AXIS,extra:{dim:o,scale:t}};return s.component.set("field",t.field),s.component.init(),s},r.prototype.createCircleGrid=function(t,e,n,a,o){var s=this.getCircleGridCfg(t,e,a,o);if(s){var l={component:new gx(s),layer:n,direction:F.NONE,type:dt.GRID,extra:{dim:o,scale:t,alignTick:T(s,"alignTick",!0)}};return l.component.init(),l}},r.prototype.getLineAxisCfg=function(t,e,n){var a=T(e,["top"])?this.axisForeContainer:this.axisContainer,o=this.view.getCoordinate(),s=cn(o,n),l=Rh(t,e),h=fn(this.view.getTheme(),n),u=T(e,["title"])?D({title:{style:{text:l}}},{title:Oh(this.view.getTheme(),n,e.title)},e):e,c=D(w(w({container:a},s),{ticks:t.getTicks().map(function(m){return{id:"".concat(m.tickValue),name:m.text,value:m.value}}),verticalFactor:o.isPolar?Fh(s,o.getCenter())*-1:Fh(s,o.getCenter()),theme:h}),h,u),f=this.getAnimateCfg(c),v=f.animate,p=f.animateOption;c.animateOption=p,c.animate=v;var g=Df(s),d=T(c,"verticalLimitLength",g?1/3:1/2);if(d<=1){var y=this.view.getCanvas().get("width"),C=this.view.getCanvas().get("height");c.verticalLimitLength=d*(g?y:C)}return c},r.prototype.getLineGridCfg=function(t,e,n,a){if(!!Au(fn(this.view.getTheme(),n),e)){var o=bu(this.view.getTheme(),n),s=D({container:T(e,["top"])?this.gridForeContainer:this.gridContainer},o,T(e,"grid"),this.getAnimateCfg(e));return s.items=bn(this.view.getCoordinate(),t,a,T(s,"alignTick",!0)),s}},r.prototype.getCircleAxisCfg=function(t,e,n){var a=T(e,["top"])?this.axisForeContainer:this.axisContainer,o=this.view.getCoordinate(),s=t.getTicks().map(function(g){return{id:"".concat(g.tickValue),name:g.text,value:g.value}});!t.isCategory&&Math.abs(o.endAngle-o.startAngle)===Math.PI*2&&s.pop();var l=Rh(t,e),h=fn(this.view.getTheme(),F.CIRCLE),u=T(e,["title"])?D({title:{style:{text:l}}},{title:Oh(this.view.getTheme(),n,e.title)},e):e,c=D(w(w({container:a},eo(this.view.getCoordinate())),{ticks:s,verticalFactor:1,theme:h}),h,u),f=this.getAnimateCfg(c),v=f.animate,p=f.animateOption;return c.animate=v,c.animateOption=p,c},r.prototype.getCircleGridCfg=function(t,e,n,a){if(!!Au(fn(this.view.getTheme(),n),e)){var o=bu(this.view.getTheme(),F.RADIUS),s=D({container:T(e,["top"])?this.gridForeContainer:this.gridContainer,center:this.view.getCoordinate().getCenter()},o,T(e,"grid"),this.getAnimateCfg(e)),l=T(s,"alignTick",!0),h=a==="x"?this.view.getYScales()[0]:this.view.getXScale();return s.items=uo(this.view.getCoordinate(),h,t,l,a),s}},r.prototype.getId=function(t,e){var n=this.view.getCoordinate();return"".concat(t,"-").concat(e,"-").concat(n.type)},r.prototype.getAnimateCfg=function(t){return{animate:this.view.getOptions().animate&&T(t,"animate"),animateOption:t&&t.animateOption?D({},Tu,t.animateOption):Tu}},r}(jr);function Ve(i,r,t){return t===F.TOP?[i.minX+i.width/2-r.width/2,i.minY]:t===F.BOTTOM?[i.minX+i.width/2-r.width/2,i.maxY-r.height]:t===F.LEFT?[i.minX,i.minY+i.height/2-r.height/2]:t===F.RIGHT?[i.maxX-r.width,i.minY+i.height/2-r.height/2]:t===F.TOP_LEFT||t===F.LEFT_TOP?[i.tl.x,i.tl.y]:t===F.TOP_RIGHT||t===F.RIGHT_TOP?[i.tr.x-r.width,i.tr.y]:t===F.BOTTOM_LEFT||t===F.LEFT_BOTTOM?[i.bl.x,i.bl.y-r.height]:t===F.BOTTOM_RIGHT||t===F.RIGHT_BOTTOM?[i.br.x-r.width,i.br.y-r.height]:[0,0]}function Lu(i,r){return Mi(i)?i===!1?!1:{}:T(i,[r],i)}function An(i){return T(i,"position",F.BOTTOM)}var MS=function(i){E(r,i);function r(t){var e=i.call(this,t)||this;return e.container=e.view.getLayer(st.FORE).addGroup(),e}return Object.defineProperty(r.prototype,"name",{get:function(){return"legend"},enumerable:!1,configurable:!0}),r.prototype.init=function(){},r.prototype.render=function(){this.update()},r.prototype.layout=function(){var t=this;this.layoutBBox=this.view.viewBBox,M(this.components,function(e){var n=e.component,a=e.direction,o=io(a),s=n.get("maxWidthRatio"),l=n.get("maxHeightRatio"),h=t.getCategoryLegendSizeCfg(o,s,l),u=n.get("maxWidth"),c=n.get("maxHeight");n.update({maxWidth:Math.min(h.maxWidth,u||0),maxHeight:Math.min(h.maxHeight,c||0)});var f=n.get("padding"),v=n.getLayoutBBox(),p=new Bt(v.x,v.y,v.width,v.height).expand(f),g=Y(Ve(t.view.viewBBox,p,a),2),d=g[0],y=g[1],C=Y(Ve(t.layoutBBox,p,a),2),m=C[0],x=C[1],S=0,b=0;a.startsWith("top")||a.startsWith("bottom")?(S=d,b=x):(S=m,b=y),n.setLocation({x:S+f[3],y:b+f[0]}),t.layoutBBox=t.layoutBBox.cut(p,a)})},r.prototype.update=function(){var t=this;this.option=this.view.getOptions().legends;var e={},n=function(f,v,p){var g=t.getId(p.field),d=t.getComponentById(g);if(d){var y=void 0,C=Lu(t.option,p.field);C!==!1&&(T(C,"custom")?y=t.getCategoryCfg(f,v,p,C,!0):p.isLinear?y=t.getContinuousCfg(f,v,p,C):p.isCategory&&(y=t.getCategoryCfg(f,v,p,C))),y&&(Ft(y,["container"]),d.direction=An(C),d.component.update(y),e[g]=!0)}else{var m=t.createFieldLegend(f,v,p);m&&(m.component.init(),t.components.push(m),e[g]=!0)}};if(T(this.option,"custom")){var a="global-custom",o=this.getComponentById(a);if(o){var s=this.getCategoryCfg(void 0,void 0,void 0,this.option,!0);Ft(s,["container"]),o.component.update(s),e[a]=!0}else{var l=this.createCustomLegend(void 0,void 0,void 0,this.option);if(l){l.init();var h=st.FORE,u=An(this.option);this.components.push({id:a,component:l,layer:h,direction:u,type:dt.LEGEND,extra:void 0}),e[a]=!0}}}else this.loopLegends(n);var c=[];M(this.getComponents(),function(f){e[f.id]?c.push(f):f.component.destroy()}),this.components=c},r.prototype.clear=function(){i.prototype.clear.call(this),this.container.clear()},r.prototype.destroy=function(){i.prototype.destroy.call(this),this.container.remove(!0)},r.prototype.getGeometries=function(t){var e=this,n=t.geometries;return M(t.views,function(a){n=n.concat(e.getGeometries(a))}),n},r.prototype.loopLegends=function(t){var e=this.view.getRootView()===this.view;if(!!e){var n=this.getGeometries(this.view),a={};M(n,function(o){var s=o.getGroupAttributes();M(s,function(l){var h=l.getScale(l.type);!h||h.type==="identity"||a[h.field]||(t(o,l,h),a[h.field]=!0)})})}},r.prototype.createFieldLegend=function(t,e,n){var a,o=Lu(this.option,n.field),s=st.FORE,l=An(o);if(o!==!1&&(T(o,"custom")?a=this.createCustomLegend(t,e,n,o):n.isLinear?a=this.createContinuousLegend(t,e,n,o):n.isCategory&&(a=this.createCategoryLegend(t,e,n,o))),a)return a.set("field",n.field),{id:this.getId(n.field),component:a,layer:s,direction:l,type:dt.LEGEND,extra:{scale:n}}},r.prototype.createCustomLegend=function(t,e,n,a){var o=this.getCategoryCfg(t,e,n,a,!0);return new kh(o)},r.prototype.createContinuousLegend=function(t,e,n,a){var o=this.getContinuousCfg(t,e,n,Ft(a,["value"]));return new dx(o)},r.prototype.createCategoryLegend=function(t,e,n,a){var o=this.getCategoryCfg(t,e,n,a);return new kh(o)},r.prototype.getContinuousCfg=function(t,e,n,a){var o=n.getTicks(),s=Ce(o,function(g){return g.value===0}),l=Ce(o,function(g){return g.value===1}),h=o.map(function(g){var d=g.value,y=g.tickValue,C=e.mapping(n.invert(d)).join("");return{value:y,attrValue:C,color:C,scaleValue:d}});s||h.push({value:n.min,attrValue:e.mapping(n.invert(0)).join(""),color:e.mapping(n.invert(0)).join(""),scaleValue:0}),l||h.push({value:n.max,attrValue:e.mapping(n.invert(1)).join(""),color:e.mapping(n.invert(1)).join(""),scaleValue:1}),h.sort(function(g,d){return g.value-d.value});var u={min:zt(h).value,max:Ct(h).value,colors:[],rail:{type:e.type},track:{}};e.type==="size"&&(u.track={style:{fill:e.type==="size"?this.view.getTheme().defaultColor:void 0}}),e.type==="color"&&(u.colors=h.map(function(g){return g.attrValue}));var c=this.container,f=An(a),v=io(f),p=T(a,"title");return p&&(p=D({text:Di(n)},p)),u.container=c,u.layout=v,u.title=p,u.animateOption=Vr,this.mergeLegendCfg(u,a,"continuous")},r.prototype.getCategoryCfg=function(t,e,n,a,o){var s=this.container,l=T(a,"position",F.BOTTOM),h=qh(this.view.getTheme(),l),u=T(h,["marker"]),c=T(a,"marker"),f=io(l),v=T(h,["pageNavigator"]),p=T(a,"pageNavigator"),g=o?Gw(u,c,a.items):Yw(this.view,t,e,u,c),d=T(a,"title");d&&(d=D({text:n?Di(n):""},d));var y=T(a,"maxWidthRatio"),C=T(a,"maxHeightRatio"),m=this.getCategoryLegendSizeCfg(f,y,C);m.container=s,m.layout=f,m.items=g,m.title=d,m.animateOption=Vr,m.pageNavigator=D({},v,p);var x=this.mergeLegendCfg(m,a,l);x.reversed&&x.items.reverse();var S=T(x,"maxItemWidth");return S&&S<=1&&(x.maxItemWidth=this.view.viewBBox.width*S),x},r.prototype.mergeLegendCfg=function(t,e,n){var a=n.split("-")[0],o=qh(this.view.getTheme(),a);return D({},o,t,e)},r.prototype.getId=function(t){return"".concat(this.name,"-").concat(t)},r.prototype.getComponentById=function(t){return Ce(this.components,function(e){return e.id===t})},r.prototype.getCategoryLegendSizeCfg=function(t,e,n){e===void 0&&(e=hl),n===void 0&&(n=hl);var a=this.view.viewBBox,o=a.width,s=a.height;return t==="vertical"?{maxWidth:o*e,maxHeight:s}:{maxWidth:o,maxHeight:s*n}},r}(jr),SS=function(i){E(r,i);function r(t){var e=i.call(this,t)||this;return e.onChangeFn=Ye,e.resetMeasure=function(){e.clear()},e.onValueChange=function(n){var a=Y(n,2),o=a[0],s=a[1];e.start=o,e.end=s,e.changeViewData(o,s)},e.container=e.view.getLayer(st.FORE).addGroup(),e.onChangeFn=is(e.onValueChange,20,{leading:!0}),e.width=0,e.view.on(tt.BEFORE_CHANGE_DATA,e.resetMeasure),e.view.on(tt.BEFORE_CHANGE_SIZE,e.resetMeasure),e}return Object.defineProperty(r.prototype,"name",{get:function(){return"slider"},enumerable:!1,configurable:!0}),r.prototype.destroy=function(){i.prototype.destroy.call(this),this.view.off(tt.BEFORE_CHANGE_DATA,this.resetMeasure),this.view.off(tt.BEFORE_CHANGE_SIZE,this.resetMeasure)},r.prototype.init=function(){},r.prototype.render=function(){this.option=this.view.getOptions().slider;var t=this.getSliderCfg(),e=t.start,n=t.end;I(this.start)&&(this.start=e,this.end=n);var a=this.view.getOptions().data;this.option&&!pe(a)?this.slider?this.slider=this.updateSlider():(this.slider=this.createSlider(),this.slider.component.on("sliderchange",this.onChangeFn)):this.slider&&(this.slider.component.destroy(),this.slider=void 0)},r.prototype.layout=function(){var t=this;if(this.option&&!this.width&&(this.measureSlider(),setTimeout(function(){t.view.destroyed||t.changeViewData(t.start,t.end)},0)),this.slider){var e=this.view.coordinateBBox.width,n=this.slider.component.get("padding"),a=Y(n,4),o=a[0];a[1],a[2];var s=a[3],l=this.slider.component.getLayoutBBox(),h=new Bt(l.x,l.y,Math.min(l.width,e),l.height).expand(n),u=this.getMinMaxText(this.start,this.end),c=u.minText,f=u.maxText,v=Y(Ve(this.view.viewBBox,h,F.BOTTOM),2);v[0];var p=v[1],g=Y(Ve(this.view.coordinateBBox,h,F.BOTTOM),2),d=g[0];g[1],this.slider.component.update(w(w({},this.getSliderCfg()),{x:d+s,y:p+o,width:this.width,start:this.start,end:this.end,minText:c,maxText:f})),this.view.viewBBox=this.view.viewBBox.cut(h,F.BOTTOM)}},r.prototype.update=function(){this.render()},r.prototype.createSlider=function(){var t=this.getSliderCfg(),e=new hx(w({container:this.container},t));return e.init(),{component:e,layer:st.FORE,direction:F.BOTTOM,type:dt.SLIDER}},r.prototype.updateSlider=function(){var t=this.getSliderCfg();if(this.width){var e=this.getMinMaxText(this.start,this.end),n=e.minText,a=e.maxText;t=w(w({},t),{width:this.width,start:this.start,end:this.end,minText:n,maxText:a})}return this.slider.component.update(t),this.slider},r.prototype.measureSlider=function(){var t=this.getSliderCfg().width;this.width=t},r.prototype.getSliderCfg=function(){var t={height:16,start:0,end:1,minText:"",maxText:"",x:0,y:0,width:this.view.coordinateBBox.width};if(rt(this.option)){var e=w({data:this.getData()},T(this.option,"trendCfg",{}));t=D({},t,this.getThemeOptions(),this.option),t=w(w({},t),{trendCfg:e})}return t.start=at(Math.min(I(t.start)?0:t.start,I(t.end)?1:t.end),0,1),t.end=at(Math.max(I(t.start)?0:t.start,I(t.end)?1:t.end),0,1),t},r.prototype.getData=function(){var t=this.view.getOptions().data,e=Y(this.view.getYScales(),1),n=e[0],a=this.view.getGroupScales();if(a.length){var o=a[0],s=o.field,l=o.ticks;return t.reduce(function(h,u){return u[s]===l[0]&&h.push(u[n.field]),h},[])}return t.map(function(h){return h[n.field]||0})},r.prototype.getThemeOptions=function(){var t=this.view.getTheme();return T(t,["components","slider","common"],{})},r.prototype.getMinMaxText=function(t,e){var n=this.view.getOptions().data,a=this.view.getXScale(),o=Me(n,a.field);a.isLinear&&(o=o.sort());var s=o,l=Gt(n);if(!a||!l)return{};var h=Gt(s),u=Math.round(t*(h-1)),c=Math.round(e*(h-1)),f=T(s,[u]),v=T(s,[c]),p=this.getSliderCfg().formatter;return p&&(f=p(f,n[u],u),v=p(v,n[c],c)),{minText:f,maxText:v}},r.prototype.changeViewData=function(t,e){var n=this.view.getOptions().data,a=this.view.getXScale(),o=Gt(n);if(!(!a||!o)){var s=Me(n,a.field),l=this.view.getXScale().isLinear?s.sort(function(v,p){return Number(v)-Number(p)}):s,h=l,u=Gt(h),c=Math.round(t*(u-1)),f=Math.round(e*(u-1));this.view.filter(a.field,function(v,p){var g=h.indexOf(v);return g>-1?Er(g,c,f):!0}),this.view.render(!0)}},r.prototype.getComponents=function(){return this.slider?[this.slider]:[]},r.prototype.clear=function(){this.slider&&(this.slider.component.destroy(),this.slider=void 0),this.width=0,this.start=void 0,this.end=void 0},r}(jr),Tn=0,Eu=8,bS=32,AS=20,TS=function(i){E(r,i);function r(t){var e=i.call(this,t)||this;return e.onChangeFn=Ye,e.resetMeasure=function(){e.clear()},e.onValueChange=function(n){var a=n.ratio,o=e.getValidScrollbarCfg().animate;e.ratio=at(a,0,1);var s=e.view.getOptions().animate;o||e.view.animate(!1),e.changeViewData(e.getScrollRange(),!0),e.view.animate(s)},e.container=e.view.getLayer(st.FORE).addGroup(),e.onChangeFn=is(e.onValueChange,20,{leading:!0}),e.trackLen=0,e.thumbLen=0,e.ratio=0,e.view.on(tt.BEFORE_CHANGE_DATA,e.resetMeasure),e.view.on(tt.BEFORE_CHANGE_SIZE,e.resetMeasure),e}return Object.defineProperty(r.prototype,"name",{get:function(){return"scrollbar"},enumerable:!1,configurable:!0}),r.prototype.destroy=function(){i.prototype.destroy.call(this),this.view.off(tt.BEFORE_CHANGE_DATA,this.resetMeasure),this.view.off(tt.BEFORE_CHANGE_SIZE,this.resetMeasure)},r.prototype.init=function(){},r.prototype.render=function(){this.option=this.view.getOptions().scrollbar,this.option?this.scrollbar?this.scrollbar=this.updateScrollbar():(this.scrollbar=this.createScrollbar(),this.scrollbar.component.on("scrollchange",this.onChangeFn)):this.scrollbar&&(this.scrollbar.component.destroy(),this.scrollbar=void 0)},r.prototype.layout=function(){var t=this;if(this.option&&!this.trackLen&&(this.measureScrollbar(),setTimeout(function(){t.view.destroyed||t.changeViewData(t.getScrollRange(),!0)})),this.scrollbar){var e=this.view.coordinateBBox.width,n=this.scrollbar.component.get("padding"),a=this.scrollbar.component.getLayoutBBox(),o=new Bt(a.x,a.y,Math.min(a.width,e),a.height).expand(n),s=this.getScrollbarComponentCfg(),l=void 0,h=void 0;if(s.isHorizontal){var u=Y(Ve(this.view.viewBBox,o,F.BOTTOM),2);u[0];var c=u[1],f=Y(Ve(this.view.coordinateBBox,o,F.BOTTOM),2),v=f[0];f[1],l=v,h=c}else{var p=Y(Ve(this.view.viewBBox,o,F.RIGHT),2);p[0];var c=p[1],g=Y(Ve(this.view.viewBBox,o,F.RIGHT),2),v=g[0];g[1],l=v,h=c}l+=n[3],h+=n[0],this.trackLen?this.scrollbar.component.update(w(w({},s),{x:l,y:h,trackLen:this.trackLen,thumbLen:this.thumbLen,thumbOffset:(this.trackLen-this.thumbLen)*this.ratio})):this.scrollbar.component.update(w(w({},s),{x:l,y:h})),this.view.viewBBox=this.view.viewBBox.cut(o,s.isHorizontal?F.BOTTOM:F.RIGHT)}},r.prototype.update=function(){this.render()},r.prototype.getComponents=function(){return this.scrollbar?[this.scrollbar]:[]},r.prototype.clear=function(){this.scrollbar&&(this.scrollbar.component.destroy(),this.scrollbar=void 0),this.trackLen=0,this.thumbLen=0,this.ratio=0,this.cnt=0,this.step=0,this.data=void 0,this.xScaleCfg=void 0,this.yScalesCfg=[]},r.prototype.setValue=function(t){this.onValueChange({ratio:t})},r.prototype.getValue=function(){return this.ratio},r.prototype.getThemeOptions=function(){var t=this.view.getTheme();return T(t,["components","scrollbar","common"],{})},r.prototype.getScrollbarTheme=function(t){var e=T(this.view.getTheme(),["components","scrollbar"]),n=t||{},a=n.thumbHighlightColor,o=mt(n,["thumbHighlightColor"]);return{default:D({},T(e,["default","style"],{}),o),hover:D({},T(e,["hover","style"],{}),{thumbColor:a})}},r.prototype.measureScrollbar=function(){var t=this.view.getXScale(),e=this.view.getYScales().slice();this.data=this.getScrollbarData(),this.step=this.getStep(),this.cnt=this.getCnt();var n=this.getScrollbarComponentCfg(),a=n.trackLen,o=n.thumbLen;this.trackLen=a,this.thumbLen=o,this.xScaleCfg={field:t.field,values:t.values||[]},this.yScalesCfg=e},r.prototype.getScrollRange=function(){var t=Math.floor((this.cnt-this.step)*at(this.ratio,0,1)),e=Math.min(t+this.step-1,this.cnt-1);return[t,e]},r.prototype.changeViewData=function(t,e){var n=this,a=Y(t,2),o=a[0],s=a[1],l=this.getValidScrollbarCfg().type,h=l!=="vertical",u=Me(this.data,this.xScaleCfg.field),c=this.view.getXScale().isLinear?u.sort(function(v,p){return Number(v)-Number(p)}):u,f=h?c:c.reverse();this.yScalesCfg.forEach(function(v){n.view.scale(v.field,{formatter:v.formatter,type:v.type,min:v.min,max:v.max,tickMethod:v.tickMethod})}),this.view.filter(this.xScaleCfg.field,function(v){var p=f.indexOf(v);return p>-1?Er(p,o,s):!0}),this.view.render(!0)},r.prototype.createScrollbar=function(){var t=this.getValidScrollbarCfg().type,e=t!=="vertical",n=new cx(w(w({container:this.container},this.getScrollbarComponentCfg()),{x:0,y:0}));return n.init(),{component:n,layer:st.FORE,direction:e?F.BOTTOM:F.RIGHT,type:dt.SCROLLBAR}},r.prototype.updateScrollbar=function(){var t=this.getScrollbarComponentCfg(),e=this.trackLen?w(w({},t),{trackLen:this.trackLen,thumbLen:this.thumbLen,thumbOffset:(this.trackLen-this.thumbLen)*this.ratio}):w({},t);return this.scrollbar.component.update(e),this.scrollbar},r.prototype.getStep=function(){if(this.step)return this.step;var t=this.view.coordinateBBox,e=this.getValidScrollbarCfg(),n=e.type,a=e.categorySize,o=n!=="vertical";return Math.floor((o?t.width:t.height)/a)},r.prototype.getCnt=function(){if(this.cnt)return this.cnt;var t=this.view.getXScale(),e=this.getScrollbarData(),n=Me(e,t.field);return Gt(n)},r.prototype.getScrollbarComponentCfg=function(){var t=this.view,e=t.coordinateBBox,n=t.viewBBox,a=this.getValidScrollbarCfg(),o=a.type,s=a.padding,l=a.width,h=a.height,u=a.style,c=o!=="vertical",f=Y(s,4),v=f[0],p=f[1],g=f[2],d=f[3],y=c?{x:e.minX+d,y:n.maxY-h-g}:{x:n.maxX-l-p,y:e.minY+v},C=this.getStep(),m=this.getCnt(),x=c?e.width-d-p:e.height-v-g,S=Math.max(x*at(C/m,0,1),AS);return w(w({},this.getThemeOptions()),{x:y.x,y:y.y,size:c?h:l,isHorizontal:c,trackLen:x,thumbLen:S,thumbOffset:0,theme:this.getScrollbarTheme(u)})},r.prototype.getValidScrollbarCfg=function(){var t={type:"horizontal",categorySize:bS,width:Eu,height:Eu,padding:[0,0,0,0],animate:!0,style:{}};return rt(this.option)&&(t=w(w({},t),this.option)),(!rt(this.option)||!this.option.padding)&&(t.padding=t.type==="horizontal"?[Tn,0,Tn,0]:[0,Tn,0,Tn]),t},r.prototype.getScrollbarData=function(){var t=this.view.getCoordinate(),e=this.getValidScrollbarCfg(),n=this.view.getOptions().data||[];return t.isReflect("y")&&e.type==="vertical"&&(n=et([],Y(n),!1).reverse()),n},r}(jr),LS={fill:"#CCD6EC",opacity:.3};function ES(i,r,t){var e,n,a,o,s,l,h=cw(i,r,t);if(h.length){h=$t(h);try{for(var u=$(h),c=u.next();!c.done;c=u.next()){var f=c.value;try{for(var v=(a=void 0,$(f)),p=v.next();!p.done;p=v.next()){var g=p.value,d=g.mappingData,y=d.x,C=d.y;g.x=P(y)?y[y.length-1]:y,g.y=P(C)?C[C.length-1]:C}}catch(B){a={error:B}}finally{try{p&&!p.done&&(o=v.return)&&o.call(v)}finally{if(a)throw a.error}}}}catch(B){e={error:B}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}var m=t.shared;if(m===!1&&h.length>1){var x=h[0],S=Math.abs(r.y-x[0].y);try{for(var b=$(h),A=b.next();!A.done;A=b.next()){var L=A.value,k=Math.abs(r.y-L[0].y);k<=S&&(x=L,S=k)}}catch(B){s={error:B}}finally{try{A&&!A.done&&(l=b.return)&&l.call(b)}finally{if(s)throw s.error}}h=[x]}return Hu($t(h))}return[]}var BS=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.show=function(t){var e=this.context.view,n=this.context.event,a=e.getController("tooltip").getTooltipCfg(),o=ES(e,{x:n.x,y:n.y},a);if(!gt(o,this.items)&&(this.items=o,o.length)){var s=e.getXScale().field,l=o[0].data[s],h=[],u=e.geometries;if(M(u,function(ht){if(ht.type==="interval"||ht.type==="schema"){var Q=ht.getElementsBy(function(ut){var vt=ut.getData();return vt[s]===l});h=h.concat(Q)}}),h.length){var c=e.getCoordinate(),f=h[0].shape.getCanvasBBox(),v=h[0].shape.getCanvasBBox(),p=f;M(h,function(ht){var Q=ht.shape.getCanvasBBox();c.isTransposed?(Q.minYv.maxY&&(v=Q)):(Q.minXv.maxX&&(v=Q)),p.x=Math.min(Q.minX,p.minX),p.y=Math.min(Q.minY,p.minY),p.width=Math.max(Q.maxX,p.maxX)-p.x,p.height=Math.max(Q.maxY,p.maxY)-p.y});var g=e.backgroundGroup,d=e.coordinateBBox,y=void 0;if(c.isRect){var C=e.getXScale(),m=t||{},x=m.appendRatio,S=m.appendWidth;I(S)&&(x=I(x)?C.isLinear?0:.25:x,S=c.isTransposed?x*v.height:x*f.width);var b=void 0,A=void 0,L=void 0,k=void 0;c.isTransposed?(b=d.minX,A=Math.min(v.minY,f.minY)-S,L=d.width,k=p.height+S*2):(b=Math.min(f.minX,v.minX)-S,A=d.minY,L=p.width+S*2,k=d.height),y=[["M",b,A],["L",b+L,A],["L",b+L,A+k],["L",b,A+k],["Z"]]}else{var B=zt(h),O=Ct(h),R=_n(B.getModel(),c).startAngle,H=_n(O.getModel(),c).endAngle,z=c.getCenter(),_=c.getRadius(),K=c.innerRadius*_;y=ur(z.x,z.y,_,R,H,K)}if(this.regionPath)this.regionPath.attr("path",y),this.regionPath.show();else{var nt=T(t,"style",LS);this.regionPath=g.addShape({type:"path",name:"active-region",capture:!1,attrs:w(w({},nt),{path:y})})}}}},r.prototype.hide=function(){this.regionPath&&this.regionPath.hide(),this.items=null},r.prototype.destroy=function(){this.hide(),this.regionPath&&this.regionPath.remove(!0),i.prototype.destroy.call(this)},r}(yt),$v=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.timeStamp=0,t}return r.prototype.show=function(){var t=this.context,e=t.event,n=t.view,a=n.isTooltipLocked();if(!a){var o=this.timeStamp,s=+new Date,l=T(t.view.getOptions(),"tooltip.showDelay",16);if(s-o>l){var h=this.location,u={x:e.x,y:e.y};(!h||!gt(h,u))&&this.showTooltip(n,u),this.timeStamp=s,this.location=u}}},r.prototype.hide=function(){var t=this.context.view,e=t.getController("tooltip"),n=this.context.event,a=n.clientX,o=n.clientY;e.isCursorEntered({x:a,y:o})||t.isTooltipLocked()||(this.hideTooltip(t),this.location=null)},r.prototype.showTooltip=function(t,e){t.showTooltip(e)},r.prototype.hideTooltip=function(t){t.hideTooltip()},r}(yt),kS=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.showTooltip=function(t,e){var n=ve(t);M(n,function(a){var o=Xo(t,a,e);a.showTooltip(o)})},r.prototype.hideTooltip=function(t){var e=ve(t);M(e,function(n){n.hideTooltip()})},r}($v),IS=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.timeStamp=0,t}return r.prototype.destroy=function(){i.prototype.destroy.call(this),this.tooltip&&this.tooltip.destroy()},r.prototype.show=function(){var t=this.context,e=t.event,n=this.timeStamp,a=+new Date;if(a-n>16){var o=this.location,s={x:e.x,y:e.y};(!o||!gt(o,s))&&this.showTooltip(s),this.timeStamp=a,this.location=s}},r.prototype.hide=function(){this.hideTooltip(),this.location=null},r.prototype.showTooltip=function(t){var e=this.context,n=e.event,a=n.target;if(a&&a.get("tip")){this.tooltip||this.renderTooltip();var o=a.get("tip");this.tooltip.update(w({title:o},t)),this.tooltip.show()}},r.prototype.hideTooltip=function(){this.tooltip&&this.tooltip.hide()},r.prototype.renderTooltip=function(){var t,e=this.context.view,n=e.canvas,a={start:{x:0,y:0},end:{x:n.get("width"),y:n.get("height")}},o=e.getTheme(),s=T(o,["components","tooltip","domStyles"],{}),l=new Ea({parent:n.get("el").parentNode,region:a,visible:!1,crosshairs:null,domStyles:w({},D({},s,(t={},t[Se]={"max-width":"50%"},t[be]={"word-break":"break-all"},t)))});l.init(),l.setCapture(!1),this.tooltip=l},r}(yt),Ks=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.stateName="",t}return r.prototype.hasState=function(t){return t.hasState(this.stateName)},r.prototype.setElementState=function(t,e){t.setState(this.stateName,e)},r.prototype.setState=function(){this.setStateEnable(!0)},r.prototype.clear=function(){var t=this.context.view;this.clearViewState(t)},r.prototype.clearViewState=function(t){var e=this,n=Wf(t,this.stateName);M(n,function(a){e.setElementState(a,!1)})},r}(yt);function Bu(i){return T(i.get("delegateObject"),"item")}var Js=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.ignoreListItemStates=["unchecked"],t}return r.prototype.isItemIgnore=function(t,e){var n=this.ignoreListItemStates,a=n.filter(function(o){return e.hasState(t,o)});return!!a.length},r.prototype.setStateByComponent=function(t,e,n){var a=this.context.view,o=t.get("field"),s=Mt(a);this.setElementsStateByItem(s,o,e,n)},r.prototype.setStateByElement=function(t,e){this.setElementState(t,e)},r.prototype.isMathItem=function(t,e,n){var a=this.context.view,o=Hr(a,e),s=ae(t,e);return!I(s)&&n.name===o.getText(s)},r.prototype.setElementsStateByItem=function(t,e,n,a){var o=this;M(t,function(s){o.isMathItem(s,e,n)&&s.setState(o.stateName,a)})},r.prototype.setStateEnable=function(t){var e=_e(this.context);if(e)Nf(this.context)&&this.setStateByElement(e,t);else{var n=Gr(this.context);if(Ri(n)){var a=n.item,o=n.component;if(a&&o&&!this.isItemIgnore(a,o)){var s=this.context.event.gEvent;if(s&&s.fromShape&&s.toShape&&Bu(s.fromShape)===Bu(s.toShape))return;this.setStateByComponent(o,a,t)}}}},r.prototype.toggle=function(){var t=_e(this.context);if(t){var e=t.hasState(this.stateName);this.setElementState(t,!e)}},r.prototype.reset=function(){this.setStateEnable(!1)},r}(Ks),PS=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.stateName="active",t}return r.prototype.active=function(){this.setState()},r}(Js),FS=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.cache={},t}return r.prototype.getColorScale=function(t,e){var n=e.geometry.getAttribute("color");if(!n)return null;var a=t.getScaleByField(n.getFields()[0]);return a},r.prototype.getLinkPath=function(t,e){var n=this.context.view,a=n.getCoordinate().isTransposed,o=t.shape.getCanvasBBox(),s=e.shape.getCanvasBBox(),l=a?[["M",o.minX,o.minY],["L",s.minX,s.maxY],["L",s.maxX,s.maxY],["L",o.maxX,o.minY],["Z"]]:[["M",o.maxX,o.minY],["L",s.minX,s.minY],["L",s.minX,s.maxY],["L",o.maxX,o.maxY],["Z"]];return l},r.prototype.addLinkShape=function(t,e,n,a){var o={opacity:.4,fill:e.shape.attr("fill")};t.addShape({type:"path",attrs:w(w({},D({},o,G(a)?a(o,e):a)),{path:this.getLinkPath(e,n)})})},r.prototype.linkByElement=function(t,e){var n=this,a=this.context.view,o=this.getColorScale(a,t);if(!!o){var s=ae(t,o.field);if(!this.cache[s]){var l=Xx(a,o.field,s),h=this.linkGroup,u=h.addGroup();this.cache[s]=u;var c=l.length;M(l,function(f,v){if(v=0},e)},r}(tl),GS=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.stateName="active",t}return r.prototype.highlight=function(){this.setState()},r.prototype.setElementState=function(t,e){var n=this.context.view,a=Mt(n);_v(a,function(o){return t===o},e)},r.prototype.clear=function(){var t=this.context.view;rl(t)},r}(el),HS=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.stateName="selected",t}return r.prototype.selected=function(){this.setState()},r}(tl),VS=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.stateName="selected",t}return r.prototype.selected=function(){this.setState()},r}(Js),NS=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.stateName="selected",t}return r.prototype.selected=function(){this.setState()},r}(el),yr=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.stateName="",t.ignoreItemStates=[],t}return r.prototype.getTriggerListInfo=function(){var t=Gr(this.context),e=null;return Ri(t)&&(e={item:t.item,list:t.component}),e},r.prototype.getAllowComponents=function(){var t=this,e=this.context.view,n=$f(e),a=[];return M(n,function(o){o.isList()&&t.allowSetStateByElement(o)&&a.push(o)}),a},r.prototype.hasState=function(t,e){return t.hasState(e,this.stateName)},r.prototype.clearAllComponentsState=function(){var t=this,e=this.getAllowComponents();M(e,function(n){n.clearItemsState(t.stateName)})},r.prototype.allowSetStateByElement=function(t){var e=t.get("field");if(!e)return!1;if(this.cfg&&this.cfg.componentNames){var n=t.get("name");if(this.cfg.componentNames.indexOf(n)===-1)return!1}var a=this.context.view,o=Hr(a,e);return o&&o.isCategory},r.prototype.allowSetStateByItem=function(t,e){var n=this.ignoreItemStates;if(n.length){var a=n.filter(function(o){return e.hasState(t,o)});return a.length===0}return!0},r.prototype.setStateByElement=function(t,e,n){var a=t.get("field"),o=this.context.view,s=Hr(o,a),l=ae(e,a),h=s.getText(l);this.setItemsState(t,h,n)},r.prototype.setStateEnable=function(t){var e=this,n=_e(this.context);if(n){var a=this.getAllowComponents();M(a,function(h){e.setStateByElement(h,n,t)})}else{var o=Gr(this.context);if(Ri(o)){var s=o.item,l=o.component;this.allowSetStateByElement(l)&&this.allowSetStateByItem(s,l)&&this.setItemState(l,s,t)}}},r.prototype.setItemsState=function(t,e,n){var a=this,o=t.getItems();M(o,function(s){s.name===e&&a.setItemState(t,s,n)})},r.prototype.setItemState=function(t,e,n){t.setItemState(e,this.stateName,n)},r.prototype.setState=function(){this.setStateEnable(!0)},r.prototype.reset=function(){this.setStateEnable(!1)},r.prototype.toggle=function(){var t=this.getTriggerListInfo();if(t&&t.item){var e=t.list,n=t.item,a=this.hasState(e,n);this.setItemState(e,n,!a)}},r.prototype.clear=function(){var t=this.getTriggerListInfo();t?t.list.clearItemsState(this.stateName):this.clearAllComponentsState()},r}(yt),XS=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.stateName="active",t}return r.prototype.active=function(){this.setState()},r}(yr),ku="inactive",Iu="active";function zS(i){var r=i.getItems();M(r,function(t){i.hasState(t,Iu)&&i.setItemState(t,Iu,!1),i.hasState(t,ku)&&i.setItemState(t,ku,!1)})}var ni="inactive",Je="active",nl=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.stateName=Je,t.ignoreItemStates=["unchecked"],t}return r.prototype.setItemsState=function(t,e,n){this.setHighlightBy(t,function(a){return a.name===e},n)},r.prototype.setItemState=function(t,e,n){t.getItems(),this.setHighlightBy(t,function(a){return a===e},n)},r.prototype.setHighlightBy=function(t,e,n){var a=t.getItems();if(n)M(a,function(l){e(l)?(t.hasState(l,ni)&&t.setItemState(l,ni,!1),t.setItemState(l,Je,!0)):t.hasState(l,Je)||t.setItemState(l,ni,!0)});else{var o=t.getItemsByState(Je),s=!0;M(o,function(l){if(!e(l))return s=!1,!1}),s?this.clear():M(a,function(l){e(l)&&(t.hasState(l,Je)&&t.setItemState(l,Je,!1),t.setItemState(l,ni,!0))})}},r.prototype.highlight=function(){this.setState()},r.prototype.clear=function(){var t=this.getTriggerListInfo();if(t)zS(t.list);else{var e=this.getAllowComponents();M(e,function(n){n.clearItemsState(Je),n.clearItemsState(ni)})}},r}(yr),WS=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.stateName="selected",t}return r.prototype.selected=function(){this.setState()},r}(yr),$S=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.stateName="unchecked",t}return r.prototype.unchecked=function(){this.setState()},r}(yr),Cr="unchecked",Ln="checked",_S=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.stateName=Ln,t}return r.prototype.setItemState=function(t,e,n){this.setCheckedBy(t,function(a){return a===e},n)},r.prototype.setCheckedBy=function(t,e,n){var a=t.getItems();n&&M(a,function(o){e(o)?(t.hasState(o,Cr)&&t.setItemState(o,Cr,!1),t.setItemState(o,Ln,!0)):t.hasState(o,Ln)||t.setItemState(o,Cr,!0)})},r.prototype.toggle=function(){var t=this.getTriggerListInfo();if(t&&t.item){var e=t.list,n=t.item,a=!ea(e.getItems(),function(o){return e.hasState(o,Cr)});a||e.hasState(n,Cr)?this.setItemState(e,n,!0):this.reset()}},r.prototype.checked=function(){this.setState()},r.prototype.reset=function(){var t=this.getAllowComponents();M(t,function(e){e.clearItemsState(Ln),e.clearItemsState(Cr)})},r}(yr),Mr="unchecked",jS=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.toggle=function(){var t,e,n,a,o,s,l,h,u=this.getTriggerListInfo();if(u!=null&&u.item){var c=u.list,f=u.item,v=c.getItems(),p=v.filter(function(B){return!c.hasState(B,Mr)}),g=v.filter(function(B){return c.hasState(B,Mr)}),d=p[0];if(v.length===p.length)try{for(var y=$(v),C=y.next();!C.done;C=y.next()){var m=C.value;c.setItemState(m,Mr,m.id!==f.id)}}catch(B){t={error:B}}finally{try{C&&!C.done&&(e=y.return)&&e.call(y)}finally{if(t)throw t.error}}else if(v.length-g.length===1)if(d.id===f.id)try{for(var x=$(v),S=x.next();!S.done;S=x.next()){var m=S.value;c.setItemState(m,Mr,!1)}}catch(B){n={error:B}}finally{try{S&&!S.done&&(a=x.return)&&a.call(x)}finally{if(n)throw n.error}}else try{for(var b=$(v),A=b.next();!A.done;A=b.next()){var m=A.value;c.setItemState(m,Mr,m.id!==f.id)}}catch(B){o={error:B}}finally{try{A&&!A.done&&(s=b.return)&&s.call(b)}finally{if(o)throw o.error}}else try{for(var L=$(v),k=L.next();!k.done;k=L.next()){var m=k.value;c.setItemState(m,Mr,m.id!==f.id)}}catch(B){l={error:B}}finally{try{k&&!k.done&&(h=L.return)&&h.call(L)}finally{if(l)throw l.error}}}},r}(yr),Pu="showRadio",co="legend-radio-tip",US=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.timeStamp=0,t}return r.prototype.show=function(){var t=this.getTriggerListInfo();if(t!=null&&t.item){var e=t.list,n=t.item;e.setItemState(n,Pu,!0)}},r.prototype.hide=function(){var t=this.getTriggerListInfo();if(t!=null&&t.item){var e=t.list,n=t.item;e.setItemState(n,Pu,!1)}},r.prototype.destroy=function(){i.prototype.destroy.call(this),this.tooltip&&this.tooltip.destroy()},r.prototype.showTip=function(){var t=this.context,e=t.event,n=this.timeStamp,a=+new Date,o=this.context.event.target;if(a-n>16&&o.get("name")==="legend-item-radio"){var s=this.location,l={x:e.x,y:e.y};this.timeStamp=a,this.location=l,(!s||!gt(s,l))&&this.showTooltip(l)}},r.prototype.hideTip=function(){this.hideTooltip(),this.location=null},r.prototype.showTooltip=function(t){var e=this.context,n=e.event,a=n.target;if(a&&a.get("tip")){this.tooltip||this.renderTooltip();var o=e.view.getCanvas().get("el").getBoundingClientRect(),s=o.x,l=o.y;this.tooltip.update(w(w({title:a.get("tip")},t),{x:t.x+s,y:t.y+l})),this.tooltip.show()}},r.prototype.hideTooltip=function(){this.tooltip&&this.tooltip.hide()},r.prototype.renderTooltip=function(){var t,e=(t={},t[Se]={padding:"6px 8px",transform:"translate(-50%, -80%)",background:"rgba(0,0,0,0.75)",color:"#fff","border-radius":"2px","z-index":100},t[be]={"font-size":"12px","line-height":"14px","margin-bottom":0,"word-break":"break-all"},t);document.getElementById(co)&&document.body.removeChild(document.getElementById(co));var n=new Ea({parent:document.body,region:null,visible:!1,crosshairs:null,domStyles:e,containerId:co});n.init(),n.setCapture(!1),this.tooltip=n},r}(yr),al=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.maskShape=null,t.points=[],t.starting=!1,t.moving=!1,t.preMovePoint=null,t.shapeType="path",t}return r.prototype.getCurrentPoint=function(){var t=this.context.event;return{x:t.x,y:t.y}},r.prototype.emitEvent=function(t){var e="mask:".concat(t),n=this.context.view,a=this.context.event;n.emit(e,{target:this.maskShape,shape:this.maskShape,points:this.points,x:a.x,y:a.y})},r.prototype.createMask=function(){var t=this.context.view,e=this.getMaskAttrs(),n=t.foregroundGroup.addShape({type:this.shapeType,name:"mask",draggable:!0,attrs:w({fill:"#C5D4EB",opacity:.3},e)});return n},r.prototype.getMaskPath=function(){return[]},r.prototype.show=function(){this.maskShape&&(this.maskShape.show(),this.emitEvent("show"))},r.prototype.start=function(t){this.starting=!0,this.moving=!1,this.points=[this.getCurrentPoint()],this.maskShape||(this.maskShape=this.createMask(),this.maskShape.set("capture",!1)),this.updateMask(t==null?void 0:t.maskStyle),this.emitEvent("start")},r.prototype.moveStart=function(){this.moving=!0,this.preMovePoint=this.getCurrentPoint()},r.prototype.move=function(){if(!(!this.moving||!this.maskShape)){var t=this.getCurrentPoint(),e=this.preMovePoint,n=t.x-e.x,a=t.y-e.y,o=this.points;M(o,function(s){s.x+=n,s.y+=a}),this.updateMask(),this.emitEvent("change"),this.preMovePoint=t}},r.prototype.updateMask=function(t){var e=D({},this.getMaskAttrs(),t);this.maskShape.attr(e)},r.prototype.moveEnd=function(){this.moving=!1,this.preMovePoint=null},r.prototype.end=function(){this.starting=!1,this.emitEvent("end"),this.maskShape&&this.maskShape.set("capture",!0)},r.prototype.hide=function(){this.maskShape&&(this.maskShape.hide(),this.emitEvent("hide"))},r.prototype.resize=function(){this.starting&&this.maskShape&&(this.points.push(this.getCurrentPoint()),this.updateMask(),this.emitEvent("change"))},r.prototype.destroy=function(){this.points=[],this.maskShape&&this.maskShape.remove(),this.maskShape=null,this.preMovePoint=null,i.prototype.destroy.call(this)},r}(yt),qS=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.shapeType="circle",t}return r.prototype.getMaskAttrs=function(){var t=this.points,e=Ct(this.points),n=0,a=0,o=0;if(t.length){var s=t[0];n=ks(s,e)/2,a=(e.x+s.x)/2,o=(e.y+s.y)/2}return{x:a,y:o,r:n}},r}(al),Uv=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.shapeType="rect",t}return r.prototype.getRegion=function(){var t=this.points;return{start:zt(t),end:Ct(t)}},r.prototype.getMaskAttrs=function(){var t=this.getRegion(),e=t.start,n=t.end,a=Math.min(e.x,n.x),o=Math.min(e.y,n.y),s=Math.abs(n.x-e.x),l=Math.abs(n.y-e.y);return{x:a,y:o,width:s,height:l}},r}(al);function Fu(i){i.x=at(i.x,0,1),i.y=at(i.y,0,1)}var qv=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.dim="x",t.inPlot=!0,t}return r.prototype.getRegion=function(){var t=null,e=null,n=this.points,a=this.dim,o=this.context.view.getCoordinate(),s=o.invert(zt(n)),l=o.invert(Ct(n));return this.inPlot&&(Fu(s),Fu(l)),a==="x"?(t=o.convert({x:s.x,y:0}),e=o.convert({x:l.x,y:1})):(t=o.convert({x:0,y:s.y}),e=o.convert({x:1,y:l.y})),{start:t,end:e}},r}(Uv),Zv=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getMaskPath=function(){var t=this.points,e=[];return t.length&&(M(t,function(n,a){a===0?e.push(["M",n.x,n.y]):e.push(["L",n.x,n.y])}),e.push(["L",t[0].x,t[0].y])),e},r.prototype.getMaskAttrs=function(){return{path:this.getMaskPath()}},r.prototype.addPoint=function(){this.resize()},r}(al),ZS=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getMaskPath=function(){var t=this.points;return $x(t,!0)},r}(Zv),QS=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.setCursor=function(t){var e=this.context.view;e.getCanvas().setCursor(t)},r.prototype.default=function(){this.setCursor("default")},r.prototype.pointer=function(){this.setCursor("pointer")},r.prototype.move=function(){this.setCursor("move")},r.prototype.crosshair=function(){this.setCursor("crosshair")},r.prototype.wait=function(){this.setCursor("wait")},r.prototype.help=function(){this.setCursor("help")},r.prototype.text=function(){this.setCursor("text")},r.prototype.eResize=function(){this.setCursor("e-resize")},r.prototype.wResize=function(){this.setCursor("w-resize")},r.prototype.nResize=function(){this.setCursor("n-resize")},r.prototype.sResize=function(){this.setCursor("s-resize")},r.prototype.neResize=function(){this.setCursor("ne-resize")},r.prototype.nwResize=function(){this.setCursor("nw-resize")},r.prototype.seResize=function(){this.setCursor("se-resize")},r.prototype.swResize=function(){this.setCursor("sw-resize")},r.prototype.nsResize=function(){this.setCursor("ns-resize")},r.prototype.ewResize=function(){this.setCursor("ew-resize")},r.prototype.zoomIn=function(){this.setCursor("zoom-in")},r.prototype.zoomOut=function(){this.setCursor("zoom-out")},r}(yt),KS=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.filterView=function(t,e,n){var a=this;t.getScaleByField(e)&&t.filter(e,n),t.views&&t.views.length&&M(t.views,function(o){a.filterView(o,e,n)})},r.prototype.filter=function(){var t=Gr(this.context);if(t){var e=this.context.view,n=t.component,a=n.get("field");if(Ri(t)){if(a){var o=n.getItemsByState("unchecked"),s=Hr(e,a),l=o.map(function(v){return v.name});l.length?this.filterView(e,a,function(v){var p=s.getText(v);return!l.includes(p)}):this.filterView(e,a,null),e.render(!0)}}else if(Xf(t)){var h=n.getValue(),u=Y(h,2),c=u[0],f=u[1];this.filterView(e,a,function(v){return v>=c&&v<=f}),e.render(!0)}}},r}(yt);function Ou(i,r,t,e){var n=Math.min(t[r],e[r]),a=Math.max(t[r],e[r]),o=Y(i.range,2),s=o[0],l=o[1];if(nl&&(a=l),n===l&&a===l)return null;var h=i.invert(n),u=i.invert(a);if(i.isCategory){var c=i.values.indexOf(h),f=i.values.indexOf(u),v=i.values.slice(c,f+1);return function(p){return v.includes(p)}}else return function(p){return p>=h&&p<=u}}var jt;(function(i){i.FILTER="brush-filter-processing",i.RESET="brush-filter-reset",i.BEFORE_FILTER="brush-filter:beforefilter",i.AFTER_FILTER="brush-filter:afterfilter",i.BEFORE_RESET="brush-filter:beforereset",i.AFTER_RESET="brush-filter:afterreset"})(jt||(jt={}));var Fa=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.dims=["x","y"],t.startPoint=null,t.isStarted=!1,t}return r.prototype.hasDim=function(t){return this.dims.includes(t)},r.prototype.start=function(){var t=this.context;this.isStarted=!0,this.startPoint=t.getCurrentPoint()},r.prototype.filter=function(){var t,e;if(Yi(this.context)){var n=this.context.event.target,a=n.getCanvasBBox();t={x:a.x,y:a.y},e={x:a.maxX,y:a.maxY}}else{if(!this.isStarted)return;t=this.startPoint,e=this.context.getCurrentPoint()}if(!(Math.abs(t.x-e.x)<5||Math.abs(t.x-e.y)<5)){var o=this.context,s=o.view,l=o.event,h={view:s,event:l,dims:this.dims};s.emit(jt.BEFORE_FILTER,At.fromData(s,jt.BEFORE_FILTER,h));var u=s.getCoordinate(),c=u.invert(e),f=u.invert(t);if(this.hasDim("x")){var v=s.getXScale(),p=Ou(v,"x",c,f);this.filterView(s,v.field,p)}if(this.hasDim("y")){var g=s.getYScales()[0],p=Ou(g,"y",c,f);this.filterView(s,g.field,p)}this.reRender(s,{source:jt.FILTER}),s.emit(jt.AFTER_FILTER,At.fromData(s,jt.AFTER_FILTER,h))}},r.prototype.end=function(){this.isStarted=!1},r.prototype.reset=function(){var t=this.context.view;if(t.emit(jt.BEFORE_RESET,At.fromData(t,jt.BEFORE_RESET,{})),this.isStarted=!1,this.hasDim("x")){var e=t.getXScale();this.filterView(t,e.field,null)}if(this.hasDim("y")){var n=t.getYScales()[0];this.filterView(t,n.field,null)}this.reRender(t,{source:jt.RESET}),t.emit(jt.AFTER_RESET,At.fromData(t,jt.AFTER_RESET,{}))},r.prototype.filterView=function(t,e,n){t.filter(e,n)},r.prototype.reRender=function(t,e){t.render(!0,e)},r}(yt),ol=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.filterView=function(t,e,n){var a=ve(t);M(a,function(o){o.filter(e,n)})},r.prototype.reRender=function(t){var e=ve(t);M(e,function(n){n.render(!0)})},r}(Fa),JS=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.filter=function(){var t=Gr(this.context),e=this.context.view,n=Mt(e);if(Yi(this.context)){var a=Es(this.context,10);a&&M(n,function(g){a.includes(g)?g.show():g.hide()})}else if(t){var o=t.component,s=o.get("field");if(Ri(t)){if(s){var l=o.getItemsByState("unchecked"),h=Hr(e,s),u=l.map(function(g){return g.name});M(n,function(g){var d=ae(g,s),y=h.getText(d);u.indexOf(y)>=0?g.hide():g.show()})}}else if(Xf(t)){var c=o.getValue(),f=Y(c,2),v=f[0],p=f[1];M(n,function(g){var d=ae(g,s);d>=v&&d<=p?g.show():g.hide()})}}},r.prototype.clear=function(){var t=Mt(this.context.view);M(t,function(e){e.show()})},r.prototype.reset=function(){this.clear()},r}(yt),Qv=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.byRecord=!1,t}return r.prototype.filter=function(){Yi(this.context)&&(this.byRecord?this.filterByRecord():this.filterByBBox())},r.prototype.filterByRecord=function(){var t=this.context.view,e=Es(this.context,10);if(!!e){var n=t.getXScale().field,a=t.getYScales()[0].field,o=e.map(function(l){return l.getModel().data}),s=ve(t);M(s,function(l){var h=Mt(l);M(h,function(u){var c=u.getModel().data;_f(o,c,n,a)?u.show():u.hide()})})}},r.prototype.filterByBBox=function(){var t=this,e=this.context.view,n=ve(e);M(n,function(a){var o=zf(t.context,a,10),s=Mt(a);o&&M(s,function(l){o.includes(l)?l.show():l.hide()})})},r.prototype.reset=function(){var t=ve(this.context.view);M(t,function(e){var n=Mt(e);M(n,function(a){a.show()})})},r}(yt),tb=10,eb=5,rb=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.buttonGroup=null,t.buttonCfg={name:"button",text:"button",textStyle:{x:0,y:0,fontSize:12,fill:"#333333",cursor:"pointer"},padding:[8,10],style:{fill:"#f7f7f7",stroke:"#cccccc",cursor:"pointer"},activeStyle:{fill:"#e6e6e6"}},t}return r.prototype.getButtonCfg=function(){return D(this.buttonCfg,this.cfg)},r.prototype.drawButton=function(){var t=this.getButtonCfg(),e=this.context.view.foregroundGroup.addGroup({name:t.name}),n=e.addShape({type:"text",name:"button-text",attrs:w({text:t.text},t.textStyle)}),a=n.getBBox(),o=Is(t.padding),s=e.addShape({type:"rect",name:"button-rect",attrs:w({x:a.x-o[3],y:a.y-o[0],width:a.width+o[1]+o[3],height:a.height+o[0]+o[2]},t.style)});s.toBack(),e.on("mouseenter",function(){s.attr(t.activeStyle)}),e.on("mouseleave",function(){s.attr(t.style)}),this.buttonGroup=e},r.prototype.resetPosition=function(){var t=this.context.view,e=t.getCoordinate(),n=e.convert({x:1,y:1}),a=this.buttonGroup,o=a.getBBox(),s=ct(null,[["t",n.x-o.width-tb,n.y+o.height+eb]]);a.setMatrix(s)},r.prototype.show=function(){this.buttonGroup||this.drawButton(),this.resetPosition(),this.buttonGroup.show()},r.prototype.hide=function(){this.buttonGroup&&this.buttonGroup.hide()},r.prototype.destroy=function(){var t=this.buttonGroup;t&&t.remove(),i.prototype.destroy.call(this)},r}(yt),ib=4,nb=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.starting=!1,t.dragStart=!1,t}return r.prototype.start=function(){this.starting=!0,this.startPoint=this.context.getCurrentPoint()},r.prototype.drag=function(){if(!!this.startPoint){var t=this.context.getCurrentPoint(),e=this.context.view,n=this.context.event;this.dragStart?e.emit("drag",{target:n.target,x:n.x,y:n.y}):ks(t,this.startPoint)>ib&&(e.emit("dragstart",{target:n.target,x:n.x,y:n.y}),this.dragStart=!0)}},r.prototype.end=function(){if(this.dragStart){var t=this.context.view,e=this.context.event;t.emit("dragend",{target:e.target,x:e.x,y:e.y})}this.starting=!1,this.dragStart=!1},r}(yt),ab=5,ob=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.starting=!1,t.isMoving=!1,t.startPoint=null,t.startMatrix=null,t}return r.prototype.start=function(){this.starting=!0,this.startPoint=this.context.getCurrentPoint(),this.startMatrix=this.context.view.middleGroup.getMatrix()},r.prototype.move=function(){if(!!this.starting){var t=this.startPoint,e=this.context.getCurrentPoint(),n=ks(t,e);if(n>ab&&!this.isMoving&&(this.isMoving=!0),this.isMoving){var a=this.context.view,o=ct(this.startMatrix,[["t",e.x-t.x,e.y-t.y]]);a.backgroundGroup.setMatrix(o),a.foregroundGroup.setMatrix(o),a.middleGroup.setMatrix(o)}}},r.prototype.end=function(){this.isMoving&&(this.isMoving=!1),this.startMatrix=null,this.starting=!1,this.startPoint=null},r.prototype.reset=function(){this.starting=!1,this.startPoint=null,this.isMoving=!1;var t=this.context.view;t.backgroundGroup.resetMatrix(),t.foregroundGroup.resetMatrix(),t.middleGroup.resetMatrix(),this.isMoving=!1},r}(yt),Du="x",Ru="y",Kv=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.dims=[Du,Ru],t.cfgFields=["dims"],t.cacheScaleDefs={},t}return r.prototype.hasDim=function(t){return this.dims.includes(t)},r.prototype.getScale=function(t){var e=this.context.view;return t==="x"?e.getXScale():e.getYScales()[0]},r.prototype.resetDim=function(t){var e=this.context.view;if(this.hasDim(t)&&this.cacheScaleDefs[t]){var n=this.getScale(t);e.scale(n.field,this.cacheScaleDefs[t]),this.cacheScaleDefs[t]=null}},r.prototype.reset=function(){this.resetDim(Du),this.resetDim(Ru);var t=this.context.view;t.render(!0)},r}(yt),sb=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.startPoint=null,t.starting=!1,t.startCache={},t}return r.prototype.start=function(){var t=this;this.startPoint=this.context.getCurrentPoint(),this.starting=!0;var e=this.dims;M(e,function(n){var a=t.getScale(n),o=a.min,s=a.max,l=a.values;t.startCache[n]={min:o,max:s,values:l}})},r.prototype.end=function(){this.startPoint=null,this.starting=!1,this.startCache={}},r.prototype.translate=function(){var t=this;if(!!this.starting){var e=this.startPoint,n=this.context.view.getCoordinate(),a=this.context.getCurrentPoint(),o=n.invert(e),s=n.invert(a),l=s.x-o.x,h=s.y-o.y,u=this.context.view,c=this.dims;M(c,function(f){t.translateDim(f,{x:l*-1,y:h*-1})}),u.render(!0)}},r.prototype.translateDim=function(t,e){if(this.hasDim(t)){var n=this.getScale(t);n.isLinear&&this.translateLinear(t,n,e)}},r.prototype.translateLinear=function(t,e,n){var a=this.context.view,o=this.startCache[t],s=o.min,l=o.max,h=l-s,u=n[t]*h;this.cacheScaleDefs[t]||(this.cacheScaleDefs[t]={nice:e.nice,min:s,max:l}),a.scale(e.field,{nice:!1,min:s+u,max:l+u})},r.prototype.reset=function(){i.prototype.reset.call(this),this.startPoint=null,this.starting=!1},r}(Kv),lb=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.zoomRatio=.05,t}return r.prototype.zoomIn=function(){this.zoom(this.zoomRatio)},r.prototype.zoom=function(t){var e=this,n=this.dims;M(n,function(a){e.zoomDim(a,t)}),this.context.view.render(!0)},r.prototype.zoomOut=function(){this.zoom(-1*this.zoomRatio)},r.prototype.zoomDim=function(t,e){if(this.hasDim(t)){var n=this.getScale(t);n.isLinear&&this.zoomLinear(t,n,e)}},r.prototype.zoomLinear=function(t,e,n){var a=this.context.view;this.cacheScaleDefs[t]||(this.cacheScaleDefs[t]={nice:e.nice,min:e.min,max:e.max});var o=this.cacheScaleDefs[t],s=o.max-o.min,l=e.min,h=e.max,u=n*s,c=l-u,f=h+u,v=f-c,p=v/s;f>c&&p<100&&p>.01&&a.scale(e.field,{nice:!1,min:l-u,max:h+u})},r}(Kv);function hb(i){var r=i.gEvent.originalEvent;return r.deltaY>0}var ub=1,cb=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.scroll=function(t){var e=this.context,n=e.view,a=e.event;if(!!n.getOptions().scrollbar){var o=(t==null?void 0:t.wheelDelta)||ub,s=n.getController("scrollbar"),l=n.getXScale(),h=n.getOptions().data,u=Gt(Me(h,l.field)),c=Gt(l.values),f=s.getValue(),v=Math.floor((u-c)*f),p=v+(hb(a)?o:-o),g=o/(u-c)/1e4,d=at(p/(u-c)+g,0,1);s.setValue(d)}},r}(yt),fb="aixs-description-tooltip",vb=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.show=function(){var t=this.context,e=Gr(t).axis,n=e.cfg.title,a=n.description,o=n.text,s=n.descriptionTooltipStyle,l=t.event,h=l.x,u=l.y;this.tooltip||this.renderTooltip(),this.tooltip.update({title:o||"",customContent:function(){return`
    \u5B57\u6BB5\u8BF4\u660E\uFF1A`).concat(a,`
    `)},x:h,y:u}),this.tooltip.show()},r.prototype.destroy=function(){i.prototype.destroy.call(this),this.tooltip&&this.tooltip.destroy()},r.prototype.hide=function(){this.tooltip&&this.tooltip.hide()},r.prototype.renderTooltip=function(){var t,e=this.context.view,n=e.canvas,a={start:{x:0,y:0},end:{x:n.get("width"),y:n.get("height")}},o=new Ea({parent:n.get("el").parentNode,region:a,visible:!1,containerId:fb,domStyles:w({},D({},(t={},t[Se]={"max-width":"50%",padding:"10px","line-height":"15px","font-size":"12px",color:"rgba(0, 0, 0, .65)"},t[be]={"word-break":"break-all","margin-bottom":"3px"},t)))});o.init(),o.setCapture(!1),this.tooltip=o},r}(yt);nw("dark",Uf(_w));Uu("canvas",VC);Uu("svg",I1);ye("Polygon",$1);ye("Interval",V1);ye("Schema",_1);ye("Path",$s);ye("Point",z1);ye("Line",N1);ye("Area",F1);ye("Edge",O1);ye("Heatmap",D1);ye("Violin",U1);ka("base",Ds);ka("interval",uM);ka("pie",cM);ka("polar",Vv);Vt("overlap",AM);Vt("distribute",vM);Vt("fixed-overlap",bM);Vt("hide-overlap",DM);Vt("limit-in-shape",wM);Vt("limit-in-canvas",xM);Vt("limit-in-plot",KM);Vt("pie-outer",gM);Vt("adjust-color",YM);Vt("interval-adjust-position",NM);Vt("interval-hide-overlap",zM);Vt("point-adjust-position",_M);Vt("pie-spider",mM);Vt("path-adjust-position",qM);_t("fade-in",JM);_t("fade-out",tS);_t("grow-in-x",rS);_t("grow-in-xy",nS);_t("grow-in-y",iS);_t("scale-in-x",sS);_t("scale-in-y",lS);_t("wave-in",uS);_t("zoom-in",cS);_t("zoom-out",fS);_t("position-update",oS);_t("sector-path-update",hS);_t("path-in",aS);$r("rect",yS);$r("mirror",dS);$r("list",pS);$r("matrix",gS);$r("circle",vS);$r("tree",mS);_r("axis",CS);_r("legend",MS);_r("tooltip",Cw);_r("annotation",wS);_r("slider",SS);_r("scrollbar",TS);V("tooltip",$v);V("sibling-tooltip",kS);V("ellipsis-text",IS);V("element-active",PS);V("element-single-active",DS);V("element-range-active",OS);V("element-highlight",il);V("element-highlight-by-x",YS);V("element-highlight-by-color",RS);V("element-single-highlight",GS);V("element-range-highlight",jv);V("element-sibling-highlight",jv,{effectSiblings:!0,effectByRecord:!0});V("element-selected",VS);V("element-single-selected",NS);V("element-range-selected",HS);V("element-link-by-color",FS);V("active-region",BS);V("list-active",XS);V("list-selected",WS);V("list-highlight",nl);V("list-unchecked",$S);V("list-checked",_S);V("list-focus",jS);V("list-radio",US);V("legend-item-highlight",nl,{componentNames:["legend"]});V("axis-label-highlight",nl,{componentNames:["axis"]});V("axis-description",vb);V("rect-mask",Uv);V("x-rect-mask",qv,{dim:"x"});V("y-rect-mask",qv,{dim:"y"});V("circle-mask",qS);V("path-mask",Zv);V("smooth-path-mask",ZS);V("cursor",QS);V("data-filter",KS);V("brush",Fa);V("brush-x",Fa,{dims:["x"]});V("brush-y",Fa,{dims:["y"]});V("sibling-filter",ol);V("sibling-x-filter",ol);V("sibling-y-filter",ol);V("element-filter",JS);V("element-sibling-filter",Qv);V("element-sibling-filter-record",Qv,{byRecord:!0});V("view-drag",nb);V("view-move",ob);V("scale-translate",sb);V("scale-zoom",lb);V("reset-button",rb,{name:"reset-button",text:"reset"});V("mousewheel-scroll",cb);function ze(i){return i.isInPlot()}it("tooltip",{start:[{trigger:"plot:mousemove",action:"tooltip:show",throttle:{wait:50,leading:!0,trailing:!1}},{trigger:"plot:touchmove",action:"tooltip:show",throttle:{wait:50,leading:!0,trailing:!1}}],end:[{trigger:"plot:mouseleave",action:"tooltip:hide"},{trigger:"plot:leave",action:"tooltip:hide"},{trigger:"plot:touchend",action:"tooltip:hide"}]});it("ellipsis-text",{start:[{trigger:"legend-item-name:mousemove",action:"ellipsis-text:show",throttle:{wait:50,leading:!0,trailing:!1}},{trigger:"legend-item-name:touchstart",action:"ellipsis-text:show",throttle:{wait:50,leading:!0,trailing:!1}},{trigger:"axis-label:mousemove",action:"ellipsis-text:show",throttle:{wait:50,leading:!0,trailing:!1}},{trigger:"axis-label:touchstart",action:"ellipsis-text:show",throttle:{wait:50,leading:!0,trailing:!1}}],end:[{trigger:"legend-item-name:mouseleave",action:"ellipsis-text:hide"},{trigger:"legend-item-name:touchend",action:"ellipsis-text:hide"},{trigger:"axis-label:mouseleave",action:"ellipsis-text:hide"},{trigger:"axis-label:mouseout",action:"ellipsis-text:hide"},{trigger:"axis-label:touchend",action:"ellipsis-text:hide"}]});it("element-active",{start:[{trigger:"element:mouseenter",action:"element-active:active"}],end:[{trigger:"element:mouseleave",action:"element-active:reset"}]});it("element-selected",{start:[{trigger:"element:click",action:"element-selected:toggle"}]});it("element-highlight",{start:[{trigger:"element:mouseenter",action:"element-highlight:highlight"}],end:[{trigger:"element:mouseleave",action:"element-highlight:reset"}]});it("element-highlight-by-x",{start:[{trigger:"element:mouseenter",action:"element-highlight-by-x:highlight"}],end:[{trigger:"element:mouseleave",action:"element-highlight-by-x:reset"}]});it("element-highlight-by-color",{start:[{trigger:"element:mouseenter",action:"element-highlight-by-color:highlight"}],end:[{trigger:"element:mouseleave",action:"element-highlight-by-color:reset"}]});it("legend-active",{start:[{trigger:"legend-item:mouseenter",action:["list-active:active","element-active:active"]}],end:[{trigger:"legend-item:mouseleave",action:["list-active:reset","element-active:reset"]}]});it("legend-highlight",{start:[{trigger:"legend-item:mouseenter",action:["legend-item-highlight:highlight","element-highlight:highlight"]}],end:[{trigger:"legend-item:mouseleave",action:["legend-item-highlight:reset","element-highlight:reset"]}]});it("axis-label-highlight",{start:[{trigger:"axis-label:mouseenter",action:["axis-label-highlight:highlight","element-highlight:highlight"]}],end:[{trigger:"axis-label:mouseleave",action:["axis-label-highlight:reset","element-highlight:reset"]}]});it("element-list-highlight",{start:[{trigger:"element:mouseenter",action:["list-highlight:highlight","element-highlight:highlight"]}],end:[{trigger:"element:mouseleave",action:["list-highlight:reset","element-highlight:reset"]}]});it("element-range-highlight",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"mask:mouseenter",action:"cursor:move"},{trigger:"plot:mouseleave",action:"cursor:default"},{trigger:"mask:mouseleave",action:"cursor:crosshair"}],start:[{trigger:"plot:mousedown",isEnable:function(i){return!i.isInShape("mask")},action:["rect-mask:start","rect-mask:show"]},{trigger:"mask:dragstart",action:["rect-mask:moveStart"]}],processing:[{trigger:"plot:mousemove",action:["rect-mask:resize"]},{trigger:"mask:drag",action:["rect-mask:move"]},{trigger:"mask:change",action:["element-range-highlight:highlight"]}],end:[{trigger:"plot:mouseup",action:["rect-mask:end"]},{trigger:"mask:dragend",action:["rect-mask:moveEnd"]},{trigger:"document:mouseup",isEnable:function(i){return!i.isInPlot()},action:["element-range-highlight:clear","rect-mask:end","rect-mask:hide"]}],rollback:[{trigger:"dblclick",action:["element-range-highlight:clear","rect-mask:hide"]}]});it("brush",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:ze,action:["brush:start","rect-mask:start","rect-mask:show"]}],processing:[{trigger:"mousemove",isEnable:ze,action:["rect-mask:resize"]}],end:[{trigger:"mouseup",isEnable:ze,action:["brush:filter","brush:end","rect-mask:end","rect-mask:hide","reset-button:show"]}],rollback:[{trigger:"reset-button:click",action:["brush:reset","reset-button:hide","cursor:crosshair"]}]});it("brush-visible",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"plot:mousedown",action:["rect-mask:start","rect-mask:show"]}],processing:[{trigger:"plot:mousemove",action:["rect-mask:resize"]},{trigger:"mask:change",action:["element-range-highlight:highlight"]}],end:[{trigger:"plot:mouseup",action:["rect-mask:end","rect-mask:hide","element-filter:filter","element-range-highlight:clear"]}],rollback:[{trigger:"dblclick",action:["element-filter:clear"]}]});it("brush-x",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:ze,action:["brush-x:start","x-rect-mask:start","x-rect-mask:show"]}],processing:[{trigger:"mousemove",isEnable:ze,action:["x-rect-mask:resize"]}],end:[{trigger:"mouseup",isEnable:ze,action:["brush-x:filter","brush-x:end","x-rect-mask:end","x-rect-mask:hide"]}],rollback:[{trigger:"dblclick",action:["brush-x:reset"]}]});it("element-path-highlight",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:ze,action:"path-mask:start"},{trigger:"mousedown",isEnable:ze,action:"path-mask:show"}],processing:[{trigger:"mousemove",action:"path-mask:addPoint"}],end:[{trigger:"mouseup",action:"path-mask:end"}],rollback:[{trigger:"dblclick",action:"path-mask:hide"}]});it("element-single-selected",{start:[{trigger:"element:click",action:"element-single-selected:toggle"}]});it("legend-filter",{showEnable:[{trigger:"legend-item:mouseenter",action:["cursor:pointer","list-radio:show"]},{trigger:"legend-item:mouseleave",action:["cursor:default","list-radio:hide"]}],start:[{trigger:"legend-item:click",isEnable:function(i){return!i.isInShape("legend-item-radio")},action:["legend-item-highlight:reset","element-highlight:reset","list-unchecked:toggle","data-filter:filter","list-radio:show"]},{trigger:"legend-item-radio:mouseenter",action:["list-radio:showTip"]},{trigger:"legend-item-radio:mouseleave",action:["list-radio:hideTip"]},{trigger:"legend-item-radio:click",action:["list-focus:toggle","data-filter:filter","list-radio:show"]}]});it("continuous-filter",{start:[{trigger:"legend:valuechanged",action:"data-filter:filter"}]});it("continuous-visible-filter",{start:[{trigger:"legend:valuechanged",action:"element-filter:filter"}]});it("legend-visible-filter",{showEnable:[{trigger:"legend-item:mouseenter",action:"cursor:pointer"},{trigger:"legend-item:mouseleave",action:"cursor:default"}],start:[{trigger:"legend-item:click",action:["legend-item-highlight:reset","element-highlight:reset","list-unchecked:toggle","element-filter:filter"]}]});it("active-region",{start:[{trigger:"plot:mousemove",action:"active-region:show"}],end:[{trigger:"plot:mouseleave",action:"active-region:hide"}]});it("axis-description",{start:[{trigger:"axis-description:mousemove",action:"axis-description:show"}],end:[{trigger:"axis-description:mouseleave",action:"axis-description:hide"}]});function Yu(i){return i.gEvent.preventDefault(),i.gEvent.originalEvent.deltaY>0}it("view-zoom",{start:[{trigger:"plot:mousewheel",isEnable:function(i){return Yu(i.event)},action:"scale-zoom:zoomOut",throttle:{wait:100,leading:!0,trailing:!1}},{trigger:"plot:mousewheel",isEnable:function(i){return!Yu(i.event)},action:"scale-zoom:zoomIn",throttle:{wait:100,leading:!0,trailing:!1}}]});it("sibling-tooltip",{start:[{trigger:"plot:mousemove",action:"sibling-tooltip:show"}],end:[{trigger:"plot:mouseleave",action:"sibling-tooltip:hide"}]});it("plot-mousewheel-scroll",{start:[{trigger:"plot:mousewheel",action:"mousewheel-scroll:scroll"}]});export{pb as C};