@antv/g-canvas 2.2.1 → 2.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /*!
2
2
  * @antv/g-canvas
3
3
  * @description A renderer implemented by Canvas 2D API
4
- * @version 2.2.1
5
- * @date 10/10/2026, 9:46:00 AM
4
+ * @version 2.2.2
5
+ * @date 10/16/2026, 2:34:54 AM
6
6
  * @author AntVis
7
7
  * @docs https://g.antv.antgroup.com/
8
8
  */
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /*!
2
2
  * @antv/g-canvas
3
3
  * @description A renderer implemented by Canvas 2D API
4
- * @version 2.2.1
5
- * @date 10/10/2026, 9:46:00 AM
4
+ * @version 2.2.2
5
+ * @date 10/16/2026, 2:34:54 AM
6
6
  * @author AntVis
7
7
  * @docs https://g.antv.antgroup.com/
8
8
  */
@@ -1,8 +1,8 @@
1
1
  /*!
2
2
  * @antv/g-canvas
3
3
  * @description A renderer implemented by Canvas 2D API
4
- * @version 2.2.1
5
- * @date 10/10/2026, 9:46:00 AM
4
+ * @version 2.2.2
5
+ * @date 10/16/2026, 2:34:54 AM
6
6
  * @author AntVis
7
7
  * @docs https://g.antv.antgroup.com/
8
8
  */
@@ -13,7 +13,7 @@ var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",i=r.toS
13
13
  * @antv/g-math
14
14
  * @description Geometry util
15
15
  * @version 3.1.0
16
- * @date 10/10/2026, 9:45:31 AM
16
+ * @date 10/16/2026, 2:34:18 AM
17
17
  * @author AntVis
18
18
  * @docs https://g.antv.antgroup.com/
