"use strict";function b(e,i,t,o={}){if(t<=0)return;e.save();const{color:s="black",lineWidth:a=1,lineCap:w="round",lineJoin:f="round",lineDash:g=null,lineDashoffset:u=0,shadowColor:l=null,shadowBlur:r=0,shadowOffsetX:y=0,shadowOffsetY:d=0,fillStyle:N="#FFFFFF"}=o;e.beginPath(),e.arc(i.x,i.y,t,0,2*Math.PI),e.strokeStyle=s,e.lineWidth=a,e.lineCap=w,e.lineJoin=f,g&&(e.setLineDash(g),e.lineDashoffset=u),l&&(e.shadowColor=l,e.shadowOffsetX=y,e.shadowOffsetY=d),r&&(e.shadowBlur=r),N&&(e.fillStyle=N),e.fillStyle&&e.fill(),e.stroke(),e.restore()}function C(e,i,t={}){if(!i.length)return;e.save();const{color:o="black",lineWidth:s=1,lineCap:a="round",lineJoin:w="round",lineDash:f=null,lineDashoffset:g=0,shadowColor:u=null,shadowBlur:l=0,shadowOffsetX:r=0,shadowOffsetY:y=0}=t;e.beginPath(),e.moveTo(i[0].x,i[0].y);for(let d=1;d<i.length;d+=1)e.lineTo(i[d].x,i[d].y);e.strokeStyle=o,e.lineWidth=s,e.lineCap=a,e.lineJoin=w,f&&(e.setLineDash(f),e.lineDashoffset=g),u&&(e.shadowColor=u,e.shadowOffsetX=r,e.shadowOffsetY=y),l&&(e.shadowBlur=l),e.stroke(),e.restore()}function m(e,i,t={}){if(!i.length)return;e.save();const{strokeColor:o="black",lineWidth:s=1,lineCap:a="round",lineJoin:w="round",lineDash:f=null,lineDashoffset:g=0,fillColor:u=null,gradient:l=null,shadowColor:r=null,shadowBlur:y=0,shadowOffsetX:d=0,shadowOffsetY:N=0}=t;e.beginPath(),e.moveTo(i[0].x,i[0].y);for(let n=1;n<i.length;n+=1)e.lineTo(i[n].x,i[n].y);if(e.closePath(),e.strokeStyle=o,e.lineWidth=s,e.lineCap=a,e.lineJoin=w,f&&(e.setLineDash(f),e.lineDashoffset=g),r&&(e.shadowColor=r,e.shadowBlur=y,e.shadowOffsetX=d,e.shadowOffsetY=N),l){let n;l.type==="linear"?n=e.createLinearGradient(h(l.start.x,Number.MIN_VALUE),h(l.start.y,Number.MIN_VALUE),h(l.end.x,Number.MIN_VALUE*2),h(l.end.y,Number.MIN_VALUE*2)):l.type==="radial"&&(n=e.createRadialGradient(h(l.start.x,Number.MIN_VALUE),h(l.start.y,Number.MIN_VALUE),l.start.r||0,h(l.end.x,Number.MIN_VALUE*2),h(l.end.y,Number.MIN_VALUE*2),l.end.r||0)),n&&l.stops&&(l.stops.forEach(p=>{n.addColorStop(p.offset,p.color)}),e.fillStyle=n)}else u&&(e.fillStyle=u);e.fillStyle&&e.fill(),o&&e.stroke(),e.restore()}function L(e,i,t={}){if(!i.length)return;e.save();const{strokeColor:o="black",lineWidth:s=1,lineCap:a="round",lineJoin:w="round",lineDash:f=null,lineDashoffset:g=0,fillColor:u=null,gradient:l=null,shadowColor:r=null,shadowBlur:y=0,shadowOffsetX:d=0,shadowOffsetY:N=0}=t;e.beginPath(),e.moveTo(i[0].x,i[0].y);for(let n=1;n<i.length;n+=1)e.lineTo(i[n].x,i[n].y);if(e.closePath(),e.strokeStyle=o,e.lineWidth=s,e.lineCap=a,e.lineJoin=w,f&&(e.setLineDash(f),e.lineDashoffset=g),r&&(e.shadowColor=r,e.shadowBlur=y,e.shadowOffsetX=d,e.shadowOffsetY=N),l){let n;l.type==="linear"?n=e.createLinearGradient(h(l.start.x,Number.MIN_VALUE),h(l.start.y,Number.MIN_VALUE),h(l.end.x,Number.MIN_VALUE*2),h(l.end.y,Number.MIN_VALUE*2)):l.type==="radial"&&(n=e.createRadialGradient(h(l.start.x,Number.MIN_VALUE),h(l.start.y,Number.MIN_VALUE),l.start.r||0,h(l.end.x,Number.MIN_VALUE*2),h(l.end.y,Number.MIN_VALUE*2),l.end.r||0)),n&&l.stops&&(l.stops.forEach(p=>{n.addColorStop(p.offset,p.color)}),e.fillStyle=n)}else u&&(e.fillStyle=u);e.fillStyle&&e.fill(),o&&e.stroke(),e.restore()}function I(e,i,t,o,s={}){e.save();const{font:a="16px sans-serif",color:w="black",align:f="start",baseline:g="alphabetic",maxWidth:u=void 0,rotation:l=0,shadowColor:r=null,shadowBlur:y=0,shadowOffsetX:d=0,shadowOffsetY:N=0,strokeColor:n=null,lineWidth:p=1}=s;e.font=a,e.fillStyle=w,e.textAlign=f,e.textBaseline=g,r&&(e.shadowColor=r,e.shadowBlur=y,e.shadowOffsetX=d,e.shadowOffsetY=N),n&&(e.strokeStyle=n,e.lineWidth=p),l!==0&&(e.translate(t,o),e.rotate(Math.PI/180*l),e.translate(-t,-o)),e.fillText(i,t,o,u),n&&e.strokeText(i,t,o,u),e.restore()}function O(e,i=20){let t;return function(...o){const s=this;t||(e.apply(s,o),t=!0,setTimeout(()=>t=!1,i))}}function E(e,i,t=!1){let o;return function(...s){const a=this,w=function(){o=null,t||e.apply(a,s)},f=t&&!o;clearTimeout(o),o=setTimeout(w,i),f&&e.apply(a,s)}}function S(e){const i=document.createElement("canvas");return i.width=e.width||1,i.height=e.height||1,e.width||(e.width=1),e.height||(e.height=1),i.getContext("2d").drawImage(e,0,0),i}function h(e,i){return[null,void 0,NaN,1/0,-1/0].includes(e)?i:e}function k({chart:e,title:i=null,slicer:t=null,legend:o=null,source:s=null,noTitle:a=null}){let w=0,f=0;if(e){const g=e.parentNode,{height:u,width:l}=g.getBoundingClientRect();let r=0,y=0,d=0,N=0,n=0;i&&(r=i.getBoundingClientRect().height),t&&(y=t.getBoundingClientRect().height),o&&(d=o.getBoundingClientRect().height),s&&(N=s.getBoundingClientRect().height),a&&(n=a.getBoundingClientRect().height),w=u-r-y-d-N-n,f=l}return{width:f,height:w}}exports.circle=b;exports.cloneCanvas=S;exports.debounce=E;exports.line=C;exports.polygon=m;exports.rect=L;exports.text=I;exports.throttle=O;exports.useResponsive=k;
