import{au as g,i as O,p as S,m as ft,T as pt,ao as xi,e as W,a8 as Mr,b as tt,an as Gr,av as kt,f as Lt,a as K,Q as D,a5 as Pe,a1 as Se,aw as Mx,ax as Zd,ay as Ax,a7 as jo,am as Zo,S as zt,F as be,ap as De,k as he,z as ve,E as Fx,A as M,g as Tx,$ as xt,a0 as Ex,a4 as ga,O as oe,M as Qd,Z as It,I as fe,C as Kd,r as Xt,y as Qs,ag as Bt,J as Jd,az as Hn,aA as kx,aB as vn,aC as tg,aD as Lx,aE as Ix,aF as zu,aG as Ii,aH as Px,H as Ir,n as Y,aa as Vu,o as Dx,Y as pa,B as Bx,N as eg,aI as jt,aj as rg,h as mt,aJ as Rt,aK as Nt,aL as ii,aM as Yi,aN as Ye,x as Ox,aO as Ch,L as $i,q as Gu,_ as en,l as ig,ak as Yu,V as Ln,s as Le,v as $u,c as Ei,ah as Qo,af as Et,ad as Rx,ac as Zt,X as Qr,G as Nx,R as zx,j as Vx,ae as Gx,al as Yx,u as hi,t as ng,d as $x,a9 as Ko,P as Hx,a2 as ag,ai as Xx,w as og,a6 as Wx}from"./ext-3770bb52.js";import{k as qx}from"./index-1e2f2bc1.js";const Jo=Object.freeze(Object.defineProperty({__proto__:null,get Base(){return Re},get Circle(){return wA},get Ellipse(){return bA},get Image(){return CA},get Line(){return AA},get Marker(){return NA},get Path(){return Ec},get Polygon(){return qA},get Polyline(){return jA},get Rect(){return JA},get Text(){return eF}},Symbol.toStringTag,{value:"Module"})),ts=Object.freeze(Object.defineProperty({__proto__:null,get Base(){return Ae},get Circle(){return cF},get Dom(){return fF},get Ellipse(){return dF},get Image(){return pF},get Line(){return mF},get Marker(){return wF},get Path(){return bF},get Polygon(){return CF},get Polyline(){return AF},get Rect(){return EF},get Text(){return DF}},Symbol.toStringTag,{value:"Module"}));var At;(function(r){r.FORE="fore",r.MID="mid",r.BG="bg"})(At||(At={}));var N;(function(r){r.TOP="top",r.TOP_LEFT="top-left",r.TOP_RIGHT="top-right",r.RIGHT="right",r.RIGHT_TOP="right-top",r.RIGHT_BOTTOM="right-bottom",r.LEFT="left",r.LEFT_TOP="left-top",r.LEFT_BOTTOM="left-bottom",r.BOTTOM="bottom",r.BOTTOM_LEFT="bottom-left",r.BOTTOM_RIGHT="bottom-right",r.RADIUS="radius",r.CIRCLE="circle",r.NONE="none"})(N||(N={}));var Dt;(function(r){r.AXIS="axis",r.GRID="grid",r.LEGEND="legend",r.TOOLTIP="tooltip",r.ANNOTATION="annotation",r.SLIDER="slider",r.SCROLLBAR="scrollbar",r.OTHER="other"})(Dt||(Dt={}));var Oi={FORE:3,MID:2,BG:1},it;(function(r){r.BEFORE_RENDER="beforerender",r.AFTER_RENDER="afterrender",r.BEFORE_PAINT="beforepaint",r.AFTER_PAINT="afterpaint",r.BEFORE_CHANGE_DATA="beforechangedata",r.AFTER_CHANGE_DATA="afterchangedata",r.BEFORE_CLEAR="beforeclear",r.AFTER_CLEAR="afterclear",r.BEFORE_DESTROY="beforedestroy",r.BEFORE_CHANGE_SIZE="beforechangesize",r.AFTER_CHANGE_SIZE="afterchangesize"})(it||(it={}));var Tr;(function(r){r.BEFORE_DRAW_ANIMATE="beforeanimate",r.AFTER_DRAW_ANIMATE="afteranimate",r.BEFORE_RENDER_LABEL="beforerenderlabel",r.AFTER_RENDER_LABEL="afterrenderlabel"})(Tr||(Tr={}));var Jt;(function(r){r.MOUSE_ENTER="plot:mouseenter",r.MOUSE_DOWN="plot:mousedown",r.MOUSE_MOVE="plot:mousemove",r.MOUSE_UP="plot:mouseup",r.MOUSE_LEAVE="plot:mouseleave",r.TOUCH_START="plot:touchstart",r.TOUCH_MOVE="plot:touchmove",r.TOUCH_END="plot:touchend",r.TOUCH_CANCEL="plot:touchcancel",r.CLICK="plot:click",r.DBLCLICK="plot:dblclick",r.CONTEXTMENU="plot:contextmenu",r.LEAVE="plot:leave",r.ENTER="plot:enter"})(Jt||(Jt={}));var Co;(function(r){r.ACTIVE="active",r.INACTIVE="inactive",r.SELECTED="selected",r.DEFAULT="default"})(Co||(Co={}));var Pi=["color","shape","size"],gt="_origin",Mh=1,Ah=1,Fh=.25,sg={};function Ux(r){var e=sg[r];if(!e)throw new Error("G engine '".concat(r,"' is not exist, please register it at first."));return e}function lg(r,e){sg[r]=e}function Mi(r,e,t){if(r){if(typeof r.addEventListener=="function")return r.addEventListener(e,t,!1),{remove:function(){r.removeEventListener(e,t,!1)}};if(typeof r.attachEvent=="function")return r.attachEvent("on"+e,t),{remove:function(){r.detachEvent("on"+e,t)}}}}var Sn,Ks,ug,Nl;function jx(){Sn=document.createElement("table"),Ks=document.createElement("tr"),ug=/^\s*<(\w+|!)[^>]*>/,Nl={tr:document.createElement("tbody"),tbody:Sn,thead:Sn,tfoot:Sn,td:Ks,th:Ks,"*":document.createElement("div")}}function Er(r){Sn||jx();var e=ug.test(r)&&RegExp.$1;(!e||!(e in Nl))&&(e="*");var t=Nl[e];r=typeof r=="string"?r.replace(/(^\s*)|(\s*$)/g,""):r,t.innerHTML=""+r;var i=t.childNodes[0];return i&&t.contains(i)&&t.removeChild(i),i}function ie(r,e,t){var i;try{i=window.getComputedStyle?window.getComputedStyle(r,null)[e]:r.style[e]}catch{}finally{i=i===void 0?t:i}return i}function Zx(r,e){var t=ie(r,"height",e);return t==="auto"&&(t=r.offsetHeight),parseFloat(t)}function Qx(r,e){var t=Zx(r,e),i=parseFloat(ie(r,"borderTopWidth"))||0,n=parseFloat(ie(r,"paddingTop"))||0,a=parseFloat(ie(r,"paddingBottom"))||0,o=parseFloat(ie(r,"borderBottomWidth"))||0,s=parseFloat(ie(r,"marginTop"))||0,l=parseFloat(ie(r,"marginBottom"))||0;return t+i+o+n+a+s+l}function Kx(r,e){var t=ie(r,"width",e);return t==="auto"&&(t=r.offsetWidth),parseFloat(t)}function Jx(r,e){var t=Kx(r,e),i=parseFloat(ie(r,"borderLeftWidth"))||0,n=parseFloat(ie(r,"paddingLeft"))||0,a=parseFloat(ie(r,"paddingRight"))||0,o=parseFloat(ie(r,"borderRightWidth"))||0,s=parseFloat(ie(r,"marginRight"))||0,l=parseFloat(ie(r,"marginLeft"))||0;return t+i+o+n+a+l+s}function qt(r,e){if(r)for(var t in e)e.hasOwnProperty(t)&&(r.style[t]=e[t]);return r}function tw(r){var e=getComputedStyle(r);return{width:(r.clientWidth||parseInt(e.width,10))-parseInt(e.paddingLeft,10)-parseInt(e.paddingRight,10),height:(r.clientHeight||parseInt(e.height,10))-parseInt(e.paddingTop,10)-parseInt(e.paddingBottom,10)}}function Th(r){return typeof r=="number"&&!isNaN(r)}function Eh(r,e,t,i){var n=t,a=i;if(e){var o=tw(r);n=o.width?o.width:n,a=o.height?o.height:a}return{width:Math.max(Th(n)?n:Mh,Mh),height:Math.max(Th(a)?a:Ah,Ah)}}function ew(r){var e=r.parentNode;e&&e.removeChild(r)}var rw="*",Hu=function(){function r(){this._events={}}return r.prototype.on=function(e,t,i){return this._events[e]||(this._events[e]=[]),this._events[e].push({callback:t,once:!!i}),this},r.prototype.once=function(e,t){return this.on(e,t,!0)},r.prototype.emit=function(e){for(var t=this,i=[],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>=e[s]&&(t.push([n].concat(o.splice(0,e[s]))),!!e[s]););return r}),t},zl=function(r,e){for(var t=[],i=0,n=r.length;n-2*!e>i;i+=2){var a=[{x:+r[i-2],y:+r[i-1]},{x:+r[i],y:+r[i+1]},{x:+r[i+2],y:+r[i+3]},{x:+r[i+4],y:+r[i+5]}];e?i?n-4===i?a[3]={x:+r[0],y:+r[1]}:n-2===i&&(a[2]={x:+r[0],y:+r[1]},a[3]={x:+r[2],y:+r[3]}):a[0]={x:+r[n-2],y:+r[n-1]}:n-4===i?a[3]=a[2]:i||(a[0]={x:+r[i],y:+r[i+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},Ia=function(r,e,t,i,n){var a=[];if(n===null&&i===null&&(i=t),r=+r,e=+e,t=+t,i=+i,n!==null){var o=Math.PI/180,s=r+t*Math.cos(-i*o),l=r+t*Math.cos(-n*o),u=e+t*Math.sin(-i*o),c=e+t*Math.sin(-n*o);a=[["M",s,u],["A",t,t,0,+(n-i>180),0,l,c]]}else a=[["M",r,e],["m",0,-i],["a",t,i,0,1,1,0,2*i],["a",t,i,0,1,1,0,-2*i],["z"]];return a},Vl=function(r){if(r=Di(r),!r||!r.length)return[["M",0,0]];var e=[],t=0,i=0,n=0,a=0,o=0,s,l;r[0][0]==="M"&&(t=+r[0][1],i=+r[0][2],n=t,a=i,o++,e[0]=["M",t,i]);for(var u=r.length===3&&r[0][0]==="M"&&r[1][0].toUpperCase()==="R"&&r[2][0].toUpperCase()==="Z",c=void 0,h=void 0,f=o,v=r.length;f1&&(b=Math.sqrt(b),t=b*t,i=b*i);var C=t*t,A=i*i,F=(a===o?-1:1)*Math.sqrt(Math.abs((C*A-C*w*w-A*_*_)/(C*w*w+A*_*_)));y=F*t*w/i+(r+s)/2,m=F*-i*_/t+(e+l)/2,d=Math.asin(((e-m)/i).toFixed(9)),p=Math.asin(((l-m)/i).toFixed(9)),d=rp&&(d=d-Math.PI*2),!o&&p>d&&(p=p-Math.PI*2)}var E=p-d;if(Math.abs(E)>c){var T=p,k=s,P=l;p=d+c*(o&&p>d?1:-1),s=y+t*Math.cos(p),l=m+i*Math.sin(p),f=cg(s,l,t,i,n,0,o,k,P,[p,T,y,m])}E=p-d;var B=Math.cos(d),z=Math.sin(d),X=Math.cos(p),I=Math.sin(p),R=Math.tan(E/4),$=4/3*t*R,G=4/3*i*R,V=[r,e],H=[r+$*z,e-G*B],Z=[s+$*I,l-G*X],rt=[s,l];if(H[0]=2*V[0]-H[0],H[1]=2*V[1]-H[1],u)return[H,Z,rt].concat(f);f=[H,Z,rt].concat(f).join().split(",");for(var U=[],Q=0,ht=f.length;Q7){_[w].shift();for(var b=_[w];b.length;)o[w]="A",i&&(s[w]="A"),_.splice(w++,0,["C"].concat(b.splice(0,6)));_.splice(w,1),c=Math.max(t.length,i&&i.length||0)}},v=function(_,w,b,C,A){_&&w&&_[A][0]==="M"&&w[A][0]!=="M"&&(w.splice(A,0,["M",C.x,C.y]),b.bx=0,b.by=0,b.x=_[A][1],b.y=_[A][2],c=Math.max(t.length,i&&i.length||0))};c=Math.max(t.length,i&&i.length||0);for(var d=0;d1?1:l<0?0:l;for(var u=l/2,c=12,h=[-.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,d=0;d0&&v<1&&l.push(v);continue}var p=h*h-4*f*c,y=Math.sqrt(p);if(!(p<0)){var m=(-h+y)/(2*c);m>0&&m<1&&l.push(m);var x=(-h-y)/(2*c);x>0&&x<1&&l.push(x)}}for(var _=l.length,w=_,b;_--;)v=l[_],b=1-v,u[0][_]=b*b*b*r+3*b*b*v*t+3*b*v*v*n+v*v*v*o,u[1][_]=b*b*b*e+3*b*b*v*i+3*b*v*v*a+v*v*v*s;return u[0][w]=r,u[1][w]=e,u[0][w+1]=o,u[1][w+1]=s,u[0].length=u[1].length=w+2,{min:{x:Math.min.apply(0,u[0]),y:Math.min.apply(0,u[1])},max:{x:Math.max.apply(0,u[0]),y:Math.max.apply(0,u[1])}}},sw=function(r,e,t,i,n,a,o,s){if(!(Math.max(r,t)Math.max(n,o)||Math.max(e,i)Math.max(a,s))){var l=(r*i-e*t)*(n-o)-(r-t)*(n*s-a*o),u=(r*i-e*t)*(a-s)-(e-i)*(n*s-a*o),c=(r-t)*(a-s)-(e-i)*(n-o);if(c){var h=l/c,f=u/c,v=+h.toFixed(2),d=+f.toFixed(2);if(!(v<+Math.min(r,t).toFixed(2)||v>+Math.max(r,t).toFixed(2)||v<+Math.min(n,o).toFixed(2)||v>+Math.max(n,o).toFixed(2)||d<+Math.min(e,i).toFixed(2)||d>+Math.max(e,i).toFixed(2)||d<+Math.min(a,s).toFixed(2)||d>+Math.max(a,s).toFixed(2)))return{x:h,y:f}}}},pr=function(r,e,t){return e>=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height},fg=function(r,e,t,i,n){if(n)return[["M",+r+ +n,e],["l",t-n*2,0],["a",n,n,0,0,1,n,n],["l",0,i-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-i],["a",n,n,0,0,1,n,-n],["z"]];var a=[["M",r,e],["l",t,0],["l",0,i],["l",-t,0],["z"]];return a.parsePathArray=hg,a},Yl=function(r,e,t,i){return r===null&&(r=e=t=i=0),e===null&&(e=r.y,t=r.width,i=r.height,r=r.x),{x:r,y:e,width:t,w:t,height:i,h:i,x2:r+t,y2:e+i,cx:r+t/2,cy:e+i/2,r1:Math.min(t,i)/2,r2:Math.max(t,i)/2,r0:Math.sqrt(t*t+i*i)/2,path:fg(r,e,t,i),vb:[r,e,t,i].join(" ")}},lw=function(r,e){return r=Yl(r),e=Yl(e),pr(e,r.x,r.y)||pr(e,r.x2,r.y)||pr(e,r.x,r.y2)||pr(e,r.x2,r.y2)||pr(r,e.x,e.y)||pr(r,e.x2,e.y)||pr(r,e.x,e.y2)||pr(r,e.x2,e.y2)||(r.xe.x||e.xr.x)&&(r.ye.y||e.yr.y)},Ph=function(r,e,t,i,n,a,o,s){O(r)||(r=[r,e,t,i,n,a,o,s]);var l=ow.apply(null,r);return Yl(l.min.x,l.min.y,l.max.x-l.min.x,l.max.y-l.min.y)},Dh=function(r,e,t,i,n,a,o,s,l){var u=1-l,c=Math.pow(u,3),h=Math.pow(u,2),f=l*l,v=f*l,d=c*r+h*3*l*t+u*3*l*l*n+v*o,p=c*e+h*3*l*i+u*3*l*l*a+v*s,y=r+2*l*(t-r)+f*(n-2*t+r),m=e+2*l*(i-e)+f*(a-2*i+e),x=t+2*l*(n-t)+f*(o-2*n+t),_=i+2*l*(a-i)+f*(s-2*a+i),w=u*r+l*t,b=u*e+l*i,C=u*n+l*o,A=u*a+l*s,F=90-Math.atan2(y-x,m-_)*180/Math.PI;return{x:d,y:p,m:{x:y,y:m},n:{x,y:_},start:{x:w,y:b},end:{x:C,y:A},alpha:F}},uw=function(r,e,t){var i=Ph(r),n=Ph(e);if(!lw(i,n))return t?0:[];for(var a=Ih.apply(0,r),o=Ih.apply(0,e),s=~~(a/8),l=~~(o/8),u=[],c=[],h={},f=t?0:[],v=0;v=0&&A<=1&&F>=0&&F<=1&&(t?f+=1:f.push({x:C.x,y:C.y,t1:A,t2:F}))}}return f},cw=function(r,e,t){r=Gl(r),e=Gl(e);for(var i,n,a,o,s,l,u,c,h,f,v=t?0:[],d=0,p=r.length;d=3&&(h.length===3&&f.push("Q"),f=f.concat(h[1])),h.length===2&&f.push("L"),f=f.concat(h[h.length-1]),f});return c}var dw=function(r,e,t){if(t===1)return[[].concat(r)];var i=[];if(e[0]==="L"||e[0]==="C"||e[0]==="Q")i=i.concat(vw(r,e,t));else{var n=[].concat(r);n[0]==="M"&&(n[0]="L");for(var a=0;a<=t-1;a++)i.push(n)}return i},gw=function(r,e){if(r.length===1)return r;var t=r.length-1,i=e.length-1,n=t/i,a=[];if(r.length===1&&r[0][0]==="M"){for(var o=0;o=0;l--)o=a[l].index,a[l].type==="add"?r.splice(o,0,[].concat(r[o])):r.splice(o,1)}i=r.length;var h=n-i;if(i0)t=Js(t,r[i-1],1);else{r[i]=e[i];break}r[i]=["Q"].concat(t.reduce(function(n,a){return n.concat(a)},[]));break;case"T":r[i]=["T"].concat(t[0]);break;case"C":if(t.length<3)if(i>0)t=Js(t,r[i-1],2);else{r[i]=e[i];break}r[i]=["C"].concat(t.reduce(function(n,a){return n.concat(a)},[]));break;case"S":if(t.length<2)if(i>0)t=Js(t,r[i-1],1);else{r[i]=e[i];break}r[i]=["S"].concat(t.reduce(function(n,a){return n.concat(a)},[]));break;default:r[i]=e[i]}return r};const Wu=Object.freeze(Object.defineProperty({__proto__:null,catmullRomToBezier:zl,fillPath:gw,fillPathByDiff:vg,formatPath:$l,intersection:hw,parsePathArray:hg,parsePathString:Di,pathToAbsolute:Vl,pathToCurve:Gl,rectPath:fg},Symbol.toStringTag,{value:"Module"}));var ya=function(){function r(e,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=e,this.name=e,this.originalEvent=t,this.timeStamp=t.timeStamp}return r.prototype.preventDefault=function(){this.defaultPrevented=!0,this.originalEvent.preventDefault&&this.originalEvent.preventDefault()},r.prototype.stopPropagation=function(){this.propagationStopped=!0},r.prototype.toString=function(){var e=this.type;return"[Event (type="+e+")]"},r.prototype.save=function(){},r.prototype.restore=function(){},r}();function gg(r,e){var t=r.indexOf(e);t!==-1&&r.splice(t,1)}var Bh=typeof window<"u"&&typeof window.document<"u";function pg(r,e){if(r.isCanvas())return!0;for(var t=e.getParent(),i=!1;t;){if(t===r){i=!0;break}t=t.getParent()}return i}function Xn(r){return r.cfg.visible&&r.cfg.capture}var es=function(r){g.__extends(e,r);function e(t){var i=r.call(this)||this;i.destroyed=!1;var n=i.getDefaultCfg();return i.cfg=ft(n,t),i}return e.prototype.getDefaultCfg=function(){return{}},e.prototype.get=function(t){return this.cfg[t]},e.prototype.set=function(t,i){this.cfg[t]=i},e.prototype.destroy=function(){this.cfg={destroyed:!0},this.off(),this.destroyed=!0},e}(Hu),Oh=globalThis&&globalThis.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var i=0,n=e.length,a;i"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Sw:typeof navigator<"u"?zh(navigator.userAgent):Ew()}function Fw(r){return r!==""&&Aw.reduce(function(e,t){var i=t[0],n=t[1];if(e)return e;var a=n.exec(r);return!!a&&[i,a]},!1)}function zh(r){var e=Fw(r);if(!e)return null;var t=e[0],i=e[1];if(t==="searchbot")return new bw;var n=i[1]&&i[1].split(".").join("_").split("_").slice(0,3);n?n.lengtho.delay&&S(e.toAttrs,function(s,l){a.call(o.toAttrs,l)&&(delete o.toAttrs[l],delete o.fromAttrs[l])})}),r}var mg=function(r){g.__extends(e,r);function e(t){var i=r.call(this,t)||this;i.attrs={};var n=i.getDefaultAttrs();return ft(n,t.attrs),i.attrs=n,i.initAttrs(n),i.initAnimate(),i}return e.prototype.getDefaultCfg=function(){return{visible:!0,capture:!0,zIndex:0}},e.prototype.getDefaultAttrs=function(){return{matrix:this.getDefaultMatrix(),opacity:1}},e.prototype.onCanvasChange=function(t){},e.prototype.initAttrs=function(t){},e.prototype.initAnimate=function(){this.set("animable",!0),this.set("animating",!1)},e.prototype.isGroup=function(){return!1},e.prototype.getParent=function(){return this.get("parent")},e.prototype.getCanvas=function(){return this.get("canvas")},e.prototype.attr=function(){for(var t,i=[],n=0;n0?a=Nw(a,w):n.addAnimator(this),a.push(w),this.set("animations",a),this.set("_pause",{isPaused:!1})}},e.prototype.stopAnimate=function(t){var i=this;t===void 0&&(t=!0);var n=this.get("animations");S(n,function(a){t&&(a.onFrame?i.attr(a.onFrame(1)):i.attr(a.toAttrs)),a.callback&&a.callback()}),this.set("animating",!1),this.set("animations",[])},e.prototype.pauseAnimate=function(){var t=this.get("timeline"),i=this.get("animations"),n=t.getTime();return S(i,function(a){a._paused=!0,a._pauseTime=n,a.pauseCallback&&a.pauseCallback()}),this.set("_pause",{isPaused:!0,pauseTime:n}),this},e.prototype.resumeAnimate=function(){var t=this.get("timeline"),i=t.getTime(),n=this.get("animations"),a=this.get("_pause").pauseTime;return S(n,function(o){o.startTime=o.startTime+(i-a),o._paused=!1,o._pauseTime=null,o.resumeCallback&&o.resumeCallback()}),this.set("_pause",{isPaused:!1}),this.set("animations",n),this},e.prototype.emitDelegation=function(t,i){var n=this,a=i.propagationPath;this.getEvents();var o;t==="mouseenter"?o=i.fromShape:t==="mouseleave"&&(o=i.toShape);for(var s=function(h){var f=a[h],v=f.get("name");if(v){if((f.isGroup()||f.isCanvas&&f.isCanvas())&&o&&pg(f,o))return"break";O(v)?S(v,function(d){n.emitDelegateEvent(f,d,i)}):l.emitDelegateEvent(f,v,i)}},l=this,u=0;u0)});o.length>0?S(o,function(l){var u=l.getBBox(),c=u.minX,h=u.maxX,f=u.minY,v=u.maxY;ci&&(i=h),fa&&(a=v)}):(t=0,i=0,n=0,a=0);var s={x:t,y:n,minX:t,minY:n,maxX:i,maxY:a,width:i-t,height:a-n};return s},e.prototype.getCanvasBBox=function(){var t=1/0,i=-1/0,n=1/0,a=-1/0,o=this.getChildren().filter(function(l){return l.get("visible")&&(!l.isGroup()||l.isGroup()&&l.getChildren().length>0)});o.length>0?S(o,function(l){var u=l.getCanvasBBox(),c=u.minX,h=u.maxX,f=u.minY,v=u.maxY;ci&&(i=h),fa&&(a=v)}):(t=0,i=0,n=0,a=0);var s={x:t,y:n,minX:t,minY:n,maxX:i,maxY:a,width:i-t,height:a-n};return s},e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return t.children=[],t},e.prototype.onAttrChange=function(t,i,n){if(r.prototype.onAttrChange.call(this,t,i,n),t==="matrix"){var a=this.getTotalMatrix();this._applyChildrenMarix(a)}},e.prototype.applyMatrix=function(t){var i=this.getTotalMatrix();r.prototype.applyMatrix.call(this,t);var n=this.getTotalMatrix();n!==i&&this._applyChildrenMarix(n)},e.prototype._applyChildrenMarix=function(t){var i=this.getChildren();S(i,function(n){n.applyMatrix(t)})},e.prototype.addShape=function(){for(var t=[],i=0;i=0;s--){var l=t[s];if(Xn(l)&&(l.isGroup()?o=l.getShape(i,n,a):l.isHit(i,n)&&(o=l)),o)break}return o},e.prototype.add=function(t){var i=this.getCanvas(),n=this.getChildren(),a=this.get("timeline"),o=t.getParent();o&&zw(o,t,!1),t.set("parent",this),i&&xg(t,i),a&&wg(t,a),n.push(t),t.onCanvasChange("add"),this._applyElementMatrix(t)},e.prototype._applyElementMatrix=function(t){var i=this.getTotalMatrix();i&&t.applyMatrix(i)},e.prototype.getChildren=function(){return this.get("children")},e.prototype.sort=function(){var t=this.getChildren();S(t,function(i,n){return i[Hl]=n,i}),t.sort(Vw(function(i,n){return i.get("zIndex")-n.get("zIndex")})),this.onCanvasChange("sort")},e.prototype.clear=function(){if(this.set("clearing",!0),!this.destroyed){for(var t=this.getChildren(),i=t.length-1;i>=0;i--)t[i].destroy();this.set("children",[]),this.onCanvasChange("clear"),this.set("clearing",!1)}},e.prototype.destroy=function(){this.get("destroyed")||(this.clear(),r.prototype.destroy.call(this))},e.prototype.getFirst=function(){return this.getChildByIndex(0)},e.prototype.getLast=function(){var t=this.getChildren();return this.getChildByIndex(t.length-1)},e.prototype.getChildByIndex=function(t){var i=this.getChildren();return i[t]},e.prototype.getCount=function(){var t=this.getChildren();return t.length},e.prototype.contain=function(t){var i=this.getChildren();return i.indexOf(t)>-1},e.prototype.removeChild=function(t,i){i===void 0&&(i=!0),this.contain(t)&&t.remove(i)},e.prototype.findAll=function(t){var i=[],n=this.getChildren();return S(n,function(a){t(a)&&i.push(a),a.isGroup()&&(i=i.concat(a.findAll(t)))}),i},e.prototype.find=function(t){var i=null,n=this.getChildren();return S(n,function(a){if(t(a)?i=a:a.isGroup()&&(i=a.find(t)),i)return!1}),i},e.prototype.findById=function(t){return this.find(function(i){return i.get("id")===t})},e.prototype.findByClassName=function(t){return this.find(function(i){return i.get("className")===t})},e.prototype.findAllByName=function(t){return this.findAll(function(i){return i.get("name")===t})},e}(mg),Hi=0,Cn=0,gn=0,bg=1e3,Mo,Mn,Ao=0,fi=0,is=0,Wn=typeof performance=="object"&&performance.now?performance:Date,Sg=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(r){setTimeout(r,17)};function Cg(){return fi||(Sg(Gw),fi=Wn.now()+is)}function Gw(){fi=0}function Xl(){this._call=this._time=this._next=null}Xl.prototype=Mg.prototype={constructor:Xl,restart:function(r,e,t){if(typeof r!="function")throw new TypeError("callback is not a function");t=(t==null?Cg():+t)+(e==null?0:+e),!this._next&&Mn!==this&&(Mn?Mn._next=this:Mo=this,Mn=this),this._call=r,this._time=t,Wl()},stop:function(){this._call&&(this._call=null,this._time=1/0,Wl())}};function Mg(r,e,t){var i=new Xl;return i.restart(r,e,t),i}function Yw(){Cg(),++Hi;for(var r=Mo,e;r;)(e=fi-r._time)>=0&&r._call.call(null,e),r=r._next;--Hi}function Yh(){fi=(Ao=Wn.now())+is,Hi=Cn=0;try{Yw()}finally{Hi=0,Hw(),fi=0}}function $w(){var r=Wn.now(),e=r-Ao;e>bg&&(is-=e,Ao=r)}function Hw(){for(var r,e=Mo,t,i=1/0;e;)e._call?(i>e._time&&(i=e._time),r=e,e=e._next):(t=e._next,e._next=null,e=r?r._next=t:Mo=t);Mn=r,Wl(i)}function Wl(r){if(!Hi){Cn&&(Cn=clearTimeout(Cn));var e=r-fi;e>24?(r<1/0&&(Cn=setTimeout(Yh,r-Wn.now()-is)),gn&&(gn=clearInterval(gn))):(gn||(Ao=Wn.now(),gn=setInterval($w,bg)),Hi=1,Sg(Yh))}}function qu(r,e,t){r.prototype=e.prototype=t,t.constructor=r}function Ag(r,e){var t=Object.create(r.prototype);for(var i in e)t[i]=e[i];return t}function ma(){}var qn=.7,Fo=1/qn,Ri="\\s*([+-]?\\d+)\\s*",Un="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",He="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Xw=/^#([0-9a-f]{3,8})$/,Ww=new RegExp(`^rgb\\(${Ri},${Ri},${Ri}\\)$`),qw=new RegExp(`^rgb\\(${He},${He},${He}\\)$`),Uw=new RegExp(`^rgba\\(${Ri},${Ri},${Ri},${Un}\\)$`),jw=new RegExp(`^rgba\\(${He},${He},${He},${Un}\\)$`),Zw=new RegExp(`^hsl\\(${Un},${He},${He}\\)$`),Qw=new RegExp(`^hsla\\(${Un},${He},${He},${Un}\\)$`),$h={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};qu(ma,jn,{copy(r){return Object.assign(new this.constructor,this,r)},displayable(){return this.rgb().displayable()},hex:Hh,formatHex:Hh,formatHex8:Kw,formatHsl:Jw,formatRgb:Xh,toString:Xh});function Hh(){return this.rgb().formatHex()}function Kw(){return this.rgb().formatHex8()}function Jw(){return Fg(this).formatHsl()}function Xh(){return this.rgb().formatRgb()}function jn(r){var e,t;return r=(r+"").trim().toLowerCase(),(e=Xw.exec(r))?(t=e[1].length,e=parseInt(e[1],16),t===6?Wh(e):t===3?new ae(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?Da(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?Da(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Ww.exec(r))?new ae(e[1],e[2],e[3],1):(e=qw.exec(r))?new ae(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Uw.exec(r))?Da(e[1],e[2],e[3],e[4]):(e=jw.exec(r))?Da(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Zw.exec(r))?jh(e[1],e[2]/100,e[3]/100,1):(e=Qw.exec(r))?jh(e[1],e[2]/100,e[3]/100,e[4]):$h.hasOwnProperty(r)?Wh($h[r]):r==="transparent"?new ae(NaN,NaN,NaN,0):null}function Wh(r){return new ae(r>>16&255,r>>8&255,r&255,1)}function Da(r,e,t,i){return i<=0&&(r=e=t=NaN),new ae(r,e,t,i)}function t1(r){return r instanceof ma||(r=jn(r)),r?(r=r.rgb(),new ae(r.r,r.g,r.b,r.opacity)):new ae}function ql(r,e,t,i){return arguments.length===1?t1(r):new ae(r,e,t,i??1)}function ae(r,e,t,i){this.r=+r,this.g=+e,this.b=+t,this.opacity=+i}qu(ae,ql,Ag(ma,{brighter(r){return r=r==null?Fo:Math.pow(Fo,r),new ae(this.r*r,this.g*r,this.b*r,this.opacity)},darker(r){return r=r==null?qn:Math.pow(qn,r),new ae(this.r*r,this.g*r,this.b*r,this.opacity)},rgb(){return this},clamp(){return new ae(ni(this.r),ni(this.g),ni(this.b),To(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:qh,formatHex:qh,formatHex8:e1,formatRgb:Uh,toString:Uh}));function qh(){return`#${Kr(this.r)}${Kr(this.g)}${Kr(this.b)}`}function e1(){return`#${Kr(this.r)}${Kr(this.g)}${Kr(this.b)}${Kr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Uh(){const r=To(this.opacity);return`${r===1?"rgb(":"rgba("}${ni(this.r)}, ${ni(this.g)}, ${ni(this.b)}${r===1?")":`, ${r})`}`}function To(r){return isNaN(r)?1:Math.max(0,Math.min(1,r))}function ni(r){return Math.max(0,Math.min(255,Math.round(r)||0))}function Kr(r){return r=ni(r),(r<16?"0":"")+r.toString(16)}function jh(r,e,t,i){return i<=0?r=e=t=NaN:t<=0||t>=1?r=e=NaN:e<=0&&(r=NaN),new ke(r,e,t,i)}function Fg(r){if(r instanceof ke)return new ke(r.h,r.s,r.l,r.opacity);if(r instanceof ma||(r=jn(r)),!r)return new ke;if(r instanceof ke)return r;r=r.rgb();var e=r.r/255,t=r.g/255,i=r.b/255,n=Math.min(e,t,i),a=Math.max(e,t,i),o=NaN,s=a-n,l=(a+n)/2;return s?(e===a?o=(t-i)/s+(t0&&l<1?0:o,new ke(o,s,l,r.opacity)}function r1(r,e,t,i){return arguments.length===1?Fg(r):new ke(r,e,t,i??1)}function ke(r,e,t,i){this.h=+r,this.s=+e,this.l=+t,this.opacity=+i}qu(ke,r1,Ag(ma,{brighter(r){return r=r==null?Fo:Math.pow(Fo,r),new ke(this.h,this.s,this.l*r,this.opacity)},darker(r){return r=r==null?qn:Math.pow(qn,r),new ke(this.h,this.s,this.l*r,this.opacity)},rgb(){var r=this.h%360+(this.h<0)*360,e=isNaN(r)||isNaN(this.s)?0:this.s,t=this.l,i=t+(t<.5?t:1-t)*e,n=2*t-i;return new ae(el(r>=240?r-240:r+120,n,i),el(r,n,i),el(r<120?r+240:r-120,n,i),this.opacity)},clamp(){return new ke(Zh(this.h),Ba(this.s),Ba(this.l),To(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 r=To(this.opacity);return`${r===1?"hsl(":"hsla("}${Zh(this.h)}, ${Ba(this.s)*100}%, ${Ba(this.l)*100}%${r===1?")":`, ${r})`}`}}));function Zh(r){return r=(r||0)%360,r<0?r+360:r}function Ba(r){return Math.max(0,Math.min(1,r||0))}function el(r,e,t){return(r<60?e+(t-e)*r/60:r<180?t:r<240?e+(t-e)*(240-r)/60:e)*255}const Uu=r=>()=>r;function i1(r,e){return function(t){return r+t*e}}function n1(r,e,t){return r=Math.pow(r,t),e=Math.pow(e,t)-r,t=1/t,function(i){return Math.pow(r+i*e,t)}}function a1(r){return(r=+r)==1?Tg:function(e,t){return t-e?n1(e,t,r):Uu(isNaN(e)?t:e)}}function Tg(r,e){var t=e-r;return t?i1(r,t):Uu(isNaN(r)?e:r)}const Qh=function r(e){var t=a1(e);function i(n,a){var o=t((n=ql(n)).r,(a=ql(a)).r),s=t(n.g,a.g),l=t(n.b,a.b),u=Tg(n.opacity,a.opacity);return function(c){return n.r=o(c),n.g=s(c),n.b=l(c),n.opacity=u(c),n+""}}return i.gamma=r,i}(1);function Eg(r,e){e||(e=[]);var t=r?Math.min(e.length,r.length):0,i=e.slice(),n;return function(a){for(n=0;nt&&(a=e.slice(t,a),s[o]?s[o]+=a:s[++o]=a),(i=i[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:Ul(i,n)})),t=rl.lastIndex;return tu.length?(l=Di(a[s]),u=Di(n[s]),u=vg(u,l),u=$l(u,l),e.fromAttrs.path=u,e.toAttrs.path=l):e.pathFormatted||(l=Di(a[s]),u=Di(n[s]),u=$l(u,l),e.fromAttrs.path=u,e.toAttrs.path=l,e.pathFormatted=!0),i[s]=[];for(var c=0;c0){for(var s=e.animators.length-1;s>=0;s--){if(i=e.animators[s],i.destroyed){e.removeAnimator(s);continue}if(!i.isAnimatePaused()){n=i.get("animations");for(var l=n.length-1;l>=0;l--)a=n[l],t=H1(i,a,o),t&&(n.splice(l,1),t=!1,a.callback&&a.callback())}n.length===0&&e.removeAnimator(s)}var u=e.canvas.get("autoDraw");u||e.canvas.draw()}})},r.prototype.addAnimator=function(e){this.animators.push(e)},r.prototype.removeAnimator=function(e){this.animators.splice(e,1)},r.prototype.isAnimating=function(){return!!this.animators.length},r.prototype.stop=function(){this.timer&&this.timer.stop()},r.prototype.stopAllAnimations=function(e){e===void 0&&(e=!0),this.animators.forEach(function(t){t.stopAnimate(e)}),this.animators=[],this.canvas.draw()},r.prototype.getTime=function(){return this.current},r}(),W1=40,lf=0,uf=["mousedown","mouseup","dblclick","mouseout","mouseover","mousemove","mouseleave","mouseenter","touchstart","touchmove","touchend","dragenter","dragover","dragleave","drop","contextmenu","mousewheel"];function cf(r,e,t){t.name=e,t.target=r,t.currentTarget=r,t.delegateTarget=r,r.emit(e,t)}function q1(r,e,t){if(t.bubbles){var i=void 0,n=!1;if(e==="mouseenter"?(i=t.fromShape,n=!0):e==="mouseleave"&&(n=!0,i=t.toShape),r.isCanvas()&&n)return;if(i&&pg(r,i)){t.bubbles=!1;return}t.name=e,t.currentTarget=r,t.delegateTarget=r,r.emit(e,t)}}var U1=function(){function r(e){var t=this;this.draggingShape=null,this.dragging=!1,this.currentShape=null,this.mousedownShape=null,this.mousedownPoint=null,this._eventCallback=function(i){var n=i.type;t._triggerEvent(n,i)},this._onDocumentMove=function(i){var n=t.canvas,a=n.get("el");if(a!==i.target&&(t.dragging||t.currentShape)){var o=t._getPointInfo(i);t.dragging&&t._emitEvent("drag",i,o,t.draggingShape)}},this._onDocumentMouseUp=function(i){var n=t.canvas,a=n.get("el");if(a!==i.target&&t.dragging){var o=t._getPointInfo(i);t.draggingShape&&t._emitEvent("drop",i,o,null),t._emitEvent("dragend",i,o,t.draggingShape),t._afterDrag(t.draggingShape,o,i)}},this.canvas=e.canvas}return r.prototype.init=function(){this._bindEvents()},r.prototype._bindEvents=function(){var e=this,t=this.canvas.get("el");S(uf,function(i){t.addEventListener(i,e._eventCallback)}),document&&(document.addEventListener("mousemove",this._onDocumentMove),document.addEventListener("mouseup",this._onDocumentMouseUp))},r.prototype._clearEvents=function(){var e=this,t=this.canvas.get("el");S(uf,function(i){t.removeEventListener(i,e._eventCallback)}),document&&(document.removeEventListener("mousemove",this._onDocumentMove),document.removeEventListener("mouseup",this._onDocumentMouseUp))},r.prototype._getEventObj=function(e,t,i,n,a,o){var s=new ya(e,t);return s.fromShape=a,s.toShape=o,s.x=i.x,s.y=i.y,s.clientX=i.clientX,s.clientY=i.clientY,s.propagationPath.push(n),s},r.prototype._getShape=function(e,t){return this.canvas.getShape(e.x,e.y,t)},r.prototype._getPointInfo=function(e){var t=this.canvas,i=t.getClientByEvent(e),n=t.getPointByEvent(e);return{x:n.x,y:n.y,clientX:i.x,clientY:i.y}},r.prototype._triggerEvent=function(e,t){var i=this._getPointInfo(t),n=this._getShape(i,t),a=this["_on"+e],o=!1;if(a)a.call(this,i,n,t);else{var s=this.currentShape;e==="mouseenter"||e==="dragenter"||e==="mouseover"?(this._emitEvent(e,t,i,null,null,n),n&&this._emitEvent(e,t,i,n,null,n),e==="mouseenter"&&this.draggingShape&&this._emitEvent("dragenter",t,i,null)):e==="mouseleave"||e==="dragleave"||e==="mouseout"?(o=!0,s&&this._emitEvent(e,t,i,s,s,null),this._emitEvent(e,t,i,null,s,null),e==="mouseleave"&&this.draggingShape&&this._emitEvent("dragleave",t,i,null)):this._emitEvent(e,t,i,n,null,null)}if(o||(this.currentShape=n),n&&!n.get("destroyed")){var l=this.canvas,u=l.get("el");u.style.cursor=n.attr("cursor")||l.get("cursor")}},r.prototype._onmousedown=function(e,t,i){i.button===lf&&(this.mousedownShape=t,this.mousedownPoint=e,this.mousedownTimeStamp=i.timeStamp),this._emitEvent("mousedown",i,e,t,null,null)},r.prototype._emitMouseoverEvents=function(e,t,i,n){var a=this.canvas.get("el");i!==n&&(i&&(this._emitEvent("mouseout",e,t,i,i,n),this._emitEvent("mouseleave",e,t,i,i,n),(!n||n.get("destroyed"))&&(a.style.cursor=this.canvas.get("cursor"))),n&&(this._emitEvent("mouseover",e,t,n,i,n),this._emitEvent("mouseenter",e,t,n,i,n)))},r.prototype._emitDragoverEvents=function(e,t,i,n,a){n?(n!==i&&(i&&this._emitEvent("dragleave",e,t,i,i,n),this._emitEvent("dragenter",e,t,n,i,n)),a||this._emitEvent("dragover",e,t,n)):i&&this._emitEvent("dragleave",e,t,i,i,n),a&&this._emitEvent("dragover",e,t,n)},r.prototype._afterDrag=function(e,t,i){e&&(e.set("capture",!0),this.draggingShape=null),this.dragging=!1;var n=this._getShape(t,i);n!==e&&this._emitMouseoverEvents(i,t,e,n),this.currentShape=n},r.prototype._onmouseup=function(e,t,i){if(i.button===lf){var n=this.draggingShape;this.dragging?(n&&this._emitEvent("drop",i,e,t),this._emitEvent("dragend",i,e,n),this._afterDrag(n,e,i)):(this._emitEvent("mouseup",i,e,t),t===this.mousedownShape&&this._emitEvent("click",i,e,t),this.mousedownShape=null,this.mousedownPoint=null)}},r.prototype._ondragover=function(e,t,i){i.preventDefault();var n=this.currentShape;this._emitDragoverEvents(i,e,n,t,!0)},r.prototype._onmousemove=function(e,t,i){var n=this.canvas,a=this.currentShape,o=this.draggingShape;if(this.dragging)o&&this._emitDragoverEvents(i,e,a,t,!1),this._emitEvent("drag",i,e,o);else{var s=this.mousedownPoint;if(s){var l=this.mousedownShape,u=i.timeStamp,c=u-this.mousedownTimeStamp,h=s.clientX-e.clientX,f=s.clientY-e.clientY,v=h*h+f*f;c>120||v>W1?l&&l.get("draggable")?(o=this.mousedownShape,o.set("capture",!1),this.draggingShape=o,this.dragging=!0,this._emitEvent("dragstart",i,e,o),this.mousedownShape=null,this.mousedownPoint=null):!l&&n.get("draggable")?(this.dragging=!0,this._emitEvent("dragstart",i,e,null),this.mousedownShape=null,this.mousedownPoint=null):(this._emitMouseoverEvents(i,e,a,t),this._emitEvent("mousemove",i,e,t)):(this._emitMouseoverEvents(i,e,a,t),this._emitEvent("mousemove",i,e,t))}else this._emitMouseoverEvents(i,e,a,t),this._emitEvent("mousemove",i,e,t)}},r.prototype._emitEvent=function(e,t,i,n,a,o){var s=this._getEventObj(e,t,i,n,a,o);if(n){s.shape=n,cf(n,e,s);for(var l=n.getParent();l;)l.emitDelegation(e,s),s.propagationStopped||q1(l,e,s),s.propagationPath.push(l),l=l.getParent()}else{var u=this.canvas;cf(u,e,s)}},r.prototype.destroy=function(){this._clearEvents(),this.canvas=null,this.currentShape=null,this.draggingShape=null,this.mousedownPoint=null,this.mousedownShape=null,this.mousedownTimeStamp=null},r}(),hf="px",ff=yg(),j1=ff&&ff.name==="firefox",ns=function(r){g.__extends(e,r);function e(t){var i=r.call(this,t)||this;return i.initContainer(),i.initDom(),i.initEvents(),i.initTimeline(),i}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return t.cursor="default",t.supportCSSTransform=!1,t},e.prototype.initContainer=function(){var t=this.get("container");K(t)&&(t=document.getElementById(t),this.set("container",t))},e.prototype.initDom=function(){var t=this.createDom();this.set("el",t);var i=this.get("container");i.appendChild(t),this.setDOMSize(this.get("width"),this.get("height"))},e.prototype.initEvents=function(){var t=new U1({canvas:this});t.init(),this.set("eventController",t)},e.prototype.initTimeline=function(){var t=new X1(this);this.set("timeline",t)},e.prototype.setDOMSize=function(t,i){var n=this.get("el");Bh&&(n.style.width=t+hf,n.style.height=i+hf)},e.prototype.changeSize=function(t,i){this.setDOMSize(t,i),this.set("width",t),this.set("height",i),this.onCanvasChange("changeSize")},e.prototype.getRenderer=function(){return this.get("renderer")},e.prototype.getCursor=function(){return this.get("cursor")},e.prototype.setCursor=function(t){this.set("cursor",t);var i=this.get("el");Bh&&i&&(i.style.cursor=t)},e.prototype.getPointByEvent=function(t){var i=this.get("supportCSSTransform");if(i){if(j1&&!D(t.layerX)&&t.layerX!==t.offsetX)return{x:t.layerX,y:t.layerY};if(!D(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)},e.prototype.getClientByEvent=function(t){var i=t;return t.touches&&(t.type==="touchend"?i=t.changedTouches[0]:i=t.touches[0]),{x:i.clientX,y:i.clientY}},e.prototype.getPointByClient=function(t,i){var n=this.get("el"),a=n.getBoundingClientRect();return{x:t-a.left,y:i-a.top}},e.prototype.getClientByPoint=function(t,i){var n=this.get("el"),a=n.getBoundingClientRect();return{x:t+a.left,y:i+a.top}},e.prototype.draw=function(){},e.prototype.removeDom=function(){var t=this.get("el");t.parentNode.removeChild(t)},e.prototype.clearEvents=function(){var t=this.get("eventController");t.destroy()},e.prototype.isCanvas=function(){return!0},e.prototype.getParent=function(){return null},e.prototype.destroy=function(){var t=this.get("timeline");this.get("destroyed")||(this.clear(),t&&t.stop(),this.clearEvents(),this.removeDom(),r.prototype.destroy.call(this))},e}(_g),as=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.isGroup=function(){return!0},e.prototype.isEntityGroup=function(){return!1},e.prototype.clone=function(){for(var t=r.prototype.clone.call(this),i=this.getChildren(),n=0;n=t&&n.minY<=i&&n.maxY>=i},e.prototype.afterAttrsChange=function(t){r.prototype.afterAttrsChange.call(this,t),this.clearCacheBBox()},e.prototype.getBBox=function(){var t=this.cfg.bbox;return t||(t=this.calculateBBox(),this.set("bbox",t)),t},e.prototype.getCanvasBBox=function(){var t=this.cfg.canvasBBox;return t||(t=this.calculateCanvasBBox(),this.set("canvasBBox",t)),t},e.prototype.applyMatrix=function(t){r.prototype.applyMatrix.call(this,t),this.set("canvasBBox",null)},e.prototype.calculateCanvasBBox=function(){var t=this.getBBox(),i=this.getTotalMatrix(),n=t.minX,a=t.minY,o=t.maxX,s=t.maxY;if(i){var l=ir(i,[t.minX,t.minY]),u=ir(i,[t.maxX,t.minY]),c=ir(i,[t.minX,t.maxY]),h=ir(i,[t.maxX,t.maxY]);n=Math.min(l[0],u[0],c[0],h[0]),o=Math.max(l[0],u[0],c[0],h[0]),a=Math.min(l[1],u[1],c[1],h[1]),s=Math.max(l[1],u[1],c[1],h[1])}var f=this.attrs;if(f.shadowColor){var v=f.shadowBlur,d=v===void 0?0:v,p=f.shadowOffsetX,y=p===void 0?0:p,m=f.shadowOffsetY,x=m===void 0?0:m,_=n-d+y,w=o+d+y,b=a-d+x,C=s+d+x;n=Math.min(n,_),o=Math.max(o,w),a=Math.min(a,b),s=Math.max(s,C)}return{x:n,y:a,minX:n,minY:a,maxX:o,maxY:s,width:o-n,height:s-a}},e.prototype.clearCacheBBox=function(){this.set("bbox",null),this.set("canvasBBox",null)},e.prototype.isClipShape=function(){return this.get("isClipShape")},e.prototype.isInShape=function(t,i){return!1},e.prototype.isOnlyHitBox=function(){return!1},e.prototype.isHit=function(t,i){var n=this.get("startArrowShape"),a=this.get("endArrowShape"),o=[t,i,1];o=this.invertFromMatrix(o);var s=o[0],l=o[1],u=this._isInBBox(s,l);return this.isOnlyHitBox()?u:!!(u&&!this.isClipped(s,l)&&(this.isInShape(s,l)||n&&n.isHit(s,l)||a&&a.isHit(s,l)))},e}(mg),Og=new Map;function Me(r,e){Og.set(r,e)}function ss(r){return Og.get(r)}function Rg(r){var e=r.attr(),t=e.x,i=e.y,n=e.width,a=e.height;return{x:t,y:i,width:n,height:a}}function Ng(r){var e=r.attr(),t=e.x,i=e.y,n=e.r;return{x:t-n,y:i-n,width:n*2,height:n*2}}function Ut(r,e,t,i){var n=r-t,a=e-i;return Math.sqrt(n*n+a*a)}function fo(r,e){return Math.abs(r-e)<.001}function rn(r,e){var t=Pe(r),i=Pe(e),n=Se(r),a=Se(e);return{x:t,y:i,width:n-t,height:a-i}}function ls(r){return(r+Math.PI*2)%(Math.PI*2)}const Vt={box:function(r,e,t,i){return rn([r,t],[e,i])},length:function(r,e,t,i){return Ut(r,e,t,i)},pointAt:function(r,e,t,i,n){return{x:(1-n)*r+n*t,y:(1-n)*e+n*i}},pointDistance:function(r,e,t,i,n,a){var o=(t-r)*(n-r)+(i-e)*(a-e);if(o<0)return Ut(r,e,n,a);var s=(t-r)*(t-r)+(i-e)*(i-e);return o>s?Ut(t,i,n,a):this.pointToLine(r,e,t,i,n,a)},pointToLine:function(r,e,t,i,n,a){var o=[t-r,i-e];if(Mx(o,[0,0]))return Math.sqrt((n-r)*(n-r)+(a-e)*(a-e));var s=[-o[1],o[0]];Zd(s,s);var l=[n-r,a-e];return Math.abs(Ax(l,s))},tangentAngle:function(r,e,t,i){return Math.atan2(i-e,t-r)}};var Z1=1e-4;function zg(r,e,t,i,n,a){var o,s=1/0,l=[t,i],u=20;a&&a>200&&(u=a/10);for(var c=1/u,h=c/10,f=0;f<=u;f++){var v=f*c,d=[n.apply(null,r.concat([v])),n.apply(null,e.concat([v]))],p=Ut(l[0],l[1],d[0],d[1]);p=0&&p=0?[n]:[]}function df(r,e,t,i){return 2*(1-i)*(e-r)+2*i*(t-e)}function Vg(r,e,t,i,n,a,o){var s=_r(r,t,n,o),l=_r(e,i,a,o),u=Vt.pointAt(r,e,t,i,o),c=Vt.pointAt(t,i,n,a,o);return[[r,e,u.x,u.y,s,l],[s,l,c.x,c.y,n,a]]}function Ql(r,e,t,i,n,a,o){if(o===0)return(Ut(r,e,t,i)+Ut(t,i,n,a)+Ut(r,e,n,a))/2;var s=Vg(r,e,t,i,n,a,.5),l=s[0],u=s[1];return l.push(o-1),u.push(o-1),Ql.apply(null,l)+Ql.apply(null,u)}const Gg={box:function(r,e,t,i,n,a){var o=vf(r,t,n)[0],s=vf(e,i,a)[0],l=[r,n],u=[e,a];return o!==void 0&&l.push(_r(r,t,n,o)),s!==void 0&&u.push(_r(e,i,a,s)),rn(l,u)},length:function(r,e,t,i,n,a){return Ql(r,e,t,i,n,a,3)},nearestPoint:function(r,e,t,i,n,a,o,s){return zg([r,t,n],[e,i,a],o,s,_r)},pointDistance:function(r,e,t,i,n,a,o,s){var l=this.nearestPoint(r,e,t,i,n,a,o,s);return Ut(l.x,l.y,o,s)},interpolationAt:_r,pointAt:function(r,e,t,i,n,a,o){return{x:_r(r,t,n,o),y:_r(e,i,a,o)}},divide:function(r,e,t,i,n,a,o){return Vg(r,e,t,i,n,a,o)},tangentAngle:function(r,e,t,i,n,a,o){var s=df(r,t,n,o),l=df(e,i,a,o),u=Math.atan2(l,s);return ls(u)}};function br(r,e,t,i,n){var a=1-n;return a*a*a*r+3*e*n*a*a+3*t*n*n*a+i*n*n*n}function gf(r,e,t,i,n){var a=1-n;return 3*(a*a*(e-r)+2*a*n*(t-e)+n*n*(i-t))}function il(r,e,t,i){var n=-3*r+9*e-9*t+3*i,a=6*r-12*e+6*t,o=3*e-3*r,s=[],l,u,c;if(fo(n,0))fo(a,0)||(l=-o/a,l>=0&&l<=1&&s.push(l));else{var h=a*a-4*n*o;fo(h,0)?s.push(-a/(2*n)):h>0&&(c=Math.sqrt(h),l=(-a+c)/(2*n),u=(-a-c)/(2*n),l>=0&&l<=1&&s.push(l),u>=0&&u<=1&&s.push(u))}return s}function Yg(r,e,t,i,n,a,o,s,l){var u=br(r,t,n,o,l),c=br(e,i,a,s,l),h=Vt.pointAt(r,e,t,i,l),f=Vt.pointAt(t,i,n,a,l),v=Vt.pointAt(n,a,o,s,l),d=Vt.pointAt(h.x,h.y,f.x,f.y,l),p=Vt.pointAt(f.x,f.y,v.x,v.y,l);return[[r,e,h.x,h.y,d.x,d.y,u,c],[u,c,p.x,p.y,v.x,v.y,o,s]]}function Kl(r,e,t,i,n,a,o,s,l){if(l===0)return Q1([r,t,n,o],[e,i,a,s]);var u=Yg(r,e,t,i,n,a,o,s,.5),c=u[0],h=u[1];return c.push(l-1),h.push(l-1),Kl.apply(null,c)+Kl.apply(null,h)}const Pn={extrema:il,box:function(r,e,t,i,n,a,o,s){for(var l=[r,o],u=[e,s],c=il(r,t,n,o),h=il(e,i,a,s),f=0;f0?t:t*-1}const K1={box:function(r,e,t,i){return{x:r-t,y:e-i,width:t*2,height:i*2}},length:function(r,e,t,i){return Math.PI*(3*(t+i)-Math.sqrt((3*t+i)*(t+3*i)))},nearestPoint:function(r,e,t,i,n,a){var o=t,s=i;if(o===0||s===0)return{x:r,y:e};for(var l=n-r,u=a-e,c=Math.abs(l),h=Math.abs(u),f=o*o,v=s*s,d=Math.PI/4,p,y,m=0;m<4;m++){p=o*Math.cos(d),y=s*Math.sin(d);var x=(f-v)*Math.pow(Math.cos(d),3)/o,_=(v-f)*Math.pow(Math.sin(d),3)/s,w=p-x,b=y-_,C=c-x,A=h-_,F=Math.hypot(b,w),E=Math.hypot(A,C),T=F*Math.asin((w*A-b*C)/(F*E)),k=T/Math.sqrt(f+v-p*p-y*y);d+=k,d=Math.min(Math.PI/2,Math.max(0,d))}return{x:r+pf(p,l),y:e+pf(y,u)}},pointDistance:function(r,e,t,i,n,a){var o=this.nearestPoint(r,e,t,i,n,a);return Ut(o.x,o.y,n,a)},pointAt:function(r,e,t,i,n){var a=2*Math.PI*n;return{x:r+t*Math.cos(a),y:e+i*Math.sin(a)}},tangentAngle:function(r,e,t,i,n){var a=2*Math.PI*n,o=Math.atan2(i*Math.cos(a),-t*Math.sin(a));return ls(o)}};function J1(r,e,t,i,n,a,o,s){return-1*t*Math.cos(n)*Math.sin(s)-i*Math.sin(n)*Math.cos(s)}function t_(r,e,t,i,n,a,o,s){return-1*t*Math.sin(n)*Math.sin(s)+i*Math.cos(n)*Math.cos(s)}function e_(r,e,t){return Math.atan(-e/r*Math.tan(t))}function r_(r,e,t){return Math.atan(e/(r*Math.tan(t)))}function yf(r,e,t,i,n,a){return t*Math.cos(n)*Math.cos(a)-i*Math.sin(n)*Math.sin(a)+r}function mf(r,e,t,i,n,a){return t*Math.sin(n)*Math.cos(a)+i*Math.cos(n)*Math.sin(a)+e}function i_(r,e,t,i){var n=Math.atan2(i*r,t*e);return(n+Math.PI*2)%(Math.PI*2)}function xf(r,e,t){return{x:r*Math.cos(t),y:e*Math.sin(t)}}function wf(r,e,t){var i=Math.cos(t),n=Math.sin(t);return[r*i-e*n,r*n+e*i]}const n_={box:function(r,e,t,i,n,a,o){for(var s=e_(t,i,n),l=1/0,u=-1/0,c=[a,o],h=-Math.PI*2;h<=Math.PI*2;h+=Math.PI){var f=s+h;au&&(u=v)}for(var d=r_(t,i,n),p=1/0,y=-1/0,m=[a,o],h=-Math.PI*2;h<=Math.PI*2;h+=Math.PI){var x=d+h;ay&&(y=_)}return{x:l,y:p,width:u-l,height:y-p}},length:function(r,e,t,i,n,a,o){},nearestPoint:function(r,e,t,i,n,a,o,s,l){var u=wf(s-r,l-e,-n),c=u[0],h=u[1],f=K1.nearestPoint(0,0,t,i,c,h),v=i_(t,i,f.x,f.y);vo&&(f=xf(t,i,o));var d=wf(f.x,f.y,n);return{x:d[0]+r,y:d[1]+e}},pointDistance:function(r,e,t,i,n,a,o,s,l){var u=this.nearestPoint(r,e,t,i,s,l);return Ut(u.x,u.y,s,l)},pointAt:function(r,e,t,i,n,a,o,s){var l=(o-a)*s+a;return{x:yf(r,e,t,i,n,l),y:mf(r,e,t,i,n,l)}},tangentAngle:function(r,e,t,i,n,a,o,s){var l=(o-a)*s+a,u=J1(r,e,t,i,n,a,o,l),c=t_(r,e,t,i,n,a,o,l);return ls(Math.atan2(c,u))}};function $g(r){for(var e=0,t=[],i=0;i1||e<0||r.length<2)return null;var t=$g(r),i=t.segments,n=t.totalLength;if(n===0)return{x:r[0][0],y:r[0][1]};for(var a=0,o=null,s=0;s=a&&e<=a+h){var f=(e-a)/h;o=Vt.pointAt(u[0],u[1],c[0],c[1],f);break}a+=h}return o}function s_(r,e){if(e>1||e<0||r.length<2)return 0;for(var t=$g(r),i=t.segments,n=t.totalLength,a=0,o=0,s=0;s=a&&e<=a+h){o=Math.atan2(c[1]-u[1],c[0]-u[0]);break}a+=h}return o}function l_(r,e,t){for(var i=1/0,n=0;n1){var n=h_(e,t);return e*i+n*(i-1)}return e}function h_(r,e){return e?e-r:r*.14}function f_(r,e){var t=us(),i=0;if(D(r)||r==="")return i;if(t.save(),t.font=e,K(r)&&r.includes(` `)){var n=r.split(` `);S(n,function(a){var o=t.measureText(a).width;i1){var n=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=n}S(t,function(a,o){isNaN(a)||(t[o]=+a)}),e[i]=t}),e}function Ra(r){return Math.sqrt(r[0]*r[0]+r[1]*r[1])}function Jl(r,e){return Ra(r)*Ra(e)?(r[0]*e[0]+r[1]*e[1])/(Ra(r)*Ra(e)):1}function bf(r,e){return(r[0]*e[1]1&&(t*=Math.sqrt(v),i*=Math.sqrt(v));var d=t*t*(f*f)+i*i*(h*h),p=d?Math.sqrt((t*t*(i*i)-d)/d):1;a===o&&(p*=-1),isNaN(p)&&(p=0);var y=i?p*t*f/i:0,m=t?p*-i*h/t:0,x=(s+u)/2+Math.cos(n)*y-Math.sin(n)*m,_=(l+c)/2+Math.sin(n)*y+Math.cos(n)*m,w=[(h-y)/t,(f-m)/i],b=[(-1*h-y)/t,(-1*f-m)/i],C=bf([1,0],w),A=bf(w,b);return Jl(w,b)<=-1&&(A=Math.PI),Jl(w,b)>=1&&(A=0),o===0&&A>0&&(A=A-2*Math.PI),o===1&&A<0&&(A=A+2*Math.PI),{cx:x,cy:_,rx:tu(r,[u,c])?0:t,ry:tu(r,[u,c])?0:i,startAngle:C,endAngle:C+A,xRotation:n,arcFlag:a,sweepFlag:o}}function Sf(r,e){return[e[0]+(e[0]-r[0]),e[1]+(e[1]-r[1])]}function m_(r){r=p_(r);for(var e=[],t=null,i=null,n=null,a=0,o=r.length,s=0;sMath.PI/2?Math.PI-u:u,c=c>Math.PI/2?Math.PI-c:c;var h={xExtra:Math.cos(l/2-u)*(e/2*(1/Math.sin(l/2)))-e/2||0,yExtra:Math.cos(c-l/2)*(e/2*(1/Math.sin(l/2)))-e/2||0};return h}function w_(r){var e=r.attr(),t=e.path,i=e.stroke,n=i?e.lineWidth:0,a=r.get("segments")||m_(t),o=x_(a,n),s=o.x,l=o.y,u=o.width,c=o.height,h={minX:s,minY:l,maxX:s+u,maxY:l+c};return h=Ju(r,h),{x:h.minX,y:h.minY,width:h.maxX-h.minX,height:h.maxY-h.minY}}function __(r){var e=r.attr(),t=e.x1,i=e.y1,n=e.x2,a=e.y2,o=Math.min(t,n),s=Math.max(t,n),l=Math.min(i,a),u=Math.max(i,a),c={minX:o,maxX:s,minY:l,maxY:u};return c=Ju(r,c),{x:c.minX,y:c.minY,width:c.maxX-c.minX,height:c.maxY-c.minY}}function b_(r){var e=r.attr(),t=e.x,i=e.y,n=e.rx,a=e.ry;return{x:t-n,y:i-a,width:n*2,height:a*2}}Me("rect",Rg);Me("image",Rg);Me("circle",Ng);Me("marker",Ng);Me("polyline",u_);Me("polygon",c_);Me("text",v_);Me("path",w_);Me("line",__);Me("ellipse",b_);var Cf=0,S_=1/2,C_=1/2,M_=.05,fs=function(){function r(e){var t=e.xField,i=e.yField,n=e.adjustNames,a=n===void 0?["x","y"]:n,o=e.dimValuesMap;this.adjustNames=a,this.xField=t,this.yField=i,this.dimValuesMap=o}return r.prototype.isAdjust=function(e){return this.adjustNames.indexOf(e)>=0},r.prototype.getAdjustRange=function(e,t,i){var n=this.yField,a=i.indexOf(t),o=i.length,s,l;return!n&&this.isAdjust("y")?(s=0,l=1):o>1?(s=i[a===0?0:a-1],l=i[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-i[o-2])/2):(s=t===0?0:t-.5,l=t===0?1:t+.5),{pre:s,next:l}},r.prototype.adjustData=function(e,t){var i=this,n=this.getDimValues(t);S(e,function(a,o){S(n,function(s,l){i.adjustDim(l,s,a,o)})})},r.prototype.groupData=function(e,t){return S(e,function(i){i[t]===void 0&&(i[t]=Cf)}),be(e,t)},r.prototype.adjustDim=function(e,t,i,n){},r.prototype.getDimValues=function(e){var t=this,i=t.xField,n=t.yField,a=ft({},this.dimValuesMap),o=[];if(i&&this.isAdjust("x")&&o.push(i),n&&this.isAdjust("y")&&o.push(n),o.forEach(function(l){a&&a[l]||(a[l]=De(e,l).sort(function(u,c){return u-c}))}),!n&&this.isAdjust("y")){var s="y";a[s]=[Cf,1]}return a},r}(),Xg={},Wg=function(r){return Xg[r.toLowerCase()]},vs=function(r,e){if(Wg(r))throw new Error("Adjust type '"+r+"' existed.");Xg[r.toLowerCase()]=e};/*! ***************************************************************************** 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 eu=function(r,e){return eu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},eu(r,e)};function ds(r,e){eu(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var $e=function(){return $e=Object.assign||function(e){for(var t,i=1,n=arguments.length;i=0){var d=this.getIntervalOnlyOffset(n,i);v=c+d}else if(!D(u)&&D(l)&&u>=0){var d=this.getDodgeOnlyOffset(n,i);v=c+d}else if(!D(l)&&!D(u)&&l>=0&&u>=0){var d=this.getIntervalAndDodgeOffset(n,i);v=c+d}else{var p=f*o/n,y=s*p,d=1/2*(f-n*p-(n-1)*y)+((i+1)*p+i*y)-1/2*p-1/2*f;v=(c+h)/2+d}return v},e.prototype.getIntervalOnlyOffset=function(t,i){var n=this,a=n.defaultSize,o=n.intervalPadding,s=n.xDimensionLegenth,l=n.groupNum,u=n.dodgeRatio,c=n.maxColumnWidth,h=n.minColumnWidth,f=n.columnWidthRatio,v=o/s,d=(1-(l-1)*v)/l*u/(t-1),p=((1-v*(l-1))/l-d*(t-1))/t;if(p=D(f)?p:1/l/t*f,!D(c)){var y=c/s;p=Math.min(p,y)}if(!D(h)){var m=h/s;p=Math.max(p,m)}p=a?a/s:p,d=((1-(l-1)*v)/l-t*p)/(t-1);var x=((1/2+i)*p+i*d+1/2*v)*l-v/2;return x},e.prototype.getDodgeOnlyOffset=function(t,i){var n=this,a=n.defaultSize,o=n.dodgePadding,s=n.xDimensionLegenth,l=n.groupNum,u=n.marginRatio,c=n.maxColumnWidth,h=n.minColumnWidth,f=n.columnWidthRatio,v=o/s,d=1*u/(l-1),p=((1-d*(l-1))/l-v*(t-1))/t;if(p=f?1/l/t*f:p,!D(c)){var y=c/s;p=Math.min(p,y)}if(!D(h)){var m=h/s;p=Math.max(p,m)}p=a?a/s:p,d=(1-(p*t+v*(t-1))*l)/(l-1);var x=((1/2+i)*p+i*v+1/2*d)*l-d/2;return x},e.prototype.getIntervalAndDodgeOffset=function(t,i){var n=this,a=n.intervalPadding,o=n.dodgePadding,s=n.xDimensionLegenth,l=n.groupNum,u=a/s,c=o/s,h=((1-u*(l-1))/l-c*(t-1))/t,f=((1/2+i)*h+i*c+1/2*u)*l-u/2;return f},e.prototype.getDistribution=function(t){var i=this.adjustDataArray,n=this.cacheMap,a=n[t];return a||(a={},S(i,function(o,s){var l=De(o,t);l.length||l.push(0),S(l,function(u){a[u]||(a[u]=[]),a[u].push(s)})}),n[t]=a),a},e}(fs);function F_(r,e){return(e-r)*Math.random()+r}var T_=function(r){ds(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.process=function(t){var i=he(t),n=ve(i);return this.adjustData(i,n),i},e.prototype.adjustDim=function(t,i,n){var a=this,o=this.groupData(n,t);return S(o,function(s,l){return a.adjustGroup(s,t,parseFloat(l),i)})},e.prototype.getAdjustOffset=function(t){var i=t.pre,n=t.next,a=(n-i)*M_;return F_(i+a,n-a)},e.prototype.adjustGroup=function(t,i,n,a){var o=this,s=this.getAdjustRange(i,n,a);return S(t,function(l){l[i]=o.getAdjustOffset(s)}),t},e}(fs),al=Tx,E_=function(r){ds(e,r);function e(t){var i=r.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,u=l===void 0?10:l,c=t.reverseOrder,h=c===void 0?!1:c;return i.adjustNames=a,i.height=s,i.size=u,i.reverseOrder=h,i}return e.prototype.process=function(t){var i=this,n=i.yField,a=i.reverseOrder,o=n?this.processStack(t):this.processOneDimStack(t);return a?this.reverse(o):o},e.prototype.reverse=function(t){return t.slice(0).reverse()},e.prototype.processStack=function(t){var i=this,n=i.xField,a=i.yField,o=i.reverseOrder,s=o?this.reverse(t):t,l=new al,u=new al;return s.map(function(c){return c.map(function(h){var f,v=M(h,n,0),d=M(h,[a]),p=v.toString();if(d=O(d)?d[1]:d,!D(d)){var y=d>=0?l:u;y.has(p)||y.set(p,0);var m=y.get(p),x=d+m;return y.set(p,x),$e($e({},h),(f={},f[a]=[m,x],f))}return h})})},e.prototype.processOneDimStack=function(t){var i=this,n=this,a=n.xField,o=n.height,s=n.reverseOrder,l="y",u=s?this.reverse(t):t,c=new al;return u.map(function(h){return h.map(function(f){var v,d=i.size,p=f[a],y=d*2/o;c.has(p)||c.set(p,y/2);var m=c.get(p);return c.set(p,m+y),$e($e({},f),(v={},v[l]=m,v))})})},e}(fs),k_=function(r){ds(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.process=function(t){var i=ve(t),n=this,a=n.xField,o=n.yField,s=this.getXValuesMaxMap(i),l=Math.max.apply(Math,Object.keys(s).map(function(u){return s[u]}));return xt(t,function(u){return xt(u,function(c){var h,f,v=c[o],d=c[a];if(O(v)){var p=(l-s[d])/2;return $e($e({},c),(h={},h[o]=xt(v,function(m){return p+m}),h))}var y=(l-v)/2;return $e($e({},c),(f={},f[o]=[y,v+y],f))})})},e.prototype.getXValuesMaxMap=function(t){var i=this,n=this,a=n.xField,o=n.yField,s=be(t,function(l){return l[a]});return Ex(s,function(l){return i.getDimMaxValue(l,o)})},e.prototype.getDimMaxValue=function(t,i){var n=xt(t,function(o){return M(o,i,[])}),a=ve(n);return Math.max.apply(Math,a)},e}(fs);vs("Dodge",A_);vs("Jitter",T_);vs("Stack",E_);vs("Symmetric",k_);var Mf=function(r,e){return K(e)?e:r.invert(r.scale(e))},xa=function(){function r(e){this.names=[],this.scales=[],this.linear=!1,this.values=[],this.callback=function(){return[]},this._parseCfg(e)}return r.prototype.mapping=function(){for(var e=this,t=[],i=0;i1?1:Number(e),i=r.length-1,n=Math.floor(i*t),a=i*t-n,o=r[n],s=n===i?o:r[n+1];return qg([ol(o,s,a,0),ol(o,s,a,1),ol(o,s,a,2)])},za,jg=function(r){if(r[0]==="#"&&r.length===7)return r;za||(za=O_()),za.style.color=r;var e=document.defaultView.getComputedStyle(za,"").getPropertyValue("color"),t=L_.exec(e),i=t[1].split(/\s*,\s*/).map(function(n){return Number(n)});return e=qg(i),e},N_=function(r){var e=K(r)?r.split("-"):r,t=xt(e,function(i){return Ug(i.indexOf("#")===-1?jg(i):i)});return function(i){return R_(t,i)}},z_=function(r){if(B_(r)){var e,t=void 0;if(r[0]==="l"){var i=I_.exec(r),n=+i[1]+90;t=i[2],e="linear-gradient("+n+"deg, "}else if(r[0]==="r"){e="radial-gradient(";var i=P_.exec(r);t=i[4]}var a=t.match(D_);return S(a,function(o,s){var l=o.split(":");e+=l[1]+" "+l[0]*100+"%",s!==a.length-1&&(e+=", ")}),e+=")",e}return r};const kr={rgb2arr:Ug,gradient:N_,toRGB:ga(jg),toCSSGradient:z_};var V_=function(r){g.__extends(e,r);function e(t){var i=r.call(this,t)||this;return i.type="color",i.names=["color"],K(i.values)&&(i.linear=!0),i.gradient=kr.gradient(i.values),i}return e.prototype.getLinearValue=function(t){return this.gradient(t)},e}(xa),G_=function(r){g.__extends(e,r);function e(t){var i=r.call(this,t)||this;return i.type="opacity",i.names=["opacity"],i}return e}(xa),Y_=function(r){g.__extends(e,r);function e(t){var i=r.call(this,t)||this;return i.names=["x","y"],i.type="position",i}return e.prototype.mapping=function(t,i){var n=this.scales,a=n[0],o=n[1];return D(t)||D(i)?[]:[O(t)?t.map(function(s){return a.scale(s)}):a.scale(t),O(i)?i.map(function(s){return o.scale(s)}):o.scale(i)]},e}(xa),$_=function(r){g.__extends(e,r);function e(t){var i=r.call(this,t)||this;return i.type="shape",i.names=["shape"],i}return e.prototype.getLinearValue=function(t){var i=Math.round((this.values.length-1)*t);return this.values[i]},e}(xa),H_=function(r){g.__extends(e,r);function e(t){var i=r.call(this,t)||this;return i.type="size",i.names=["size"],i}return e}(xa),Zg={};function X_(r){return Zg[r]}function Ue(r,e){Zg[r]=e}var tc=function(){function r(e){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__=e,this.initCfg(),this.init()}return r.prototype.translate=function(e){return e},r.prototype.change=function(e){ft(this.__cfg__,e),this.init()},r.prototype.clone=function(){return this.constructor(this.__cfg__)},r.prototype.getTicks=function(){var e=this;return xt(this.ticks,function(t,i){return pt(t)?t:{text:e.getText(t,i),tickValue:t,value:e.scale(t)}})},r.prototype.getText=function(e,t){var i=this.formatter,n=i?i(e,t):e;return D(n)||!W(n.toString)?"":n.toString()},r.prototype.getConfig=function(e){return this.__cfg__[e]},r.prototype.init=function(){ft(this,this.__cfg__),this.setDomain(),oe(this.getConfig("ticks"))&&(this.ticks=this.calculateTicks())},r.prototype.initCfg=function(){},r.prototype.setDomain=function(){},r.prototype.calculateTicks=function(){var e=this.tickMethod,t=[];if(K(e)){var i=X_(e);if(!i)throw new Error("There is no method to to calculate ticks!");t=i(this)}else W(e)&&(t=e(this));return t},r.prototype.rangeMin=function(){return this.range[0]},r.prototype.rangeMax=function(){return this.range[1]},r.prototype.calcPercent=function(e,t,i){return tt(e)?(e-t)/(i-t):NaN},r.prototype.calcValue=function(e,t,i){return t+e*(i-t)},r}(),gs=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="cat",t.isCategory=!0,t}return e.prototype.buildIndexMap=function(){if(!this.translateIndexMap){this.translateIndexMap=new Map;for(var t=0;tthis.max?NaN:this.values[a]},e.prototype.getText=function(t){for(var i=[],n=1;n1?t-1:t}this.translateIndexMap&&(this.translateIndexMap=void 0)},e}(tc),Qg=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,wr="\\d\\d?",yr="\\d\\d",W_="\\d{3}",q_="\\d{4}",Dn="[^\\s]+",Kg=/\[([^]*?)\]/gm;function Jg(r,e){for(var t=[],i=0,n=r.length;i-1?n:null}};function Dr(r){for(var e=[],t=1;t3?0:(r-r%10!==10?1:0)*r%10]}},ko=Dr({},ec),rp=function(r){return ko=Dr(ko,r)},Ff=function(r){return r.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},Kt=function(r,e){for(e===void 0&&(e=2),r=String(r);r.length0?"-":"+")+Kt(Math.floor(Math.abs(e)/60)*100+Math.abs(e)%60,4)},Z:function(r){var e=r.getTimezoneOffset();return(e>0?"-":"+")+Kt(Math.floor(Math.abs(e)/60),2)+":"+Kt(Math.abs(e)%60,2)}},Tf=function(r){return+r-1},Ef=[null,wr],kf=[null,Dn],Lf=["isPm",Dn,function(r,e){var t=r.toLowerCase();return t===e.amPm[0]?0:t===e.amPm[1]?1:null}],If=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(r){var e=(r+"").match(/([+-]|\d\d)/gi);if(e){var t=+e[1]*60+parseInt(e[2],10);return e[0]==="+"?t:-t}return 0}],Q_={D:["day",wr],DD:["day",yr],Do:["day",wr+Dn,function(r){return parseInt(r,10)}],M:["month",wr,Tf],MM:["month",yr,Tf],YY:["year",yr,function(r){var e=new Date,t=+(""+e.getFullYear()).substr(0,2);return+(""+(+r>68?t-1:t)+r)}],h:["hour",wr,void 0,"isPm"],hh:["hour",yr,void 0,"isPm"],H:["hour",wr],HH:["hour",yr],m:["minute",wr],mm:["minute",yr],s:["second",wr],ss:["second",yr],YYYY:["year",q_],S:["millisecond","\\d",function(r){return+r*100}],SS:["millisecond",yr,function(r){return+r*10}],SSS:["millisecond",W_],d:Ef,dd:Ef,ddd:kf,dddd:kf,MMM:["month",Dn,Af("monthNamesShort")],MMMM:["month",Dn,Af("monthNames")],a:Lf,A:Lf,ZZ:If,Z:If},Lo={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"},ip=function(r){return Dr(Lo,r)},np=function(r,e,t){if(e===void 0&&(e=Lo.default),t===void 0&&(t={}),typeof r=="number"&&(r=new Date(r)),Object.prototype.toString.call(r)!=="[object Date]"||isNaN(r.getTime()))throw new Error("Invalid Date pass to format");e=Lo[e]||e;var i=[];e=e.replace(Kg,function(a,o){return i.push(o),"@@@"});var n=Dr(Dr({},ko),t);return e=e.replace(Qg,function(a){return Z_[a](r,n)}),e.replace(/@@@/g,function(){return i.shift()})};function ap(r,e,t){if(t===void 0&&(t={}),typeof e!="string")throw new Error("Invalid format in fecha parse");if(e=Lo[e]||e,r.length>1e3)return null;var i=new Date,n={year:i.getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},a=[],o=[],s=e.replace(Kg,function(w,b){return o.push(Ff(b)),"@@@"}),l={},u={};s=Ff(s).replace(Qg,function(w){var b=Q_[w],C=b[0],A=b[1],F=b[3];if(l[C])throw new Error("Invalid format. "+C+" specified twice in format");return l[C]=!0,F&&(u[F]=!0),a.push(b),"("+A+")"}),Object.keys(u).forEach(function(w){if(!l[w])throw new Error("Invalid format. "+w+" is required in specified format")}),s=s.replace(/@@@/g,function(){return o.shift()});var c=r.match(new RegExp(s,"i"));if(!c)return null;for(var h=Dr(Dr({},ko),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 m}var op={format:np,parse:ap,defaultI18n:ec,setGlobalDateI18n:rp,setGlobalDateMasks:ip};const K_=Object.freeze(Object.defineProperty({__proto__:null,assign:Dr,default:op,defaultI18n:ec,format:np,parse:ap,setGlobalDateI18n:rp,setGlobalDateMasks:ip},Symbol.toStringTag,{value:"Module"}));function J_(r){return function(e,t,i,n){for(var a=D(i)?0:i,o=D(n)?e.length:n;a>>1;r(e[s])>t?o=s:a=s+1}return a}}var Pf="format";function sp(r,e){var t=K_[Pf]||op[Pf];return t(r,e)}function Io(r){return K(r)&&(r.indexOf("T")>0?r=new Date(r).getTime():r=new Date(r.replace(/-/gi,"/")).getTime()),Qd(r)&&(r=r.getTime()),r}var Ee=1e3,ai=60*Ee,oi=60*ai,nr=24*oi,Bn=nr*31,Df=nr*365,pn=[["HH:mm:ss",Ee],["HH:mm:ss",Ee*10],["HH:mm:ss",Ee*30],["HH:mm",ai],["HH:mm",ai*10],["HH:mm",ai*30],["HH",oi],["HH",oi*6],["HH",oi*12],["YYYY-MM-DD",nr],["YYYY-MM-DD",nr*4],["YYYY-WW",nr*7],["YYYY-MM",Bn],["YYYY-MM",Bn*4],["YYYY-MM",Bn*6],["YYYY",nr*380]];function tb(r,e,t){var i=(e-r)/t,n=J_(function(o){return o[1]})(pn,i)-1,a=pn[n];return n<0?a=pn[0]:n>=pn.length&&(a=It(pn)),a}var eb=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="timeCat",t}return e.prototype.translate=function(t){t=Io(t);var i=this.values.indexOf(t);return i===-1&&(tt(t)&&t-1){var a=this.values[n],o=this.formatter;return a=o?o(a,i):sp(a,this.mask),a}return t},e.prototype.initCfg=function(){this.tickMethod="time-cat",this.mask="YYYY-MM-DD",this.tickCount=7},e.prototype.setDomain=function(){var t=this.values;S(t,function(i,n){t[n]=Io(i)}),t.sort(function(i,n){return i-n}),r.prototype.setDomain.call(this)},e}(gs),ps=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.isContinuous=!0,t}return e.prototype.scale=function(t){if(D(t))return NaN;var i=this.rangeMin(),n=this.rangeMax(),a=this.max,o=this.min;if(a===o)return i;var s=this.getScalePercent(t);return i+s*(n-i)},e.prototype.init=function(){r.prototype.init.call(this);var t=this.ticks,i=fe(t),n=It(t);ithis.max&&(this.max=n),D(this.minLimit)||(this.min=i),D(this.maxLimit)||(this.max=n)},e.prototype.setDomain=function(){var t=Kd(this.values),i=t.min,n=t.max;D(this.min)&&(this.min=i),D(this.max)&&(this.max=n),this.min>this.max&&(this.min=i,this.max=n)},e.prototype.calculateTicks=function(){var t=this,i=r.prototype.calculateTicks.call(this);return this.nice||(i=Xt(i,function(n){return n>=t.min&&n<=t.max})),i},e.prototype.getScalePercent=function(t){var i=this.max,n=this.min;return(t-n)/(i-n)},e.prototype.getInvertPercent=function(t){return(t-this.rangeMin())/(this.rangeMax()-this.rangeMin())},e}(tc),ys=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="linear",t.isLinear=!0,t}return e.prototype.invert=function(t){var i=this.getInvertPercent(t);return this.min+i*(this.max-this.min)},e.prototype.initCfg=function(){this.tickMethod="wilkinson-extended",this.nice=!1},e}(ps);function Sr(r,e){var t=Math.E,i;return e>=0?i=Math.pow(t,Math.log(e)/r):i=Math.pow(t,Math.log(-e)/r)*-1,i}function xe(r,e){return r===1?1:Math.log(e)/Math.log(r)}function lp(r,e,t){D(t)&&(t=Math.max.apply(null,r));var i=t;return S(r,function(n){n>0&&n1&&(i=1),i}var rb=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="log",t}return e.prototype.invert=function(t){var i=this.base,n=xe(i,this.max),a=this.rangeMin(),o=this.rangeMax()-a,s,l=this.positiveMin;if(l){if(t===0)return 0;s=xe(i,l/i);var u=1/(n-s)*o;if(t=0?1:-1;return Math.pow(s,n)*l},e.prototype.initCfg=function(){this.tickMethod="pow",this.exponent=2,this.tickCount=5,this.nice=!0},e.prototype.getScalePercent=function(t){var i=this.max,n=this.min;if(i===n)return 0;var a=this.exponent,o=(Sr(a,t)-Sr(a,n))/(Sr(a,i)-Sr(a,n));return o},e}(ps),nb=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="time",t}return e.prototype.getText=function(t,i){var n=this.translate(t),a=this.formatter;return a?a(n,i):sp(n,this.mask)},e.prototype.scale=function(t){var i=t;return(K(i)||Qd(i))&&(i=this.translate(i)),r.prototype.scale.call(this,i)},e.prototype.translate=function(t){return Io(t)},e.prototype.initCfg=function(){this.tickMethod="time-pretty",this.mask="YYYY-MM-DD",this.tickCount=7,this.nice=!1},e.prototype.setDomain=function(){var t=this.values,i=this.getConfig("min"),n=this.getConfig("max");if((!D(i)||!tt(i))&&(this.min=this.translate(this.min)),(!D(n)||!tt(n))&&(this.max=this.translate(this.max)),t&&t.length){var a=[],o=1/0,s=o,l=0;S(t,function(u){var c=Io(u);if(isNaN(c))throw new TypeError("Invalid Time: "+u+" in time scale!");o>c?(s=o,o=c):s>c&&(s=c),l1&&(this.minTickInterval=s-o),D(i)&&(this.min=o),D(n)&&(this.max=l)}},e}(ys),up=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="quantize",t}return e.prototype.invert=function(t){var i=this.ticks,n=i.length,a=this.getInvertPercent(t),o=Math.floor(a*(n-1));if(o>=n-1)return It(i);if(o<0)return fe(i);var s=i[o],l=i[o+1],u=o/(n-1),c=(o+1)/(n-1);return s+(a-u)/(c-u)*(l-s)},e.prototype.initCfg=function(){this.tickMethod="r-pretty",this.tickCount=5,this.nice=!0},e.prototype.calculateTicks=function(){var t=r.prototype.calculateTicks.call(this);return this.nice||(It(t)!==this.max&&t.push(this.max),fe(t)!==this.min&&t.unshift(this.min)),t},e.prototype.getScalePercent=function(t){var i=this.ticks;if(tIt(i))return 1;var n=0;return S(i,function(a,o){if(t>=a)n=o;else return!1}),n/(i.length-1)},e}(ps),ab=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="quantile",t}return e.prototype.initCfg=function(){this.tickMethod="quantile",this.tickCount=5,this.nice=!0},e}(up),cp={};function ru(r){return cp[r]}function je(r,e){if(ru(r))throw new Error("type '"+r+"' existed.");cp[r]=e}var ob=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="identity",t.isIdentity=!0,t}return e.prototype.calculateTicks=function(){return this.values},e.prototype.scale=function(t){return this.values[0]!==t&&tt(t)?t:this.range[0]},e.prototype.invert=function(t){var i=this.range;return ti[1]?NaN:this.values[0]},e}(tc);function hp(r){var e=r.values,t=r.tickInterval,i=r.tickCount,n=r.showLast;if(tt(t)){var a=Xt(e,function(d,p){return p%t===0}),o=It(e);return n&&It(a)!==o&&a.push(o),a}var s=e.length,l=r.min,u=r.max;if(D(l)&&(l=0),D(u)&&(u=e.length-1),!tt(i)||i>=s)return e.slice(l,u+1);if(i<=0||u<=0)return[];for(var c=i===1?s:Math.floor(s/(i-1)),h=[],f=l,v=0;v=u);v++)f=Math.min(l+v*c,u),v===i-1&&n?h.push(e[u]):h.push(e[f]);return h}function sb(r){var e=r.min,t=r.max,i=r.nice,n=r.tickCount,a=new lb;return a.domain([e,t]),i&&a.nice(n),a.ticks(n)}var ll=5,Bf=Math.sqrt(50),Of=Math.sqrt(10),Rf=Math.sqrt(2),lb=function(){function r(){this._domain=[0,1]}return r.prototype.domain=function(e){return e?(this._domain=Array.from(e,Number),this):this._domain.slice()},r.prototype.nice=function(e){var t,i;e===void 0&&(e=ll);var n=this._domain.slice(),a=0,o=this._domain.length-1,s=this._domain[a],l=this._domain[o],u;return l0?(s=Math.floor(s/u)*u,l=Math.ceil(l/u)*u,u=vo(s,l,e)):u<0&&(s=Math.ceil(s*u)/u,l=Math.floor(l*u)/u,u=vo(s,l,e)),u>0?(n[a]=Math.floor(s/u)*u,n[o]=Math.ceil(l/u)*u,this.domain(n)):u<0&&(n[a]=Math.ceil(s*u)/u,n[o]=Math.floor(l*u)/u,this.domain(n)),this},r.prototype.ticks=function(e){return e===void 0&&(e=ll),ub(this._domain[0],this._domain[this._domain.length-1],e||ll)},r}();function ub(r,e,t){var i,n=-1,a,o,s;if(e=+e,r=+r,t=+t,r===e&&t>0)return[r];if((i=e0)for(r=Math.ceil(r/s),e=Math.floor(e/s),o=new Array(a=Math.ceil(e-r+1));++n=0?(a>=Bf?10:a>=Of?5:a>=Rf?2:1)*Math.pow(10,n):-Math.pow(10,-n)/(a>=Bf?10:a>=Of?5:a>=Rf?2:1)}function Nf(r,e,t){var i;return t==="ceil"?i=Math.ceil(r/e):t==="floor"?i=Math.floor(r/e):i=Math.round(r/e),i*e}function rc(r,e,t){var i=Nf(r,t,"floor"),n=Nf(e,t,"ceil");i=Qs(i,t),n=Qs(n,t);for(var a=[],o=Math.max((n-i)/(Math.pow(2,12)-1),t),s=i;s<=n;s=s+o){var l=Qs(s,o);a.push(l)}return{min:i,max:n,ticks:a}}function ic(r,e,t){var i,n=r.minLimit,a=r.maxLimit,o=r.min,s=r.max,l=r.tickCount,u=l===void 0?5:l,c=D(n)?D(e)?o:e:n,h=D(a)?D(t)?s:t:a;if(c>h&&(i=[c,h],h=i[0],c=i[1]),u<=2)return[c,h];for(var f=(h-c)/(u-1),v=[],d=0;d=0&&(l=1),1-s/(o-1)-t+l}function gb(r,e,t){var i=Bt(e),n=Jd(e,r),a=1;return 1-n/(i-1)-t+a}function pb(r,e,t,i,n,a){var o=(r-1)/(a-n),s=(e-1)/(Math.max(a,i)-Math.min(t,n));return 2-Math.max(o/s,s/o)}function yb(r,e){return r>=e?2-(r-1)/(e-1):1}function mb(r,e,t,i){var n=e-r;return 1-.5*(Math.pow(e-i,2)+Math.pow(r-t,2))/Math.pow(.1*n,2)}function xb(r,e,t){var i=e-r;if(t>i){var n=(t-i)/2;return 1-Math.pow(n,2)/Math.pow(.1*i,2)}return 1}function wb(){return 1}function _b(r,e,t,i,n,a){t===void 0&&(t=5),i===void 0&&(i=!0),n===void 0&&(n=hb),a===void 0&&(a=[.25,.2,.5,.05]);var o=t<0?0:Math.round(t);if(Number.isNaN(r)||Number.isNaN(e)||typeof r!="number"||typeof e!="number"||!o)return{min:0,max:0,ticks:[]};if(e-r<1e-15||o===1)return{min:r,max:e,ticks:[r]};if(e-r>1e148){var s=t||5,l=(e-r)/s;return{min:r,max:e,ticks:Array(s).fill(null).map(function(H,Z){return Ur(r+l*Z)})}}for(var u={score:-2,lmin:0,lmax:0,lstep:0},c=1;c<1/0;){for(var h=0;hu.score&&(!i||F<=r&&E>=e)&&(u.lmin=F,u.lmax=E,u.lstep=T,u.score=X)}m+=1}d+=1}}c+=1}var I=Ur(u.lmax),R=Ur(u.lmin),$=Ur(u.lstep),G=Math.floor(vb((I-R)/$))+1,V=new Array(G);V[0]=Ur(R);for(var h=1;h0)o=Math.floor(xe(e,i));else{var l=lp(a,e,n);o=Math.floor(xe(e,l))}for(var u=s-o,c=Math.ceil(u/t),h=[],f=o;f=0?1:-1;return Math.pow(o,e)*s})}function Mb(r,e){var t=r.length*e;return e===1?r[r.length-1]:e===0?r[0]:t%1!==0?r[Math.ceil(t)-1]:r.length%2===0?(r[t-1]+r[t])/2:r[t]}function Ab(r){var e=r.tickCount,t=r.values;if(!t||!t.length)return[];for(var i=t.slice().sort(function(s,l){return s-l}),n=[],a=0;a1&&(n=n*Math.ceil(s)),i&&nDf)for(var l=Po(t),u=Math.ceil(a/Df),c=s;c<=l+u;c=c+u)o.push(kb(c));else if(a>Bn)for(var h=Math.ceil(a/Bn),f=iu(e),v=Lb(e,t),c=0;c<=v+h;c=c+h)o.push(Ib(s,c+f));else if(a>nr)for(var d=new Date(e),p=d.getFullYear(),y=d.getMonth(),m=d.getDate(),x=Math.ceil(a/nr),_=Pb(e,t),c=0;c<_+x;c=c+x)o.push(new Date(p,y,m+c).getTime());else if(a>oi)for(var d=new Date(e),p=d.getFullYear(),y=d.getMonth(),x=d.getDate(),w=d.getHours(),b=Math.ceil(a/oi),C=Db(e,t),c=0;c<=C+b;c=c+b)o.push(new Date(p,y,x,w+c).getTime());else if(a>ai)for(var A=Bb(e,t),F=Math.ceil(a/ai),c=0;c<=A+F;c=c+F)o.push(e+c*ai);else{var E=a;E=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}Ue("cat",hp);Ue("time-cat",Eb);Ue("wilkinson-extended",bb);Ue("r-pretty",Fb);Ue("time",Tb);Ue("time-pretty",Ob);Ue("log",Sb);Ue("pow",Cb);Ue("quantile",Ab);Ue("d3-linear",cb);je("cat",gs);je("category",gs);je("identity",ob);je("linear",ys);je("log",rb);je("pow",ib);je("time",nb);je("timeCat",eb);je("quantize",up);je("quantile",ab);var vp={},dp=function(r){return vp[r.toLowerCase()]},wa=function(r,e){if(dp(r))throw new Error("Attribute type '".concat(r,"' existed."));vp[r.toLowerCase()]=e};wa("Color",V_);wa("Opacity",G_);wa("Position",Y_);wa("Shape",$_);wa("Size",H_);var nc=function(){function r(e){this.type="coordinate",this.isRect=!1,this.isHelix=!1,this.isPolar=!1,this.isReflectX=!1,this.isReflectY=!1;var t=e.start,i=e.end,n=e.matrix,a=n===void 0?[1,0,0,0,1,0,0,0,1]:n,o=e.isTransposed,s=o===void 0?!1:o;this.start=t,this.end=i,this.matrix=a,this.originalMatrix=g.__spreadArray([],a),this.isTransposed=s}return r.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)},r.prototype.update=function(e){ft(this,e),this.initial()},r.prototype.convertDim=function(e,t){var i,n=this[t],a=n.start,o=n.end;return this.isReflect(t)&&(i=[o,a],a=i[0],o=i[1]),a+e*(o-a)},r.prototype.invertDim=function(e,t){var i,n=this[t],a=n.start,o=n.end;return this.isReflect(t)&&(i=[o,a],a=i[0],o=i[1]),(e-a)/(o-a)},r.prototype.applyMatrix=function(e,t,i){i===void 0&&(i=0);var n=this.matrix,a=[e,t,i];return Hn(a,a,n),a},r.prototype.invertMatrix=function(e,t,i){i===void 0&&(i=0);var n=this.matrix,a=kx([0,0,0,0,0,0,0,0,0],n),o=[e,t,i];return a&&Hn(o,o,a),o},r.prototype.convert=function(e){var t=this.convertPoint(e),i=t.x,n=t.y,a=this.applyMatrix(i,n,1);return{x:a[0],y:a[1]}},r.prototype.invert=function(e){var t=this.invertMatrix(e.x,e.y,1);return this.invertPoint({x:t[0],y:t[1]})},r.prototype.rotate=function(e){var t=this.matrix,i=this.center;return vn(t,t,[-i.x,-i.y]),tg(t,t,e),vn(t,t,[i.x,i.y]),this},r.prototype.reflect=function(e){return e==="x"?this.isReflectX=!this.isReflectX:this.isReflectY=!this.isReflectY,this},r.prototype.scale=function(e,t){var i=this.matrix,n=this.center;return vn(i,i,[-n.x,-n.y]),Lx(i,i,[e,t]),vn(i,i,[n.x,n.y]),this},r.prototype.translate=function(e,t){var i=this.matrix;return vn(i,i,[e,t]),this},r.prototype.transpose=function(){return this.isTransposed=!this.isTransposed,this},r.prototype.getCenter=function(){return this.center},r.prototype.getWidth=function(){return this.width},r.prototype.getHeight=function(){return this.height},r.prototype.getRadius=function(){return this.radius},r.prototype.isReflect=function(e){return e==="x"?this.isReflectX:this.isReflectY},r.prototype.resetMatrix=function(e){this.matrix=e||g.__spreadArray([],this.originalMatrix)},r}(),gp=function(r){g.__extends(e,r);function e(t){var i=r.call(this,t)||this;return i.isRect=!0,i.type="cartesian",i.initial(),i}return e.prototype.initial=function(){r.prototype.initial.call(this);var t=this.start,i=this.end;this.x={start:t.x,end:i.x},this.y={start:t.y,end:i.y}},e.prototype.convertPoint=function(t){var i,n=t.x,a=t.y;return this.isTransposed&&(i=[a,n],n=i[0],a=i[1]),{x:this.convertDim(n,"x"),y:this.convertDim(a,"y")}},e.prototype.invertPoint=function(t){var i,n=this.invertDim(t.x,"x"),a=this.invertDim(t.y,"y");return this.isTransposed&&(i=[a,n],n=i[0],a=i[1]),{x:n,y:a}},e}(nc),Rb=function(r){g.__extends(e,r);function e(t){var i=r.call(this,t)||this;i.isHelix=!0,i.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,u=l===void 0?0:l,c=t.radius;return i.startAngle=a,i.endAngle=s,i.innerRadius=u,i.radius=c,i.initial(),i}return e.prototype.initial=function(){r.prototype.initial.call(this);var t=(this.endAngle-this.startAngle)/(2*Math.PI)+1,i=Math.min(this.width,this.height)/2;this.radius&&this.radius>=0&&this.radius<=1&&(i=i*this.radius),this.d=Math.floor(i*(1-this.innerRadius)/t),this.a=this.d/(Math.PI*2),this.x={start:this.startAngle,end:this.endAngle},this.y={start:this.innerRadius*i,end:this.innerRadius*i+this.d*.99}},e.prototype.convertPoint=function(t){var i,n=t.x,a=t.y;this.isTransposed&&(i=[a,n],n=i[0],a=i[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)}},e.prototype.invertPoint=function(t){var i,n=this.d+this.y.start,a=Ix([0,0],[t.x,t.y],[this.center.x,this.center.y]),o=zu(a,[1,0],!0),s=o*this.a;Ii(a)this.width/i?(s=this.width/i,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*i,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}},e.prototype.getRadius=function(){return this.polarRadius},e.prototype.convertPoint=function(t){var i,n=this.getCenter(),a=t.x,o=t.y;return this.isTransposed&&(i=[o,a],a=i[0],o=i[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}},e.prototype.invertPoint=function(t){var i,n=this.getCenter(),a=[t.x-n.x,t.y-n.y],o=this,s=o.startAngle,l=o.endAngle;this.isReflect("x")&&(i=[l,s],s=i[0],l=i[1]);var u=[1,0,0,0,1,0,0,0,1];tg(u,u,s);var c=[1,0,0];Hn(c,c,u);var h=[c[0],c[1]],f=zu(h,a,l0?d:-d;var p=this.invertDim(v,"y"),y={x:0,y:0};return y.x=this.isTransposed?p:d,y.y=this.isTransposed?d:p,y},e.prototype.getCenter=function(){return this.circleCenter},e.prototype.getOneBox=function(){var t=this.startAngle,i=this.endAngle;if(Math.abs(i-t)>=Math.PI*2)return{minX:-1,maxX:1,minY:-1,maxY:1};for(var n=[0,Math.cos(t),Math.cos(i)],a=[0,Math.sin(t),Math.sin(i)],o=Math.min(t,i);o=0;i--)r.removeChild(e[i])}function Yb(r,e){return!!r.className.match(new RegExp("(\\s|^)"+e+"(\\s|$)"))}function Qn(r){var e=r.start,t=r.end,i=Math.min(e.x,t.x),n=Math.min(e.y,t.y),a=Math.max(e.x,t.x),o=Math.max(e.y,t.y);return{x:i,y:n,minX:i,minY:n,maxX:a,maxY:o,width:a-i,height:o-n}}function $b(r){var e=r.map(function(s){return s.x}),t=r.map(function(s){return s.y}),i=Math.min.apply(Math,e),n=Math.min.apply(Math,t),a=Math.max.apply(Math,e),o=Math.max.apply(Math,t);return{x:i,y:n,minX:i,minY:n,maxX:a,maxY:o,width:a-i,height:o-n}}function xs(r,e,t,i){var n=r+t,a=e+i;return{x:r,y:e,width:t,height:i,minX:r,minY:e,maxX:isNaN(n)?0:n,maxY:isNaN(a)?0:a}}function si(r,e,t){return(1-t)*r+e*t}function Ni(r,e,t){return{x:r.x+Math.cos(t)*e,y:r.y+Math.sin(t)*e}}function Hb(r,e){var t=e.x-r.x,i=e.y-r.y;return Math.sqrt(t*t+i*i)}var Bo=function(r,e,t){return t===void 0&&(t=Math.pow(Number.EPSILON,.5)),[r,e].includes(1/0)?Math.abs(r)===Math.abs(e):Math.abs(r-e)0?S(l,function(u){if(u.get("visible")){if(u.isGroup()&&u.get("children").length===0)return!0;var c=wp(u),h=u.applyToMatrix([c.minX,c.minY,1]),f=u.applyToMatrix([c.minX,c.maxY,1]),v=u.applyToMatrix([c.maxX,c.minY,1]),d=u.applyToMatrix([c.maxX,c.maxY,1]),p=Math.min(h[0],f[0],v[0],d[0]),y=Math.max(h[0],f[0],v[0],d[0]),m=Math.min(h[1],f[1],v[1],d[1]),x=Math.max(h[1],f[1],v[1],d[1]);pa&&(a=y),ms&&(s=x)}}):(n=0,a=0,o=0,s=0),i=xs(n,o,a-n,s-o)}return t?Xb(i,t):i}function Wb(r,e){if(!(!r.getClip()&&!e.getClip())){var t=e.getClip();if(!t){r.setClip(null);return}var i={type:t.get("type"),attrs:t.attr()};r.setClip(i)}}function ee(r){return r+"px"}function _p(r,e,t,i){var n=Hb(r,e),a=i/n,o=0;return t==="start"?o=0-a:t==="end"&&(o=1+a),{x:si(r.x,e.x,o),y:si(r.y,e.y,o)}}var qb={none:[],point:["x","y"],region:["start","end"],points:["points"],circle:["center","radius","startAngle","endAngle"]},bp=function(r){g.__extends(e,r);function e(t){var i=r.call(this,t)||this;return i.initCfg(),i}return e.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}},e.prototype.clear=function(){},e.prototype.update=function(t){var i=this,n=this.get("defaultCfg")||{};S(t,function(a,o){var s=i.get(o),l=a;s!==a&&(pt(a)&&n[o]&&(l=Y({},n[o],a)),i.set(o,l))}),this.updateInner(t),this.afterUpdate(t)},e.prototype.updateInner=function(t){},e.prototype.afterUpdate=function(t){Ir(t,"visible")&&(t.visible?this.show():this.hide()),Ir(t,"capture")&&this.setCapture(t.capture)},e.prototype.getLayoutBBox=function(){return this.getBBox()},e.prototype.getLocationType=function(){return this.get("locationType")},e.prototype.getOffset=function(){return{offsetX:this.get("offsetX"),offsetY:this.get("offsetY")}},e.prototype.setOffset=function(t,i){this.update({offsetX:t,offsetY:i})},e.prototype.setLocation=function(t){var i=g.__assign({},t);this.update(i)},e.prototype.getLocation=function(){var t=this,i={},n=this.get("locationType"),a=qb[n];return S(a,function(o){i[o]=t.get(o)}),i},e.prototype.isList=function(){return!1},e.prototype.isSlider=function(){return!1},e.prototype.init=function(){},e.prototype.initCfg=function(){var t=this,i=this.get("defaultCfg");S(i,function(n,a){var o=t.get(a);if(pt(o)){var s=Y({},n,o);t.set(a,s)}})},e}(es),Wr="update_status",Ub=["visible","tip","delegateObject"],jb=["container","group","shapesMap","isRegister","isUpdating","destroyed"],Wt=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return g.__assign(g.__assign({},t),{container:null,shapesMap:{},group:null,capture:!0,isRegister:!1,isUpdating:!1,isInit:!0})},e.prototype.remove=function(){this.clear();var t=this.get("group");t.remove()},e.prototype.clear=function(){var t=this.get("group");t.clear(),this.set("shapesMap",{}),this.clearOffScreenCache(),this.set("isInit",!0)},e.prototype.getChildComponentById=function(t){var i=this.getElementById(t),n=i&&i.get("component");return n},e.prototype.getElementById=function(t){return this.get("shapesMap")[t]},e.prototype.getElementByLocalId=function(t){var i=this.getElementId(t);return this.getElementById(i)},e.prototype.getElementsByName=function(t){var i=[];return S(this.get("shapesMap"),function(n){n.get("name")===t&&i.push(n)}),i},e.prototype.getContainer=function(){return this.get("container")},e.prototype.updateInner=function(t){this.offScreenRender(),this.get("updateAutoRender")&&this.render()},e.prototype.render=function(){var t=this.get("offScreenGroup");t||(t=this.offScreenRender());var i=this.get("group");this.updateElements(t,i),this.deleteElements(),this.applyOffset(),this.get("eventInitted")||(this.initEvent(),this.set("eventInitted",!0)),this.set("isInit",!1)},e.prototype.show=function(){var t=this.get("group");t.show(),this.set("visible",!0)},e.prototype.hide=function(){var t=this.get("group");t.hide(),this.set("visible",!1)},e.prototype.setCapture=function(t){var i=this.get("group");i.set("capture",t),this.set("capture",t)},e.prototype.destroy=function(){this.removeEvent(),this.remove(),r.prototype.destroy.call(this)},e.prototype.getBBox=function(){return this.get("group").getCanvasBBox()},e.prototype.getLayoutBBox=function(){var t=this.get("group"),i=this.getInnerLayoutBBox(),n=t.getTotalMatrix();return n&&(i=Gb(n,i)),i},e.prototype.on=function(t,i,n){var a=this.get("group");return a.on(t,i,n),this},e.prototype.off=function(t,i){var n=this.get("group");return n&&n.off(t,i),this},e.prototype.emit=function(t,i){var n=this.get("group");n.emit(t,i)},e.prototype.init=function(){r.prototype.init.call(this),this.get("group")||this.initGroup(),this.offScreenRender()},e.prototype.getInnerLayoutBBox=function(){return this.get("offScreenBBox")||this.get("group").getBBox()},e.prototype.delegateEmit=function(t,i){var n=this.get("group");i.target=n,n.emit(t,i),yp(n,t,i)},e.prototype.createOffScreenGroup=function(){var t=this.get("group"),i=t.getGroupBase(),n=new i({delegateObject:this.getDelegateObject()});return n},e.prototype.applyOffset=function(){var t=this.get("offsetX"),i=this.get("offsetY");this.moveElementTo(this.get("group"),{x:t,y:i})},e.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()}))},e.prototype.offScreenRender=function(){this.clearOffScreenCache();var t=this.createOffScreenGroup();return this.renderInner(t),this.set("offScreenGroup",t),this.set("offScreenBBox",wp(t)),t},e.prototype.addGroup=function(t,i){this.appendDelegateObject(t,i);var n=t.addGroup(i);return this.get("isRegister")&&this.registerElement(n),n},e.prototype.addShape=function(t,i){this.appendDelegateObject(t,i);var n=t.addShape(i);return this.get("isRegister")&&this.registerElement(n),n},e.prototype.addComponent=function(t,i){var n=i.id,a=i.component,o=g.__rest(i,["id","component"]),s=new a(g.__assign(g.__assign({},o),{id:n,container:t,updateAutoRender:this.get("updateAutoRender")}));return s.init(),s.render(),this.get("isRegister")&&this.registerElement(s.get("group")),s},e.prototype.initEvent=function(){},e.prototype.removeEvent=function(){var t=this.get("group");t.off()},e.prototype.getElementId=function(t){var i=this.get("id"),n=this.get("name");return i+"-"+n+"-"+t},e.prototype.registerElement=function(t){var i=t.get("id");this.get("shapesMap")[i]=t},e.prototype.unregisterElement=function(t){var i=t.get("id");delete this.get("shapesMap")[i]},e.prototype.moveElementTo=function(t,i){var n=ac(i);t.attr("matrix",n)},e.prototype.addAnimation=function(t,i,n){var a=i.attr("opacity");D(a)&&(a=1),i.attr("opacity",0),i.animate({opacity:a},n)},e.prototype.removeAnimation=function(t,i,n){i.animate({opacity:0},n)},e.prototype.updateAnimation=function(t,i,n,a){i.animate(n,a)},e.prototype.updateElements=function(t,i){var n=this,a=this.get("animate"),o=this.get("animateOption"),s=t.getChildren().slice(0),l;S(s,function(u){var c=u.get("id"),h=n.getElementById(c),f=u.get("name");if(h)if(u.get("isComponent")){var v=u.get("component"),d=h.get("component"),p=Vu(v.cfg,Dx(pa(v.cfg),jb));d.update(p),h.set(Wr,"update")}else{var y=n.getReplaceAttrs(h,u);a&&o.update?n.updateAnimation(f,h,y,o.update):h.attr(y),u.isGroup()&&n.updateElements(u,h),S(Ub,function(w){h.set(w,u.get(w))}),Wb(h,u),l=h,h.set(Wr,"update")}else{i.add(u);var m=i.getChildren();if(m.splice(m.length-1,1),l){var x=m.indexOf(l);m.splice(x+1,0,u)}else m.unshift(u);if(n.registerElement(u),u.set(Wr,"add"),u.get("isComponent")){var v=u.get("component");v.set("container",i)}else u.isGroup()&&n.registerNewGroup(u);if(l=u,a){var _=n.get("isInit")?o.appear:o.enter;_&&n.addAnimation(f,u,_)}}})},e.prototype.clearUpdateStatus=function(t){var i=t.getChildren();S(i,function(n){n.set(Wr,null)})},e.prototype.clearOffScreenCache=function(){var t=this.get("offScreenGroup");t&&t.destroy(),this.set("offScreenGroup",null),this.set("offScreenBBox",null)},e.prototype.getDelegateObject=function(){var t,i=this.get("name"),n=(t={},t[i]=this,t.component=this,t);return n},e.prototype.appendDelegateObject=function(t,i){var n=t.get("delegateObject");i.delegateObject||(i.delegateObject={}),ft(i.delegateObject,n)},e.prototype.getReplaceAttrs=function(t,i){var n=t.attr(),a=i.attr();return S(n,function(o,s){a[s]===void 0&&(a[s]=void 0)}),a},e.prototype.registerNewGroup=function(t){var i=this,n=t.getChildren();S(n,function(a){i.registerElement(a),a.set(Wr,"add"),a.isGroup()&&i.registerNewGroup(a)})},e.prototype.deleteElements=function(){var t=this,i=this.get("shapesMap"),n=[];S(i,function(s,l){!s.get(Wr)||s.destroyed?n.push([l,s]):s.set(Wr,null)});var a=this.get("animate"),o=this.get("animateOption");S(n,function(s){var l=s[0],u=s[1];if(!u.destroyed){var c=u.get("name");if(a&&o.leave){var h=ft({callback:function(){t.removeElement(u)}},o.leave);t.removeAnimation(c,u,h)}else t.removeElement(u)}delete i[l]})},e.prototype.removeElement=function(t){if(t.get("isGroup")){var i=t.get("component");i&&i.destroy()}t.remove()},e}(bp),ul="…";function Zb(r){for(var e=0,t=0;t0&&r.charCodeAt(e)<128?1:2}function Qb(r,e,t){t===void 0&&(t="tail");var i=r.length,n="";if(t==="tail"){for(var a=0,o=0;a=19968&&s<=40869?a+=2:a+=1}a>t&&(t=a,i=n)}return r[i].getBBox().width}function nu(r){if(r.length>tS)return eS(r);var e=0;return S(r,function(t){var i=t.getBBox(),n=i.width;e=0?f=Qb(a,h,i):f=Kb,f&&(e.attr("text",f),c=!0)}return c?e.set("tip",a):e.set("tip",null),c}function ws(r,e){var t=e.x,i=e.y,n=e.content,a=e.style,o=e.id,s=e.name,l=e.rotate,u=e.maxLength,c=e.autoEllipsis,h=e.isVertical,f=e.ellipsisPosition,v=e.background,d=r.addGroup({id:o+"-group",name:s+"-group",attrs:{x:t,y:i}}),p=d.addShape({type:"text",id:o,name:s,attrs:g.__assign({x:0,y:0,text:n},a)}),y=Do(M(v,"padding",0));if(u&&c){var m=u-(y[1]+y[3]);On(!h,p,m,f)}if(v){var x=M(v,"style",{}),_=p.getCanvasBBox(),w=_.minX,b=_.minY,C=_.width,A=_.height,F=d.addShape("rect",{id:o+"-bg",name:o+"-bg",attrs:g.__assign({x:w-y[3],y:b-y[0],width:C+y[1]+y[3],height:A+y[0]+y[2]},x)});F.toBack()}oc(d,t,i),xp(d,l,t,i)}const at={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 iS=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return g.__assign(g.__assign({},t),{name:"annotation",type:"line",locationType:"region",start:null,end:null,style:{},text:null,defaultCfg:{style:{fill:at.textColor,fontSize:12,textAlign:"center",textBaseline:"bottom",fontFamily:at.fontFamily},text:{position:"center",autoRotate:!0,content:null,offsetX:0,offsetY:0,style:{stroke:at.lineColor,lineWidth:1}}}})},e.prototype.renderInner=function(t){this.renderLine(t),this.get("text")&&this.renderLabel(t)},e.prototype.renderLine=function(t){var i=this.get("start"),n=this.get("end"),a=this.get("style");this.addShape(t,{type:"line",id:this.getElementId("line"),name:"annotation-line",attrs:g.__assign({x1:i.x,y1:i.y,x2:n.x,y2:n.y},a)})},e.prototype.getLabelPoint=function(t,i,n){var a;return n==="start"?a=0:n==="center"?a=.5:K(n)&&n.indexOf("%")!==-1?a=parseInt(n,10)/100:tt(n)?a=n:a=1,(a>1||a<0)&&(a=1),{x:si(t.x,i.x,a),y:si(t.y,i.y,a)}},e.prototype.renderLabel=function(t){var i=this.get("text"),n=this.get("start"),a=this.get("end"),o=i.position,s=i.content,l=i.style,u=i.offsetX,c=i.offsetY,h=i.autoRotate,f=i.maxLength,v=i.autoEllipsis,d=i.ellipsisPosition,p=i.background,y=i.isVertical,m=y===void 0?!1:y,x=this.getLabelPoint(n,a,o),_=x.x+u,w=x.y+c,b={id:this.getElementId("line-text"),name:"annotation-line-text",x:_,y:w,content:s,style:l,maxLength:f,autoEllipsis:v,ellipsisPosition:d,background:p,isVertical:m};if(h){var C=[a.x-n.x,a.y-n.y];b.rotate=Math.atan2(C[1],C[0])}ws(t,b)},e}(Wt),nS=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return g.__assign(g.__assign({},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:at.textColor,fontSize:12,textAlign:"center",textBaseline:"middle",fontFamily:at.fontFamily}}})},e.prototype.setLocation=function(t){this.set("x",t.x),this.set("y",t.y),this.resetLocation()},e.prototype.renderInner=function(t){var i=this.getLocation(),n=i.x,a=i.y,o=this.get("content"),s=this.get("style"),l=this.getElementId("text"),u=this.get("name")+"-text",c=this.get("maxLength"),h=this.get("autoEllipsis"),f=this.get("isVertical"),v=this.get("ellipsisPosition"),d=this.get("background"),p=this.get("rotate"),y={id:l,name:u,x:n,y:a,content:o,style:s,maxLength:c,autoEllipsis:h,isVertical:f,ellipsisPosition:v,background:d,rotate:p};ws(t,y)},e.prototype.resetLocation=function(){var t=this.getElementByLocalId("text-group");if(t){var i=this.getLocation(),n=i.x,a=i.y,o=this.get("rotate");oc(t,n,a),xp(t,o,n,a)}},e}(Wt),aS=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return g.__assign(g.__assign({},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}})},e.prototype.renderInner=function(t){this.renderArc(t)},e.prototype.getArcPath=function(){var t=this.getLocation(),i=t.center,n=t.radius,a=t.startAngle,o=t.endAngle,s=Ni(i,n,a),l=Ni(i,n,o),u=o-a>Math.PI?1:0,c=[["M",s.x,s.y]];if(o-a===Math.PI*2){var h=Ni(i,n,a+Math.PI);c.push(["A",n,n,0,u,1,h.x,h.y]),c.push(["A",n,n,0,u,1,l.x,l.y])}else c.push(["A",n,n,0,u,1,l.x,l.y]);return c},e.prototype.renderArc=function(t){var i=this.getArcPath(),n=this.get("style");this.addShape(t,{type:"path",id:this.getElementId("arc"),name:"annotation-arc",attrs:g.__assign({path:i},n)})},e}(Wt),oS=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return g.__assign(g.__assign({},t),{name:"annotation",type:"region",locationType:"region",start:null,end:null,style:{},defaultCfg:{style:{lineWidth:0,fill:at.regionColor,opacity:.4}}})},e.prototype.renderInner=function(t){this.renderRegion(t)},e.prototype.renderRegion=function(t){var i=this.get("start"),n=this.get("end"),a=this.get("style"),o=Qn({start:i,end:n});this.addShape(t,{type:"rect",id:this.getElementId("region"),name:"annotation-region",attrs:g.__assign({x:o.x,y:o.y,width:o.width,height:o.height},a)})},e}(Wt),sS=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return g.__assign(g.__assign({},t),{name:"annotation",type:"image",locationType:"region",start:null,end:null,src:null,style:{}})},e.prototype.renderInner=function(t){this.renderImage(t)},e.prototype.getImageAttrs=function(){var t=this.get("start"),i=this.get("end"),n=this.get("style"),a=Qn({start:t,end:i}),o=this.get("src");return g.__assign({x:a.x,y:a.y,img:o,width:a.width,height:a.height},n)},e.prototype.renderImage=function(t){this.addShape(t,{type:"image",id:this.getElementId("image"),name:"annotation-image",attrs:this.getImageAttrs()})},e}(Wt),lS=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return g.__assign(g.__assign({},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:at.lineColor,lineWidth:1}},text:{content:"",display:!0,style:{fill:at.textColor,opacity:.65,fontSize:12,textAlign:"start",fontFamily:at.fontFamily}}}})},e.prototype.renderInner=function(t){M(this.get("line"),"display")&&this.renderLine(t),M(this.get("text"),"display")&&this.renderText(t),M(this.get("point"),"display")&&this.renderPoint(t),this.get("autoAdjust")&&this.autoAdjust(t)},e.prototype.applyOffset=function(){this.moveElementTo(this.get("group"),{x:this.get("x")+this.get("offsetX"),y:this.get("y")+this.get("offsetY")})},e.prototype.renderPoint=function(t){var i=this.getShapeAttrs().point;this.addShape(t,{type:"circle",id:this.getElementId("point"),name:"annotation-point",attrs:i})},e.prototype.renderLine=function(t){var i=this.getShapeAttrs().line;this.addShape(t,{type:"path",id:this.getElementId("line"),name:"annotation-line",attrs:i})},e.prototype.renderText=function(t){var i=this.getShapeAttrs().text,n=i.x,a=i.y,o=i.text,s=g.__rest(i,["x","y","text"]),l=this.get("text"),u=l.background,c=l.maxLength,h=l.autoEllipsis,f=l.isVertival,v=l.ellipsisPosition,d={x:n,y:a,id:this.getElementId("text"),name:"annotation-text",content:o,style:s,background:u,maxLength:c,autoEllipsis:h,isVertival:f,ellipsisPosition:v};ws(t,d)},e.prototype.autoAdjust=function(t){var i=this.get("direction"),n=this.get("x"),a=this.get("y"),o=M(this.get("line"),"length",0),s=this.get("coordinateBBox"),l=t.getBBox(),u=l.minX,c=l.maxX,h=l.minY,f=l.maxY,v=t.findById(this.getElementId("text-group")),d=t.findById(this.getElementId("text")),p=t.findById(this.getElementId("line"));if(s&&v){var y=v.attr("x"),m=v.attr("y"),x=d.getCanvasBBox(),_=x.width,w=x.height,b=0,C=0;if(n+u<=s.minX)if(i==="leftward")b=1;else{var A=s.minX-(n+u);y=v.attr("x")+A}else if(n+c>=s.maxX)if(i==="rightward")b=-1;else{var A=n+c-s.maxX;y=v.attr("x")-A}if(b&&(p&&p.attr("path",[["M",0,0],["L",o*b,0]]),y=(o+2+_)*b),a+h<=s.minY)if(i==="upward")C=1;else{var A=s.minY-(a+h);m=v.attr("y")+A}else if(a+f>=s.maxY)if(i==="downward")C=-1;else{var A=a+f-s.maxY;m=v.attr("y")-A}C&&(p&&p.attr("path",[["M",0,0],["L",0,o*C]]),m=(o+2+w)*C),(y!==v.attr("x")||m!==v.attr("y"))&&oc(v,y,m)}},e.prototype.getShapeAttrs=function(){var t=M(this.get("line"),"display"),i=M(this.get("point"),"style",{}),n=M(this.get("line"),"style",{}),a=M(this.get("text"),"style",{}),o=this.get("direction"),s=t?M(this.get("line"),"length",0):0,l=0,u=0,c="top",h="start";switch(o){case"upward":u=-1,c="bottom";break;case"downward":u=1,c="top";break;case"leftward":l=-1,h="end";break;case"rightward":l=1,h="start";break}return{point:g.__assign({x:0,y:0},i),line:g.__assign({path:[["M",0,0],["L",s*l,s*u]]},n),text:g.__assign({x:(s+2)*l,y:(s+2)*u,text:M(this.get("text"),"content",""),textBaseline:c,textAlign:h},a)}},e}(Wt),uS=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return g.__assign(g.__assign({},t),{name:"annotation",type:"dataRegion",locationType:"points",points:[],lineLength:0,region:{},text:{},defaultCfg:{region:{style:{lineWidth:0,fill:at.regionColor,opacity:.4}},text:{content:"",style:{textAlign:"center",textBaseline:"bottom",fontSize:12,fill:at.textColor,fontFamily:at.fontFamily}}}})},e.prototype.renderInner=function(t){var i=M(this.get("region"),"style",{});M(this.get("text"),"style",{});var n=this.get("lineLength")||0,a=this.get("points");if(a.length){var o=$b(a),s=[];s.push(["M",a[0].x,o.minY-n]),a.forEach(function(u){s.push(["L",u.x,u.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:g.__assign({path:s},i)});var l=g.__assign({id:this.getElementId("text"),name:"annotation-text",x:(o.minX+o.maxX)/2,y:o.minY-n},this.get("text"));ws(t,l)}},e}(Wt),cS=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return g.__assign(g.__assign({},t),{name:"annotation",type:"regionFilter",locationType:"region",start:null,end:null,color:null,shape:[]})},e.prototype.renderInner=function(t){var i=this,n=this.get("start"),a=this.get("end"),o=this.addGroup(t,{id:this.getElementId("region-filter"),capture:!1});S(this.get("shapes"),function(l,u){var c=l.get("type"),h=he(l.attr());i.adjustShapeAttrs(h),i.addShape(o,{id:i.getElementId("shape-"+c+"-"+u),capture:!1,type:c,attrs:h})});var s=Qn({start:n,end:a});o.setClip({type:"rect",attrs:{x:s.minX,y:s.minY,width:s.width,height:s.height}})},e.prototype.adjustShapeAttrs=function(t){var i=this.get("color");t.fill&&(t.fill=t.fillStyle=i),t.stroke=t.strokeStyle=i},e}(Wt),hS=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return g.__assign(g.__assign({},t),{name:"annotation",type:"shape",draw:Mr})},e.prototype.renderInner=function(t){var i=this.get("render");W(i)&&i(t)},e}(Wt),lc=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return g.__assign(g.__assign({},t),{container:null,containerTpl:"
",updateAutoRender:!0,containerClassName:"",parent:null})},e.prototype.getContainer=function(){return this.get("container")},e.prototype.show=function(){var t=this.get("container");t.style.display="",this.set("visible",!0)},e.prototype.hide=function(){var t=this.get("container");t.style.display="none",this.set("visible",!1)},e.prototype.setCapture=function(t){var i=this.getContainer(),n=t?"auto":"none";i.style.pointerEvents=n,this.set("capture",t)},e.prototype.getBBox=function(){var t=this.getContainer(),i=parseFloat(t.style.left)||0,n=parseFloat(t.style.top)||0;return xs(i,n,t.clientWidth,t.clientHeight)},e.prototype.clear=function(){var t=this.get("container");sc(t)},e.prototype.destroy=function(){this.removeEvent(),this.removeDom(),r.prototype.destroy.call(this)},e.prototype.init=function(){r.prototype.init.call(this),this.initContainer(),this.initDom(),this.resetStyles(),this.applyStyles(),this.initEvent(),this.initCapture(),this.initVisible()},e.prototype.initCapture=function(){this.setCapture(this.get("capture"))},e.prototype.initVisible=function(){this.get("visible")?this.show():this.hide()},e.prototype.initDom=function(){},e.prototype.initContainer=function(){var t=this.get("container");if(D(t)){t=this.createDom();var i=this.get("parent");K(i)&&(i=document.getElementById(i),this.set("parent",i)),i.appendChild(t),this.get("containerId")&&t.setAttribute("id",this.get("containerId")),this.set("container",t)}else K(t)&&(t=document.getElementById(t),this.set("container",t));this.get("parent")||this.set("parent",t.parentNode)},e.prototype.resetStyles=function(){var t=this.get("domStyles"),i=this.get("defaultStyles");t?t=Y({},i,t):t=i,this.set("domStyles",t)},e.prototype.applyStyles=function(){var t=this.get("domStyles");if(t){var i=this.getContainer();this.applyChildrenStyles(i,t);var n=this.get("containerClassName");if(n&&Yb(i,n)){var a=t[n];qt(i,a)}}},e.prototype.applyChildrenStyles=function(t,i){S(i,function(n,a){var o=t.getElementsByClassName(a);S(o,function(s){qt(s,n)})})},e.prototype.applyStyle=function(t,i){var n=this.get("domStyles");qt(i,n[t])},e.prototype.createDom=function(){var t=this.get("containerTpl");return Er(t)},e.prototype.initEvent=function(){},e.prototype.removeDom=function(){var t=this.get("container");t&&t.parentNode&&t.parentNode.removeChild(t)},e.prototype.removeEvent=function(){},e.prototype.updateInner=function(t){Ir(t,"domStyles")&&(this.resetStyles(),this.applyStyles()),this.resetPosition()},e.prototype.resetPosition=function(){},e}(bp),fS=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return g.__assign(g.__assign({},t),{name:"annotation",type:"html",locationType:"point",x:0,y:0,containerTpl:'
',alignX:"left",alignY:"top",html:"",zIndex:7})},e.prototype.render=function(){var t=this.getContainer(),i=this.get("html");sc(t);var n=W(i)?i(t):i;if(eg(n))t.appendChild(n);else if(K(n)||tt(n)){var a=Er(""+n);a&&t.appendChild(a)}this.resetPosition()},e.prototype.resetPosition=function(){var t=this.getContainer(),i=this.getLocation(),n=i.x,a=i.y,o=this.get("alignX"),s=this.get("alignY"),l=this.get("offsetX"),u=this.get("offsetY"),c=Jx(t),h=Qx(t),f={x:n,y:a};o==="middle"?f.x-=Math.round(c/2):o==="right"&&(f.x-=Math.round(c)),s==="middle"?f.y-=Math.round(h/2):s==="bottom"&&(f.y-=Math.round(h)),l&&(f.x+=l),u&&(f.y+=u),qt(t,{position:"absolute",left:f.x+"px",top:f.y+"px",zIndex:this.get("zIndex")})},e}(lc);const vS=Object.freeze(Object.defineProperty({__proto__:null,Arc:aS,DataMarker:lS,DataRegion:uS,Html:fS,Image:sS,Line:iS,Region:oS,RegionFilter:cS,Shape:hS,Text:nS},Symbol.toStringTag,{value:"Module"}));function An(r,e,t){var i=e+"Style",n=null;return S(t,function(a,o){r[o]&&a[i]&&(n||(n={}),ft(n,a[i]))}),n}var Sp=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return g.__assign(g.__assign({},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:at.lineColor}},tickLine:{style:{lineWidth:1,stroke:at.lineColor},alignTick:!0,length:5,displayWithLabel:!0},subTickLine:{style:{lineWidth:1,stroke:at.lineColor},count:4,length:2},label:{autoRotate:!0,autoHide:!1,autoEllipsis:!1,style:{fontSize:12,fill:at.textColor,fontFamily:at.fontFamily,fontWeight:"normal"},offset:10,offsetX:0,offsetY:0},title:{autoRotate:!0,spacing:5,position:"center",style:{fontSize:12,fill:at.textColor,textBaseline:"middle",fontFamily:at.fontFamily,textAlign:"center"},iconStyle:{fill:at.descriptionIconFill,stroke:at.descriptionIconStroke},description:""},tickStates:{active:{labelStyle:{fontWeight:500},tickLineStyle:{lineWidth:2}},inactive:{labelStyle:{fill:at.uncheckedColor}}},optimize:{enable:!0,threshold:400}},theme:{}})},e.prototype.renderInner=function(t){this.get("line")&&this.drawLine(t),this.drawTicks(t),this.get("title")&&this.drawTitle(t)},e.prototype.isList=function(){return!0},e.prototype.getItems=function(){return this.get("ticks")},e.prototype.setItems=function(t){this.update({ticks:t})},e.prototype.updateItem=function(t,i){ft(t,i),this.clear(),this.render()},e.prototype.clearItems=function(){var t=this.getElementByLocalId("label-group");t&&t.clear()},e.prototype.setItemState=function(t,i,n){t[i]=n,this.updateTickStates(t)},e.prototype.hasState=function(t,i){return!!t[i]},e.prototype.getItemStates=function(t){var i=this.get("tickStates"),n=[];return S(i,function(a,o){t[o]&&n.push(o)}),n},e.prototype.clearItemsState=function(t){var i=this,n=this.getItemsByState(t);S(n,function(a){i.setItemState(a,t,!1)})},e.prototype.getItemsByState=function(t){var i=this,n=this.getItems();return Xt(n,function(a){return i.hasState(a,t)})},e.prototype.getSidePoint=function(t,i){var n=this,a=n.getSideVector(i,t);return{x:t.x+a[0],y:t.y+a[1]}},e.prototype.getTextAnchor=function(t){var i;return zt(t[0],0)?i="center":t[0]>0?i="start":t[0]<0&&(i="end"),i},e.prototype.getTextBaseline=function(t){var i;return zt(t[1],0)?i="middle":t[1]>0?i="top":t[1]<0&&(i="bottom"),i},e.prototype.processOverlap=function(t){},e.prototype.drawLine=function(t){var i=this.getLinePath(),n=this.get("line");this.addShape(t,{type:"path",id:this.getElementId("line"),name:"axis-line",attrs:ft({path:i},n.style)})},e.prototype.getTickLineItems=function(t){var i=this,n=[],a=this.get("tickLine"),o=a.alignTick,s=a.length,l=1,u=t.length;return u>=2&&(l=t[1].value-t[0].value),S(t,function(c){var h=c.point;o||(h=i.getTickPoint(c.value-l/2));var f=i.getSidePoint(h,s);n.push({startPoint:h,tickValue:c.value,endPoint:f,tickId:c.id,id:"tickline-"+c.id})}),n},e.prototype.getSubTickLineItems=function(t){var i=[],n=this.get("subTickLine"),a=n.count,o=t.length;if(o>=2)for(var s=0;s0){var n=Bt(i);if(n>t.threshold){var a=Math.ceil(n/t.threshold),o=i.filter(function(s,l){return l%a===0});this.set("ticks",o),this.set("originalTicks",i)}}},e.prototype.getLabelAttrs=function(t,i,n){var a=this.get("label"),o=a.offset,s=a.offsetX,l=a.offsetY,u=a.rotate,c=a.formatter,h=this.getSidePoint(t.point,o),f=this.getSideVector(o,h),v=c?c(t.name,t,i):t.name,d=a.style;d=W(d)?M(this.get("theme"),["label","style"],{}):d;var p=ft({x:h.x+s,y:h.y+l,text:v,textAlign:this.getTextAnchor(f),textBaseline:this.getTextBaseline(f)},d);return u&&(p.matrix=vi(h,u)),p},e.prototype.drawLabels=function(t){var i=this,n=this.get("ticks"),a=this.addGroup(t,{name:"axis-label-group",id:this.getElementId("label-group")});S(n,function(f,v){i.addShape(a,{type:"text",name:"axis-label",id:i.getElementId("label-"+f.id),attrs:i.getLabelAttrs(f,v,n),delegateObject:{tick:f,item:f,index:v}})}),this.processOverlap(a);var o=a.getChildren(),s=M(this.get("theme"),["label","style"],{}),l=this.get("label"),u=l.style,c=l.formatter;if(W(u)){var h=o.map(function(f){return M(f.get("delegateObject"),"tick")});S(o,function(f,v){var d=f.get("delegateObject").tick,p=c?c(d.name,d,v):d.name,y=ft({},s,u(p,v,h));f.attr(y)})}},e.prototype.getTitleAttrs=function(){var t=this.get("title"),i=t.style,n=t.position,a=t.offset,o=t.spacing,s=o===void 0?0:o,l=t.autoRotate,u=i.fontSize,c=.5;n==="start"?c=0:n==="end"&&(c=1);var h=this.getTickPoint(c),f=this.getSidePoint(h,a||s+u/2),v=ft({x:f.x,y:f.y,text:t.text},i),d=t.rotate,p=d;if(D(d)&&l){var y=this.getAxisVector(h),m=[1,0];p=zu(y,m,!0)}if(p){var x=vi(f,p);v.matrix=x}return v},e.prototype.drawTitle=function(t){var i,n=this.getTitleAttrs(),a=this.addShape(t,{type:"text",id:this.getElementId("title"),name:"axis-title",attrs:n});!((i=this.get("title"))===null||i===void 0)&&i.description&&this.drawDescriptionIcon(t,a,n.matrix)},e.prototype.drawDescriptionIcon=function(t,i,n){var a=this.addGroup(t,{name:"axis-description",id:this.getElementById("description")}),o=i.getBBox(),s=o.maxX,l=o.maxY,u=o.height,c=this.get("title").iconStyle,h=4,f=u/2,v=f/6,d=s+h,p=l-u/2,y=[d+f,p-f],m=y[0],x=y[1],_=[m+f,x+f],w=_[0],b=_[1],C=[m,b+f],A=C[0],F=C[1],E=[d,x+f],T=E[0],k=E[1],P=[d+f,p-u/4],B=P[0],z=P[1],X=[B,z+v],I=X[0],R=X[1],$=[I,R+v],G=$[0],V=$[1],H=[G,V+f*3/4],Z=H[0],rt=H[1];this.addShape(a,{type:"path",id:this.getElementId("title-description-icon"),name:"axis-title-description-icon",attrs:g.__assign({path:[["M",m,x],["A",f,f,0,0,1,w,b],["A",f,f,0,0,1,A,F],["A",f,f,0,0,1,T,k],["A",f,f,0,0,1,m,x],["M",B,z],["L",I,R],["M",G,V],["L",Z,rt]],lineWidth:v,matrix:n},c)}),this.addShape(a,{type:"rect",id:this.getElementId("title-description-rect"),name:"axis-title-description-rect",attrs:{x:d,y:p-u/2,width:u,height:u,stroke:"#000",fill:"#000",opacity:0,matrix:n,cursor:"pointer"}})},e.prototype.applyTickStates=function(t,i){var n=this.getItemStates(t);if(n.length){var a=this.get("tickStates"),o=this.getElementId("label-"+t.id),s=i.findById(o);if(s){var l=An(t,"label",a);l&&s.attr(l)}var u=this.getElementId("tickline-"+t.id),c=i.findById(u);if(c){var h=An(t,"tickLine",a);h&&c.attr(h)}}},e.prototype.updateTickStates=function(t){var i=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(i.length){if(o){var u=An(t,"label",n);u&&o.attr(u)}if(l){var c=An(t,"tickLine",n);c&&l.attr(c)}}else o&&o.attr(a.style),l&&l.attr(s.style)},e}(Wt);function uc(r,e,t,i){var n=e.getChildren(),a=!1;return S(n,function(o){var s=On(r,o,t,i);a=a||s}),a}function dS(){return Cp}function gS(r,e,t){return uc(r,e,t,"head")}function Cp(r,e,t){return uc(r,e,t,"tail")}function pS(r,e,t){return uc(r,e,t,"middle")}const yS=Object.freeze(Object.defineProperty({__proto__:null,ellipsisHead:gS,ellipsisMiddle:pS,ellipsisTail:Cp,getDefault:dS},Symbol.toStringTag,{value:"Module"}));function mS(r){var e=r.attr("matrix");return e&&e[0]!==1}function Mp(r){var e=mS(r)?Vb(r.attr("matrix")):0;return e%360}function au(r,e,t,i){var n=!1,a=Mp(e),o=Math.abs(r?t.attr("y")-e.attr("y"):t.attr("x")-e.attr("x")),s=(r?t.attr("y")>e.attr("y"):t.attr("x")>e.attr("x"))?e.getBBox():t.getBBox();if(r){var l=Math.abs(Math.cos(a));Bo(l,0,Math.PI/180)?n=s.width+i>o:n=s.height/l+i>o}else{var l=Math.abs(Math.sin(a));Bo(l,0,Math.PI/180)?n=s.width+i>o:n=s.height/l+i>o}return n}function Kn(r,e,t,i){var n=(i==null?void 0:i.minGap)||0,a=e.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],u=l,c=1;c1){f=Math.ceil(f);for(var p=0;p2){var o=n[0],s=n[n.length-1];o.get("visible")||(o.show(),Kn(r,e,!1,i)&&(a=!0)),s.get("visible")||(s.show(),Kn(r,e,!0,i)&&(a=!0))}return a}const CS=Object.freeze(Object.defineProperty({__proto__:null,equidistance:Fp,equidistanceWithReverseBoth:SS,getDefault:xS,reserveBoth:bS,reserveFirst:wS,reserveLast:_S},Symbol.toStringTag,{value:"Module"}));function MS(r,e){S(r,function(t){var i=t.attr("x"),n=t.attr("y"),a=vi({x:i,y:n},e);t.attr("matrix",a)})}function Tp(r,e,t,i){var n=e.getChildren();if(!n.length||!r&&n.length<2)return!1;var a=nu(n),o=!1;if(r)o=!!t&&a>t;else{var s=Math.abs(n[1].attr("x")-n[0].attr("x"));o=a>s}if(o){var l=i(t,a);MS(n,l)}return o}function AS(){return Ep}function Ep(r,e,t,i){return Tp(r,e,t,function(){return tt(i)?i:r?at.verticalAxisRotate:at.horizontalAxisRotate})}function FS(r,e,t){return Tp(r,e,t,function(i,n){if(!i)return r?at.verticalAxisRotate:at.horizontalAxisRotate;if(r)return-Math.acos(i/n);var a=0;return i>n?a=Math.PI/4:(a=Math.asin(i/n),a>Math.PI/4&&(a=Math.PI/4)),a})}const TS=Object.freeze(Object.defineProperty({__proto__:null,fixedAngle:Ep,getDefault:AS,unfixedAngle:FS},Symbol.toStringTag,{value:"Module"})),kp=Object.freeze(Object.defineProperty({__proto__:null,autoEllipsis:yS,autoHide:CS,autoRotate:TS},Symbol.toStringTag,{value:"Module"}));var ES=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return g.__assign(g.__assign({},t),{type:"line",locationType:"region",start:null,end:null})},e.prototype.getLinePath=function(){var t=this.get("start"),i=this.get("end"),n=[];return n.push(["M",t.x,t.y]),n.push(["L",i.x,i.y]),n},e.prototype.getInnerLayoutBBox=function(){var t=this.get("start"),i=this.get("end"),n=r.prototype.getInnerLayoutBBox.call(this),a=Math.min(t.x,i.x,n.x),o=Math.min(t.y,i.y,n.y),s=Math.max(t.x,i.x,n.maxX),l=Math.max(t.y,i.y,n.maxY);return{x:a,y:o,minX:a,minY:o,maxX:s,maxY:l,width:s-a,height:l-o}},e.prototype.isVertical=function(){var t=this.get("start"),i=this.get("end");return zt(t.x,i.x)},e.prototype.isHorizontal=function(){var t=this.get("start"),i=this.get("end");return zt(t.y,i.y)},e.prototype.getTickPoint=function(t){var i=this,n=i.get("start"),a=i.get("end"),o=a.x-n.x,s=a.y-n.y;return{x:n.x+o*t,y:n.y+s*t}},e.prototype.getSideVector=function(t){var i=this.getAxisVector(),n=Zd([0,0],i),a=this.get("verticalFactor"),o=[n[1],n[0]*-1];return jt([0,0],o,t*a)},e.prototype.getAxisVector=function(){var t=this.get("start"),i=this.get("end");return[i.x-t.x,i.y-t.y]},e.prototype.processOverlap=function(t){var i=this,n=this.isVertical(),a=this.isHorizontal();if(!(!n&&!a)){var o=this.get("label"),s=this.get("title"),l=this.get("verticalLimitLength"),u=o.offset,c=l,h=0,f=0;s&&(h=s.style.fontSize,f=s.spacing),c&&(c=c-u-f-h);var v=this.get("overlapOrder");if(S(v,function(y){o[y]&&i.canProcessOverlap(y)&&i.autoProcessOverlap(y,o[y],t,c)}),s&&D(s.offset)){var d=t.getCanvasBBox(),p=n?d.width:d.height;s.offset=u+p+f+h/2}}},e.prototype.canProcessOverlap=function(t){var i=this.get("label");return t==="autoRotate"?D(i.rotate):!0},e.prototype.autoProcessOverlap=function(t,i,n,a){var o=this,s=this.isVertical(),l=!1,u=kp[t];if(i===!0)this.get("label"),l=u.getDefault()(s,n,a);else if(W(i))l=i(s,n,a);else if(pt(i)){var c=i;u[c.type]&&(l=u[c.type](s,n,a,c.cfg))}else u[i]&&(l=u[i](s,n,a));if(t==="autoRotate"){if(l){var h=n.getChildren(),f=this.get("verticalFactor");S(h,function(d){var p=d.attr("textAlign");if(p==="center"){var y=f>0?"end":"start";d.attr("textAlign",y)}})}}else if(t==="autoHide"){var v=n.getChildren().slice(0);S(v,function(d){d.get("visible")||(o.get("isRegister")&&o.unregisterElement(d),d.remove())})}},e}(Sp),kS=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return g.__assign(g.__assign({},t),{type:"circle",locationType:"circle",center:null,radius:null,startAngle:-Math.PI/2,endAngle:Math.PI*3/2})},e.prototype.getLinePath=function(){var t=this.get("center"),i=t.x,n=t.y,a=this.get("radius"),o=a,s=this.get("startAngle"),l=this.get("endAngle"),u=[];if(Math.abs(l-s)===Math.PI*2)u=[["M",i,n-o],["A",a,o,0,1,1,i,n+o],["A",a,o,0,1,1,i,n-o],["Z"]];else{var c=this.getCirclePoint(s),h=this.getCirclePoint(l),f=Math.abs(l-s)>Math.PI?1:0,v=s>l?0:1;u=[["M",i,n],["L",c.x,c.y],["A",a,o,0,f,v,h.x,h.y],["L",i,n]]}return u},e.prototype.getTickPoint=function(t){var i=this.get("startAngle"),n=this.get("endAngle"),a=i+(n-i)*t;return this.getCirclePoint(a)},e.prototype.getSideVector=function(t,i){var n=this.get("center"),a=[i.x-n.x,i.y-n.y],o=this.get("verticalFactor"),s=Ii(a);return jt(a,a,o*t/s),a},e.prototype.getAxisVector=function(t){var i=this.get("center"),n=[t.x-i.x,t.y-i.y];return[n[1],-1*n[0]]},e.prototype.getCirclePoint=function(t,i){var n=this.get("center");return i=i||this.get("radius"),{x:n.x+Math.cos(t)*i,y:n.y+Math.sin(t)*i}},e.prototype.canProcessOverlap=function(t){var i=this.get("label");return t==="autoRotate"?D(i.rotate):!0},e.prototype.processOverlap=function(t){var i=this,n=this.get("label"),a=this.get("title"),o=this.get("verticalLimitLength"),s=n.offset,l=o,u=0,c=0;a&&(u=a.style.fontSize,c=a.spacing),l&&(l=l-s-c-u);var h=this.get("overlapOrder");if(S(h,function(v){n[v]&&i.canProcessOverlap(v)&&i.autoProcessOverlap(v,n[v],t,l)}),a&&D(a.offset)){var f=t.getCanvasBBox().height;a.offset=s+f+c+u/2}},e.prototype.autoProcessOverlap=function(t,i,n,a){var o=this,s=!1,l=kp[t];if(a>0)if(i===!0)s=l.getDefault()(!1,n,a);else if(W(i))s=i(!1,n,a);else if(pt(i)){var u=i;l[u.type]&&(s=l[u.type](!1,n,a,u.cfg))}else l[i]&&(s=l[i](!1,n,a));if(t==="autoRotate"){if(s){var c=n.getChildren(),h=this.get("verticalFactor");S(c,function(v){var d=v.attr("textAlign");if(d==="center"){var p=h>0?"end":"start";v.attr("textAlign",p)}})}}else if(t==="autoHide"){var f=n.getChildren().slice(0);S(f,function(v){v.get("visible")||(o.get("isRegister")&&o.unregisterElement(v),v.remove())})}},e}(Sp),cc=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return g.__assign(g.__assign({},t),{name:"crosshair",type:"base",line:{},text:null,textBackground:{},capture:!1,defaultCfg:{line:{style:{lineWidth:1,stroke:at.lineColor}},text:{position:"start",offset:10,autoRotate:!1,content:null,style:{fill:at.textColor,textAlign:"center",textBaseline:"middle",fontFamily:at.fontFamily}},textBackground:{padding:5,style:{stroke:at.lineColor}}}})},e.prototype.renderInner=function(t){this.get("line")&&this.renderLine(t),this.get("text")&&(this.renderText(t),this.renderBackground(t))},e.prototype.renderText=function(t){var i=this.get("text"),n=i.style,a=i.autoRotate,o=i.content;if(!D(o)){var s=this.getTextPoint(),l=null;if(a){var u=this.getRotateAngle();l=vi(s,u)}this.addShape(t,{type:"text",name:"crosshair-text",id:this.getElementId("text"),attrs:g.__assign(g.__assign(g.__assign({},s),{text:o,matrix:l}),n)})}},e.prototype.renderLine=function(t){var i=this.getLinePath(),n=this.get("line"),a=n.style;this.addShape(t,{type:"path",name:"crosshair-line",id:this.getElementId("line"),attrs:g.__assign({path:i},a)})},e.prototype.renderBackground=function(t){var i=this.getElementId("text"),n=t.findById(i),a=this.get("textBackground");if(a&&n){var o=n.getBBox(),s=Do(a.padding),l=a.style,u=this.addShape(t,{type:"rect",name:"crosshair-text-background",id:this.getElementId("text-background"),attrs:g.__assign({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)});u.toBack()}},e}(Wt),Lp=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return g.__assign(g.__assign({},t),{type:"line",locationType:"region",start:null,end:null})},e.prototype.getRotateAngle=function(){var t=this.getLocation(),i=t.start,n=t.end,a=this.get("text").position,o=Math.atan2(n.y-i.y,n.x-i.x),s=a==="start"?o-Math.PI/2:o+Math.PI/2;return s},e.prototype.getTextPoint=function(){var t=this.getLocation(),i=t.start,n=t.end,a=this.get("text"),o=a.position,s=a.offset;return _p(i,n,o,s)},e.prototype.getLinePath=function(){var t=this.getLocation(),i=t.start,n=t.end;return[["M",i.x,i.y],["L",n.x,n.y]]},e}(cc),LS=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return g.__assign(g.__assign({},t),{type:"circle",locationType:"circle",center:null,radius:100,startAngle:-Math.PI/2,endAngle:Math.PI*3/2})},e.prototype.getRotateAngle=function(){var t=this.getLocation(),i=t.startAngle,n=t.endAngle,a=this.get("text").position,o=a==="start"?i+Math.PI/2:n-Math.PI/2;return o},e.prototype.getTextPoint=function(){var t=this.get("text"),i=t.position,n=t.offset,a=this.getLocation(),o=a.center,s=a.radius,l=a.startAngle,u=a.endAngle,c=i==="start"?l:u,h=this.getRotateAngle()-Math.PI,f=Ni(o,s,c),v=Math.cos(h)*n,d=Math.sin(h)*n;return{x:f.x+v,y:f.y+d}},e.prototype.getLinePath=function(){var t=this.getLocation(),i=t.center,n=t.radius,a=t.startAngle,o=t.endAngle,s=null;if(o-a===Math.PI*2){var l=i.x,u=i.y;s=[["M",l,u-n],["A",n,n,0,1,1,l,u+n],["A",n,n,0,1,1,l,u-n],["Z"]]}else{var c=Ni(i,n,a),h=Ni(i,n,o),f=Math.abs(o-a)>Math.PI?1:0,v=a>o?0:1;s=[["M",c.x,c.y],["A",n,n,0,f,v,h.x,h.y]]}return s},e}(cc),Jn="g2-crosshair",ou=Jn+"-line",su=Jn+"-text",yn;const IS=(yn={},yn[""+Jn]={position:"relative"},yn[""+ou]={position:"absolute",backgroundColor:"rgba(0, 0, 0, 0.25)"},yn[""+su]={position:"absolute",color:at.textColor,fontFamily:at.fontFamily},yn);var PS=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return g.__assign(g.__assign({},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:Jn,defaultStyles:IS,defaultCfg:{text:{position:"start",content:null,align:"center",offset:10}}})},e.prototype.render=function(){this.resetText(),this.resetPosition()},e.prototype.initCrossHair=function(){var t=this.getContainer(),i=this.get("crosshairTpl"),n=Er(i);t.appendChild(n),this.applyStyle(ou,n),this.set("crosshairEl",n)},e.prototype.getTextPoint=function(){var t=this.getLocation(),i=t.start,n=t.end,a=this.get("text"),o=a.position,s=a.offset;return _p(i,n,o,s)},e.prototype.resetText=function(){var t=this.get("text"),i=this.get("textEl");if(t){var n=t.content;if(!i){var a=this.getContainer(),o=rg(this.get("textTpl"),t);i=Er(o),a.appendChild(i),this.applyStyle(su,i),this.set("textEl",i)}i.innerHTML=n}else i&&i.remove()},e.prototype.isVertical=function(t,i){return t.x===i.x},e.prototype.resetPosition=function(){var t=this.get("crosshairEl");t||(this.initCrossHair(),t=this.get("crosshairEl"));var i=this.get("start"),n=this.get("end"),a=Math.min(i.x,n.x),o=Math.min(i.y,n.y);this.isVertical(i,n)?qt(t,{width:"1px",height:ee(Math.abs(n.y-i.y))}):qt(t,{height:"1px",width:ee(Math.abs(n.x-i.x))}),qt(t,{top:ee(o),left:ee(a)}),this.alignText()},e.prototype.alignText=function(){var t=this.get("textEl");if(t){var i=this.get("text").align,n=t.clientWidth,a=this.getTextPoint();switch(i){case"center":a.x=a.x-n/2;break;case"right":a.x=a.x-n}qt(t,{top:ee(a.y),left:ee(a.x)})}},e.prototype.updateInner=function(t){Ir(t,"text")&&this.resetText(),r.prototype.updateInner.call(this,t)},e}(lc);const Vf=Object.freeze(Object.defineProperty({__proto__:null,Base:cc,Circle:LS,Html:PS,Line:Lp},Symbol.toStringTag,{value:"Module"}));var Ip=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return g.__assign(g.__assign({},t),{name:"grid",line:{},alternateColor:null,capture:!1,items:[],closed:!1,defaultCfg:{line:{type:"line",style:{lineWidth:1,stroke:at.lineColor}}}})},e.prototype.getLineType=function(){var t=this.get("line")||this.get("defaultCfg").line;return t.type},e.prototype.renderInner=function(t){this.drawGrid(t)},e.prototype.getAlternatePath=function(t,i){var n=this.getGridPath(t),a=i.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},e.prototype.getPathStyle=function(){return this.get("line").style},e.prototype.drawGrid=function(t){var i=this,n=this.get("line"),a=this.get("items"),o=this.get("alternateColor"),s=null;S(a,function(l,u){var c=l.id||u;if(n){var h=i.getPathStyle();h=W(h)?h(l,u,a):h;var f=i.getElementId("line-"+c),v=i.getGridPath(l.points);i.addShape(t,{type:"path",name:"grid-line",id:f,attrs:ft({path:v},h)})}if(o&&u>0){var d=i.getElementId("region-"+c),p=u%2===0;if(K(o))p&&i.drawAlternateRegion(d,t,s.points,l.points,o);else{var y=p?o[1]:o[0];i.drawAlternateRegion(d,t,s.points,l.points,y)}}s=l})},e.prototype.drawAlternateRegion=function(t,i,n,a,o){var s=this.getAlternatePath(n,a);this.addShape(i,{type:"path",id:t,name:"grid-region",attrs:{path:s,fill:o}})},e}(Wt);function DS(r,e,t,i){var n=t-r,a=i-e;return Math.sqrt(n*n+a*a)}var BS=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return g.__assign(g.__assign({},t),{type:"circle",center:null,closed:!0})},e.prototype.getGridPath=function(t,i){var n=this.getLineType(),a=this.get("closed"),o=[];if(t.length)if(n==="circle"){var s=this.get("center"),l=t[0],u=DS(s.x,s.y,l.x,l.y),c=i?0:1;a?(o.push(["M",s.x,s.y-u]),o.push(["A",u,u,0,0,c,s.x,s.y+u]),o.push(["A",u,u,0,0,c,s.x,s.y-u]),o.push(["Z"])):S(t,function(h,f){f===0?o.push(["M",h.x,h.y]):o.push(["A",u,u,0,0,c,h.x,h.y])})}else S(t,function(h,f){f===0?o.push(["M",h.x,h.y]):o.push(["L",h.x,h.y])}),a&&o.push(["Z"]);return o},e}(Ip),OS=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return g.__assign(g.__assign({},t),{type:"line"})},e.prototype.getGridPath=function(t){var i=[];return S(t,function(n,a){a===0?i.push(["M",n.x,n.y]):i.push(["L",n.x,n.y])}),i},e}(Ip),Pp=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return g.__assign(g.__assign({},t),{name:"legend",layout:"horizontal",locationType:"point",x:0,y:0,offsetX:0,offsetY:0,title:null,background:null})},e.prototype.getLayoutBBox=function(){var t=r.prototype.getLayoutBBox.call(this),i=this.get("maxWidth"),n=this.get("maxHeight"),a=t.width,o=t.height;return i&&(a=Math.min(a,i)),n&&(o=Math.min(o,n)),xs(t.minX,t.minY,a,o)},e.prototype.setLocation=function(t){this.set("x",t.x),this.set("y",t.y),this.resetLocation()},e.prototype.resetLocation=function(){var t=this.get("x"),i=this.get("y"),n=this.get("offsetX"),a=this.get("offsetY");this.moveElementTo(this.get("group"),{x:t+n,y:i+a})},e.prototype.applyOffset=function(){this.resetLocation()},e.prototype.getDrawPoint=function(){return this.get("currentPoint")},e.prototype.setDrawPoint=function(t){return this.set("currentPoint",t)},e.prototype.renderInner=function(t){this.resetDraw(),this.get("title")&&this.drawTitle(t),this.drawLegendContent(t),this.get("background")&&this.drawBackground(t)},e.prototype.drawBackground=function(t){var i=this.get("background"),n=t.getBBox(),a=Do(i.padding),o=g.__assign({x:0,y:0,width:n.width+a[1]+a[3],height:n.height+a[0]+a[2]},i.style),s=this.addShape(t,{type:"rect",id:this.getElementId("background"),name:"legend-background",attrs:o});s.toBack()},e.prototype.drawTitle=function(t){var i=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:g.__assign({text:s,x:i.x,y:i.y},o)}),u=l.getBBox();this.set("currentPoint",{x:i.x,y:u.maxY+a})},e.prototype.resetDraw=function(){var t=this.get("background"),i={x:0,y:0};if(t){var n=Do(t.padding);i.x=n[3],i.y=n[0]}this.set("currentPoint",i)},e}(Wt),cl={marker:{style:{inactiveFill:"#000",inactiveOpacity:.45,fill:"#000",opacity:1,size:12}},text:{style:{fill:"#ccc",fontSize:12}}},Ga={fill:at.textColor,fontSize:12,textAlign:"start",textBaseline:"middle",fontFamily:at.fontFamily,fontWeight:"normal",lineHeight:12},hl="navigation-arrow-right",fl="navigation-arrow-left",Gf={right:90*Math.PI/180,left:(360-90)*Math.PI/180,up:0,down:180*Math.PI/180},RS=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.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 i=t.getElementByLocalId("item-group");if(t.currentPageIndex>1){t.currentPageIndex-=1,t.updateNavigation();var n=t.getCurrentNavigationMatrix();t.get("animate")?i.animate({matrix:n},100):i.attr({matrix:n})}},t.onNavigationAfter=function(){var i=t.getElementByLocalId("item-group");if(t.currentPageIndexy&&(y=A),v==="horizontal"?(m&&mu}if(s==="horizontal"){var F=this.get("maxRow")||1,E=v+(F===1?0:C),T=u-f-y.width-y.minX;this.pageHeight=E*F,this.pageWidth=T,S(l,function(P){var B=P.getBBox(),z=h||B.width;(_&&_w&&(w=B.width)}),b=w,w+=f,u&&(w=Math.min(u,w),b=Math.min(u,b)),this.pageWidth=w,this.pageHeight=c-Math.max(y.height,v+C);var k=Math.floor(this.pageHeight/(v+C));S(l,function(P,B){B!==0&&B%k===0&&(x+=1,m.x+=w,m.y=o),n.moveElementTo(P,m),P.getParent().setClip({type:"rect",attrs:{x:m.x,y:m.y,width:w,height:v}}),m.y+=v+C}),this.totalPagesCnt=x,this.moveElementTo(p,{x:a+b/2-y.width/2-y.minX,y:c-y.height-y.minY})}this.pageHeight&&this.pageWidth&&i.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(x/this.get("maxRow")):this.totalPagesCnt=x,this.currentPageIndex>this.totalPagesCnt&&(this.currentPageIndex=1),this.updateNavigation(p),i.attr("matrix",this.getCurrentNavigationMatrix())},e.prototype.drawNavigation=function(t,i,n,a){var o={x:0,y:0},s=this.addGroup(t,{id:this.getElementId("navigation-group"),name:"legend-navigation"}),l=M(a.marker,"style",{}),u=l.size,c=u===void 0?12:u,h=g.__rest(l,["size"]),f=this.drawArrow(s,o,fl,i==="horizontal"?"up":"left",c,h);f.on("click",this.onNavigationBack);var v=f.getBBox();o.x+=v.width+2;var d=this.addShape(s,{type:"text",id:this.getElementId("navigation-text"),name:"navigation-text",attrs:g.__assign({x:o.x,y:o.y+c/2,text:n,textBaseline:"middle"},M(a.text,"style"))}),p=d.getBBox();o.x+=p.width+2;var y=this.drawArrow(s,o,hl,i==="horizontal"?"down":"right",c,h);return y.on("click",this.onNavigationAfter),s},e.prototype.updateNavigation=function(t){var i=Y({},cl,this.get("pageNavigator")),n=i.marker.style,a=n.fill,o=n.opacity,s=n.inactiveFill,l=n.inactiveOpacity,u=this.currentPageIndex+"/"+this.totalPagesCnt,c=t?t.getChildren()[1]:this.getElementByLocalId("navigation-text"),h=t?t.findById(this.getElementId(fl)):this.getElementByLocalId(fl),f=t?t.findById(this.getElementId(hl)):this.getElementByLocalId(hl);c.attr("text",u),h.attr("opacity",this.currentPageIndex===1?l:o),h.attr("fill",this.currentPageIndex===1?s:a),h.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=h.getBBox().maxX+2;c.attr("x",v),v+=c.getBBox().width+2,this.updateArrowPath(f,{x:v,y:0})},e.prototype.drawArrow=function(t,i,n,a,o,s){var l=i.x,u=i.y,c=this.addShape(t,{type:"path",id:this.getElementId(n),name:n,attrs:g.__assign({size:o,direction:a,path:[["M",l+o/2,u],["L",l,u+o],["L",l+o,u+o],["Z"]],cursor:"pointer"},s)});return c.attr("matrix",vi({x:l+o/2,y:u+o/2},Gf[a])),c},e.prototype.updateArrowPath=function(t,i){var n=i.x,a=i.y,o=t.attr(),s=o.size,l=o.direction,u=vi({x:n+s/2,y:a+s/2},Gf[l]);t.attr("path",[["M",n+s/2,a],["L",n,a+s],["L",n+s,a+s],["Z"]]),t.attr("matrix",u)},e.prototype.getCurrentNavigationMatrix=function(){var t=this,i=t.currentPageIndex,n=t.pageWidth,a=t.pageHeight,o=this.get("layout"),s=o==="horizontal"?{x:0,y:a*(1-i)}:{x:n*(1-i),y:0};return ac(s)},e.prototype.applyItemStates=function(t,i){var n=this.getItemStates(t),a=n.length>0;if(a){var o=i.getChildren(),s=this.get("itemStates");S(o,function(l){var u=l.get("name"),c=u.split("-")[2],h=An(t,c,s);h&&(l.attr(h),c==="marker"&&!(l.get("isStroke")&&l.get("isFill"))&&(l.get("isStroke")&&l.attr("fill",null),l.get("isFill")&&l.attr("stroke",null)))})}},e.prototype.getLimitItemWidth=function(){var t=this.get("itemWidth"),i=this.get("maxItemWidth");return i?t&&(i=t<=i?t:i):t&&(i=t),i},e}(Pp),NS=1.4,Yf=.4,zS=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return g.__assign(g.__assign({},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:at.textColor,textBaseline:"middle",fontFamily:at.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:at.textColor,fontSize:12,textAlign:"start",textBaseline:"top"}}}})},e.prototype.isSlider=function(){return!0},e.prototype.getValue=function(){return this.getCurrentValue()},e.prototype.getRange=function(){return{min:this.get("min"),max:this.get("max")}},e.prototype.setRange=function(t,i){this.update({min:t,max:i})},e.prototype.setValue=function(t){var i=this.getValue();this.set("value",t);var n=this.get("group");this.resetTrackClip(),this.get("slidable")&&this.resetHandlers(n),this.delegateEmit("valuechanged",{originValue:i,value:t})},e.prototype.initEvent=function(){var t=this.get("group");this.bindSliderEvent(t),this.bindRailEvent(t),this.bindTrackEvent(t)},e.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)},e.prototype.bindSliderEvent=function(t){this.bindHandlersEvent(t)},e.prototype.bindHandlersEvent=function(t){var i=this;t.on("legend-handler-min:drag",function(n){var a=i.getValueByCanvasPoint(n.x,n.y),o=i.getCurrentValue(),s=o[1];sa&&(s=a),i.setValue([s,a])})},e.prototype.bindRailEvent=function(t){},e.prototype.bindTrackEvent=function(t){var i=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=i.getValueByCanvasPoint(n.x,n.y),s=i.getValueByCanvasPoint(a.x,a.y),l=i.getCurrentValue(),u=l[1]-l[0],c=i.getRange(),h=s-o;h<0?l[0]+h>c.min?i.setValue([l[0]+h,l[1]+h]):i.setValue([c.min,c.min+u]):h>0&&(h>0&&l[1]+ho&&(h=o),h0&&this.changeRailLength(a,s,n[s]-v)}},e.prototype.changeRailLength=function(t,i,n){var a=t.getBBox(),o;i==="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)},e.prototype.changeRailPosition=function(t,i,n){var a=t.getBBox(),o=this.getRailPath(i,n,a.width,a.height);t.attr("path",o)},e.prototype.fixedHorizontal=function(t,i,n,a){var o=this.get("label"),s=o.align,l=o.spacing,u=n.getBBox(),c=t.getBBox(),h=i.getBBox(),f=u.height;this.fitRailLength(c,h,u,n),u=n.getBBox(),s==="rail"?(t.attr({x:a.x,y:a.y+f/2}),this.changeRailPosition(n,a.x+c.width+l,a.y),i.attr({x:a.x+c.width+u.width+l*2,y:a.y+f/2})):s==="top"?(t.attr({x:a.x,y:a.y}),i.attr({x:a.x+u.width,y:a.y}),this.changeRailPosition(n,a.x,a.y+c.height+l)):(this.changeRailPosition(n,a.x,a.y),t.attr({x:a.x,y:a.y+u.height+l}),i.attr({x:a.x+u.width,y:a.y+u.height+l}))},e.prototype.fixedVertail=function(t,i,n,a){var o=this.get("label"),s=o.align,l=o.spacing,u=n.getBBox(),c=t.getBBox(),h=i.getBBox();if(this.fitRailLength(c,h,u,n),u=n.getBBox(),s==="rail")t.attr({x:a.x,y:a.y}),this.changeRailPosition(n,a.x,a.y+c.height+l),i.attr({x:a.x,y:a.y+c.height+u.height+l*2});else if(s==="right")t.attr({x:a.x+u.width+l,y:a.y}),this.changeRailPosition(n,a.x,a.y),i.attr({x:a.x+u.width+l,y:a.y+u.height});else{var f=Math.max(c.width,h.width);t.attr({x:a.x,y:a.y}),this.changeRailPosition(n,a.x+f+l,a.y),i.attr({x:a.x,y:a.y+u.height})}},e}(Pp),hr="g2-tooltip",fr="g2-tooltip-title",ta="g2-tooltip-list",_s="g2-tooltip-list-item",bs="g2-tooltip-marker",Ss="g2-tooltip-value",Dp="g2-tooltip-name",hc="g2-tooltip-crosshair-x",fc="g2-tooltip-crosshair-y";const VS=Object.freeze(Object.defineProperty({__proto__:null,CONTAINER_CLASS:hr,CROSSHAIR_X:hc,CROSSHAIR_Y:fc,LIST_CLASS:ta,LIST_ITEM_CLASS:_s,MARKER_CLASS:bs,NAME_CLASS:Dp,TITLE_CLASS:fr,VALUE_CLASS:Ss},Symbol.toStringTag,{value:"Module"}));var ze;const GS=(ze={},ze[""+hr]={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:at.fontFamily,lineHeight:"20px",padding:"10px 10px 6px 10px"},ze[""+fr]={marginBottom:"4px"},ze[""+ta]={margin:"0px",listStyleType:"none",padding:"0px"},ze[""+_s]={listStyleType:"none",marginBottom:"4px"},ze[""+bs]={width:"8px",height:"8px",borderRadius:"50%",display:"inline-block",marginRight:"8px"},ze[""+Ss]={display:"inline-block",float:"right",marginLeft:"30px"},ze[""+hc]={position:"absolute",width:"1px",backgroundColor:"rgba(0, 0, 0, 0.25)"},ze[""+fc]={position:"absolute",height:"1px",backgroundColor:"rgba(0, 0, 0, 0.25)"},ze);function YS(r,e,t,i,n){var a={left:rn.x+n.width,top:en.y+n.height};return a}function $S(r,e,t,i,n,a){var o=r,s=e;switch(a){case"left":o=r-i-t,s=e-n/2;break;case"right":o=r+t,s=e-n/2;break;case"top":o=r-i/2,s=e-n-t;break;case"bottom":o=r-i/2,s=e+t;break;default:o=r+t,s=e-n-t;break}return{x:o,y:s}}function HS(r,e,t,i,n,a,o){var s=$S(r,e,t,i,n,a);if(o){var l=YS(s.x,s.y,i,n,o);a==="auto"?(l.right&&(s.x=Math.max(0,r-i-t)),l.top&&(s.y=Math.max(0,e-n-t))):a==="top"||a==="bottom"?(l.left&&(s.x=o.x),l.right&&(s.x=o.x+o.width-i),a==="top"&&l.top&&(s.y=e+t),a==="bottom"&&l.bottom&&(s.y=e-n-t)):(l.top&&(s.y=o.y),l.bottom&&(s.y=o.y+o.height-n),a==="left"&&l.left&&(s.x=r+t),a==="right"&&l.right&&(s.x=r-i-t))}return s}function XS(r,e){var t=!1;return S(e,function(i){if(Ir(r,i))return t=!0,!1}),t}var WS=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return g.__assign(g.__assign({},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:hr,crosshairs:null,offset:10,position:"right",domStyles:null,defaultStyles:GS})},e.prototype.render=function(){this.get("customContent")?this.renderCustomContent():(this.resetTitle(),this.renderItems()),this.resetPosition()},e.prototype.clear=function(){this.clearCrosshairs(),this.setTitle(""),this.clearItemDoms()},e.prototype.show=function(){var t=this.getContainer();!t||this.destroyed||(this.set("visible",!0),qt(t,{visibility:"visible"}),this.setCrossHairsVisible(!0))},e.prototype.hide=function(){var t=this.getContainer();!t||this.destroyed||(this.set("visible",!1),qt(t,{visibility:"hidden"}),this.setCrossHairsVisible(!1))},e.prototype.getLocation=function(){return{x:this.get("x"),y:this.get("y")}},e.prototype.setLocation=function(t){this.set("x",t.x),this.set("y",t.y),this.resetPosition()},e.prototype.setCrossHairsVisible=function(t){var i=t?"":"none",n=this.get("xCrosshairDom"),a=this.get("yCrosshairDom");n&&qt(n,{display:i}),a&&qt(a,{display:i})},e.prototype.initContainer=function(){if(r.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()}},e.prototype.updateInner=function(t){this.get("customContent")?this.renderCustomContent():(XS(t,["title","showTitle"])&&this.resetTitle(),Ir(t,"items")&&this.renderItems()),r.prototype.updateInner.call(this,t)},e.prototype.initDom=function(){this.cacheDoms()},e.prototype.removeDom=function(){r.prototype.removeDom.call(this),this.clearCrosshairs()},e.prototype.resetPosition=function(){var t=this.get("x"),i=this.get("y"),n=this.get("offset"),a=this.getOffset(),o=a.offsetX,s=a.offsetY,l=this.get("position"),u=this.get("region"),c=this.getContainer(),h=this.getBBox(),f=h.width,v=h.height,d;u&&(d=Qn(u));var p=HS(t,i,n,f,v,l,d);qt(c,{left:ee(p.x+o),top:ee(p.y+s)}),this.resetCrosshairs()},e.prototype.renderCustomContent=function(){var t=this.getHtmlContentNode(),i=this.get("parent"),n=this.get("container");n&&n.parentNode===i?i.replaceChild(t,n):i.appendChild(t),this.set("container",t),this.resetStyles(),this.applyStyles()},e.prototype.getHtmlContentNode=function(){var t,i=this.get("customContent");if(i){var n=i(this.get("title"),this.get("items"));eg(n)?t=n:t=Er(n)}return t},e.prototype.cacheDoms=function(){var t=this.getContainer(),i=t.getElementsByClassName(fr)[0],n=t.getElementsByClassName(ta)[0];this.set("titleDom",i),this.set("listDom",n)},e.prototype.resetTitle=function(){var t=this.get("title"),i=this.get("showTitle");i&&t?this.setTitle(t):this.setTitle("")},e.prototype.setTitle=function(t){var i=this.get("titleDom");i&&(i.innerText=t)},e.prototype.resetCrosshairs=function(){var t=this.get("crosshairsRegion"),i=this.get("crosshairs");if(!t||!i)this.clearCrosshairs();else{var n=Qn(t),a=this.get("xCrosshairDom"),o=this.get("yCrosshairDom");i==="x"?(this.resetCrosshair("x",n),o&&(o.remove(),this.set("yCrosshairDom",null))):i==="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"))}},e.prototype.resetCrosshair=function(t,i){var n=this.checkCrosshair(t),a=this.get(t);t==="x"?qt(n,{left:ee(a),top:ee(i.y),height:ee(i.height)}):qt(n,{top:ee(a),left:ee(i.x),width:ee(i.width)})},e.prototype.checkCrosshair=function(t){var i=t+"CrosshairDom",n=t+"CrosshairTpl",a="CROSSHAIR_"+t.toUpperCase(),o=VS[a],s=this.get(i),l=this.get("parent");return s||(s=Er(this.get(n)),this.applyStyle(o,s),l.appendChild(s),this.set(i,s)),s},e.prototype.renderItems=function(){this.clearItemDoms();var t=this.get("items"),i=this.get("itemTpl"),n=this.get("listDom");n&&(S(t,function(a){var o=kr.toCSSGradient(a.color),s=g.__assign(g.__assign({},a),{color:o}),l=rg(i,s),u=Er(l);n.appendChild(u)}),this.applyChildrenStyles(n,this.get("domStyles")))},e.prototype.clearItemDoms=function(){this.get("listDom")&&sc(this.get("listDom"))},e.prototype.clearCrosshairs=function(){var t=this.get("xCrosshairDom"),i=this.get("yCrosshairDom");t&&t.remove(),i&&i.remove(),this.set("xCrosshairDom",null),this.set("yCrosshairDom",null)},e}(lc),qS={opacity:0},US={stroke:"#C5C5C5",strokeOpacity:.85},jS={fill:"#CACED4",opacity:.85};function ZS(r,e,t,i){var n=[],a=!!i,o,s,l,u,c,h,f;if(a){l=i[0],u=i[1];for(var v=0,d=r.length;vv&&(a=[v,f],f=a[0],v=a[1],o=[n,i],i=o[0],n=o[1],d=!0);var p=i.getBBox(),y=n.getBBox(),m=p.width>f-c?{x:f+h/2+c,textAlign:"left"}:{x:f-h/2-c,textAlign:"right"},x=y.width>u-v-c?{x:v-h/2-c,textAlign:"right"}:{x:v+h/2+c,textAlign:"left"};return d?[x,m]:[m,x]},e.prototype.draw=function(){var t=this.get("container"),i=t&&t.get("canvas");i&&i.draw()},e.prototype.getContainerDOM=function(){var t=this.get("container"),i=t&&t.get("canvas");return i&&i.get("container")},e}(Wt),cC={trackColor:"rgba(0,0,0,0)",thumbColor:"rgba(0,0,0,0.15)",size:8,lineCap:"round"},vl={default:cC,hover:{thumbColor:"rgba(0,0,0,0.2)"}},hC=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.clearEvents=Mr,t.onStartEvent=function(i){return function(n){t.isMobile=i,n.originalEvent.preventDefault();var a=i?M(n.originalEvent,"touches.0.clientX"):n.clientX,o=i?M(n.originalEvent,"touches.0.clientY"):n.clientY;t.startPos=t.cfg.isHorizontal?a:o,t.bindLaterEvent()}},t.bindLaterEvent=function(){var i=t.getContainerDOM(),n=[];t.isMobile?n=[Mi(i,"touchmove",t.onMouseMove),Mi(i,"touchend",t.onMouseUp),Mi(i,"touchcancel",t.onMouseUp)]:n=[Mi(i,"mousemove",t.onMouseMove),Mi(i,"mouseup",t.onMouseUp),Mi(i,"mouseleave",t.onMouseUp)],t.clearEvents=function(){n.forEach(function(a){a.remove()})}},t.onMouseMove=function(i){var n=t.cfg,a=n.isHorizontal,o=n.thumbOffset;i.preventDefault();var s=t.isMobile?M(i,"touches.0.clientX"):i.clientX,l=t.isMobile?M(i,"touches.0.clientY"):i.clientY,u=a?s:l,c=u-t.startPos;t.startPos=u,t.updateThumbOffset(o+c)},t.onMouseUp=function(i){i.preventDefault(),t.clearEvents()},t.onTrackClick=function(i){var n=t.cfg,a=n.isHorizontal,o=n.x,s=n.y,l=n.thumbLen,u=t.getContainerDOM(),c=u.getBoundingClientRect(),h=i.clientX,f=i.clientY,v=a?h-c.left-o-l/2:f-c.top-s-l/2,d=t.validateRange(v);t.updateThumbOffset(d)},t.onThumbMouseOver=function(){var i=t.cfg.theme.hover.thumbColor;t.getElementByLocalId("thumb").attr("stroke",i),t.draw()},t.onThumbMouseOut=function(){var i=t.cfg.theme.default.thumbColor;t.getElementByLocalId("thumb").attr("stroke",i),t.draw()},t}return e.prototype.setRange=function(t,i){this.set("minLimit",t),this.set("maxLimit",i);var n=this.getValue(),a=mt(n,t,i);n!==a&&!this.get("isInit")&&this.setValue(a)},e.prototype.getRange=function(){var t=this.get("minLimit")||0,i=this.get("maxLimit")||1;return{min:t,max:i}},e.prototype.setValue=function(t){var i=this.getRange(),n=this.getValue();this.update({thumbOffset:(this.get("trackLen")-this.get("thumbLen"))*mt(t,i.min,i.max)}),this.delegateEmit("valuechange",{originalValue:n,value:this.getValue()})},e.prototype.getValue=function(){return mt(this.get("thumbOffset")/(this.get("trackLen")-this.get("thumbLen")),0,1)},e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return g.__assign(g.__assign({},t),{name:"scrollbar",isHorizontal:!0,minThumbLen:20,thumbOffset:0,theme:vl})},e.prototype.renderInner=function(t){this.renderTrackShape(t),this.renderThumbShape(t)},e.prototype.applyOffset=function(){this.moveElementTo(this.get("group"),{x:this.get("x"),y:this.get("y")})},e.prototype.initEvent=function(){this.bindEvents()},e.prototype.renderTrackShape=function(t){var i=this.cfg,n=i.trackLen,a=i.theme,o=a===void 0?{default:{}}:a,s=Y({},vl,o).default,l=s.lineCap,u=s.trackColor,c=s.size,h=M(this.cfg,"size",c),f=this.get("isHorizontal")?{x1:0+h/2,y1:h/2,x2:n-h/2,y2:h/2,lineWidth:h,stroke:u,lineCap:l}:{x1:h/2,y1:0+h/2,x2:h/2,y2:n-h/2,lineWidth:h,stroke:u,lineCap:l};return this.addShape(t,{id:this.getElementId("track"),name:"track",type:"line",attrs:f})},e.prototype.renderThumbShape=function(t){var i=this.cfg,n=i.thumbOffset,a=i.thumbLen,o=i.theme,s=Y({},vl,o).default,l=s.size,u=s.lineCap,c=s.thumbColor,h=M(this.cfg,"size",l),f=this.get("isHorizontal")?{x1:n+h/2,y1:h/2,x2:n+a-h/2,y2:h/2,lineWidth:h,stroke:c,lineCap:u,cursor:"default"}:{x1:h/2,y1:n+h/2,x2:h/2,y2:n+a-h/2,lineWidth:h,stroke:c,lineCap:u,cursor:"default"};return this.addShape(t,{id:this.getElementId("thumb"),name:"thumb",type:"line",attrs:f})},e.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 i=t.findById(this.getElementId("track"));i.on("click",this.onTrackClick);var n=t.findById(this.getElementId("thumb"));n.on("mouseover",this.onThumbMouseOver),n.on("mouseout",this.onThumbMouseOut)},e.prototype.getContainerDOM=function(){var t=this.get("container"),i=t&&t.get("canvas");return i&&i.get("container")},e.prototype.validateRange=function(t){var i=this.cfg,n=i.thumbLen,a=i.trackLen,o=t;return t+n>a?o=a-n:t+na.x?a.x:e,t=ta.y?a.y:i,n=n=i&&r<=n}function xC(r,e,t){if(K(r))return r.padEnd(e,t);if(O(r)){var i=r.length;if(i=this.minX&&e.maxX<=this.maxX&&e.minY>=this.minY&&e.maxY<=this.maxY},r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height)},r.prototype.add=function(){for(var e=[],t=0;te.minX&&this.minYe.minY},r.prototype.size=function(){return this.width*this.height},r.prototype.isPointIn=function(e){return e.x>=this.minX&&e.x<=this.maxX&&e.y>=this.minY&&e.y<=this.maxY},r}();function wC(r){return[[r.minX,r.minY],[r.maxX,r.minY],[r.maxX,r.maxY],[r.minX,r.maxY]]}function _a(r){if(r.isPolar&&!r.isTransposed)return(r.endAngle-r.startAngle)*r.getRadius();var e=r.convert({x:0,y:0}),t=r.convert({x:1,y:0});return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function _C(r){if(r.isPolar){var e=r.startAngle,t=r.endAngle;return t-e===Math.PI*2}return!1}function Ms(r,e){var t=r.getCenter();return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function bC(r,e){var t=!1;if(r)if(r.type==="theta"){var i=r.start,n=r.end;t=Bi(e.x,i.x,n.x)&&Bi(e.y,i.y,n.y)}else{var a=r.invert(e);t=Bi(a.x,0,1)&&Bi(a.y,0,1)}return t}function Wi(r,e){var t=r.getCenter();return Math.atan2(e.y-t.y,e.x-t.x)}function vc(r,e){e===void 0&&(e=0);var t=r.start,i=r.end,n=r.getWidth(),a=r.getHeight();if(r.isPolar){var o=r.startAngle,s=r.endAngle,l=r.getCenter(),u=r.getRadius();return{type:"path",startState:{path:Lr(l.x,l.y,u+e,o,o)},endState:function(h){var f=(s-o)*h+o,v=Lr(l.x,l.y,u+e,o,f);return{path:v}},attrs:{path:Lr(l.x,l.y,u+e,o,s)}}}var c;return r.isTransposed?c={height:a+e*2}:c={width:n+e*2},{type:"rect",startState:{x:t.x-e,y:i.y-e,width:r.isTransposed?n+e*2:0,height:r.isTransposed?0:a+e*2},endState:c,attrs:{x:t.x-e,y:i.y-e,width:n+e*2,height:a+e*2}}}function SC(r,e){e===void 0&&(e=0);var t=r.start,i=r.end,n=r.getWidth(),a=r.getHeight(),o=Math.min(t.x,i.x),s=Math.min(t.y,i.y);return Qt.fromRange(o-e,s-e,o+n+e,s+a+e)}var CC=/^(?:(?!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 MC(r){var e="linear";return CC.test(r)?e="timeCat":K(r)&&(e="cat"),e}function zp(r,e,t,i){return e===void 0&&(e={}),e.type?e.type:r.type!=="identity"&&Pi.includes(t)&&["interval"].includes(i)||r.isCategory?"cat":r.type}function AC(r,e,t){var i=e||[];if(tt(r)||D(Ox(i,r))&&oe(t)){var n=ru("identity");return new n({field:r.toString(),values:[r]})}var a=De(i,r),o=M(t,"type",MC(a[0])),s=ru(o);return new s(g.__assign({field:r,values:a},t))}function FC(r,e){if(r.type!=="identity"&&e.type!=="identity"){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);r.change(t)}}function ra(r){return r.alias||r.field}function Vp(r,e,t){var i=r.values,n=i.length,a;if(n===1)a=[.5,1];else{var o=1,s=0;_C(e)?e.isTransposed?(o=M(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 TC(r){var e=r.values.filter(function(t){return!D(t)&&!isNaN(t)});return Math.max.apply(Math,g.__spreadArray(g.__spreadArray([],g.__read(e),!1),[D(r.max)?-1/0:r.max],!1))}function EC(r){var e,t;switch(r){case N.TOP:e={x:0,y:1},t={x:1,y:1};break;case N.RIGHT:e={x:1,y:0},t={x:1,y:1};break;case N.BOTTOM:e={x:0,y:0},t={x:1,y:0};break;case N.LEFT:e={x:0,y:0},t={x:0,y:1};break;default:e=t={x:0,y:0}}return{start:e,end:t}}function kC(r){var e,t;return r.isTransposed?(e={x:0,y:0},t={x:1,y:0}):(e={x:0,y:0},t={x:0,y:1}),{start:e,end:t}}function Ya(r,e){var t={start:{x:0,y:0},end:{x:0,y:0}};r.isRect?t=EC(e):r.isPolar&&(t=kC(r));var i=t.start,n=t.end;return{start:r.convert(i),end:r.convert(n)}}function Gp(r){var e=r.start,t=r.end;return e.x===t.x}function qf(r,e){var t=r.start,i=r.end,n=Gp(r);return n?(t.y-i.y)*(e.x-t.x)>0?1:-1:(i.x-t.x)*(t.y-e.y)>0?-1:1}function $a(r,e){var t=M(r,["components","axis"],{});return Y({},M(t,["common"],{}),Y({},M(t,[e],{})))}function Uf(r,e,t){var i=M(r,["components","axis"],{});return Y({},M(i,["common","title"],{}),Y({},M(i,[e,"title"],{})),t)}function dl(r){var e=r.x,t=r.y,i=r.circleCenter,n=t.start>t.end,a=r.isTransposed?r.convert({x:n?0:1,y:0}):r.convert({x:0,y:n?0:1}),o=[a.x-i.x,a.y-i.y],s=[1,0],l=a.y>i.y?Ch(o,s):Ch(o,s)*-1,u=l+(e.end-e.start),c=Math.sqrt(Math.pow(a.x-i.x,2)+Math.pow(a.y-i.y,2));return{center:i,radius:c,startAngle:l,endAngle:u}}function Oo(r,e){return $i(r)?r===!1?!1:{}:M(r,[e])}function jf(r,e){return M(r,"position",e)}function Zf(r,e){return M(e,["title","text"],ra(r))}var nn=function(){function r(e,t){this.destroyed=!1,this.facets=[],this.view=e,this.cfg=Y({},this.getDefaultCfg(),t)}return r.prototype.init=function(){this.container||(this.container=this.createContainer());var e=this.view.getData();this.facets=this.generateFacets(e)},r.prototype.render=function(){this.renderViews()},r.prototype.update=function(){},r.prototype.clear=function(){this.clearFacetViews()},r.prototype.destroy=function(){this.clear(),this.container&&(this.container.remove(!0),this.container=void 0),this.destroyed=!0,this.view=void 0,this.facets=[]},r.prototype.facetToView=function(e){var t=e.region,i=e.data,n=e.padding,a=n===void 0?this.cfg.padding:n,o=this.view.createView({region:t,padding:a});o.data(i||[]),e.view=o,this.beforeEachView(o,e);var s=this.cfg.eachView;return s&&s(o,e),this.afterEachView(o,e),o},r.prototype.createContainer=function(){var e=this.view.getLayer(At.FORE);return e.addGroup()},r.prototype.renderViews=function(){this.createFacetViews()},r.prototype.createFacetViews=function(){var e=this;return this.facets.map(function(t){return e.facetToView(t)})},r.prototype.clearFacetViews=function(){var e=this;S(this.facets,function(t){t.view&&(e.view.removeView(t.view),t.view=void 0)})},r.prototype.parseSpacing=function(){var e=this.view.viewBBox,t=e.width,i=e.height,n=this.cfg.spacing;return n.map(function(a,o){return tt(a)?a/(o===0?t:i):parseFloat(a)/100})},r.prototype.getFieldValues=function(e,t){var i=[],n={};return S(e,function(a){var o=a[t];!D(o)&&!n[o]&&(i.push(o),n[o]=!0)}),i},r.prototype.getRegion=function(e,t,i,n){var a=g.__read(this.parseSpacing(),2),o=a[0],s=a[1],l=(1+o)/(t===0?1:t)-o,u=(1+s)/(e===0?1:e)-s,c={x:(l+o)*i,y:(u+s)*n},h={x:c.x+l,y:c.y+u};return{start:c,end:h}},r.prototype.getDefaultCfg=function(){return{eachView:void 0,showTitle:!0,spacing:[0,0],padding:10,fields:[]}},r.prototype.getDefaultTitleCfg=function(){var e=this.view.getTheme().fontFamily;return{style:{fontSize:14,fill:"#666",fontFamily:e}}},r.prototype.processAxis=function(e,t){var i=e.getOptions(),n=i.coordinate,a=e.geometries,o=M(n,"type","rect");if(o==="rect"&&a.length){D(i.axes)&&(i.axes={});var s=i.axes,l=g.__read(a[0].getXYFields(),2),u=l[0],c=l[1],h=Oo(s,u),f=Oo(s,c);h!==!1&&(i.axes[u]=this.getXAxisOption(u,s,h,t)),f!==!1&&(i.axes[c]=this.getYAxisOption(c,s,f,t))}},r.prototype.getFacetDataFilter=function(e){return function(t){return Gu(e,function(i){var n=i.field,a=i.value;return!D(a)&&n?t[n]===a:!0})}},r}(),Yp={},LC=function(r){return Yp[en(r)]},an=function(r,e){Yp[en(r)]=e},yt=function(){function r(e,t){this.context=e,this.cfg=t,e.addAction(this)}return r.prototype.applyCfg=function(e){ft(this,e)},r.prototype.init=function(){this.applyCfg(this.cfg)},r.prototype.destroy=function(){this.context.removeAction(this),this.context=null},r}(),IC=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.execute=function(){this.callback&&this.callback(this.context)},e.prototype.destroy=function(){r.prototype.destroy.call(this),this.callback=null},e}(yt),dc={};function PC(r,e){var t=dc[r],i=null;if(t){var n=t.ActionClass,a=t.cfg;i=new n(e,a),i.name=r,i.init()}return i}function As(r){var e=dc[r];return M(e,"ActionClass")}function q(r,e,t){dc[r]={ActionClass:e,cfg:t}}function DC(r,e){var t=new IC(e);return t.callback=r,t.name="callback",t}function BC(r,e){var t=[];if(r.length){t.push(["M",r[0].x,r[0].y]);for(var i=1,n=r.length;i=o[u]?1:0,f=c>Math.PI?1:0,v=t.convert(s),d=Ms(t,v);if(d>=.5)if(c===Math.PI*2){var p={x:(s.x+o.x)/2,y:(s.y+o.y)/2},y=t.convert(p);l.push(["A",d,d,0,f,h,y.x,y.y]),l.push(["A",d,d,0,f,h,v.x,v.y])}else l.push(["A",d,d,0,f,h,v.x,v.y]);return l}function RC(r){S(r,function(e,t){var i=e;if(i[0].toLowerCase()==="a"){var n=r[t-1],a=r[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 NC=function(r,e,t,i){var n,a=[],o=!!i,s,l,u,c,h,f,v;if(o){n=g.__read(i,2),u=n[0],c=n[1];for(var d=0,p=r.length;d2&&(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>=e[s]&&(t.push([n].concat(o.splice(0,e[s]))),!!e[s]););return""}),t}var Qf=function(r,e,t){return r>=e&&r<=t};function HC(r,e,t,i){var n=.001,a={x:t.x-r.x,y:t.y-r.y},o={x:e.x-r.x,y:e.y-r.y},s={x:i.x-t.x,y:i.y-t.y},l=o.x*s.y-o.y*s.x,u=l*l,c=o.x*o.x+o.y*o.y,h=s.x*s.x+s.y*s.y,f=null;if(u>n*c*h){var v=(a.x*s.y-a.y*s.x)/l,d=(a.x*o.y-a.y*o.x)/l;Qf(v,0,1)&&Qf(d,0,1)&&(f={x:r.x+v*o.x,y:r.y+v*o.y})}return f}var XC=1e-6;function gl(r){return Math.abs(r)0!=gl(s[1]-t)>0&&gl(e-(t-o[1])*(o[0]-s[0])/(o[1]-s[1])-o[0])<0&&(i=!i)}return i}function Jf(r){for(var e=[],t=r.length,i=0;i1){var o=r[0],s=r[t-1];e.push({from:{x:s[0],y:s[1]},to:{x:o[0],y:o[1]}})}return e}function qC(r,e){var t=!1;return S(r,function(i){if(HC(i.from,i.to,e.from,e.to))return t=!0,!1}),t}function tv(r){var e=r.map(function(i){return i[0]}),t=r.map(function(i){return i[1]});return{minX:Math.min.apply(null,e),maxX:Math.max.apply(null,e),minY:Math.min.apply(null,t),maxY:Math.max.apply(null,t)}}function UC(r,e){return!(e.minX>r.maxX||e.maxXr.maxY||e.maxY0&&n>0&&(i>=e||n>=e)}function qp(r,e){var t=r.getCanvasBBox();return Wp(r,e)?t:null}function Up(r,e){var t=r.event.maskShapes;return t.map(function(i){return qp(i,e)}).filter(function(i){return!!i})}function ZC(r,e){var t=r.event,i=t.target;return jp(i,e)}function jp(r,e){return Wp(r,e)?r.attr("path"):null}function QC(r,e){var t=r.event.maskShapes;return t.map(function(i){return jp(i,e)})}function Br(r){var e=r.event,t,i=e.target;return i&&(t=i.get("element")),t}function di(r){var e=r.event,t=e.target,i;return t&&(i=t.get("delegateObject")),i}function Zp(r){var e=r.event.gEvent;return!(e&&e.fromShape&&e.toShape&&e.fromShape.get("element")===e.toShape.get("element"))}function ia(r){return r&&r.component&&r.component.isList()}function Qp(r){return r&&r.component&&r.component.isSlider()}function na(r){var e=r.event,t=e.target;return t&&(t==null?void 0:t.get("name"))==="mask"||Fs(r)}function Fs(r){var e;return((e=r.event.target)===null||e===void 0?void 0:e.get("name"))==="multi-mask"}function gc(r,e){var t=r.event.target;if(Fs(r))return KC(r,e);if(t.get("type")==="path"){var i=ZC(r,e);return i?ey(r.view,i):void 0}var n=Xp(r,e);return n?Ts(r.view,n):null}function KC(r,e){var t=r.event.target;if(t.get("type")==="path"){var i=QC(r,e);return i.length>0?i.flatMap(function(a){return ey(r.view,a)}):null}var n=Up(r,e);return n.length>0?n.flatMap(function(a){return Ts(r.view,a)}):null}function Kp(r,e,t){if(Fs(r))return JC(r,e,t);var i=Xp(r,t);return i?Jp(i,r,e):null}function Jp(r,e,t){var i=e.view,n=uu(i,t,{x:r.x,y:r.y}),a=uu(i,t,{x:r.maxX,y:r.maxY}),o={minX:n.x,minY:n.y,maxX:a.x,maxY:a.y};return Ts(t,o)}function JC(r,e,t){var i=Up(r,t);return i.length>0?i.flatMap(function(n){return Jp(n,r,e)}):null}function Gt(r){var e=r.geometries,t=[];return S(e,function(i){var n=i.elements;t=t.concat(n)}),r.views&&r.views.length&&S(r.views,function(i){t=t.concat(Gt(i))}),t}function tM(r,e,t){var i=Gt(r);return i.filter(function(n){return Be(n,e)===t})}function ty(r,e){var t=r.geometries,i=[];return S(t,function(n){var a=n.getElementsBy(function(o){return o.hasState(e)});i=i.concat(a)}),i}function Be(r,e){var t=r.getModel(),i=t.data,n;return O(i)?n=i[0][e]:n=i[e],n}function eM(r,e){return!(e.minX>r.maxX||e.maxXr.maxY||e.maxY=e.x&&r.y<=e.y&&r.maxY>e.y}function Xe(r){var e=r.parent,t=null;return e&&(t=e.views.filter(function(i){return i!==r})),t}function iM(r,e){var t=r.getCoordinate();return t.invert(e)}function uu(r,e,t){var i=iM(r,t);return e.getCoordinate().convert(i)}function iy(r,e,t,i){var n=!1;return S(r,function(a){if(a[t]===e[t]&&a[i]===e[i])return n=!0,!1}),n}function qi(r,e){var t=r.getScaleByField(e);return!t&&r.views&&S(r.views,function(i){if(t=qi(i,e),t)return!1}),t}var nM=function(){function r(e){this.actions=[],this.event=null,this.cacheMap={},this.view=e}return r.prototype.cache=function(){for(var e=[],t=0;t=0&&t.splice(i,1)},r.prototype.getCurrentPoint=function(){var e=this.event;if(e)if(e.target instanceof HTMLElement){var t=this.view.getCanvas(),i=t.getPointByClient(e.clientX,e.clientY);return i}else return{x:e.x,y:e.y};return null},r.prototype.getCurrentShape=function(){return M(this.event,["gEvent","shape"])},r.prototype.isInPlot=function(){var e=this.getCurrentPoint();return e?this.view.isPointInPlot(e):!1},r.prototype.isInShape=function(e){var t=this.getCurrentShape();return t?t.get("name")===e:!1},r.prototype.isInComponent=function(e){var t=ry(this.view),i=this.getCurrentPoint();return i?!!t.find(function(n){var a=n.getBBox();return e?n.get("name")===e&&rv(a,i):rv(a,i)}):!1},r.prototype.destroy=function(){S(this.actions.slice(),function(e){e.destroy()}),this.view=null,this.event=null,this.actions=null,this.cacheMap=null},r}(),aM=function(){function r(e,t){this.view=e,this.cfg=t}return r.prototype.init=function(){this.initEvents()},r.prototype.initEvents=function(){},r.prototype.clearEvents=function(){},r.prototype.destroy=function(){this.clearEvents()},r}();function iv(r,e,t){var i=r.split(":"),n=i[0],a=e.getAction(n)||PC(n,e);if(!a)throw new Error("There is no action named ".concat(n));var o=i[1];return{action:a,methodName:o,arg:t}}function nv(r){var e=r.action,t=r.methodName,i=r.arg;if(e[t])e[t](i);else throw new Error("Action(".concat(e.name,") doesn't have a method called ").concat(t))}var ce={START:"start",SHOW_ENABLE:"showEnable",END:"end",ROLLBACK:"rollback",PROCESSING:"processing"},oM=function(r){g.__extends(e,r);function e(t,i){var n=r.call(this,t,i)||this;return n.callbackCaches={},n.emitCaches={},n.steps=i,n}return e.prototype.init=function(){this.initContext(),r.prototype.init.call(this)},e.prototype.destroy=function(){r.prototype.destroy.call(this),this.steps=null,this.context&&(this.context.destroy(),this.context=null),this.callbackCaches=null,this.view=null},e.prototype.initEvents=function(){var t=this;S(this.steps,function(i,n){S(i,function(a){var o=t.getActionCallback(n,a);o&&t.bindEvent(a.trigger,o)})})},e.prototype.clearEvents=function(){var t=this;S(this.steps,function(i,n){S(i,function(a){var o=t.getActionCallback(n,a);o&&t.offEvent(a.trigger,o)})})},e.prototype.initContext=function(){var t=this.view,i=new nM(t);this.context=i;var n=this.steps;S(n,function(a){S(a,function(o){if(W(o.action))o.actionObject={action:DC(o.action,i),methodName:"execute"};else if(K(o.action))o.actionObject=iv(o.action,i,o.arg);else if(O(o.action)){var s=o.action,l=O(o.arg)?o.arg:[o.arg];o.actionObject=[],S(s,function(u,c){o.actionObject.push(iv(u,i,l[c]))})}})})},e.prototype.isAllowStep=function(t){var i=this.currentStepName,n=this.steps;if(i===t||t===ce.SHOW_ENABLE)return!0;if(t===ce.PROCESSING)return i===ce.START;if(t===ce.START)return i!==ce.PROCESSING;if(t===ce.END)return i===ce.PROCESSING||i===ce.START;if(t===ce.ROLLBACK){if(n[ce.END])return i===ce.END;if(i===ce.START)return!0}return!1},e.prototype.isAllowExecute=function(t,i){if(this.isAllowStep(t)){var n=this.getKey(t,i);return i.once&&this.emitCaches[n]?!1:i.isEnable?i.isEnable(this.context):!0}return!1},e.prototype.enterStep=function(t){this.currentStepName=t,this.emitCaches={}},e.prototype.afterExecute=function(t,i){t!==ce.SHOW_ENABLE&&this.currentStepName!==t&&this.enterStep(t);var n=this.getKey(t,i);this.emitCaches[n]=!0},e.prototype.getKey=function(t,i){return t+i.trigger+i.action},e.prototype.getActionCallback=function(t,i){var n=this,a=this.context,o=this.callbackCaches,s=i.actionObject;if(i.action&&s){var l=this.getKey(t,i);if(!o[l]){var u=function(c){a.event=c,n.isAllowExecute(t,i)?(O(s)?S(s,function(h){a.event=c,nv(h)}):(a.event=c,nv(s)),n.afterExecute(t,i),i.callback&&(a.event=c,i.callback(a))):a.event=null};i.debounce?o[l]=ig(u,i.debounce.wait,i.debounce.immediate):i.throttle?o[l]=Yu(u,i.throttle.wait,{leading:i.throttle.leading,trailing:i.throttle.trailing}):o[l]=u}return o[l]}return null},e.prototype.bindEvent=function(t,i){var n=t.split(":");n[0]==="window"?window.addEventListener(n[1],i):n[0]==="document"?document.addEventListener(n[1],i):this.view.on(t,i)},e.prototype.offEvent=function(t,i){var n=t.split(":");n[0]==="window"?window.removeEventListener(n[1],i):n[0]==="document"?document.removeEventListener(n[1],i):this.view.off(t,i)},e}(aM),ny={};function sM(r){return ny[en(r)]}function J(r,e){ny[en(r)]=e}function lM(r,e,t){var i=sM(r);if(!i)return null;if(Ln(i)){var n=ft(he(i),t);return new oM(e,n)}else{var a=i;return new a(e,t)}}function uM(r){return{title:{autoRotate:!0,position:"center",spacing:r.axisTitleSpacing,style:{fill:r.axisTitleTextFillColor,fontSize:r.axisTitleTextFontSize,lineHeight:r.axisTitleTextLineHeight,textBaseline:"middle",fontFamily:r.fontFamily},iconStyle:{fill:r.axisDescriptionIconFillColor}},label:{autoRotate:!1,autoEllipsis:!1,autoHide:{type:"equidistance",cfg:{minGap:6}},offset:r.axisLabelOffset,style:{fill:r.axisLabelFillColor,fontSize:r.axisLabelFontSize,lineHeight:r.axisLabelLineHeight,fontFamily:r.fontFamily}},line:{style:{lineWidth:r.axisLineBorder,stroke:r.axisLineBorderColor}},grid:{line:{type:"line",style:{stroke:r.axisGridBorderColor,lineWidth:r.axisGridBorder,lineDash:r.axisGridLineDash}},alignTick:!0,animate:!0},tickLine:{style:{lineWidth:r.axisTickLineBorder,stroke:r.axisTickLineBorderColor},alignTick:!0,length:r.axisTickLineLength},subTickLine:null,animate:!0}}function cM(r){return{title:null,marker:{symbol:"circle",spacing:r.legendMarkerSpacing,style:{r:r.legendCircleMarkerSize,fill:r.legendMarkerColor}},itemName:{spacing:5,style:{fill:r.legendItemNameFillColor,fontFamily:r.fontFamily,fontSize:r.legendItemNameFontSize,lineHeight:r.legendItemNameLineHeight,fontWeight:r.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:r.legendPageNavigatorMarkerSize,inactiveFill:r.legendPageNavigatorMarkerInactiveFillColor,inactiveOpacity:r.legendPageNavigatorMarkerInactiveFillOpacity,fill:r.legendPageNavigatorMarkerFillColor,opacity:r.legendPageNavigatorMarkerFillOpacity}},text:{style:{fill:r.legendPageNavigatorTextFillColor,fontSize:r.legendPageNavigatorTextFontSize}}},animate:!1,maxItemWidth:200,itemSpacing:r.legendItemSpacing,itemMarginBottom:r.legendItemMarginBottom,padding:r.legendPadding}}function ay(r){var e,t={point:{default:{fill:r.pointFillColor,r:r.pointSize,stroke:r.pointBorderColor,lineWidth:r.pointBorder,fillOpacity:r.pointFillOpacity},active:{stroke:r.pointActiveBorderColor,lineWidth:r.pointActiveBorder},selected:{stroke:r.pointSelectedBorderColor,lineWidth:r.pointSelectedBorder},inactive:{fillOpacity:r.pointInactiveFillOpacity,strokeOpacity:r.pointInactiveBorderOpacity}},hollowPoint:{default:{fill:r.hollowPointFillColor,lineWidth:r.hollowPointBorder,stroke:r.hollowPointBorderColor,strokeOpacity:r.hollowPointBorderOpacity,r:r.hollowPointSize},active:{stroke:r.hollowPointActiveBorderColor,strokeOpacity:r.hollowPointActiveBorderOpacity},selected:{lineWidth:r.hollowPointSelectedBorder,stroke:r.hollowPointSelectedBorderColor,strokeOpacity:r.hollowPointSelectedBorderOpacity},inactive:{strokeOpacity:r.hollowPointInactiveBorderOpacity}},area:{default:{fill:r.areaFillColor,fillOpacity:r.areaFillOpacity,stroke:null},active:{fillOpacity:r.areaActiveFillOpacity},selected:{fillOpacity:r.areaSelectedFillOpacity},inactive:{fillOpacity:r.areaInactiveFillOpacity}},hollowArea:{default:{fill:null,stroke:r.hollowAreaBorderColor,lineWidth:r.hollowAreaBorder,strokeOpacity:r.hollowAreaBorderOpacity},active:{fill:null,lineWidth:r.hollowAreaActiveBorder},selected:{fill:null,lineWidth:r.hollowAreaSelectedBorder},inactive:{strokeOpacity:r.hollowAreaInactiveBorderOpacity}},interval:{default:{fill:r.intervalFillColor,fillOpacity:r.intervalFillOpacity},active:{stroke:r.intervalActiveBorderColor,lineWidth:r.intervalActiveBorder},selected:{stroke:r.intervalSelectedBorderColor,lineWidth:r.intervalSelectedBorder},inactive:{fillOpacity:r.intervalInactiveFillOpacity,strokeOpacity:r.intervalInactiveBorderOpacity}},hollowInterval:{default:{fill:r.hollowIntervalFillColor,stroke:r.hollowIntervalBorderColor,lineWidth:r.hollowIntervalBorder,strokeOpacity:r.hollowIntervalBorderOpacity},active:{stroke:r.hollowIntervalActiveBorderColor,lineWidth:r.hollowIntervalActiveBorder,strokeOpacity:r.hollowIntervalActiveBorderOpacity},selected:{stroke:r.hollowIntervalSelectedBorderColor,lineWidth:r.hollowIntervalSelectedBorder,strokeOpacity:r.hollowIntervalSelectedBorderOpacity},inactive:{stroke:r.hollowIntervalInactiveBorderColor,lineWidth:r.hollowIntervalInactiveBorder,strokeOpacity:r.hollowIntervalInactiveBorderOpacity}},line:{default:{stroke:r.lineBorderColor,lineWidth:r.lineBorder,strokeOpacity:r.lineBorderOpacity,fill:null,lineAppendWidth:10,lineCap:"round",lineJoin:"round"},active:{lineWidth:r.lineActiveBorder},selected:{lineWidth:r.lineSelectedBorder},inactive:{strokeOpacity:r.lineInactiveBorderOpacity}}},i=uM(r),n=cM(r);return{background:r.backgroundColor,defaultColor:r.brandColor,subColor:r.subColor,semanticRed:r.paletteSemanticRed,semanticGreen:r.paletteSemanticGreen,padding:"auto",fontFamily:r.fontFamily,columnWidthRatio:1/2,maxColumnWidth:null,minColumnWidth:null,roseWidthRatio:.9999999,multiplePieWidthRatio:1/1.3,colors10:r.paletteQualitative10,colors20:r.paletteQualitative20,sequenceColors:r.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=ea(a.getModel(),o),l=s.startAngle,u=s.endAngle,c=(l+u)/2,h=7.5,f=h*Math.cos(c),v=h*Math.sin(c);return{matrix:kt(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:g.__assign(g.__assign({},t.line.default),{lineCap:null,lineDash:[1,1]})},active:{style:g.__assign(g.__assign({},t.line.active),{lineCap:null,lineDash:[1,1]})},inactive:{style:g.__assign(g.__assign({},t.line.inactive),{lineCap:null,lineDash:[1,1]})},selected:{style:g.__assign(g.__assign({},t.line.selected),{lineCap:null,lineDash:[1,1]})}},dash:{default:{style:g.__assign(g.__assign({},t.line.default),{lineCap:null,lineDash:[5.5,1]})},active:{style:g.__assign(g.__assign({},t.line.active),{lineCap:null,lineDash:[5.5,1]})},inactive:{style:g.__assign(g.__assign({},t.line.inactive),{lineCap:null,lineDash:[5.5,1]})},selected:{style:g.__assign(g.__assign({},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:i,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:Y({},i.grid,{line:{type:"line"}})},radius:{title:null,grid:Y({},i.grid,{line:{type:"circle"}})}},legend:{common:n,right:{layout:"vertical",padding:r.legendVerticalPadding},left:{layout:"vertical",padding:r.legendVerticalPadding},top:{layout:"horizontal",padding:r.legendHorizontalPadding},bottom:{layout:"horizontal",padding:r.legendHorizontalPadding},continuous:{title:null,background:null,track:{},rail:{type:"color",size:r.sliderRailHeight,defaultLength:r.sliderRailWidth,style:{fill:r.sliderRailFillColor,stroke:r.sliderRailBorderColor,lineWidth:r.sliderRailBorder}},label:{align:"rail",spacing:4,formatter:null,style:{fill:r.sliderLabelTextFillColor,fontSize:r.sliderLabelTextFontSize,lineHeight:r.sliderLabelTextLineHeight,textBaseline:"middle",fontFamily:r.fontFamily}},handler:{size:r.sliderHandlerWidth,style:{fill:r.sliderHandlerFillColor,stroke:r.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:r.tooltipCrosshairsBorderColor,lineWidth:r.tooltipCrosshairsBorder}},text:null,textBackground:{padding:2,style:{fill:"rgba(0, 0, 0, 0.25)",lineWidth:0,stroke:null}},follow:!1},domStyles:(e={},e["".concat(hr)]={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:r.tooltipContainerFillColor,opacity:r.tooltipContainerFillOpacity,boxShadow:r.tooltipContainerShadow,borderRadius:"".concat(r.tooltipContainerBorderRadius,"px"),color:r.tooltipTextFillColor,fontSize:"".concat(r.tooltipTextFontSize,"px"),fontFamily:r.fontFamily,lineHeight:"".concat(r.tooltipTextLineHeight,"px"),padding:"0 12px 0 12px"},e["".concat(fr)]={marginBottom:"12px",marginTop:"12px"},e["".concat(ta)]={margin:0,listStyleType:"none",padding:0},e["".concat(_s)]={listStyleType:"none",padding:0,marginBottom:"12px",marginTop:"12px",marginLeft:0,marginRight:0},e["".concat(bs)]={width:"8px",height:"8px",borderRadius:"50%",display:"inline-block",marginRight:"8px"},e["".concat(Ss)]={display:"inline-block",float:"right",marginLeft:"30px"},e)},annotation:{arc:{style:{stroke:r.annotationArcBorderColor,lineWidth:r.annotationArcBorder},animate:!0},line:{style:{stroke:r.annotationLineBorderColor,lineDash:r.annotationLineDash,lineWidth:r.annotationLineBorder},text:{position:"start",autoRotate:!0,style:{fill:r.annotationTextFillColor,stroke:r.annotationTextBorderColor,lineWidth:r.annotationTextBorder,fontSize:r.annotationTextFontSize,textAlign:"start",fontFamily:r.fontFamily,textBaseline:"bottom"}},animate:!0},text:{style:{fill:r.annotationTextFillColor,stroke:r.annotationTextBorderColor,lineWidth:r.annotationTextBorder,fontSize:r.annotationTextFontSize,textBaseline:"middle",textAlign:"start",fontFamily:r.fontFamily},animate:!0},region:{top:!1,style:{lineWidth:r.annotationRegionBorder,stroke:r.annotationRegionBorderColor,fill:r.annotationRegionFillColor,fillOpacity:r.annotationRegionFillOpacity},animate:!0},image:{top:!1,animate:!0},dataMarker:{top:!0,point:{style:{r:3,stroke:r.brandColor,lineWidth:2}},line:{style:{stroke:r.annotationLineBorderColor,lineWidth:r.annotationLineBorder},length:r.annotationDataMarkerLineLength},text:{style:{textAlign:"start",fill:r.annotationTextFillColor,stroke:r.annotationTextBorderColor,lineWidth:r.annotationTextBorder,fontSize:r.annotationTextFontSize,fontFamily:r.fontFamily}},direction:"upward",autoAdjust:!0,animate:!0},dataRegion:{style:{region:{fill:r.annotationRegionFillColor,fillOpacity:r.annotationRegionFillOpacity},text:{textAlign:"center",textBaseline:"bottom",fill:r.annotationTextFillColor,stroke:r.annotationTextBorderColor,lineWidth:r.annotationTextBorder,fontSize:r.annotationTextFontSize,fontFamily:r.fontFamily}},animate:!0}},slider:{common:{padding:[8,8,8,8],backgroundStyle:{fill:r.cSliderBackgroundFillColor,opacity:r.cSliderBackgroundFillOpacity},foregroundStyle:{fill:r.cSliderForegroundFillColor,opacity:r.cSliderForegroundFillOpacity},handlerStyle:{width:r.cSliderHandlerWidth,height:r.cSliderHandlerHeight,fill:r.cSliderHandlerFillColor,opacity:r.cSliderHandlerFillOpacity,stroke:r.cSliderHandlerBorderColor,lineWidth:r.cSliderHandlerBorder,radius:r.cSliderHandlerBorderRadius,highLightFill:r.cSliderHandlerHighlightFillColor},textStyle:{fill:r.cSliderTextFillColor,opacity:r.cSliderTextFillOpacity,fontSize:r.cSliderTextFontSize,lineHeight:r.cSliderTextLineHeight,fontWeight:r.cSliderTextFontWeight,stroke:r.cSliderTextBorderColor,lineWidth:r.cSliderTextBorder}}},scrollbar:{common:{padding:[8,8,8,8]},default:{style:{trackColor:r.scrollbarTrackFillColor,thumbColor:r.scrollbarThumbFillColor}},hover:{style:{thumbColor:r.scrollbarThumbHighlightFillColor}}}},labels:{offset:12,style:{fill:r.labelFillColor,fontSize:r.labelFontSize,fontFamily:r.fontFamily,stroke:r.labelBorderColor,lineWidth:r.labelBorder},fillColorDark:r.labelFillColorDark,fillColorLight:r.labelFillColorLight,autoRotate:!0},innerLabels:{style:{fill:r.innerLabelFillColor,fontSize:r.innerLabelFontSize,fontFamily:r.fontFamily,stroke:r.innerLabelBorderColor,lineWidth:r.innerLabelBorder},autoRotate:!0},overflowLabels:{style:{fill:r.overflowLabelFillColor,fontSize:r.overflowLabelFontSize,fontFamily:r.fontFamily,stroke:r.overflowLabelBorderColor,lineWidth:r.overflowLabelBorder}},pieLabels:{labelHeight:14,offset:10,labelLine:{style:{lineWidth:r.labelLineBorder}},autoRotate:!0}}}var ut={100:"#000",95:"#0D0D0D",85:"#262626",65:"#595959",45:"#8C8C8C",25:"#BFBFBF",15:"#D9D9D9",6:"#F0F0F0"},Ai={100:"#FFFFFF",95:"#F2F2F2",85:"#D9D9D9",65:"#A6A6A6",45:"#737373",25:"#404040",15:"#262626",6:"#0F0F0F"},hM=["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"],fM=["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"],vM=["#B8E1FF","#9AC5FF","#7DAAFF","#5B8FF9","#3D76DD","#085EC0","#0047A5","#00318A","#001D70"],oy=function(r){r===void 0&&(r={});var e=r.paletteQualitative10,t=e===void 0?hM:e,i=r.paletteQualitative20,n=i===void 0?fM:i,a=r.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:vM,fontFamily:`"Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"`,axisLineBorderColor:ut[25],axisLineBorder:1,axisLineDash:null,axisTitleTextFillColor:ut[65],axisTitleTextFontSize:12,axisTitleTextLineHeight:12,axisTitleTextFontWeight:"normal",axisTitleSpacing:12,axisDescriptionIconFillColor:Ai[85],axisTickLineBorderColor:ut[25],axisTickLineLength:4,axisTickLineBorder:1,axisSubTickLineBorderColor:ut[15],axisSubTickLineLength:2,axisSubTickLineBorder:1,axisLabelFillColor:ut[45],axisLabelFontSize:12,axisLabelLineHeight:12,axisLabelFontWeight:"normal",axisLabelOffset:8,axisGridBorderColor:ut[15],axisGridBorder:1,axisGridLineDash:null,legendTitleTextFillColor:ut[45],legendTitleTextFontSize:12,legendTitleTextLineHeight:21,legendTitleTextFontWeight:"normal",legendMarkerColor:o,legendMarkerSpacing:8,legendMarkerSize:4,legendCircleMarkerSize:4,legendSquareMarkerSize:4,legendLineMarkerSize:5,legendItemNameFillColor:ut[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:ut[100],legendPageNavigatorMarkerInactiveFillOpacity:.45,legendPageNavigatorMarkerFillColor:ut[100],legendPageNavigatorMarkerFillOpacity:1,legendPageNavigatorTextFillColor:ut[45],legendPageNavigatorTextFontSize:12,sliderRailFillColor:ut[15],sliderRailBorder:0,sliderRailBorderColor:null,sliderRailWidth:100,sliderRailHeight:12,sliderLabelTextFillColor:ut[45],sliderLabelTextFontSize:12,sliderLabelTextLineHeight:12,sliderLabelTextFontWeight:"normal",sliderHandlerFillColor:ut[6],sliderHandlerWidth:10,sliderHandlerHeight:14,sliderHandlerBorder:1,sliderHandlerBorderColor:ut[25],annotationArcBorderColor:ut[15],annotationArcBorder:1,annotationLineBorderColor:ut[25],annotationLineBorder:1,annotationLineDash:null,annotationTextFillColor:ut[65],annotationTextFontSize:12,annotationTextLineHeight:12,annotationTextFontWeight:"normal",annotationTextBorderColor:null,annotationTextBorder:0,annotationRegionFillColor:ut[100],annotationRegionFillOpacity:.06,annotationRegionBorder:0,annotationRegionBorderColor:null,annotationDataMarkerLineLength:16,tooltipCrosshairsBorderColor:ut[25],tooltipCrosshairsBorder:1,tooltipCrosshairsLineDash:null,tooltipContainerFillColor:"rgb(255, 255, 255)",tooltipContainerFillOpacity:.95,tooltipContainerShadow:"0px 0px 10px #aeaeae",tooltipContainerBorderRadius:3,tooltipTextFillColor:ut[65],tooltipTextFontSize:12,tooltipTextLineHeight:12,tooltipTextFontWeight:"bold",labelFillColor:ut[65],labelFillColorDark:"#2c3542",labelFillColorLight:"#ffffff",labelFontSize:12,labelLineHeight:12,labelFontWeight:"normal",labelBorderColor:null,labelBorder:0,innerLabelFillColor:Ai[100],innerLabelFontSize:12,innerLabelLineHeight:12,innerLabelFontWeight:"normal",innerLabelBorderColor:null,innerLabelBorder:0,overflowLabelFillColor:ut[65],overflowLabelFontSize:12,overflowLabelLineHeight:12,overflowLabelFontWeight:"normal",overflowLabelBorderColor:Ai[100],overflowLabelBorder:1,labelLineBorder:1,labelLineBorderColor:ut[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:Ai[100],pointBorderOpacity:1,pointActiveBorderColor:ut[100],pointSelectedBorder:2,pointSelectedBorderColor:ut[100],pointInactiveFillOpacity:.3,pointInactiveBorderOpacity:.3,hollowPointSize:4,hollowPointBorder:1,hollowPointBorderColor:o,hollowPointBorderOpacity:.95,hollowPointFillColor:Ai[100],hollowPointActiveBorder:1,hollowPointActiveBorderColor:ut[100],hollowPointActiveBorderOpacity:1,hollowPointSelectedBorder:2,hollowPointSelectedBorderColor:ut[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:ut[100],hollowAreaSelectedBorder:3,hollowAreaSelectedBorderColor:ut[100],hollowAreaInactiveBorderOpacity:.3,intervalFillColor:o,intervalFillOpacity:.95,intervalActiveBorder:1,intervalActiveBorderColor:ut[100],intervalActiveBorderOpacity:1,intervalSelectedBorder:2,intervalSelectedBorderColor:ut[100],intervalSelectedBorderOpacity:1,intervalInactiveBorderOpacity:.3,intervalInactiveFillOpacity:.3,hollowIntervalBorder:2,hollowIntervalBorderColor:o,hollowIntervalBorderOpacity:1,hollowIntervalFillColor:Ai[100],hollowIntervalActiveBorder:2,hollowIntervalActiveBorderColor:ut[100],hollowIntervalSelectedBorder:3,hollowIntervalSelectedBorderColor:ut[100],hollowIntervalSelectedBorderOpacity:1,hollowIntervalInactiveBorderOpacity:.3};return g.__assign(g.__assign({},s),r)};oy();function No(r){var e=r.styleSheet,t=e===void 0?{}:e,i=g.__rest(r,["styleSheet"]),n=oy(t);return Y({},ay(n),i)}var dM=No({}),cu={default:dM};function Nn(r){return M(cu,en(r),cu.default)}function gM(r,e){cu[en(r)]=No(e)}function av(r,e,t){var i=t.translate(r),n=t.translate(e);return zt(i,n)}function pM(r,e){var t=e.coordinate,i=e.getXScale(),n=i.range,a=n[n.length-1],o=n[0],s=t.invert(r),l=s.x;return t.isPolar&&l>(1+a)/2&&(l=o),i.translate(i.invert(l))}function ov(r,e,t){var i=t.coordinate,n=t.getYScale(),a=n.field,o=i.invert(e),s=n.invert(o.y),l=Le(r,function(u){var c=u[gt];return c[a][0]<=s&&c[a][1]>=s});return l||r[r.length-1]}var yM=ga(function(r){if(r.isCategory)return 1;for(var e=r.values,t=e.length,i=r.translate(e[0]),n=i,a=0;an&&(n=s)}return(n-i)/(t-1)});function mM(r,e,t){var i=e.getAttribute("position"),n=i.getFields(),a=e.scales,o=W(t)||!t?n[0]:t,s=a[o],l=s?s.getText(r[o]):r[o]||o;return W(t)?t(l,r):l}function xM(r){var e=$u(r.attributes);return Xt(e,function(t){return Ei(Pi,t.type)})}function sy(r){var e,t,i=xM(r),n;try{for(var a=g.__values(i),o=a.next();!o.done;o=a.next()){var s=o.value,l=s.getScale(s.type);if(l&&l.isLinear){var u=M(r.scaleDefs,l.field),c=zp(l,u,s.type,r.type);if(c!=="cat"){n=l;break}}}}catch(v){e={error:v}}finally{try{o&&!o.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}var h=r.getXScale(),f=r.getYScale();return n||f||h}function wM(r,e){var t=e.field,i=r[t];if(O(i)){var n=i.map(function(a){return e.getText(a)});return n.join("-")}return e.getText(i)}function _M(r,e){var t,i=e.getGroupScales();if(i.length&&(t=i[0]),t){var n=t.field;return t.getText(r[n])}var a=sy(e);return ra(a)}function ly(r,e,t){if(e.length===0)return null;var i=t.type,n=t.getXScale(),a=t.getYScale(),o=n.field,s=a.field,l=null;if(i==="heatmap"||i==="point"){for(var u=t.coordinate,c=u.invert(r),h=n.invert(c.x),f=a.invert(c.y),v=1/0,d=0;d=w)if(F)O(l)||(l=[]),l.push(E);else{l=E;break}}O(l)&&(l=ov(l,r,t))}else{var T=void 0;if(!n.isLinear&&n.type!=="timeCat"){for(var d=0;dn.translate(A)||wn.max||wMath.abs(n.translate(T[gt][o])-w)&&(_=T)}var X=yM(t.getXScale());return!l&&Math.abs(n.translate(_[gt][o])-w)<=X/2&&(l=_),l}function yc(r,e,t,i){var n,a;t===void 0&&(t=""),i===void 0&&(i=!1);var o=r[gt],s=mM(o,e,t),l=e.tooltipOption,u=e.theme.defaultColor,c=[],h,f;function v(E,T){if(i||!D(T)&&T!==""){var k={title:s,data:o,mappingData:r,name:E,value:T,color:r.color||u,marker:!0};c.push(k)}}if(pt(l)){var d=l.fields,p=l.callback;if(p){var y=d.map(function(E){return r[gt][E]}),m=p.apply(void 0,g.__spreadArray([],g.__read(y),!1)),x=g.__assign({data:r[gt],mappingData:r,title:s,color:r.color||u,marker:!0},m);c.push(x)}else{var _=e.scales;try{for(var w=g.__values(d),b=w.next();!b.done;b=w.next()){var C=b.value;if(!D(o[C])){var A=_[C];h=ra(A),f=A.getText(o[C]),v(h,f)}}}catch(E){n={error:E}}finally{try{b&&!b.done&&(a=w.return)&&a.call(w)}finally{if(n)throw n.error}}}}else{var F=sy(e);f=wM(o,F),h=_M(o,e),v(h,f)}return c}function sv(r,e,t,i){var n,a,o=i.showNil,s=[],l=r.dataArray;if(!oe(l)){r.sort(l);try{for(var u=g.__values(l),c=u.next();!c.done;c=u.next()){var h=c.value,f=ly(e,h,r);if(f){var v=r.getElementId(f),d=r.elementsMap[v];if(r.type==="heatmap"||d.visible){var p=yc(f,r,t,o);p.length&&s.push(p)}}}}catch(y){n={error:y}}finally{try{c&&!c.done&&(a=u.return)&&a.call(u)}finally{if(n)throw n.error}}}return s}function lv(r,e,t,i){var n=i.showNil,a=[],o=r.container,s=o.getShape(e.x,e.y);if(s&&s.get("visible")&&s.get("origin")){var l=s.get("origin").mappingData,u=yc(l,r,t,n);u.length&&a.push(u)}return a}function hu(r,e,t){var i,n,a=[],o=r.geometries,s=t.shared,l=t.title,u=t.reversed;try{for(var c=g.__values(o),h=c.next();!h.done;h=c.next()){var f=h.value;if(f.visible&&f.tooltipOption!==!1){var v=f.type,d=void 0;["point","edge","polygon"].includes(v)?d=lv(f,e,l,t):["area","line","path","heatmap"].includes(v)||s!==!1?d=sv(f,e,l,t):d=lv(f,e,l,t),d.length&&(u&&d.reverse(),a.push(d))}}}catch(p){i={error:p}}finally{try{h&&!h.done&&(n=c.return)&&n.call(c)}finally{if(i)throw i.error}}return a}function bM(r,e,t){var i,n,a=hu(r,e,t);try{for(var o=g.__values(r.views),s=o.next();!s.done;s=o.next()){var l=s.value;a=a.concat(hu(l,e,t))}}catch(u){i={error:u}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function SM(r){return!tt(r)&&!O(r)}function mc(r){r===void 0&&(r=0);var e=O(r)?r:[r];switch(e.length){case 0:e=[0,0,0,0];break;case 1:e=new Array(4).fill(e[0]);break;case 2:e=g.__spreadArray(g.__spreadArray([],g.__read(e),!1),g.__read(e),!1);break;case 3:e=g.__spreadArray(g.__spreadArray([],g.__read(e),!1),[e[1]],!1);break;default:e=e.slice(0,4);break}return e}var xc={};function wi(r,e){xc[r]=e}function CM(){return Object.keys(xc)}function MM(r){return xc[r]}var AM=function(){function r(e){this.option=this.wrapperOption(e)}return r.prototype.update=function(e){return this.option=this.wrapperOption(e),this},r.prototype.hasAction=function(e){var t=this.option.actions;return Qo(t,function(i){return i[0]===e})},r.prototype.create=function(e,t){var i=this.option,n=i.type,a=i.cfg,o=n==="theta",s=g.__assign({start:e,end:t},a),l=zb(o?"polar":n);return this.coordinate=new l(s),this.coordinate.type=n,o&&(this.hasAction("transpose")||this.transpose()),this.execActions(),this.coordinate},r.prototype.adjust=function(e,t){return this.coordinate.update({start:e,end:t}),this.coordinate.resetMatrix(),this.execActions(["scale","rotate","translate"]),this.coordinate},r.prototype.rotate=function(e){return this.option.actions.push(["rotate",e]),this},r.prototype.reflect=function(e){return this.option.actions.push(["reflect",e]),this},r.prototype.scale=function(e,t){return this.option.actions.push(["scale",e,t]),this},r.prototype.transpose=function(){return this.option.actions.push(["transpose"]),this},r.prototype.getOption=function(){return this.option},r.prototype.getCoordinate=function(){return this.coordinate},r.prototype.wrapperOption=function(e){return g.__assign({type:"rect",actions:[],cfg:{}},e)},r.prototype.execActions=function(e){var t=this,i=this.option.actions;S(i,function(n){var a,o=g.__read(n),s=o[0],l=o.slice(1),u=D(e)?!0:e.includes(s);u&&(a=t.coordinate)[s].apply(a,g.__spreadArray([],g.__read(l),!1))})},r}(),bt=function(){function r(e,t,i){this.view=e,this.gEvent=t,this.data=i,this.type=t.type}return r.fromData=function(e,t,i){return new r(e,new ya(t,{}),i)},Object.defineProperty(r.prototype,"target",{get:function(){return this.gEvent.target},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"event",{get:function(){return this.gEvent.originalEvent},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"x",{get:function(){return this.gEvent.x},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"y",{get:function(){return this.gEvent.y},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"clientX",{get:function(){return this.gEvent.clientX},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"clientY",{get:function(){return this.gEvent.clientY},enumerable:!1,configurable:!0}),r.prototype.toString=function(){return"[Event (type=".concat(this.type,")]")},r.prototype.clone=function(){return new r(this.view,this.gEvent,this.data)},r}();function FM(r){var e=r.getController("axis"),t=r.getController("legend"),i=r.getController("annotation"),n=r.getController("slider"),a=r.getController("scrollbar");[e,n,a,t,i].forEach(function(o){o&&o.layout()})}var TM=function(){function r(){this.scales=new Map,this.syncScales=new Map}return r.prototype.createScale=function(e,t,i,n){var a=i,o=this.getScaleMeta(n);if(t.length===0&&o){var s=o.scale,l={type:s.type};s.isCategory&&(l.values=s.values),a=Y(l,o.scaleDef,i)}var u=AC(e,t,a);return this.cacheScale(u,i,n),u},r.prototype.sync=function(e,t){var i=this;this.syncScales.forEach(function(n,a){var o=Number.MAX_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER,l=[];S(n,function(u){var c=i.getScale(u);s=tt(c.max)?Math.max(s,c.max):s,o=tt(c.min)?Math.min(o,c.min):o,S(c.values,function(h){l.includes(h)||l.push(h)})}),S(n,function(u){var c=i.getScale(u);if(c.isContinuous)c.change({min:o,max:s,values:l});else if(c.isCategory){var h=c.range,f=i.getScaleMeta(u);l&&!M(f,["scaleDef","range"])&&(h=Vp(Y({},c,{values:l}),e,t)),c.change({values:l,range:h})}})})},r.prototype.cacheScale=function(e,t,i){var n=this.getScaleMeta(i);n&&n.scale.type===e.type?(FC(n.scale,e),n.scaleDef=t):(n={key:i,scale:e,scaleDef:t},this.scales.set(i,n));var a=this.getSyncKey(n);if(n.syncKey=a,this.removeFromSyncScales(i),a){var o=this.syncScales.get(a);o||(o=[],this.syncScales.set(a,o)),o.push(i)}},r.prototype.getScale=function(e){var t=this.getScaleMeta(e);if(!t){var i=It(e.split("-")),n=this.syncScales.get(i);n&&n.length&&(t=this.getScaleMeta(n[0]))}return t&&t.scale},r.prototype.deleteScale=function(e){var t=this.getScaleMeta(e);if(t){var i=t.syncKey,n=this.syncScales.get(i);if(n&&n.length){var a=n.indexOf(e);a!==-1&&n.splice(a,1)}}this.scales.delete(e)},r.prototype.clear=function(){this.scales.clear(),this.syncScales.clear()},r.prototype.removeFromSyncScales=function(e){var t=this;this.syncScales.forEach(function(i,n){var a=i.indexOf(e);if(a!==-1)return i.splice(a,1),i.length===0&&t.syncScales.delete(n),!1})},r.prototype.getSyncKey=function(e){var t=e.scale,i=e.scaleDef,n=t.field,a=M(i,["sync"]);return a===!0?n:a===!1?void 0:a},r.prototype.getScaleMeta=function(e){return this.scales.get(e)},r}(),po=function(){function r(e,t,i,n){e===void 0&&(e=0),t===void 0&&(t=0),i===void 0&&(i=0),n===void 0&&(n=0),this.top=e,this.right=t,this.bottom=i,this.left=n}return r.instance=function(e,t,i,n){return e===void 0&&(e=0),t===void 0&&(t=0),i===void 0&&(i=0),n===void 0&&(n=0),new r(e,t,i,n)},r.prototype.max=function(e){var t=g.__read(e,4),i=t[0],n=t[1],a=t[2],o=t[3];return this.top=Math.max(this.top,i),this.right=Math.max(this.right,n),this.bottom=Math.max(this.bottom,a),this.left=Math.max(this.left,o),this},r.prototype.shrink=function(e){var t=g.__read(e,4),i=t[0],n=t[1],a=t[2],o=t[3];return this.top+=i,this.right+=n,this.bottom+=a,this.left+=o,this},r.prototype.inc=function(e,t){var i=e.width,n=e.height;switch(t){case N.TOP:case N.TOP_LEFT:case N.TOP_RIGHT:this.top+=n;break;case N.RIGHT:case N.RIGHT_TOP:case N.RIGHT_BOTTOM:this.right+=i;break;case N.BOTTOM:case N.BOTTOM_LEFT:case N.BOTTOM_RIGHT:this.bottom+=n;break;case N.LEFT:case N.LEFT_TOP:case N.LEFT_BOTTOM:this.left+=i;break}return this},r.prototype.getPadding=function(){return[this.top,this.right,this.bottom,this.left]},r.prototype.clone=function(){return new(r.bind.apply(r,g.__spreadArray([void 0],g.__read(this.getPadding()),!1)))},r}();function EM(r){var e=r.padding;if(!SM(e))return new(po.bind.apply(po,g.__spreadArray([void 0],g.__read(mc(e)),!1)));var t=r.viewBBox,i=new po,n=[],a=[],o=[];return S(r.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)}),S(n,function(s){var l=s.component,u=l.getLayoutBBox(),c=new Qt(u.x,u.y,u.width,u.height),h=c.exceed(t);i.max(h)}),S(a,function(s){var l=s.component,u=s.direction,c=l.getLayoutBBox(),h=l.get("padding"),f=new Qt(c.x,c.y,c.width,c.height).expand(h);i.inc(f,u)}),S(o,function(s){var l=s.component,u=s.direction,c=l.getLayoutBBox(),h=new Qt(c.x,c.y,c.width,c.height);i.inc(h,u)}),i}function kM(r,e,t){var i=t.instance();e.forEach(function(n){n.autoPadding=i.max(n.autoPadding.getPadding())})}var uy=function(r){g.__extends(e,r);function e(t){var i=r.call(this,{visible:t.visible})||this;i.views=[],i.geometries=[],i.controllers=[],i.interactions={},i.limitInPlot=!1,i.options={data:[],animate:!0},i.usedControllers=CM(),i.scalePool=new TM,i.layoutFunc=FM,i.isPreMouseInPlot=!1,i.isDataChanged=!1,i.isCoordinateChanged=!1,i.createdScaleKeys=new Map,i.onCanvasEvent=function(_){var w=_.name;if(!w.includes(":")){var b=i.createViewEvent(_);i.doPlotEvent(b),i.emit(w,b)}},i.onDelegateEvents=function(_){var w=_.name;if(w.includes(":")){var b=i.createViewEvent(_);i.emit(w,b)}};var n=t.id,a=n===void 0?Gr("view"):n,o=t.parent,s=t.canvas,l=t.backgroundGroup,u=t.middleGroup,c=t.foregroundGroup,h=t.region,f=h===void 0?{start:{x:0,y:0},end:{x:1,y:1}}:h,v=t.padding,d=t.appendPadding,p=t.theme,y=t.options,m=t.limitInPlot,x=t.syncViewPadding;return i.parent=o,i.canvas=s,i.backgroundGroup=l,i.middleGroup=u,i.foregroundGroup=c,i.region=f,i.padding=v,i.appendPadding=d,i.options=g.__assign(g.__assign({},i.options),y),i.limitInPlot=m,i.id=a,i.syncViewPadding=x,i.themeObject=pt(p)?Y({},Nn("default"),No(p)):Nn(p),i.init(),i}return e.prototype.setLayout=function(t){this.layoutFunc=t},e.prototype.init=function(){this.calculateViewBBox(),this.initEvents(),this.initComponentController(),this.initOptions()},e.prototype.render=function(t,i){t===void 0&&(t=!1),this.emit(it.BEFORE_RENDER,bt.fromData(this,it.BEFORE_RENDER,i)),this.paint(t),this.emit(it.AFTER_RENDER,bt.fromData(this,it.AFTER_RENDER,i)),this.visible===!1&&this.changeVisible(!1)},e.prototype.clear=function(){var t=this;this.emit(it.BEFORE_CLEAR),this.filteredData=[],this.coordinateInstance=void 0,this.isDataChanged=!1,this.isCoordinateChanged=!1;for(var i=this.geometries,n=0;n');T.appendChild(k);var P=Eh(T,l,a,o),B=Ux(f),z=new B.Canvas(g.__assign({container:k,pixelRatio:v,localRefresh:p,supportCSSTransform:_},P));return i=r.call(this,{parent:null,canvas:z,backgroundGroup:z.addGroup({zIndex:Oi.BG}),middleGroup:z.addGroup({zIndex:Oi.MID}),foregroundGroup:z.addGroup({zIndex:Oi.FORE}),padding:u,appendPadding:c,visible:m,options:C,limitInPlot:A,theme:F,syncViewPadding:E})||this,i.onResize=ig(function(){i.forceFit()},300),i.ele=T,i.canvas=z,i.width=P.width,i.height=P.height,i.autoFit=l,i.localRefresh=p,i.renderer=f,i.wrapperElement=k,i.updateCanvasStyle(),i.bindAutoFit(),i.initDefaultInteractions(b),i}return e.prototype.initDefaultInteractions=function(t){var i=this;S(t,function(n){i.interaction(n)})},e.prototype.aria=function(t){var i="aria-label";t===!1?this.ele.removeAttribute(i):this.ele.setAttribute(i,t.label)},e.prototype.changeSize=function(t,i){return this.width===t&&this.height===i?this:(this.emit(it.BEFORE_CHANGE_SIZE),this.width=t,this.height=i,this.canvas.changeSize(t,i),this.render(!0),this.emit(it.AFTER_CHANGE_SIZE),this)},e.prototype.clear=function(){r.prototype.clear.call(this),this.aria(!1)},e.prototype.destroy=function(){r.prototype.destroy.call(this),this.unbindAutoFit(),this.canvas.destroy(),ew(this.wrapperElement),this.wrapperElement=null},e.prototype.changeVisible=function(t){return r.prototype.changeVisible.call(this,t),this.wrapperElement.style.display=t?"":"none",this},e.prototype.forceFit=function(){if(!this.destroyed){var t=Eh(this.ele,!0,this.width,this.height),i=t.width,n=t.height;this.changeSize(i,n)}},e.prototype.updateCanvasStyle=function(){qt(this.canvas.get("el"),{display:"inline-block",verticalAlign:"middle"})},e.prototype.bindAutoFit=function(){this.autoFit&&window.addEventListener("resize",this.onResize)},e.prototype.unbindAutoFit=function(){this.autoFit&&window.removeEventListener("resize",this.onResize)},e}(uy),on=function(){function r(e){this.visible=!0,this.components=[],this.view=e}return r.prototype.clear=function(e){S(this.components,function(t){t.component.destroy()}),this.components=[]},r.prototype.destroy=function(){this.clear()},r.prototype.getComponents=function(){return this.components},r.prototype.changeVisible=function(e){this.visible!==e&&(this.components.forEach(function(t){e?t.component.show():t.component.hide()}),this.visible=e)},r}();function IM(r){for(var e=[],t=function(n){var a=r[n],o=Le(e,function(s){return s.color===a.color&&s.name===a.name&&s.value===a.value&&s.title===a.title});o||e.push(a)},i=0;i1){var w=u[0],b=Math.abs(t.y-w[0].y);try{for(var C=g.__values(u),A=C.next();!A.done;A=C.next()){var F=A.value,E=Math.abs(t.y-F[0].y);E<=b&&(w=F,b=E)}}catch(T){s={error:T}}finally{try{A&&!A.done&&(l=C.return)&&l.call(C)}finally{if(s)throw s.error}}u=[w]}return IM(ve(u))}return[]},e.prototype.layout=function(){},e.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")}})}},e.prototype.isCursorEntered=function(t){if(this.tooltip){var i=this.tooltip.getContainer(),n=this.tooltip.get("capture");if(i&&n){var a=i.getBoundingClientRect(),o=a.x,s=a.y,l=a.width,u=a.height;return new Qt(o,s,l,u).isPointIn(t)}}return!1},e.prototype.getTooltipCfg=function(){var t=this.view,i=t.getOptions().tooltip,n=this.processCustomContent(i),a=t.getTheme(),o=M(a,["components","tooltip"],{}),s=M(n,"enterable",o.enterable);return Y({},o,n,{capture:!!(s||this.isLocked)})},e.prototype.processCustomContent=function(t){if($i(t)||!M(t,"customContent"))return t;var i=t.customContent,n=function(a,o){var s=i(a,o)||"";return K(s)?'
    '+s+"
    ":s};return g.__assign(g.__assign({},t),{customContent:n})},e.prototype.getTitle=function(t){var i=t[0].title||t[0].name;return this.title=i,i},e.prototype.renderTooltip=function(){var t=this.view.getCanvas(),i={start:{x:0,y:0},end:{x:t.get("width"),y:t.get("height")}},n=this.getTooltipCfg(),a=new Cs(g.__assign(g.__assign({parent:t.get("el").parentNode,region:i},n),{visible:!1,crosshairs:null}));a.init(),this.tooltip=a},e.prototype.renderTooltipMarkers=function(t,i){var n,a,o=this.getTooltipMarkersGroup(),s=this.view.getRootView(),l=s.limitInPlot;try{for(var u=g.__values(t),c=u.next();!c.done;c=u.next()){var h=c.value,f=h.x,v=h.y;if(l||o!=null&&o.getClip()){var d=vc(s.getCoordinate()),p=d.type,y=d.attrs;o==null||o.setClip({type:p,attrs:y})}else o==null||o.setClip(void 0);var m=this.view.getTheme(),x=M(m,["components","tooltip","marker"],{}),_=g.__assign(g.__assign({fill:h.color,symbol:"circle",shadowColor:h.color},W(i)?g.__assign(g.__assign({},x),i(h)):i),{x:f,y:v});o.addShape("marker",{attrs:_})}}catch(w){n={error:w}}finally{try{c&&!c.done&&(a=u.return)&&a.call(u)}finally{if(n)throw n.error}}},e.prototype.renderCrosshairs=function(t,i){var n=M(i,["crosshairs","type"],"x");n==="x"?(this.yCrosshair&&this.yCrosshair.hide(),this.renderXCrosshairs(t,i)):n==="y"?(this.xCrosshair&&this.xCrosshair.hide(),this.renderYCrosshairs(t,i)):n==="xy"&&(this.renderXCrosshairs(t,i),this.renderYCrosshairs(t,i))},e.prototype.renderXCrosshairs=function(t,i){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=Wi(n,t),l=n.getCenter(),u=n.getRadius();o=Tt(l.x,l.y,u,s),a=l}var c=Y({start:a,end:o,container:this.getTooltipCrosshairsGroup()},M(i,"crosshairs",{}),this.getCrosshairsText("x",t,i));delete c.type;var h=this.xCrosshair;h?h.update(c):(h=new Lp(c),h.init()),h.render(),h.show(),this.xCrosshair=h},e.prototype.renderYCrosshairs=function(t,i){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:Ms(n,t),startAngle:n.startAngle,endAngle:n.endAngle},o="Circle";a=Y({container:this.getTooltipCrosshairsGroup()},a,M(i,"crosshairs",{}),this.getCrosshairsText("y",t,i)),delete a.type;var u=this.yCrosshair;u?n.isRect&&u.get("type")==="circle"||!n.isRect&&u.get("type")==="line"?(u=new Vf[o](a),u.init()):u.update(a):(u=new Vf[o](a),u.init()),u.render(),u.show(),this.yCrosshair=u},e.prototype.getCrosshairsText=function(t,i,n){var a=M(n,["crosshairs","text"]),o=M(n,["crosshairs","follow"]),s=this.items;if(a){var l=this.getViewWithGeometry(this.view),u=s[0],c=l.getXScale(),h=l.getYScales()[0],f=void 0,v=void 0;if(o){var d=this.view.getCoordinate().invert(i);f=c.invert(d.x),v=h.invert(d.y)}else f=u.data[c.field],v=u.data[h.field];var p=t==="x"?f:v;return W(a)?a=a(t,p,s,i):a.content=p,{text:a}}},e.prototype.getGuideGroup=function(){if(!this.guideGroup){var t=this.view.foregroundGroup;this.guideGroup=t.addGroup({name:"tooltipGuide",capture:!1})}return this.guideGroup},e.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},e.prototype.getTooltipCrosshairsGroup=function(){var t=this.tooltipCrosshairsGroup;return t||(t=this.getGuideGroup().addGroup({name:"tooltipCrosshairsGroup",capture:!1}),t.toBack(),this.tooltipCrosshairsGroup=t),t},e.prototype.findItemsFromView=function(t,i){var n,a;if(t.getOptions().tooltip===!1)return[];var o=this.getTooltipCfg(),s=hu(t,i,o);try{for(var l=g.__values(t.views),u=l.next();!u.done;u=l.next()){var c=u.value;s=s.concat(this.findItemsFromView(c,i))}}catch(h){n={error:h}}finally{try{u&&!u.done&&(a=l.return)&&a.call(l)}finally{if(n)throw n.error}}return s},e.prototype.getViewWithGeometry=function(t){var i=this;return t.geometries.length?t:Le(t.views,function(n){return i.getViewWithGeometry(n)})},e.prototype.getItemsAfterProcess=function(t){var i=this.getTooltipCfg().customItems,n=i||function(a){return a};return n(t)},e}(on),hy={};function fy(r){return hy[r.toLowerCase()]}function de(r,e){hy[r.toLowerCase()]=e}var Ui={appear:{duration:450,easing:"easeQuadOut"},update:{duration:400,easing:"easeQuadInOut"},enter:{duration:400,easing:"easeQuadInOut"},leave:{duration:350,easing:"easeQuadIn"}},PM={interval:function(r){return{enter:{animation:r.isRect?r.isTransposed?"scale-in-x":"scale-in-y":"fade-in"},update:{animation:r.isPolar&&r.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"}}},uv={line:function(){return{animation:"wave-in"}},area:function(){return{animation:"wave-in"}},path:function(){return{animation:"fade-in"}},interval:function(r){var e;return r.isRect?e=r.isTransposed?"grow-in-x":"grow-in-y":(e="grow-in-xy",r.isPolar&&r.isTransposed&&(e="wave-in")),{animation:e}},schema:function(r){var e;return r.isRect?e=r.isTransposed?"grow-in-x":"grow-in-y":e="grow-in-xy",{animation:e}},polygon:function(){return{animation:"fade-in",duration:500}},edge:function(){return{animation:"fade-in"}}};function DM(r,e){return{delay:W(r.delay)?r.delay(e):r.delay,easing:W(r.easing)?r.easing(e):r.easing,duration:W(r.duration)?r.duration(e):r.duration,callback:r.callback,repeat:r.repeat}}function vy(r,e,t){var i=PM[r];return i&&(W(i)&&(i=i(e)),i=Y({},Ui,i),t)?i[t]:i}function zi(r,e,t){var i=M(r.get("origin"),"data",gt),n=e.animation,a=DM(e,i);if(n){var o=fy(n);o&&o(r,a,t)}else r.animate(t.toAttrs,a)}function BM(r,e,t,i,n){if(uv[t]){var a=uv[t](i),o=fy(M(a,"animation",""));if(o){var s=g.__assign(g.__assign(g.__assign({},Ui.appear),a),e);r.stopAnimate(),o(r,s,{coordinate:i,minYPoint:n,toAttrs:null})}}}var wc="element-background",dy=function(r){g.__extends(e,r);function e(t){var i=r.call(this,t)||this;i.labelShape=[],i.states=[];var n=t.shapeFactory,a=t.container,o=t.offscreenGroup,s=t.elementIndex,l=t.visible,u=l===void 0?!0:l;return i.shapeFactory=n,i.container=a,i.offscreenGroup=o,i.visible=u,i.elementIndex=s,i}return e.prototype.draw=function(t,i){i===void 0&&(i=!1),this.model=t,this.data=t.data,this.shapeType=this.getShapeType(t),this.drawShape(t,i),this.visible===!1&&this.changeVisible(!1)},e.prototype.update=function(t){var i=this,n=i.shapeFactory,a=i.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"))}},e.prototype.destroy=function(){var t=this,i=t.shapeFactory,n=t.shape;if(n){var a=this.getAnimateCfg("leave");a?zi(n,a,{coordinate:i.coordinate,toAttrs:g.__assign({},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,r.prototype.destroy.call(this)},e.prototype.changeVisible=function(t){r.prototype.changeVisible.call(this,t),t?(this.shape&&this.shape.show(),this.labelShape&&this.labelShape.forEach(function(i){i.show()})):(this.shape&&this.shape.hide(),this.labelShape&&this.labelShape.forEach(function(i){i.hide()}))},e.prototype.setState=function(t,i){var n=this,a=n.states,o=n.shapeFactory,s=n.model,l=n.shape,u=n.shapeType,c=a.indexOf(t);if(i){if(c>-1)return;a.push(t),(t==="active"||t==="selected")&&(l==null||l.toFront())}else{if(c===-1)return;if(a.splice(c,1),t==="active"||t==="selected"){var h=this.geometry,f=h.sortZIndex,v=h.zIndexReversed,d=v?this.geometry.elements.length-this.elementIndex:this.elementIndex;f?l.setZIndex(d):l.set("zIndex",d)}}var p=o.drawShape(u,s,this.getOffscreenGroup());a.length?this.syncShapeStyle(l,p,a,null):this.syncShapeStyle(l,p,["reset"],null),p.remove(!0);var y={state:t,stateStatus:i,element:this,target:this.container};this.container.emit("statechange",y),yp(this.shape,"statechange",y)},e.prototype.clearStates=function(){var t=this,i=this.states;S(i,function(n){t.setState(n,!1)}),this.states=[]},e.prototype.hasState=function(t){return this.states.includes(t)},e.prototype.getStates=function(){return this.states},e.prototype.getData=function(){return this.data},e.prototype.getModel=function(){return this.model},e.prototype.getBBox=function(){var t=this,i=t.shape,n=t.labelShape,a={x:0,y:0,minX:0,minY:0,maxX:0,maxY:0,width:0,height:0};return i&&(a=i.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},e.prototype.getStatesStyle=function(){if(!this.statesStyle){var t=this,i=t.shapeType,n=t.geometry,a=t.shapeFactory,o=n.stateOption,s=a.defaultShapeType,l=a.theme[i]||a.theme[s];this.statesStyle=Y({},l,o)}return this.statesStyle},e.prototype.getStateStyle=function(t,i){var n=this.getStatesStyle(),a=M(n,[t,"style"],{}),o=a[i]||a;return W(o)?o(this):o},e.prototype.getAnimateCfg=function(t){var i=this,n=this.animate;if(n){var a=n[t];return a&&g.__assign(g.__assign({},a),{callback:function(){var o;W(a.callback)&&a.callback(),(o=i.geometry)===null||o===void 0||o.emit(Tr.AFTER_DRAW_ANIMATE)}})}return null},e.prototype.drawShape=function(t,i){var n;i===void 0&&(i=!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 u=this.shape.cfg.name;u?K(u)&&(this.shape.cfg.name=["element",u]):this.shape.cfg.name=["element",this.shapeFactory.geometryType];var c=i?"enter":"appear",h=this.getAnimateCfg(c);h&&((n=this.geometry)===null||n===void 0||n.emit(Tr.BEFORE_DRAW_ANIMATE),zi(this.shape,h,{coordinate:o.coordinate,toAttrs:g.__assign({},this.shape.attr())}))}},e.prototype.getOffscreenGroup=function(){if(!this.offscreenGroup){var t=this.container.getGroupBase();this.offscreenGroup=new t({})}return this.offscreenGroup},e.prototype.setShapeInfo=function(t,i){var n=this;if(t.cfg.origin=i,t.cfg.element=this,t.isGroup()){var a=t.get("children");a.forEach(function(o){n.setShapeInfo(o,i)})}},e.prototype.syncShapeStyle=function(t,i,n,a,o){var s=this,l;if(n===void 0&&(n=[]),o===void 0&&(o=0),!(!t||!i)){var u=t.get("clipShape"),c=i.get("clipShape");if(this.syncShapeStyle(u,c,n,a),t.isGroup())for(var h=t.get("children"),f=i.get("children"),v=0;v=0?a=i:n<=0?a=n:a=0,a},e.prototype.createAttrOption=function(t,i,n){if(D(i)||pt(i))pt(i)&&Lt(Object.keys(i),["values"])?Et(this.attributeOption,t,{fields:i.values}):Et(this.attributeOption,t,i);else{var a={};tt(i)?a.values=[i]:a.fields=mn(i),n&&(W(n)?a.callback=n:a.values=n),Et(this.attributeOption,t,a)}},e.prototype.initAttributes=function(){var t=this,i=this,n=i.attributes,a=i.attributeOption,o=i.theme,s=i.shapeType;this.groupScales=[];var l={},u=function(f){if(a.hasOwnProperty(f)){var v=a[f];if(!v)return{value:void 0};var d=g.__assign({},v),p=d.callback,y=d.values,m=d.fields,x=m===void 0?[]:m,_=x.map(function(b){var C=t.scales[b];if(!l[b]&&Pi.includes(f)){var A=zp(C,M(t.scaleDefs,b),f,t.type);A==="cat"&&(t.groupScales.push(C),l[b]=!0)}return C});d.scales=_,f!=="position"&&_.length===1&&_[0].type==="identity"?d.values=_[0].values:!p&&!y&&(f==="size"?d.values=o.sizes:f==="shape"?d.values=o.shapes[s]||[]:f==="color"&&(_.length?d.values=_[0].values.length<=10?o.colors10:o.colors20:d.values=o.colors10));var w=dp(f);n[f]=new w(d)}};for(var c in a){var h=u(c);if(typeof h=="object")return h.value}},e.prototype.processData=function(t){var i,n;this.hasSorted=!1;for(var a=this.getAttribute("position").scales,o=a.filter(function(A){return A.isCategory}),s=this.groupData(t),l=[],u=0,c=s.length;us&&(s=h)}var f=this.scaleDefs,v={};ot.max&&!M(f,[a,"max"])&&(v.max=s),t.change(v)},e.prototype.beforeMapping=function(t){var i=t;if(this.sortable&&this.sort(i),this.generatePoints)for(var n=0,a=i.length;n1)for(var f=0;f0})}function wy(r,e,t){var i=t.data,n=t.origin,a=t.animateCfg,o=t.coordinate,s=M(a,"update");r.set("data",i),r.set("origin",n),r.set("animateCfg",a),r.set("coordinate",o),r.set("visible",e.get("visible")),(r.getChildren()||[]).forEach(function(l,u){var c=e.getChildByIndex(u);if(!c)r.removeChild(l),l.remove(!0);else{l.set("data",i),l.set("origin",n),l.set("animateCfg",a),l.set("coordinate",o);var h=Np(l,c);s?zi(l,s,{toAttrs:h,coordinate:o}):l.attr(h),c.isGroup()&&wy(l,c,t)}}),S(e.getChildren(),function(l,u){u>=r.getCount()&&(l.destroyed||r.add(l))})}var XM=function(){function r(e){this.shapesMap={};var t=e.layout,i=e.container;this.layout=t,this.container=i}return r.prototype.render=function(e,t,i){return i===void 0&&(i=!1),g.__awaiter(this,void 0,void 0,function(){var n,a,o,s,l,u,c,h,f=this;return g.__generator(this,function(v){switch(v.label){case 0:if(n={},a=this.createOffscreenGroup(),!e.length)return[3,2];try{for(o=g.__values(e),s=o.next();!s.done;s=o.next())l=s.value,l&&(n[l.id]=this.renderLabel(l,a))}catch(d){c={error:d}}finally{try{s&&!s.done&&(h=o.return)&&h.call(o)}finally{if(c)throw c.error}}return[4,this.doLayout(e,t,n)];case 1:v.sent(),this.renderLabelLine(e,n),this.renderLabelBackground(e,n),this.adjustLabel(e,n),v.label=2;case 2:return u=this.shapesMap,S(n,function(d,p){if(d.destroyed)delete n[p];else{if(u[p]){var y=d.get("data"),m=d.get("origin"),x=d.get("coordinate"),_=d.get("animateCfg"),w=u[p];wy(w,n[p],{data:y,origin:m,animateCfg:_,coordinate:x}),n[p]=w}else{if(f.container.destroyed)return;f.container.add(d);var b=M(d.get("animateCfg"),i?"enter":"appear");b&&zi(d,b,{toAttrs:g.__assign({},d.attr()),coordinate:d.get("coordinate")})}delete u[p]}}),S(u,function(d){var p=M(d.get("animateCfg"),"leave");p?zi(d,p,{toAttrs:null,coordinate:d.get("coordinate")}):d.remove(!0)}),this.shapesMap=n,a.destroy(),[2]}})})},r.prototype.clear=function(){this.container.clear(),this.shapesMap={}},r.prototype.destroy=function(){this.container.destroy(),this.shapesMap=null},r.prototype.renderLabel=function(e,t){var i=e.id,n=e.elementId,a=e.data,o=e.mappingData,s=e.coordinate,l=e.animate,u=e.content,c=e.capture,h={id:i,elementId:n,capture:c,data:a,origin:g.__assign(g.__assign({},o),{data:o[gt]}),coordinate:s},f=t.addGroup(g.__assign({name:"label",animateCfg:this.animate===!1||l===null||l===!1?!1:Y({},this.animate,l)},h)),v;if(u.isGroup&&u.isGroup()||u.isShape&&u.isShape()){var d=u.getCanvasBBox(),p=d.width,y=d.height,m=M(e,"textAlign","left"),x=e.x,_=e.y-y/2;m==="center"?x=x-p/2:(m==="right"||m==="end")&&(x=x-p),Ca(u,x,_),v=u,f.add(u)}else{var w=M(e,["style","fill"]);v=f.addShape("text",g.__assign({attrs:g.__assign(g.__assign({x:e.x,y:e.y,textAlign:e.textAlign,textBaseline:M(e,"textBaseline","middle"),text:e.content},e.style),{fill:zx(w)?e.color:w})},h))}return e.rotate&&bc(v,e.rotate),f},r.prototype.doLayout=function(e,t,i){return g.__awaiter(this,void 0,void 0,function(){var n,a=this;return g.__generator(this,function(o){switch(o.label){case 0:return this.layout?(n=O(this.layout)?this.layout:[this.layout],[4,Promise.all(n.map(function(s){var l=RM(M(s,"type",""));if(l){var u=[],c=[];return S(i,function(h,f){u.push(h),c.push(t[h.get("elementId")])}),l(e,u,c,a.region,s.cfg)}}))]):[3,2];case 1:o.sent(),o.label=2;case 2:return[2]}})})},r.prototype.renderLabelLine=function(e,t){S(e,function(i){var n=M(i,"coordinate");if(!(!i||!n)){var a=n.getCenter(),o=n.getRadius();if(i.labelLine){var s=M(i,"labelLine",{}),l=i.id,u=s.path;if(!u){var c=Tt(a.x,a.y,o,i.angle);u=[["M",c.x,c.y],["L",i.x,i.y]]}var h=t[l];h.destroyed||h.addShape("path",{capture:!1,attrs:g.__assign({path:u,stroke:i.color?i.color:M(i,["style","fill"],"#000"),fill:null},s.style),id:l,origin:i.mappingData,data:i.data,coordinate:i.coordinate})}}})},r.prototype.renderLabelBackground=function(e,t){S(e,function(i){var n=M(i,"coordinate"),a=M(i,"background");if(!(!a||!n)){var o=i.id,s=t[o];if(!s.destroyed){var l=s.getChildren()[0];if(l){var u=xy(s,i,a.padding),c=u.rotation,h=g.__rest(u,["rotation"]),f=s.addShape("rect",{attrs:g.__assign(g.__assign({},h),a.style||{}),id:o,origin:i.mappingData,data:i.data,coordinate:i.coordinate});if(f.setZIndex(-1),c){var v=l.getMatrix();f.setMatrix(v)}}}}})},r.prototype.createOffscreenGroup=function(){var e=this.container,t=e.getGroupBase(),i=new t({});return i},r.prototype.adjustLabel=function(e,t){S(e,function(i){if(i){var n=i.id,a=t[n];if(!a.destroyed){var o=a.findAll(function(s){return s.get("type")!=="path"});S(o,function(s){s&&(i.offsetX&&s.attr("x",s.attr("x")+i.offsetX),i.offsetY&&s.attr("y",s.attr("y")+i.offsetY))})}}})},r}();function hv(r){var e=0;return S(r,function(t){e+=t}),e/r.length}var ks=function(){function r(e){this.geometry=e}return r.prototype.getLabelItems=function(e){var t=this,i=[],n=this.getLabelCfgs(e);return S(e,function(a,o){var s=n[o];if(!s||D(a.x)||D(a.y)){i.push(null);return}var l=O(s.content)?s.content:[s.content];s.content=l;var u=l.length;S(l,function(c,h){if(D(c)||c===""){i.push(null);return}var f=g.__assign(g.__assign({},s),t.getLabelPoint(s,a,h));f.textAlign||(f.textAlign=t.getLabelAlign(f,h,u)),f.offset<=0&&(f.labelLine=null),i.push(f)})}),i},r.prototype.render=function(e,t){return t===void 0&&(t=!1),g.__awaiter(this,void 0,void 0,function(){var i,n,a;return g.__generator(this,function(o){switch(o.label){case 0:return i=this.getLabelItems(e),n=this.getLabelsRenderer(),a=this.getGeometryShapes(),[4,n.render(i,a,t)];case 1:return o.sent(),[2]}})})},r.prototype.clear=function(){var e=this.labelsRenderer;e&&e.clear()},r.prototype.destroy=function(){var e=this.labelsRenderer;e&&e.destroy(),this.labelsRenderer=null},r.prototype.getCoordinate=function(){return this.geometry.coordinate},r.prototype.getDefaultLabelCfg=function(e,t){var i=this.geometry,n=i.type,a=i.theme;return n==="polygon"||n==="interval"&&t==="middle"||e<0&&!["line","point","path"].includes(n)?M(a,"innerLabels",{}):M(a,"labels",{})},r.prototype.getThemedLabelCfg=function(e){var t=this.geometry,i=this.getDefaultLabelCfg(),n=t.type,a=t.theme,o;return n==="polygon"||e.offset<0&&!["line","point","path"].includes(n)?o=Y({},i,a.innerLabels,e):o=Y({},i,a.labels,e),o},r.prototype.setLabelPosition=function(e,t,i,n){},r.prototype.getLabelOffset=function(e){var t=this.getCoordinate(),i=this.getOffsetVector(e);return t.isTransposed?i[0]:i[1]},r.prototype.getLabelOffsetPoint=function(e,t,i){var n=e.offset,a=this.getCoordinate(),o=a.isTransposed,s=o?"x":"y",l=o?1:-1,u={x:0,y:0};return t>0||i===1?u[s]=n*l:u[s]=n*l*-1,u},r.prototype.getLabelPoint=function(e,t,i){var n=this.getCoordinate(),a=e.content.length;function o(y,m,x){x===void 0&&(x=!1);var _=y;return O(_)&&(e.content.length===1?x?_=hv(_):_.length<=2?_=_[y.length-1]:_=hv(_):_=_[m]),_}var s={content:e.content[i],x:0,y:0,start:{x:0,y:0},color:"#fff"},l=O(t.shape)?t.shape[0]:t.shape,u=l==="funnel"||l==="pyramid";if(this.geometry.type==="polygon"){var c=mC(t.x,t.y);s.x=c[0],s.y=c[1]}else this.geometry.type==="interval"&&!u?(s.x=o(t.x,i,!0),s.y=o(t.y,i)):(s.x=o(t.x,i),s.y=o(t.y,i));if(u){var h=M(t,"nextPoints"),f=M(t,"points");if(h){var v=n.convert(f[1]),d=n.convert(h[1]);s.x=(v.x+d.x)/2,s.y=(v.y+d.y)/2}else if(l==="pyramid"){var v=n.convert(f[1]),d=n.convert(f[2]);s.x=(v.x+d.x)/2,s.y=(v.y+d.y)/2}}e.position&&this.setLabelPosition(s,t,i,e.position);var p=this.getLabelOffsetPoint(e,i,a);return s.start={x:s.x,y:s.y},s.x+=p.x,s.y+=p.y,s.color=t.color,s},r.prototype.getLabelAlign=function(e,t,i){var n="center",a=this.getCoordinate();if(a.isTransposed){var o=e.offset;o<0?n="right":o===0?n="center":n="left",i>1&&t===0&&(n==="right"?n="left":n==="left"&&(n="right"))}return n},r.prototype.getLabelId=function(e){var t=this.geometry,i=t.type,n=t.getXScale(),a=t.getYScale(),o=e[gt],s=t.getElementId(e);return i==="line"||i==="area"?s+=" ".concat(o[n.field]):i==="path"&&(s+=" ".concat(o[n.field],"-").concat(o[a.field])),s},r.prototype.getLabelsRenderer=function(){var e=this.geometry,t=e.labelsContainer,i=e.labelOption,n=e.canvasRegion,a=e.animateOption,o=this.geometry.coordinate,s=this.labelsRenderer;return s||(s=new XM({container:t,layout:M(i,["cfg","layout"],{type:this.defaultLayout})}),this.labelsRenderer=s),s.region=n,s.animate=a?vy("label",o):!1,s},r.prototype.getLabelCfgs=function(e){var t=this,i=this.geometry,n=i.labelOption,a=i.scales,o=i.coordinate,s=n,l=s.fields,u=s.callback,c=s.cfg,h=l.map(function(v){return a[v]}),f=[];return S(e,function(v,d){var p=v[gt],y=t.getLabelText(p,h),m;if(u){var x=l.map(function(A){return p[A]});if(m=u.apply(void 0,g.__spreadArray([],g.__read(x),!1)),D(m)){f.push(null);return}}var _=g.__assign(g.__assign({id:t.getLabelId(v),elementId:t.geometry.getElementId(v),data:p,mappingData:v,coordinate:o},c),m);W(_.position)&&(_.position=_.position(p,v,d));var w=t.getLabelOffset(_.offset||0),b=t.getDefaultLabelCfg(w,_.position);_=Y({},b,_),_.offset=t.getLabelOffset(_.offset||0);var C=_.content;W(C)?_.content=C(p,v,d):Qr(C)&&(_.content=y[0]),f.push(_)}),f},r.prototype.getLabelText=function(e,t){var i=[];return S(t,function(n){var a=e[n.field];O(a)?a=a.map(function(o){return n.getText(o)}):a=n.getText(a),D(a)||a===""?i.push(null):i.push(a)}),i},r.prototype.getOffsetVector=function(e){e===void 0&&(e=0);var t=this.getCoordinate(),i=0;return tt(e)&&(i=e),t.isTransposed?t.applyMatrix(i,0):t.applyMatrix(0,i)},r.prototype.getGeometryShapes=function(){var e=this.geometry,t={};return S(e.elementsMap,function(i,n){t[n]=i.shape}),S(e.getOffscreenGroup().getChildren(),function(i){var n=e.getElementId(i.get("origin").mappingData);t[n]=i}),t},r}();function fu(r,e,t){if(!r)return t;var i;if(r.callback&&r.callback.length>1){var n=Array(r.callback.length-1).fill("");i=r.mapping.apply(r,g.__spreadArray([e],g.__read(n),!1)).join("")}else i=r.mapping(e).join("");return i||t}var gi={hexagon:function(r,e,t){var i=t/2*Math.sqrt(3);return[["M",r,e-t],["L",r+i,e-t/2],["L",r+i,e+t/2],["L",r,e+t],["L",r-i,e+t/2],["L",r-i,e-t/2],["Z"]]},bowtie:function(r,e,t){var i=t-1.5;return[["M",r-t,e-i],["L",r+t,e+i],["L",r+t,e-i],["L",r-t,e+i],["Z"]]},cross:function(r,e,t){return[["M",r-t,e-t],["L",r+t,e+t],["M",r+t,e-t],["L",r-t,e+t]]},tick:function(r,e,t){return[["M",r-t/2,e-t],["L",r+t/2,e-t],["M",r,e-t],["L",r,e+t],["M",r-t/2,e+t],["L",r+t/2,e+t]]},plus:function(r,e,t){return[["M",r-t,e],["L",r+t,e],["M",r,e-t],["L",r,e+t]]},hyphen:function(r,e,t){return[["M",r-t,e],["L",r+t,e]]},line:function(r,e,t){return[["M",r,e-t],["L",r,e+t]]}},WM=["line","cross","tick","plus","hyphen"];function qM(r,e){return W(e)?e(r):Y({},r,e)}function UM(r,e){var t=r.symbol;if(K(t)&&WM.indexOf(t)!==-1){var i=M(r,"style",{}),n=M(i,"lineWidth",1),a=i.stroke||i.fill||e;r.style=Y({},r.style,{lineWidth:n,stroke:a,fill:null})}}function _y(r){var e=r.symbol;K(e)&&gi[e]&&(r.symbol=gi[e])}function pl(r){return r.startsWith(N.LEFT)||r.startsWith(N.RIGHT)?"vertical":"horizontal"}function by(r,e,t,i,n){var a=t.getScale(t.type);if(a.isCategory){var o=a.field,s=e.getAttribute("color"),l=e.getAttribute("shape"),u=r.getTheme().defaultColor,c=e.coordinate.isPolar;return a.getTicks().map(function(h,f){var v,d=h.text,p=h.value,y=d,m=a.invert(p),x=r.filterFieldData(o,[(v={},v[o]=m,v)]).length===0;S(r.views,function(A){var F;A.filterFieldData(o,[(F={},F[o]=m,F)]).length||(x=!0)});var _=fu(s,m,u),w=fu(l,m,"point"),b=e.getShapeMarker(w,{color:_,isInPolar:c}),C=n;return W(C)&&(C=C(y,f,g.__assign({name:y,value:m},Y({},i,b)))),b=Y({},i,b,re(g.__assign({},C),["style"])),UM(b,_),C&&C.style&&(b.style=qM(b.style,C.style)),_y(b),{id:m,name:y,value:m,marker:b,unchecked:x}})}return[]}function jM(r,e,t){return t.map(function(i,n){var a=e;W(a)&&(a=a(i.name,n,Y({},r,i)));var o=W(i.marker)?i.marker(i.name,n,Y({},r,i)):i.marker,s=Y({},r,a,o);return _y(s),i.marker=s,i})}function fv(r,e){var t=M(r,["components","legend"],{});return Y({},M(t,["common"],{}),Y({},M(t,[e],{})))}function yl(r){return r?!1:r==null||isNaN(r)}function vv(r){if(O(r))return yl(r[1].y);var e=r.y;return O(e)?yl(e[0]):yl(e)}function Ls(r,e,t){if(e===void 0&&(e=!1),t===void 0&&(t=!0),!r.length||r.length===1&&!t)return[];if(e){for(var i=[],n=0,a=r.length;n=r&&n<=r+t&&a>=e&&a<=e+i}function aa(r,e){return!(e.minX>r.maxX||e.maxXr.maxY||e.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),i*=Math.sqrt(v));var d=t*t*(f*f)+i*i*(h*h),p=d?Math.sqrt((t*t*(i*i)-d)/d):1;a===o&&(p*=-1),isNaN(p)&&(p=0);var y=i?p*t*f/i:0,m=t?p*-i*h/t:0,x=(s+u)/2+Math.cos(n)*y-Math.sin(n)*m,_=(l+c)/2+Math.sin(n)*y+Math.cos(n)*m,w=[(h-y)/t,(f-m)/i],b=[(-1*h-y)/t,(-1*f-m)/i],C=gv([1,0],w),A=gv(w,b);return du(w,b)<=-1&&(A=Math.PI),du(w,b)>=1&&(A=0),o===0&&A>0&&(A=A-2*Math.PI),o===1&&A<0&&(A=A+2*Math.PI),{cx:x,cy:_,rx:dv(r,[u,c])?0:t,ry:dv(r,[u,c])?0:i,startAngle:C,endAngle:C+A,xRotation:n,arcFlag:a,sweepFlag:o}}var Vo=Math.sin,Go=Math.cos,Cc=Math.atan2,Xa=Math.PI;function Ly(r,e,t,i,n,a,o){var s=e.stroke,l=e.lineWidth,u=t-n,c=i-a,h=Cc(c,u),f=new Ec({type:"path",canvas:r.get("canvas"),isArrowShape:!0,attrs:{path:"M"+10*Go(Xa/6)+","+10*Vo(Xa/6)+" L0,0 L"+10*Go(Xa/6)+",-"+10*Vo(Xa/6),stroke:s,lineWidth:l}});f.translate(n,a),f.rotateAtPoint(n,a,h),r.set(o?"startArrowShape":"endArrowShape",f)}function Iy(r,e,t,i,n,a,o){var s=e.startArrow,l=e.endArrow,u=e.stroke,c=e.lineWidth,h=o?s:l,f=h.d,v=h.fill,d=h.stroke,p=h.lineWidth,y=g.__rest(h,["d","fill","stroke","lineWidth"]),m=t-n,x=i-a,_=Cc(x,m);f&&(n=n-Go(_)*f,a=a-Vo(_)*f);var w=new Ec({type:"path",canvas:r.get("canvas"),isArrowShape:!0,attrs:g.__assign(g.__assign({},y),{stroke:d||u,lineWidth:p||c,fill:v})});w.translate(n,a),w.rotateAtPoint(n,a,_),r.set(o?"startArrowShape":"endArrowShape",w)}function li(r,e,t,i,n){var a=Cc(i-e,t-r);return{dx:Go(a)*n,dy:Vo(a)*n}}function Mc(r,e,t,i,n,a){typeof e.startArrow=="object"?Iy(r,e,t,i,n,a,!0):e.startArrow?Ly(r,e,t,i,n,a,!0):r.set("startArrowShape",null)}function Ac(r,e,t,i,n,a){typeof e.endArrow=="object"?Iy(r,e,t,i,n,a,!1):e.endArrow?Ly(r,e,t,i,n,a,!1):r.set("startArrowShape",null)}var pv={fill:"fillStyle",stroke:"strokeStyle",opacity:"globalAlpha"};function ji(r,e){var t=e.attr();for(var i in t){var n=t[i],a=pv[i]?pv[i]:i;a==="matrix"&&n?r.transform(n[0],n[1],n[3],n[4],n[6],n[7]):a==="lineDash"&&r.setLineDash?O(n)&&r.setLineDash(n):(a==="strokeStyle"||a==="fillStyle"?n=hA(r,e,n):a==="globalAlpha"&&(n=n*r.globalAlpha),r[a]=n)}}function gu(r,e,t){for(var i=0;ib?w:b,k=w>b?1:w/b,P=w>b?b/w:1;e.translate(x,_),e.rotate(F),e.scale(k,P),e.arc(0,0,T,C,A,1-E),e.scale(1/k,1/P),e.rotate(-F),e.translate(-x,-_)}break}case"Z":e.closePath();break}if(f==="Z")s=l;else{var B=h.length;s=[h[B-2],h[B-1]]}}}}function By(r,e){var t=r.get("canvas");t&&(e==="remove"&&(r._cacheCanvasBBox=r.get("cacheCanvasBBox")),r.get("hasChanged")||(r.set("hasChanged",!0),r.cfg.parent&&r.cfg.parent.get("hasChanged")||(t.refreshElement(r,e,t),t.get("autoDraw")&&t.draw())))}function gA(r){var e;if(r.destroyed)e=r._cacheCanvasBBox;else{var t=r.get("cacheCanvasBBox"),i=t&&!!(t.width&&t.height),n=r.getCanvasBBox(),a=n&&!!(n.width&&n.height);i&&a?e=nA(t,n):i?e=t:a&&(e=n)}return e}function pA(r){if(!r.length)return null;var e=[],t=[],i=[],n=[];return S(r,function(a){var o=gA(a);o&&(e.push(o.minX),t.push(o.minY),i.push(o.maxX),n.push(o.maxY))}),{minX:Pe(e),minY:Pe(t),maxX:Se(i),maxY:Se(n)}}function yA(r,e){return!r||!e||!aa(r,e)?null:{minX:Math.max(r.minX,e.minX),minY:Math.max(r.minY,e.minY),maxX:Math.min(r.maxX,e.maxX),maxY:Math.min(r.maxY,e.maxY)}}var Tc=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.onCanvasChange=function(t){By(this,t)},e.prototype.getShapeBase=function(){return Jo},e.prototype.getGroupBase=function(){return e},e.prototype._applyClip=function(t,i){i&&(t.save(),ji(t,i),i.createPath(t),t.restore(),t.clip(),i._afterDraw())},e.prototype.cacheCanvasBBox=function(){var t=this.cfg.children,i=[],n=[];S(t,function(f){var v=f.cfg.cacheCanvasBBox;v&&f.cfg.isInView&&(i.push(v.minX,v.maxX),n.push(v.minY,v.maxY))});var a=null;if(i.length){var o=Pe(i),s=Se(i),l=Pe(n),u=Se(n);a={minX:o,minY:l,x:o,y:l,maxX:s,maxY:u,width:s-o,height:u-l};var c=this.cfg.canvas;if(c){var h=c.getViewRange();this.set("isInView",aa(a,h))}}else this.set("isInView",!1);this.set("cacheCanvasBBox",a)},e.prototype.draw=function(t,i){var n=this.cfg.children,a=i?this.cfg.refresh:!0;n.length&&a&&(t.save(),ji(t,this),this._applyClip(t,this.getClip()),gu(t,n,i),t.restore(),this.cacheCanvasBBox()),this.cfg.refresh=null,this.set("hasChanged",!1)},e.prototype.skipDraw=function(){this.set("cacheCanvasBBox",null),this.set("hasChanged",!1)},e}(as),mA=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return g.__assign(g.__assign({},t),{lineWidth:1,lineAppendWidth:0,strokeOpacity:1,fillOpacity:1})},e.prototype.getShapeBase=function(){return Jo},e.prototype.getGroupBase=function(){return Tc},e.prototype.onCanvasChange=function(t){By(this,t)},e.prototype.calculateBBox=function(){var t=this.get("type"),i=this.getHitLineWidth(),n=ss(t),a=n(this),o=i/2,s=a.x-o,l=a.y-o,u=a.x+a.width+o,c=a.y+a.height+o;return{x:s,minX:s,y:l,minY:l,width:a.width+i,height:a.height+i,maxX:u,maxY:c}},e.prototype.isFill=function(){return!!this.attrs.fill||this.isClipShape()},e.prototype.isStroke=function(){return!!this.attrs.stroke},e.prototype._applyClip=function(t,i){i&&(t.save(),ji(t,i),i.createPath(t),t.restore(),t.clip(),i._afterDraw())},e.prototype.draw=function(t,i){var n=this.cfg.clipShape;if(i){if(this.cfg.refresh===!1){this.set("hasChanged",!1);return}var a=this.getCanvasBBox();if(!aa(i,a)){this.set("hasChanged",!1),this.cfg.isInView&&this._afterDraw();return}}t.save(),ji(t,this),this._applyClip(t,n),this.drawPath(t),t.restore(),this._afterDraw()},e.prototype.getCanvasViewBox=function(){var t=this.cfg.canvas;return t?t.getViewRange():null},e.prototype.cacheCanvasBBox=function(){var t=this.getCanvasViewBox();if(t){var i=this.getCanvasBBox(),n=aa(i,t);this.set("isInView",n),n?this.set("cacheCanvasBBox",i):this.set("cacheCanvasBBox",null)}},e.prototype._afterDraw=function(){this.cacheCanvasBBox(),this.set("hasChanged",!1),this.set("refresh",null)},e.prototype.skipDraw=function(){this.set("cacheCanvasBBox",null),this.set("isInView",null),this.set("hasChanged",!1)},e.prototype.drawPath=function(t){this.createPath(t),this.strokeAndFill(t),this.afterDrawPath(t)},e.prototype.fill=function(t){t.fill()},e.prototype.stroke=function(t){t.stroke()},e.prototype.strokeAndFill=function(t){var i=this.attrs,n=i.lineWidth,a=i.opacity,o=i.strokeOpacity,s=i.fillOpacity;this.isFill()&&(!D(s)&&s!==1?(t.globalAlpha=s,this.fill(t),t.globalAlpha=a):this.fill(t)),this.isStroke()&&n>0&&(!D(o)&&o!==1&&(t.globalAlpha=o),this.stroke(t)),this.afterDrawPath(t)},e.prototype.createPath=function(t){},e.prototype.afterDrawPath=function(t){},e.prototype.isInShape=function(t,i){var n=this.isStroke(),a=this.isFill(),o=this.getHitLineWidth();return this.isInStrokeOrPath(t,i,n,a,o)},e.prototype.isInStrokeOrPath=function(t,i,n,a,o){return!1},e.prototype.getHitLineWidth=function(){if(!this.isStroke())return 0;var t=this.attrs;return t.lineWidth+t.lineAppendWidth},e}(os);const Re=mA;var xA=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return g.__assign(g.__assign({},t),{x:0,y:0,r:0})},e.prototype.isInStrokeOrPath=function(t,i,n,a,o){var s=this.attr(),l=s.x,u=s.y,c=s.r,h=o/2,f=Ty(l,u,t,i);return a&&n?f<=c+h:a?f<=c:n?f>=c-h&&f<=c+h:!1},e.prototype.createPath=function(t){var i=this.attr(),n=i.x,a=i.y,o=i.r;t.beginPath(),t.arc(n,a,o,0,Math.PI*2,!1),t.closePath()},e}(Re);const wA=xA;function Wa(r,e,t,i){return r/(t*t)+e/(i*i)}var _A=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return g.__assign(g.__assign({},t),{x:0,y:0,rx:0,ry:0})},e.prototype.isInStrokeOrPath=function(t,i,n,a,o){var s=this.attr(),l=o/2,u=s.x,c=s.y,h=s.rx,f=s.ry,v=(t-u)*(t-u),d=(i-c)*(i-c);return a&&n?Wa(v,d,h+l,f+l)<=1:a?Wa(v,d,h,f)<=1:n?Wa(v,d,h-l,f-l)>=1&&Wa(v,d,h+l,f+l)<=1:!1},e.prototype.createPath=function(t){var i=this.attr(),n=i.x,a=i.y,o=i.rx,s=i.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,u=o>s?1:o/s,c=o>s?s/o:1;t.save(),t.translate(n,a),t.scale(u,c),t.arc(0,0,l,0,Math.PI*2),t.restore(),t.closePath()}},e}(Re);const bA=_A;function yv(r){return r instanceof HTMLElement&&K(r.nodeName)&&r.nodeName.toUpperCase()==="CANVAS"}var SA=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return g.__assign(g.__assign({},t),{x:0,y:0,width:0,height:0})},e.prototype.initAttrs=function(t){this._setImage(t.img)},e.prototype.isStroke=function(){return!1},e.prototype.isOnlyHitBox=function(){return!0},e.prototype._afterLoading=function(){if(this.get("toDraw")===!0){var t=this.get("canvas");t?t.draw():this.createPath(this.get("context"))}},e.prototype._setImage=function(t){var i=this,n=this.attrs;if(K(t)){var a=new Image;a.onload=function(){if(i.destroyed)return!1;i.attr("img",a),i.set("loading",!1),i._afterLoading();var o=i.get("callback");o&&o.call(i)},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)):yv(t)&&(n.width||(n.width=Number(t.getAttribute("width"))),n.height||(n.height,Number(t.getAttribute("height"))))},e.prototype.onAttrChange=function(t,i,n){r.prototype.onAttrChange.call(this,t,i,n),t==="img"&&this._setImage(i)},e.prototype.createPath=function(t){if(this.get("loading")){this.set("toDraw",!0),this.set("context",t);return}var i=this.attr(),n=i.x,a=i.y,o=i.width,s=i.height,l=i.sx,u=i.sy,c=i.swidth,h=i.sheight,f=i.img;(f instanceof Image||yv(f))&&(!D(l)&&!D(u)&&!D(c)&&!D(h)?t.drawImage(f,l,u,c,h,n,a,o,s):t.drawImage(f,n,a,o,s))},e}(Re);const CA=SA;function Ar(r,e,t,i,n,a,o){var s=Math.min(r,t),l=Math.max(r,t),u=Math.min(e,i),c=Math.max(e,i),h=n/2;return a>=s-h&&a<=l+h&&o>=u-h&&o<=c+h?Vt.pointToLine(r,e,t,i,a,o)<=n/2:!1}var MA=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return g.__assign(g.__assign({},t),{x1:0,y1:0,x2:0,y2:0,startArrow:!1,endArrow:!1})},e.prototype.initAttrs=function(t){this.setArrow()},e.prototype.onAttrChange=function(t,i,n){r.prototype.onAttrChange.call(this,t,i,n),this.setArrow()},e.prototype.setArrow=function(){var t=this.attr(),i=t.x1,n=t.y1,a=t.x2,o=t.y2,s=t.startArrow,l=t.endArrow;s&&Mc(this,t,a,o,i,n),l&&Ac(this,t,i,n,a,o)},e.prototype.isInStrokeOrPath=function(t,i,n,a,o){if(!n||!o)return!1;var s=this.attr(),l=s.x1,u=s.y1,c=s.x2,h=s.y2;return Ar(l,u,c,h,o,t,i)},e.prototype.createPath=function(t){var i=this.attr(),n=i.x1,a=i.y1,o=i.x2,s=i.y2,l=i.startArrow,u=i.endArrow,c={dx:0,dy:0},h={dx:0,dy:0};l&&l.d&&(c=li(n,a,o,s,i.startArrow.d)),u&&u.d&&(h=li(n,a,o,s,i.endArrow.d)),t.beginPath(),t.moveTo(n+c.dx,a+c.dy),t.lineTo(o-h.dx,s-h.dy)},e.prototype.afterDrawPath=function(t){var i=this.get("startArrowShape"),n=this.get("endArrowShape");i&&i.draw(t),n&&n.draw(t)},e.prototype.getTotalLength=function(){var t=this.attr(),i=t.x1,n=t.y1,a=t.x2,o=t.y2;return Vt.length(i,n,a,o)},e.prototype.getPoint=function(t){var i=this.attr(),n=i.x1,a=i.y1,o=i.x2,s=i.y2;return Vt.pointAt(n,a,o,s,t)},e}(Re);const AA=MA;var FA=/[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/ig,TA=/[^\s\,]+/ig;function EA(r){var e=r||[];if(O(e))return e;if(K(e))return e=e.match(FA),S(e,function(t,i){if(t=t.match(TA),t[0].length>1){var n=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=n}S(t,function(a,o){isNaN(a)||(t[o]=+a)}),e[i]=t}),e}var zn=` \v\f\r   ᠎              \u2028\u2029`,kA=new RegExp("([a-z])["+zn+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+zn+"]*,?["+zn+"]*)+)","ig"),LA=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+zn+"]*,?["+zn+"]*","ig");function IA(r){if(!r)return null;if(O(r))return r;var e={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},t=[];return String(r).replace(kA,function(i,n,a){var o=[],s=n.toLowerCase();if(a.replace(LA,function(l,u){u&&o.push(+u)}),s==="m"&&o.length>2&&(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>=e[s]&&(t.push([n].concat(o.splice(0,e[s]))),!!e[s]););return""}),t}var PA=/[a-z]/;function mv(r,e){return[e[0]+(e[0]-r[0]),e[1]+(e[1]-r[1])]}function Oy(r){var e=IA(r);if(!e||!e.length)return[["M",0,0]];for(var t=!1,i=0;i=0){t=!0;break}}if(!t)return e;var a=[],o=0,s=0,l=0,u=0,c=0,h=e[0];(h[0]==="M"||h[0]==="m")&&(o=+h[1],s=+h[2],l=o,u=s,c++,a[0]=["M",o,s]);for(var i=c,f=e.length;i1&&(t*=Math.sqrt(v),i*=Math.sqrt(v));var d=t*t*(f*f)+i*i*(h*h),p=d?Math.sqrt((t*t*(i*i)-d)/d):1;a===o&&(p*=-1),isNaN(p)&&(p=0);var y=i?p*t*f/i:0,m=t?p*-i*h/t:0,x=(s+u)/2+Math.cos(n)*y-Math.sin(n)*m,_=(l+c)/2+Math.sin(n)*y+Math.cos(n)*m,w=[(h-y)/t,(f-m)/i],b=[(-1*h-y)/t,(-1*f-m)/i],C=xv([1,0],w),A=xv(w,b);return yu(w,b)<=-1&&(A=Math.PI),yu(w,b)>=1&&(A=0),o===0&&A>0&&(A=A-2*Math.PI),o===1&&A<0&&(A=A+2*Math.PI),{cx:x,cy:_,rx:mu(r,[u,c])?0:t,ry:mu(r,[u,c])?0:i,startAngle:C,endAngle:C+A,xRotation:n,arcFlag:a,sweepFlag:o}}function wv(r,e){return[e[0]+(e[0]-r[0]),e[1]+(e[1]-r[1])]}function BA(r){r=EA(r);for(var e=[],t=null,i=null,n=null,a=0,o=r.length,s=0;s0!=ml(s[1]-t)>0&&ml(e-(t-o[1])*(o[0]-s[0])/(o[1]-s[1])-o[0])<0&&(i=!i)}return i}function Fn(r,e,t,i,n,a,o,s){var l=(Math.atan2(s-e,o-r)+Math.PI*2)%(Math.PI*2);if(ln)return!1;var u={x:r+t*Math.cos(l),y:e+t*Math.sin(l)};return Ty(u.x,u.y,o,s)<=a/2}var GA=kt;function YA(r){for(var e=!1,t=r.length,i=0;i_?x:_,E=x>_?1:x/_,T=x>_?_/x:1,k=GA(null,[["t",-y,-m],["r",-C],["s",1/E,1/T]]);Hn(A,A,k),a=Fn(0,0,F,w,b,e,A[0],A[1]);break}if(a)break}}return a}function HA(r){for(var e=r.length,t=[],i=[],n=[],a=0;a0&&i.push(n),{polygons:t,polylines:i}}const Ua=g.__assign({hasArc:YA,extractPolygons:HA,isPointInStroke:$A},Wu);function _v(r,e,t){for(var i=!1,n=0;n=c[0]&&t<=c[1]&&(n=(t-c[0])/(c[1]-c[0]),a=h)});var s=o[a];if(D(s)||D(a))return null;var l=s.length,u=o[a+1];return Pn.pointAt(s[l-2],s[l-1],u[1],u[2],u[3],u[4],u[5],u[6],n)},e.prototype._calculateCurve=function(){var t=this.attr().path;this.set("curve",Ua.pathToCurve(t))},e.prototype._setTcache=function(){var t=0,i=0,n=[],a,o,s,l,u=this.get("curve");if(u){if(S(u,function(c,h){s=u[h+1],l=c.length,s&&(t+=Pn.length(c[l-2],c[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}S(u,function(c,h){s=u[h+1],l=c.length,s&&(a=[],a[0]=i/t,o=Pn.length(c[l-2],c[l-1],s[1],s[2],s[3],s[4],s[5],s[6]),i+=o||0,a[1]=i/t,n.push(a))}),this.set("tCache",n)}},e.prototype.getStartTangent=function(){var t=this.getSegments(),i;if(t.length>1){var n=t[0].currentPoint,a=t[1].currentPoint,o=t[1].startTangent;i=[],o?(i.push([n[0]-o[0],n[1]-o[1]]),i.push([n[0],n[1]])):(i.push([a[0],a[1]]),i.push([n[0],n[1]]))}return i},e.prototype.getEndTangent=function(){var t=this.getSegments(),i=t.length,n;if(i>1){var a=t[i-2].currentPoint,o=t[i-1].currentPoint,s=t[i-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},e}(Re);const Ec=XA;function zy(r,e,t,i,n){var a=r.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)}),Vt.pointAt(i[o][0],i[o][1],i[o+1][0],i[o+1][1],a)},e.prototype._setTcache=function(){var t=this.attr().points;if(!(!t||t.length===0)){var i=this.getTotalLength();if(!(i<=0)){var n=0,a=[],o,s;S(t,function(l,u){t[u+1]&&(o=[],o[0]=n/i,s=Vt.length(l[0],l[1],t[u+1][0],t[u+1][1]),n+=s,o[1]=n/i,a.push(o))}),this.set("tCache",a)}}},e.prototype.getStartTangent=function(){var t=this.attr().points,i=[];return i.push([t[1][0],t[1][1]]),i.push([t[0][0],t[0][1]]),i},e.prototype.getEndTangent=function(){var t=this.attr().points,i=t.length-1,n=[];return n.push([t[i-1][0],t[i-1][1]]),n.push([t[i][0],t[i][1]]),n},e}(Re);const jA=UA;function ZA(r,e,t,i,n,a,o){var s=n/2;return Jr(r-s,e-s,t,n,a,o)||Jr(r+t-s,e-s,n,i,a,o)||Jr(r+s,e+i-s,t,n,a,o)||Jr(r-s,e+s,n,i,a,o)}function QA(r,e,t,i,n,a,o,s){return Ar(r+n,e,r+t-n,e,a,o,s)||Ar(r+t,e+n,r+t,e+i-n,a,o,s)||Ar(r+t-n,e+i,r+n,e+i,a,o,s)||Ar(r,e+i-n,r,e+n,a,o,s)||Fn(r+t-n,e+n,n,1.5*Math.PI,2*Math.PI,a,o,s)||Fn(r+t-n,e+i-n,n,0,.5*Math.PI,a,o,s)||Fn(r+n,e+i-n,n,.5*Math.PI,Math.PI,a,o,s)||Fn(r+n,e+n,n,Math.PI,1.5*Math.PI,a,o,s)}var KA=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return g.__assign(g.__assign({},t),{x:0,y:0,width:0,height:0,radius:0})},e.prototype.isInStrokeOrPath=function(t,i,n,a,o){var s=this.attr(),l=s.x,u=s.y,c=s.width,h=s.height,f=s.radius;if(f){var d=!1;return n&&(d=QA(l,u,c,h,f,o,t,i)),!d&&a&&(d=Ry(this,t,i)),d}else{var v=o/2;if(a&&n)return Jr(l-v,u-v,c+v,h+v,t,i);if(a)return Jr(l,u,c,h,t,i);if(n)return ZA(l,u,c,h,o,t,i)}},e.prototype.createPath=function(t){var i=this.attr(),n=i.x,a=i.y,o=i.width,s=i.height,l=i.radius;if(t.beginPath(),l===0)t.rect(n,a,o,s);else{var u=fA(l),c=u[0],h=u[1],f=u[2],v=u[3];t.moveTo(n+c,a),t.lineTo(n+o-h,a),h!==0&&t.arc(n+o-h,a+h,h,-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+c),c!==0&&t.arc(n+c,a+c,c,Math.PI,Math.PI*1.5),t.closePath()}},e}(Re);const JA=KA;var tF=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return g.__assign(g.__assign({},t),{x:0,y:0,text:null,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom"})},e.prototype.isOnlyHitBox=function(){return!0},e.prototype.initAttrs=function(t){this._assembleFont(),t.text&&this._setText(t.text)},e.prototype._assembleFont=function(){var t=this.attrs;t.font=hs(t)},e.prototype._setText=function(t){var i=null;K(t)&&t.indexOf(` `)!==-1&&(i=t.split(` `)),this.set("textArr",i)},e.prototype.onAttrChange=function(t,i,n){r.prototype.onAttrChange.call(this,t,i,n),t.startsWith("font")&&this._assembleFont(),t==="text"&&this._setText(i)},e.prototype._getSpaceingY=function(){var t=this.attrs,i=t.lineHeight,n=t.fontSize*1;return i?i-n:n*.14},e.prototype._drawTextArr=function(t,i,n){var a=this.attrs,o=a.textBaseline,s=a.x,l=a.y,u=a.fontSize*1,c=this._getSpaceingY(),h=cs(a.text,a.fontSize,a.lineHeight),f;S(i,function(v,d){f=l+d*(c+u)-h+u,o==="middle"&&(f+=h-u-(h-u)/2),o==="top"&&(f+=h-u),D(v)||(n?t.fillText(v,s,f):t.strokeText(v,s,f))})},e.prototype._drawText=function(t,i){var n=this.attr(),a=n.x,o=n.y,s=this.get("textArr");if(s)this._drawTextArr(t,s,i);else{var l=n.text;D(l)||(i?t.fillText(l,a,o):t.strokeText(l,a,o))}},e.prototype.strokeAndFill=function(t){var i=this.attrs,n=i.lineWidth,a=i.opacity,o=i.strokeOpacity,s=i.fillOpacity;this.isStroke()&&n>0&&(!D(o)&&o!==1&&(t.globalAlpha=a),this.stroke(t)),this.isFill()&&(!D(s)&&s!==1?(t.globalAlpha=s,this.fill(t),t.globalAlpha=a):this.fill(t)),this.afterDrawPath(t)},e.prototype.fill=function(t){this._drawText(t,!0)},e.prototype.stroke=function(t){this._drawText(t,!1)},e}(Re);const eF=tF;function rF(r,e){if(e){var t=rs(e);return ir(t,r)}return r}function Vy(r,e,t){var i=r.getTotalMatrix();if(i){var n=rF([e,t,1],i),a=n[0],o=n[1];return[a,o]}return[e,t]}function bv(r,e,t){if(r.isCanvas&&r.isCanvas())return!0;if(!Xn(r)||r.cfg.isInView===!1)return!1;if(r.cfg.clipShape){var i=Vy(r,e,t),n=i[0],a=i[1];if(r.isClipped(n,a))return!1}var o=r.cfg.cacheCanvasBBox||r.getCanvasBBox();return e>=o.minX&&e<=o.maxX&&t>=o.minY&&t<=o.maxY}function Gy(r,e,t){if(!bv(r,e,t))return null;for(var i=null,n=r.getChildren(),a=n.length,o=a-1;o>=0;o--){var s=n[o];if(s.isGroup())i=Gy(s,e,t);else if(bv(s,e,t)){var l=s,u=Vy(s,e,t),c=u[0],h=u[1];l.isInShape(c,h)&&(i=s)}if(i)break}return i}var iF=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return t.renderer="canvas",t.autoDraw=!0,t.localRefresh=!0,t.refreshElements=[],t.clipView=!0,t.quickHit=!1,t},e.prototype.onCanvasChange=function(t){(t==="attr"||t==="sort"||t==="changeSize")&&(this.set("refreshElements",[this]),this.draw())},e.prototype.getShapeBase=function(){return Jo},e.prototype.getGroupBase=function(){return Tc},e.prototype.getPixelRatio=function(){var t=this.get("pixelRatio")||iA();return t>=1?Math.ceil(t):1},e.prototype.getViewRange=function(){return{minX:0,minY:0,maxX:this.cfg.width,maxY:this.cfg.height}},e.prototype.createDom=function(){var t=document.createElement("canvas"),i=t.getContext("2d");return this.set("context",i),t},e.prototype.setDOMSize=function(t,i){r.prototype.setDOMSize.call(this,t,i);var n=this.get("context"),a=this.get("el"),o=this.getPixelRatio();a.width=o*t,a.height=o*i,o>1&&n.scale(o,o)},e.prototype.clear=function(){r.prototype.clear.call(this),this._clearFrame();var t=this.get("context"),i=this.get("el");t.clearRect(0,0,i.width,i.height)},e.prototype.getShape=function(t,i){var n;return this.get("quickHit")?n=Gy(this,t,i):n=r.prototype.getShape.call(this,t,i,null),n},e.prototype._getRefreshRegion=function(){var t=this.get("refreshElements"),i=this.getViewRange(),n;if(t.length&&t[0]===this)n=i;else if(n=pA(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=yA(n,i))}return n},e.prototype.refreshElement=function(t){var i=this.get("refreshElements");i.push(t)},e.prototype._clearFrame=function(){var t=this.get("drawFrame");t&&(Vx(t),this.set("drawFrame",null),this.set("refreshElements",[]))},e.prototype.draw=function(){var t=this.get("drawFrame");this.get("autoDraw")&&t||this._startDraw()},e.prototype._drawAll=function(){var t=this.get("context"),i=this.get("el"),n=this.getChildren();t.clearRect(0,0,i.width,i.height),ji(t,this),gu(t,n),this.set("refreshElements",[])},e.prototype._drawRegion=function(){var t=this.get("context"),i=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(),ji(t,this),vA(this,n,a),gu(t,n,a),t.restore()):i.length&&Py(i),S(i,function(o){o.get("hasChanged")&&o.set("hasChanged",!1)}),this.set("refreshElements",[])},e.prototype._startDraw=function(){var t=this,i=this.get("drawFrame");i||(i=Gx(function(){t.get("localRefresh")?t._drawRegion():t._drawAll(),t.set("drawFrame",null)}),this.set("drawFrame",i))},e.prototype.skipDraw=function(){},e.prototype.removeDom=function(){var t=this.get("el");t.width=0,t.height=0,t.parentNode.removeChild(t)},e}(ns),nF="0.5.12";const aF=Object.freeze(Object.defineProperty({__proto__:null,AbstractCanvas:ns,AbstractGroup:as,AbstractShape:os,Base:es,Canvas:iF,Event:ya,Group:Tc,PathUtil:Wu,Shape:Jo,assembleFont:hs,getArcParams:zo,getBBoxMethod:ss,getOffScreenContext:us,getTextHeight:cs,invert:rs,isAllowCapture:Xn,multiplyVec2:ir,registerBBox:Me,registerEasing:Bg,version:nF},Symbol.toStringTag,{value:"Module"}));var xu={rect:"path",circle:"circle",line:"line",path:"path",marker:"path",text:"text",polyline:"polyline",polygon:"polygon",image:"image",ellipse:"ellipse",dom:"foreignObject"},st={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 Ce(r){return document.createElementNS("http://www.w3.org/2000/svg",r)}function Yy(r){var e=xu[r.type],t=r.getParent();if(!e)throw new Error("the type "+r.type+" is not supported by svg");var i=Ce(e);if(r.get("id")&&(i.id=r.get("id")),r.set("el",i),r.set("attrs",{}),t){var n=t.get("el");n||(n=t.createDom(),t.set("el",n)),n.appendChild(i)}return i}function $y(r,e){var t=r.get("el"),i=Yx(t.children).sort(e),n=document.createDocumentFragment();i.forEach(function(a){n.appendChild(a)}),t.appendChild(n)}function oF(r,e){var t=r.parentNode,i=Array.from(t.childNodes).filter(function(s){return s.nodeType===1&&s.nodeName.toLowerCase()!=="defs"}),n=i[e],a=i.indexOf(r);if(n){if(a>e)t.insertBefore(r,n);else if(a0&&(i?"stroke"in n?this._setColor(t,"stroke",s):"strokeStyle"in n&&this._setColor(t,"stroke",l):this._setColor(t,"stroke",s||l),c&&f.setAttribute(st.strokeOpacity,c),h&&f.setAttribute(st.lineWidth,h))},e.prototype._setColor=function(t,i,n){var a=this.get("el");if(!n){a.setAttribute(st[i],"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(st[i],"url(#"+o+")")}else if(/^[p,P]{1}[\s]*\(/.test(n)){var o=t.find("pattern",n);o||(o=t.addPattern(n)),a.setAttribute(st[i],"url(#"+o+")")}else a.setAttribute(st[i],n)},e.prototype.shadow=function(t,i){var n=this.attr(),a=i||n,o=a.shadowOffsetX,s=a.shadowOffsetY,l=a.shadowBlur,u=a.shadowColor;(o||s||l||u)&&sF(this,t)},e.prototype.transform=function(t){var i=this.attr(),n=(t||i).matrix;n&&Ma(this)},e.prototype.isInShape=function(t,i){return this.isPointInPath(t,i)},e.prototype.isPointInPath=function(t,i){var n=this.get("el"),a=this.get("canvas"),o=a.get("el").getBoundingClientRect(),s=t+o.left,l=i+o.top,u=document.elementFromPoint(s,l);return!!(u&&u.isEqualNode(n))},e.prototype.getHitLineWidth=function(){var t=this.attrs,i=t.lineWidth,n=t.lineAppendWidth;return this.isStroke()?i+n:0},e}(os);const Ae=lF;var uF=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="circle",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return g.__assign(g.__assign({},t),{x:0,y:0,r:0})},e.prototype.createPath=function(t,i){var n=this.attr(),a=this.get("el");S(i||n,function(o,s){s==="x"||s==="y"?a.setAttribute("c"+s,o):st[s]&&a.setAttribute(st[s],o)})},e}(Ae);const cF=uF;var hF=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="dom",t.canFill=!1,t.canStroke=!1,t}return e.prototype.createPath=function(t,i){var n=this.attr(),a=this.get("el");if(S(i||n,function(u,c){st[c]&&a.setAttribute(st[c],u)}),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},e}(Ae);const fF=hF;var vF=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="ellipse",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return g.__assign(g.__assign({},t),{x:0,y:0,rx:0,ry:0})},e.prototype.createPath=function(t,i){var n=this.attr(),a=this.get("el");S(i||n,function(o,s){s==="x"||s==="y"?a.setAttribute("c"+s,o):st[s]&&a.setAttribute(st[s],o)})},e}(Ae);const dF=vF;var gF=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="image",t.canFill=!1,t.canStroke=!1,t}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return g.__assign(g.__assign({},t),{x:0,y:0,width:0,height:0})},e.prototype.createPath=function(t,i){var n=this,a=this.attr(),o=this.get("el");S(i||a,function(s,l){l==="img"?n._setImage(a.img):st[l]&&o.setAttribute(st[l],s)})},e.prototype.setAttr=function(t,i){this.attrs[t]=i,t==="img"&&this._setImage(i)},e.prototype._setImage=function(t){var i=this.attr(),n=this.get("el");if(K(t))n.setAttribute("href",t);else if(t instanceof window.Image)i.width||(n.setAttribute("width",t.width),this.attr("width",t.width)),i.height||(n.setAttribute("height",t.height),this.attr("height",t.height)),n.setAttribute("href",t.src);else if(t instanceof HTMLElement&&K(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),i.width||(n.setAttribute("width",""+t.width),this.attr("width",t.width)),i.height||(n.setAttribute("height",""+t.height),this.attr("height",t.height)),n.setAttribute("href",a.toDataURL())}},e}(Ae);const pF=gF;var yF=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="line",t.canFill=!1,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return g.__assign(g.__assign({},t),{x1:0,y1:0,x2:0,y2:0,startArrow:!1,endArrow:!1})},e.prototype.createPath=function(t,i){var n=this.attr(),a=this.get("el");S(i||n,function(o,s){if(s==="startArrow"||s==="endArrow")if(o){var l=pt(o)?t.addArrow(n,st[s]):t.getDefaultArrow(n,st[s]);a.setAttribute(st[s],"url(#"+l+")")}else a.removeAttribute(st[s]);else st[s]&&a.setAttribute(st[s],o)})},e.prototype.getTotalLength=function(){var t=this.attr(),i=t.x1,n=t.y1,a=t.x2,o=t.y2;return Vt.length(i,n,a,o)},e.prototype.getPoint=function(t){var i=this.attr(),n=i.x1,a=i.y1,o=i.x2,s=i.y2;return Vt.pointAt(n,a,o,s,t)},e}(Ae);const mF=yF;var ja={circle:function(r,e,t){return[["M",r,e],["m",-t,0],["a",t,t,0,1,0,t*2,0],["a",t,t,0,1,0,-t*2,0]]},square:function(r,e,t){return[["M",r-t,e-t],["L",r+t,e-t],["L",r+t,e+t],["L",r-t,e+t],["Z"]]},diamond:function(r,e,t){return[["M",r-t,e],["L",r,e-t],["L",r+t,e],["L",r,e+t],["Z"]]},triangle:function(r,e,t){var i=t*Math.sin(.3333333333333333*Math.PI);return[["M",r-t,e+i],["L",r,e-i],["L",r+t,e+i],["z"]]},triangleDown:function(r,e,t){var i=t*Math.sin(.3333333333333333*Math.PI);return[["M",r-t,e-i],["L",r+t,e-i],["L",r,e+i],["Z"]]}};const Sv={get:function(r){return ja[r]},register:function(r,e){ja[r]=e},remove:function(r){delete ja[r]},getAll:function(){return ja}};var xF=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="marker",t.canFill=!0,t.canStroke=!0,t}return e.prototype.createPath=function(t){var i=this.get("el");i.setAttribute("d",this._assembleMarker())},e.prototype._assembleMarker=function(){var t=this._getPath();return O(t)?t.map(function(i){return i.join(" ")}).join(""):t},e.prototype._getPath=function(){var t=this.attr(),i=t.x,n=t.y,a=t.r||t.radius,o=t.symbol||"circle",s;return W(o)?s=o:s=Sv.get(o),s?s(i,n,a):(console.warn(s+" symbol is not exist."),null)},e.symbolsFactory=Sv,e}(Ae);const wF=xF;var _F=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="path",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return g.__assign(g.__assign({},t),{startArrow:!1,endArrow:!1})},e.prototype.createPath=function(t,i){var n=this,a=this.attr(),o=this.get("el");S(i||a,function(s,l){if(l==="path"&&O(s))o.setAttribute("d",n._formatPath(s));else if(l==="startArrow"||l==="endArrow")if(s){var u=pt(s)?t.addArrow(a,st[l]):t.getDefaultArrow(a,st[l]);o.setAttribute(st[l],"url(#"+u+")")}else o.removeAttribute(st[l]);else st[l]&&o.setAttribute(st[l],s)})},e.prototype._formatPath=function(t){var i=t.map(function(n){return n.join(" ")}).join("");return~i.indexOf("NaN")?"":i},e.prototype.getTotalLength=function(){var t=this.get("el");return t?t.getTotalLength():null},e.prototype.getPoint=function(t){var i=this.get("el"),n=this.getTotalLength();if(n===0)return null;var a=i?i.getPointAtLength(t*n):null;return a?{x:a.x,y:a.y}:null},e}(Ae);const bF=_F;var SF=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="polygon",t.canFill=!0,t.canStroke=!0,t}return e.prototype.createPath=function(t,i){var n=this.attr(),a=this.get("el");S(i||n,function(o,s){s==="points"&&O(o)&&o.length>=2?a.setAttribute("points",o.map(function(l){return l[0]+","+l[1]}).join(" ")):st[s]&&a.setAttribute(st[s],o)})},e}(Ae);const CF=SF;var MF=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="polyline",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return g.__assign(g.__assign({},t),{startArrow:!1,endArrow:!1})},e.prototype.onAttrChange=function(t,i,n){r.prototype.onAttrChange.call(this,t,i,n),["points"].indexOf(t)!==-1&&this._resetCache()},e.prototype._resetCache=function(){this.set("totalLength",null),this.set("tCache",null)},e.prototype.createPath=function(t,i){var n=this.attr(),a=this.get("el");S(i||n,function(o,s){s==="points"&&O(o)&&o.length>=2?a.setAttribute("points",o.map(function(l){return l[0]+","+l[1]}).join(" ")):st[s]&&a.setAttribute(st[s],o)})},e.prototype.getTotalLength=function(){var t=this.attr().points,i=this.get("totalLength");return D(i)?(this.set("totalLength",Hg.length(t)),this.get("totalLength")):i},e.prototype.getPoint=function(t){var i=this.attr().points,n=this.get("tCache");n||(this._setTcache(),n=this.get("tCache"));var a,o;return S(n,function(s,l){t>=s[0]&&t<=s[1]&&(a=(t-s[0])/(s[1]-s[0]),o=l)}),Vt.pointAt(i[o][0],i[o][1],i[o+1][0],i[o+1][1],a)},e.prototype._setTcache=function(){var t=this.attr().points;if(!(!t||t.length===0)){var i=this.getTotalLength();if(!(i<=0)){var n=0,a=[],o,s;S(t,function(l,u){t[u+1]&&(o=[],o[0]=n/i,s=Vt.length(l[0],l[1],t[u+1][0],t[u+1][1]),n+=s,o[1]=n/i,a.push(o))}),this.set("tCache",a)}}},e.prototype.getStartTangent=function(){var t=this.attr().points,i=[];return i.push([t[1][0],t[1][1]]),i.push([t[0][0],t[0][1]]),i},e.prototype.getEndTangent=function(){var t=this.attr().points,i=t.length-1,n=[];return n.push([t[i-1][0],t[i-1][1]]),n.push([t[i][0],t[i][1]]),n},e}(Ae);const AF=MF;function FF(r){var e=0,t=0,i=0,n=0;return O(r)?r.length===1?e=t=i=n=r[0]:r.length===2?(e=i=r[0],t=n=r[1]):r.length===3?(e=r[0],t=n=r[1],i=r[2]):(e=r[0],t=r[1],i=r[2],n=r[3]):e=t=i=n=r,{r1:e,r2:t,r3:i,r4:n}}var TF=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="rect",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return g.__assign(g.__assign({},t),{x:0,y:0,width:0,height:0,radius:0})},e.prototype.createPath=function(t,i){var n=this,a=this.attr(),o=this.get("el"),s=!1,l=["x","y","width","height","radius"];S(i||a,function(u,c){l.indexOf(c)!==-1&&!s?(o.setAttribute("d",n._assembleRect(a)),s=!0):l.indexOf(c)===-1&&st[c]&&o.setAttribute(st[c],u)})},e.prototype._assembleRect=function(t){var i=t.x,n=t.y,a=t.width,o=t.height,s=t.radius;if(!s)return"M "+i+","+n+" l "+a+",0 l 0,"+o+" l"+-a+" 0 z";var l=FF(s);O(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 u=[["M "+(i+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 u.join(" ")},e}(Ae);const EF=TF;var Cv=.3,kF={top:"before-edge",middle:"central",bottom:"after-edge",alphabetic:"baseline",hanging:"hanging"},LF={top:"text-before-edge",middle:"central",bottom:"text-after-edge",alphabetic:"alphabetic",hanging:"hanging"},IF={left:"left",start:"left",center:"middle",right:"end",end:"end"},PF=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="text",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return g.__assign(g.__assign({},t),{x:0,y:0,text:null,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom"})},e.prototype.createPath=function(t,i){var n=this,a=this.attr(),o=this.get("el");this._setFont(),S(i||a,function(s,l){l==="text"?n._setText(""+s):l==="matrix"&&s?Ma(n):st[l]&&o.setAttribute(st[l],s)}),o.setAttribute("paint-order","stroke"),o.setAttribute("style","stroke-linecap:butt; stroke-linejoin:miter;")},e.prototype._setFont=function(){var t=this.get("el"),i=this.attr(),n=i.textBaseline,a=i.textAlign,o=yg();o&&o.name==="firefox"?t.setAttribute("dominant-baseline",LF[n]||"alphabetic"):t.setAttribute("alignment-baseline",kF[n]||"baseline"),t.setAttribute("text-anchor",IF[a]||"left")},e.prototype._setText=function(t){var i=this.get("el"),n=this.attr(),a=n.x,o=n.textBaseline,s=o===void 0?"bottom":o;if(!t)i.innerHTML="";else if(~t.indexOf(` `)){var l=t.split(` `),u=l.length-1,c="";S(l,function(h,f){f===0?s==="alphabetic"?c+=''+h+"":s==="top"?c+=''+h+"":s==="middle"?c+=''+h+"":s==="bottom"?c+=''+h+"":s==="hanging"&&(c+=''+h+""):c+=''+h+""}),i.innerHTML=c}else i.innerHTML=t},e}(Ae);const DF=PF;var BF=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,OF=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,RF=/[\d.]+:(#[^\s]+|[^)]+\))/gi;function Wy(r){var e=r.match(RF);if(!e)return"";var t="";return e.sort(function(i,n){return i=i.split(":"),n=n.split(":"),Number(i[0])-Number(n[0])}),S(e,function(i){i=i.split(":"),t+=''}),t}function NF(r,e){var t=BF.exec(r),i=jo(Zo(parseFloat(t[1])),Math.PI*2),n=t[2],a,o;i>=0&&i<.5*Math.PI?(a={x:0,y:0},o={x:1,y:1}):.5*Math.PI<=i&&i`;t.innerHTML=i},r}(),Mv=function(){function r(e,t){this.cfg={};var i=Ce("marker"),n=Gr("marker_");i.setAttribute("id",n);var a=Ce("path");a.setAttribute("stroke",e.stroke||"none"),a.setAttribute("fill",e.fill||"none"),i.appendChild(a),i.setAttribute("overflow","visible"),i.setAttribute("orient","auto-start-reverse"),this.el=i,this.child=a,this.id=n;var o=e[t==="marker-start"?"startArrow":"endArrow"];return this.stroke=e.stroke||"#000",o===!0?this._setDefaultPath(t,a):(this.cfg=o,this._setMarker(e.lineWidth,a)),this}return r.prototype.match=function(){return!1},r.prototype._setDefaultPath=function(e,t){var i=this.el;t.setAttribute("d","M0,0 L"+10*Math.cos(Math.PI/6)+",5 L0,10"),i.setAttribute("refX",""+10*Math.cos(Math.PI/6)),i.setAttribute("refY",""+5)},r.prototype._setMarker=function(e,t){var i=this.el,n=this.cfg.path,a=this.cfg.d;O(n)&&(n=n.map(function(o){return o.join(" ")}).join("")),t.setAttribute("d",n),i.appendChild(t),a&&i.setAttribute("refX",""+a/e)},r.prototype.update=function(e){var t=this.child;t.attr?t.attr("fill",e):t.setAttribute("fill",e)},r}(),HF=function(){function r(e){this.type="clip",this.cfg={};var t=Ce("clipPath");this.el=t,this.id=Gr("clip_"),t.id=this.id;var i=e.cfg.el;return t.appendChild(i),this.cfg=e,this}return r.prototype.match=function(){return!1},r.prototype.remove=function(){var e=this.el;e.parentNode.removeChild(e)},r}(),XF=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,WF=function(){function r(e){this.cfg={};var t=Ce("pattern");t.setAttribute("patternUnits","userSpaceOnUse");var i=Ce("image");t.appendChild(i);var n=Gr("pattern_");t.id=n,this.el=t,this.id=n,this.cfg=e;var a=XF.exec(e),o=a[2];i.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 r.prototype.match=function(e,t){return this.cfg===t},r}(),qF=function(){function r(e){var t=Ce("defs"),i=Gr("defs_");t.id=i,e.appendChild(t),this.children=[],this.defaultArrow={},this.el=t,this.canvas=e}return r.prototype.find=function(e,t){for(var i=this.children,n=null,a=0;a0&&(v[0][0]="L")),a=a.concat(v)}),a.push(["Z"])}return a}function Is(r,e,t,i,n){for(var a=Ft(r,e,!e,"lineWidth"),o=r.connectNulls,s=r.isInCircle,l=r.points,u=r.showSinglePoint,c=Ls(l,o,u),h=[],f=0,v=c.length;fo&&(o=l),l=i[0]}));var y=this.scales[d];try{for(var m=g.__values(t),x=m.next();!x.done;x=m.next()){var _=x.value,w=this.getDrawCfg(_),b=w.x,C=w.y,A=y.scale(_[gt][d]);this.drawGrayScaleBlurredCircle(b-u.x,C-c.y,n+a,A,p)}}catch(T){o={error:T}}finally{try{x&&!x.done&&(s=m.return)&&s.call(m)}finally{if(o)throw o.error}}var F=p.getImageData(0,0,h,f);this.clearShadowCanvasCtx(),this.colorize(F),p.putImageData(F,0,0);var E=this.getImageShape();E.attr("x",u.x),E.attr("y",c.y),E.attr("width",h),E.attr("height",f),E.attr("img",p.canvas),E.set("origin",this.getShapeInfo(t))},e.prototype.getDefaultSize=function(){var t=this.getAttribute("position"),i=this.coordinate;return Math.min(i.getWidth()/(t.scales[0].ticks.length*4),i.getHeight()/(t.scales[1].ticks.length*4))},e.prototype.clearShadowCanvasCtx=function(){var t=this.getShadowCanvasCtx();t.clearRect(0,0,t.canvas.width,t.canvas.height)},e.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")},e.prototype.getGrayScaleBlurredCanvas=function(){return this.grayScaleBlurredCanvas||(this.grayScaleBlurredCanvas=document.createElement("canvas")),this.grayScaleBlurredCanvas},e.prototype.drawGrayScaleBlurredCircle=function(t,i,n,a,o){var s=this.getGrayScaleBlurredCanvas();o.globalAlpha=a,o.drawImage(s,t-n,i-n)},e.prototype.colorize=function(t){for(var i=this.getAttribute("color"),n=t.data,a=this.paletteCache,o=3;oe&&(t=t?e/(1+i/t):0,i=e-t),n+a>e&&(n=n?e/(1+a/n):0,a=e-n),[t||0,i||0,n||0,a||0]}function jy(r,e,t){var i=[];if(t.isRect){var n=t.isTransposed?{x:t.start.x,y:e[0].y}:{x:e[0].x,y:t.start.y},a=t.isTransposed?{x:t.end.x,y:e[2].y}:{x:e[3].x,y:t.end.y},o=M(r,["background","style","radius"]);if(o){var s=t.isTransposed?Math.abs(e[0].y-e[2].y):e[2].x-e[1].x,l=t.isTransposed?t.getWidth():t.getHeight(),u=g.__read(Uy(o,Math.min(s,l)),4),c=u[0],h=u[1],f=u[2],v=u[3],d=t.isTransposed&&t.isReflect("y"),p=d?0:1,y=function(C){return d?-C:C};i.push(["M",n.x,a.y+y(c)]),c!==0&&i.push(["A",c,c,0,0,p,n.x+c,a.y]),i.push(["L",a.x-h,a.y]),h!==0&&i.push(["A",h,h,0,0,p,a.x,a.y+y(h)]),i.push(["L",a.x,n.y-y(f)]),f!==0&&i.push(["A",f,f,0,0,p,a.x-f,n.y]),i.push(["L",n.x+v,n.y]),v!==0&&i.push(["A",v,v,0,0,p,n.x,n.y-y(v)])}else i.push(["M",n.x,n.y]),i.push(["L",a.x,n.y]),i.push(["L",a.x,a.y]),i.push(["L",n.x,a.y]),i.push(["L",n.x,n.y]);i.push(["z"])}if(t.isPolar){var m=t.getCenter(),x=ea(r,t),_=x.startAngle,w=x.endAngle;if(t.type!=="theta"&&!t.isTransposed)i=Lr(m.x,m.y,t.getRadius(),_,w);else{var b=function(F){return Math.pow(F,2)},c=Math.sqrt(b(m.x-e[0].x)+b(m.y-e[0].y)),h=Math.sqrt(b(m.x-e[2].x)+b(m.y-e[2].y));i=Lr(m.x,m.y,c,t.startAngle,t.endAngle,h)}}return i}function eT(r,e,t){var i=t.getWidth(),n=t.getHeight(),a=t.type==="rect",o=[],s=(r[2].x-r[1].x)/2,l=t.isTransposed?s*n/i:s*i/n;return e==="round"?(a?(o.push(["M",r[0].x,r[0].y+l]),o.push(["L",r[1].x,r[1].y-l]),o.push(["A",s,s,0,0,1,r[2].x,r[2].y-l]),o.push(["L",r[3].x,r[3].y+l]),o.push(["A",s,s,0,0,1,r[0].x,r[0].y+l])):(o.push(["M",r[0].x,r[0].y]),o.push(["L",r[1].x,r[1].y]),o.push(["A",s,s,0,0,1,r[2].x,r[2].y]),o.push(["L",r[3].x,r[3].y]),o.push(["A",s,s,0,0,1,r[0].x,r[0].y])),o.push(["z"])):o=Pc(r),o}function Zy(r,e,t){var i=[];return D(e)?t?i.push(["M",r[0].x,r[0].y],["L",r[1].x,r[1].y],["L",(r[2].x+r[3].x)/2,(r[2].y+r[3].y)/2],["Z"]):i.push(["M",r[0].x,r[0].y],["L",r[1].x,r[1].y],["L",r[2].x,r[2].y],["L",r[3].x,r[3].y],["Z"]):i.push(["M",r[0].x,r[0].y],["L",r[1].x,r[1].y],["L",e[1].x,e[1].y],["L",e[0].x,e[0].y],["Z"]),i}function xn(r,e){return[e,r]}function rT(r,e,t){var i,n,a,o,s,l,u,c=g.__read(g.__spreadArray([],g.__read(r),!1),4),h=c[0],f=c[1],v=c[2],d=c[3],p=g.__read(typeof t=="number"?Array(4).fill(t):t,4),y=p[0],m=p[1],x=p[2],_=p[3];e.isTransposed&&(i=g.__read(xn(f,d),2),f=i[0],d=i[1]),e.isReflect("y")&&(n=g.__read(xn(h,f),2),h=n[0],f=n[1],a=g.__read(xn(v,d),2),v=a[0],d=a[1]),e.isReflect("x")&&(o=g.__read(xn(h,d),2),h=o[0],d=o[1],s=g.__read(xn(f,v),2),f=s[0],v=s[1]);var w=[],b=function(C){return Math.abs(C)};return l=g.__read(Uy([y,m,x,_],Math.min(b(d.x-h.x),b(f.y-h.y))).map(function(C){return b(C)}),4),y=l[0],m=l[1],x=l[2],_=l[3],e.isTransposed&&(u=g.__read([_,y,m,x],4),y=u[0],m=u[1],x=u[2],_=u[3]),h.yo&&(n=o)}return n}function nT(r,e){if(e){var t=ve(r),i=De(t,e);return i.length}return r.length}function Dc(r){var e=r.theme,t=r.coordinate,i=r.getXScale(),n=i.values,a=r.beforeMappingData,o=n.length,s=_a(r.coordinate),l=r.intervalPadding,u=r.dodgePadding,c=r.maxColumnWidth||e.maxColumnWidth,h=r.minColumnWidth||e.minColumnWidth,f=r.columnWidthRatio||e.columnWidthRatio,v=r.multiplePieWidthRatio||e.multiplePieWidthRatio,d=r.roseWidthRatio||e.roseWidthRatio;if(i.isLinear&&n.length>1){n.sort();var p=iT(n,i);o=(i.max-i.min)/p,n.length>o&&(o=n.length)}var y=i.range,m=1/o,x=1;if(t.isPolar?t.isTransposed&&o>1?x=v:x=d:(i.isLinear&&(m*=y[1]-y[0]),x=f),!D(l)&&l>=0){var _=l/s;m=(1-(o-1)*_)/o}else m*=x;if(r.getAdjust("dodge")){var w=r.getAdjust("dodge"),b=w.dodgeBy,C=nT(a,b);if(!D(u)&&u>=0){var A=u/s;m=(m-A*(C-1))/C}else!D(l)&&l>=0&&(m*=x),m=m/C;m=m>=0?m:0}if(!D(c)&&c>=0){var F=c/s;m>F&&(m=F)}if(!D(h)&&h>=0){var E=h/s;m0&&!M(i,[n,"min"])&&t.change({min:0}),o<=0&&!M(i,[n,"max"])&&t.change({max:0}))}},e.prototype.getDrawCfg=function(t){var i=r.prototype.getDrawCfg.call(this,t);return i.background=this.background,i},e}($r),oT=function(r){g.__extends(e,r);function e(t){var i=r.call(this,t)||this;i.type="line";var n=t.sortable,a=n===void 0?!1:n;return i.sortable=a,i}return e}(Lc),Qy=["circle","square","bowtie","diamond","hexagon","triangle","triangle-down"],sT=["cross","tick","plus","hyphen","line"];function Bc(r,e,t,i,n){var a,o,s=Ft(e,n,!n,"r"),l=r.parsePoints(e.points),u=l[0];if(e.isStack)u=l[1];else if(l.length>1){var c=t.addGroup();try{for(var h=g.__values(l),f=h.next();!f.done;f=h.next()){var v=f.value;c.addShape({type:"marker",attrs:g.__assign(g.__assign(g.__assign({},s),{symbol:gi[i]||i}),v)})}}catch(d){a={error:d}}finally{try{f&&!f.done&&(o=h.return)&&o.call(h)}finally{if(a)throw a.error}}return c}return t.addShape({type:"marker",attrs:g.__assign(g.__assign(g.__assign({},s),{symbol:gi[i]||i}),u)})}Yr("point",{defaultShapeType:"hollow-circle",getDefaultPoints:function(r){return Sc(r)}});S(Qy,function(r){lt("point","hollow-".concat(r),{draw:function(e,t){return Bc(this,e,t,r,!0)},getMarker:function(e){var t=e.color;return{symbol:gi[r]||r,style:{r:4.5,stroke:t,fill:null}}}})});var lT=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="point",t.shapeType="point",t.generatePoints=!0,t}return e.prototype.getDrawCfg=function(t){var i=r.prototype.getDrawCfg.call(this,t);return g.__assign(g.__assign({},i),{isStack:!!this.getAdjust("stack")})},e}($r);function uT(r){for(var e=r[0],t=1,i=[["M",e.x,e.y]];t2?"weight":"normal",a;if(r.isInCircle){var o={x:0,y:1};return n==="normal"?a=dT(i[0],i[1],o):(t.fill=t.stroke,a=gT(i,o)),a=this.parsePath(a),e.addShape("path",{attrs:g.__assign(g.__assign({},t),{path:a})})}else{if(n==="normal")return i=this.parsePoints(i),a=Rp((i[1].x+i[0].x)/2,i[0].y,Math.abs(i[1].x-i[0].x)/2,Math.PI,Math.PI*2),e.addShape("path",{attrs:g.__assign(g.__assign({},t),{path:a})});var s=wu(i[1],i[3]),l=wu(i[2],i[0]);return a=[["M",i[0].x,i[0].y],["L",i[1].x,i[1].y],s,["L",i[3].x,i[3].y],["L",i[2].x,i[2].y],l,["Z"]],a=this.parsePath(a),t.fill=t.stroke,e.addShape("path",{attrs:g.__assign(g.__assign({},t),{path:a})})}},getMarker:function(r){return{symbol:"circle",style:{r:4.5,fill:r.color}}}});function pT(r,e){var t=wu(r,e),i=[["M",r.x,r.y]];return i.push(t),i}lt("edge","smooth",{draw:function(r,e){var t=Ft(r,!0,!1,"lineWidth"),i=r.points,n=this.parsePath(pT(i[0],i[1]));return e.addShape("path",{attrs:g.__assign(g.__assign({},t),{path:n})})},getMarker:function(r){return{symbol:"circle",style:{r:4.5,fill:r.color}}}});var Za=1/3;function yT(r,e){var t=[];t.push({x:r.x,y:r.y*(1-Za)+e.y*Za}),t.push({x:e.x,y:r.y*(1-Za)+e.y*Za}),t.push(e);var i=[["M",r.x,r.y]];return S(t,function(n){i.push(["L",n.x,n.y])}),i}lt("edge","vhv",{draw:function(r,e){var t=Ft(r,!0,!1,"lineWidth"),i=r.points,n=this.parsePath(yT(i[0],i[1]));return e.addShape("path",{attrs:g.__assign(g.__assign({},t),{path:n})})},getMarker:function(r){return{symbol:"circle",style:{r:4.5,fill:r.color}}}});lt("interval","funnel",{getPoints:function(r){return r.size=r.size*2,Ic(r)},draw:function(r,e){var t=Ft(r,!1,!0),i=this.parsePath(Zy(r.points,r.nextPoints,!1)),n=e.addShape("path",{attrs:g.__assign(g.__assign({},t),{path:i}),name:"interval"});return n},getMarker:function(r){var e=r.color;return{symbol:"square",style:{r:4,fill:e}}}});lt("interval","hollow-rect",{draw:function(r,e){var t=Ft(r,!0,!1),i=e,n=r==null?void 0:r.background;if(n){i=e.addGroup();var a=My(r),o=jy(r,this.parsePoints(r.points),this.coordinate);i.addShape("path",{attrs:g.__assign(g.__assign({},a),{path:o}),capture:!1,zIndex:-1,name:wc})}var s=this.parsePath(Pc(r.points)),l=i.addShape("path",{attrs:g.__assign(g.__assign({},t),{path:s}),name:"interval"});return n?i:l},getMarker:function(r){var e=r.color,t=r.isInPolar;return t?{symbol:"circle",style:{r:4.5,stroke:e,fill:null}}:{symbol:"square",style:{r:4,stroke:e,fill:null}}}});function mT(r){var e=r.x,t=r.y,i=r.y0;return O(t)?t.map(function(n,a){return{x:O(e)?e[a]:e,y:n}}):[{x:e,y:i},{x:e,y:t}]}lt("interval","line",{getPoints:function(r){return mT(r)},draw:function(r,e){var t=Ft(r,!0,!1,"lineWidth"),i=re(g.__assign({},t),["fill"]),n=this.parsePath(Pc(r.points,!1)),a=e.addShape("path",{attrs:g.__assign(g.__assign({},i),{path:n}),name:"interval"});return a},getMarker:function(r){var e=r.color;return{symbol:function(t,i,n){return[["M",t,i-n],["L",t,i+n]]},style:{r:5,stroke:e}}}});lt("interval","pyramid",{getPoints:function(r){return r.size=r.size*2,Ic(r)},draw:function(r,e){var t=Ft(r,!1,!0),i=this.parsePath(Zy(r.points,r.nextPoints,!0)),n=e.addShape("path",{attrs:g.__assign(g.__assign({},t),{path:i}),name:"interval"});return n},getMarker:function(r){var e=r.color;return{symbol:"square",style:{r:4,fill:e}}}});function xT(r){var e,t=r.x,i=r.y,n=r.y0,a=r.size,o,s;O(i)?(e=g.__read(i,2),o=e[0],s=e[1]):(o=n,s=i);var l=t+a/2,u=t-a/2;return[{x:t,y:o},{x:t,y:s},{x:u,y:o},{x:l,y:o},{x:u,y:s},{x:l,y:s}]}function wT(r){return[["M",r[0].x,r[0].y],["L",r[1].x,r[1].y],["M",r[2].x,r[2].y],["L",r[3].x,r[3].y],["M",r[4].x,r[4].y],["L",r[5].x,r[5].y]]}lt("interval","tick",{getPoints:function(r){return xT(r)},draw:function(r,e){var t=Ft(r,!0,!1),i=this.parsePath(wT(r.points)),n=e.addShape("path",{attrs:g.__assign(g.__assign({},t),{path:i}),name:"interval"});return n},getMarker:function(r){var e=r.color;return{symbol:function(t,i,n){return[["M",t-n/2,i-n],["L",t+n/2,i-n],["M",t,i-n],["L",t,i+n],["M",t-n/2,i+n],["L",t+n/2,i+n]]},style:{r:5,stroke:e}}}});var _T=function(r,e,t){var i=r.x,n=r.y,a=e.x,o=e.y,s;switch(t){case"hv":s=[{x:a,y:n}];break;case"vh":s=[{x:i,y:o}];break;case"hvh":var l=(a+i)/2;s=[{x:l,y:n},{x:l,y:o}];break;case"vhv":var u=(n+o)/2;s=[{x:i,y:u},{x:a,y:u}];break}return s};function bT(r,e){var t=[];return S(r,function(i,n){var a=r[n+1];if(t.push(i),a){var o=_T(i,a,e);t=t.concat(o)}}),t}function ST(r){return r.map(function(e,t){return t===0?["M",e.x,e.y]:["L",e.x,e.y]})}function CT(r,e){var t=Ls(r.points,r.connectNulls,r.showSinglePoint),i=[];return S(t,function(n){var a=bT(n,e);i=i.concat(ST(a))}),g.__assign(g.__assign({},Ft(r,!0,!1,"lineWidth")),{path:i})}S(["hv","vh","hvh","vhv"],function(r){lt("line",r,{draw:function(e,t){var i=CT(e,r),n=t.addShape({type:"path",attrs:i,name:"line"});return n},getMarker:function(e){return Ay(e,r)}})});S(sT,function(r){lt("point",r,{draw:function(e,t){return Bc(this,e,t,r,!0)},getMarker:function(e){var t=e.color;return{symbol:gi[r],style:{r:4.5,stroke:t,fill:null}}}})});lt("point","image",{draw:function(r,e){var t,i,n=Ft(r,!1,!1,"r").r,a=this.parsePoints(r.points),o=a[0];if(r.isStack)o=a[1];else if(a.length>1){var s=e.addGroup();try{for(var l=g.__values(a),u=l.next();!u.done;u=l.next()){var c=u.value;s.addShape("image",{attrs:{x:c.x-n/2,y:c.y-n,width:n,height:n,img:r.shape[1]}})}}catch(h){t={error:h}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(t)throw t.error}}return s}return e.addShape("image",{attrs:{x:o.x-n/2,y:o.y-n,width:n,height:n,img:r.shape[1]}})},getMarker:function(r){var e=r.color;return{symbol:"circle",style:{r:4.5,fill:e}}}});S(Qy,function(r){lt("point",r,{draw:function(e,t){return Bc(this,e,t,r,!1)},getMarker:function(e){var t=e.color;return{symbol:gi[r]||r,style:{r:4.5,fill:t}}}})});function Av(r){var e=O(r)?r:[r],t=e[0],i=e[e.length-1],n=e.length>1?e[1]:t,a=e.length>3?e[3]:i,o=e.length>2?e[2]:n;return{min:t,max:i,min1:n,max1:a,median:o}}function Fv(r,e,t){var i=t/2,n;if(O(e)){var a=Av(e),o=a.min,s=a.max,l=a.median,u=a.min1,c=a.max1,h=r-i,f=r+i;n=[[h,s],[f,s],[r,s],[r,c],[h,u],[h,c],[f,c],[f,u],[r,u],[r,o],[h,o],[f,o],[h,l],[f,l]]}else{e=D(e)?.5:e;var v=Av(r),o=v.min,s=v.max,l=v.median,u=v.min1,c=v.max1,d=e-i,p=e+i;n=[[o,d],[o,p],[o,e],[u,e],[u,d],[u,p],[c,p],[c,d],[c,e],[s,e],[s,d],[s,p],[l,d],[l,p]]}return n.map(function(y){return{x:y[0],y:y[1]}})}function MT(r){return[["M",r[0].x,r[0].y],["L",r[1].x,r[1].y],["M",r[2].x,r[2].y],["L",r[3].x,r[3].y],["M",r[4].x,r[4].y],["L",r[5].x,r[5].y],["L",r[6].x,r[6].y],["L",r[7].x,r[7].y],["L",r[4].x,r[4].y],["Z"],["M",r[8].x,r[8].y],["L",r[9].x,r[9].y],["M",r[10].x,r[10].y],["L",r[11].x,r[11].y],["M",r[12].x,r[12].y],["L",r[13].x,r[13].y]]}lt("schema","box",{getPoints:function(r){var e=r.x,t=r.y,i=r.size;return Fv(e,t,i)},draw:function(r,e){var t=Ft(r,!0,!1),i=this.parsePath(MT(r.points)),n=e.addShape("path",{attrs:g.__assign(g.__assign({},t),{path:i,name:"schema"})});return n},getMarker:function(r){var e=r.color;return{symbol:function(t,i,n){var a=[i-6,i-3,i,i+3,i+6],o=Fv(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:e}}}});function AT(r){var e=O(r)?r:[r],t=e.sort(function(i,n){return n-i});return xC(t,4,t[t.length-1])}function Tv(r,e,t){var i=AT(e);return[{x:r,y:i[0]},{x:r,y:i[1]},{x:r-t/2,y:i[2]},{x:r-t/2,y:i[1]},{x:r+t/2,y:i[1]},{x:r+t/2,y:i[2]},{x:r,y:i[2]},{x:r,y:i[3]}]}function FT(r){return[["M",r[0].x,r[0].y],["L",r[1].x,r[1].y],["M",r[2].x,r[2].y],["L",r[3].x,r[3].y],["L",r[4].x,r[4].y],["L",r[5].x,r[5].y],["Z"],["M",r[6].x,r[6].y],["L",r[7].x,r[7].y]]}lt("schema","candle",{getPoints:function(r){var e=r.x,t=r.y,i=r.size;return Tv(e,t,i)},draw:function(r,e){var t=Ft(r,!0,!0),i=this.parsePath(FT(r.points)),n=e.addShape("path",{attrs:g.__assign(g.__assign({},t),{path:i,name:"schema"})});return n},getMarker:function(r){var e=r.color;return{symbol:function(t,i,n){var a=[i+7.5,i+3,i-3,i-7.5],o=Tv(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:e,fill:e,r:6}}}});function TT(r,e){var t=Math.abs(r[0].x-r[2].x),i=Math.abs(r[0].y-r[2].y),n=Math.min(t,i);e&&(n=mt(e,0,Math.min(t,i))),n=n/2;var a=(r[0].x+r[2].x)/2,o=(r[0].y+r[2].y)/2;return{x:a-n,y:o-n,width:n*2,height:n*2}}lt("polygon","square",{draw:function(r,e){if(!oe(r.points)){var t=Ft(r,!0,!0),i=this.parsePoints(r.points);return e.addShape("rect",{attrs:g.__assign(g.__assign({},t),TT(i,r.size)),name:"polygon"})}},getMarker:function(r){var e=r.color;return{symbol:"square",style:{r:4,fill:e}}}});lt("violin","smooth",{draw:function(r,e){var t=Ft(r,!0,!0),i=this.parsePath(Cy(r.points));return e.addShape("path",{attrs:g.__assign(g.__assign({},t),{path:i})})},getMarker:function(r){var e=r.color;return{symbol:"circle",style:{stroke:null,r:4,fill:e}}}});lt("violin","hollow",{draw:function(r,e){var t=Ft(r,!0,!1),i=this.parsePath(Sy(r.points));return e.addShape("path",{attrs:g.__assign(g.__assign({},t),{path:i})})},getMarker:function(r){var e=r.color;return{symbol:"circle",style:{r:4,fill:null,stroke:e}}}});lt("violin","hollow-smooth",{draw:function(r,e){var t=Ft(r,!0,!1),i=this.parsePath(Cy(r.points));return e.addShape("path",{attrs:g.__assign(g.__assign({},t),{path:i})})},getMarker:function(r){var e=r.color;return{symbol:"circle",style:{r:4,fill:null,stroke:e}}}});var ET=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getLabelValueDir=function(t){var i="y",n=t.points;return n[0][i]<=n[2][i]?1:-1},e.prototype.getLabelOffsetPoint=function(t,i,n,a){var o,s=r.prototype.getLabelOffsetPoint.call(this,t,i,n),l=this.getCoordinate(),u=l.isTransposed,c=u?"x":"y",h=this.getLabelValueDir(t.mappingData);return s=g.__assign(g.__assign({},s),(o={},o[c]=s[c]*h,o)),l.isReflect("x")&&(s=g.__assign(g.__assign({},s),{x:s.x*-1})),l.isReflect("y")&&(s=g.__assign(g.__assign({},s),{y:s.y*-1})),s},e.prototype.getThemedLabelCfg=function(t){var i=this.geometry,n=this.getDefaultLabelCfg(),a=i.theme;return Y({},n,a.labels,t.position==="middle"?{offset:0}:{},t)},e.prototype.setLabelPosition=function(t,i,n,a){var o=this.getCoordinate(),s=o.isTransposed,l=i.points,u=o.convert(l[0]),c=o.convert(l[2]),h=this.getLabelValueDir(i),f,v,d,p,y=O(i.shape)?i.shape[0]:i.shape;if(y==="funnel"||y==="pyramid"){var m=M(i,"nextPoints"),x=M(i,"points");if(m){var _=o.convert(x[0]),w=o.convert(x[1]),b=o.convert(m[0]),C=o.convert(m[1]);s?(f=Math.min(b.y,_.y),d=Math.max(b.y,_.y),v=(w.x+C.x)/2,p=(_.x+b.x)/2):(f=Math.min((w.y+C.y)/2,(_.y+b.y)/2),d=Math.max((w.y+C.y)/2,(_.y+b.y)/2),v=C.x,p=_.x)}else f=Math.min(c.y,u.y),d=Math.max(c.y,u.y),v=c.x,p=u.x}else f=Math.min(c.y,u.y),d=Math.max(c.y,u.y),v=c.x,p=u.x;switch(a){case"right":t.x=v,t.y=(f+d)/2,t.textAlign=M(t,"textAlign",h>0?"left":"right");break;case"left":t.x=p,t.y=(f+d)/2,t.textAlign=M(t,"textAlign",h>0?"left":"right");break;case"bottom":s&&(t.x=(v+p)/2),t.y=d,t.textAlign=M(t,"textAlign","center"),t.textBaseline=M(t,"textBaseline",h>0?"bottom":"top");break;case"middle":s&&(t.x=(v+p)/2),t.y=(f+d)/2,t.textAlign=M(t,"textAlign","center"),t.textBaseline=M(t,"textBaseline","middle");break;case"top":s&&(t.x=(v+p)/2),t.y=f,t.textAlign=M(t,"textAlign","center"),t.textBaseline=M(t,"textBaseline",h>0?"bottom":"top");break}},e}(ks),Qa=Math.PI/2,Ky=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getLabelOffset=function(t){var i=this.getCoordinate(),n=0;if(tt(t))n=t;else if(K(t)&&t.indexOf("%")!==-1){var a=i.getRadius();i.innerRadius>0&&(a=a*(1-i.innerRadius)),n=parseFloat(t)*.01*a}return n},e.prototype.getLabelItems=function(t){var i=r.prototype.getLabelItems.call(this,t),n=this.geometry.getYScale();return xt(i,function(a){if(a&&n){var o=n.scale(M(a.data,n.field));return g.__assign(g.__assign({},a),{percent:o})}return a})},e.prototype.getLabelAlign=function(t){var i=this.getCoordinate(),n;if(t.labelEmit)n=t.angle<=Math.PI/2&&t.angle>=-Math.PI/2?"left":"right";else if(!i.isTransposed)n="center";else{var a=i.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},e.prototype.getLabelPoint=function(t,i,n){var a=1,o,s=t.content[n];this.isToMiddle(i)?o=this.getMiddlePoint(i.points):(t.content.length===1&&n===0?n=1:n===0&&(a=-1),o=this.getArcPoint(i,n));var l=t.offset*a,u=this.getPointAngle(o),c=t.labelEmit,h=this.getCirclePoint(u,l,o,c);return h.r===0?h.content="":(h.content=s,h.angle=u,h.color=i.color),h.rotate=t.autoRotate?this.getLabelRotate(u,l,c):t.rotate,h.start={x:o.x,y:o.y},h},e.prototype.getArcPoint=function(t,i){return i===void 0&&(i=0),!O(t.x)&&!O(t.y)?{x:t.x,y:t.y}:{x:O(t.x)?t.x[i]:t.x,y:O(t.y)?t.y[i]:t.y}},e.prototype.getPointAngle=function(t){return Wi(this.getCoordinate(),t)},e.prototype.getCirclePoint=function(t,i,n,a){var o=this.getCoordinate(),s=o.getCenter(),l=Ms(o,n);if(l===0)return g.__assign(g.__assign({},s),{r:l});var u=t;if(o.isTransposed&&l>i&&!a){var c=Math.asin(i/(2*l));u=t+c*2}else l=l+i;return{x:s.x+l*Math.cos(u),y:s.y+l*Math.sin(u),r:l}},e.prototype.getLabelRotate=function(t,i,n){var a=t+Qa;return n&&(a-=Qa),a&&(a>Qa?a=a-Math.PI:a<-Qa&&(a=a+Math.PI)),a},e.prototype.getMiddlePoint=function(t){var i=this.getCoordinate(),n=t.length,a={x:0,y:0};return S(t,function(o){a.x+=o.x,a.y+=o.y}),a.x/=n,a.y/=n,a=i.convert(a),a},e.prototype.isToMiddle=function(t){return t.x.length>2},e}(ks),kT=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.defaultLayout="distribute",t}return e.prototype.getDefaultLabelCfg=function(t,i){var n=r.prototype.getDefaultLabelCfg.call(this,t,i);return Y({},n,M(this.geometry.theme,"pieLabels",{}))},e.prototype.getLabelOffset=function(t){return r.prototype.getLabelOffset.call(this,t)||0},e.prototype.getLabelRotate=function(t,i,n){var a;return i<0&&(a=t,a>Math.PI/2&&(a=a-Math.PI),a<-Math.PI/2&&(a=a+Math.PI)),a},e.prototype.getLabelAlign=function(t){var i=this.getCoordinate(),n=i.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},e.prototype.getArcPoint=function(t){return t},e.prototype.getPointAngle=function(t){var i=this.getCoordinate(),n={x:O(t.x)?t.x[0]:t.x,y:t.y[0]},a={x:O(t.x)?t.x[1]:t.x,y:t.y[1]},o,s=Wi(i,n);if(t.points&&t.points[0].y===t.points[1].y)o=s;else{var l=Wi(i,a);s>=l&&(l=l+Math.PI*2),o=s+(l-s)/2}return o},e.prototype.getCirclePoint=function(t,i){var n=this.getCoordinate(),a=n.getCenter(),o=n.getRadius()+i;return g.__assign(g.__assign({},Tt(a.x,a.y,o,t)),{angle:t,r:o})},e}(Ky),Ev=4;function LT(r,e,t,i,n,a){var o,s,l=!0,u=i.start,c=i.end,h=Math.min(u.y,c.y),f=Math.abs(u.y-c.y),v,d=0,p=Number.MIN_VALUE,y=e.map(function(A){return A.y>d&&(d=A.y),A.yf&&(f=d-h);l;)for(y.forEach(function(A){var F=(Math.min.apply(p,A.targets)+Math.max.apply(p,A.targets))/2;A.pos=Math.min(Math.max(p,F-A.size/2),f-A.size)}),l=!1,v=y.length;v--;)if(v>0){var m=y[v-1],x=y[v];m.pos+m.size>x.pos&&(m.size+=x.size,m.targets=m.targets.concat(x.targets),m.pos+m.size>f&&(m.pos=f-m.size),y.splice(v,1),l=!0)}v=0,y.forEach(function(A){var F=h+t/2;A.targets.forEach(function(){e[v].y=A.pos+F,F+=t,v++})});var _={};try{for(var w=g.__values(r),b=w.next();!b.done;b=w.next()){var C=b.value;_[C.get("id")]=C}}catch(A){o={error:A}}finally{try{b&&!b.done&&(s=w.return)&&s.call(w)}finally{if(o)throw o.error}}e.forEach(function(A){var F=A.r*A.r,E=Math.pow(Math.abs(A.y-n.y),2);if(F0){var l=14,u=o+n,c=u*2+l*2,h={start:a.start,end:a.end},f=[[],[]];r.forEach(function(v){v&&(v.textAlign==="right"?f[0].push(v):f[1].push(v))}),f.forEach(function(v,d){var p=c/l;v.length>p&&(v.sort(function(y,m){return m["..percent"]-y["..percent"]}),v.splice(p,v.length-p)),v.sort(function(y,m){return y.y-m.y}),LT(e,v,l,h,s,d)})}S(r,function(v){if(v&&v.labelLine){var d=v.offset,p=v.angle,y=Tt(s.x,s.y,o,p),m=Tt(s.x,s.y,o+d/2,p),x=v.x+M(v,"offsetX",0),_=v.y+M(v,"offsetY",0),w={x:x-Math.cos(p)*Ev,y:_-Math.sin(p)*Ev};pt(v.labelLine)||(v.labelLine={}),v.labelLine.path=["M ".concat(y.x),"".concat(y.y," Q").concat(m.x),"".concat(m.y," ").concat(w.x),w.y].join(",")}})}}function Jy(r,e,t){var i=r.filter(function(d){return!d.invisible});i.sort(function(d,p){return d.y-p.y});var n=!0,a=t.minY,o=t.maxY,s=Math.abs(a-o),l,u=0,c=Number.MIN_VALUE,h=i.map(function(d){return d.y>u&&(u=d.y),d.ys&&(s=u-a);n;)for(h.forEach(function(d){var p=(Math.min.apply(c,d.targets)+Math.max.apply(c,d.targets))/2;d.pos=Math.min(Math.max(c,p-d.size/2),s-d.size),d.pos=Math.max(0,d.pos)}),n=!1,l=h.length;l--;)if(l>0){var f=h[l-1],v=h[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),h.splice(l,1),n=!0)}l=0,h.forEach(function(d){var p=a+e/2;d.targets.forEach(function(){i[l].y=d.pos+p,p+=e,l++})})}var kv=4;function PT(r,e){var t=e.getCenter(),i=e.getRadius();if(r&&r.labelLine){var n=r.angle,a=r.offset,o=Tt(t.x,t.y,i,n),s=r.x+M(r,"offsetX",0)*(Math.cos(n)>0?1:-1),l=r.y+M(r,"offsetY",0)*(Math.sin(n)>0?1:-1),u={x:s-Math.cos(n)*kv,y:l-Math.sin(n)*kv},c=r.labelLine.smooth,h=[],f=u.x-t.x,v=u.y-t.y,d=Math.atan(v/f);if(f<0&&(d+=Math.PI),c===!1){pt(r.labelLine)||(r.labelLine={});var p=0;(n<0&&n>-Math.PI/2||n>Math.PI*1.5)&&u.y>o.y&&(p=1),n>=0&&no.y&&(p=1),n>=Math.PI/2&&nu.y&&(p=1),(n<-Math.PI/2||n>=Math.PI&&nu.y&&(p=1);var y=a/2>4?4:Math.max(a/2-1,0),m=Tt(t.x,t.y,i+y,n),x=Tt(t.x,t.y,i+a/2,d),_=0;h.push("M ".concat(o.x," ").concat(o.y)),h.push("L ".concat(m.x," ").concat(m.y)),h.push("A ".concat(t.x," ").concat(t.y," 0 ").concat(_," ").concat(p," ").concat(x.x," ").concat(x.y)),h.push("L ".concat(u.x," ").concat(u.y))}else{var m=Tt(t.x,t.y,i+(a/2>4?4:Math.max(a/2-1,0)),n),w=o.xMath.pow(Math.E,-16)&&h.push.apply(h,["C",u.x+w*4,u.y,2*m.x-o.x,2*m.y-o.y,o.x,o.y]),h.push("L ".concat(o.x," ").concat(o.y))}r.labelLine.path=h.join(" ")}}function DT(r,e,t,i){var n,a,o=Xt(r,function(F){return!D(F)}),s=e[0]&&e[0].get("coordinate");if(s){var l=s.getCenter(),u=s.getRadius(),c={};try{for(var h=g.__values(e),f=h.next();!f.done;f=h.next()){var v=f.value;c[v.get("id")]=v}}catch(F){n={error:F}}finally{try{f&&!f.done&&(a=h.return)&&a.call(h)}finally{if(n)throw n.error}}var d=M(o[0],"labelHeight",14),p=M(o[0],"offset",0);if(!(p<=0)){var y="left",m="right",x=be(o,function(F){return F.xT&&(F.sort(function(k,P){return P.percent-k.percent}),S(F,function(k,P){P+1>T&&(c[k.id].set("visible",!1),k.invisible=!0)})),Jy(F,d,A)}),S(x,function(F,E){S(F,function(T){var k=E===m,P=c[T.id],B=P.getChildByIndex(0);if(B){var z=u+p,X=T.y-l.y,I=Math.pow(z,2),R=Math.pow(X,2),$=I-R>0?I-R:0,G=Math.sqrt($),V=Math.abs(Math.cos(T.angle)*z);k?T.x=l.x+Math.max(G,V):T.x=l.x-Math.max(G,V)}B&&(B.attr("y",T.y),B.attr("x",T.x)),PT(T,s)})})}}}var bu=4,BT=4,Lv=4;function OT(r,e,t){var i=e.getCenter(),n=e.getRadius(),a={x:r.x-(t?Lv:-Lv),y:r.y},o=Tt(i.x,i.y,n+bu,r.angle),s={x:a.x,y:a.y},l={x:o.x,y:o.y},u=Tt(i.x,i.y,n,r.angle),c="";if(a.y!==o.y){var h=t?4:-4;s.y=a.y,r.angle<0&&r.angle>=-Math.PI/2&&(s.x=Math.max(o.x,a.x-h),a.y0&&r.angleo.y?l.y=s.y:(l.y=o.y,l.x=Math.max(l.x,s.x-h))),r.angle>Math.PI/2&&(s.x=Math.min(o.x,a.x-h),a.y>o.y?l.y=s.y:(l.y=o.y,l.x=Math.min(l.x,s.x-h))),r.angle<-Math.PI/2&&(s.x=Math.min(o.x,a.x-h),a.ys.x||F.x===s.x&&F.y>s.y,k=D(F.offsetX)?BT:F.offsetX,P=Tt(s.x,s.y,l+bu,F.angle),B=d+k;F.x=s.x+(T?1:-1)*(l+B),F.y=P.y}}});var p=o.start,y=o.end,m="left",x="right",_=be(r,function(F){return F.xw&&(w=Math.min(E,Math.abs(p.y-y.y)))});var b={minX:p.x,maxX:y.x,minY:s.y-w/2,maxY:s.y+w/2};S(_,function(F,E){var T=w/v;F.length>T&&(F.sort(function(k,P){return P.percent-k.percent}),S(F,function(k,P){P>T&&(u[k.id].set("visible",!1),k.invisible=!0)})),Jy(F,v,b)});var C=b.minY,A=b.maxY;S(_,function(F,E){var T=E===x;S(F,function(k){var P=M(u,k&&[k.id]);if(P){if(k.yA){P.set("visible",!1);return}var B=P.getChildByIndex(0),z=B.getCanvasBBox(),X={x:T?z.x:z.maxX,y:z.y+z.height/2};Ca(B,k.x-X.x,k.y-X.y),k.labelLine&&OT(k,o,T)}})})}}function NT(r,e,t,i){S(e,function(n){var a=i.minX,o=i.minY,s=i.maxX,l=i.maxY,u=n.getCanvasBBox(),c=u.minX,h=u.minY,f=u.maxX,v=u.maxY,d=u.x,p=u.y,y=u.width,m=u.height,x=d,_=p;(cs?x=s-y:f>s&&(x=x-(f-s)),h>l?_=l-m:v>l&&(_=_-(v-l)),(x!==d||_!==p)&&Ca(n,x-d,_-p)})}function zT(r,e,t,i){S(e,function(n,a){var o=n.getCanvasBBox(),s=t[a].getBBox();(o.minXs.maxX||o.maxY>s.maxY)&&n.remove(!0)})}var VT=100,tm=function(){function r(e){e===void 0&&(e={}),this.bitmap={};var t=e.xGap,i=t===void 0?1:t,n=e.yGap,a=n===void 0?8:n;this.xGap=i,this.yGap=a}return r.prototype.hasGap=function(e){for(var t=!0,i=this.bitmap,n=Math.round(e.minX),a=Math.round(e.maxX),o=Math.round(e.minY),s=Math.round(e.maxY),l=n;l<=a;l+=1){if(!i[l]){i[l]={};continue}if(l===n||l===a){for(var u=o;u<=s;u++)if(i[l][u]){t=!1;break}}else if(i[l][o]||i[l][s]){t=!1;break}}return t},r.prototype.fillGap=function(e){for(var t=this.bitmap,i=Math.round(e.minX),n=Math.round(e.maxX),a=Math.round(e.minY),o=Math.round(e.maxY),s=i;s<=n;s+=1)t[s]||(t[s]={});for(var s=i;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[i][s]=!0,t[n][s]=!0;if(this.xGap!==1)for(var s=i;s<=n;s+=1)t[s][a]=!0,t[s][o]=!0},r.prototype.destroy=function(){this.bitmap={}},r}();function GT(r,e,t){t===void 0&&(t=VT);var i=-1,n=r.attr(),a=n.x,o=n.y,s=r.getCanvasBBox(),l=Math.sqrt(s.width*s.width+s.height*s.height),u,c=-i,h=0,f=0,v=function(m){var x=m*.1;return[x*Math.cos(x),x*Math.sin(x)]};if(e.hasGap(s))return e.fillGap(s),!0;for(var d=!1,p=0,y={};Math.min(Math.abs(h),Math.abs(f))4)return[];var e=function(n,a){return[a.x-n.x,a.y-n.y]},t=e(r[0],r[1]),i=e(r[1],r[2]);return[t,i]}function Ka(r,e,t){e===void 0&&(e=0),t===void 0&&(t={x:0,y:0});var i=r.x,n=r.y;return{x:(i-t.x)*Math.cos(-e)+(n-t.y)*Math.sin(-e)+t.x,y:(t.x-i)*Math.sin(-e)+(n-t.y)*Math.cos(-e)+t.y}}function Pv(r){var e=[{x:r.x,y:r.y},{x:r.x+r.width,y:r.y},{x:r.x+r.width,y:r.y+r.height},{x:r.x,y:r.y+r.height}],t=r.rotation;return t?[Ka(e[0],t,e[0]),Ka(e[1],t,e[0]),Ka(e[2],t,e[0]),Ka(e[3],t,e[0])]:e}function Dv(r,e){if(r.length>4)return{min:0,max:0};var t=[];return r.forEach(function(i){t.push(XT([i.x,i.y],e))}),{min:Math.min.apply(Math,g.__spreadArray([],g.__read(t),!1)),max:Math.max.apply(Math,g.__spreadArray([],g.__read(t),!1))}}function WT(r,e){return r.max>e.min&&r.minr.x+r.width+t||e.x+e.widthr.y+r.height+t||e.y+e.height"u")){var e;try{e=new Blob([r.toString()],{type:"application/javascript"})}catch{e=new window.BlobBuilder,e.append(r.toString()),e=e.getBlob()}return new ZT(URL.createObjectURL(e))}}var KT=function(r){function e(){function u(_,w){return(_[0]||0)*(w[0]||0)+(_[1]||0)*(w[1]||0)+(_[2]||0)*(w[2]||0)}function c(_){if(_.length>4)return[];var w=function(A,F){return[F.x-A.x,F.y-A.y]},b=w(_[0],_[1]),C=w(_[1],_[2]);return[b,C]}function h(_,w,b){w===void 0&&(w=0),b===void 0&&(b={x:0,y:0});var C=_.x,A=_.y;return{x:(C-b.x)*Math.cos(-w)+(A-b.y)*Math.sin(-w)+b.x,y:(b.x-C)*Math.sin(-w)+(A-b.y)*Math.cos(-w)+b.y}}function f(_){var w=[{x:_.x,y:_.y},{x:_.x+_.width,y:_.y},{x:_.x+_.width,y:_.y+_.height},{x:_.x,y:_.y+_.height}],b=_.rotation;return b?[h(w[0],b,w[0]),h(w[1],b,w[0]),h(w[2],b,w[0]),h(w[3],b,w[0])]:w}function v(_,w){if(_.length>4)return{min:0,max:0};var b=[];return _.forEach(function(C){b.push(u([C.x,C.y],w))}),{min:Math.min.apply(null,b),max:Math.max.apply(null,b)}}function d(_,w){return _.max>w.min&&_.min_.x+_.width+b||w.x+w.width<_.x-b||w.y>_.y+_.height+b||w.y+w.height<_.y-b)}function x(_,w,b){if(b===void 0&&(b=0),!y(_)||!y(w))return!1;if(!_.rotation&&!w.rotation)return m(_,w,b);for(var C=f(_),A=f(w),F=c(C).concat(c(A)),E=0;E=a.height:o.width>=a.width}function n2(r,e,t){var i=!!r.getAdjust("stack");return i||e.every(function(n,a){var o=t[a];return i2(r,n,o)})}function a2(r,e,t){var i=r.coordinate,n=Qt.fromObject(t.getBBox()),a=Or(e);i.isTransposed?a.attr({x:n.minX+n.width/2,textAlign:"center"}):a.attr({y:n.minY+n.height/2,textBaseline:"middle"})}function o2(r,e,t){var i;if(t.length!==0){var n=(i=t[0])===null||i===void 0?void 0:i.get("element"),a=n==null?void 0:n.geometry;if(!(!a||a.type!=="interval")){var o=n2(a,e,t);o&&t.forEach(function(s,l){var u=e[l];a2(a,u,s)})}}}function s2(r){var e=500,t=[],i=Math.max(Math.floor(r.length/e),1);return S(r,function(n,a){a%i===0?t.push(n):n.set("visible",!1)}),t}function l2(r,e,t){var i;if(t.length!==0){var n=(i=t[0])===null||i===void 0?void 0:i.get("element"),a=n==null?void 0:n.geometry;if(!(!a||a.type!=="interval")){var o=s2(e),s=g.__read(a.getXYFields(),1),l=s[0],u=[],c=[],h=be(o,function(y){return y.get("data")[l]}),f=hi(xt(o,function(y){return y.get("data")[l]})),v;o.forEach(function(y){y.set("visible",!0)});var d=function(y){y&&(y.length&&c.push(y.pop()),c.push.apply(c,g.__spreadArray([],g.__read(y),!1)))};for(Bt(f)>0&&(v=f.shift(),d(h[v])),Bt(f)>0&&(v=f.pop(),d(h[v])),S(f.reverse(),function(y){d(h[y])});c.length>0;){var p=c.shift();p.get("visible")&&(HM(p,u)?p.set("visible",!1):u.push(p))}}}}function u2(r,e){var t=r.getXYFields()[1],i=[],n=e.sort(function(a,o){return a.get("data")[t]-a.get("data")[t]});return n.length>0&&i.push(n.shift()),n.length>0&&i.push(n.pop()),i.push.apply(i,g.__spreadArray([],g.__read(n),!1)),i}function em(r,e,t){return r.some(function(i){return t(i,e)})}function c2(r,e,t){t===void 0&&(t=0);var i=Math.max(0,Math.min(r.x+r.width+t,e.x+e.width+t)-Math.max(r.x-t,e.x-t)),n=Math.max(0,Math.min(r.y+r.height+t,e.y+e.height+t)-Math.max(r.y-t,e.y-t));return i*n}function Nv(r,e){return em(r,e,function(t,i){var n=Or(t),a=Or(i);return c2(n.getCanvasBBox(),a.getCanvasBBox(),2)>0})}function h2(r,e,t,i,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 u=g.__read(l.getXYFields(),2),c=u[0],h=u[1],f=be(e,function(p){return p.get("data")[c]}),v=[],d=n&&n.offset||((o=r[0])===null||o===void 0?void 0:o.offset)||12;xt(pa(f).reverse(),function(p){for(var y=u2(l,f[p]);y.length;){var m=y.shift(),x=Or(m);if(em(v,m,function(b,C){return b.get("data")[c]===C.get("data")[c]&&b.get("data")[h]===C.get("data")[h]})){x.set("visible",!1);continue}var _=Nv(v,m),w=!1;if(_&&(x.attr("y",x.attr("y")+2*d),w=Nv(v,m)),w){x.set("visible",!1);continue}v.push(m)}})}}}function f2(r,e){var t=r.getXYFields()[1],i=[],n=e.sort(function(a,o){return a.get("data")[t]-a.get("data")[t]});return n.length>0&&i.push(n.shift()),n.length>0&&i.push(n.pop()),i.push.apply(i,g.__spreadArray([],g.__read(n),!1)),i}function rm(r,e,t){return r.some(function(i){return t(i,e)})}function v2(r,e,t){t===void 0&&(t=0);var i=Math.max(0,Math.min(r.x+r.width+t,e.x+e.width+t)-Math.max(r.x-t,e.x-t)),n=Math.max(0,Math.min(r.y+r.height+t,e.y+e.height+t)-Math.max(r.y-t,e.y-t));return i*n}function zv(r,e){return rm(r,e,function(t,i){var n=Or(t),a=Or(i);return v2(n.getCanvasBBox(),a.getCanvasBBox(),2)>0})}function d2(r,e,t,i,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 u=g.__read(l.getXYFields(),2),c=u[0],h=u[1],f=be(e,function(p){return p.get("data")[c]}),v=[],d=n&&n.offset||((o=r[0])===null||o===void 0?void 0:o.offset)||12;xt(pa(f).reverse(),function(p){for(var y=f2(l,f[p]);y.length;){var m=y.shift(),x=Or(m);if(rm(v,m,function(b,C){return b.get("data")[c]===C.get("data")[c]&&b.get("data")[h]===C.get("data")[h]})){x.set("visible",!1);continue}var _=zv(v,m),w=!1;if(_&&(x.attr("y",x.attr("y")+2*d),w=zv(v,m)),w){x.set("visible",!1);continue}v.push(m)}})}}}var _l;function g2(){return _l||(_l=document.createElement("canvas").getContext("2d")),_l}var Ja=ga(function(r,e){e===void 0&&(e={});var t=e.fontSize,i=e.fontFamily,n=e.fontWeight,a=e.fontStyle,o=e.fontVariant,s=g2();return s.font=[a,o,n,"".concat(t,"px"),i].join(" "),s.measureText(K(r)?r:"").width},function(r,e){return e===void 0&&(e={}),g.__spreadArray([r],g.__read($u(e)),!1).join("")}),p2=function(r,e,t){var i=16,n=Ja("...",t),a;K(r)?a=r:a=ng(r);var o=e,s=[],l,u;if(Ja(r,t)<=e)return r;for(;l=a.substr(0,i),u=Ja(l,t),!(u+n>o&&u>o);)if(s.push(l),o-=u,a=a.substr(i),!a)return s.join("");for(;l=a.substr(0,1),u=Ja(l,t),!(u+n>o);)if(s.push(l),o-=u,a=a.substr(1),!a)return s.join("");return"".concat(s.join(""),"...")};function y2(r,e,t,i,n){if(!(e.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=e[0].get("coordinate");if(l){var u=SC(l,s),c=u.minX,h=u.minY,f=u.maxX,v=u.maxY;S(e,function(d){var p=d.getCanvasBBox(),y=p.minX,m=p.minY,x=p.maxX,_=p.maxY,w=p.x,b=p.y,C=p.width,A=p.height,F=w,E=b;if(a.indexOf("left")>=0&&(y=0&&(m=0&&(y>f?F=f-C:x>f&&(F=F-(x-f))),a.indexOf("bottom")>=0&&(m>v?E=v-A:_>v&&(E=E-(_-v))),F!==w||E!==b){var T=F-w;if(o==="translate")Ca(d,T,E-b);else if(o==="ellipsis"){var k=d.findAll(function(P){return P.get("type")==="text"});k.forEach(function(P){var B=Vu(P.attr(),["fontSize","fontFamily","fontWeight","fontStyle","fontVariant"]),z=P.getCanvasBBox(),X=p2(P.attr("text"),z.width-Math.abs(T),B);P.attr("text",X)})}else d.hide()}})}}}function m2(r,e,t){var i={fillOpacity:D(r.attr("fillOpacity"))?1:r.attr("fillOpacity"),strokeOpacity:D(r.attr("strokeOpacity"))?1:r.attr("strokeOpacity"),opacity:D(r.attr("opacity"))?1:r.attr("opacity")};r.attr({fillOpacity:0,strokeOpacity:0,opacity:0}),r.animate(i,e)}function x2(r,e,t){var i={fillOpacity:0,strokeOpacity:0,opacity:0},n=e.easing,a=e.duration,o=e.delay;r.animate(i,a,n,function(){r.remove(!0)},o)}function w2(r,e,t){var i,n=g.__read(e,2),a=n[0],o=n[1];return r.applyToMatrix([a,o,1]),t==="x"?(r.setMatrix(kt(r.getMatrix(),[["t",-a,-o],["s",.01,1],["t",a,o]])),i=kt(r.getMatrix(),[["t",-a,-o],["s",100,1],["t",a,o]])):t==="y"?(r.setMatrix(kt(r.getMatrix(),[["t",-a,-o],["s",1,.01],["t",a,o]])),i=kt(r.getMatrix(),[["t",-a,-o],["s",1,100],["t",a,o]])):t==="xy"&&(r.setMatrix(kt(r.getMatrix(),[["t",-a,-o],["s",.01,.01],["t",a,o]])),i=kt(r.getMatrix(),[["t",-a,-o],["s",100,100],["t",a,o]])),i}function Oc(r,e,t,i,n){var a=t.start,o=t.end,s=t.getWidth(),l=t.getHeight(),u,c;n==="y"?(u=a.x+s/2,c=i.ya.x?i.x:a.x,c=a.y+l/2):n==="xy"&&(t.isPolar?(u=t.getCenter().x,c=t.getCenter().y):(u=(a.x+o.x)/2,c=(a.y+o.y)/2));var h=w2(r,[u,c],n);r.animate({matrix:h},e)}function _2(r,e,t){var i=t.coordinate,n=t.minYPoint;Oc(r,e,i,n,"x")}function b2(r,e,t){var i=t.coordinate,n=t.minYPoint;Oc(r,e,i,n,"y")}function S2(r,e,t){var i=t.coordinate,n=t.minYPoint;Oc(r,e,i,n,"xy")}function C2(r,e,t){var i=r.getTotalLength();r.attr("lineDash",[i]),r.animate(function(n){return{lineDashOffset:(1-n)*i}},e)}function M2(r,e,t){var i=t.toAttrs,n=i.x,a=i.y;delete i.x,delete i.y,r.attr(i),r.animate({x:n,y:a},e)}function A2(r,e,t){var i=r.getBBox(),n=r.get("origin").mappingData,a=n.points,o=a[0].y-a[1].y>0?i.maxX:i.minX,s=(i.minY+i.maxY)/2;r.applyToMatrix([o,s,1]);var l=kt(r.getMatrix(),[["t",-o,-s],["s",.01,1],["t",o,s]]);r.setMatrix(l),r.animate({matrix:kt(r.getMatrix(),[["t",-o,-s],["s",100,1],["t",o,s]])},e)}function F2(r,e,t){var i=r.getBBox(),n=r.get("origin").mappingData,a=(i.minX+i.maxX)/2,o=n.points,s=o[0].y-o[1].y<=0?i.maxY:i.minY;r.applyToMatrix([a,s,1]);var l=kt(r.getMatrix(),[["t",-a,-s],["s",1,.01],["t",a,s]]);r.setMatrix(l),r.animate({matrix:kt(r.getMatrix(),[["t",-a,-s],["s",1,100],["t",a,s]])},e)}function Vv(r,e){var t,i=zo(r,e),n=i.startAngle,a=i.endAngle;return!zt(n,-Math.PI*.5)&&n<-Math.PI*.5&&(n+=Math.PI*2),!zt(a,-Math.PI*.5)&&a<-Math.PI*.5&&(a+=Math.PI*2),e[5]===0&&(t=g.__read([a,n],2),n=t[0],a=t[1]),zt(n,Math.PI*1.5)&&(n=Math.PI*-.5),zt(a,Math.PI*-.5)&&!zt(n,a)&&(a=Math.PI*1.5),{startAngle:n,endAngle:a}}function Gv(r){var e;return r[0]==="M"||r[0]==="L"?e=[r[1],r[2]]:(r[0]==="a"||r[0]==="A"||r[0]==="C")&&(e=[r[r.length-2],r[r.length-1]]),e}function Yv(r){var e,t,i,n=r.filter(function(_){return _[0]==="A"||_[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=r.indexOf(a),l=r.indexOf(o),u=Gv(r[s-1]),c=Gv(r[l-1]),h=Vv(u,a),f=h.startAngle,v=h.endAngle,d=Vv(c,o),p=d.startAngle,y=d.endAngle;zt(f,p)&&zt(v,y)?(t=f,i=v):(t=Math.min(f,p),i=Math.max(v,y));var m=a[1],x=n[n.length-1][1];return m=0;u--){var c=this.getFacetsByLevel(t,u);try{for(var h=(i=void 0,g.__values(c)),f=h.next();!f.done;f=h.next()){var v=f.value;this.isLeaf(v)||(v.originColIndex=v.columnIndex,v.columnIndex=this.getRegionIndex(v.children),v.columnValuesLength=o.length)}}catch(d){i={error:d}}finally{try{f&&!f.done&&(n=h.return)&&n.call(h)}finally{if(i)throw i.error}}}},e.prototype.getFacetsByLevel=function(t,i){var n=[];return t.forEach(function(a){a.rowIndex===i&&n.push(a)}),n},e.prototype.getRegionIndex=function(t){var i=t[0],n=t[t.length-1];return(n.columnIndex-i.columnIndex)/2+i.columnIndex},e.prototype.isLeaf=function(t){return!t.children||!t.children.length},e.prototype.getRows=function(){return this.cfg.fields.length+1},e.prototype.getChildFacets=function(t,i,n){var a=this,o=this.cfg.fields,s=o.length;if(!(s=v){var y=n.parsePosition([d[l],d[s.field]]);y&&f.push(y)}if(d[l]===h)return!1}),f},e.prototype.parsePercentPosition=function(t){var i=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)},u=a.getWidth()*i+l.x,c=a.getHeight()*n+l.y;return{x:u,y:c}},e.prototype.getCoordinateBBox=function(){var t=this.view.getCoordinate(),i=t.start,n=t.end,a=t.getWidth(),o=t.getHeight(),s={x:Math.min(i.x,n.x),y:Math.min(i.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}},e.prototype.getAnnotationCfg=function(t,i,n){var a=this,o=this.view.getCoordinate(),s=this.view.getCanvas(),l={};if(D(i))return null;var u=i.start,c=i.end,h=i.position,f=this.parsePosition(u),v=this.parsePosition(c),d=this.parsePosition(h);if(["arc","image","line","region","regionFilter"].includes(t)&&(!f||!v))return null;if(["text","dataMarker","html"].includes(t)&&!d)return null;if(t==="arc"){var p=i;p.start,p.end;var y=g.__rest(p,["start","end"]),m=Wi(o,f),x=Wi(o,v);m>x&&(x=Math.PI*2+x),l=g.__assign(g.__assign({},y),{center:o.getCenter(),radius:Ms(o,f),startAngle:m,endAngle:x})}else if(t==="image"){var _=i;_.start,_.end;var y=g.__rest(_,["start","end"]);l=g.__assign(g.__assign({},y),{start:f,end:v,src:i.src})}else if(t==="line"){var w=i;w.start,w.end;var y=g.__rest(w,["start","end"]);l=g.__assign(g.__assign({},y),{start:f,end:v,text:M(i,"text",null)})}else if(t==="region"){var b=i;b.start,b.end;var y=g.__rest(b,["start","end"]);l=g.__assign(g.__assign({},y),{start:f,end:v})}else if(t==="text"){var C=this.view.getData(),A=i;A.position;var F=A.content,y=g.__rest(A,["position","content"]),E=F;W(F)&&(E=F(C)),l=g.__assign(g.__assign(g.__assign({},d),y),{content:E})}else if(t==="dataMarker"){var T=i;T.position;var k=T.point,P=T.line,B=T.text,z=T.autoAdjust,X=T.direction,y=g.__rest(T,["position","point","line","text","autoAdjust","direction"]);l=g.__assign(g.__assign(g.__assign({},y),d),{coordinateBBox:this.getCoordinateBBox(),point:k,line:P,text:B,autoAdjust:z,direction:X})}else if(t==="dataRegion"){var I=i,R=I.start,$=I.end,G=I.region,B=I.text,V=I.lineLength,y=g.__rest(I,["start","end","region","text","lineLength"]);l=g.__assign(g.__assign({},y),{points:this.getRegionPoints(R,$),region:G,text:B,lineLength:V})}else if(t==="regionFilter"){var H=i;H.start,H.end;var Z=H.apply,rt=H.color,y=g.__rest(H,["start","end","apply","color"]),U=this.view.geometries,Q=[],ht=function(Ne){Ne&&(Ne.isGroup()?Ne.getChildren().forEach(function(fn){return ht(fn)}):Q.push(Ne))};S(U,function(Ne){Z?Ei(Z,Ne.type)&&S(Ne.elements,function(fn){ht(fn.shape)}):S(Ne.elements,function(fn){ht(fn.shape)})}),l=g.__assign(g.__assign({},y),{color:rt,shapes:Q,start:f,end:v})}else if(t==="shape"){var _t=i,Ct=_t.render,Yt=g.__rest(_t,["render"]),Qe=function(Cx){if(W(i.render))return Ct(Cx,a.view,{parsePosition:a.parsePosition.bind(a)})};l=g.__assign(g.__assign({},Yt),{render:Qe})}else if(t==="html"){var Ke=i,Je=Ke.html;Ke.position;var Yt=g.__rest(Ke,["html","position"]),Xr=function(Ne){return W(Je)?Je(Ne,a.view):Je};l=g.__assign(g.__assign(g.__assign({},Yt),d),{parent:s.get("el").parentNode,html:Xr})}var gr=Y({},n,g.__assign(g.__assign({},l),{top:i.top,style:i.style,offsetX:i.offsetX,offsetY:i.offsetY}));return t!=="html"&&(gr.container=this.getComponentContainer(gr)),gr.animate=this.view.getOptions().animate&&gr.animate&&M(i,"animate",gr.animate),gr.animateOption=Y({},Ui,gr.animateOption,i.animateOption),gr},e.prototype.isTop=function(t){return M(t,"top",!0)},e.prototype.getComponentContainer=function(t){return this.isTop(t)?this.foregroundContainer:this.backgroundContainer},e.prototype.getAnnotationTheme=function(t){return M(this.view.getTheme(),["components","annotation",t],{})},e.prototype.updateOrCreate=function(t){var i=this.cache.get(this.getCacheKey(t));if(i){var n=t.type,a=this.getAnnotationTheme(n),o=this.getAnnotationCfg(n,t,a);o&&re(o,["container"]),i.component.update(g.__assign(g.__assign({},o||{}),{visible:!!o})),Ei(eo,t.type)&&i.component.render()}else i=this.createAnnotation(t),i&&(i.component.init(),Ei(eo,t.type)&&i.component.render());return i},e.prototype.syncCache=function(t){var i=this,n=new Map(this.cache);return t.forEach(function(a,o){n.set(o,a)}),n.forEach(function(a,o){Le(i.option,function(s){return o===i.getCacheKey(s)})||(a.component.destroy(),n.delete(o))}),n},e.prototype.getCacheKey=function(t){return t},e}(on);function Hv(r,e){var t=Y({},M(r,["components","axis","common"]),M(r,["components","axis",e]));return M(t,["grid"],{})}function ro(r,e,t,i){var n=[],a=e.getTicks();return r.isPolar&&a.push({value:1,text:"",tickValue:""}),a.reduce(function(o,s,l){var u=s.value;if(i)n.push({points:[r.convert(t==="y"?{x:0,y:u}:{x:u,y:0}),r.convert(t==="y"?{x:1,y:u}:{x:u,y:1})]});else if(l){var c=o.value,h=(c+u)/2;n.push({points:[r.convert(t==="y"?{x:0,y:h}:{x:h,y:0}),r.convert(t==="y"?{x:1,y:h}:{x:h,y:1})]})}return s},a[0]),n}function Sl(r,e,t,i,n){var a=e.values.length,o=[],s=t.getTicks();return s.reduce(function(l,u){var c=l?l.value:u.value,h=u.value,f=(c+h)/2;return n==="x"?o.push({points:[r.convert({x:i?h:f,y:0}),r.convert({x:i?h:f,y:1})]}):o.push({points:xt(Array(a+1),function(v,d){return r.convert({x:d/a,y:i?h:f})})}),u},s[0]),o}function Xv(r,e){var t=M(e,"grid");if(t===null)return!1;var i=M(r,"grid");return!(t===void 0&&i===null)}var xr=["container"],Wv=g.__assign(g.__assign({},Ui),{appear:null}),V2=function(r){g.__extends(e,r);function e(t){var i=r.call(this,t)||this;return i.cache=new Map,i.gridContainer=i.view.getLayer(At.BG).addGroup(),i.gridForeContainer=i.view.getLayer(At.FORE).addGroup(),i.axisContainer=i.view.getLayer(At.BG).addGroup(),i.axisForeContainer=i.view.getLayer(At.FORE).addGroup(),i}return Object.defineProperty(e.prototype,"name",{get:function(){return"axis"},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype.render=function(){this.update()},e.prototype.layout=function(){var t=this,i=this.view.getCoordinate();S(this.getComponents(),function(n){var a=n.component,o=n.direction,s=n.type,l=n.extra,u=l.dim,c=l.scale,h=l.alignTick,f;if(s===Dt.AXIS)i.isPolar?u==="x"?f=i.isTransposed?Ya(i,o):dl(i):u==="y"&&(f=i.isTransposed?dl(i):Ya(i,o)):f=Ya(i,o);else if(s===Dt.GRID)if(i.isPolar){var v=void 0;i.isTransposed?v=u==="x"?Sl(i,t.view.getYScales()[0],c,h,u):ro(i,c,u,h):v=u==="x"?ro(i,c,u,h):Sl(i,t.view.getXScale(),c,h,u),f={items:v,center:t.view.getCoordinate().getCenter()}}else f={items:ro(i,c,u,h)};a.update(f)})},e.prototype.update=function(){this.option=this.view.getOptions().axes;var t=new Map;this.updateXAxes(t),this.updateYAxes(t);var i=new Map;this.cache.forEach(function(n,a){t.has(a)?i.set(a,n):n.component.destroy()}),this.cache=i},e.prototype.clear=function(){r.prototype.clear.call(this),this.cache.clear(),this.gridContainer.clear(),this.gridForeContainer.clear(),this.axisContainer.clear(),this.axisForeContainer.clear()},e.prototype.destroy=function(){r.prototype.destroy.call(this),this.gridContainer.remove(!0),this.gridForeContainer.remove(!0),this.axisContainer.remove(!0),this.axisForeContainer.remove(!0)},e.prototype.getComponents=function(){var t=[];return this.cache.forEach(function(i){t.push(i)}),t},e.prototype.updateXAxes=function(t){var i=this.view.getXScale();if(!(!i||i.isIdentity)){var n=Oo(this.option,i.field);if(n!==!1){var a=jf(n,N.BOTTOM),o=At.BG,s="x",l=this.view.getCoordinate(),u=this.getId("axis",i.field),c=this.getId("grid",i.field);if(l.isRect){var h=this.cache.get(u);if(h){var f=this.getLineAxisCfg(i,n,a);re(f,xr),h.component.update(f),t.set(u,h)}else h=this.createLineAxis(i,n,o,a,s),this.cache.set(u,h),t.set(u,h);var v=this.cache.get(c);if(v){var f=this.getLineGridCfg(i,n,a,s);re(f,xr),v.component.update(f),t.set(c,v)}else v=this.createLineGrid(i,n,o,a,s),v&&(this.cache.set(c,v),t.set(c,v))}else if(l.isPolar){var h=this.cache.get(u);if(h){var f=l.isTransposed?this.getLineAxisCfg(i,n,N.RADIUS):this.getCircleAxisCfg(i,n,a);re(f,xr),h.component.update(f),t.set(u,h)}else{if(l.isTransposed){if(Qr(n))return;h=this.createLineAxis(i,n,o,N.RADIUS,s)}else h=this.createCircleAxis(i,n,o,a,s);this.cache.set(u,h),t.set(u,h)}var v=this.cache.get(c);if(v){var f=l.isTransposed?this.getCircleGridCfg(i,n,N.RADIUS,s):this.getLineGridCfg(i,n,N.CIRCLE,s);re(f,xr),v.component.update(f),t.set(c,v)}else{if(l.isTransposed){if(Qr(n))return;v=this.createCircleGrid(i,n,o,N.RADIUS,s)}else v=this.createLineGrid(i,n,o,N.CIRCLE,s);v&&(this.cache.set(c,v),t.set(c,v))}}}}},e.prototype.updateYAxes=function(t){var i=this,n=this.view.getYScales();S(n,function(a,o){if(!(!a||a.isIdentity)){var s=a.field,l=Oo(i.option,s);if(l!==!1){var u=At.BG,c="y",h=i.getId("axis",s),f=i.getId("grid",s),v=i.view.getCoordinate();if(v.isRect){var d=jf(l,o===0?N.LEFT:N.RIGHT),p=i.cache.get(h);if(p){var y=i.getLineAxisCfg(a,l,d);re(y,xr),p.component.update(y),t.set(h,p)}else p=i.createLineAxis(a,l,u,d,c),i.cache.set(h,p),t.set(h,p);var m=i.cache.get(f);if(m){var y=i.getLineGridCfg(a,l,d,c);re(y,xr),m.component.update(y),t.set(f,m)}else m=i.createLineGrid(a,l,u,d,c),m&&(i.cache.set(f,m),t.set(f,m))}else if(v.isPolar){var p=i.cache.get(h);if(p){var y=v.isTransposed?i.getCircleAxisCfg(a,l,N.CIRCLE):i.getLineAxisCfg(a,l,N.RADIUS);re(y,xr),p.component.update(y),t.set(h,p)}else{if(v.isTransposed){if(Qr(l))return;p=i.createCircleAxis(a,l,u,N.CIRCLE,c)}else p=i.createLineAxis(a,l,u,N.RADIUS,c);i.cache.set(h,p),t.set(h,p)}var m=i.cache.get(f);if(m){var y=v.isTransposed?i.getLineGridCfg(a,l,N.CIRCLE,c):i.getCircleGridCfg(a,l,N.RADIUS,c);re(y,xr),m.component.update(y),t.set(f,m)}else{if(v.isTransposed){if(Qr(l))return;m=i.createLineGrid(a,l,u,N.CIRCLE,c)}else m=i.createCircleGrid(a,l,u,N.RADIUS,c);m&&(i.cache.set(f,m),t.set(f,m))}}}}})},e.prototype.createLineAxis=function(t,i,n,a,o){var s={component:new fC(this.getLineAxisCfg(t,i,a)),layer:n,direction:a===N.RADIUS?N.NONE:a,type:Dt.AXIS,extra:{dim:o,scale:t}};return s.component.set("field",t.field),s.component.init(),s},e.prototype.createLineGrid=function(t,i,n,a,o){var s=this.getLineGridCfg(t,i,a,o);if(s){var l={component:new dC(s),layer:n,direction:N.NONE,type:Dt.GRID,extra:{dim:o,scale:t,alignTick:M(s,"alignTick",!0)}};return l.component.init(),l}},e.prototype.createCircleAxis=function(t,i,n,a,o){var s={component:new vC(this.getCircleAxisCfg(t,i,a)),layer:n,direction:a,type:Dt.AXIS,extra:{dim:o,scale:t}};return s.component.set("field",t.field),s.component.init(),s},e.prototype.createCircleGrid=function(t,i,n,a,o){var s=this.getCircleGridCfg(t,i,a,o);if(s){var l={component:new gC(s),layer:n,direction:N.NONE,type:Dt.GRID,extra:{dim:o,scale:t,alignTick:M(s,"alignTick",!0)}};return l.component.init(),l}},e.prototype.getLineAxisCfg=function(t,i,n){var a=M(i,["top"])?this.axisForeContainer:this.axisContainer,o=this.view.getCoordinate(),s=Ya(o,n),l=Zf(t,i),u=$a(this.view.getTheme(),n),c=M(i,["title"])?Y({title:{style:{text:l}}},{title:Uf(this.view.getTheme(),n,i.title)},i):i,h=Y(g.__assign(g.__assign({container:a},s),{ticks:t.getTicks().map(function(_){return{id:"".concat(_.tickValue),name:_.text,value:_.value}}),verticalFactor:o.isPolar?qf(s,o.getCenter())*-1:qf(s,o.getCenter()),theme:u}),u,c),f=this.getAnimateCfg(h),v=f.animate,d=f.animateOption;h.animateOption=d,h.animate=v;var p=Gp(s),y=M(h,"verticalLimitLength",p?1/3:1/2);if(y<=1){var m=this.view.getCanvas().get("width"),x=this.view.getCanvas().get("height");h.verticalLimitLength=y*(p?m:x)}return h},e.prototype.getLineGridCfg=function(t,i,n,a){if(Xv($a(this.view.getTheme(),n),i)){var o=Hv(this.view.getTheme(),n),s=Y({container:M(i,["top"])?this.gridForeContainer:this.gridContainer},o,M(i,"grid"),this.getAnimateCfg(i));return s.items=ro(this.view.getCoordinate(),t,a,M(s,"alignTick",!0)),s}},e.prototype.getCircleAxisCfg=function(t,i,n){var a=M(i,["top"])?this.axisForeContainer:this.axisContainer,o=this.view.getCoordinate(),s=t.getTicks().map(function(p){return{id:"".concat(p.tickValue),name:p.text,value:p.value}});!t.isCategory&&Math.abs(o.endAngle-o.startAngle)===Math.PI*2&&s.length&&(s[s.length-1].name="");var l=Zf(t,i),u=$a(this.view.getTheme(),N.CIRCLE),c=M(i,["title"])?Y({title:{style:{text:l}}},{title:Uf(this.view.getTheme(),n,i.title)},i):i,h=Y(g.__assign(g.__assign({container:a},dl(this.view.getCoordinate())),{ticks:s,verticalFactor:1,theme:u}),u,c),f=this.getAnimateCfg(h),v=f.animate,d=f.animateOption;return h.animate=v,h.animateOption=d,h},e.prototype.getCircleGridCfg=function(t,i,n,a){if(Xv($a(this.view.getTheme(),n),i)){var o=Hv(this.view.getTheme(),N.RADIUS),s=Y({container:M(i,["top"])?this.gridForeContainer:this.gridContainer,center:this.view.getCoordinate().getCenter()},o,M(i,"grid"),this.getAnimateCfg(i)),l=M(s,"alignTick",!0),u=a==="x"?this.view.getYScales()[0]:this.view.getXScale();return s.items=Sl(this.view.getCoordinate(),u,t,l,a),s}},e.prototype.getId=function(t,i){var n=this.view.getCoordinate();return"".concat(t,"-").concat(i,"-").concat(n.type)},e.prototype.getAnimateCfg=function(t){return{animate:this.view.getOptions().animate&&M(t,"animate"),animateOption:t&&t.animateOption?Y({},Wv,t.animateOption):Wv}},e}(on);function Fr(r,e,t){return t===N.TOP?[r.minX+r.width/2-e.width/2,r.minY]:t===N.BOTTOM?[r.minX+r.width/2-e.width/2,r.maxY-e.height]:t===N.LEFT?[r.minX,r.minY+r.height/2-e.height/2]:t===N.RIGHT?[r.maxX-e.width,r.minY+r.height/2-e.height/2]:t===N.TOP_LEFT||t===N.LEFT_TOP?[r.tl.x,r.tl.y]:t===N.TOP_RIGHT||t===N.RIGHT_TOP?[r.tr.x-e.width,r.tr.y]:t===N.BOTTOM_LEFT||t===N.LEFT_BOTTOM?[r.bl.x,r.bl.y-e.height]:t===N.BOTTOM_RIGHT||t===N.RIGHT_BOTTOM?[r.br.x-e.width,r.br.y-e.height]:[0,0]}function qv(r,e){return $i(r)?r===!1?!1:{}:M(r,[e],r)}function io(r){return M(r,"position",N.BOTTOM)}var G2=function(r){g.__extends(e,r);function e(t){var i=r.call(this,t)||this;return i.container=i.view.getLayer(At.FORE).addGroup(),i}return Object.defineProperty(e.prototype,"name",{get:function(){return"legend"},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype.render=function(){this.update()},e.prototype.layout=function(){var t=this;this.layoutBBox=this.view.viewBBox,S(this.components,function(i){var n=i.component,a=i.direction,o=pl(a),s=n.get("maxWidthRatio"),l=n.get("maxHeightRatio"),u=t.getCategoryLegendSizeCfg(o,s,l),c=n.get("maxWidth"),h=n.get("maxHeight");n.update({maxWidth:Math.min(u.maxWidth,c||0),maxHeight:Math.min(u.maxHeight,h||0)});var f=n.get("padding"),v=n.getLayoutBBox(),d=new Qt(v.x,v.y,v.width,v.height).expand(f),p=g.__read(Fr(t.view.viewBBox,d,a),2),y=p[0],m=p[1],x=g.__read(Fr(t.layoutBBox,d,a),2),_=x[0],w=x[1],b=0,C=0;a.startsWith("top")||a.startsWith("bottom")?(b=y,C=w):(b=_,C=m),n.setLocation({x:b+f[3],y:C+f[0]}),t.layoutBBox=t.layoutBBox.cut(d,a)})},e.prototype.update=function(){var t=this;this.option=this.view.getOptions().legends;var i={},n=function(f,v,d){var p=t.getId(d.field),y=t.getComponentById(p);if(y){var m=void 0,x=qv(t.option,d.field);x!==!1&&(M(x,"custom")?m=t.getCategoryCfg(f,v,d,x,!0):d.isLinear?m=t.getContinuousCfg(f,v,d,x):d.isCategory&&(m=t.getCategoryCfg(f,v,d,x))),m&&(re(m,["container"]),y.direction=io(x),y.component.update(m),i[p]=!0)}else{var _=t.createFieldLegend(f,v,d);_&&(_.component.init(),t.components.push(_),i[p]=!0)}};if(M(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);re(s,["container"]),o.component.update(s),i[a]=!0}else{var l=this.createCustomLegend(void 0,void 0,void 0,this.option);if(l){l.init();var u=At.FORE,c=io(this.option);this.components.push({id:a,component:l,layer:u,direction:c,type:Dt.LEGEND,extra:void 0}),i[a]=!0}}}else this.loopLegends(n);var h=[];S(this.getComponents(),function(f){i[f.id]?h.push(f):f.component.destroy()}),this.components=h},e.prototype.clear=function(){r.prototype.clear.call(this),this.container.clear()},e.prototype.destroy=function(){r.prototype.destroy.call(this),this.container.remove(!0)},e.prototype.getGeometries=function(t){var i=this,n=t.geometries;return S(t.views,function(a){n=n.concat(i.getGeometries(a))}),n},e.prototype.loopLegends=function(t){var i=this.view.getRootView()===this.view;if(i){var n=this.getGeometries(this.view),a={};S(n,function(o){var s=o.getGroupAttributes();S(s,function(l){var u=l.getScale(l.type);!u||u.type==="identity"||a[u.field]||(t(o,l,u),a[u.field]=!0)})})}},e.prototype.createFieldLegend=function(t,i,n){var a,o=qv(this.option,n.field),s=At.FORE,l=io(o);if(o!==!1&&(M(o,"custom")?a=this.createCustomLegend(t,i,n,o):n.isLinear?a=this.createContinuousLegend(t,i,n,o):n.isCategory&&(a=this.createCategoryLegend(t,i,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}}},e.prototype.createCustomLegend=function(t,i,n,a){var o=this.getCategoryCfg(t,i,n,a,!0);return new Hf(o)},e.prototype.createContinuousLegend=function(t,i,n,a){var o=this.getContinuousCfg(t,i,n,re(a,["value"]));return new pC(o)},e.prototype.createCategoryLegend=function(t,i,n,a){var o=this.getCategoryCfg(t,i,n,a);return new Hf(o)},e.prototype.getContinuousCfg=function(t,i,n,a){var o=n.getTicks(),s=Le(o,function(p){return p.value===0}),l=Le(o,function(p){return p.value===1}),u=o.map(function(p){var y=p.value,m=p.tickValue,x=i.mapping(n.invert(y)).join("");return{value:m,attrValue:x,color:x,scaleValue:y}});s||u.push({value:n.min,attrValue:i.mapping(n.invert(0)).join(""),color:i.mapping(n.invert(0)).join(""),scaleValue:0}),l||u.push({value:n.max,attrValue:i.mapping(n.invert(1)).join(""),color:i.mapping(n.invert(1)).join(""),scaleValue:1}),u.sort(function(p,y){return p.value-y.value});var c={min:fe(u).value,max:It(u).value,colors:[],rail:{type:i.type},track:{}};i.type==="size"&&(c.track={style:{fill:i.type==="size"?this.view.getTheme().defaultColor:void 0}}),i.type==="color"&&(c.colors=u.map(function(p){return p.attrValue}));var h=this.container,f=io(a),v=pl(f),d=M(a,"title");return d&&(d=Y({text:ra(n)},d)),c.container=h,c.layout=v,c.title=d,c.animateOption=Ui,this.mergeLegendCfg(c,a,"continuous")},e.prototype.getCategoryCfg=function(t,i,n,a,o){var s=this.container,l=M(a,"position",N.BOTTOM),u=fv(this.view.getTheme(),l),c=M(u,["marker"]),h=M(a,"marker"),f=pl(l),v=M(u,["pageNavigator"]),d=M(a,"pageNavigator"),p=o?jM(c,h,a.items):by(this.view,t,i,c,h),y=M(a,"title");y&&(y=Y({text:n?ra(n):""},y));var m=M(a,"maxWidthRatio"),x=M(a,"maxHeightRatio"),_=this.getCategoryLegendSizeCfg(f,m,x);_.container=s,_.layout=f,_.items=p,_.title=y,_.animateOption=Ui,_.pageNavigator=Y({},v,d);var w=this.mergeLegendCfg(_,a,l);w.reversed&&w.items.reverse();var b=M(w,"maxItemWidth");return b&&b<=1&&(w.maxItemWidth=this.view.viewBBox.width*b),w},e.prototype.mergeLegendCfg=function(t,i,n){var a=n.split("-")[0],o=fv(this.view.getTheme(),a);return Y({},o,t,i)},e.prototype.getId=function(t){return"".concat(this.name,"-").concat(t)},e.prototype.getComponentById=function(t){return Le(this.components,function(i){return i.id===t})},e.prototype.getCategoryLegendSizeCfg=function(t,i,n){i===void 0&&(i=Fh),n===void 0&&(n=Fh);var a=this.view.viewBBox,o=a.width,s=a.height;return t==="vertical"?{maxWidth:o*i,maxHeight:s}:{maxWidth:o,maxHeight:s*n}},e}(on),Y2=function(r){g.__extends(e,r);function e(t){var i=r.call(this,t)||this;return i.onChangeFn=Mr,i.resetMeasure=function(){i.clear()},i.onValueChange=function(n){var a=g.__read(n,2),o=a[0],s=a[1];i.start=o,i.end=s,i.changeViewData(o,s)},i.container=i.view.getLayer(At.FORE).addGroup(),i.onChangeFn=Yu(i.onValueChange,20,{leading:!0}),i.width=0,i.view.on(it.BEFORE_CHANGE_DATA,i.resetMeasure),i.view.on(it.BEFORE_CHANGE_SIZE,i.resetMeasure),i}return Object.defineProperty(e.prototype,"name",{get:function(){return"slider"},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){r.prototype.destroy.call(this),this.view.off(it.BEFORE_CHANGE_DATA,this.resetMeasure),this.view.off(it.BEFORE_CHANGE_SIZE,this.resetMeasure)},e.prototype.init=function(){},e.prototype.render=function(){this.option=this.view.getOptions().slider;var t=this.getSliderCfg(),i=t.start,n=t.end;D(this.start)&&(this.start=i,this.end=n);var a=this.view.getOptions().data;this.option&&!oe(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)},e.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 i=this.view.coordinateBBox.width,n=this.slider.component.get("padding"),a=g.__read(n,4),o=a[0];a[1],a[2];var s=a[3],l=this.slider.component.getLayoutBBox(),u=new Qt(l.x,l.y,Math.min(l.width,i),l.height).expand(n),c=this.getMinMaxText(this.start,this.end),h=c.minText,f=c.maxText,v=g.__read(Fr(this.view.viewBBox,u,N.BOTTOM),2);v[0];var d=v[1],p=g.__read(Fr(this.view.coordinateBBox,u,N.BOTTOM),2),y=p[0];p[1],this.slider.component.update(g.__assign(g.__assign({},this.getSliderCfg()),{x:y+s,y:d+o,width:this.width,start:this.start,end:this.end,minText:h,maxText:f})),this.view.viewBBox=this.view.viewBBox.cut(u,N.BOTTOM)}},e.prototype.update=function(){this.render()},e.prototype.createSlider=function(){var t=this.getSliderCfg(),i=new uC(g.__assign({container:this.container},t));return i.init(),{component:i,layer:At.FORE,direction:N.BOTTOM,type:Dt.SLIDER}},e.prototype.updateSlider=function(){var t=this.getSliderCfg();if(this.width){var i=this.getMinMaxText(this.start,this.end),n=i.minText,a=i.maxText;t=g.__assign(g.__assign({},t),{width:this.width,start:this.start,end:this.end,minText:n,maxText:a})}return this.slider.component.update(t),this.slider},e.prototype.measureSlider=function(){var t=this.getSliderCfg().width;this.width=t},e.prototype.getSliderCfg=function(){var t={height:16,start:0,end:1,minText:"",maxText:"",x:0,y:0,width:this.view.coordinateBBox.width};if(pt(this.option)){var i=g.__assign({data:this.getData()},M(this.option,"trendCfg",{}));t=Y({},t,this.getThemeOptions(),this.option),t=g.__assign(g.__assign({},t),{trendCfg:i})}return t.start=mt(Math.min(D(t.start)?0:t.start,D(t.end)?1:t.end),0,1),t.end=mt(Math.max(D(t.start)?0:t.start,D(t.end)?1:t.end),0,1),t},e.prototype.getData=function(){var t=this.view.getOptions().data,i=g.__read(this.view.getYScales(),1),n=i[0],a=this.view.getGroupScales();if(a.length){var o=a[0],s=o.field,l=o.ticks;return t.reduce(function(u,c){return c[s]===l[0]&&u.push(c[n.field]),u},[])}return t.map(function(u){return u[n.field]||0})},e.prototype.getThemeOptions=function(){var t=this.view.getTheme();return M(t,["components","slider","common"],{})},e.prototype.getMinMaxText=function(t,i){var n=this.view.getOptions().data,a=this.view.getXScale(),o=De(n,a.field);a.isLinear&&(o=o.sort());var s=o,l=Bt(n);if(!a||!l)return{};var u=Bt(s),c=Math.round(t*(u-1)),h=Math.round(i*(u-1)),f=M(s,[c]),v=M(s,[h]),d=this.getSliderCfg().formatter;return d&&(f=d(f,n[c],c),v=d(v,n[h],h)),{minText:f,maxText:v}},e.prototype.changeViewData=function(t,i){var n=this.view.getOptions().data,a=this.view.getXScale(),o=Bt(n);if(!(!a||!o)){var s=De(n,a.field),l=this.view.getXScale().isLinear?s.sort(function(v,d){return Number(v)-Number(d)}):s,u=l,c=Bt(u),h=Math.round(t*(c-1)),f=Math.round(i*(c-1));this.view.filter(a.field,function(v,d){var p=u.indexOf(v);return p>-1?Bi(p,h,f):!0}),this.view.render(!0)}},e.prototype.getComponents=function(){return this.slider?[this.slider]:[]},e.prototype.clear=function(){this.slider&&(this.slider.component.destroy(),this.slider=void 0),this.width=0,this.start=void 0,this.end=void 0},e}(on),no=0,Uv=8,$2=32,H2=20,X2=function(r){g.__extends(e,r);function e(t){var i=r.call(this,t)||this;return i.onChangeFn=Mr,i.resetMeasure=function(){i.clear()},i.onValueChange=function(n){var a=n.ratio,o=i.getValidScrollbarCfg().animate;i.ratio=mt(a,0,1);var s=i.view.getOptions().animate;o||i.view.animate(!1),i.changeViewData(i.getScrollRange(),!0),i.view.animate(s)},i.container=i.view.getLayer(At.FORE).addGroup(),i.onChangeFn=Yu(i.onValueChange,20,{leading:!0}),i.trackLen=0,i.thumbLen=0,i.ratio=0,i.view.on(it.BEFORE_CHANGE_DATA,i.resetMeasure),i.view.on(it.BEFORE_CHANGE_SIZE,i.resetMeasure),i}return Object.defineProperty(e.prototype,"name",{get:function(){return"scrollbar"},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){r.prototype.destroy.call(this),this.view.off(it.BEFORE_CHANGE_DATA,this.resetMeasure),this.view.off(it.BEFORE_CHANGE_SIZE,this.resetMeasure)},e.prototype.init=function(){},e.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)},e.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 i=this.view.coordinateBBox.width,n=this.scrollbar.component.get("padding"),a=this.scrollbar.component.getLayoutBBox(),o=new Qt(a.x,a.y,Math.min(a.width,i),a.height).expand(n),s=this.getScrollbarComponentCfg(),l=void 0,u=void 0;if(s.isHorizontal){var c=g.__read(Fr(this.view.viewBBox,o,N.BOTTOM),2);c[0];var h=c[1],f=g.__read(Fr(this.view.coordinateBBox,o,N.BOTTOM),2),v=f[0];f[1],l=v,u=h}else{var d=g.__read(Fr(this.view.viewBBox,o,N.RIGHT),2);d[0];var h=d[1],p=g.__read(Fr(this.view.viewBBox,o,N.RIGHT),2),v=p[0];p[1],l=v,u=h}l+=n[3],u+=n[0],this.trackLen?this.scrollbar.component.update(g.__assign(g.__assign({},s),{x:l,y:u,trackLen:this.trackLen,thumbLen:this.thumbLen,thumbOffset:(this.trackLen-this.thumbLen)*this.ratio})):this.scrollbar.component.update(g.__assign(g.__assign({},s),{x:l,y:u})),this.view.viewBBox=this.view.viewBBox.cut(o,s.isHorizontal?N.BOTTOM:N.RIGHT)}},e.prototype.update=function(){this.render()},e.prototype.getComponents=function(){return this.scrollbar?[this.scrollbar]:[]},e.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=[]},e.prototype.setValue=function(t){this.onValueChange({ratio:t})},e.prototype.getValue=function(){return this.ratio},e.prototype.getThemeOptions=function(){var t=this.view.getTheme();return M(t,["components","scrollbar","common"],{})},e.prototype.getScrollbarTheme=function(t){var i=M(this.view.getTheme(),["components","scrollbar"]),n=t||{},a=n.thumbHighlightColor,o=g.__rest(n,["thumbHighlightColor"]);return{default:Y({},M(i,["default","style"],{}),o),hover:Y({},M(i,["hover","style"],{}),{thumbColor:a})}},e.prototype.measureScrollbar=function(){var t=this.view.getXScale(),i=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=i},e.prototype.getScrollRange=function(){var t=Math.floor((this.cnt-this.step)*mt(this.ratio,0,1)),i=Math.min(t+this.step-1,this.cnt-1);return[t,i]},e.prototype.changeViewData=function(t,i){var n=this,a=g.__read(t,2),o=a[0],s=a[1],l=this.getValidScrollbarCfg().type,u=l!=="vertical",c=De(this.data,this.xScaleCfg.field),h=this.view.getXScale().isLinear?c.sort(function(v,d){return Number(v)-Number(d)}):c,f=u?h:h.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 d=f.indexOf(v);return d>-1?Bi(d,o,s):!0}),this.view.render(!0)},e.prototype.createScrollbar=function(){var t=this.getValidScrollbarCfg().type,i=t!=="vertical",n=new hC(g.__assign(g.__assign({container:this.container},this.getScrollbarComponentCfg()),{x:0,y:0}));return n.init(),{component:n,layer:At.FORE,direction:i?N.BOTTOM:N.RIGHT,type:Dt.SCROLLBAR}},e.prototype.updateScrollbar=function(){var t=this.getScrollbarComponentCfg(),i=this.trackLen?g.__assign(g.__assign({},t),{trackLen:this.trackLen,thumbLen:this.thumbLen,thumbOffset:(this.trackLen-this.thumbLen)*this.ratio}):g.__assign({},t);return this.scrollbar.component.update(i),this.scrollbar},e.prototype.getStep=function(){if(this.step)return this.step;var t=this.view.coordinateBBox,i=this.getValidScrollbarCfg(),n=i.type,a=i.categorySize,o=n!=="vertical";return Math.floor((o?t.width:t.height)/a)},e.prototype.getCnt=function(){if(this.cnt)return this.cnt;var t=this.view.getXScale(),i=this.getScrollbarData(),n=De(i,t.field);return Bt(n)},e.prototype.getScrollbarComponentCfg=function(){var t=this.view,i=t.coordinateBBox,n=t.viewBBox,a=this.getValidScrollbarCfg(),o=a.type,s=a.padding,l=a.width,u=a.height,c=a.style,h=o!=="vertical",f=g.__read(s,4),v=f[0],d=f[1],p=f[2],y=f[3],m=h?{x:i.minX+y,y:n.maxY-u-p}:{x:n.maxX-l-d,y:i.minY+v},x=this.getStep(),_=this.getCnt(),w=h?i.width-y-d:i.height-v-p,b=Math.max(w*mt(x/_,0,1),H2);return g.__assign(g.__assign({},this.getThemeOptions()),{x:m.x,y:m.y,size:h?u:l,isHorizontal:h,trackLen:w,thumbLen:b,thumbOffset:0,theme:this.getScrollbarTheme(c)})},e.prototype.getValidScrollbarCfg=function(){var t={type:"horizontal",categorySize:$2,width:Uv,height:Uv,padding:[0,0,0,0],animate:!0,style:{}};return pt(this.option)&&(t=g.__assign(g.__assign({},t),this.option)),(!pt(this.option)||!this.option.padding)&&(t.padding=t.type==="horizontal"?[no,0,no,0]:[0,no,0,no]),t},e.prototype.getScrollbarData=function(){var t=this.view.getCoordinate(),i=this.getValidScrollbarCfg(),n=this.view.getOptions().data||[];return t.isReflect("y")&&i.type==="vertical"&&(n=g.__spreadArray([],g.__read(n),!1).reverse()),n},e}(on),W2={fill:"#CCD6EC",opacity:.3};function q2(r,e,t){var i,n,a,o,s,l,u=bM(r,e,t);if(u.length){u=ve(u);try{for(var c=g.__values(u),h=c.next();!h.done;h=c.next()){var f=h.value;try{for(var v=(a=void 0,g.__values(f)),d=v.next();!d.done;d=v.next()){var p=d.value,y=p.mappingData,m=y.x,x=y.y;p.x=O(m)?m[m.length-1]:m,p.y=O(x)?x[x.length-1]:x}}catch(T){a={error:T}}finally{try{d&&!d.done&&(o=v.return)&&o.call(v)}finally{if(a)throw a.error}}}}catch(T){i={error:T}}finally{try{h&&!h.done&&(n=c.return)&&n.call(c)}finally{if(i)throw i.error}}var _=t.shared;if(_===!1&&u.length>1){var w=u[0],b=Math.abs(e.y-w[0].y);try{for(var C=g.__values(u),A=C.next();!A.done;A=C.next()){var F=A.value,E=Math.abs(e.y-F[0].y);E<=b&&(w=F,b=E)}}catch(T){s={error:T}}finally{try{A&&!A.done&&(l=C.return)&&l.call(C)}finally{if(s)throw s.error}}u=[w]}return hi(ve(u))}return[]}var U2=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.show=function(t){var i=this.context.view,n=this.context.event,a=i.getController("tooltip").getTooltipCfg(),o=q2(i,{x:n.x,y:n.y},a);if(!Lt(o,this.items)&&(this.items=o,o.length)){var s=i.getXScale().field,l=o[0].data[s],u=[],c=i.geometries;if(S(c,function($){if($.type==="interval"||$.type==="schema"){var G=$.getElementsBy(function(V){var H=V.getData();return H[s]===l});u=u.concat(G)}}),u.length){var h=i.getCoordinate(),f=u[0].shape.getCanvasBBox(),v=u[0].shape.getCanvasBBox(),d=f;S(u,function($){var G=$.shape.getCanvasBBox();h.isTransposed?(G.minYv.maxY&&(v=G)):(G.minXv.maxX&&(v=G)),d.x=Math.min(G.minX,d.minX),d.y=Math.min(G.minY,d.minY),d.width=Math.max(G.maxX,d.maxX)-d.x,d.height=Math.max(G.maxY,d.maxY)-d.y});var p=i.backgroundGroup,y=i.coordinateBBox,m=void 0;if(h.isRect){var x=i.getXScale(),_=t||{},w=_.appendRatio,b=_.appendWidth;D(b)&&(w=D(w)?x.isLinear?0:.25:w,b=h.isTransposed?w*v.height:w*f.width);var C=void 0,A=void 0,F=void 0,E=void 0;h.isTransposed?(C=y.minX,A=Math.min(v.minY,f.minY)-b,F=y.width,E=d.height+b*2):(C=Math.min(f.minX,v.minX)-b,A=y.minY,F=d.width+b*2,E=y.height),m=[["M",C,A],["L",C+F,A],["L",C+F,A+E],["L",C,A+E],["Z"]]}else{var T=fe(u),k=It(u),P=ea(T.getModel(),h).startAngle,B=ea(k.getModel(),h).endAngle,z=h.getCenter(),X=h.getRadius(),I=h.innerRadius*X;m=Lr(z.x,z.y,X,P,B,I)}if(this.regionPath)this.regionPath.attr("path",m),this.regionPath.show();else{var R=M(t,"style",W2);this.regionPath=p.addShape({type:"path",name:"active-region",capture:!1,attrs:g.__assign(g.__assign({},R),{path:m})})}}}},e.prototype.hide=function(){this.regionPath&&this.regionPath.hide(),this.items=null},e.prototype.destroy=function(){this.hide(),this.regionPath&&this.regionPath.remove(!0),r.prototype.destroy.call(this)},e}(yt),im=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.timeStamp=0,t}return e.prototype.show=function(){var t=this.context,i=t.event,n=t.view,a=n.isTooltipLocked();if(!a){var o=this.timeStamp,s=+new Date,l=M(t.view.getOptions(),"tooltip.showDelay",16);if(s-o>l){var u=this.location,c={x:i.x,y:i.y};(!u||!Lt(u,c))&&this.showTooltip(n,c),this.timeStamp=s,this.location=c}}},e.prototype.hide=function(){var t=this.context.view,i=t.getController("tooltip"),n=this.context.event,a=n.clientX,o=n.clientY;i.isCursorEntered({x:a,y:o})||t.isTooltipLocked()||(this.hideTooltip(t),this.location=null)},e.prototype.showTooltip=function(t,i){t.showTooltip(i)},e.prototype.hideTooltip=function(t){t.hideTooltip()},e}(yt),j2=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.showTooltip=function(t,i){var n=Xe(t);S(n,function(a){var o=uu(t,a,i);a.showTooltip(o)})},e.prototype.hideTooltip=function(t){var i=Xe(t);S(i,function(n){n.hideTooltip()})},e}(im),Z2=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.timeStamp=0,t}return e.prototype.destroy=function(){r.prototype.destroy.call(this),this.tooltip&&this.tooltip.destroy()},e.prototype.show=function(){var t=this.context,i=t.event,n=this.timeStamp,a=+new Date;if(a-n>16){var o=this.location,s={x:i.x,y:i.y};(!o||!Lt(o,s))&&this.showTooltip(s),this.timeStamp=a,this.location=s}},e.prototype.hide=function(){this.hideTooltip(),this.location=null},e.prototype.showTooltip=function(t){var i=this.context,n=i.event,a=n.target;if(a&&a.get("tip")){this.tooltip||this.renderTooltip();var o=a.get("tip");this.tooltip.update(g.__assign({title:o},t)),this.tooltip.show()}},e.prototype.hideTooltip=function(){this.tooltip&&this.tooltip.hide()},e.prototype.renderTooltip=function(){var t,i=this.context.view,n=i.canvas,a={start:{x:0,y:0},end:{x:n.get("width"),y:n.get("height")}},o=i.getTheme(),s=M(o,["components","tooltip","domStyles"],{}),l=new Cs({parent:n.get("el").parentNode,region:a,visible:!1,crosshairs:null,domStyles:g.__assign({},Y({},s,(t={},t[hr]={"max-width":"50%"},t[fr]={"word-break":"break-all"},t)))});l.init(),l.setCapture(!1),this.tooltip=l},e}(yt),Nc=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="",t}return e.prototype.hasState=function(t){return t.hasState(this.stateName)},e.prototype.setElementState=function(t,i){t.setState(this.stateName,i)},e.prototype.setState=function(){this.setStateEnable(!0)},e.prototype.clear=function(){var t=this.context.view;this.clearViewState(t)},e.prototype.clearViewState=function(t){var i=this,n=ty(t,this.stateName);S(n,function(a){i.setElementState(a,!1)})},e}(yt);function jv(r){return M(r.get("delegateObject"),"item")}var zc=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.ignoreListItemStates=["unchecked"],t}return e.prototype.isItemIgnore=function(t,i){var n=this.ignoreListItemStates,a=n.filter(function(o){return i.hasState(t,o)});return!!a.length},e.prototype.setStateByComponent=function(t,i,n){var a=this.context.view,o=t.get("field"),s=Gt(a);this.setElementsStateByItem(s,o,i,n)},e.prototype.setStateByElement=function(t,i){this.setElementState(t,i)},e.prototype.isMathItem=function(t,i,n){var a=this.context.view,o=qi(a,i),s=Be(t,i);return!D(s)&&n.name===o.getText(s)},e.prototype.setElementsStateByItem=function(t,i,n,a){var o=this;S(t,function(s){o.isMathItem(s,i,n)&&s.setState(o.stateName,a)})},e.prototype.setStateEnable=function(t){var i=Br(this.context);if(i)Zp(this.context)&&this.setStateByElement(i,t);else{var n=di(this.context);if(ia(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&&jv(s.fromShape)===jv(s.toShape))return;this.setStateByComponent(o,a,t)}}}},e.prototype.toggle=function(){var t=Br(this.context);if(t){var i=t.hasState(this.stateName);this.setElementState(t,!i)}},e.prototype.reset=function(){this.setStateEnable(!1)},e}(Nc),Q2=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="active",t}return e.prototype.active=function(){this.setState()},e}(zc),K2=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.cache={},t}return e.prototype.getColorScale=function(t,i){var n=i.geometry.getAttribute("color");if(!n)return null;var a=t.getScaleByField(n.getFields()[0]);return a},e.prototype.getLinkPath=function(t,i){var n=this.context.view,a=n.getCoordinate().isTransposed,o=t.shape.getCanvasBBox(),s=i.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},e.prototype.addLinkShape=function(t,i,n,a){var o={opacity:.4,fill:i.shape.attr("fill")};t.addShape({type:"path",attrs:g.__assign(g.__assign({},Y({},o,W(a)?a(o,i):a)),{path:this.getLinkPath(i,n)})})},e.prototype.linkByElement=function(t,i){var n=this,a=this.context.view,o=this.getColorScale(a,t);if(o){var s=Be(t,o.field);if(!this.cache[s]){var l=tM(a,o.field,s),u=this.linkGroup,c=u.addGroup();this.cache[s]=c;var h=l.length;S(l,function(f,v){if(v=0},i)},e}(Vc),iE=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="active",t}return e.prototype.highlight=function(){this.setState()},e.prototype.setElementState=function(t,i){var n=this.context.view,a=Gt(n);nm(a,function(o){return t===o},i)},e.prototype.clear=function(){var t=this.context.view;Yc(t)},e}(Gc),nE=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="selected",t}return e.prototype.selected=function(){this.setState()},e}(Vc),aE=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="selected",t}return e.prototype.selected=function(){this.setState()},e}(zc),oE=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="selected",t}return e.prototype.selected=function(){this.setState()},e}(Gc),_i=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="",t.ignoreItemStates=[],t}return e.prototype.getTriggerListInfo=function(){var t=di(this.context),i=null;return ia(t)&&(i={item:t.item,list:t.component}),i},e.prototype.getAllowComponents=function(){var t=this,i=this.context.view,n=ry(i),a=[];return S(n,function(o){o.isList()&&t.allowSetStateByElement(o)&&a.push(o)}),a},e.prototype.hasState=function(t,i){return t.hasState(i,this.stateName)},e.prototype.clearAllComponentsState=function(){var t=this,i=this.getAllowComponents();S(i,function(n){n.clearItemsState(t.stateName)})},e.prototype.allowSetStateByElement=function(t){var i=t.get("field");if(!i)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=qi(a,i);return o&&o.isCategory},e.prototype.allowSetStateByItem=function(t,i){var n=this.ignoreItemStates;if(n.length){var a=n.filter(function(o){return i.hasState(t,o)});return a.length===0}return!0},e.prototype.setStateByElement=function(t,i,n){var a=t.get("field"),o=this.context.view,s=qi(o,a),l=Be(i,a),u=s.getText(l);this.setItemsState(t,u,n)},e.prototype.setStateEnable=function(t){var i=this,n=Br(this.context);if(n){var a=this.getAllowComponents();S(a,function(u){i.setStateByElement(u,n,t)})}else{var o=di(this.context);if(ia(o)){var s=o.item,l=o.component;this.allowSetStateByElement(l)&&this.allowSetStateByItem(s,l)&&this.setItemState(l,s,t)}}},e.prototype.setItemsState=function(t,i,n){var a=this,o=t.getItems();S(o,function(s){s.name===i&&a.setItemState(t,s,n)})},e.prototype.setItemState=function(t,i,n){t.setItemState(i,this.stateName,n)},e.prototype.setState=function(){this.setStateEnable(!0)},e.prototype.reset=function(){this.setStateEnable(!1)},e.prototype.toggle=function(){var t=this.getTriggerListInfo();if(t&&t.item){var i=t.list,n=t.item,a=this.hasState(i,n);this.setItemState(i,n,!a)}},e.prototype.clear=function(){var t=this.getTriggerListInfo();t?t.list.clearItemsState(this.stateName):this.clearAllComponentsState()},e}(yt),sE=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="active",t}return e.prototype.active=function(){this.setState()},e}(_i),Zv="inactive",Qv="active";function lE(r){var e=r.getItems();S(e,function(t){r.hasState(t,Qv)&&r.setItemState(t,Qv,!1),r.hasState(t,Zv)&&r.setItemState(t,Zv,!1)})}var wn="inactive",qr="active",Hc=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName=qr,t.ignoreItemStates=["unchecked"],t}return e.prototype.setItemsState=function(t,i,n){this.setHighlightBy(t,function(a){return a.name===i},n)},e.prototype.setItemState=function(t,i,n){t.getItems(),this.setHighlightBy(t,function(a){return a===i},n)},e.prototype.setHighlightBy=function(t,i,n){var a=t.getItems();if(n)S(a,function(l){i(l)?(t.hasState(l,wn)&&t.setItemState(l,wn,!1),t.setItemState(l,qr,!0)):t.hasState(l,qr)||t.setItemState(l,wn,!0)});else{var o=t.getItemsByState(qr),s=!0;S(o,function(l){if(!i(l))return s=!1,!1}),s?this.clear():S(a,function(l){i(l)&&(t.hasState(l,qr)&&t.setItemState(l,qr,!1),t.setItemState(l,wn,!0))})}},e.prototype.highlight=function(){this.setState()},e.prototype.clear=function(){var t=this.getTriggerListInfo();if(t)lE(t.list);else{var i=this.getAllowComponents();S(i,function(n){n.clearItemsState(qr),n.clearItemsState(wn)})}},e}(_i),uE=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="selected",t}return e.prototype.selected=function(){this.setState()},e}(_i),cE=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="unchecked",t}return e.prototype.unchecked=function(){this.setState()},e}(_i),Fi="unchecked",ao="checked",hE=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName=ao,t}return e.prototype.setItemState=function(t,i,n){this.setCheckedBy(t,function(a){return a===i},n)},e.prototype.setCheckedBy=function(t,i,n){var a=t.getItems();n&&S(a,function(o){i(o)?(t.hasState(o,Fi)&&t.setItemState(o,Fi,!1),t.setItemState(o,ao,!0)):t.hasState(o,ao)||t.setItemState(o,Fi,!0)})},e.prototype.toggle=function(){var t=this.getTriggerListInfo();if(t&&t.item){var i=t.list,n=t.item,a=!Qo(i.getItems(),function(o){return i.hasState(o,Fi)});a||i.hasState(n,Fi)?this.setItemState(i,n,!0):this.reset()}},e.prototype.checked=function(){this.setState()},e.prototype.reset=function(){var t=this.getAllowComponents();S(t,function(i){i.clearItemsState(ao),i.clearItemsState(Fi)})},e}(_i),Ti="unchecked",fE=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.toggle=function(){var t,i,n,a,o,s,l,u,c=this.getTriggerListInfo();if(c!=null&&c.item){var h=c.list,f=c.item,v=h.getItems(),d=v.filter(function(T){return!h.hasState(T,Ti)}),p=v.filter(function(T){return h.hasState(T,Ti)}),y=d[0];if(v.length===d.length)try{for(var m=g.__values(v),x=m.next();!x.done;x=m.next()){var _=x.value;h.setItemState(_,Ti,_.id!==f.id)}}catch(T){t={error:T}}finally{try{x&&!x.done&&(i=m.return)&&i.call(m)}finally{if(t)throw t.error}}else if(v.length-p.length===1)if(y.id===f.id)try{for(var w=g.__values(v),b=w.next();!b.done;b=w.next()){var _=b.value;h.setItemState(_,Ti,!1)}}catch(T){n={error:T}}finally{try{b&&!b.done&&(a=w.return)&&a.call(w)}finally{if(n)throw n.error}}else try{for(var C=g.__values(v),A=C.next();!A.done;A=C.next()){var _=A.value;h.setItemState(_,Ti,_.id!==f.id)}}catch(T){o={error:T}}finally{try{A&&!A.done&&(s=C.return)&&s.call(C)}finally{if(o)throw o.error}}else try{for(var F=g.__values(v),E=F.next();!E.done;E=F.next()){var _=E.value;h.setItemState(_,Ti,_.id!==f.id)}}catch(T){l={error:T}}finally{try{E&&!E.done&&(u=F.return)&&u.call(F)}finally{if(l)throw l.error}}}},e}(_i),Kv="showRadio",Cl="legend-radio-tip",vE=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.timeStamp=0,t}return e.prototype.show=function(){var t=this.getTriggerListInfo();if(t!=null&&t.item){var i=t.list,n=t.item;i.setItemState(n,Kv,!0)}},e.prototype.hide=function(){var t=this.getTriggerListInfo();if(t!=null&&t.item){var i=t.list,n=t.item;i.setItemState(n,Kv,!1)}},e.prototype.destroy=function(){r.prototype.destroy.call(this),this.tooltip&&this.tooltip.destroy()},e.prototype.showTip=function(){var t=this.context,i=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:i.x,y:i.y};this.timeStamp=a,this.location=l,(!s||!Lt(s,l))&&this.showTooltip(l)}},e.prototype.hideTip=function(){this.hideTooltip(),this.location=null},e.prototype.showTooltip=function(t){var i=this.context,n=i.event,a=n.target;if(a&&a.get("tip")){this.tooltip||this.renderTooltip();var o=i.view.getCanvas().get("el").getBoundingClientRect(),s=o.x,l=o.y;this.tooltip.update(g.__assign(g.__assign({title:a.get("tip")},t),{x:t.x+s,y:t.y+l})),this.tooltip.show()}},e.prototype.hideTooltip=function(){this.tooltip&&this.tooltip.hide()},e.prototype.renderTooltip=function(){var t,i=(t={},t[hr]={padding:"6px 8px",transform:"translate(-50%, -80%)",background:"rgba(0,0,0,0.75)",color:"#fff","border-radius":"2px","z-index":100},t[fr]={"font-size":"12px","line-height":"14px","margin-bottom":0,"word-break":"break-all"},t);document.getElementById(Cl)&&document.body.removeChild(document.getElementById(Cl));var n=new Cs({parent:document.body,region:null,visible:!1,crosshairs:null,domStyles:i,containerId:Cl});n.init(),n.setCapture(!1),this.tooltip=n},e}(_i),Xc=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.maskShape=null,t.points=[],t.starting=!1,t.moving=!1,t.preMovePoint=null,t.shapeType="path",t}return e.prototype.getCurrentPoint=function(){var t=this.context.event;return{x:t.x,y:t.y}},e.prototype.emitEvent=function(t){var i="mask:".concat(t),n=this.context.view,a=this.context.event;n.emit(i,{target:this.maskShape,shape:this.maskShape,points:this.points,x:a.x,y:a.y})},e.prototype.createMask=function(){var t=this.context.view,i=this.getMaskAttrs(),n=t.foregroundGroup.addShape({type:this.shapeType,name:"mask",draggable:!0,attrs:g.__assign({fill:"#C5D4EB",opacity:.3},i)});return n},e.prototype.getMaskPath=function(){return[]},e.prototype.show=function(){this.maskShape&&(this.maskShape.show(),this.emitEvent("show"))},e.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")},e.prototype.moveStart=function(){this.moving=!0,this.preMovePoint=this.getCurrentPoint()},e.prototype.move=function(){if(!(!this.moving||!this.maskShape)){var t=this.getCurrentPoint(),i=this.preMovePoint,n=t.x-i.x,a=t.y-i.y,o=this.points;S(o,function(s){s.x+=n,s.y+=a}),this.updateMask(),this.emitEvent("change"),this.preMovePoint=t}},e.prototype.updateMask=function(t){var i=Y({},this.getMaskAttrs(),t);this.maskShape.attr(i)},e.prototype.moveEnd=function(){this.moving=!1,this.preMovePoint=null},e.prototype.end=function(){this.starting=!1,this.emitEvent("end"),this.maskShape&&this.maskShape.set("capture",!0)},e.prototype.hide=function(){this.maskShape&&(this.maskShape.hide(),this.emitEvent("hide"))},e.prototype.resize=function(){this.starting&&this.maskShape&&(this.points.push(this.getCurrentPoint()),this.updateMask(),this.emitEvent("change"))},e.prototype.destroy=function(){this.points=[],this.maskShape&&this.maskShape.remove(),this.maskShape=null,this.preMovePoint=null,r.prototype.destroy.call(this)},e}(yt);function om(r){var e=It(r),t=0,i=0,n=0;if(r.length){var a=r[0];t=pc(a,e)/2,i=(e.x+a.x)/2,n=(e.y+a.y)/2}return{x:i,y:n,r:t}}var dE=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.shapeType="circle",t}return e.prototype.getMaskAttrs=function(){return om(this.points)},e}(Xc);function sm(r){return{start:fe(r),end:It(r)}}function lm(r,e){var t=Math.min(r.x,e.x),i=Math.min(r.y,e.y),n=Math.abs(e.x-r.x),a=Math.abs(e.y-r.y);return{x:t,y:i,width:n,height:a}}var um=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.shapeType="rect",t}return e.prototype.getRegion=function(){return sm(this.points)},e.prototype.getMaskAttrs=function(){var t=this.getRegion(),i=t.start,n=t.end;return lm(i,n)},e}(Xc);function Jv(r){r.x=mt(r.x,0,1),r.y=mt(r.y,0,1)}function cm(r,e,t,i){var n=null,a=null,o=i.invert(fe(r)),s=i.invert(It(r));return t&&(Jv(o),Jv(s)),e==="x"?(n=i.convert({x:o.x,y:0}),a=i.convert({x:s.x,y:1})):(n=i.convert({x:0,y:o.y}),a=i.convert({x:1,y:s.y})),{start:n,end:a}}var hm=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.dim="x",t.inPlot=!0,t}return e.prototype.getRegion=function(){var t=this.context.view.getCoordinate();return cm(this.points,this.dim,this.inPlot,t)},e}(um);function Wc(r){var e=[];return r.length&&(S(r,function(t,i){i===0?e.push(["M",t.x,t.y]):e.push(["L",t.x,t.y])}),e.push(["L",r[0].x,r[0].y])),e}function fm(r){return{path:Wc(r)}}var vm=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getMaskPath=function(){return Wc(this.points)},e.prototype.getMaskAttrs=function(){return fm(this.points)},e.prototype.addPoint=function(){this.resize()},e}(Xc);function qc(r){return rM(r,!0)}function dm(r){return{path:qc(r)}}var gE=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getMaskPath=function(){return qc(this.points)},e.prototype.getMaskAttrs=function(){return dm(this.points)},e}(vm),Uc=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.maskShapes=[],t.starting=!1,t.moving=!1,t.recordPoints=null,t.preMovePoint=null,t.shapeType="path",t.maskType="multi-mask",t}return e.prototype.getCurrentPoint=function(){var t=this.context.event;return{x:t.x,y:t.y}},e.prototype.emitEvent=function(t){var i="".concat(this.maskType,":").concat(t),n=this.context.view,a=this.context.event,o={type:this.shapeType,name:this.maskType,get:function(s){return o.hasOwnProperty(s)?o[s]:void 0}};n.emit(i,{target:o,maskShapes:this.maskShapes,multiPoints:this.recordPoints,x:a.x,y:a.y})},e.prototype.createMask=function(t){var i=this.context.view,n=this.recordPoints[t],a=this.getMaskAttrs(n),o=i.foregroundGroup.addShape({type:this.shapeType,name:"mask",draggable:!0,attrs:g.__assign({fill:"#C5D4EB",opacity:.3},a)});this.maskShapes.push(o)},e.prototype.getMaskPath=function(t){return[]},e.prototype.show=function(){this.maskShapes.length>0&&(this.maskShapes.forEach(function(t){return t.show()}),this.emitEvent("show"))},e.prototype.start=function(t){this.recordPointStart(),this.starting=!0,this.moving=!1;var i=this.recordPoints.length-1;this.createMask(i),this.updateShapesCapture(!1),this.updateMask(t==null?void 0:t.maskStyle),this.emitEvent("start")},e.prototype.moveStart=function(){this.moving=!0,this.preMovePoint=this.getCurrentPoint(),this.updateShapesCapture(!1)},e.prototype.move=function(){if(!(!this.moving||this.maskShapes.length===0)){var t=this.getCurrentPoint(),i=this.preMovePoint,n=t.x-i.x,a=t.y-i.y,o=this.getCurMaskShapeIndex();o>-1&&(this.recordPoints[o].forEach(function(s){s.x+=n,s.y+=a}),this.updateMask(),this.emitEvent("change"),this.preMovePoint=t)}},e.prototype.updateMask=function(t){var i=this;this.recordPoints.forEach(function(n,a){var o=Y({},i.getMaskAttrs(n),t);i.maskShapes[a].attr(o)})},e.prototype.resize=function(){this.starting&&this.maskShapes.length>0&&(this.recordPointContinue(),this.updateMask(),this.emitEvent("change"))},e.prototype.moveEnd=function(){this.moving=!1,this.preMovePoint=null,this.updateShapesCapture(!0)},e.prototype.end=function(){this.starting=!1,this.emitEvent("end"),this.updateShapesCapture(!0)},e.prototype.hide=function(){this.maskShapes.length>0&&(this.maskShapes.forEach(function(t){return t.hide()}),this.emitEvent("hide"))},e.prototype.remove=function(){var t=this.getCurMaskShapeIndex();t>-1&&(this.recordPoints.splice(t,1),this.maskShapes[t].remove(),this.maskShapes.splice(t,1),this.preMovePoint=null,this.updateShapesCapture(!0),this.emitEvent("change"))},e.prototype.clearAll=function(){this.recordPointClear(),this.maskShapes.forEach(function(t){return t.remove()}),this.maskShapes=[],this.preMovePoint=null},e.prototype.clear=function(){var t=this.getCurMaskShapeIndex();t===-1?(this.recordPointClear(),this.maskShapes.forEach(function(i){return i.remove()}),this.maskShapes=[],this.emitEvent("clearAll")):(this.recordPoints.splice(t,1),this.maskShapes[t].remove(),this.maskShapes.splice(t,1),this.preMovePoint=null,this.emitEvent("clearSingle")),this.preMovePoint=null},e.prototype.destroy=function(){this.clear(),r.prototype.destroy.call(this)},e.prototype.getRecordPoints=function(){var t;return g.__spreadArray([],g.__read((t=this.recordPoints)!==null&&t!==void 0?t:[]),!1)},e.prototype.recordPointStart=function(){var t=this.getRecordPoints(),i=this.getCurrentPoint();this.recordPoints=g.__spreadArray(g.__spreadArray([],g.__read(t),!1),[[i]],!1)},e.prototype.recordPointContinue=function(){var t=this.getRecordPoints(),i=this.getCurrentPoint(),n=t.splice(-1,1)[0]||[];n.push(i),this.recordPoints=g.__spreadArray(g.__spreadArray([],g.__read(t),!1),[n],!1)},e.prototype.recordPointClear=function(){this.recordPoints=[]},e.prototype.updateShapesCapture=function(t){this.maskShapes.forEach(function(i){return i.set("capture",t)})},e.prototype.getCurMaskShapeIndex=function(){var t=this.getCurrentPoint();return this.maskShapes.findIndex(function(i){var n=i.attrs,a=n.width,o=n.height,s=n.r,l=a===0||o===0||s===0;return!l&&i.isHit(t.x,t.y)})},e}(yt),gm=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.shapeType="rect",t}return e.prototype.getRegion=function(t){return sm(t)},e.prototype.getMaskAttrs=function(t){var i=this.getRegion(t),n=i.start,a=i.end;return lm(n,a)},e}(Uc),pm=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.dim="x",t.inPlot=!0,t}return e.prototype.getRegion=function(t){var i=this.context.view.getCoordinate();return cm(t,this.dim,this.inPlot,i)},e}(gm),pE=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.shapeType="circle",t.getMaskAttrs=om,t}return e}(Uc),ym=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.getMaskPath=Wc,t.getMaskAttrs=fm,t}return e.prototype.addPoint=function(){this.resize()},e}(Uc),yE=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.getMaskPath=qc,t.getMaskAttrs=dm,t}return e}(ym),mE=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.setCursor=function(t){var i=this.context.view;i.getCanvas().setCursor(t)},e.prototype.default=function(){this.setCursor("default")},e.prototype.pointer=function(){this.setCursor("pointer")},e.prototype.move=function(){this.setCursor("move")},e.prototype.crosshair=function(){this.setCursor("crosshair")},e.prototype.wait=function(){this.setCursor("wait")},e.prototype.help=function(){this.setCursor("help")},e.prototype.text=function(){this.setCursor("text")},e.prototype.eResize=function(){this.setCursor("e-resize")},e.prototype.wResize=function(){this.setCursor("w-resize")},e.prototype.nResize=function(){this.setCursor("n-resize")},e.prototype.sResize=function(){this.setCursor("s-resize")},e.prototype.neResize=function(){this.setCursor("ne-resize")},e.prototype.nwResize=function(){this.setCursor("nw-resize")},e.prototype.seResize=function(){this.setCursor("se-resize")},e.prototype.swResize=function(){this.setCursor("sw-resize")},e.prototype.nsResize=function(){this.setCursor("ns-resize")},e.prototype.ewResize=function(){this.setCursor("ew-resize")},e.prototype.zoomIn=function(){this.setCursor("zoom-in")},e.prototype.zoomOut=function(){this.setCursor("zoom-out")},e}(yt),xE=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.filterView=function(t,i,n){var a=this;t.getScaleByField(i)&&t.filter(i,n),t.views&&t.views.length&&S(t.views,function(o){a.filterView(o,i,n)})},e.prototype.filter=function(){var t=di(this.context);if(t){var i=this.context.view,n=t.component,a=n.get("field");if(ia(t)){if(a){var o=n.getItemsByState("unchecked"),s=qi(i,a),l=o.map(function(v){return v.name});l.length?this.filterView(i,a,function(v){var d=s.getText(v);return!l.includes(d)}):this.filterView(i,a,null),i.render(!0)}}else if(Qp(t)){var u=n.getValue(),c=g.__read(u,2),h=c[0],f=c[1];this.filterView(i,a,function(v){return v>=h&&v<=f}),i.render(!0)}}},e}(yt);function td(r,e,t,i){var n=Math.min(t[e],i[e]),a=Math.max(t[e],i[e]),o=g.__read(r.range,2),s=o[0],l=o[1];if(nl&&(a=l),n===l&&a===l)return null;var u=r.invert(n),c=r.invert(a);if(r.isCategory){var h=r.values.indexOf(u),f=r.values.indexOf(c),v=r.values.slice(h,f+1);return function(d){return v.includes(d)}}else return function(d){return d>=u&&d<=c}}var te;(function(r){r.FILTER="brush-filter-processing",r.RESET="brush-filter-reset",r.BEFORE_FILTER="brush-filter:beforefilter",r.AFTER_FILTER="brush-filter:afterfilter",r.BEFORE_RESET="brush-filter:beforereset",r.AFTER_RESET="brush-filter:afterreset"})(te||(te={}));var Ps=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.dims=["x","y"],t.startPoint=null,t.isStarted=!1,t}return e.prototype.hasDim=function(t){return this.dims.includes(t)},e.prototype.start=function(){var t=this.context;this.isStarted=!0,this.startPoint=t.getCurrentPoint()},e.prototype.filter=function(){var t,i;if(na(this.context)){var n=this.context.event.target,a=n.getCanvasBBox();t={x:a.x,y:a.y},i={x:a.maxX,y:a.maxY}}else{if(!this.isStarted)return;t=this.startPoint,i=this.context.getCurrentPoint()}if(!(Math.abs(t.x-i.x)<5||Math.abs(t.x-i.y)<5)){var o=this.context,s=o.view,l=o.event,u={view:s,event:l,dims:this.dims};s.emit(te.BEFORE_FILTER,bt.fromData(s,te.BEFORE_FILTER,u));var c=s.getCoordinate(),h=c.invert(i),f=c.invert(t);if(this.hasDim("x")){var v=s.getXScale(),d=td(v,"x",h,f);this.filterView(s,v.field,d)}if(this.hasDim("y")){var p=s.getYScales()[0],d=td(p,"y",h,f);this.filterView(s,p.field,d)}this.reRender(s,{source:te.FILTER}),s.emit(te.AFTER_FILTER,bt.fromData(s,te.AFTER_FILTER,u))}},e.prototype.end=function(){this.isStarted=!1},e.prototype.reset=function(){var t=this.context.view;if(t.emit(te.BEFORE_RESET,bt.fromData(t,te.BEFORE_RESET,{})),this.isStarted=!1,this.hasDim("x")){var i=t.getXScale();this.filterView(t,i.field,null)}if(this.hasDim("y")){var n=t.getYScales()[0];this.filterView(t,n.field,null)}this.reRender(t,{source:te.RESET}),t.emit(te.AFTER_RESET,bt.fromData(t,te.AFTER_RESET,{}))},e.prototype.filterView=function(t,i,n){t.filter(i,n)},e.prototype.reRender=function(t,i){t.render(!0,i)},e}(yt),jc=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.filterView=function(t,i,n){var a=Xe(t);S(a,function(o){o.filter(i,n)})},e.prototype.reRender=function(t){var i=Xe(t);S(i,function(n){n.render(!0)})},e}(Ps),wE=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.filter=function(){var t=di(this.context),i=this.context.view,n=Gt(i);if(na(this.context)){var a=gc(this.context,10);a&&S(n,function(p){a.includes(p)?p.show():p.hide()})}else if(t){var o=t.component,s=o.get("field");if(ia(t)){if(s){var l=o.getItemsByState("unchecked"),u=qi(i,s),c=l.map(function(p){return p.name});S(n,function(p){var y=Be(p,s),m=u.getText(y);c.indexOf(m)>=0?p.hide():p.show()})}}else if(Qp(t)){var h=o.getValue(),f=g.__read(h,2),v=f[0],d=f[1];S(n,function(p){var y=Be(p,s);y>=v&&y<=d?p.show():p.hide()})}}},e.prototype.clear=function(){var t=Gt(this.context.view);S(t,function(i){i.show()})},e.prototype.reset=function(){this.clear()},e}(yt),mm=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.byRecord=!1,t}return e.prototype.filter=function(){na(this.context)&&(this.byRecord?this.filterByRecord():this.filterByBBox())},e.prototype.filterByRecord=function(){var t=this.context.view,i=gc(this.context,10);if(i){var n=t.getXScale().field,a=t.getYScales()[0].field,o=i.map(function(l){return l.getModel().data}),s=Xe(t);S(s,function(l){var u=Gt(l);S(u,function(c){var h=c.getModel().data;iy(o,h,n,a)?c.show():c.hide()})})}},e.prototype.filterByBBox=function(){var t=this,i=this.context.view,n=Xe(i);S(n,function(a){var o=Kp(t.context,a,10),s=Gt(a);o&&S(s,function(l){o.includes(l)?l.show():l.hide()})})},e.prototype.reset=function(){var t=Xe(this.context.view);S(t,function(i){var n=Gt(i);S(n,function(a){a.show()})})},e}(yt),_E=10,bE=5,SE=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.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 e.prototype.getButtonCfg=function(){return Y(this.buttonCfg,this.cfg)},e.prototype.drawButton=function(){var t=this.getButtonCfg(),i=this.context.view.foregroundGroup.addGroup({name:t.name}),n=i.addShape({type:"text",name:"button-text",attrs:g.__assign({text:t.text},t.textStyle)}),a=n.getBBox(),o=mc(t.padding),s=i.addShape({type:"rect",name:"button-rect",attrs:g.__assign({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(),i.on("mouseenter",function(){s.attr(t.activeStyle)}),i.on("mouseleave",function(){s.attr(t.style)}),this.buttonGroup=i},e.prototype.resetPosition=function(){var t=this.context.view,i=t.getCoordinate(),n=i.convert({x:1,y:1}),a=this.buttonGroup,o=a.getBBox(),s=kt(null,[["t",n.x-o.width-_E,n.y+o.height+bE]]);a.setMatrix(s)},e.prototype.show=function(){this.buttonGroup||this.drawButton(),this.resetPosition(),this.buttonGroup.show()},e.prototype.hide=function(){this.buttonGroup&&this.buttonGroup.hide()},e.prototype.destroy=function(){var t=this.buttonGroup;t&&t.remove(),r.prototype.destroy.call(this)},e}(yt),CE=4,ME=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.starting=!1,t.dragStart=!1,t}return e.prototype.start=function(){this.starting=!0,this.startPoint=this.context.getCurrentPoint()},e.prototype.drag=function(){if(this.startPoint){var t=this.context.getCurrentPoint(),i=this.context.view,n=this.context.event;this.dragStart?i.emit("drag",{target:n.target,x:n.x,y:n.y}):pc(t,this.startPoint)>CE&&(i.emit("dragstart",{target:n.target,x:n.x,y:n.y}),this.dragStart=!0)}},e.prototype.end=function(){if(this.dragStart){var t=this.context.view,i=this.context.event;t.emit("dragend",{target:i.target,x:i.x,y:i.y})}this.starting=!1,this.dragStart=!1},e}(yt),AE=5,FE=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.starting=!1,t.isMoving=!1,t.startPoint=null,t.startMatrix=null,t}return e.prototype.start=function(){this.starting=!0,this.startPoint=this.context.getCurrentPoint(),this.startMatrix=this.context.view.middleGroup.getMatrix()},e.prototype.move=function(){if(this.starting){var t=this.startPoint,i=this.context.getCurrentPoint(),n=pc(t,i);if(n>AE&&!this.isMoving&&(this.isMoving=!0),this.isMoving){var a=this.context.view,o=kt(this.startMatrix,[["t",i.x-t.x,i.y-t.y]]);a.backgroundGroup.setMatrix(o),a.foregroundGroup.setMatrix(o),a.middleGroup.setMatrix(o)}}},e.prototype.end=function(){this.isMoving&&(this.isMoving=!1),this.startMatrix=null,this.starting=!1,this.startPoint=null},e.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},e}(yt),ed="x",rd="y",xm=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.dims=[ed,rd],t.cfgFields=["dims"],t.cacheScaleDefs={},t}return e.prototype.hasDim=function(t){return this.dims.includes(t)},e.prototype.getScale=function(t){var i=this.context.view;return t==="x"?i.getXScale():i.getYScales()[0]},e.prototype.resetDim=function(t){var i=this.context.view;if(this.hasDim(t)&&this.cacheScaleDefs[t]){var n=this.getScale(t);i.scale(n.field,this.cacheScaleDefs[t]),this.cacheScaleDefs[t]=null}},e.prototype.reset=function(){this.resetDim(ed),this.resetDim(rd);var t=this.context.view;t.render(!0)},e}(yt),TE=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.startPoint=null,t.starting=!1,t.startCache={},t}return e.prototype.start=function(){var t=this;this.startPoint=this.context.getCurrentPoint(),this.starting=!0;var i=this.dims;S(i,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}})},e.prototype.end=function(){this.startPoint=null,this.starting=!1,this.startCache={}},e.prototype.translate=function(){var t=this;if(this.starting){var i=this.startPoint,n=this.context.view.getCoordinate(),a=this.context.getCurrentPoint(),o=n.invert(i),s=n.invert(a),l=s.x-o.x,u=s.y-o.y,c=this.context.view,h=this.dims;S(h,function(f){t.translateDim(f,{x:l*-1,y:u*-1})}),c.render(!0)}},e.prototype.translateDim=function(t,i){if(this.hasDim(t)){var n=this.getScale(t);n.isLinear&&this.translateLinear(t,n,i)}},e.prototype.translateLinear=function(t,i,n){var a=this.context.view,o=this.startCache[t],s=o.min,l=o.max,u=l-s,c=n[t]*u;this.cacheScaleDefs[t]||(this.cacheScaleDefs[t]={nice:i.nice,min:s,max:l}),a.scale(i.field,{nice:!1,min:s+c,max:l+c})},e.prototype.reset=function(){r.prototype.reset.call(this),this.startPoint=null,this.starting=!1},e}(xm),EE=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.zoomRatio=.05,t}return e.prototype.zoomIn=function(){this.zoom(this.zoomRatio)},e.prototype.zoom=function(t){var i=this,n=this.dims;S(n,function(a){i.zoomDim(a,t)}),this.context.view.render(!0)},e.prototype.zoomOut=function(){this.zoom(-1*this.zoomRatio)},e.prototype.zoomDim=function(t,i){if(this.hasDim(t)){var n=this.getScale(t);n.isLinear&&this.zoomLinear(t,n,i)}},e.prototype.zoomLinear=function(t,i,n){var a=this.context.view;this.cacheScaleDefs[t]||(this.cacheScaleDefs[t]={nice:i.nice,min:i.min,max:i.max});var o=this.cacheScaleDefs[t],s=o.max-o.min,l=i.min,u=i.max,c=n*s,h=l-c,f=u+c,v=f-h,d=v/s;f>h&&d<100&&d>.01&&a.scale(i.field,{nice:!1,min:l-c,max:u+c})},e}(xm);function kE(r){var e=r.gEvent.originalEvent;return e.deltaY>0}var LE=1,IE=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.scroll=function(t){var i=this.context,n=i.view,a=i.event;if(n.getOptions().scrollbar){var o=(t==null?void 0:t.wheelDelta)||LE,s=n.getController("scrollbar"),l=n.getXScale(),u=n.getOptions().data,c=Bt(De(u,l.field)),h=Bt(l.values),f=s.getValue(),v=Math.floor((c-h)*f),d=v+(kE(a)?o:-o),p=o/(c-h)/1e4,y=mt(d/(c-h)+p,0,1);s.setValue(y)}},e}(yt),PE="aixs-description-tooltip",DE=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.show=function(){var t=this.context,i=di(t).axis,n=i.cfg.title,a=n.description,o=n.text,s=n.descriptionTooltipStyle,l=t.event,u=l.x,c=l.y;this.tooltip||this.renderTooltip(),this.tooltip.update({title:o||"",customContent:function(){return`
    字段说明:`).concat(a,`
    `)},x:u,y:c}),this.tooltip.show()},e.prototype.destroy=function(){r.prototype.destroy.call(this),this.tooltip&&this.tooltip.destroy()},e.prototype.hide=function(){this.tooltip&&this.tooltip.hide()},e.prototype.renderTooltip=function(){var t,i=this.context.view,n=i.canvas,a={start:{x:0,y:0},end:{x:n.get("width"),y:n.get("height")}},o=new Cs({parent:n.get("el").parentNode,region:a,visible:!1,containerId:PE,domStyles:g.__assign({},Y({},(t={},t[hr]={"max-width":"50%",padding:"10px","line-height":"15px","font-size":"12px",color:"rgba(0, 0, 0, .65)"},t[fr]={"word-break":"break-all","margin-bottom":"3px"},t)))});o.init(),o.setCapture(!1),this.tooltip=o},e}(yt);gM("dark",ay(rA));lg("canvas",aF);lg("svg",ZF);Ze("Polygon",cT);Ze("Interval",aT);Ze("Schema",hT);Ze("Path",Lc);Ze("Point",lT);Ze("Line",oT);Ze("Area",KF);Ze("Edge",JF);Ze("Heatmap",tT);Ze("Violin",vT);Sa("base",ks);Sa("interval",ET);Sa("pie",kT);Sa("polar",Ky);le("overlap",HT);le("distribute",IT);le("fixed-overlap",$T);le("hide-overlap",t2);le("limit-in-shape",zT);le("limit-in-canvas",NT);le("limit-in-plot",y2);le("pie-outer",DT);le("adjust-color",r2);le("interval-adjust-position",o2);le("interval-hide-overlap",l2);le("point-adjust-position",h2);le("pie-spider",RT);le("path-adjust-position",d2);de("fade-in",m2);de("fade-out",x2);de("grow-in-x",_2);de("grow-in-xy",S2);de("grow-in-y",b2);de("scale-in-x",A2);de("scale-in-y",F2);de("wave-in",E2);de("zoom-in",k2);de("zoom-out",L2);de("position-update",M2);de("sector-path-update",T2);de("path-in",C2);an("rect",O2);an("mirror",B2);an("list",P2);an("matrix",D2);an("circle",I2);an("tree",R2);wi("axis",V2);wi("legend",G2);wi("tooltip",cy);wi("annotation",z2);wi("slider",Y2);wi("scrollbar",X2);q("tooltip",im);q("sibling-tooltip",j2);q("ellipsis-text",Z2);q("element-active",Q2);q("element-single-active",tE);q("element-range-active",J2);q("element-highlight",$c);q("element-highlight-by-x",rE);q("element-highlight-by-color",eE);q("element-single-highlight",iE);q("element-range-highlight",am);q("element-sibling-highlight",am,{effectSiblings:!0,effectByRecord:!0});q("element-selected",aE);q("element-single-selected",oE);q("element-range-selected",nE);q("element-link-by-color",K2);q("active-region",U2);q("list-active",sE);q("list-selected",uE);q("list-highlight",Hc);q("list-unchecked",cE);q("list-checked",hE);q("list-focus",fE);q("list-radio",vE);q("legend-item-highlight",Hc,{componentNames:["legend"]});q("axis-label-highlight",Hc,{componentNames:["axis"]});q("axis-description",DE);q("rect-mask",um);q("x-rect-mask",hm,{dim:"x"});q("y-rect-mask",hm,{dim:"y"});q("circle-mask",dE);q("path-mask",vm);q("smooth-path-mask",gE);q("rect-multi-mask",gm);q("x-rect-multi-mask",pm,{dim:"x"});q("y-rect-multi-mask",pm,{dim:"y"});q("circle-multi-mask",pE);q("path-multi-mask",ym);q("smooth-path-multi-mask",yE);q("cursor",mE);q("data-filter",xE);q("brush",Ps);q("brush-x",Ps,{dims:["x"]});q("brush-y",Ps,{dims:["y"]});q("sibling-filter",jc);q("sibling-x-filter",jc,{dims:"x"});q("sibling-y-filter",jc,{dims:"y"});q("element-filter",wE);q("element-sibling-filter",mm);q("element-sibling-filter-record",mm,{byRecord:!0});q("view-drag",ME);q("view-move",FE);q("scale-translate",TE);q("scale-zoom",EE);q("reset-button",SE,{name:"reset-button",text:"reset"});q("mousewheel-scroll",IE);function sr(r){return r.isInPlot()}J("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"}]});J("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"}]});J("element-active",{start:[{trigger:"element:mouseenter",action:"element-active:active"}],end:[{trigger:"element:mouseleave",action:"element-active:reset"}]});J("element-selected",{start:[{trigger:"element:click",action:"element-selected:toggle"}]});J("element-highlight",{start:[{trigger:"element:mouseenter",action:"element-highlight:highlight"}],end:[{trigger:"element:mouseleave",action:"element-highlight:reset"}]});J("element-highlight-by-x",{start:[{trigger:"element:mouseenter",action:"element-highlight-by-x:highlight"}],end:[{trigger:"element:mouseleave",action:"element-highlight-by-x:reset"}]});J("element-highlight-by-color",{start:[{trigger:"element:mouseenter",action:"element-highlight-by-color:highlight"}],end:[{trigger:"element:mouseleave",action:"element-highlight-by-color:reset"}]});J("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"]}]});J("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"]}]});J("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"]}]});J("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"]}]});J("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(r){return!r.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(r){return!r.isInPlot()},action:["element-range-highlight:clear","rect-mask:end","rect-mask:hide"]}],rollback:[{trigger:"dblclick",action:["element-range-highlight:clear","rect-mask:hide"]}]});J("brush",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:sr,action:["brush:start","rect-mask:start","rect-mask:show"]}],processing:[{trigger:"mousemove",isEnable:sr,action:["rect-mask:resize"]}],end:[{trigger:"mouseup",isEnable:sr,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"]}]});J("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"]}]});J("brush-x",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:sr,action:["brush-x:start","x-rect-mask:start","x-rect-mask:show"]}],processing:[{trigger:"mousemove",isEnable:sr,action:["x-rect-mask:resize"]}],end:[{trigger:"mouseup",isEnable:sr,action:["brush-x:filter","brush-x:end","x-rect-mask:end","x-rect-mask:hide"]}],rollback:[{trigger:"dblclick",action:["brush-x:reset"]}]});J("element-path-highlight",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:sr,action:"path-mask:start"},{trigger:"mousedown",isEnable:sr,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"}]});J("brush-x-multi",{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:"mousedown",isEnable:sr,action:["x-rect-multi-mask:start","x-rect-multi-mask:show"]},{trigger:"mask:dragstart",action:["x-rect-multi-mask:moveStart"]}],processing:[{trigger:"mousemove",isEnable:function(r){return!Fs(r)},action:["x-rect-multi-mask:resize"]},{trigger:"multi-mask:change",action:"element-range-highlight:highlight"},{trigger:"mask:drag",action:["x-rect-multi-mask:move"]}],end:[{trigger:"mouseup",action:["x-rect-multi-mask:end"]},{trigger:"mask:dragend",action:["x-rect-multi-mask:moveEnd"]}],rollback:[{trigger:"dblclick",action:["x-rect-multi-mask:clear","cursor:crosshair"]},{trigger:"multi-mask:clearAll",action:["element-range-highlight:clear"]},{trigger:"multi-mask:clearSingle",action:["element-range-highlight:highlight"]}]});J("element-single-selected",{start:[{trigger:"element:click",action:"element-single-selected:toggle"}]});J("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(r){return!r.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"]}]});J("continuous-filter",{start:[{trigger:"legend:valuechanged",action:"data-filter:filter"}]});J("continuous-visible-filter",{start:[{trigger:"legend:valuechanged",action:"element-filter:filter"}]});J("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"]}]});J("active-region",{start:[{trigger:"plot:mousemove",action:"active-region:show"}],end:[{trigger:"plot:mouseleave",action:"active-region:hide"}]});J("axis-description",{start:[{trigger:"axis-description:mousemove",action:"axis-description:show"}],end:[{trigger:"axis-description:mouseleave",action:"axis-description:hide"}]});function id(r){return r.gEvent.preventDefault(),r.gEvent.originalEvent.deltaY>0}J("view-zoom",{start:[{trigger:"plot:mousewheel",isEnable:function(r){return id(r.event)},action:"scale-zoom:zoomOut",throttle:{wait:100,leading:!0,trailing:!1}},{trigger:"plot:mousewheel",isEnable:function(r){return!id(r.event)},action:"scale-zoom:zoomIn",throttle:{wait:100,leading:!0,trailing:!1}}]});J("sibling-tooltip",{start:[{trigger:"plot:mousemove",action:"sibling-tooltip:show"}],end:[{trigger:"plot:mouseleave",action:"sibling-tooltip:hide"}]});J("plot-mousewheel-scroll",{start:[{trigger:"plot:mousewheel",action:"mousewheel-scroll:scroll"}]});var ne=["type","alias","tickCount","tickInterval","min","max","nice","minLimit","maxLimit","range","tickMethod","base","exponent","mask","sync"],Oe;(function(r){r.ERROR="error",r.WARN="warn",r.INFO="log"})(Oe||(Oe={}));var BE="AntV/G2Plot";function OE(r){for(var e=[],t=1;t=0}),n=t.every(function(a){return M(a,[e])<=0});return i?{min:0}:n?{max:0}:{}}function wm(r,e,t,i,n){if(n===void 0&&(n=[]),!Array.isArray(r))return{nodes:[],links:[]};var a=[],o={},s=-1;return r.forEach(function(l){var u=l[e],c=l[t],h=l[i],f=ct(l,n);o[u]||(o[u]=g.__assign({id:++s,name:u},f)),o[c]||(o[c]=g.__assign({id:++s,name:c},f)),a.push(g.__assign({source:o[u].id,target:o[c].id,value:h},f))}),{nodes:Object.values(o).sort(function(l,u){return l.id-u.id}),links:a}}function Zi(r,e){var t=Xt(r,function(i){var n=i[e];return n===null||typeof n=="number"&&!isNaN(n)});return dr(Oe.WARN,t.length===r.length,"illegal data existed in chart data."),t}var RE=5,NE={}.toString,_m=function(r,e){return NE.call(r)==="[object "+e+"]"},zE=function(r){return _m(r,"Array")},VE=function(r){return typeof r=="object"&&r!==null},nd=function(r){if(!VE(r)||!_m(r,"Object"))return!1;for(var e=r;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(r)===e},bm=function(r,e,t,i){t=t||0,i=i||RE;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var a=e[n];a?nd(a)?(nd(r[n])||(r[n]={}),t=i&&r<=n}function Rr(r){if(tt(r))return[r,r,r,r];if(O(r)){var e=r.length;if(e===1)return[r[0],r[0],r[0],r[0]];if(e===2)return[r[0],r[1],r[0],r[1]];if(e===3)return[r[0],r[1],r[2],r[1]];if(e===4)return r}return[0,0,0,0]}function Ds(r,e,t){e===void 0&&(e="bottom"),t===void 0&&(t=25);var i=Rr(r),n=[e.startsWith("top")?t:0,e.startsWith("right")?t:0,e.startsWith("bottom")?t:0,e.startsWith("left")?t:0];return[i[0]+n[0],i[1]+n[1],i[2]+n[2],i[3]+n[3]]}function Qc(r){var e=r.map(function(i){return Rr(i)}),t=[0,0,0,0];return e.length>0&&(t=t.map(function(i,n){return e.forEach(function(a,o){i+=e[o][n]}),i})),t}function HE(r,e){var t=[];if(r.length){t.push(["M",r[0].x,r[0].y]);for(var i=1,n=r.length;i"},key:"".concat(l===0?"top":"bottom","-statistic")},ct(s,["offsetX","offsetY","rotate","style","formatter"])))}})},UE=function(r,e,t){var i=e.statistic,n=i.title,a=i.content;[n,a].forEach(function(o){if(o){var s=W(o.style)?o.style(t):o.style;r.annotation().html(g.__assign({position:["50%","100%"],html:function(l,u){var c=u.getCoordinate(),h=u.views[0].getCoordinate(),f=h.getCenter(),v=h.getRadius(),d=Math.max(Math.sin(h.startAngle),Math.sin(h.endAngle))*v,p=f.y+d-c.y.start-parseFloat(M(s,"fontSize",0)),y=c.getRadius()*c.innerRadius*2;Cm(l,g.__assign({width:"".concat(y,"px"),transform:"translate(-50%, ".concat(p,"px)")},Sm(s)));var m=u.getData();if(o.customHtml)return o.customHtml(l,u,t,m);var x=o.content;return o.formatter&&(x=o.formatter(t,m)),x?K(x)?x:"".concat(x):"
    "}},ct(o,["offsetX","offsetY","rotate","style","formatter"])))}})};function Mm(r,e){return e?Zt(e,function(t,i,n){return t.replace(new RegExp("{\\s*".concat(n,"\\s*}"),"g"),i)},r):r}function nt(r,e){return r.views.find(function(t){return t.id===e})}function Tn(r){var e=r.parent;return e?e.views:[]}function od(r){return Tn(r).filter(function(e){return e!==r})}function Aa(r,e,t){t===void 0&&(t=r.geometries),typeof e=="boolean"?r.animate(e):r.animate(!0),S(t,function(i){var n;W(e)?n=e(i.type||i.shapeType,i)||!0:n=e,i.animate(n)})}function Os(){return typeof window=="object"?window==null?void 0:window.devicePixelRatio:2}function Kc(r,e){e===void 0&&(e=r);var t=document.createElement("canvas"),i=Os();t.width=r*i,t.height=e*i,t.style.width="".concat(r,"px"),t.style.height="".concat(e,"px");var n=t.getContext("2d");return n.scale(i,i),t}function Jc(r,e,t,i){i===void 0&&(i=t);var n=e.backgroundColor,a=e.opacity;r.globalAlpha=a,r.fillStyle=n,r.beginPath(),r.fillRect(0,0,t,i),r.closePath()}function Am(r,e,t){var i=r+e;return t?i*2:i}function Fm(r,e){var t=e?[[r*.25,r*.25],[r*.75,r*.75]]:[[r*.5,r*.5]];return t}function th(r,e){var t=e*Math.PI/180,i={a:Math.cos(t)*(1/r),b:Math.sin(t)*(1/r),c:-Math.sin(t)*(1/r),d:Math.cos(t)*(1/r),e:0,f:0};return i}var jE={size:6,padding:2,backgroundColor:"transparent",opacity:1,rotation:0,fill:"#fff",fillOpacity:.5,stroke:"transparent",lineWidth:0,isStagger:!0};function ZE(r,e,t,i){var n=e.size,a=e.fill,o=e.lineWidth,s=e.stroke,l=e.fillOpacity;r.beginPath(),r.globalAlpha=l,r.fillStyle=a,r.strokeStyle=s,r.lineWidth=o,r.arc(t,i,n/2,0,2*Math.PI,!1),r.fill(),o&&r.stroke(),r.closePath()}function QE(r){var e=L({},jE,r),t=e.size,i=e.padding,n=e.isStagger,a=e.rotation,o=Am(t,i,n),s=Fm(o,n),l=Kc(o,o),u=l.getContext("2d");Jc(u,e,o);for(var c=0,h=s;c1&&arguments[1]!==void 0?arguments[1]:60,a=null;return function(){for(var o=this,s=arguments.length,l=new Array(s),u=0;u_){var b=w/p.length,C=Math.max(1,Math.ceil(_/b)-1),A="".concat(p.slice(0,C),"...");x.attr("text",A)}}}}function Uk(r,e,t){Wk(r,e,t),qk(r,e,t)}function jk(r,e,t){return e===void 0&&(e=!0),t===void 0&&(t=!1),function(i){var n=i.options,a=i.chart,o=n.conversionTag,s=n.theme;return o&&!t&&(a.theme(L({},pt(s)?s:Nn(s),{columnWidthRatio:1/3})),a.annotation().shape({render:function(l,u){var c=l.addGroup({id:"".concat(a.id,"-conversion-tag-group"),name:"conversion-tag-group"}),h=Le(a.geometries,function(d){return d.type==="interval"}),f={view:u,geometry:h,group:c,field:r,horizontal:e,options:Xk(o,e)},v=h.elements;S(v,function(d,p){p>0&&Uk(f,v[p-1],d)})}})),i}}function Zk(r){var e=r.options,t=e.legend,i=e.seriesField,n=e.isStack;return i?t!==!1&&(t=g.__assign({position:n?"right-top":"top-left"},t)):t=!1,r.options.legend=t,r}function Qk(r){var e=r.chart,t=r.options,i=t.data,n=t.columnStyle,a=t.color,o=t.columnWidthRatio,s=t.isPercent,l=t.isGroup,u=t.isStack,c=t.xField,h=t.yField,f=t.seriesField,v=t.groupField,d=t.tooltip,p=t.shape,y=s&&l&&u?kk(i,h,[c,v],h):Ta(i,h,c,h,s),m=[];u&&f&&!l?y.forEach(function(w){var b=m.find(function(C){return C[c]===w[c]&&C[f]===w[f]});b?b[h]+=w[h]||0:m.push(g.__assign({},w))}):m=y,e.data(m);var x=s?g.__assign({formatter:function(w){var b;return{name:l&&u?"".concat(w[f]," - ").concat(w[v]):(b=w[f])!==null&&b!==void 0?b:w[c],value:(Number(w[h])*100).toFixed(2)+"%"}}},d):d,_=L({},r,{options:{data:m,widthRatio:o,tooltip:x,interval:{shape:p,style:n,color:a}}});return Ht(_),_}function ah(r){var e,t,i=r.options,n=i.xAxis,a=i.yAxis,o=i.xField,s=i.yField,l=i.data,u=i.isPercent,c=u?{max:1,min:0,minLimit:0,maxLimit:1}:{};return j(Mt((e={},e[o]=n,e[s]=a,e),(t={},t[o]={type:"cat"},t[s]=g.__assign(g.__assign({},Zc(l,s)),c),t)))(r)}function Kk(r){var e=r.chart,t=r.options,i=t.xAxis,n=t.yAxis,a=t.xField,o=t.yField;return i===!1?e.axis(a,!1):e.axis(a,i),n===!1?e.axis(o,!1):e.axis(o,n),r}function Jk(r){var e=r.chart,t=r.options,i=t.legend,n=t.seriesField;return i&&n?e.legend(n,i):i===!1&&e.legend(!1),r}function tL(r){var e=r.chart,t=r.options,i=t.label,n=t.yField,a=t.isRange,o=$t(e,"interval");if(!i)o.label(!1);else{var s=i.callback,l=g.__rest(i,["callback"]);o.label({fields:[n],callback:s,cfg:g.__assign({layout:l!=null&&l.position?void 0:[{type:"interval-adjust-position"},{type:"interval-hide-overlap"},{type:"adjust-color"},{type:"limit-in-plot",cfg:{action:"hide"}}]},Ot(a?g.__assign({content:function(u){var c;return(c=u[n])===null||c===void 0?void 0:c.join("-")}},l):l))})}return r}function eL(r){var e=r.chart,t=r.options,i=t.tooltip,n=t.isGroup,a=t.isStack,o=t.groupField,s=t.data,l=t.xField,u=t.yField,c=t.seriesField;if(i===!1)e.tooltip(!1);else{var h=i;if(n&&a){var f=h.customItems,v=(h==null?void 0:h.formatter)||function(d){return{name:"".concat(d[c]," - ").concat(d[o]),value:d[u]}};h=g.__assign(g.__assign({},h),{customItems:function(d){var p=[];return S(d,function(y){var m=Xt(s,function(x){return Hx(x,ct(y.data,[l,c]))});m.forEach(function(x){p.push(g.__assign(g.__assign(g.__assign({},y),{value:x[u],data:x,mappingData:{_origin:x}}),v(x)))})}),f?f(p):p}})}e.tooltip(h)}return r}function Hs(r,e){e===void 0&&(e=!1);var t=r.options,i=t.seriesField;return j(Zk,ot,ge("columnStyle"),Hr,Tm("rect"),Qk,ah,Kk,Jk,eL,Fa,eh,tL,zm,wt,vt,St(),jk(t.yField,!e,!!i),Hk(!t.isStack),yi)(r)}function rL(r){var e=r.options,t=e.xField,i=e.yField,n=e.xAxis,a=e.yAxis,o={left:"bottom",right:"top",top:"left",bottom:"right"},s=a!==!1?g.__assign({position:o[(a==null?void 0:a.position)||"left"]},a):!1,l=n!==!1?g.__assign({position:o[(n==null?void 0:n.position)||"bottom"]},n):!1;return g.__assign(g.__assign({},r),{options:g.__assign(g.__assign({},e),{xField:i,yField:t,xAxis:s,yAxis:l})})}function iL(r){var e=r.options,t=e.label;return t&&!t.position&&(t.position="left",t.layout||(t.layout=[{type:"interval-adjust-position"},{type:"interval-hide-overlap"},{type:"adjust-color"},{type:"limit-in-plot",cfg:{action:"hide"}}])),L({},r,{options:{label:t}})}function nL(r){var e=r.options,t=e.seriesField,i=e.isStack,n=e.legend;return t?n!==!1&&(n=g.__assign({position:i?"top-left":"right-top"},n||{})):n=!1,L({},r,{options:{legend:n}})}function aL(r){var e=r.options,t=[{type:"transpose"},{type:"reflectY"}].concat(e.coordinate||[]);return L({},r,{options:{coordinate:t}})}function oL(r){var e=r.chart,t=r.options,i=t.barStyle,n=t.barWidthRatio,a=t.minBarWidth,o=t.maxBarWidth,s=t.barBackground;return Hs({chart:e,options:g.__assign(g.__assign({},t),{columnStyle:i,columnWidthRatio:n,minColumnWidth:a,maxColumnWidth:o,columnBackground:s})},!0)}function Gm(r){return j(rL,iL,nL,Pt,aL,oL)(r)}var sL=L({},et.getDefaultOptions(),{barWidthRatio:.6,marginRatio:1/32,tooltip:{shared:!0,showMarkers:!1,offset:20},legend:{radio:{}},interactions:[{type:"active-region"}]}),lL=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="bar",t}return e.getDefaultOptions=function(){return sL},e.prototype.changeData=function(t){var i,n;this.updateOption({data:t});var a=this,o=a.chart,s=a.options,l=s.isPercent,u=s.xField,c=s.yField,h=s.xAxis,f=s.yAxis;i=[c,u],u=i[0],c=i[1],n=[f,h],h=n[0],f=n[1];var v=g.__assign(g.__assign({},s),{xField:u,yField:c,yAxis:f,xAxis:h});ah({chart:o,options:v}),o.changeData(Ta(t,u,c,u,l))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return Gm},e}(et),uL=L({},et.getDefaultOptions(),{columnWidthRatio:.6,marginRatio:1/32,tooltip:{shared:!0,showMarkers:!1,offset:20},legend:{radio:{}},interactions:[{type:"active-region"}]}),cL=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="column",t}return e.getDefaultOptions=function(){return uL},e.prototype.changeData=function(t){this.updateOption({data:t});var i=this.options,n=i.yField,a=i.xField,o=i.isPercent,s=this,l=s.chart,u=s.options;ah({chart:l,options:u}),this.chart.changeData(Ta(t,n,a,n,o))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return Hs},e}(et),Al,Nr="$$percentage$$",zr="$$mappingValue$$",ur="$$conversion$$",Mu="$$totalPercentage$$",la="$$x$$",ua="$$y$$",hL={appendPadding:[0,80],minSize:0,maxSize:1,meta:(Al={},Al[zr]={min:0,max:1,nice:!1},Al),label:{style:{fill:"#fff",fontSize:12}},tooltip:{showTitle:!1,showMarkers:!1,shared:!1},conversionTag:{offsetX:10,offsetY:0,style:{fontSize:12,fill:"rgba(0,0,0,0.45)"}}},Ym="CONVERSION_TAG_NAME";function oh(r,e,t){var i=[],n=t.yField,a=t.maxSize,o=t.minSize,s=M(ag(e,n),[n]),l=tt(a)?a:1,u=tt(o)?o:0;return i=xt(r,function(c,h){var f=(c[n]||0)/s;return c[Nr]=f,c[zr]=(l-u)*f+u,c[ur]=[M(r,[h-1,n]),c[n]],c}),i}function sh(r){return function(e){var t=e.chart,i=e.options,n=i.conversionTag,a=i.filteredData,o=a||t.getOptions().data;if(n){var s=n.formatter;o.forEach(function(l,u){if(!(u<=0||Number.isNaN(l[zr]))){var c=r(l,u,o,{top:!0,name:Ym,text:{content:W(s)?s(l,o):s,offsetX:n.offsetX,offsetY:n.offsetY,position:"end",autoRotate:!1,style:g.__assign({textAlign:"start",textBaseline:"middle"},n.style)}});t.annotation().line(c)}})}return e}}function fL(r){var e=r.chart,t=r.options,i=t.data,n=i===void 0?[]:i,a=t.yField,o=t.maxSize,s=t.minSize,l=oh(n,n,{yField:a,maxSize:o,minSize:s});return e.data(l),r}function vL(r){var e=r.chart,t=r.options,i=t.xField,n=t.yField,a=t.color,o=t.tooltip,s=t.label,l=t.shape,u=l===void 0?"funnel":l,c=t.funnelStyle,h=t.state,f=Fe(o,[i,n]),v=f.fields,d=f.formatter;ue({chart:e,options:{type:"interval",xField:i,yField:zr,colorField:i,tooltipFields:O(v)&&v.concat([Nr,ur]),mapping:{shape:u,tooltip:d,color:a,style:c},label:s,state:h}});var p=$t(r.chart,"interval");return p.adjust("symmetric"),r}function dL(r){var e=r.chart,t=r.options,i=t.isTransposed;return e.coordinate({type:"rect",actions:i?[]:[["transpose"],["scale",1,-1]]}),r}function $m(r){var e=r.options,t=r.chart,i=e.maxSize,n=M(t,["geometries","0","dataArray"],[]),a=M(t,["options","data","length"]),o=xt(n,function(l){return M(l,["0","nextPoints","0","x"])*a-.5}),s=function(l,u,c,h){var f=i-(i-l[zr])/2;return g.__assign(g.__assign({},h),{start:[o[u-1]||u-.5,f],end:[o[u-1]||u-.5,f+.05]})};return sh(s)(r),r}function Hm(r){return j(fL,vL,dL,$m)(r)}function gL(r){var e,t=r.chart,i=r.options,n=i.data,a=n===void 0?[]:n,o=i.yField;return t.data(a),t.scale((e={},e[o]={sync:!0},e)),r}function pL(r){var e=r.chart,t=r.options,i=t.data,n=t.xField,a=t.yField,o=t.color,s=t.compareField,l=t.isTransposed,u=t.tooltip,c=t.maxSize,h=t.minSize,f=t.label,v=t.funnelStyle,d=t.state,p=t.showFacetTitle;return e.facet("mirror",{fields:[s],transpose:!l,padding:l?0:[32,0,0,0],showTitle:p,eachView:function(y,m){var x=l?m.rowIndex:m.columnIndex;l||y.coordinate({type:"rect",actions:[["transpose"],["scale",x===0?-1:1,-1]]});var _=oh(m.data,i,{yField:a,maxSize:c,minSize:h});y.data(_);var w=Fe(u,[n,a,s]),b=w.fields,C=w.formatter,A=l?{offset:x===0?10:-23,position:x===0?"bottom":"top"}:{offset:10,position:"left",style:{textAlign:x===0?"end":"start"}};ue({chart:y,options:{type:"interval",xField:n,yField:zr,colorField:n,tooltipFields:O(b)&&b.concat([Nr,ur]),mapping:{shape:"funnel",tooltip:C,color:o,style:v},label:f===!1?!1:L({},A,f),state:d}})}}),r}function Xm(r){var e=r.chart,t=r.index,i=r.options,n=i.conversionTag,a=i.isTransposed;(tt(t)?[e]:e.views).forEach(function(o,s){var l=M(o,["geometries","0","dataArray"],[]),u=M(o,["options","data","length"]),c=xt(l,function(f){return M(f,["0","nextPoints","0","x"])*u-.5}),h=function(f,v,d,p){var y=(t||s)===0?-1:1;return L({},p,{start:[c[v-1]||v-.5,f[zr]],end:[c[v-1]||v-.5,f[zr]+.05],text:a?{style:{textAlign:"start"}}:{offsetX:n!==!1?y*n.offsetX:0,style:{textAlign:(t||s)===0?"end":"start"}}})};sh(h)(L({},{chart:o,options:i}))})}function yL(r){var e=r.chart;return e.once("beforepaint",function(){return Xm(r)}),r}function mL(r){return j(gL,pL,yL)(r)}function xL(r){var e=r.chart,t=r.options,i=t.data,n=i===void 0?[]:i,a=t.yField,o=Zt(n,function(u,c){return u+(c[a]||0)},0),s=ag(n,a)[a],l=xt(n,function(u,c){var h=[],f=[];if(u[Mu]=(u[a]||0)/o,c){var v=n[c-1][la],d=n[c-1][ua];h[0]=v[3],f[0]=d[3],h[1]=v[2],f[1]=d[2]}else h[0]=-.5,f[0]=1,h[1]=.5,f[1]=1;return f[2]=f[1]-u[Mu],h[2]=(f[2]+1)/4,f[3]=f[2],h[3]=-h[2],u[la]=h,u[ua]=f,u[Nr]=(u[a]||0)/s,u[ur]=[M(n,[c-1,a]),u[a]],u});return e.data(l),r}function wL(r){var e=r.chart,t=r.options,i=t.xField,n=t.yField,a=t.color,o=t.tooltip,s=t.label,l=t.funnelStyle,u=t.state,c=Fe(o,[i,n]),h=c.fields,f=c.formatter;return ue({chart:e,options:{type:"polygon",xField:la,yField:ua,colorField:i,tooltipFields:O(h)&&h.concat([Nr,ur]),label:s,state:u,mapping:{tooltip:f,color:a,style:l}}}),r}function _L(r){var e=r.chart,t=r.options,i=t.isTransposed;return e.coordinate({type:"rect",actions:i?[["transpose"],["reflect","x"]]:[]}),r}function bL(r){var e=function(t,i,n,a){return g.__assign(g.__assign({},a),{start:[t[la][1],t[ua][1]],end:[t[la][1]+.05,t[ua][1]]})};return sh(e)(r),r}function SL(r){return j(xL,wL,_L,bL)(r)}function CL(r){var e,t=r.chart,i=r.options,n=i.data,a=n===void 0?[]:n,o=i.yField;return t.data(a),t.scale((e={},e[o]={sync:!0},e)),r}function ML(r){var e=r.chart,t=r.options,i=t.seriesField,n=t.isTransposed,a=t.showFacetTitle;return e.facet("rect",{fields:[i],padding:[n?0:32,10,0,10],showTitle:a,eachView:function(o,s){Hm(L({},r,{chart:o,options:{data:s.data}}))}}),r}function AL(r){return j(CL,ML)(r)}var FL=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.rendering=!1,t}return e.prototype.change=function(t){var i=this;if(!this.rendering){var n=t.seriesField,a=t.compareField,o=a?Xm:$m,s=this.context.view,l=n||a?s.views:[s];xt(l,function(u,c){var h=u.getController("annotation"),f=Xt(M(h,["option"],[]),function(d){var p=d.name;return p!==Ym});h.clear(!0),S(f,function(d){typeof d=="object"&&u.annotation()[d.type](d)});var v=M(u,["filteredData"],u.getOptions().data);o({chart:u,index:c,options:g.__assign(g.__assign({},t),{filteredData:oh(v,v,t)})}),u.filterData(v),i.rendering=!0,u.render(!0)})}this.rendering=!1},e}(yt),Wm="funnel-conversion-tag",Au="funnel-afterrender",qm={trigger:"afterrender",action:"".concat(Wm,":change")};q(Wm,FL);J(Au,{start:[qm]});function TL(r){var e=r.options,t=e.compareField,i=e.xField,n=e.yField,a=e.locale,o=e.funnelStyle,s=e.data,l=Rs(a),u={label:t?{fields:[i,n,t,Nr,ur],formatter:function(h){return"".concat(h[n])}}:{fields:[i,n,Nr,ur],offset:0,position:"middle",formatter:function(h){return"".concat(h[i]," ").concat(h[n])}},tooltip:{title:i,formatter:function(h){return{name:h[i],value:h[n]}}},conversionTag:{formatter:function(h){return"".concat(l.get(["conversionTag","label"]),": ").concat(Vm.apply(void 0,h[ur]))}}},c;return(t||o)&&(c=function(h){return L({},t&&{lineWidth:1,stroke:"#fff"},W(o)?o(h):o)}),L({options:u},r,{options:{funnelStyle:c,data:he(s)}})}function EL(r){var e=r.options,t=e.compareField,i=e.dynamicHeight,n=e.seriesField;return n?AL(r):t?mL(r):i?SL(r):Hm(r)}function kL(r){var e,t=r.options,i=t.xAxis,n=t.yAxis,a=t.xField,o=t.yField;return j(Mt((e={},e[a]=i,e[o]=n,e)))(r)}function LL(r){var e=r.chart;return e.axis(!1),r}function IL(r){var e=r.chart,t=r.options,i=t.legend;return i===!1?e.legend(!1):e.legend(i),r}function PL(r){var e=r.chart,t=r.options,i=t.interactions,n=t.dynamicHeight;return S(i,function(a){a.enable===!1?e.removeInteraction(a.type):e.interaction(a.type,a.cfg||{})}),n?e.removeInteraction(Au):e.interaction(Au,{start:[g.__assign(g.__assign({},qm),{arg:t})]}),r}function Um(r){return j(TL,EL,kL,LL,Pt,PL,IL,vt,ot,St())(r)}var DL=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="funnel",t}return e.getDefaultOptions=function(){return hL},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return Um},e.prototype.setState=function(t,i,n){n===void 0&&(n=!0);var a=sa(this.chart);S(a,function(o){i(o.getData())&&o.setState(t,n)})},e.prototype.getStates=function(){var t=sa(this.chart),i=[];return S(t,function(n){var a=n.getData(),o=n.getStates();S(o,function(s){i.push({data:a,state:s,geometry:n.geometry,element:n})})}),i},e.CONVERSATION_FIELD=ur,e.PERCENT_FIELD=Nr,e.TOTAL_PERCENT_FIELD=Mu,e}(et),so,lh="range",jm="type",ar="percent",BL="#f0f0f0",Zm="indicator-view",Qm="range-view",OL={percent:0,range:{ticks:[]},innerRadius:.9,radius:.95,startAngle:-7/6*Math.PI,endAngle:1/6*Math.PI,syncViewPadding:!0,axis:{line:null,label:{offset:-24,style:{textAlign:"center",textBaseline:"middle"}},subTickLine:{length:-8},tickLine:{length:-12},grid:null},indicator:{pointer:{style:{lineWidth:5,lineCap:"round"}},pin:{style:{r:9.75,lineWidth:4.5,fill:"#fff"}}},statistic:{title:!1},meta:(so={},so[lh]={sync:"v"},so[ar]={sync:"v",tickCount:5,tickInterval:.2},so),animation:!1};function RL(r,e){return r.map(function(t,i){var n;return n={},n[lh]=t-(r[i-1]||0),n[jm]="".concat(i),n[ar]=e,n})}function Km(r){var e;return[(e={},e[ar]=mt(r,0,1),e)]}function Jm(r,e){var t=M(e,["ticks"],[]),i=Bt(t)?hi(t):[0,mt(r,0,1),1];return i[0]||i.shift(),RL(i,r)}function NL(r){var e=r.chart,t=r.options,i=t.percent,n=t.range,a=t.radius,o=t.innerRadius,s=t.startAngle,l=t.endAngle,u=t.axis,c=t.indicator,h=t.gaugeStyle,f=t.type,v=t.meter,d=n.color,p=n.width;if(c){var y=Km(i),m=e.createView({id:Zm});m.data(y),m.point().position("".concat(ar,"*1")).shape(c.shape||"gauge-indicator").customInfo({defaultColor:e.getTheme().defaultColor,indicator:c}),m.coordinate("polar",{startAngle:s,endAngle:l,radius:o*a}),m.axis(ar,u),m.scale(ar,ct(u,ne))}var x=Jm(i,t.range),_=e.createView({id:Qm});_.data(x);var w=K(d)?[d,BL]:d,b=Ht({chart:_,options:{xField:"1",yField:lh,seriesField:jm,rawFields:[ar],isStack:!0,interval:{color:w,style:h,shape:f==="meter"?"meter-gauge":null},args:{zIndexReversed:!0,sortZIndex:!0},minColumnWidth:p,maxColumnWidth:p}}).ext,C=b.geometry;return C.customInfo({meter:v}),_.coordinate("polar",{innerRadius:o,radius:a,startAngle:s,endAngle:l}).transpose(),r}function zL(r){var e;return j(Mt((e={range:{min:0,max:1,maxLimit:1,minLimit:0}},e[ar]={},e)))(r)}function t0(r,e){var t=r.chart,i=r.options,n=i.statistic,a=i.percent;if(t.getController("annotation").clear(!0),n){var o=n.content,s=void 0;o&&(s=L({},{content:"".concat((a*100).toFixed(2),"%"),style:{opacity:.75,fontSize:"30px",lineHeight:1,textAlign:"center",color:"rgba(44,53,66,0.85)"}},o)),UE(t,{statistic:g.__assign(g.__assign({},n),{content:s})},{percent:a})}return e&&t.render(!0),r}function VL(r){var e=r.chart,t=r.options,i=t.tooltip;return i?e.tooltip(L({showTitle:!1,showMarkers:!1,containerTpl:'
    ',domStyles:{"g2-tooltip":{padding:"4px 8px",fontSize:"10px"}},customContent:function(n,a){var o=M(a,[0,"data",ar],0);return"".concat((o*100).toFixed(2),"%")}},i)):e.tooltip(!1),r}function GL(r){var e=r.chart;return e.legend(!1),r}function e0(r){return j(ot,vt,NL,zL,VL,t0,wt,St(),GL)(r)}lt("point","gauge-indicator",{draw:function(r,e){var t=r.customInfo,i=t.indicator,n=t.defaultColor,a=i,o=a.pointer,s=a.pin,l=e.addGroup(),u=this.parsePoint({x:0,y:0});return o&&l.addShape("line",{name:"pointer",attrs:g.__assign({x1:u.x,y1:u.y,x2:r.x,y2:r.y,stroke:n},o.style)}),s&&l.addShape("circle",{name:"pin",attrs:g.__assign({x:u.x,y:u.y,stroke:n},s.style)}),l}});lt("interval","meter-gauge",{draw:function(r,e){var t=r.customInfo.meter,i=t===void 0?{}:t,n=i.steps,a=n===void 0?50:n,o=i.stepRatio,s=o===void 0?.5:o;a=a<1?1:a,s=mt(s,0,1);var l=this.coordinate,u=l.startAngle,c=l.endAngle,h=0;if(s>0&&s<1){var f=c-u;h=f/a/(s/(1-s)+1-1/a)}for(var v=h/(1-s)*s,d=e.addGroup(),p=this.coordinate.getCenter(),y=this.coordinate.getRadius(),m=se.getAngle(r,this.coordinate),x=m.startAngle,_=m.endAngle,w=x;w<_;){var b=void 0,C=(w-u)%(v+h);C1?l/(i-1):s.max),!t&&!i){var c=$L(o);u=l/c}var h={},f=be(a,n);oe(f)?S(a,function(d){var p=d[e],y=cd(p,u,i),m="".concat(y[0],"-").concat(y[1]);Ir(h,m)||(h[m]={range:y,count:0}),h[m].count+=1}):Object.keys(f).forEach(function(d){S(f[d],function(p){var y=p[e],m=cd(y,u,i),x="".concat(m[0],"-").concat(m[1]),_="".concat(x,"-").concat(d);Ir(h,_)||(h[_]={range:m,count:0},h[_][n]=d),h[_].count+=1})});var v=[];return S(h,function(d){v.push(d)}),v}var Xo="range",ca="count",HL=L({},et.getDefaultOptions(),{columnStyle:{stroke:"#FFFFFF"},tooltip:{shared:!0,showMarkers:!1},interactions:[{type:"active-region"}]});function XL(r){var e=r.chart,t=r.options,i=t.data,n=t.binField,a=t.binNumber,o=t.binWidth,s=t.color,l=t.stackField,u=t.legend,c=t.columnStyle,h=r0(i,n,o,a,l);e.data(h);var f=L({},r,{options:{xField:Xo,yField:ca,seriesField:l,isStack:!0,interval:{color:s,style:c}}});return Ht(f),u&&l?e.legend(l,u):e.legend(!1),r}function WL(r){var e,t=r.options,i=t.xAxis,n=t.yAxis;return j(Mt((e={},e[Xo]=i,e[ca]=n,e)))(r)}function qL(r){var e=r.chart,t=r.options,i=t.xAxis,n=t.yAxis;return i===!1?e.axis(Xo,!1):e.axis(Xo,i),n===!1?e.axis(ca,!1):e.axis(ca,n),r}function UL(r){var e=r.chart,t=r.options,i=t.label,n=$t(e,"interval");if(!i)n.label(!1);else{var a=i.callback,o=g.__rest(i,["callback"]);n.label({fields:[ca],callback:a,cfg:Ot(o)})}return r}function i0(r){return j(ot,ge("columnStyle"),XL,WL,qL,Hr,UL,Pt,wt,vt)(r)}var jL=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="histogram",t}return e.getDefaultOptions=function(){return HL},e.prototype.changeData=function(t){this.updateOption({data:t});var i=this.options,n=i.binField,a=i.binNumber,o=i.binWidth,s=i.stackField;this.chart.changeData(r0(t,n,o,a,s))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return i0},e}(et),ZL=L({},et.getDefaultOptions(),{tooltip:{shared:!0,showMarkers:!0,showCrosshairs:!0,crosshairs:{type:"x"}},legend:{position:"top-left",radio:{}},isStack:!1}),QL=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.active=function(){var t=this.getView(),i=this.context.event;if(i.data){var n=i.data.items,a=t.geometries.filter(function(o){return o.type==="point"});S(a,function(o){S(o.elements,function(s){var l=og(n,function(u){return u.data===s.data})!==-1;s.setState("active",l)})})}},e.prototype.reset=function(){var t=this.getView(),i=t.geometries.filter(function(n){return n.type==="point"});S(i,function(n){S(n.elements,function(a){a.setState("active",!1)})})},e.prototype.getView=function(){return this.context.view},e}(yt);q("marker-active",QL);J("marker-active",{start:[{trigger:"tooltip:show",action:"marker-active:active"}],end:[{trigger:"tooltip:hide",action:"marker-active:reset"}]});var KL=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="line",t}return e.getDefaultOptions=function(){return ZL},e.prototype.changeData=function(t){this.updateOption({data:t});var i=this,n=i.chart,a=i.options;$s({chart:n,options:a}),this.chart.changeData(t)},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return Rm},e}(et),n0=L({},et.getDefaultOptions(),{legend:{position:"right",radio:{}},tooltip:{shared:!1,showTitle:!1,showMarkers:!1},label:{layout:{type:"limit-in-plot",cfg:{action:"ellipsis"}}},pieStyle:{stroke:"white",lineWidth:1},statistic:{title:{style:{fontWeight:300,color:"#4B535E",textAlign:"center",fontSize:"20px",lineHeight:1}},content:{style:{fontWeight:"bold",color:"rgba(44,53,66,0.85)",textAlign:"center",fontSize:"32px",lineHeight:1}}},theme:{components:{annotation:{text:{animate:!1}}}}}),JL=[1,0,0,0,1,0,0,0,1];function Fu(r,e){var t=e?g.__spreadArray([],e,!0):g.__spreadArray([],JL,!0);return se.transform(t,r)}var tI=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getActiveElements=function(){var t=se.getDelegationObject(this.context);if(t){var i=this.context.view,n=t.component,a=t.item,o=n.get("field");if(o){var s=i.geometries[0].elements;return s.filter(function(l){return l.getModel().data[o]===a.value})}}return[]},e.prototype.getActiveElementLabels=function(){var t=this.context.view,i=this.getActiveElements(),n=t.geometries[0].labelsContainer.getChildren();return n.filter(function(a){return i.find(function(o){return Lt(o.getData(),a.get("data"))})})},e.prototype.transfrom=function(t){t===void 0&&(t=7.5);var i=this.getActiveElements(),n=this.getActiveElementLabels();i.forEach(function(a,o){var s=n[o],l=a.geometry.coordinate;if(l.isPolar&&l.isTransposed){var u=se.getAngle(a.getModel(),l),c=u.startAngle,h=u.endAngle,f=(c+h)/2,v=t,d=v*Math.cos(f),p=v*Math.sin(f);a.shape.setMatrix(Fu([["t",d,p]])),s.setMatrix(Fu([["t",d,p]]))}})},e.prototype.active=function(){this.transfrom()},e.prototype.reset=function(){this.transfrom(0)},e}(yt);function eI(r){var e=r.event,t,i=e.target;return i&&(t=i.get("element")),t}var rI=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getAnnotations=function(t){var i=t||this.context.view;return i.getController("annotation").option},e.prototype.getInitialAnnotation=function(){return this.initialAnnotation},e.prototype.init=function(){var t=this,i=this.context.view;i.removeInteraction("tooltip"),i.on("afterchangesize",function(){var n=t.getAnnotations(i);t.initialAnnotation=n})},e.prototype.change=function(t){var i=this.context,n=i.view,a=i.event;this.initialAnnotation||(this.initialAnnotation=this.getAnnotations());var o=M(a,["data","data"]);if(a.type.match("legend-item")){var s=se.getDelegationObject(this.context),l=n.getGroupedFields()[0];if(s&&l){var u=s.item;o=n.getData().find(function(v){return v[l]===u.value})}}if(o){var c=M(t,"annotations",[]),h=M(t,"statistic",{});n.getController("annotation").clear(!0),S(c,function(v){typeof v=="object"&&n.annotation()[v.type](v)}),Bs(n,{statistic:h,plotType:"pie"},o),n.render(!0)}var f=eI(this.context);f&&f.shape.toFront()},e.prototype.reset=function(){var t=this.context.view,i=t.getController("annotation");i.clear(!0);var n=this.getInitialAnnotation();S(n,function(a){t.annotation()[a.type](a)}),t.render(!0)},e}(yt),a0="pie-statistic";q(a0,rI);J("pie-statistic-active",{start:[{trigger:"element:mouseenter",action:"pie-statistic:change"}],end:[{trigger:"element:mouseleave",action:"pie-statistic:reset"}]});q("pie-legend",tI);J("pie-legend-active",{start:[{trigger:"legend-item:mouseenter",action:"pie-legend:active"}],end:[{trigger:"legend-item:mouseleave",action:"pie-legend:reset"}]});function iI(r,e){var t=null;return S(r,function(i){typeof i[e]=="number"&&(t+=i[e])}),t}function nI(r,e){var t;switch(r){case"inner":return t="-30%",K(e)&&e.endsWith("%")?parseFloat(e)*.01>0?t:e:e<0?e:t;case"outer":return t=12,K(e)&&e.endsWith("%")?parseFloat(e)*.01<0?t:e:e>0?e:t;default:return e}}function Wo(r,e){return Gu(Zi(r,e),function(t){return t[e]===0})}function aI(r){var e=r.chart,t=r.options,i=t.data,n=t.angleField,a=t.colorField,o=t.color,s=t.pieStyle,l=t.shape,u=Zi(i,n);if(Wo(u,n)){var c="$$percentage$$";u=u.map(function(f){var v;return g.__assign(g.__assign({},f),(v={},v[c]=1/u.length,v))}),e.data(u);var h=L({},r,{options:{xField:"1",yField:c,seriesField:a,isStack:!0,interval:{color:o,shape:l,style:s},args:{zIndexReversed:!0,sortZIndex:!0}}});Ht(h)}else{e.data(u);var h=L({},r,{options:{xField:"1",yField:n,seriesField:a,isStack:!0,interval:{color:o,shape:l,style:s},args:{zIndexReversed:!0,sortZIndex:!0}}});Ht(h)}return r}function oI(r){var e,t=r.chart,i=r.options,n=i.meta,a=i.colorField,o=L({},n);return t.scale(o,(e={},e[a]={type:"cat"},e)),r}function sI(r){var e=r.chart,t=r.options,i=t.radius,n=t.innerRadius,a=t.startAngle,o=t.endAngle;return e.coordinate({type:"theta",cfg:{radius:i,innerRadius:n,startAngle:a,endAngle:o}}),r}function lI(r){var e=r.chart,t=r.options,i=t.label,n=t.colorField,a=t.angleField,o=e.geometries[0];if(!i)o.label(!1);else{var s=i.callback,l=g.__rest(i,["callback"]),u=Ot(l);if(u.content){var c=u.content;u.content=function(d,p,y){var m=d[n],x=d[a],_=e.getScaleByField(a),w=_==null?void 0:_.scale(x);return W(c)?c(g.__assign(g.__assign({},d),{percent:w}),p,y):K(c)?Mm(c,{value:x,name:m,percentage:tt(w)&&!D(x)?"".concat((w*100).toFixed(2),"%"):null}):c}}var h={inner:"",outer:"pie-outer",spider:"pie-spider"},f=u.type?h[u.type]:"pie-outer",v=u.layout?O(u.layout)?u.layout:[u.layout]:[];u.layout=(f?[{type:f}]:[]).concat(v),o.label({fields:n?[a,n]:[a],callback:s,cfg:g.__assign(g.__assign({},u),{offset:nI(u.type,u.offset),type:"pie"})})}return r}function o0(r){var e=r.innerRadius,t=r.statistic,i=r.angleField,n=r.colorField,a=r.meta,o=r.locale,s=Rs(o);if(e&&t){var l=L({},n0.statistic,t),u=l.title,c=l.content;return u!==!1&&(u=L({},{formatter:function(h){var f=h?h[n]:D(u.content)?s.get(["statistic","total"]):u.content,v=M(a,[n,"formatter"])||function(d){return d};return v(f)}},u)),c!==!1&&(c=L({},{formatter:function(h,f){var v=h?h[i]:iI(f,i),d=M(a,[i,"formatter"])||function(p){return p};return h||D(c.content)?d(v):c.content}},c)),L({},{statistic:{title:u,content:c}},r)}return r}function s0(r){var e=r.chart,t=r.options,i=o0(t),n=i.innerRadius,a=i.statistic;return e.getController("annotation").clear(!0),j(St())(r),n&&a&&Bs(e,{statistic:a,plotType:"pie"}),r}function uI(r){var e=r.chart,t=r.options,i=t.tooltip,n=t.colorField,a=t.angleField,o=t.data;if(i===!1)e.tooltip(i);else if(e.tooltip(L({},i,{shared:!1})),Wo(o,a)){var s=M(i,"fields"),l=M(i,"formatter");oe(M(i,"fields"))&&(s=[n,a],l=l||function(u){return{name:u[n],value:ng(u[a])}}),e.geometries[0].tooltip(s.join("*"),ki(s,l))}return r}function cI(r){var e=r.chart,t=r.options,i=o0(t),n=i.interactions,a=i.statistic,o=i.annotations;return S(n,function(s){var l,u;if(s.enable===!1)e.removeInteraction(s.type);else if(s.type==="pie-statistic-active"){var c=[];!((l=s.cfg)===null||l===void 0)&&l.start||(c=[{trigger:"element:mouseenter",action:"".concat(a0,":change"),arg:{statistic:a,annotations:o}}]),S((u=s.cfg)===null||u===void 0?void 0:u.start,function(h){c.push(g.__assign(g.__assign({},h),{arg:{statistic:a,annotations:o}}))}),e.interaction(s.type,L({},s.cfg,{start:c}))}else e.interaction(s.type,s.cfg||{})}),r}function l0(r){return j(ge("pieStyle"),aI,oI,ot,sI,sn,uI,lI,Hr,s0,cI,vt)(r)}var hI=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="pie",t}return e.getDefaultOptions=function(){return n0},e.prototype.changeData=function(t){this.chart.emit(it.BEFORE_CHANGE_DATA,bt.fromData(this.chart,it.BEFORE_CHANGE_DATA,null));var i=this.options,n=this.options.angleField,a=Zi(i.data,n),o=Zi(t,n);Wo(a,n)||Wo(o,n)?this.update({data:t}):(this.updateOption({data:t}),this.chart.data(o),s0({chart:this.chart,options:this.options}),this.chart.render(!0)),this.chart.emit(it.AFTER_CHANGE_DATA,bt.fromData(this.chart,it.AFTER_CHANGE_DATA,null))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return l0},e}(et),u0=["#FAAD14","#E8EDF3"],fI={percent:.2,color:u0,animation:{}};function uh(r){var e=mt(pi(r)?r:0,0,1);return[{current:"".concat(e),type:"current",percent:e},{current:"".concat(e),type:"target",percent:1}]}function c0(r){var e=r.chart,t=r.options,i=t.percent,n=t.progressStyle,a=t.color,o=t.barWidthRatio;e.data(uh(i));var s=L({},r,{options:{xField:"current",yField:"percent",seriesField:"type",widthRatio:o,interval:{style:n,color:K(a)?[a,u0[1]]:a},args:{zIndexReversed:!0,sortZIndex:!0}}});return Ht(s),e.tooltip(!1),e.axis(!1),e.legend(!1),r}function vI(r){var e=r.chart;return e.coordinate("rect").transpose(),r}function h0(r){return j(c0,Mt({}),vI,vt,ot,St())(r)}var dI=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="process",t}return e.getDefaultOptions=function(){return fI},e.prototype.changeData=function(t){this.updateOption({percent:t}),this.chart.changeData(uh(t))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return h0},e}(et);function gI(r){var e=r.chart,t=r.options,i=t.innerRadius,n=t.radius;return e.coordinate("theta",{innerRadius:i,radius:n}),r}function f0(r,e){var t=r.chart,i=r.options,n=i.innerRadius,a=i.statistic,o=i.percent,s=i.meta;if(t.getController("annotation").clear(!0),n&&a){var l=M(s,["percent","formatter"])||function(c){return"".concat((c*100).toFixed(2),"%")},u=a.content;u&&(u=L({},u,{content:D(u.content)?l(o):u.content})),Bs(t,{statistic:g.__assign(g.__assign({},a),{content:u}),plotType:"ring-progress"},{percent:o})}return e&&t.render(!0),r}function v0(r){return j(c0,Mt({}),gI,f0,vt,ot,St())(r)}var pI={percent:.2,innerRadius:.8,radius:.98,color:["#FAAD14","#E8EDF3"],statistic:{title:!1,content:{style:{fontSize:"14px",fontWeight:300,fill:"#4D4D4D",textAlign:"center",textBaseline:"middle"}}},animation:{}},yI=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="ring-process",t}return e.getDefaultOptions=function(){return pI},e.prototype.changeData=function(t){this.chart.emit(it.BEFORE_CHANGE_DATA,bt.fromData(this.chart,it.BEFORE_CHANGE_DATA,null)),this.updateOption({percent:t}),this.chart.data(uh(t)),f0({chart:this.chart,options:this.options},!0),this.chart.emit(it.AFTER_CHANGE_DATA,bt.fromData(this.chart,it.AFTER_CHANGE_DATA,null))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return v0},e}(et);function Vr(r,e){return mI(r)||xI(r,e)||wI()}function mI(r){if(Array.isArray(r))return r}function xI(r,e){var t=[],i=!0,n=!1,a=void 0;try{for(var o=r[Symbol.iterator](),s;!(i=(s=o.next()).done)&&(t.push(s.value),!(e&&t.length===e));i=!0);}catch(l){n=!0,a=l}finally{try{!i&&o.return!=null&&o.return()}finally{if(n)throw a}}return t}function wI(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function ch(r,e,t,i){r=r.filter(function(d,p){var y=e(d,p),m=t(d,p);return y!=null&&isFinite(y)&&m!=null&&isFinite(m)}),i&&r.sort(function(d,p){return e(d)-e(p)});for(var n=r.length,a=new Float64Array(n),o=new Float64Array(n),s=0,l=0,u,c,h,f=0;fn&&(c.splice(v+1,0,m),f=!0)}return f}}function ka(r,e,t,i){var n=i-r*r,a=Math.abs(n)<1e-24?0:(t-r*e)/n,o=e-a*r;return[o,a]}function bI(){var r=function(a){return a[0]},e=function(a){return a[1]},t;function i(n){var a=0,o=0,s=0,l=0,u=0,c=0,h=t?+t[0]:1/0,f=t?+t[1]:-1/0;Si(n,r,e,function(_,w){var b=Math.log(w),C=_*w;++a,o+=(w-o)/a,l+=(C-l)/a,c+=(_*C-c)/a,s+=(w*b-s)/a,u+=(C*b-u)/a,t||(_f&&(f=_))});var v=ka(l/o,s/o,u/o,c/o),d=Vr(v,2),p=d[0],y=d[1];p=Math.exp(p);var m=function(w){return p*Math.exp(y*w)},x=Ea(h,f,m);return x.a=p,x.b=y,x.predict=m,x.rSquared=un(n,r,e,o,m),x}return i.domain=function(n){return arguments.length?(t=n,i):t},i.x=function(n){return arguments.length?(r=n,i):r},i.y=function(n){return arguments.length?(e=n,i):e},i}function d0(){var r=function(a){return a[0]},e=function(a){return a[1]},t;function i(n){var a=0,o=0,s=0,l=0,u=0,c=t?+t[0]:1/0,h=t?+t[1]:-1/0;Si(n,r,e,function(x,_){++a,o+=(x-o)/a,s+=(_-s)/a,l+=(x*_-l)/a,u+=(x*x-u)/a,t||(xh&&(h=x))});var f=ka(o,s,l,u),v=Vr(f,2),d=v[0],p=v[1],y=function(_){return p*_+d},m=[[c,y(c)],[h,y(h)]];return m.a=p,m.b=d,m.predict=y,m.rSquared=un(n,r,e,s,y),m}return i.domain=function(n){return arguments.length?(t=n,i):t},i.x=function(n){return arguments.length?(r=n,i):r},i.y=function(n){return arguments.length?(e=n,i):e},i}function SI(r){r.sort(function(t,i){return t-i});var e=r.length/2;return e%1===0?(r[e-1]+r[e])/2:r[Math.floor(e)]}var fd=2,vd=1e-12;function CI(){var r=function(a){return a[0]},e=function(a){return a[1]},t=.3;function i(n){for(var a=ch(n,r,e,!0),o=Vr(a,4),s=o[0],l=o[1],u=o[2],c=o[3],h=s.length,f=Math.max(2,~~(t*h)),v=new Float64Array(h),d=new Float64Array(h),p=new Float64Array(h).fill(1),y=-1;++y<=fd;){for(var m=[0,f-1],x=0;xs[b]-_?w:b,A=0,F=0,E=0,T=0,k=0,P=1/Math.abs(s[C]-_||1),B=w;B<=b;++B){var z=s[B],X=l[B],I=MI(Math.abs(_-z)*P)*p[B],R=z*I;A+=I,F+=R,E+=X*I,T+=X*R,k+=z*R}var $=ka(F/A,E/A,T/A,k/A),G=Vr($,2),V=G[0],H=G[1];v[x]=V+H*_,d[x]=Math.abs(l[x]-v[x]),AI(s,x+1,m)}if(y===fd)break;var Z=SI(d);if(Math.abs(Z)=1?vd:(Q=1-U*U)*Q}return FI(s,v,u,c)}return i.bandwidth=function(n){return arguments.length?(t=n,i):t},i.x=function(n){return arguments.length?(r=n,i):r},i.y=function(n){return arguments.length?(e=n,i):e},i}function MI(r){return(r=1-r*r*r)*r*r}function AI(r,e,t){var i=r[e],n=t[0],a=t[1]+1;if(!(a>=r.length))for(;e>n&&r[a]-i<=i-r[n];)t[0]=++n,t[1]=a,++a}function FI(r,e,t,i){for(var n=r.length,a=[],o=0,s=0,l=[],u;of&&(f=w))});var d=ka(s,l,u,c),p=Vr(d,2),y=p[0],m=p[1],x=function(b){return m*Math.log(b)/v+y},_=Ea(h,f,x);return _.a=m,_.b=y,_.predict=x,_.rSquared=un(a,r,e,l,x),_}return n.domain=function(a){return arguments.length?(i=a,n):i},n.x=function(a){return arguments.length?(r=a,n):r},n.y=function(a){return arguments.length?(e=a,n):e},n.base=function(a){return arguments.length?(t=a,n):t},n}function g0(){var r=function(a){return a[0]},e=function(a){return a[1]},t;function i(n){var a=ch(n,r,e),o=Vr(a,4),s=o[0],l=o[1],u=o[2],c=o[3],h=s.length,f=0,v=0,d=0,p=0,y=0,m,x,_,w;for(m=0;mF&&(F=I))});var E=d-f*f,T=f*E-v*v,k=(y*f-p*v)/T,P=(p*E-y*v)/T,B=-k*f,z=function(R){return R=R-u,k*R*R+P*R+B+c},X=Ea(A,F,z);return X.a=k,X.b=P-2*k*u,X.c=B-P*u+k*u*u+c,X.predict=z,X.rSquared=un(n,r,e,b,z),X}return i.domain=function(n){return arguments.length?(t=n,i):t},i.x=function(n){return arguments.length?(r=n,i):r},i.y=function(n){return arguments.length?(e=n,i):e},i}function EI(){var r=function(o){return o[0]},e=function(o){return o[1]},t=3,i;function n(a){if(t===1){var o=d0().x(r).y(e).domain(i)(a);return o.coefficients=[o.b,o.a],delete o.a,delete o.b,o}if(t===2){var s=g0().x(r).y(e).domain(i)(a);return s.coefficients=[s.c,s.b,s.a],delete s.a,delete s.b,delete s.c,s}var l=ch(a,r,e),u=Vr(l,4),c=u[0],h=u[1],f=u[2],v=u[3],d=c.length,p=[],y=[],m=t+1,x=0,_=0,w=i?+i[0]:1/0,b=i?+i[1]:-1/0;Si(a,r,e,function(z,X){++_,x+=(X-x)/_,i||(zb&&(b=z))});var C,A,F,E,T;for(C=0;C=0;--a)for(s=e[a],l=1,n[a]+=s,o=1;o<=a;++o)l*=(a+1-o)/o,n[a-o]+=s*Math.pow(t,o)*l;return n[0]+=i,n}function LI(r){var e=r.length-1,t=[],i,n,a,o,s;for(i=0;iMath.abs(r[i][o])&&(o=n);for(a=i;a=i;a--)r[a][n]-=r[a][i]*r[i][n]/r[i][i]}for(n=e-1;n>=0;--n){for(s=0,a=n+1;af&&(f=_))});var v=ka(o,s,l,u),d=Vr(v,2),p=d[0],y=d[1];p=Math.exp(p);var m=function(w){return p*Math.pow(w,y)},x=Ea(h,f,m);return x.a=p,x.b=y,x.predict=m,x.rSquared=un(n,r,e,c,m),x}return i.domain=function(n){return arguments.length?(t=n,i):t},i.x=function(n){return arguments.length?(r=n,i):r},i.y=function(n){return arguments.length?(e=n,i):e},i}var PI={exp:bI,linear:d0,loess:CI,log:TI,poly:EI,pow:II,quad:g0};function DI(r,e){var t=10,i={regionStyle:[{position:{start:[r,"max"],end:["max",e]},style:{fill:"#d8d0c0",opacity:.4}},{position:{start:["min","max"],end:[r,e]},style:{fill:"#a3dda1",opacity:.4}},{position:{start:["min",e],end:[r,"min"]},style:{fill:"#d8d0c0",opacity:.4}},{position:{start:[r,e],end:["max","min"]},style:{fill:"#a3dda1",opacity:.4}}],lineStyle:{stroke:"#9ba29a",lineWidth:1},labelStyle:[{position:["max",e],offsetX:-t,offsetY:-t,style:{textAlign:"right",textBaseline:"bottom",fontSize:14,fill:"#ccc"}},{position:["min",e],offsetX:t,offsetY:-t,style:{textAlign:"left",textBaseline:"bottom",fontSize:14,fill:"#ccc"}},{position:["min",e],offsetX:t,offsetY:t,style:{textAlign:"left",textBaseline:"top",fontSize:14,fill:"#ccc"}},{position:["max",e],offsetX:-t,offsetY:t,style:{textAlign:"right",textBaseline:"top",fontSize:14,fill:"#ccc"}}]};return i}var BI=function(r,e){var t=e.view,i=e.options,n=i.xField,a=i.yField,o=t.getScaleByField(n),s=t.getScaleByField(a),l=r.map(function(u){return t.getCoordinate().convert({x:o.scale(u[0]),y:s.scale(u[1])})});return qE(l,!1)},OI=function(r){var e=r.options,t=e.xField,i=e.yField,n=e.data,a=e.regressionLine,o=a.type,s=o===void 0?"linear":o,l=a.algorithm,u=a.equation,c,h=null;if(l)c=O(l)?l:l(n),h=u;else{var f=PI[s]().x(function(v){return v[t]}).y(function(v){return v[i]});c=f(n),h=NI(s,c)}return[BI(c,r),h]},RI=function(r){var e,t=r.meta,i=t===void 0?{}:t,n=r.xField,a=r.yField,o=r.data,s=o[0][n],l=o[0][a],u=s>0,c=l>0;function h(f,v){var d=M(i,[f]);function p(m){return M(d,m)}var y={};return v==="x"?(tt(s)&&(tt(p("min"))||(y.min=u?0:s*2),tt(p("max"))||(y.max=u?s*2:0)),y):(tt(l)&&(tt(p("min"))||(y.min=c?0:l*2),tt(p("max"))||(y.max=c?l*2:0)),y)}return g.__assign(g.__assign({},i),(e={},e[n]=g.__assign(g.__assign({},i[n]),h(n,"x")),e[a]=g.__assign(g.__assign({},i[a]),h(a,"y")),e))};function NI(r,e){var t,i,n,a=function(u,c){return c===void 0&&(c=4),Math.round(u*Math.pow(10,c))/Math.pow(10,c)},o=function(u){return Number.isFinite(u)?a(u):"?"};switch(r){case"linear":return"y = ".concat(o(e.a),"x + ").concat(o(e.b),", R^2 = ").concat(o(e.rSquared));case"exp":return"y = ".concat(o(e.a),"e^(").concat(o(e.b),"x), R^2 = ").concat(o(e.rSquared));case"log":return"y = ".concat(o(e.a),"ln(x) + ").concat(o(e.b),", R^2 = ").concat(o(e.rSquared));case"quad":return"y = ".concat(o(e.a),"x^2 + ").concat(o(e.b),"x + ").concat(o(e.c),", R^2 = ").concat(o(e.rSquared));case"poly":for(var s="y = ".concat(o((t=e.coefficients)===null||t===void 0?void 0:t[0])," + ").concat(o((i=e.coefficients)===null||i===void 0?void 0:i[1]),"x + ").concat(o((n=e.coefficients)===null||n===void 0?void 0:n[2]),"x^2"),l=3;l
    ',itemTpl:"{value}",domStyles:{"g2-tooltip":{padding:"2px 4px",fontSize:"10px"}},showCrosshairs:!0,crosshairs:{type:"x"}},rP={appendPadding:2,tooltip:g.__assign({},b0),animation:{}};function iP(r){var e=r.chart,t=r.options,i=t.data,n=t.color,a=t.areaStyle,o=t.point,s=t.line,l=o==null?void 0:o.state,u=Ci(i);e.data(u);var c=L({},r,{options:{xField:fa,yField:Vi,area:{color:n,style:a},line:s,point:o}}),h=L({},c,{options:{tooltip:!1}}),f=L({},c,{options:{tooltip:!1,state:l}});return Ns(c),ln(h),pe(f),e.axis(!1),e.legend(!1),r}function cn(r){var e,t,i=r.options,n=i.xAxis,a=i.yAxis,o=i.data,s=Ci(o);return j(Mt((e={},e[fa]=n,e[Vi]=a,e),(t={},t[fa]={type:"cat"},t[Vi]=Zc(s,Vi),t)))(r)}function S0(r){return j(ge("areaStyle"),iP,cn,Pt,ot,vt,St())(r)}var nP={appendPadding:2,tooltip:g.__assign({},b0),color:"l(90) 0:#E5EDFE 1:#ffffff",areaStyle:{fillOpacity:.6},line:{size:1,color:"#5B8FF9"},animation:{}},aP=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="tiny-area",t}return e.getDefaultOptions=function(){return nP},e.prototype.changeData=function(t){this.updateOption({data:t});var i=this,n=i.chart,a=i.options;cn({chart:n,options:a}),n.changeData(Ci(t))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return S0},e}(et);function oP(r){var e=r.chart,t=r.options,i=t.data,n=t.color,a=t.columnStyle,o=t.columnWidthRatio,s=Ci(i);e.data(s);var l=L({},r,{options:{xField:fa,yField:Vi,widthRatio:o,interval:{style:a,color:n}}});return Ht(l),e.axis(!1),e.legend(!1),e.interaction("element-active"),r}function C0(r){return j(ot,ge("columnStyle"),oP,cn,Pt,vt,St())(r)}var sP={showTitle:!1,shared:!0,showMarkers:!1,customContent:function(r,e){return"".concat(M(e,[0,"data","y"],0))},containerTpl:'
    ',itemTpl:"{value}",domStyles:{"g2-tooltip":{padding:"2px 4px",fontSize:"10px"}}},lP={appendPadding:2,tooltip:g.__assign({},sP),animation:{}},uP=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="tiny-column",t}return e.getDefaultOptions=function(){return lP},e.prototype.changeData=function(t){this.updateOption({data:t});var i=this,n=i.chart,a=i.options;cn({chart:n,options:a}),n.changeData(Ci(t))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return C0},e}(et);function cP(r){var e=r.chart,t=r.options,i=t.data,n=t.color,a=t.lineStyle,o=t.point,s=o==null?void 0:o.state,l=Ci(i);e.data(l);var u=L({},r,{options:{xField:fa,yField:Vi,line:{color:n,style:a},point:o}}),c=L({},u,{options:{tooltip:!1,state:s}});return ln(u),pe(c),e.axis(!1),e.legend(!1),r}function M0(r){return j(cP,cn,ot,Pt,vt,St())(r)}var hP=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="tiny-line",t}return e.getDefaultOptions=function(){return rP},e.prototype.changeData=function(t){this.updateOption({data:t});var i=this,n=i.chart,a=i.options;cn({chart:n,options:a}),n.changeData(Ci(t))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return M0},e}(et),fP={line:Rm,pie:l0,column:Hs,bar:Gm,area:Nm,gauge:e0,"tiny-line":M0,"tiny-column":C0,"tiny-area":S0,"ring-progress":v0,progress:h0,scatter:y0,histogram:i0,funnel:Um,stock:_0},vP={line:KL,pie:hI,column:cL,bar:lL,area:zk,gauge:YL,"tiny-line":hP,"tiny-column":uP,"tiny-area":aP,"ring-progress":yI,progress:dI,scatter:qI,histogram:jL,funnel:DL,stock:eP},dP={pie:{label:!1},column:{tooltip:{showMarkers:!1}},bar:{tooltip:{showMarkers:!1}}};function Tu(r,e,t){var i=vP[r];if(!i){console.error("could not find ".concat(r," plot"));return}var n=fP[r];n({chart:e,options:L({},i.getDefaultOptions(),M(dP,r,{}),t)})}function gP(r){var e=r.chart,t=r.options,i=t.views,n=t.legend;return S(i,function(a){var o=a.region,s=a.data,l=a.meta,u=a.axes,c=a.coordinate,h=a.interactions,f=a.annotations,v=a.tooltip,d=a.geometries,p=e.createView({region:o});p.data(s);var y={};u&&S(u,function(m,x){y[x]=ct(m,ne)}),y=L({},l,y),p.scale(y),u?S(u,function(m,x){p.axis(x,m)}):p.axis(!1),p.coordinate(c),S(d,function(m){var x=ue({chart:p,options:m}).ext,_=m.adjust;_&&x.geometry.adjust(_)}),S(h,function(m){m.enable===!1?p.removeInteraction(m.type):p.interaction(m.type,m.cfg)}),S(f,function(m){p.annotation()[m.type](g.__assign({},m))}),typeof a.animation=="boolean"?p.animate(!1):(p.animate(!0),S(p.geometries,function(m){m.animate(a.animation)})),v&&(p.interaction("tooltip"),p.tooltip(v))}),n?S(n,function(a,o){e.legend(o,a)}):e.legend(!1),e.tooltip(t.tooltip),r}function pP(r){var e=r.chart,t=r.options,i=t.plots,n=t.data,a=n===void 0?[]:n;return S(i,function(o){var s=o.type,l=o.region,u=o.options,c=u===void 0?{}:u,h=o.top,f=c.tooltip;if(h){Tu(s,e,g.__assign(g.__assign({},c),{data:a}));return}var v=e.createView(g.__assign({region:l},ct(c,Pm)));f&&v.interaction("tooltip"),Tu(s,v,g.__assign({data:a},c))}),r}function yP(r){var e=r.chart,t=r.options;return e.option("slider",t.slider),r}function mP(r){return j(vt,gP,pP,wt,vt,ot,Pt,yP,St())(r)}function xP(r,e){var t=r.getModel(),i=t.data,n;return O(i)?n=i[0][e]:n=i[e],n}function wP(r){var e=Yo(r);S(e,function(t){t.hasState("active")&&t.setState("active",!1),t.hasState("selected")&&t.setState("selected",!1),t.hasState("inactive")&&t.setState("inactive",!1)})}var _P=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getAssociationItems=function(t,i){var n,a=this.context.event,o=i||{},s=o.linkField,l=o.dim,u=[];if(!((n=a.data)===null||n===void 0)&&n.data){var c=a.data.data;S(t,function(h){var f,v,d=s;if(l==="x"?d=h.getXScale().field:l==="y"?d=(f=h.getYScales().find(function(y){return y.field===d}))===null||f===void 0?void 0:f.field:d||(d=(v=h.getGroupScales()[0])===null||v===void 0?void 0:v.field),!!d){var p=xt(Yo(h),function(y){var m=!1,x=!1,_=O(c)?M(c[0],d):M(c,d);return xP(y,d)===_?m=!0:x=!0,{element:y,view:h,active:m,inactive:x}});u.push.apply(u,p)}})}return u},e.prototype.showTooltip=function(t){var i=od(this.context.view),n=this.getAssociationItems(i,t);S(n,function(a){if(a.active){var o=a.element.shape.getCanvasBBox();a.view.showTooltip({x:o.minX+o.width/2,y:o.minY+o.height/2})}})},e.prototype.hideTooltip=function(){var t=od(this.context.view);S(t,function(i){i.hideTooltip()})},e.prototype.active=function(t){var i=Tn(this.context.view),n=this.getAssociationItems(i,t);S(n,function(a){var o=a.active,s=a.element;o&&s.setState("active",!0)})},e.prototype.selected=function(t){var i=Tn(this.context.view),n=this.getAssociationItems(i,t);S(n,function(a){var o=a.active,s=a.element;o&&s.setState("selected",!0)})},e.prototype.highlight=function(t){var i=Tn(this.context.view),n=this.getAssociationItems(i,t);S(n,function(a){var o=a.inactive,s=a.element;o&&s.setState("inactive",!0)})},e.prototype.reset=function(){var t=Tn(this.context.view);S(t,function(i){wP(i)})},e}(yt);q("association",_P);J("association-active",{start:[{trigger:"element:mouseenter",action:"association:active"}],end:[{trigger:"element:mouseleave",action:"association:reset"}]});J("association-selected",{start:[{trigger:"element:mouseenter",action:"association:selected"}],end:[{trigger:"element:mouseleave",action:"association:reset"}]});J("association-highlight",{start:[{trigger:"element:mouseenter",action:"association:highlight"}],end:[{trigger:"element:mouseleave",action:"association:reset"}]});J("association-tooltip",{start:[{trigger:"element:mousemove",action:"association:showTooltip"}],end:[{trigger:"element:mouseleave",action:"association:hideTooltip"}]});(function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="mix",t}return e.prototype.getSchemaAdaptor=function(){return mP},e})(et);var dd;(function(r){r.DEV="DEV",r.BETA="BETA",r.STABLE="STABLE"})(dd||(dd={}));var We="first-axes-view",qe="second-axes-view",ei="series-field-key";function A0(r,e,t,i,n){var a=[];e.forEach(function(h){i.forEach(function(f){var v,d=(v={},v[r]=f[r],v[t]=h,v[h]=f[h],v);a.push(d)})});var o=Object.values(be(a,t)),s=o[0],l=s===void 0?[]:s,u=o[1],c=u===void 0?[]:u;return n?[l.reverse(),c.reverse()]:[l,c]}function or(r){return r!=="vertical"}function bP(r,e,t){var i=e[0],n=e[1],a=i.autoPadding,o=n.autoPadding,s=r.__axisPosition,l=s.layout,u=s.position;if(or(l)&&u==="top"&&(i.autoPadding=t.instance(a.top,0,a.bottom,a.left),n.autoPadding=t.instance(o.top,a.left,o.bottom,0)),or(l)&&u==="bottom"&&(i.autoPadding=t.instance(a.top,a.right/2+5,a.bottom,a.left),n.autoPadding=t.instance(o.top,o.right,o.bottom,a.right/2+5)),!or(l)&&u==="bottom"){var c=a.left>=o.left?a.left:o.left;i.autoPadding=t.instance(a.top,a.right,a.bottom/2+5,c),n.autoPadding=t.instance(a.bottom/2+5,o.right,o.bottom,c)}if(!or(l)&&u==="top"){var c=a.left>=o.left?a.left:o.left;i.autoPadding=t.instance(a.top,a.right,0,c),n.autoPadding=t.instance(0,o.right,a.top,c)}}function SP(r){var e=r.chart,t=r.options,i=t.data,n=t.xField,a=t.yField,o=t.color,s=t.barStyle,l=t.widthRatio,u=t.legend,c=t.layout,h=A0(n,a,ei,i,or(c));u?e.legend(ei,u):u===!1&&e.legend(!1);var f,v,d=h[0],p=h[1];or(c)?(f=e.createView({region:{start:{x:0,y:0},end:{x:.5,y:1}},id:We}),f.coordinate().transpose().reflect("x"),v=e.createView({region:{start:{x:.5,y:0},end:{x:1,y:1}},id:qe}),v.coordinate().transpose(),f.data(d),v.data(p)):(f=e.createView({region:{start:{x:0,y:0},end:{x:1,y:.5}},id:We}),v=e.createView({region:{start:{x:0,y:.5},end:{x:1,y:1}},id:qe}),v.coordinate().reflect("y"),f.data(d),v.data(p));var y=L({},r,{chart:f,options:{widthRatio:l,xField:n,yField:a[0],seriesField:ei,interval:{color:o,style:s}}});Ht(y);var m=L({},r,{chart:v,options:{xField:n,yField:a[1],seriesField:ei,widthRatio:l,interval:{color:o,style:s}}});return Ht(m),r}function CP(r){var e,t,i,n=r.options,a=r.chart,o=n.xAxis,s=n.yAxis,l=n.xField,u=n.yField,c=nt(a,We),h=nt(a,qe),f={};return pa((n==null?void 0:n.meta)||{}).map(function(v){M(n==null?void 0:n.meta,[v,"alias"])&&(f[v]=n.meta[v].alias)}),a.scale((e={},e[ei]={sync:!0,formatter:function(v){return M(f,v,v)}},e)),Mt((t={},t[l]=o,t[u[0]]=s[u[0]],t))(L({},r,{chart:c})),Mt((i={},i[l]=o,i[u[1]]=s[u[1]],i))(L({},r,{chart:h})),r}function MP(r){var e=r.chart,t=r.options,i=t.xAxis,n=t.yAxis,a=t.xField,o=t.yField,s=t.layout,l=nt(e,We),u=nt(e,qe);return(i==null?void 0:i.position)==="bottom"?u.axis(a,g.__assign(g.__assign({},i),{label:{formatter:function(){return""}}})):u.axis(a,!1),i===!1?l.axis(a,!1):l.axis(a,g.__assign({position:or(s)?"top":"bottom"},i)),n===!1?(l.axis(o[0],!1),u.axis(o[1],!1)):(l.axis(o[0],n[o[0]]),u.axis(o[1],n[o[1]])),e.__axisPosition={position:l.getOptions().axes[a].position,layout:s},r}function AP(r){var e=r.chart;return wt(L({},r,{chart:nt(e,We)})),wt(L({},r,{chart:nt(e,qe)})),r}function FP(r){var e=r.chart,t=r.options,i=t.yField,n=t.yAxis;return yi(L({},r,{chart:nt(e,We),options:{yAxis:n[i[0]]}})),yi(L({},r,{chart:nt(e,qe),options:{yAxis:n[i[1]]}})),r}function TP(r){var e=r.chart;return ot(L({},r,{chart:nt(e,We)})),ot(L({},r,{chart:nt(e,qe)})),ot(r),r}function EP(r){var e=r.chart;return vt(L({},r,{chart:nt(e,We)})),vt(L({},r,{chart:nt(e,qe)})),r}function kP(r){var e=this,t,i,n=r.chart,a=r.options,o=a.label,s=a.yField,l=a.layout,u=nt(n,We),c=nt(n,qe),h=$t(u,"interval"),f=$t(c,"interval");if(!o)h.label(!1),f.label(!1);else{var v=o.callback,d=g.__rest(o,["callback"]);d.position||(d.position="middle"),d.offset===void 0&&(d.offset=2);var p=g.__assign({},d);if(or(l)){var y=((t=p.style)===null||t===void 0?void 0:t.textAlign)||(d.position==="middle"?"center":"left");d.style=L({},d.style,{textAlign:y});var m={left:"right",right:"left",center:"center"};p.style=L({},p.style,{textAlign:m[y]})}else{var x={top:"bottom",bottom:"top",middle:"middle"};typeof d.position=="string"?d.position=x[d.position]:typeof d.position=="function"&&(d.position=function(){for(var b=[],C=0;C1?"".concat(e,"_").concat(t):"".concat(e)}function E0(r){var e=r.data,t=r.xField,i=r.measureField,n=r.rangeField,a=r.targetField,o=r.layout,s=[],l=[];e.forEach(function(h,f){var v=[h[n]].flat();v.sort(function(y,m){return y-m}),v.forEach(function(y,m){var x,_=m===0?y:v[m]-v[m-1];s.push((x={rKey:"".concat(n,"_").concat(m)},x[t]=t?h[t]:String(f),x[n]=_,x))});var d=[h[i]].flat();d.forEach(function(y,m){var x;s.push((x={mKey:gd(d,i,m)},x[t]=t?h[t]:String(f),x[i]=y,x))});var p=[h[a]].flat();p.forEach(function(y,m){var x;s.push((x={tKey:gd(p,a,m)},x[t]=t?h[t]:String(f),x[a]=y,x))}),l.push(h[n],h[i],h[a])});var u=Math.min.apply(Math,l.flat(1/0)),c=Math.max.apply(Math,l.flat(1/0));return u=u>0?0:u,o==="vertical"&&s.reverse(),{min:u,max:c,ds:s}}function GP(r){var e=r.chart,t=r.options,i=t.bulletStyle,n=t.targetField,a=t.rangeField,o=t.measureField,s=t.xField,l=t.color,u=t.layout,c=t.size,h=t.label,f=E0(t),v=f.min,d=f.max,p=f.ds;e.data(p);var y=L({},r,{options:{xField:s,yField:a,seriesField:"rKey",isStack:!0,label:M(h,"range"),interval:{color:M(l,"range"),style:M(i,"range"),size:M(c,"range")}}});Ht(y),e.geometries[0].tooltip(!1);var m=L({},r,{options:{xField:s,yField:o,seriesField:"mKey",isStack:!0,label:M(h,"measure"),interval:{color:M(l,"measure"),style:M(i,"measure"),size:M(c,"measure")}}});Ht(m);var x=L({},r,{options:{xField:s,yField:n,seriesField:"tKey",label:M(h,"target"),point:{color:M(l,"target"),style:M(i,"target"),size:W(M(c,"target"))?function(_){return M(c,"target")(_)/2}:M(c,"target")/2,shape:u==="horizontal"?"line":"hyphen"}}});return pe(x),u==="horizontal"&&e.coordinate().transpose(),g.__assign(g.__assign({},r),{ext:{data:{min:v,max:d}}})}function k0(r){var e,t,i=r.options,n=r.ext,a=i.xAxis,o=i.yAxis,s=i.targetField,l=i.rangeField,u=i.measureField,c=i.xField,h=n.data;return j(Mt((e={},e[c]=a,e[u]=o,e),(t={},t[u]={min:h==null?void 0:h.min,max:h==null?void 0:h.max,sync:!0},t[s]={sync:"".concat(u)},t[l]={sync:"".concat(u)},t)))(r)}function YP(r){var e=r.chart,t=r.options,i=t.xAxis,n=t.yAxis,a=t.xField,o=t.measureField,s=t.rangeField,l=t.targetField;return e.axis("".concat(s),!1),e.axis("".concat(l),!1),i===!1?e.axis("".concat(a),!1):e.axis("".concat(a),i),n===!1?e.axis("".concat(o),!1):e.axis("".concat(o),n),r}function $P(r){var e=r.chart,t=r.options,i=t.legend;return e.removeInteraction("legend-filter"),e.legend(i),e.legend("rKey",!1),e.legend("mKey",!1),e.legend("tKey",!1),r}function HP(r){var e=r.chart,t=r.options,i=t.label,n=t.measureField,a=t.targetField,o=t.rangeField,s=e.geometries,l=s[0],u=s[1],c=s[2];return M(i,"range")?l.label("".concat(o),g.__assign({layout:[{type:"limit-in-plot"}]},Ot(i.range))):l.label(!1),M(i,"measure")?u.label("".concat(n),g.__assign({layout:[{type:"limit-in-plot"}]},Ot(i.measure))):u.label(!1),M(i,"target")?c.label("".concat(a),g.__assign({layout:[{type:"limit-in-plot"}]},Ot(i.target))):c.label(!1),r}function XP(r){j(GP,k0,YP,$P,ot,HP,Pt,wt,vt)(r)}var WP=L({},et.getDefaultOptions(),{layout:"horizontal",size:{range:30,measure:20,target:20},xAxis:{tickLine:!1,line:null},bulletStyle:{range:{fillOpacity:.5}},label:{measure:{position:"right"}},tooltip:{showMarkers:!1}});(function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="bullet",t}return e.getDefaultOptions=function(){return WP},e.prototype.changeData=function(t){this.updateOption({data:t});var i=E0(this.options),n=i.min,a=i.max,o=i.ds;k0({options:this.options,ext:{data:{min:n,max:a}},chart:this.chart}),this.chart.changeData(o)},e.prototype.getSchemaAdaptor=function(){return XP},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e})(et);var qP={y:0,nodeWidthRatio:.05,weight:!1,nodePaddingRatio:.1,id:function(r){return r.id},source:function(r){return r.source},target:function(r){return r.target},sourceWeight:function(r){return r.value||1},targetWeight:function(r){return r.value||1},sortBy:null};function UP(r,e,t){S(r,function(i,n){i.inEdges=e.filter(function(a){return"".concat(t.target(a))==="".concat(n)}),i.outEdges=e.filter(function(a){return"".concat(t.source(a))==="".concat(n)}),i.edges=i.outEdges.concat(i.inEdges),i.frequency=i.edges.length,i.value=0,i.inEdges.forEach(function(a){i.value+=t.targetWeight(a)}),i.outEdges.forEach(function(a){i.value+=t.sourceWeight(a)})})}function jP(r,e){var t={weight:function(n,a){return a.value-n.value},frequency:function(n,a){return a.frequency-n.frequency},id:function(n,a){return"".concat(e.id(n)).localeCompare("".concat(e.id(a)))}},i=t[e.sortBy];!i&&W(e.sortBy)&&(i=e.sortBy),i&&r.sort(i)}function ZP(r,e){var t=r.length;if(!t)throw new TypeError("Invalid nodes: it's empty!");if(e.weight){var i=e.nodePaddingRatio;if(i<0||i>=1)throw new TypeError("Invalid nodePaddingRatio: it must be in range [0, 1)!");var n=i/(2*t),a=e.nodeWidthRatio;if(a<=0||a>=1)throw new TypeError("Invalid nodeWidthRatio: it must be in range (0, 1)!");var o=0;r.forEach(function(l){o+=l.value}),r.forEach(function(l){l.weight=l.value/o,l.width=l.weight*(1-i),l.height=a}),r.forEach(function(l,u){for(var c=0,h=u-1;h>=0;h--)c+=r[h].width+2*n;var f=l.minX=n+c,v=l.maxX=l.minX+l.width,d=l.minY=e.y-a/2,p=l.maxY=d+a;l.x=[f,v,v,f],l.y=[d,d,p,p]})}else{var s=1/t;r.forEach(function(l,u){l.x=(u+.5)*s,l.y=e.y})}return r}function QP(r,e,t){if(t.weight){var i={};S(r,function(n,a){i[a]=n.value}),e.forEach(function(n){var a=t.source(n),o=t.target(n),s=r[a],l=r[o];if(s&&l){var u=i[a],c=t.sourceWeight(n),h=s.minX+(s.value-u)/s.value*s.width,f=h+c/s.value*s.width;i[a]-=c;var v=i[o],d=t.targetWeight(n),p=l.minX+(l.value-v)/l.value*l.width,y=p+d/l.value*l.width;i[o]-=d;var m=t.y;n.x=[h,f,p,y],n.y=[m,m,m,m],n.source=s,n.target=l}})}else e.forEach(function(n){var a=r[t.source(n)],o=r[t.target(n)];a&&o&&(n.x=[a.x,o.x],n.y=[a.y,o.y],n.source=a,n.target=o)});return e}function KP(r){return ft({},qP,r)}function JP(r,e){var t=KP(r),i={},n=e.nodes,a=e.links;n.forEach(function(l){var u=t.id(l);i[u]=l}),UP(i,a,t),jP(n,t);var o=ZP(n,t),s=QP(i,a,t);return{nodes:o,links:s}}var L0="x",I0="y",P0="name",D0="source",tD={nodeStyle:{opacity:1,fillOpacity:1,lineWidth:1},edgeStyle:{opacity:.5,lineWidth:2},label:{fields:["x","name"],callback:function(r,e){var t=(r[0]+r[1])/2,i=t>.5?-4:4;return{offsetX:i,content:e}},labelEmit:!0,style:{fill:"#8c8c8c"}},tooltip:{showTitle:!1,showMarkers:!1,fields:["source","target","value","isNode"],showContent:function(r){return!M(r,[0,"data","isNode"])},formatter:function(r){var e=r.source,t=r.target,i=r.value;return{name:"".concat(e," -> ").concat(t),value:i}}},interactions:[{type:"element-active"}],weight:!0,nodePaddingRatio:.1,nodeWidthRatio:.05};function eD(r){var e=r.options,t=e.data,i=e.sourceField,n=e.targetField,a=e.weightField,o=e.nodePaddingRatio,s=e.nodeWidthRatio,l=e.rawFields,u=l===void 0?[]:l,c=wm(t,i,n,a),h=JP({weight:!0,nodePaddingRatio:o,nodeWidthRatio:s},c),f=h.nodes,v=h.links,d=f.map(function(y){return g.__assign(g.__assign({},ct(y,g.__spreadArray(["id","x","y","name"],u,!0))),{isNode:!0})}),p=v.map(function(y){return g.__assign(g.__assign({source:y.source.name,target:y.target.name,name:y.source.name||y.target.name},ct(y,g.__spreadArray(["x","y","value"],u,!0))),{isNode:!1})});return g.__assign(g.__assign({},r),{ext:g.__assign(g.__assign({},r.ext),{chordData:{nodesData:d,edgesData:p}})})}function rD(r){var e,t=r.chart;return t.scale((e={x:{sync:!0,nice:!0},y:{sync:!0,nice:!0,max:1}},e[P0]={sync:"color"},e[D0]={sync:"color"},e)),r}function iD(r){var e=r.chart;return e.axis(!1),r}function nD(r){var e=r.chart;return e.legend(!1),r}function aD(r){var e=r.chart,t=r.options,i=t.tooltip;return e.tooltip(i),r}function oD(r){var e=r.chart;return e.coordinate("polar").reflect("y"),r}function sD(r){var e=r.chart,t=r.options,i=r.ext.chordData.nodesData,n=t.nodeStyle,a=t.label,o=t.tooltip,s=e.createView();return s.data(i),zs({chart:s,options:{xField:L0,yField:I0,seriesField:P0,polygon:{style:n},label:a,tooltip:o}}),r}function lD(r){var e=r.chart,t=r.options,i=r.ext.chordData.edgesData,n=t.edgeStyle,a=t.tooltip,o=e.createView();o.data(i);var s={xField:L0,yField:I0,seriesField:D0,edge:{style:n,shape:"arc"},tooltip:a};return km({chart:o,options:s}),r}function uD(r){var e=r.chart,t=r.options,i=t.animation;return Aa(e,i,GE(e)),r}function cD(r){return j(ot,eD,oD,rD,iD,nD,aD,lD,sD,wt,Hr,uD)(r)}(function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="chord",t}return e.getDefaultOptions=function(){return tD},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return cD},e})(et);var hD=["x","y","r","name","value","path","depth"],fD={colorField:"name",autoFit:!0,pointStyle:{lineWidth:0,stroke:"#fff"},legend:!1,hierarchyConfig:{size:[1,1],padding:0},label:{fields:["name"],layout:{type:"limit-in-shape"}},tooltip:{showMarkers:!1,showTitle:!1},drilldown:{enabled:!1}},pd=4,vD=0,yd=5,md="drilldown-bread-crumb",dD={position:"top-left",dividerText:"/",textStyle:{fontSize:12,fill:"rgba(0, 0, 0, 0.65)",cursor:"pointer"},activeTextStyle:{fill:"#87B5FF"}},va="hierarchy-data-transform-params",gD=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.name="drill-down",t.historyCache=[],t.breadCrumbGroup=null,t.breadCrumbCfg=dD,t}return e.prototype.click=function(){var t=M(this.context,["event","data","data"]);if(!t)return!1;this.drill(t),this.drawBreadCrumb()},e.prototype.resetPosition=function(){if(this.breadCrumbGroup){var t=this.context.view.getCoordinate(),i=this.breadCrumbGroup,n=i.getBBox(),a=this.getButtonCfg().position,o={x:t.start.x,y:t.end.y-(n.height+yd*2)};t.isPolar&&(o={x:0,y:0}),a==="bottom-left"&&(o={x:t.start.x,y:t.start.y});var s=se.transform(null,[["t",o.x+vD,o.y+n.height+yd]]);i.setMatrix(s)}},e.prototype.back=function(){Bt(this.historyCache)&&this.backTo(this.historyCache.slice(0,-1))},e.prototype.reset=function(){this.historyCache[0]&&this.backTo(this.historyCache.slice(0,1)),this.historyCache=[],this.hideCrumbGroup()},e.prototype.drill=function(t){var i=this.context.view,n=M(i,["interactions","drill-down","cfg","transformData"],function(u){return u}),a=n(g.__assign({data:t.data},t[va]));i.changeData(a);for(var o=[],s=t;s;){var l=s.data;o.unshift({id:"".concat(l.name,"_").concat(s.height,"_").concat(s.depth),name:l.name,children:n(g.__assign({data:l},t[va]))}),s=s.parent}this.historyCache=(this.historyCache||[]).slice(0,-1).concat(o)},e.prototype.backTo=function(t){if(!(!t||t.length<=0)){var i=this.context.view,n=It(t).children;i.changeData(n),t.length>1?(this.historyCache=t,this.drawBreadCrumb()):(this.historyCache=[],this.hideCrumbGroup())}},e.prototype.getButtonCfg=function(){var t=this.context.view,i=M(t,["interactions","drill-down","cfg","drillDownConfig"]);return L(this.breadCrumbCfg,i==null?void 0:i.breadCrumb,this.cfg)},e.prototype.drawBreadCrumb=function(){this.drawBreadCrumbGroup(),this.resetPosition(),this.breadCrumbGroup.show()},e.prototype.drawBreadCrumbGroup=function(){var t=this,i=this.getButtonCfg(),n=this.historyCache;this.breadCrumbGroup?this.breadCrumbGroup.clear():this.breadCrumbGroup=this.context.view.foregroundGroup.addGroup({name:md});var a=0;n.forEach(function(o,s){var l=t.breadCrumbGroup.addShape({type:"text",id:o.id,name:"".concat(md,"_").concat(o.name,"_text"),attrs:g.__assign(g.__assign({text:s===0&&!D(i.rootText)?i.rootText:o.name},i.textStyle),{x:a,y:0})}),u=l.getBBox();if(a+=u.width+pd,l.on("click",function(f){var v,d=f.target.get("id");if(d!==((v=It(n))===null||v===void 0?void 0:v.id)){var p=n.slice(0,n.findIndex(function(y){return y.id===d})+1);t.backTo(p)}}),l.on("mouseenter",function(f){var v,d=f.target.get("id");d!==((v=It(n))===null||v===void 0?void 0:v.id)?l.attr(i.activeTextStyle):l.attr({cursor:"default"})}),l.on("mouseleave",function(){l.attr(i.textStyle)}),s=0;)e+=t[i].value;r.value=e}function MD(){return this.eachAfter(CD)}function AD(r,e){let t=-1;for(const i of this)r.call(e,i,++t,this);return this}function FD(r,e){for(var t=this,i=[t],n,a,o=-1;t=i.pop();)if(r.call(e,t,++o,this),n=t.children)for(a=n.length-1;a>=0;--a)i.push(n[a]);return this}function TD(r,e){for(var t=this,i=[t],n=[],a,o,s,l=-1;t=i.pop();)if(n.push(t),a=t.children)for(o=0,s=a.length;o=0;)t+=i[n].value;e.value=t})}function LD(r){return this.eachBefore(function(e){e.children&&e.children.sort(r)})}function ID(r){for(var e=this,t=PD(e,r),i=[e];e!==t;)e=e.parent,i.push(e);for(var n=i.length;r!==t;)i.splice(n,0,r),r=r.parent;return i}function PD(r,e){if(r===e)return r;var t=r.ancestors(),i=e.ancestors(),n=null;for(r=t.pop(),e=i.pop();r===e;)n=r,r=t.pop(),e=i.pop();return n}function DD(){for(var r=this,e=[r];r=r.parent;)e.push(r);return e}function BD(){return Array.from(this)}function OD(){var r=[];return this.eachBefore(function(e){e.children||r.push(e)}),r}function RD(){var r=this,e=[];return r.each(function(t){t!==r&&e.push({source:t.parent,target:t})}),e}function*ND(){var r=this,e,t=[r],i,n,a;do for(e=t.reverse(),t=[];r=e.pop();)if(yield r,i=r.children)for(n=0,a=i.length;n=0;--s)n.push(a=o[s]=new Ji(o[s])),a.parent=i,a.depth=i.depth+1;return t.eachBefore(B0)}function zD(){return hn(this).eachBefore(YD)}function VD(r){return r.children}function GD(r){return Array.isArray(r)?r[1]:null}function YD(r){r.data.value!==void 0&&(r.value=r.data.value),r.data=r.data.data}function B0(r){var e=0;do r.height=e;while((r=r.parent)&&r.height<++e)}function Ji(r){this.data=r,this.depth=this.height=0,this.parent=null}Ji.prototype=hn.prototype={constructor:Ji,count:MD,each:AD,eachAfter:TD,eachBefore:FD,find:ED,sum:kD,sort:LD,path:ID,ancestors:DD,descendants:BD,leaves:OD,links:RD,copy:zD,[Symbol.iterator]:ND};function $D(r){return typeof r=="object"&&"length"in r?r:Array.from(r)}function HD(r){for(var e=r.length,t,i;e;)i=Math.random()*e--|0,t=r[e],r[e]=r[i],r[i]=t;return r}function O0(r){for(var e=0,t=(r=HD(Array.from(r))).length,i=[],n,a;e0&&t*t>i*i+n*n}function Tl(r,e){for(var t=0;tl?(n=(u+l-a)/(2*u),s=Math.sqrt(Math.max(0,l/u-n*n)),t.x=r.x-n*i-s*o,t.y=r.y-n*o+s*i):(n=(u+a-l)/(2*u),s=Math.sqrt(Math.max(0,a/u-n*n)),t.x=e.x+n*i-s*o,t.y=e.y+n*o+s*i)):(t.x=e.x+t.r,t.y=e.y)}function wd(r,e){var t=r.r+e.r-1e-6,i=e.x-r.x,n=e.y-r.y;return t>0&&t*t>i*i+n*n}function _d(r){var e=r._,t=r.next._,i=e.r+t.r,n=(e.x*t.r+t.x*e.r)/i,a=(e.y*t.r+t.y*e.r)/i;return n*n+a*a}function uo(r){this._=r,this.next=null,this.previous=null}function z0(r){if(!(n=(r=$D(r)).length))return 0;var e,t,i,n,a,o,s,l,u,c,h;if(e=r[0],e.x=0,e.y=0,!(n>1))return e.r;if(t=r[1],e.x=-t.r,t.x=e.r,t.y=0,!(n>2))return e.r+t.r;xd(t,e,i=r[2]),e=new uo(e),t=new uo(t),i=new uo(i),e.next=i.previous=t,t.next=e.previous=i,i.next=t.previous=e;t:for(s=3;s0)throw new Error("cycle");return l}return t.id=function(i){return arguments.length?(r=qo(i),t):r},t.parentId=function(i){return arguments.length?(e=qo(i),t):e},t}function eB(r,e){return r.parent===e.parent?1:2}function kl(r){var e=r.children;return e?e[0]:r.t}function Ll(r){var e=r.children;return e?e[e.length-1]:r.t}function rB(r,e,t){var i=t/(e.i-r.i);e.c-=i,e.s+=t,r.c+=i,e.z+=t,e.m+=t}function iB(r){for(var e=0,t=0,i=r.children,n=i.length,a;--n>=0;)a=i[n],a.z+=e,a.m+=e,e+=a.s+(t+=a.c)}function nB(r,e,t){return r.a.parent===e.parent?r.a:t}function xo(r,e){this._=r,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}xo.prototype=Object.create(Ji.prototype);function aB(r){for(var e=new xo(r,0),t,i=[e],n,a,o,s;t=i.pop();)if(a=t._.children)for(t.children=new Array(s=a.length),o=s-1;o>=0;--o)i.push(n=t.children[o]=new xo(a[o],o)),n.parent=t;return(e.parent=new xo(null,0)).children=[e],e}function oB(){var r=eB,e=1,t=1,i=null;function n(u){var c=aB(u);if(c.eachAfter(a),c.parent.m=-c.z,c.eachBefore(o),i)u.eachBefore(l);else{var h=u,f=u,v=u;u.eachBefore(function(x){x.xf.x&&(f=x),x.depth>v.depth&&(v=x)});var d=h===f?1:r(h,f)/2,p=d-h.x,y=e/(f.x+d+p),m=t/(v.depth||1);u.eachBefore(function(x){x.x=(x.x+p)*y,x.y=x.depth*m})}return u}function a(u){var c=u.children,h=u.parent.children,f=u.i?h[u.i-1]:null;if(c){iB(u);var v=(c[0].z+c[c.length-1].z)/2;f?(u.z=f.z+r(u._,f._),u.m=u.z-v):u.z=v}else f&&(u.z=f.z+r(u._,f._));u.parent.A=s(u,f,u.parent.A||h[0])}function o(u){u._.x=u.z+u.parent.m,u.m+=u.parent.m}function s(u,c,h){if(c){for(var f=u,v=u,d=c,p=f.parent.children[0],y=f.m,m=v.m,x=d.m,_=p.m,w;d=Ll(d),f=kl(f),d&&f;)p=kl(p),v=Ll(v),v.a=u,w=d.z+x-f.z-y+r(d._,f._),w>0&&(rB(nB(d,u,h),u,w),y+=w,m+=w),x+=d.m,y+=f.m,_+=p.m,m+=v.m;d&&!Ll(v)&&(v.t=d,v.m+=x-m),f&&!kl(p)&&(p.t=f,p.m+=y-_,h=u)}return h}function l(u){u.x*=e,u.y=u.depth*t}return n.separation=function(u){return arguments.length?(r=u,n):r},n.size=function(u){return arguments.length?(i=!1,e=+u[0],t=+u[1],n):i?null:[e,t]},n.nodeSize=function(u){return arguments.length?(i=!0,e=+u[0],t=+u[1],n):i?[e,t]:null},n}function Ws(r,e,t,i,n){for(var a=r.children,o,s=-1,l=a.length,u=r.value&&(n-t)/r.value;++sx&&(x=u),C=y*y*b,_=Math.max(x/C,C/m),_>w){y-=u;break}w=_}o.push(l={value:y,dice:v1?i:1)},t}($0);function W0(){var r=X0,e=!1,t=1,i=1,n=[0],a=Zr,o=Zr,s=Zr,l=Zr,u=Zr;function c(f){return f.x0=f.y0=0,f.x1=t,f.y1=i,f.eachBefore(h),n=[0],e&&f.eachBefore(G0),f}function h(f){var v=n[f.depth],d=f.x0+v,p=f.y0+v,y=f.x1-v,m=f.y1-v;y=f-1){var x=a[h];x.x0=d,x.y0=p,x.x1=y,x.y1=m;return}for(var _=u[h],w=v/2+_,b=h+1,C=f-1;b>>1;u[A]m-p){var T=v?(d*E+y*F)/v:y;c(h,b,F,d,p,T,m),c(b,f,E,T,p,y,m)}else{var k=v?(p*E+m*F)/v:m;c(h,b,F,d,p,y,k),c(b,f,E,d,k,y,m)}}}function lB(r,e,t,i,n){(r.depth&1?Ws:La)(r,e,t,i,n)}const uB=function r(e){function t(i,n,a,o,s){if((l=i._squarify)&&l.ratio===e)for(var l,u,c,h,f=-1,v,d=l.length,p=i.value;++f1?i:1)},t}($0),Md=Object.freeze(Object.defineProperty({__proto__:null,cluster:SD,hierarchy:hn,pack:V0,packEnclose:O0,packSiblings:UD,partition:Y0,stratify:tB,tree:oB,treemap:W0,treemapBinary:sB,treemapDice:La,treemapResquarify:uB,treemapSlice:Ws,treemapSliceDice:lB,treemapSquarify:X0},Symbol.toStringTag,{value:"Module"}));var q0="nodeIndex",U0="childNodeCount",hh="nodeAncestor",Il="Invalid field: it must be a string!";function fh(r,e){var t=r.field,i=r.fields;if(K(t))return t;if(O(t))return console.warn(Il),t[0];if(console.warn("".concat(Il," will try to get fields instead.")),K(i))return i;if(O(i)&&i.length)return i[0];if(e)return e;throw new TypeError(Il)}function vh(r){var e=[];if(r&&r.each){var t,i;r.each(function(n){var a,o;n.parent!==t?(t=n.parent,i=0):i+=1;var s=Xt((((a=n.ancestors)===null||a===void 0?void 0:a.call(n))||[]).map(function(l){return e.find(function(u){return u.name===l.name})||l}),function(l){var u=l.depth;return u>0&&u1;)c="".concat((u=h.parent.data)===null||u===void 0?void 0:u.name," / ").concat(c),h=h.parent;if(a&&l.depth>2)return null;var f=L({},l.data,g.__assign(g.__assign(g.__assign({},ct(l.data,n)),{path:c}),l));f.ext=t,f[va]={hierarchyConfig:t,rawFields:n,enableDrillDown:a},s.push(f)}),s}function Z0(r,e,t){var i=Qc([r,e]),n=i[0],a=i[1],o=i[2],s=i[3],l=t.width,u=t.height,c=l-(s+a),h=u-(n+o),f=Math.min(c,h),v=(c-f)/2,d=(h-f)/2,p=n+d,y=a+v,m=o+d,x=s+v,_=[p,y,m,x],w=f<0?0:f;return{finalPadding:_,finalSize:w}}function fB(r){var e=r.chart,t=Math.min(e.viewBBox.width,e.viewBBox.height);return L({options:{size:function(i){var n=i.r;return n*t}}},r)}function vB(r){var e=r.options,t=r.chart,i=t.viewBBox,n=e.padding,a=e.appendPadding,o=e.drilldown,s=a;if(o!=null&&o.enabled){var l=Ds(t.appendPadding,M(o,["breadCrumb","position"]));s=Qc([l,a])}var u=Z0(n,s,i).finalPadding;return t.padding=u,t.appendPadding=0,r}function dB(r){var e=r.chart,t=r.options,i=e.padding,n=e.appendPadding,a=t.color,o=t.colorField,s=t.pointStyle,l=t.hierarchyConfig,u=t.sizeField,c=t.rawFields,h=c===void 0?[]:c,f=t.drilldown,v=j0({data:t.data,hierarchyConfig:l,enableDrillDown:f==null?void 0:f.enabled,rawFields:h});e.data(v);var d=e.viewBBox,p=Z0(i,n,d).finalSize,y=function(m){var x=m.r;return x*p};return u&&(y=function(m){return m[u]*p}),pe(L({},r,{options:{xField:"x",yField:"y",seriesField:o,sizeField:u,rawFields:g.__spreadArray(g.__spreadArray([],hD,!0),h,!0),point:{color:a,style:s,shape:"circle",size:y}}})),r}function gB(r){return j(Mt({},{x:{min:0,max:1,minLimit:0,maxLimit:1,nice:!0},y:{min:0,max:1,minLimit:0,maxLimit:1,nice:!0}}))(r)}function pB(r){var e=r.chart,t=r.options,i=t.tooltip;if(i===!1)e.tooltip(!1);else{var n=i;M(i,"fields")||(n=L({},{customItems:function(a){return a.map(function(o){var s=M(e.getOptions(),"scales"),l=M(s,["name","formatter"],function(c){return c}),u=M(s,["value","formatter"],function(c){return c});return g.__assign(g.__assign({},o),{name:l(o.data.name),value:u(o.data.value)})})}},n)),e.tooltip(n)}return r}function yB(r){var e=r.chart;return e.axis(!1),r}function mB(r){var e=r.drilldown,t=r.interactions,i=t===void 0?[]:t;return e!=null&&e.enabled?L({},r,{interactions:g.__spreadArray(g.__spreadArray([],i,!0),[{type:"drill-down",cfg:{drillDownConfig:e,transformData:j0,enableDrillDown:!0}}],!1)}):r}function xB(r){var e=r.chart,t=r.options;return wt({chart:e,options:mB(t)}),r}function wB(r){return j(ge("pointStyle"),fB,vB,ot,gB,dB,yB,sn,pB,xB,vt,St())(r)}function Ad(r){var e=M(r,["event","data","data"],{});return O(e.children)&&e.children.length>0}function Fd(r){var e=r.view.getCoordinate(),t=e.innerRadius;if(t){var i=r.event,n=i.x,a=i.y,o=e.center,s=o.x,l=o.y,u=e.getRadius()*t,c=Math.sqrt(Math.pow(s-n,2)+Math.pow(l-a,2));return c-1?$E(v,c,h):!0}),r.getRootView().render(!0)}};function CB(r){var e,t=r.options,i=t.geometryOptions,n=i===void 0?[]:i,a=t.xField,o=t.yField,s=Gu(n,function(l){var u=l.geometry;return u===mi.Line||u===void 0});return L({},{options:{geometryOptions:[],meta:(e={},e[a]={type:"cat",sync:!0,range:s?[0,1]:void 0},e),tooltip:{showMarkers:s,showCrosshairs:s,shared:!0,crosshairs:{type:"x"}},interactions:s?[{type:"legend-visible-filter"}]:[{type:"legend-visible-filter"},{type:"active-region"}],legend:{position:"top-left"}}},r,{options:{yAxis:Ed(o,t.yAxis),geometryOptions:[Td(a,o[0],n[0]),Td(a,o[1],n[1])],annotations:Ed(o,t.annotations)}})}function MB(r){var e,t,i=r.chart,n=r.options,a=n.geometryOptions,o={line:0,column:1},s=[{type:(e=a[0])===null||e===void 0?void 0:e.geometry,id:ye},{type:(t=a[1])===null||t===void 0?void 0:t.geometry,id:me}];return s.sort(function(l,u){return-o[l.type]+o[u.type]}).forEach(function(l){return i.createView({id:l.id})}),r}function AB(r){var e=r.chart,t=r.options,i=t.xField,n=t.yField,a=t.geometryOptions,o=t.data,s=t.tooltip,l=[g.__assign(g.__assign({},a[0]),{id:ye,data:o[0],yField:n[0]}),g.__assign(g.__assign({},a[1]),{id:me,data:o[1],yField:n[1]})];return l.forEach(function(u){var c=u.id,h=u.data,f=u.yField,v=dh(u)&&u.isPercent,d=v?Dm(h,f,i,f):h,p=nt(e,c).data(d),y=v?g.__assign({formatter:function(m){return{name:m[u.seriesField]||f,value:(Number(m[f])*100).toFixed(2)+"%"}}},s):s;SB({chart:p,options:{xField:i,yField:f,tooltip:y,geometryOption:u}})}),r}function FB(r){var e,t=r.chart,i=r.options,n=i.geometryOptions,a=((e=t.getTheme())===null||e===void 0?void 0:e.colors10)||[],o=0;return t.once("beforepaint",function(){S(n,function(s,l){var u=nt(t,l===0?ye:me);if(!s.color){var c=u.getGroupScales(),h=M(c,[0,"values","length"],1),f=a.slice(o,o+h).concat(l===0?[]:a);u.geometries.forEach(function(v){s.seriesField?v.color(s.seriesField,f):v.color(f[0])}),o+=h}}),t.render(!0)}),r}function TB(r){var e,t,i=r.chart,n=r.options,a=n.xAxis,o=n.yAxis,s=n.xField,l=n.yField;return Mt((e={},e[s]=a,e[l[0]]=o[0],e))(L({},r,{chart:nt(i,ye)})),Mt((t={},t[s]=a,t[l[1]]=o[1],t))(L({},r,{chart:nt(i,me)})),r}function EB(r){var e=r.chart,t=r.options,i=nt(e,ye),n=nt(e,me),a=t.xField,o=t.yField,s=t.xAxis,l=t.yAxis;return e.axis(a,!1),e.axis(o[0],!1),e.axis(o[1],!1),i.axis(a,s),i.axis(o[0],kd(l[0],tn.Left)),n.axis(a,!1),n.axis(o[1],kd(l[1],tn.Right)),r}function kB(r){var e=r.chart,t=r.options,i=t.tooltip,n=nt(e,ye),a=nt(e,me);return e.tooltip(i),n.tooltip({shared:!0}),a.tooltip({shared:!0}),r}function LB(r){var e=r.chart;return wt(L({},r,{chart:nt(e,ye)})),wt(L({},r,{chart:nt(e,me)})),r}function IB(r){var e=r.chart,t=r.options,i=t.annotations,n=M(i,[0]),a=M(i,[1]);return St(n)(L({},r,{chart:nt(e,ye),options:{annotations:n}})),St(a)(L({},r,{chart:nt(e,me),options:{annotations:a}})),r}function PB(r){var e=r.chart;return ot(L({},r,{chart:nt(e,ye)})),ot(L({},r,{chart:nt(e,me)})),ot(r),r}function DB(r){var e=r.chart;return vt(L({},r,{chart:nt(e,ye)})),vt(L({},r,{chart:nt(e,me)})),r}function BB(r){var e=r.chart,t=r.options,i=t.yAxis;return yi(L({},r,{chart:nt(e,ye),options:{yAxis:i[0]}})),yi(L({},r,{chart:nt(e,me),options:{yAxis:i[1]}})),r}function OB(r){var e=r.chart,t=r.options,i=t.legend,n=t.geometryOptions,a=t.yField,o=t.data,s=nt(e,ye),l=nt(e,me);if(i===!1)e.legend(!1);else if(pt(i)&&i.custom===!0)e.legend(i);else{var u=M(n,[0,"legend"],i),c=M(n,[1,"legend"],i);e.once("beforepaint",function(){var h=o[0].length?Ld({view:s,geometryOption:n[0],yField:a[0],legend:u}):[],f=o[1].length?Ld({view:l,geometryOption:n[1],yField:a[1],legend:c}):[];e.legend(L({},i,{custom:!0,items:h.concat(f)}))}),n[0].seriesField&&s.legend(n[0].seriesField,u),n[1].seriesField&&l.legend(n[1].seriesField,c),e.on("legend-item:click",function(h){var f=M(h,"gEvent.delegateObject",{});if(f&&f.item){var v=f.item,d=v.value,p=v.isGeometry,y=v.viewId;if(p){var m=og(a,function(w){return w===d});if(m>-1){var x=M(nt(e,y),"geometries");S(x,function(w){w.changeVisible(!f.item.unchecked)})}}else{var _=M(e.getController("legend"),"option.items",[]);S(e.views,function(w){var b=w.getGroupScales();S(b,function(C){C.values&&C.values.indexOf(d)>-1&&w.filter(C.field,function(A){var F=Le(_,function(E){return E.value===A});return!F.unchecked})}),e.render(!0)})}}})}return r}function RB(r){var e=r.chart,t=r.options,i=t.slider,n=nt(e,ye),a=nt(e,me);return i&&(n.option("slider",i),n.on("slider:valuechanged",function(o){var s=o.event,l=s.value,u=s.originValue;Lt(l,u)||Id(a,l)}),e.once("afterpaint",function(){if(!$i(i)){var o=i.start,s=i.end;(o||s)&&Id(a,[o,s])}})),r}function NB(r){return j(CB,MB,PB,AB,TB,EB,BB,kB,LB,IB,DB,FB,OB,RB)(r)}(function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="dual-axes",t}return e.prototype.getDefaultOptions=function(){return L({},r.prototype.getDefaultOptions.call(this),{yAxis:[],syncViewPadding:!0})},e.prototype.getSchemaAdaptor=function(){return NB},e})(et);function zB(r,e){var t=e.data,i=e.coordinate,n=e.interactions,a=e.annotations,o=e.animation,s=e.tooltip,l=e.axes,u=e.meta,c=e.geometries;t&&r.data(t);var h={};l&&S(l,function(f,v){h[v]=ct(f,ne)}),h=L({},u,h),r.scale(h),i&&r.coordinate(i),l===!1?r.axis(!1):S(l,function(f,v){r.axis(v,f)}),S(c,function(f){var v=ue({chart:r,options:f}).ext,d=f.adjust;d&&v.geometry.adjust(d)}),S(n,function(f){f.enable===!1?r.removeInteraction(f.type):r.interaction(f.type,f.cfg)}),S(a,function(f){r.annotation()[f.type](g.__assign({},f))}),Aa(r,o),s?(r.interaction("tooltip"),r.tooltip(s)):s===!1&&r.removeInteraction("tooltip")}function VB(r){var e=r.chart,t=r.options,i=t.type,n=t.data,a=t.fields,o=t.eachView,s=Ko(t,["type","data","fields","eachView","axes","meta","tooltip","coordinate","theme","legend","interactions","annotations"]);return e.data(n),e.facet(i,g.__assign(g.__assign({},s),{fields:a,eachView:function(l,u){var c=o(l,u);if(c.geometries)zB(l,c);else{var h=c,f=h.options;f.tooltip&&l.interaction("tooltip"),Tu(h.type,l,f)}}})),r}function GB(r){var e=r.chart,t=r.options,i=t.axes,n=t.meta,a=t.tooltip,o=t.coordinate,s=t.theme,l=t.legend,u=t.interactions,c=t.annotations,h={};return i&&S(i,function(f,v){h[v]=ct(f,ne)}),h=L({},n,h),e.scale(h),e.coordinate(o),i?S(i,function(f,v){e.axis(v,f)}):e.axis(!1),a?(e.interaction("tooltip"),e.tooltip(a)):a===!1&&e.removeInteraction("tooltip"),e.legend(l),s&&e.theme(s),S(u,function(f){f.enable===!1?e.removeInteraction(f.type):e.interaction(f.type,f.cfg)}),S(c,function(f){e.annotation()[f.type](g.__assign({},f))}),r}function YB(r){return j(ot,VB,GB)(r)}var $B={title:{style:{fontSize:12,fill:"rgba(0,0,0,0.65)"}},rowTitle:{style:{fontSize:12,fill:"rgba(0,0,0,0.65)"}},columnTitle:{style:{fontSize:12,fill:"rgba(0,0,0,0.65)"}}};(function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="area",t}return e.getDefaultOptions=function(){return $B},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return YB},e})(et);function HB(r){var e=r.chart,t=r.options,i=t.data,n=t.type,a=t.xField,o=t.yField,s=t.colorField,l=t.sizeField,u=t.sizeRatio,c=t.shape,h=t.color,f=t.tooltip,v=t.heatmapStyle,d=t.meta;e.data(i);var p="polygon";n==="density"&&(p="heatmap");var y=Fe(f,[a,o,s]),m=y.fields,x=y.formatter,_=1;return(u||u===0)&&(!c&&!l?console.warn("sizeRatio is not in effect: Must define shape or sizeField first"):u<0||u>1?console.warn("sizeRatio is not in effect: It must be a number in [0,1]"):_=u),ue(L({},r,{options:{type:p,colorField:s,tooltipFields:m,shapeField:l||"",label:void 0,mapping:{tooltip:x,shape:c&&(l?function(w){var b=i.map(function(E){return E[l]}),C=(d==null?void 0:d[l])||{},A=C.min,F=C.max;return A=tt(A)?A:Math.min.apply(Math,b),F=tt(F)?F:Math.max.apply(Math,b),[c,(M(w,l)-A)/(F-A),_]}:function(){return[c,1,_]}),color:h||s&&e.getTheme().sequenceColors.join("-"),style:v}}})),r}function XB(r){var e,t=r.options,i=t.xAxis,n=t.yAxis,a=t.xField,o=t.yField;return j(Mt((e={},e[a]=i,e[o]=n,e)))(r)}function WB(r){var e=r.chart,t=r.options,i=t.xAxis,n=t.yAxis,a=t.xField,o=t.yField;return i===!1?e.axis(a,!1):e.axis(a,i),n===!1?e.axis(o,!1):e.axis(o,n),r}function qB(r){var e=r.chart,t=r.options,i=t.legend,n=t.colorField,a=t.sizeField,o=t.sizeLegend,s=i!==!1;return n&&e.legend(n,s?i:!1),a&&e.legend(a,o===void 0?i:o),!s&&!o&&e.legend(!1),r}function UB(r){var e=r.chart,t=r.options,i=t.label,n=t.colorField,a=t.type,o=$t(e,a==="density"?"heatmap":"polygon");if(!i)o.label(!1);else if(n){var s=i.callback,l=g.__rest(i,["callback"]);o.label({fields:[n],callback:s,cfg:Ot(l)})}return r}function jB(r){var e,t,i=r.chart,n=r.options,a=n.coordinate,o=n.reflect,s=L({actions:[]},a??{type:"rect"});return o&&((t=(e=s.actions)===null||e===void 0?void 0:e.push)===null||t===void 0||t.call(e,["reflect",o])),i.coordinate(s),r}function ZB(r){return j(ot,ge("heatmapStyle"),XB,jB,HB,WB,qB,Pt,UB,St(),wt,vt,Hr)(r)}var QB=L({},et.getDefaultOptions(),{type:"polygon",legend:!1,coordinate:{type:"rect"},xAxis:{tickLine:null,line:null,grid:{alignTick:!1,line:{style:{lineWidth:1,lineDash:null,stroke:"#f0f0f0"}}}},yAxis:{grid:{alignTick:!1,line:{style:{lineWidth:1,lineDash:null,stroke:"#f0f0f0"}}}}});lt("polygon","circle",{draw:function(r,e){var t,i,n=r.x,a=r.y,o=this.parsePoints(r.points),s=Math.abs(o[2].x-o[1].x),l=Math.abs(o[1].y-o[0].y),u=Math.min(s,l)/2,c=Number(r.shape[1]),h=Number(r.shape[2]),f=Math.sqrt(h),v=u*f*Math.sqrt(c),d=((t=r.style)===null||t===void 0?void 0:t.fill)||r.color||((i=r.defaultStyle)===null||i===void 0?void 0:i.fill),p=e.addShape("circle",{attrs:g.__assign(g.__assign(g.__assign({x:n,y:a,r:v},r.defaultStyle),r.style),{fill:d})});return p}});lt("polygon","square",{draw:function(r,e){var t,i,n=r.x,a=r.y,o=this.parsePoints(r.points),s=Math.abs(o[2].x-o[1].x),l=Math.abs(o[1].y-o[0].y),u=Math.min(s,l),c=Number(r.shape[1]),h=Number(r.shape[2]),f=Math.sqrt(h),v=u*f*Math.sqrt(c),d=((t=r.style)===null||t===void 0?void 0:t.fill)||r.color||((i=r.defaultStyle)===null||i===void 0?void 0:i.fill),p=e.addShape("rect",{attrs:g.__assign(g.__assign(g.__assign({x:n-v/2,y:a-v/2,width:v,height:v},r.defaultStyle),r.style),{fill:d})});return p}});(function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="heatmap",t}return e.getDefaultOptions=function(){return QB},e.prototype.getSchemaAdaptor=function(){return ZB},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e})(et);var KB="liquid";function K0(r){return[{percent:r,type:KB}]}function JB(r){var e=r.chart,t=r.options,i=t.percent,n=t.liquidStyle,a=t.radius,o=t.outline,s=t.wave,l=t.shape,u=t.shapeStyle,c=t.animation;e.scale({percent:{min:0,max:1}}),e.data(K0(i));var h=t.color||e.getTheme().defaultColor,f=L({},r,{options:{xField:"type",yField:"percent",widthRatio:a,interval:{color:h,style:n,shape:"liquid-fill-gauge"}}}),v=Ht(f).ext,d=v.geometry,p=e.getTheme().background,y={percent:i,radius:a,outline:o,wave:s,shape:l,shapeStyle:u,background:p,animation:c};return d.customInfo(y),e.legend(!1),e.axis(!1),e.tooltip(!1),r}function J0(r,e){var t=r.chart,i=r.options,n=i.statistic,a=i.percent,o=i.meta;t.getController("annotation").clear(!0);var s=M(o,["percent","formatter"])||function(u){return"".concat((u*100).toFixed(2),"%")},l=n.content;return l&&(l=L({},l,{content:D(l.content)?s(a):l.content})),Bs(t,{statistic:g.__assign(g.__assign({},n),{content:l}),plotType:"liquid"},{percent:a}),e&&t.render(!0),r}function tO(r){return j(ot,ge("liquidStyle"),JB,J0,Mt({}),vt,wt)(r)}var eO={radius:.9,statistic:{title:!1,content:{style:{opacity:.75,fontSize:"30px",lineHeight:"30px",textAlign:"center"}}},outline:{border:2,distance:0},wave:{count:3,length:192},shape:"circle"},Pd=5e3;function Dd(r,e,t){return r+(e-r)*t}function rO(r){var e=g.__assign({opacity:1},r.style);return r.color&&!e.fill&&(e.fill=r.color),e}function iO(r){var e={fill:"#fff",fillOpacity:0,lineWidth:4},t=ft({},e,r.style);return r.color&&!t.stroke&&(t.stroke=r.color),tt(r.opacity)&&(t.opacity=t.strokeOpacity=r.opacity),t}function nO(r,e,t,i){return e===0?[[r+1/2*t/Math.PI/2,i/2],[r+1/2*t/Math.PI,i],[r+t/4,i]]:e===1?[[r+1/2*t/Math.PI/2*(Math.PI-2),i],[r+1/2*t/Math.PI/2*(Math.PI-1),i/2],[r+t/4,0]]:e===2?[[r+1/2*t/Math.PI/2,-i/2],[r+1/2*t/Math.PI,-i],[r+t/4,-i]]:[[r+1/2*t/Math.PI/2*(Math.PI-2),-i],[r+1/2*t/Math.PI/2*(Math.PI-1),-i/2],[r+t/4,0]]}function aO(r,e,t,i,n,a,o){for(var s=Math.ceil(2*r/t*4)*4,l=[],u=i;u<-Math.PI*2;)u+=Math.PI*2;for(;u>0;)u-=Math.PI*2;u=u/Math.PI/2*t;var c=a-r+u-r*2;l.push(["M",c,e]);for(var h=0,f=0;f0){var P=e.addGroup({name:"waves"}),B=P.setClip({type:"path",attrs:{path:k}});oO(_.x,_.y,1-r.points[1].y,y,A,P,B,C*2,m,h)}return e.addShape("path",{name:"distance",attrs:{path:k,fill:"transparent",lineWidth:d+p*2,stroke:c==="transparent"?"#fff":c}}),e.addShape("path",{name:"wrap",attrs:ft(F,{path:k,fill:"transparent",lineWidth:d})}),e}});(function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="liquid",t}return e.getDefaultOptions=function(){return eO},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.changeData=function(t){this.chart.emit(it.BEFORE_CHANGE_DATA,bt.fromData(this.chart,it.BEFORE_CHANGE_DATA,null)),this.updateOption({percent:t}),this.chart.data(K0(t)),J0({chart:this.chart,options:this.options},!0),this.chart.emit(it.AFTER_CHANGE_DATA,bt.fromData(this.chart,it.AFTER_CHANGE_DATA,null))},e.prototype.getSchemaAdaptor=function(){return tO},e})(et);function fO(r){var e=r.chart,t=r.options,i=t.data,n=t.lineStyle,a=t.color,o=t.point,s=t.area;e.data(i);var l=L({},r,{options:{line:{style:n,color:a},point:o&&g.__assign({color:a},o),area:s&&g.__assign({color:a},s),label:void 0}}),u=L({},l,{options:{tooltip:!1}}),c=(o==null?void 0:o.state)||t.state,h=L({},l,{options:{tooltip:!1,state:c}});return ln(l),pe(h),Ns(u),r}function vO(r){var e,t=r.options,i=t.xAxis,n=t.yAxis,a=t.xField,o=t.yField;return j(Mt((e={},e[a]=i,e[o]=n,e)))(r)}function dO(r){var e=r.chart,t=r.options,i=t.radius,n=t.startAngle,a=t.endAngle;return e.coordinate("polar",{radius:i,startAngle:n,endAngle:a}),r}function gO(r){var e=r.chart,t=r.options,i=t.xField,n=t.xAxis,a=t.yField,o=t.yAxis;return e.axis(i,n),e.axis(a,o),r}function pO(r){var e=r.chart,t=r.options,i=t.label,n=t.yField,a=$t(e,"line");if(!i)a.label(!1);else{var o=i.callback,s=g.__rest(i,["callback"]);a.label({fields:[n],callback:o,cfg:Ot(s)})}return r}function yO(r){return j(fO,vO,ot,dO,gO,sn,Pt,pO,wt,vt,St())(r)}var mO=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"radar-tooltip"},enumerable:!1,configurable:!0}),e.prototype.getTooltipItems=function(t){var i=this.getTooltipCfg(),n=i.shared,a=i.title,o=r.prototype.getTooltipItems.call(this,t);if(o.length>0){var s=this.view.geometries[0],l=s.dataArray,u=o[0].name,c=[];return l.forEach(function(h){h.forEach(function(f){var v=se.getTooltipItems(f,s),d=v[0];if(!n&&d&&d.name===u){var p=D(a)?u:a;c.push(g.__assign(g.__assign({},d),{name:d.title,title:p}))}else if(n&&d){var p=D(a)?d.name||u:a;c.push(g.__assign(g.__assign({},d),{name:d.title,title:p}))}})}),c}return[]},e}(cy);wi("radar-tooltip",mO);var xO=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.init=function(){var t=this.context.view;t.removeInteraction("tooltip")},e.prototype.show=function(){var t=this.context.event,i=this.getTooltipController();i.showTooltip({x:t.x,y:t.y})},e.prototype.hide=function(){var t=this.getTooltipController();t.hideTooltip()},e.prototype.getTooltipController=function(){var t=this.context.view;return t.getController("radar-tooltip")},e}(yt);q("radar-tooltip",xO);J("radar-tooltip",{start:[{trigger:"plot:mousemove",action:"radar-tooltip:show"}],end:[{trigger:"plot:mouseleave",action:"radar-tooltip:hide"}]});(function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="radar",t}return e.prototype.changeData=function(t){this.updateOption({data:t}),this.chart.changeData(t)},e.prototype.getDefaultOptions=function(){return L({},r.prototype.getDefaultOptions.call(this),{xAxis:{label:{offset:15},grid:{line:{type:"line"}}},yAxis:{grid:{line:{type:"circle"}}},legend:{position:"top"},tooltip:{shared:!0,showCrosshairs:!0,showMarkers:!0,crosshairs:{type:"xy",line:{style:{stroke:"#565656",lineDash:[4]}},follow:!0}}})},e.prototype.getSchemaAdaptor=function(){return yO},e})(et);function wO(r,e,t){var i=t.map(function(o){return o[e]}).filter(function(o){return o!==void 0}),n=i.length>0?Math.max.apply(Math,i):0,a=Math.abs(r)%360;return a?n*360/a:n}function _O(r,e,t){var i=[];return r.forEach(function(n){var a=i.find(function(o){return o[e]===n[e]});a?a[t]+=n[t]||null:i.push(g.__assign({},n))}),i}function bO(r){var e=r.chart,t=r.options,i=t.barStyle,n=t.color,a=t.tooltip,o=t.colorField,s=t.type,l=t.xField,u=t.yField,c=t.data,h=t.shape,f=Zi(c,u);e.data(f);var v=L({},r,{options:{tooltip:a,seriesField:o,interval:{style:i,color:n,shape:h||(s==="line"?"line":"intervel")},minColumnWidth:t.minBarWidth,maxColumnWidth:t.maxBarWidth,columnBackground:t.barBackground}});return Ht(v),s==="line"&&pe({chart:e,options:{xField:l,yField:u,seriesField:o,point:{shape:"circle",color:n}}}),r}function tx(r){var e,t=r.options,i=t.yField,n=t.xField,a=t.data,o=t.isStack,s=t.isGroup,l=t.colorField,u=t.maxAngle,c=o&&!s&&l?_O(a,n,i):a,h=Zi(c,i);return j(Mt((e={},e[i]={min:0,max:wO(u,i,h)},e)))(r)}function SO(r){var e=r.chart,t=r.options,i=t.radius,n=t.innerRadius,a=t.startAngle,o=t.endAngle;return e.coordinate({type:"polar",cfg:{radius:i,innerRadius:n,startAngle:a,endAngle:o}}).transpose(),r}function CO(r){var e=r.chart,t=r.options,i=t.xField,n=t.xAxis;return e.axis(i,n),r}function MO(r){var e=r.chart,t=r.options,i=t.label,n=t.yField,a=$t(e,"interval");if(!i)a.label(!1);else{var o=i.callback,s=g.__rest(i,["callback"]);a.label({fields:[n],callback:o,cfg:g.__assign(g.__assign({},Ot(s)),{type:"polar"})})}return r}function AO(r){return j(ge("barStyle"),bO,tx,CO,SO,wt,vt,ot,Pt,sn,St(),MO)(r)}var FO=L({},et.getDefaultOptions(),{interactions:[{type:"element-active"}],legend:!1,tooltip:{showMarkers:!1},xAxis:{grid:null,tickLine:null,line:null},maxAngle:240});(function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="radial-bar",t}return e.getDefaultOptions=function(){return FO},e.prototype.changeData=function(t){this.updateOption({data:t}),tx({chart:this.chart,options:this.options}),this.chart.changeData(t)},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return AO},e})(et);function TO(r){var e=r.chart,t=r.options,i=t.data,n=t.sectorStyle,a=t.shape,o=t.color;return e.data(i),j(Ht)(L({},r,{options:{marginRatio:1,interval:{style:n,color:o,shape:a}}})),r}function EO(r){var e=r.chart,t=r.options,i=t.label,n=t.xField,a=$t(e,"interval");if(i===!1)a.label(!1);else if(pt(i)){var o=i.callback,s=i.fields,l=g.__rest(i,["callback","fields"]),u=l.offset,c=l.layout;(u===void 0||u>=0)&&(c=c?O(c)?c:[c]:[],l.layout=Xt(c,function(h){return h.type!=="limit-in-shape"}),l.layout.length||delete l.layout),a.label({fields:s||[n],callback:o,cfg:Ot(l)})}else dr(Oe.WARN,i===null,"the label option must be an Object."),a.label({fields:[n]});return r}function kO(r){var e=r.chart,t=r.options,i=t.legend,n=t.seriesField;return i===!1?e.legend(!1):n&&e.legend(n,i),r}function LO(r){var e=r.chart,t=r.options,i=t.radius,n=t.innerRadius,a=t.startAngle,o=t.endAngle;return e.coordinate({type:"polar",cfg:{radius:i,innerRadius:n,startAngle:a,endAngle:o}}),r}function IO(r){var e,t=r.options,i=t.xAxis,n=t.yAxis,a=t.xField,o=t.yField;return j(Mt((e={},e[a]=i,e[o]=n,e)))(r)}function PO(r){var e=r.chart,t=r.options,i=t.xAxis,n=t.yAxis,a=t.xField,o=t.yField;return i?e.axis(a,i):e.axis(a,!1),n?e.axis(o,n):e.axis(o,!1),r}function DO(r){j(ge("sectorStyle"),TO,IO,EO,LO,PO,kO,Pt,wt,vt,ot,St(),Hr)(r)}var BO=L({},et.getDefaultOptions(),{xAxis:!1,yAxis:!1,legend:{position:"right",radio:{}},sectorStyle:{stroke:"#fff",lineWidth:1},label:{layout:{type:"limit-in-shape"}},tooltip:{shared:!0,showMarkers:!1},interactions:[{type:"active-region"}]});(function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="rose",t}return e.getDefaultOptions=function(){return BO},e.prototype.changeData=function(t){this.updateOption({data:t}),this.chart.changeData(t)},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return DO},e})(et);var Od="x",Rd="y",Nd="name",qs="nodes",Us="edges";function OO(r,e,t){var i=[];return r.forEach(function(n){var a=n[e],o=n[t];i.includes(a)||i.push(a),i.includes(o)||i.push(o)}),i}function RO(r,e,t,i){var n={};return e.forEach(function(a){n[a]={},e.forEach(function(o){n[a][o]=0})}),r.forEach(function(a){n[a[t]][a[i]]=1}),n}function NO(r,e,t){if(!O(r))return[];var i=[],n=OO(r,e,t),a=RO(r,n,e,t),o={};n.forEach(function(l){o[l]=0});function s(l){o[l]=1,n.forEach(function(u){if(a[l][u]!=0)if(o[u]==1)i.push("".concat(l,"_").concat(u));else{if(o[u]==-1)return;s(u)}}),o[l]=-1}return n.forEach(function(l){o[l]!=-1&&s(l)}),i.length!==0&&console.warn("sankey data contains circle, ".concat(i.length," records removed."),i),r.filter(function(l){return i.findIndex(function(u){return u==="".concat(l[e],"_").concat(l[t])})<0})}function zO(r){return r.target.depth}function VO(r){return r.depth}function GO(r,e){return e-1-r.height}function gh(r,e){return r.sourceLinks.length?r.depth:e-1}function YO(r){return r.targetLinks.length?r.depth:r.sourceLinks.length?Wx(r.sourceLinks,zO)-1:0}function co(r){return function(){return r}}function Pl(r,e){for(var t=0,i=0;i$)throw new Error("circular link");G=V,V=new Set}if(u)for(var Z=Math.max(Dl(R,function(Q){return Q.depth})+1,0),rt=void 0,U=0;U$)throw new Error("circular link");G=V,V=new Set}}function w(I){for(var R=I.nodes,$=Math.max(Dl(R,function(Ct){return Ct.depth})+1,0),G=(t-r-n)/($-1),V=new Array($).fill(0).map(function(){return[]}),H=0,Z=R;H0){var Xr=(Q/ht-U.y0)*R;U.y0+=Xr,U.y1+=Xr,P(U)}}c===void 0&&H.sort(Uo),H.length&&E(H,$)}}function F(I,R,$){for(var G=I.length,V=G-2;V>=0;--V){for(var H=I[V],Z=0,rt=H;Z0){var Xr=(Q/ht-U.y0)*R;U.y0+=Xr,U.y1+=Xr,P(U)}}c===void 0&&H.sort(Uo),H.length&&E(H,$)}}function E(I,R){var $=I.length>>1,G=I[$];k(I,G.y0-o,$-1,R),T(I,G.y1+o,$+1,R),k(I,i,I.length-1,R),T(I,e,0,R)}function T(I,R,$,G){for(;$1e-6&&(V.y0+=H,V.y1+=H),R=V.y1+o}}function k(I,R,$,G){for(;$>=0;--$){var V=I[$],H=(V.y1-R)*G;H>1e-6&&(V.y0-=H,V.y1-=H),R=V.y0-o}}function P(I){var R=I.sourceLinks,$=I.targetLinks;if(h===void 0){for(var G=0,V=$;G "+n,value:a}}},nodeWidthRatio:.008,nodePaddingRatio:.01,animation:{appear:{animation:"wave-in"},enter:{animation:"wave-in"}}}},e.prototype.changeData=function(t){this.updateOption({data:t});var i=ex(this.options,this.chart.width,this.chart.height),n=i.nodes,a=i.edges,o=nt(this.chart,qs),s=nt(this.chart,Us);o.changeData(n),s.changeData(a)},e.prototype.getSchemaAdaptor=function(){return sR},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e})(et);var ph="ancestor-node",rx="value",da="path",uR=[da,q0,hh,U0,"name","depth","height"],cR=L({},et.getDefaultOptions(),{innerRadius:0,radius:.85,hierarchyConfig:{field:"value"},tooltip:{shared:!0,showMarkers:!1,offset:20,showTitle:!1},legend:!1,sunburstStyle:{lineWidth:.5,stroke:"#FFF"},drilldown:{enabled:!0}}),hR={field:"value",size:[1,1],round:!1,padding:0,sort:function(r,e){return e.value-r.value},as:["x","y"],ignoreParentValue:!0};function fR(r,e){e=ft({},hR,e);var t=e.as;if(!O(t)||t.length!==2)throw new TypeError('Invalid as: it must be an array with 2 strings (e.g. [ "x", "y" ])!');var i;try{i=fh(e)}catch(l){console.warn(l)}var n=function(l){return Y0().size(e.size).round(e.round).padding(e.padding)(hn(l).sum(function(u){return Bt(u.children)?e.ignoreParentValue?0:u[i]-Zt(u.children,function(c,h){return c+h[i]},0):u[i]}).sort(e.sort))},a=n(r),o=t[0],s=t[1];return a.each(function(l){var u,c;l[o]=[l.x0,l.x1,l.x1,l.x0],l[s]=[l.y1,l.y1,l.y0,l.y0],l.name=l.name||((u=l.data)===null||u===void 0?void 0:u.name)||((c=l.data)===null||c===void 0?void 0:c.label),l.data.name=l.name,["x0","x1","y0","y1"].forEach(function(h){t.indexOf(h)===-1&&delete l[h]})}),vh(a)}var vR={field:"value",tile:"treemapSquarify",size:[1,1],round:!1,ignoreParentValue:!0,padding:0,paddingInner:0,paddingOuter:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,as:["x","y"],sort:function(r,e){return e.value-r.value},ratio:.5*(1+Math.sqrt(5))};function dR(r,e){return r==="treemapSquarify"?Md[r].ratio(e):Md[r]}function ix(r,e){e=ft({},vR,e);var t=e.as;if(!O(t)||t.length!==2)throw new TypeError('Invalid as: it must be an array with 2 strings (e.g. [ "x", "y" ])!');var i;try{i=fh(e)}catch(u){console.warn(u)}var n=dR(e.tile,e.ratio),a=function(u){return W0().tile(n).size(e.size).round(e.round).padding(e.padding).paddingInner(e.paddingInner).paddingOuter(e.paddingOuter).paddingTop(e.paddingTop).paddingRight(e.paddingRight).paddingBottom(e.paddingBottom).paddingLeft(e.paddingLeft)(hn(u).sum(function(c){return e.ignoreParentValue&&c.children?0:c[i]}).sort(e.sort))},o=a(r),s=t[0],l=t[1];return o.each(function(u){u[s]=[u.x0,u.x1,u.x1,u.x0],u[l]=[u.y1,u.y1,u.y0,u.y0],["x0","x1","y0","y1"].forEach(function(c){t.indexOf(c)===-1&&delete u[c]})}),vh(o)}function nx(r){var e=r.data,t=r.colorField,i=r.rawFields,n=r.hierarchyConfig,a=n===void 0?{}:n,o=a.activeDepth,s={partition:fR,treemap:ix},l=r.seriesField,u=r.type||"partition",c=s[u](e,g.__assign(g.__assign({field:l||"value"},Ko(a,["activeDepth"])),{type:"hierarchy.".concat(u),as:["x","y"]})),h=[];return c.forEach(function(f){var v,d,p,y,m,x;if(f.depth===0||o>0&&f.depth>o)return null;for(var _=f.data.name,w=g.__assign({},f);w.depth>1;)_="".concat((d=w.parent.data)===null||d===void 0?void 0:d.name," / ").concat(_),w=w.parent;var b=g.__assign(g.__assign(g.__assign({},ct(f.data,g.__spreadArray(g.__spreadArray([],i||[],!0),[a.field],!1))),(v={},v[da]=_,v[ph]=w.data.name,v)),f);l&&(b[l]=f.data[l]||((y=(p=f.parent)===null||p===void 0?void 0:p.data)===null||y===void 0?void 0:y[l])),t&&(b[t]=f.data[t]||((x=(m=f.parent)===null||m===void 0?void 0:m.data)===null||x===void 0?void 0:x[t])),b.ext=a,b[va]={hierarchyConfig:a,colorField:t,rawFields:i},h.push(b)}),h}function gR(r){var e=r.chart,t=r.options,i=t.color,n=t.colorField,a=n===void 0?ph:n,o=t.sunburstStyle,s=t.rawFields,l=s===void 0?[]:s,u=t.shape,c=nx(t);e.data(c);var h;return o&&(h=function(f){return L({},{fillOpacity:Math.pow(.85,f.depth)},W(o)?o(f):o)}),zs(L({},r,{options:{xField:"x",yField:"y",seriesField:a,rawFields:hi(g.__spreadArray(g.__spreadArray([],uR,!0),l,!0)),polygon:{color:i,style:h,shape:u}}})),r}function pR(r){var e=r.chart;return e.axis(!1),r}function yR(r){var e=r.chart,t=r.options,i=t.label,n=$t(e,"polygon");if(!i)n.label(!1);else{var a=i.fields,o=a===void 0?["name"]:a,s=i.callback,l=g.__rest(i,["fields","callback"]);n.label({fields:o,callback:s,cfg:Ot(l)})}return r}function mR(r){var e=r.chart,t=r.options,i=t.innerRadius,n=t.radius,a=t.reflect,o=e.coordinate({type:"polar",cfg:{innerRadius:i,radius:n}});return a&&o.reflect(a),r}function xR(r){var e,t=r.options,i=t.hierarchyConfig,n=t.meta;return j(Mt({},(e={},e[rx]=M(n,M(i,["field"],"value")),e)))(r)}function wR(r){var e=r.chart,t=r.options,i=t.tooltip;if(i===!1)e.tooltip(!1);else{var n=i;M(i,"fields")||(n=L({},{customItems:function(a){return a.map(function(o){var s=M(e.getOptions(),"scales"),l=M(s,[da,"formatter"],function(c){return c}),u=M(s,[rx,"formatter"],function(c){return c});return g.__assign(g.__assign({},o),{name:l(o.data[da]),value:u(o.data.value)})})}},n)),e.tooltip(n)}return r}function _R(r){var e=r.drilldown,t=r.interactions,i=t===void 0?[]:t;return e!=null&&e.enabled?L({},r,{interactions:g.__spreadArray(g.__spreadArray([],i,!0),[{type:"drill-down",cfg:{drillDownConfig:e,transformData:nx}}],!1)}):r}function bR(r){var e=r.chart,t=r.options,i=t.drilldown;return wt({chart:e,options:_R(t)}),i!=null&&i.enabled&&(e.appendPadding=Ds(e.appendPadding,M(i,["breadCrumb","position"]))),r}function SR(r){return j(ot,ge("sunburstStyle"),gR,pR,xR,sn,mR,wR,yR,bR,vt,St())(r)}(function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="sunburst",t}return e.getDefaultOptions=function(){return cR},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return SR},e.SUNBURST_ANCESTOR_FIELD=ph,e.SUNBURST_PATH_FIELD=da,e.NODE_ANCESTORS_FIELD=hh,e})(et);function ax(r,e){if(O(r))return r.find(function(t){return t.type===e})}function ox(r,e){var t=ax(r,e);return t&&t.enable!==!1}function yh(r){var e=r.interactions,t=r.drilldown;return M(t,"enabled")||ox(e,"treemap-drill-down")}function CR(r){var e=r.interactions["drill-down"];if(e){var t=e.context.actions.find(function(i){return i.name==="drill-down-action"});t.reset()}}function mh(r){var e=r.data,t=r.colorField,i=r.enableDrillDown,n=r.hierarchyConfig,a=ix(e,g.__assign(g.__assign({},n),{type:"hierarchy.treemap",field:"value",as:["x","y"]})),o=[];return a.forEach(function(s){if(s.depth===0||i&&s.depth!==1||!i&&s.children)return null;var l=s.ancestors().map(function(f){return{data:f.data,height:f.height,value:f.value}}),u=i&&O(e.path)?l.concat(e.path.slice(1)):l,c=Object.assign({},s.data,g.__assign({x:s.x,y:s.y,depth:s.depth,value:s.value,path:u},s));if(!s.data[t]&&s.parent){var h=s.ancestors().find(function(f){return f.data[t]});c[t]=h==null?void 0:h.data[t]}else c[t]=s.data[t];c[va]={hierarchyConfig:n,colorField:t,enableDrillDown:i},o.push(c)}),o}function MR(r){var e=r.options,t=e.colorField;return L({options:{rawFields:["value"],tooltip:{fields:["name","value",t,"path"],formatter:function(i){return{name:i.name,value:i.value}}}}},r)}function AR(r){var e=r.chart,t=r.options,i=t.color,n=t.colorField,a=t.rectStyle,o=t.hierarchyConfig,s=t.rawFields,l=mh({data:t.data,colorField:t.colorField,enableDrillDown:yh(t),hierarchyConfig:o});return e.data(l),zs(L({},r,{options:{xField:"x",yField:"y",seriesField:n,rawFields:s,polygon:{color:i,style:a}}})),e.coordinate().reflect("y"),r}function FR(r){var e=r.chart;return e.axis(!1),r}function TR(r){var e=r.drilldown,t=r.interactions,i=t===void 0?[]:t,n=yh(r);return n?L({},r,{interactions:g.__spreadArray(g.__spreadArray([],i,!0),[{type:"drill-down",cfg:{drillDownConfig:e,transformData:mh}}],!1)}):r}function ER(r){var e=r.chart,t=r.options,i=t.interactions,n=t.drilldown;wt({chart:e,options:TR(t)});var a=ax(i,"view-zoom");a&&(a.enable!==!1?e.getCanvas().on("mousewheel",function(s){s.preventDefault()}):e.getCanvas().off("mousewheel"));var o=yh(t);return o&&(e.appendPadding=Ds(e.appendPadding,M(n,["breadCrumb","position"]))),r}function kR(r){return j(MR,ot,ge("rectStyle"),AR,FR,sn,Pt,ER,vt,St())(r)}var LR={colorField:"name",rectStyle:{lineWidth:1,stroke:"#fff"},hierarchyConfig:{tile:"treemapSquarify"},label:{fields:["name"],layout:{type:"limit-in-shape"}},tooltip:{showMarkers:!1,showTitle:!1},drilldown:{enabled:!1,breadCrumb:{position:"bottom-left",rootText:"初始",dividerText:"/",textStyle:{fontSize:12,fill:"rgba(0, 0, 0, 0.65)",cursor:"pointer"},activeTextStyle:{fill:"#87B5FF"}}}};(function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="treemap",t}return e.getDefaultOptions=function(){return LR},e.prototype.changeData=function(t){var i=this.options,n=i.colorField,a=i.interactions,o=i.hierarchyConfig;this.updateOption({data:t});var s=mh({data:t,colorField:n,enableDrillDown:ox(a,"treemap-drill-down"),hierarchyConfig:o});this.chart.changeData(s),CR(this.chart)},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return kR},e})(et);var cr="id",ku="path",IR={appendPadding:[10,0,20,0],blendMode:"multiply",tooltip:{showTitle:!1,showMarkers:!1,fields:["id","size"],formatter:function(r){return{name:r.id,value:r.size}}},legend:{position:"top-left"},label:{style:{textAlign:"center",fill:"#fff"}},interactions:[{type:"legend-filter",enable:!1}],state:{active:{style:{stroke:"#000"}},selected:{style:{stroke:"#000",lineWidth:2}},inactive:{style:{fillOpacity:.3,strokeOpacity:.3}}},defaultInteractions:["tooltip","venn-legend-active"]};function js(r){if(r){var e=r.geometries[0].elements;e.forEach(function(t){t.shape.toFront()})}}var PR=As("element-active"),DR=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.syncElementsPos=function(){js(this.context.view)},e.prototype.active=function(){r.prototype.active.call(this),this.syncElementsPos()},e.prototype.toggle=function(){r.prototype.toggle.call(this),this.syncElementsPos()},e.prototype.reset=function(){r.prototype.reset.call(this),this.syncElementsPos()},e}(PR),BR=As("element-highlight"),OR=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.syncElementsPos=function(){js(this.context.view)},e.prototype.highlight=function(){r.prototype.highlight.call(this),this.syncElementsPos()},e.prototype.toggle=function(){r.prototype.toggle.call(this),this.syncElementsPos()},e.prototype.clear=function(){r.prototype.clear.call(this),this.syncElementsPos()},e.prototype.reset=function(){r.prototype.reset.call(this),this.syncElementsPos()},e}(BR),RR=As("element-selected"),NR=As("element-single-selected"),zR=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.syncElementsPos=function(){js(this.context.view)},e.prototype.selected=function(){r.prototype.selected.call(this),this.syncElementsPos()},e.prototype.toggle=function(){r.prototype.toggle.call(this),this.syncElementsPos()},e.prototype.reset=function(){r.prototype.reset.call(this),this.syncElementsPos()},e}(RR),VR=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.syncElementsPos=function(){js(this.context.view)},e.prototype.selected=function(){r.prototype.selected.call(this),this.syncElementsPos()},e.prototype.toggle=function(){r.prototype.toggle.call(this),this.syncElementsPos()},e.prototype.reset=function(){r.prototype.reset.call(this),this.syncElementsPos()},e}(NR);q("venn-element-active",DR);q("venn-element-highlight",OR);q("venn-element-selected",zR);q("venn-element-single-selected",VR);J("venn-element-active",{start:[{trigger:"element:mouseenter",action:"venn-element-active:active"}],end:[{trigger:"element:mouseleave",action:"venn-element-active:reset"}]});J("venn-element-highlight",{start:[{trigger:"element:mouseenter",action:"venn-element-highlight:highlight"}],end:[{trigger:"element:mouseleave",action:"venn-element-highlight:reset"}]});J("venn-element-selected",{start:[{trigger:"element:click",action:"venn-element-selected:toggle"}],rollback:[{trigger:"dblclick",action:["venn-element-selected:reset"]}]});J("venn-element-single-selected",{start:[{trigger:"element:click",action:"venn-element-single-selected:toggle"}],rollback:[{trigger:"dblclick",action:["venn-element-single-selected:reset"]}]});J("venn-legend-active",{start:[{trigger:"legend-item:mouseenter",action:["list-active:active","venn-element-active:active"]}],end:[{trigger:"legend-item:mouseleave",action:["list-active:reset","venn-element-active:reset"]}]});J("venn-legend-highlight",{start:[{trigger:"legend-item:mouseenter",action:["legend-item-highlight:highlight","venn-element-highlight:highlight"]}],end:[{trigger:"legend-item:mouseleave",action:["legend-item-highlight:reset","venn-element-highlight:reset"]}]});var GR=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getLabelPoint=function(t,i,n){var a=t.data,o=a.x,s=a.y,l=t.customLabelInfo,u=l.offsetX,c=l.offsetY;return{content:t.content[n],x:o+u,y:s+c}},e}(ks);Sa("venn",GR);var $n=` \v\f\r   ᠎              \u2028\u2029`,YR=new RegExp("([a-z])["+$n+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+$n+"]*,?["+$n+"]*)+)","ig"),$R=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+$n+"]*,?["+$n+"]*","ig");function HR(r){if(!r)return null;if(qx(r))return r;var e={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},t=[];return String(r).replace(YR,function(i,n,a){var o=[],s=n.toLowerCase();if(a.replace($R,function(l,u){u&&o.push(+u)}),s==="m"&&o.length>2&&(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>=e[s]&&(t.push([n].concat(o.splice(0,e[s]))),!!e[s]););return""}),t}function XR(r){return L({},r.defaultStyle,{fill:r.color},r.style)}lt("schema","venn",{draw:function(r,e){var t=r.data,i=HR(t[ku]),n=XR(r),a=e.addGroup({name:"venn-shape"});a.addShape("path",{attrs:g.__assign(g.__assign({},n),{path:i}),name:"venn-path"});var o=r.customInfo,s=o.offsetX,l=o.offsetY,u=se.transform(null,[["t",s,l]]);return a.setMatrix(u),a},getMarker:function(r){var e=r.color;return{symbol:"circle",style:{lineWidth:0,stroke:e,fill:e,r:4}}}});var WR=function(r){return function(e,t){var i=[];return i[0]=r(e[0],t[0]),i[1]=r(e[1],t[1]),i[2]=r(e[2],t[2]),i}},$d={normal:function(r){return r},multiply:function(r,e){return r*e/255},screen:function(r,e){return 255*(1-(1-r/255)*(1-e/255))},overlay:function(r,e){return e<128?2*r*e/255:255*(1-2*(1-r/255)*(1-e/255))},darken:function(r,e){return r>e?e:r},lighten:function(r,e){return r>e?r:e},dodge:function(r,e){return r===255?255:(r=255*(e/255)/(1-r/255),r>255?255:r)},burn:function(r,e){return e===255?255:r===0?0:255*(1-Math.min(1,(1-e/255)/(r/255)))}},qR=function(r){if(!$d[r])throw new Error("unknown blend mode "+r);return $d[r]};function UR(r,e,t){t===void 0&&(t="normal");var i=WR(qR(t))(ho(r),ho(e)),n=ho(r),a=n[0],o=n[1],s=n[2],l=n[3],u=ho(e),c=u[0],h=u[1],f=u[2],v=u[3],d=Number((l+v*(1-l)).toFixed(2)),p=Math.round((l*(1-v)*(a/255)+l*v*(i[0]/255)+(1-l)*v*(c/255))/d*255),y=Math.round((l*(1-v)*(o/255)+l*v*(i[1]/255)+(1-l)*v*(h/255))/d*255),m=Math.round((l*(1-v)*(s/255)+l*v*(i[2]/255)+(1-l)*v*(f/255))/d*255);return"rgba(".concat(p,", ").concat(y,", ").concat(m,", ").concat(d,")")}function ho(r){var e=r.replace("/s+/g",""),t;return typeof e=="string"&&!e.startsWith("rgba")&&!e.startsWith("#")?t=kr.rgb2arr(kr.toRGB(e)).concat([1]):(e.startsWith("rgba")&&(t=e.replace("rgba(","").replace(")","").split(",")),e.startsWith("#")&&(t=kr.rgb2arr(e).concat([1])),t.map(function(i,n){return n===3?Number(i):i|0}))}function jR(r,e,t,i){i=i||{};var n=i.maxIterations||100,a=i.tolerance||1e-10,o=r(e),s=r(t),l=t-e;if(o*s>0)throw"Initial bisect points must have opposite signs";if(o===0)return e;if(s===0)return t;for(var u=0;u=0&&(e=c),Math.abs(l)=d[v-1].fx){var k=!1;if(w.fx>T.fx?(rr(b,1+c,_,-c,T),b.fx=r(b),b.fx=1)break;for(p=1;ps+a*n*l||u>=m)y=n;else{if(Math.abs(h)<=-o*l)return n;h*(y-p)>=0&&(y=p),p=n,m=u}return 0}for(var d=0;d<10;++d){if(rr(i.x,1,t.x,n,e),u=i.fx=r(i.x,i.fxprime),h=Gi(i.fxprime,e),u>s+a*n*l||d&&u>=c)return v(f,n,c);if(Math.abs(h)<=-o*l)return n;if(h>=0)return v(n,f,u);c=u,f=n,n*=2}return n}function QR(r,e,t){var i={x:e.slice(),fx:0,fxprime:e.slice()},n={x:e.slice(),fx:0,fxprime:e.slice()},a=e.slice(),o,s,l=1,u;t=t||{},u=t.maxIterations||e.length*20,i.fx=r(i.x,i.fxprime),o=i.fxprime.slice(),Pu(o,i.fxprime,-1);for(var c=0;c1){var l=hx(i);for(o=0;o-1){var p=r[h.parentIndex[d]],y=Math.atan2(h.x-p.x,h.y-p.y),m=Math.atan2(c.x-p.x,c.y-p.y),x=m-y;x<0&&(x+=2*Math.PI);var _=m-x/2,w=Ie(f,{x:p.x+p.radius*Math.sin(_),y:p.y+p.radius*Math.cos(_)});w>p.radius*2&&(w=p.radius*2),(v===null||v.width>w)&&(v={circle:p,width:w,p1:h,p2:c})}v!==null&&(s.push(v),n+=Du(v.circle.radius,v.width),c=h)}}else{var b=r[0];for(o=1;oMath.abs(b.radius-r[o].radius)){C=!0;break}C?n=a=0:(n=b.radius*b.radius*Math.PI,s.push({circle:b,p1:{x:b.x,y:b.y+b.radius},p2:{x:b.x-lx,y:b.y+b.radius},width:b.radius*2}))}return a/=2,e&&(e.area=n+a,e.arcArea=n,e.polygonArea=a,e.arcs=s,e.innerPoints=i,e.intersectionPoints=t),n+a}function KR(r,e){for(var t=0;te[t].radius+lx)return!1;return!0}function JR(r){for(var e=[],t=0;t=r+e)return 0;if(t<=Math.abs(r-e))return Math.PI*Math.min(r,e)*Math.min(r,e);var i=r-(t*t-e*e+r*r)/(2*t),n=e-(t*t-r*r+e*e)/(2*t);return Du(r,i)+Du(e,n)}function cx(r,e){var t=Ie(r,e),i=r.radius,n=e.radius;if(t>=i+n||t<=Math.abs(i-n))return[];var a=(i*i-n*n+t*t)/(2*t),o=Math.sqrt(i*i-a*a),s=r.x+a*(e.x-r.x)/t,l=r.y+a*(e.y-r.y)/t,u=-(e.y-r.y)*(o/t),c=-(e.x-r.x)*(o/t);return[{x:s+u,y:l-c},{x:s-u,y:l+c}]}function hx(r){for(var e={x:0,y:0},t=0;t=o&&(a=t[i],o=s)}var l=sx(function(f){return-1*Ol({x:f[0],y:f[1]},r,e)},[a.x,a.y],{maxIterations:500,minErrorDelta:1e-10}).x,u={x:l[0],y:l[1]},c=!0;for(i=0;ir[i].radius){c=!1;break}for(i=0;i0&&console.log("WARNING: area "+a+" not represented on screen")}return t}function rN(r,e,t){var i=[],n=r-t,a=e;return i.push("M",n,a),i.push("A",t,t,0,1,0,n+2*t,a),i.push("A",t,t,0,1,0,n,a),i.join(" ")}function iN(r){var e={};xh(r,e);var t=e.arcs;if(t.length===0)return"M 0 0";if(t.length==1){var i=t[0].circle;return rN(i.x,i.y,i.radius)}else{for(var n=[` M`,t[0].p2.x,t[0].p2.y],a=0;as;n.push(` A`,s,s,0,l?1:0,1,o.p1.x,o.p1.y)}return n.join(" ")}}function nN(r,e){e=e||{},e.maxIterations=e.maxIterations||500;var t=e.initialLayout||lN,i=e.lossFunction||wh;r=aN(r);var n=t(r,e),a=[],o=[],s;for(s in n)n.hasOwnProperty(s)&&(a.push(n[s].x),a.push(n[s].y),o.push(s));for(var l=sx(function(h){for(var f={},v=0;vu?1:-1}),i=0;i=Math.min(e[o].size,e[s].size)?h=1:a.size<=1e-10&&(h=-1),n[o][s]=n[s][o]=h}),{distances:i,constraints:n}}function sN(r,e,t,i){var n=0,a;for(a=0;a0&&d<=h||f<0&&d>=h||(n+=2*p*p,e[2*a]+=4*p*(o-u),e[2*a+1]+=4*p*(s-c),e[2*l]+=4*p*(u-o),e[2*l+1]+=4*p*(c-s))}return n}function lN(r,e){var t=cN(r,e),i=e.lossFunction||wh;if(r.length>=8){var n=uN(r,e),a=i(n,r),o=i(t,r);a+1e-8=Math.min(i[c].size,i[h].size)&&(u=0),n[c].push({set:h,size:l.size,weight:u}),n[h].push({set:c,size:l.size,weight:u})}var f=[];for(a in n)if(n.hasOwnProperty(a)){for(var v=0,o=0;o=m.length)){var B=Math.max(P-h,0),z=P,X=Math.min(P+h,m.length-1),I=B-(P-h),R=P+h-X,$=w[-h-1+I]||0,G=w[-h-1+R]||0,V=b/(b-$-G);I>0&&(A+=V*(I-1)*C);var H=Math.max(0,P-h+1);a.inside(0,m.length-1,H)&&(m[H].y+=V*1*C),a.inside(0,m.length-1,z+1)&&(m[z+1].y-=V*2*C),a.inside(0,m.length-1,X+1)&&(m[X+1].y+=V*1*C)}});var F=A,E=0,T=0;return m.forEach(function(k){E+=k.y,F+=E,k.y=F,T+=F}),T>0&&m.forEach(function(k){k.y/=T}),m};function s(l,u){for(var c={},h=0,f=-u;f<=u;f++)h+=l(f/u),c[f]=h;return c}r.exports.getExpectedValueFromPdf=function(l){if(!(!l||l.length===0)){var u=0;return l.forEach(function(c){u+=c.x*c.y}),u}},r.exports.getXWithLeftTailArea=function(l,u){if(!(!l||l.length===0)){for(var c=0,h=0,f=0;f=u));f++);return l[h].x}},r.exports.getPerplexity=function(l){if(!(!l||l.length===0)){var u=0;return l.forEach(function(c){var h=Math.log(c.y);isFinite(h)&&(u+=c.y*h)}),u=-u/i,Math.pow(2,u)}}})(LN);const PN=Ou;function Xd(r,e){var t=r.length*e;if(r.length===0)throw new Error("quantile requires at least one data point.");if(e<0||e>1)throw new Error("quantiles must be between 0 and 1");return e===1?r[r.length-1]:e===0?r[0]:t%1!==0?r[Math.ceil(t)-1]:r.length%2===0?(r[t-1]+r[t])/2:r[t]}function _n(r,e,t){var i=r[e];r[e]=r[t],r[t]=i}function wo(r,e,t,i){for(t=t||0,i=i||r.length-1;i>t;){if(i-t>600){var n=i-t+1,a=e-t+1,o=Math.log(n),s=.5*Math.exp(2*o/3),l=.5*Math.sqrt(o*s*(n-s)/n);a-n/2<0&&(l*=-1);var u=Math.max(t,Math.floor(e-a*s/n+l)),c=Math.min(i,Math.floor(e+(n-a)*s/n+l));wo(r,e,u,c)}var h=r[e],f=t,v=i;for(_n(r,t,e),r[i]>h&&_n(r,t,i);fh;)v--}r[t]===h?_n(r,t,v):(v++,_n(r,v,i)),v<=e&&(t=v+1),e<=v&&(i=v-1)}}function bn(r,e){var t=r.slice();if(Array.isArray(e)){DN(t,e);for(var i=[],n=0;n0?c:h},y=L({},r,{options:{xField:n,yField:_e,seriesField:n,rawFields:[a,Zs,Nu,_e],widthRatio:l,interval:{style:u,shape:v||"waterfall",color:p}}}),m=Ht(y).ext,x=m.geometry;return x.customInfo(g.__assign(g.__assign({},d),{leaderLine:s})),r}function QN(r){var e,t,i=r.options,n=i.xAxis,a=i.yAxis,o=i.xField,s=i.yField,l=i.meta,u=L({},{alias:s},M(l,s));return j(Mt((e={},e[o]=n,e[s]=a,e[_e]=a,e),L({},l,(t={},t[_e]=u,t[Zs]=u,t[bh]=u,t))))(r)}function KN(r){var e=r.chart,t=r.options,i=t.xAxis,n=t.yAxis,a=t.xField,o=t.yField;return i===!1?e.axis(a,!1):e.axis(a,i),n===!1?(e.axis(o,!1),e.axis(_e,!1)):(e.axis(o,n),e.axis(_e,n)),r}function JN(r){var e=r.chart,t=r.options,i=t.legend,n=t.total,a=t.risingFill,o=t.fallingFill,s=t.locale,l=Rs(s);if(i===!1)e.legend(!1);else{var u=[{name:l.get(["general","increase"]),value:"increase",marker:{symbol:"square",style:{r:5,fill:a}}},{name:l.get(["general","decrease"]),value:"decrease",marker:{symbol:"square",style:{r:5,fill:o}}}];n&&u.push({name:n.label||"",value:"total",marker:{symbol:"square",style:L({},{r:5},M(n,"style"))}}),e.legend(L({},{custom:!0,position:"top",items:u},i)),e.removeInteraction("legend-filter")}return r}function tz(r){var e=r.chart,t=r.options,i=t.label,n=t.labelMode,a=t.xField,o=$t(e,"interval");if(!i)o.label(!1);else{var s=i.callback,l=g.__rest(i,["callback"]);o.label({fields:n==="absolute"?[bh,a]:[Zs,a],callback:s,cfg:Ot(l)})}return r}function ez(r){var e=r.chart,t=r.options,i=t.tooltip,n=t.xField,a=t.yField;if(i!==!1){e.tooltip(g.__assign({showCrosshairs:!1,showMarkers:!1,shared:!0,fields:[a]},i));var o=e.geometries[0];i!=null&&i.formatter?o.tooltip("".concat(n,"*").concat(a),i.formatter):o.tooltip(a)}else e.tooltip(!1);return r}function rz(r){return j(jN,ot,ZN,QN,KN,JN,ez,tz,Hr,wt,vt,St())(r)}(function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="waterfall",t}return e.getDefaultOptions=function(){return XN},e.prototype.changeData=function(t){var i=this.options,n=i.xField,a=i.yField,o=i.total;this.updateOption({data:t}),this.chart.changeData(_x(t,n,a,o))},e.prototype.getSchemaAdaptor=function(){return rz},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e})(et);var Sh="color",iz=L({},et.getDefaultOptions(),{timeInterval:2e3,legend:!1,tooltip:{showTitle:!1,showMarkers:!1,showCrosshairs:!1,fields:["text","value",Sh],formatter:function(r){return{name:r.text,value:r.value}}},wordStyle:{fontFamily:"Verdana",fontWeight:"normal",padding:1,fontSize:[12,60],rotation:[0,90],rotationSteps:2,rotateRatio:.5}}),nz={font:function(){return"serif"},padding:1,size:[500,500],spiral:"archimedean",timeInterval:3e3};function az(r,e){return e=ft({},nz,e),oz(r,e)}function oz(r,e){var t=xz();["font","fontSize","fontWeight","padding","rotate","size","spiral","timeInterval","random"].forEach(function(l){D(e[l])||t[l](e[l])}),t.words(r),e.imageMask&&t.createMask(e.imageMask);var i=t.start(),n=i._tags;n.forEach(function(l){l.x+=e.size[0]/2,l.y+=e.size[1]/2});var a=e.size,o=a[0],s=a[1];return n.push({text:"",value:0,x:0,y:0,opacity:0}),n.push({text:"",value:0,x:o,y:s,opacity:0}),n}var Rl=Math.PI/180,kn=1<<11>>5,So=1<<11;function sz(r){return r.text}function lz(){return"serif"}function Ud(){return"normal"}function uz(r){return r.value}function cz(){return~~(Math.random()*2)*90}function hz(){return 1}function fz(r,e,t,i){if(!e.sprite){var n=r.context,a=r.ratio;n.clearRect(0,0,(kn<<5)/a,So/a);var o=0,s=0,l=0,u=t.length;for(--i;++i>5<<5,h=~~Math.max(Math.abs(p+y),Math.abs(p-y))}else c=c+31>>5<<5;if(h>l&&(l=h),o+c>=kn<<5&&(o=0,s+=l,l=0),s+h>=So)break;n.translate((o+(c>>1))/a,(s+(h>>1))/a),e.rotate&&n.rotate(e.rotate*Rl),n.fillText(e.text,0,0),e.padding&&(n.lineWidth=2*e.padding,n.strokeText(e.text,0,0)),n.restore(),e.width=c,e.height=h,e.xoff=o,e.yoff=s,e.x1=c>>1,e.y1=h>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,o+=c}for(var x=n.getImageData(0,0,(kn<<5)/a,So/a).data,_=[];--i>=0;)if(e=t[i],!!e.hasText){for(var c=e.width,w=c>>5,h=e.y1-e.y0,b=0;b>5),T=x[(s+F)*(kn<<5)+(o+b)<<2]?1<<31-b%32:0;_[E]|=T,C|=T}C?A=F:(e.y0++,h--,F--,s++)}e.y1=e.y0+A,e.sprite=_.slice(0,(e.y1-e.y0)*w)}}}function vz(r,e,t){t>>=5;for(var i=r.sprite,n=r.width>>5,a=r.x-(n<<4),o=a&127,s=32-o,l=r.y1-r.y0,u=(r.y+r.y0)*t+(a>>5),c,h=0;h>>o:0))&e[u+f])return!0;u+=t}return!1}function dz(r,e){var t=r[0],i=r[1];e.x+e.x0i.x&&(i.x=e.x+e.x1),e.y+e.y1>i.y&&(i.y=e.y+e.y1)}function gz(r,e){return r.x+r.x1>e[0].x&&r.x+r.x0e[0].y&&r.y+r.y0>5)*r[1]),w=l.length,b=[],C=l.map(function(T,k,P){return T.text=c.call(this,T,k,P),T.font=e.call(this,T,k,P),T.style=h.call(this,T,k,P),T.weight=i.call(this,T,k,P),T.rotate=n.call(this,T,k,P),T.size=~~t.call(this,T,k,P),T.padding=a.call(this,T,k,P),T}).sort(function(T,k){return k.size-T.size}),A=-1,F=v.board?[{x:0,y:0},{x:y,y:m}]:null;E();function E(){for(var T=Date.now();Date.now()-T>1,k.y=m*(s()+.5)>>1,fz(x,k,C,A),k.hasText&&p(_,k,F)&&(b.push(k),F?v.hasImage||dz(F,k):F=[{x:k.x+k.x0,y:k.y+k.y0},{x:k.x+k.x1,y:k.y+k.y1}],k.x-=r[0]>>1,k.y-=r[1]>>1)}v._tags=b,v._bounds=F}return v};function d(y){y.width=y.height=1;var m=Math.sqrt(y.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,1,1).data.length>>2);y.width=(kn<<5)/m,y.height=So/m;var x=y.getContext("2d",{willReadFrequently:!0});return x.fillStyle=x.strokeStyle="red",x.textAlign="center",{context:x,ratio:m}}function p(y,m,x){for(var _=m.x,w=m.y,b=Math.sqrt(r[0]*r[0]+r[1]*r[1]),C=o(r),A=s()<.5?1:-1,F,E=-A,T,k;(F=C(E+=A))&&(T=~~F[0],k=~~F[1],!(Math.min(Math.abs(T),Math.abs(k))>=b));)if(m.x=_+T,m.y=w+k,!(m.x+m.x0<0||m.y+m.y0<0||m.x+m.x1>r[0]||m.y+m.y1>r[1])&&(!x||!vz(m,y,r[0]))&&(!x||gz(m,x))){for(var P=m.sprite,B=m.width>>5,z=r[0]>>5,X=m.x-(B<<4),I=X&127,R=32-I,$=m.y1-m.y0,G=void 0,V=(m.y+m.y0)*z+(X>>5),H=0;H<$;H++){G=0;for(var Z=0;Z<=B;Z++)y[V+Z]|=G<>>I:0);V+=z}return delete m.sprite,!0}return!1}return v.createMask=function(y){var m=document.createElement("canvas"),x=r[0],_=r[1];if(!(!x||!_)){var w=x>>5,b=jd((x>>5)*_);m.width=x,m.height=_;var C=m.getContext("2d");C.drawImage(y,0,0,y.width,y.height,0,0,x,_);for(var A=C.getImageData(0,0,x,_).data,F=0;F<_;F++)for(var E=0;E>5),k=F*x+E<<2,P=A[k]>=250&&A[k+1]>=250&&A[k+2]>=250,B=P?1<<31-E%32:0;b[T]|=B}v.board=b,v.hasImage=!0}},v.timeInterval=function(y){u=y??1/0},v.words=function(y){l=y},v.size=function(y){r=[+y[0],+y[1]]},v.font=function(y){e=Ge(y)},v.fontWeight=function(y){i=Ge(y)},v.rotate=function(y){n=Ge(y)},v.spiral=function(y){o=mz[y]||y},v.fontSize=function(y){t=Ge(y)},v.padding=function(y){a=Ge(y)},v.random=function(y){s=Ge(y)},v}function Sx(r){var e=r.options,t=r.chart,i=t,n=i.width,a=i.height,o=i.padding,s=i.appendPadding,l=i.ele,u=e.data,c=e.imageMask,h=e.wordField,f=e.weightField,v=e.colorField,d=e.wordStyle,p=e.timeInterval,y=e.random,m=e.spiral,x=e.autoFit,_=x===void 0?!0:x,w=e.placementStrategy;if(!u||!u.length)return[];var b=d.fontFamily,C=d.fontWeight,A=d.padding,F=d.fontSize,E=Cz(u,f),T=[Fz(E),Tz(E)],k=u.map(function(z){return{text:z[h],value:z[f],color:z[v],datum:z}}),P={imageMask:c,font:b,fontSize:Sz(F,T),fontWeight:C,size:wz({width:n,height:a,padding:o,appendPadding:s,autoFit:_,container:l}),padding:A,timeInterval:p,random:y,spiral:m,rotate:Mz(e)};if(W(w)){var B=k.map(function(z,X,I){return g.__assign(g.__assign(g.__assign({},z),{hasText:!!z.text,font:Ge(P.font)(z,X,I),weight:Ge(P.fontWeight)(z,X,I),rotate:Ge(P.rotate)(z,X,I),size:Ge(P.fontSize)(z,X,I),style:"normal"}),w.call(t,z,X,I))});return B.push({text:"",value:0,x:0,y:0,opacity:0}),B.push({text:"",value:0,x:P.size[0],y:P.size[1],opacity:0}),B}return az(k,P)}function wz(r){var e=r.width,t=r.height,i=r.container,n=r.autoFit,a=r.padding,o=r.appendPadding;if(n){var s=Su(i);e=s.width,t=s.height}e=e||400,t=t||400;var l=_z({padding:a,appendPadding:o}),u=l[0],c=l[1],h=l[2],f=l[3],v=[e-(f+c),t-(u+h)];return v}function _z(r){var e=Rr(r.padding),t=Rr(r.appendPadding),i=e[0]+t[0],n=e[1]+t[1],a=e[2]+t[2],o=e[3]+t[3];return[i,n,a,o]}function bz(r){return new Promise(function(e,t){if(r instanceof HTMLImageElement){e(r);return}if(K(r)){var i=new Image;i.crossOrigin="anonymous",i.src=r,i.onload=function(){e(i)},i.onerror=function(){dr(Oe.ERROR,!1,"image %s load failed !!!",r),t()};return}dr(Oe.WARN,r===void 0,"The type of imageMask option must be String or HTMLImageElement."),t()})}function Sz(r,e){if(W(r))return r;if(O(r)){var t=r[0],i=r[1];if(!e)return function(){return(i+t)/2};var n=e[0],a=e[1];return a===n?function(){return(i+t)/2}:function(s){var l=s.value;return(i-t)/(a-n)*(l-n)+t}}return function(){return r}}function Cz(r,e){return r.map(function(t){return t[e]}).filter(function(t){return typeof t=="number"&&!isNaN(t)})}function Mz(r){var e=Az(r),t=e.rotation,i=e.rotationSteps;if(!O(t))return t;var n=t[0],a=t[1],o=i===1?0:(a-n)/(i-1);return function(){return a===n?a:Math.floor(Math.random()*i)*o}}function Az(r){var e=r.wordStyle.rotationSteps;return e<1&&(dr(Oe.WARN,!1,"The rotationSteps option must be greater than or equal to 1."),e=1),{rotation:r.wordStyle.rotation,rotationSteps:e}}function Fz(r){return Math.min.apply(Math,r)}function Tz(r){return Math.max.apply(Math,r)}function Ez(r){var e=r.chart,t=r.options,i=t.colorField,n=t.color,a=Sx(r);e.data(a);var o=L({},r,{options:{xField:"x",yField:"y",seriesField:i&&Sh,rawFields:W(n)&&g.__spreadArray(g.__spreadArray([],M(t,"rawFields",[]),!0),["datum"],!1),point:{color:n,shape:"word-cloud"}}}),s=pe(o).ext;return s.geometry.label(!1),e.coordinate().reflect("y"),e.axis(!1),r}function kz(r){return j(Mt({x:{nice:!1},y:{nice:!1}}))(r)}function Lz(r){var e=r.chart,t=r.options,i=t.legend,n=t.colorField;return i===!1?e.legend(!1):n&&e.legend(Sh,i),r}function Iz(r){j(Ez,kz,Pt,Lz,wt,vt,ot,Hr)(r)}lt("point","word-cloud",{draw:function(r,e){var t=r.x,i=r.y,n=e.addShape("text",{attrs:g.__assign(g.__assign({},Pz(r)),{x:t,y:i})}),a=r.data.rotate;return typeof a=="number"&&se.rotate(n,a*Math.PI/180),n}});function Pz(r){return{fontSize:r.data.size,text:r.data.text,textAlign:"center",fontFamily:r.data.font,fontWeight:r.data.weight,fill:r.color||r.defaultStyle.stroke,textBaseline:"alphabetic"}}(function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="word-cloud",t}return e.getDefaultOptions=function(){return iz},e.prototype.changeData=function(t){this.updateOption({data:t}),this.options.imageMask?this.render():this.chart.changeData(Sx({chart:this.chart,options:this.options}))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.render=function(){var t=this;return new Promise(function(i){var n=t.options.imageMask;if(!n){r.prototype.render.call(t),i();return}var a=function(o){t.options=g.__assign(g.__assign({},t.options),{imageMask:o||null}),r.prototype.render.call(t),i()};bz(n).then(a).catch(a)})},e.prototype.getSchemaAdaptor=function(){return Iz},e.prototype.triggerResize=function(){var t=this;this.chart.destroyed||(this.execAdaptor(),window.setTimeout(function(){r.prototype.triggerResize.call(t)}))},e})(et);(function(r){g.__extends(e,r);function e(t,i,n,a){var o=r.call(this,t,L({},a,i))||this;return o.type="g2-plot",o.defaultOptions=a,o.adaptor=n,o}return e.prototype.getDefaultOptions=function(){return this.defaultOptions},e.prototype.getSchemaAdaptor=function(){return this.adaptor},e})(et);Em("en-US",ok);Em("zh-CN",sk);export{zk as A,cL as C,KL as L,hI as P,yI as R,aP as T};