19
19
  */function ye(e,t,r,n){var i=e-r,a=t-n;return Math.sqrt(i*i+a*a)}ve.tag="CanvasPicker";function ge(e,t,r,n,i,a){var o=-1,l=1/0,c=[r,n],s=20;a&&a>200&&(s=a/10);for(var u=1/s,f=u/10,h=0;s>=h;h++){var d=h*u,v=[i.apply(void 0,pe(e.concat([d]))),i.apply(void 0,pe(t.concat([d])))],p=ye(c[0],c[1],v[0],v[1]);l>p&&(o=d,l=p)}if(0===o)return{x:e[0],y:t[0]};if(1===o){var y=e.length;return{x:e[y-1],y:t[y-1]}}l=1/0;for(var g=0;32>g&&1e-4<=f;g++){var m=o-f,b=o+f,x=[i.apply(void 0,pe(e.concat([m]))),i.apply(void 0,pe(t.concat([m])))],S=ye(c[0],c[1],x[0],x[1]);if(m>=0&&l>S)o=m,l=S;else{var w=[i.apply(void 0,pe(e.concat([b]))),i.apply(void 0,pe(t.concat([b])))],M=ye(c[0],c[1],w[0],w[1]);1>=b&&l>M?(o=b,l=M):f*=.5}}return{x:i.apply(void 0,pe(e.concat([o]))),y:i.apply(void 0,pe(t.concat([o])))}}function me(e,t,r,n,i,a){var o=[r-e,n-t];if(function(e,t){return e[0]===t[0]&&e[1]===t[1]}(o,[0,0]))return Math.sqrt((i-e)*(i-e)+(a-t)*(a-t));var l=[-o[1],o[0]];return function(e,t){var r=t[0],n=t[1],i=r*r+n*n;i>0&&(i=1/Math.sqrt(i)),e[0]=t[0]*i,e[1]=t[1]*i}(l,l),Math.abs(function(e,t){return e[0]*t[0]+e[1]*t[1]}([i-e,a-t],l))}function be(e,t,r,n,i){var a=1-i;return a*a*a*e+3*t*i*a*a+3*r*i*i*a+n*i*i*i}function xe(e,t,r,n,i,a,o,l,c,s,u){var f=function(e,t,r,n,i,a,o,l,c,s,u){return ge([e,r,i,o],[t,n,a,l],c,s,be,u)}(e,t,r,n,i,a,o,l,c,s,u);return ye(f.x,f.y,c,s)}function Se(e,t,r,n){var i=1-n;return i*i*e+2*n*i*t+n*n*r}function we(e,t,r,n,i,a,o,l){var c=function(e,t,r,n,i,a,o,l){return ge([e,r,i],[t,n,a],o,l,Se)}(e,t,r,n,i,a,o,l);return ye(c.x,c.y,o,l)}function Me(e,r,n){var i=e.parsedStyle,a=i.cx,o=i.cy,l=i.r,c=i.fill,s=i.stroke,u=i.lineWidth,f=i.increasedLineWidthForHitTesting,h=i.pointerEvents,d=void 0===h?"auto":h,v=((void 0===u?1:u)+(void 0===f?0:f))/2,p=ye(void 0===a?0:a,void 0===o?0:o,r.x,r.y),y=m(t.isFillOrStrokeAffected(d,c,s),2),g=y[0],b=y[1];return g&&b||n?l+v>=p:g?l>=p:!!b&&(p>=l-v&&l+v>=p)}function ke(e,t,r,n){return e/(r*r)+t/(n*n)}function Oe(e,r,n){var i=e.parsedStyle,a=i.cx,o=void 0===a?0:a,l=i.cy,c=void 0===l?0:l,s=i.rx,u=i.ry,f=i.lineWidth,h=void 0===f?1:f,d=i.increasedLineWidthForHitTesting,v=void 0===d?0:d,p=i.pointerEvents,y=r.x,g=r.y,b=m(t.isFillOrStrokeAffected(void 0===p?"auto":p,i.fill,i.stroke),2),x=b[0],S=b[1],w=(h+v)/2,M=(y-o)*(y-o),k=(g-c)*(g-c);return x&&S||n?1>=ke(M,k,s+w,u+w):x?1>=ke(M,k,s,u):!!S&&(ke(M,k,s-w,u-w)>=1&&1>=ke(M,k,s+w,u+w))}function Ce(e,t,r,n,i,a){return!(e>i||i>e+r||t>a||a>t+n)}function Pe(e,t,r,n,i,a,o,l){var c=(Math.atan2(l-t,o-e)+2*Math.PI)%(2*Math.PI),s={x:e+r*Math.cos(c),y:t+r*Math.sin(c)};return ye(s.x,s.y,o,l)<=a/2}function Te(e,t,r,n,i,a,o){var l=i/2;return!(Math.min(e,r)-l>a||a>Math.max(e,r)+l||Math.min(t,n)-l>o||o>Math.max(t,n)+l)&&me(e,t,r,n,a,o)<=i/2}function Ae(e,t,r,n,i){var a=e.length;if(2>a)return!1;for(var o=0;a-1>o;o++){if(Te(e[o][0],e[o][1],e[o+1][0],e[o+1][1],t,r,n))return!0}if(i){var l=e[0],c=e[a-1];if(Te(l[0],l[1],c[0],c[1],t,r,n))return!0}return!1}function Re(e){return 1e-6>Math.abs(e)?0:0>e?-1:1}function Ee(e,t,r){return!((r[0]-e[0])*(t[1]-e[1])!==(t[0]-e[0])*(r[1]-e[1])||Math.min(e[0],t[0])>r[0]||r[0]>Math.max(e[0],t[0])||Math.min(e[1],t[1])>r[1]||r[1]>Math.max(e[1],t[1]))}function De(e,t,r){var n=!1,i=e.length;if(2>=i)return!1;for(var a=0;i>a;a++){var o=e[a],l=e[(a+1)%i];if(Ee(o,l,[t,r]))return!0;Re(o[1]-r)>0!=Re(l[1]-r)>0&&0>Re(t-(r-o[1])*(o[0]-l[0])/(o[1]-l[1])-o[0])&&(n=!n)}return n}function Ie(e,t,r){for(var n=!1,i=0;e.length>i;i++){if(n=De(e[i],t,r))break}return n}function je(e,r,n){var i=e.parsedStyle,a=i.x1,o=i.y1,l=i.x2,c=i.y2,s=i.lineWidth,u=void 0===s?1:s,f=i.increasedLineWidthForHitTesting,h=void 0===f?0:f,d=i.pointerEvents;return!(!m(t.isFillOrStrokeAffected(void 0===d?"auto":d,i.fill,i.stroke),2)[1]&&!n||!u)&&Te(a,o,l,c,u+h,r.x,r.y)}function Fe(e,r,n,i,a,o){var l=e.parsedStyle,c=l.lineWidth,s=void 0===c?1:c,u=l.increasedLineWidthForHitTesting,f=void 0===u?0:u,h=l.d,d=l.pointerEvents,v=h.segments,p=h.hasArc,y=h.polylines,g=h.polygons,b=m(t.isFillOrStrokeAffected(void 0===d?"auto":d,(null==g?void 0:g.length)&&l.fill,l.stroke),2),x=b[0],S=b[1],w=t.getOrCalculatePathTotalLength(e),M=!1;return x||n?M=p?i(e,r):Ie(g,r.x,r.y)||Ie(y,r.x,r.y):((S||n)&&(M=function(e,t,r,n,i){for(var a=!1,o=t/2,l=0;e.length>l;l++){var c=e[l],s=c.currentPoint,u=c.params,f=c.prePoint,h=c.box;if(!h||Ce(h.x-o,h.y-o,h.width+t,h.height+t,r,n))switch(c.command){case"L":case"Z":if(a=Te(f[0],f[1],s[0],s[1],t,r,n))return!0;break;case"Q":if(a=t/2>=we(f[0],f[1],u[1],u[2],u[3],u[4],r,n))return!0;break;case"C":if(a=t/2>=xe(f[0],f[1],u[1],u[2],u[3],u[4],u[5],u[6],r,n,i))return!0;break;case"A":c.cubicParams||(c.cubicParams=I(f[0],f[1],u[1],u[2],u[3],u[4],u[5],u[6],u[7],void 0));for(var d=c.cubicParams,v=f,p=0;d.length>p;p+=6){var y=xe(v[0],v[1],d[p],d[p+1],d[p+2],d[p+3],d[p+4],d[p+5],r,n,i);if(v=[d[p+4],d[p+5]],a=t/2>=y)return!0}}}return a}(v,s+f,r.x,r.y,w)),M)}function Le(e,r,n){var i=e.parsedStyle,a=i.lineWidth,o=void 0===a?1:a,l=i.increasedLineWidthForHitTesting,c=void 0===l?0:l,s=i.points,u=i.pointerEvents,f=m(t.isFillOrStrokeAffected(void 0===u?"auto":u,i.fill,i.stroke),2),h=f[0],d=!1;return(f[1]||n)&&(d=Ae(s.points,o+c,r.x,r.y,!0)),d||!h&&!n||(d=De(s.points,r.x,r.y)),d}function Ne(e,r,n){var i=e.parsedStyle,a=i.lineWidth,o=void 0===a?1:a,l=i.increasedLineWidthForHitTesting,c=void 0===l?0:l,s=i.points,u=i.pointerEvents;return!(!m(t.isFillOrStrokeAffected(void 0===u?"auto":u,i.fill,i.stroke),2)[1]&&!n||!o)&&Ae(s.points,o+c,r.x,r.y,!1)}function Be(e,r,n,i,a){var o=e.parsedStyle,l=o.radius,c=o.lineWidth,s=void 0===c?1:c,u=o.increasedLineWidthForHitTesting,f=void 0===u?0:u,h=o.x,d=void 0===h?0:h,v=o.y,p=void 0===v?0:v,y=o.width,g=o.height,b=o.pointerEvents,x=m(t.isFillOrStrokeAffected(void 0===b?"auto":b,o.fill,o.stroke),2),S=x[0],w=x[1],M=s+f;if(l&&l.some(function(e){return 0!==e})){var k=!1;return(w||n)&&(k=function(e,t,r,n,i,a,o,l){var c=m(i,4),s=c[0],u=c[1],f=c[2],h=c[3];return Te(e+s,t,e+r-u,t,a,o,l)||Te(e+r,t+u,e+r,t+n-f,a,o,l)||Te(e+r-f,t+n,e+h,t+n,a,o,l)||Te(e,t+n-h,e,t+s,a,o,l)||Pe(e+r-u,t+u,u,0,0,a,o,l)||Pe(e+r-f,t+n-f,f,0,0,a,o,l)||Pe(e+h,t+n-h,h,0,0,a,o,l)||Pe(e+s,t+s,s,0,0,a,o,l)}(d,p,y,g,l.map(function(e){return E(e,0,Math.min(Math.abs(y)/2,Math.abs(g)/2))}),M,r.x,r.y)),k||!S&&!n||(k=i(e,r)),k}var O=M/2;return S&&w||n?Ce(d-O,p-O,y+O,g+O,r.x,r.y):S?Ce(d,p,y,g,r.x,r.y):!!w&&function(e,t,r,n,i,a,o){var l=i/2;return Ce(e-l,t-l,r,i,a,o)||Ce(e+r-l,t-l,i,n,a,o)||Ce(e+l,t+n-l,r,i,a,o)||Ce(e-l,t+l,i,n,a,o)}(d,p,y,g,M,r.x,r.y)}function Ge(e,r,n,i,a,o){var l=e.parsedStyle,c=l.pointerEvents,s=l.x,u=void 0===s?0:s,f=l.y,h=void 0===f?0:f,d=l.width,v=l.height;if("non-transparent-pixel"===(void 0===c?"auto":c)){var y=a.config.offscreenCanvas,g=o.offscreenCanvasCreator.getOrCreateCanvas(y),m=o.offscreenCanvasCreator.getOrCreateContext(y,{willReadFrequently:!0});return g.width=d,g.height=v,a.defaultStyleRendererFactory[t.Shape.IMAGE].render(m,p(p({},e.parsedStyle),{},{x:0,y:0}),e,void 0,void 0,void 0),m.getImageData(r.x-u,r.y-h,1,1).data.every(function(e){return 0!==e})}return!0}function We(e,t,r,n){var i=e.getGeometryBounds();return!(i.min[0]>t.x||i.min[1]>t.y||t.x>i.max[0]||t.y>i.max[1])}var _e=function(e){function r(){var e;o(this,r);for(var t=arguments.length,n=Array(t),i=0;t>i;i++)n[i]=arguments[i];return(e=u(this,r,[].concat(n))).name="canvas-picker",e}return h(r,e),a(r,[{key:"init",value:function(){var e,r=(d(d(d(d(d(d(d(d(d(d(e={},t.Shape.CIRCLE,Me),t.Shape.ELLIPSE,Oe),t.Shape.RECT,Be),t.Shape.LINE,je),t.Shape.POLYLINE,Ne),t.Shape.POLYGON,Le),t.Shape.PATH,Fe),t.Shape.TEXT,We),t.Shape.GROUP,null),t.Shape.IMAGE,Ge),d(d(e,t.Shape.HTML,null),t.Shape.MESH,null));this.context.pointInPathPickerFactory=r,this.addRenderingPlugin(new ve)}},{key:"destroy",value:function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()}}])}(t.AbstractRendererPlugin),He=Object.freeze({__proto__:null,Plugin:_e});function $e(e,t){var r=t.cx,n=t.cy;e.arc(void 0===r?0:r,void 0===n?0:n,t.r,0,2*Math.PI,!1)}function ze(e,t){var r=t.cx,n=void 0===r?0:r,i=t.cy,a=void 0===i?0:i,o=t.rx,l=t.ry;if(e.ellipse)e.ellipse(n,a,o,l,0,0,2*Math.PI,!1);else{var c=o>l?o:l,s=o>l?1:o/l,u=o>l?l/o:1;e.save(),e.scale(s,u),e.arc(n,a,c,0,2*Math.PI)}}function Ye(e,r){var n=r.x1,i=r.y1,a=r.x2,o=r.y2,l=r.markerStart,c=r.markerEnd,s=r.markerStartOffset,u=r.markerEndOffset,f=0,h=0,d=0,v=0,p=0;l&&t.isDisplayObject(l)&&s&&(f=Math.cos(p=Math.atan2(o-i,a-n))*(s||0),h=Math.sin(p)*(s||0)),c&&t.isDisplayObject(c)&&u&&(d=Math.cos(p=Math.atan2(i-o,n-a))*(u||0),v=Math.sin(p)*(u||0)),e.moveTo(n+f,i+h),e.lineTo(a+d,o+v)}function Xe(e,r){var n=r.markerStart,i=r.markerEnd,a=r.markerStartOffset,o=r.markerEndOffset,l=r.d,c=l.absolutePath,s=l.segments,u=0,f=0,h=0,d=0,v=0;if(n&&t.isDisplayObject(n)&&a){var p=m(n.parentNode.getStartTangent(),2),y=p[0],g=p[1];u=Math.cos(v=Math.atan2(y[1]-g[1],y[0]-g[0]))*(a||0),f=Math.sin(v)*(a||0)}if(i&&t.isDisplayObject(i)&&o){var b=m(i.parentNode.getEndTangent(),2),x=b[0],S=b[1];h=Math.cos(v=Math.atan2(x[1]-S[1],x[0]-S[0]))*(o||0),d=Math.sin(v)*(o||0)}for(var w=0;c.length>w;w++){var M=c[w],k=M[0],O=c[w+1],C=(w===c.length-1||O&&("M"===O[0]||"Z"===O[0]))&&0!==h&&0!==d,P=m(0===w&&(0!==u||0!==f)?[u,f]:[0,0],2),T=P[0],A=P[1],R=m(C?[h,d]:[0,0],2),E=R[0],D=R[1];switch(k){case"M":e.moveTo(M[1]+T,M[2]+A);break;case"L":e.lineTo(M[1]+E,M[2]+D);break;case"Q":e.quadraticCurveTo(M[1],M[2],M[3]+E,M[4]+D);break;case"C":e.bezierCurveTo(M[1],M[2],M[3],M[4],M[5]+E,M[6]+D);break;case"A":var I=s[w].arcParams,j=I.cx,F=I.cy,L=I.rx,N=I.ry,B=I.startAngle,G=I.endAngle,W=I.xRotation,_=I.sweepFlag;if(e.ellipse)e.ellipse(j,F,L,N,W,B,G,!!(1-_));else{var H=L>N?L:N,$=L>N?1:L/N,z=L>N?N/L:1;e.translate(j,F),e.rotate(W),e.scale($,z),e.arc(0,0,H,B,G,!!(1-_)),e.scale(1/$,1/z),e.rotate(-W),e.translate(-j,-F)}C&&e.lineTo(M[6]+h,M[7]+d);break;case"Z":e.closePath()}}}function qe(e,r){var n=r.markerStart,i=r.markerEnd,a=r.markerStartOffset,o=r.markerEndOffset,l=r.points.points,c=l.length,s=l[0][0],u=l[0][1],f=l[c-1][0],h=l[c-1][1],d=0,v=0,p=0,y=0,g=0;n&&t.isDisplayObject(n)&&a&&(d=Math.cos(g=Math.atan2(l[1][1]-l[0][1],l[1][0]-l[0][0]))*(a||0),v=Math.sin(g)*(a||0)),i&&t.isDisplayObject(i)&&o&&(p=Math.cos(g=Math.atan2(l[c-1][1]-l[0][1],l[c-1][0]-l[0][0]))*(o||0),y=Math.sin(g)*(o||0)),e.moveTo(s+(d||p),u+(v||y));for(var m=1;c-1>m;m++){var b=l[m];e.lineTo(b[0],b[1])}e.lineTo(f,h)}function Ve(e,r){var n=r.markerStart,i=r.markerEnd,a=r.markerStartOffset,o=r.markerEndOffset,l=r.points.points,c=l.length,s=l[0][0],u=l[0][1],f=l[c-1][0],h=l[c-1][1],d=0,v=0,p=0,y=0,g=0;n&&t.isDisplayObject(n)&&a&&(d=Math.cos(g=Math.atan2(l[1][1]-l[0][1],l[1][0]-l[0][0]))*(a||0),v=Math.sin(g)*(a||0)),i&&t.isDisplayObject(i)&&o&&(p=Math.cos(g=Math.atan2(l[c-2][1]-l[c-1][1],l[c-2][0]-l[c-1][0]))*(o||0),y=Math.sin(g)*(o||0)),e.moveTo(s+d,u+v);for(var m=1;c-1>m;m++){var b=l[m];e.lineTo(b[0],b[1])}e.lineTo(f+p,h+y)}function Qe(e,t){var r=t.x,n=void 0===r?0:r,i=t.y,a=void 0===i?0:i,o=t.radius,l=t.width,c=t.height,s=l,u=c;if(o&&o.some(function(e){return 0!==e})){var f=l>0?1:-1,h=c>0?1:-1,d=f+h===0,v=m(o.map(function(e){return E(e,0,Math.min(Math.abs(s)/2,Math.abs(u)/2))}),4),p=v[0],y=v[1],g=v[2],b=v[3];e.moveTo(f*p+n,a),e.lineTo(s-f*y+n,a),0!==y&&e.arc(s-f*y+n,h*y+a,y,-h*Math.PI/2,f>0?0:Math.PI,d),e.lineTo(s+n,u-h*g+a),0!==g&&e.arc(s-f*g+n,u-h*g+a,g,f>0?0:Math.PI,h>0?Math.PI/2:1.5*Math.PI,d),e.lineTo(f*b+n,u+a),0!==b&&e.arc(f*b+n,u-h*b+a,b,h>0?Math.PI/2:-Math.PI/2,f>0?Math.PI:0,d),e.lineTo(n,h*p+a),0!==p&&e.arc(f*p+n,h*p+a,p,f>0?Math.PI:0,h>0?1.5*Math.PI:Math.PI/2,d)}else e.rect(n,a,s,u)}var Ue=function(e){function r(){var e;o(this,r);for(var t=arguments.length,n=Array(t),i=0;t>i;i++)n[i]=arguments[i];return(e=u(this,r,[].concat(n))).name="canvas-path-generator",e}return h(r,e),a(r,[{key:"init",value:function(){var e,r=(d(d(d(d(d(d(d(d(d(d(e={},t.Shape.CIRCLE,$e),t.Shape.ELLIPSE,ze),t.Shape.RECT,Qe),t.Shape.LINE,Ye),t.Shape.POLYLINE,Ve),t.Shape.POLYGON,qe),t.Shape.PATH,Xe),t.Shape.TEXT,void 0),t.Shape.GROUP,void 0),t.Shape.IMAGE,void 0),d(d(d(e,t.Shape.HTML,void 0),t.Shape.MESH,void 0),t.Shape.FRAGMENT,void 0));this.context.pathGeneratorFactory=r}},{key:"destroy",value:function(){delete this.context.pathGeneratorFactory}}])}(t.AbstractRendererPlugin),Je=Object.freeze({__proto__:null,Plugin:Ue}),Ze=function(){return a(function e(t){o(this,e),this.renderingContext=t.renderingContext,this.canvasConfig=t.config},[{key:"init",value:function(){var e=this.canvasConfig,t=e.container,r=e.canvas;if(r)this.$canvas=r,t&&r.parentElement!==t&&t.appendChild(r),this.$container=r.parentElement,this.canvasConfig.container=this.$container;else if(t&&(this.$container="string"==typeof t?document.getElementById(t):t,this.$container)){var n=document.createElement("canvas");this.$container.appendChild(n),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=n}this.context=this.$canvas.getContext("2d"),this.resize(this.canvasConfig.width,this.canvasConfig.height)}},{key:"getContext",value:function(){return this.context}},{key:"getDomElement",value:function(){return this.$canvas}},{key:"getDPR",value:function(){return this.dpr}},{key:"getBoundingClientRect",value:function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()}},{key:"destroy",value:function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)}},{key:"resize",value:function(e,r){this.dpr=this.canvasConfig.devicePixelRatio,this.$canvas&&(this.$canvas.width=this.dpr*e,this.$canvas.height=this.dpr*r,t.setDOMSize(this.$canvas,e,r)),this.renderingContext.renderReasons.add(t.RenderReason.CAMERA_CHANGED)}},{key:"applyCursorStyle",value:function(e){this.$container&&this.$container.style&&(this.$container.style.cursor=e)}},{key:"toDataURL",value:(e=se(le().mark(function e(){var t,r=arguments;return le().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.context.canvas.toDataURL((t=r.length>0&&void 0!==r[0]?r[0]:{}).type,t.encoderOptions));case 1:case"end":return e.stop()}},e,this)})),function(){return e.apply(this,arguments)})}]);var e}(),Ke=function(e){function t(){var e;o(this,t);for(var r=arguments.length,n=Array(r),i=0;r>i;i++)n[i]=arguments[i];return(e=u(this,t,[].concat(n))).name="canvas-context-register",e}return h(t,e),a(t,[{key:"init",value:function(){this.context.ContextService=Ze}},{key:"destroy",value:function(){delete this.context.ContextService}}])}(t.AbstractRendererPlugin),et=function(e){function r(e){var n;return o(this,r),(n=u(this,r,[e])).registerPlugin(new Ke),n.registerPlugin(new t.ImageLoader.Plugin),n.registerPlugin(new Ue),n.registerPlugin(new J),n.registerPlugin(new t.DomInteraction.Plugin),n.registerPlugin(new _e),n.registerPlugin(new t.HTMLRenderer.Plugin),n}return h(r,e),a(r)}(t.AbstractRenderer);Object.defineProperty(e,"DomInteraction",{enumerable:!0,get:function(){return t.DomInteraction}}),Object.defineProperty(e,"HTMLRenderer",{enumerable:!0,get:function(){return t.HTMLRenderer}}),Object.defineProperty(e,"ImageLoader",{enumerable:!0,get:function(){return t.ImageLoader}}),e.CanvasPathGenerator=Je,e.CanvasPicker=He,e.CanvasRenderer=Z,e.Renderer=et});