@antv/g-canvas 1.8.5 → 1.8.8

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.umd.js CHANGED
@@ -1778,7 +1778,7 @@
1778
1778
  } // should look up in the ancestor node
1779
1779
 
1780
1780
 
1781
- clipped = _this2.findClosestClipPath(displayObject);
1781
+ clipped = g.findClosestClipPathTarget(displayObject);
1782
1782
 
1783
1783
  if (!clipped) {
1784
1784
  _context.next = 28;
@@ -2540,8 +2540,8 @@
2540
2540
  var segments = path.segments,
2541
2541
  hasArc = path.hasArc,
2542
2542
  polylines = path.polylines,
2543
- polygons = path.polygons,
2544
- totalLength = path.totalLength;
2543
+ polygons = path.polygons;
2544
+ var totalLength = g.getOrCalculatePathTotalLength(displayObject);
2545
2545
  var isClipPath = !!(clipPathTargets === null || clipPathTargets === void 0 ? void 0 : clipPathTargets.length);
2546
2546
  var isHit = false;
2547
2547
 
@@ -2,7 +2,7 @@
2
2
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
3
3
  r=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=Object.create((e&&e.prototype instanceof f?e:f).prototype),i=new O(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return S()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===l)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=h(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),o}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function f(){}function p(){}function d(){}var v={};s(v,i,(function(){return this}));var y=Object.getPrototypeOf,g=y&&y(y(P([])));g&&g!==e&&n.call(g,i)&&(v=g);var m=d.prototype=f.prototype=Object.create(v);function w(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(o,i,a,c){var s=h(t[o],t,i);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,c)}))}c(s.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=h(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function P(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:S}}function S(){return{value:void 0,done:!0}}return p.prototype=d,s(m,"constructor",d),s(d,"constructor",p),p.displayName=s(d,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,s(t,c,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},w(b.prototype),s(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new b(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(m),s(m,c,"Generator"),s(m,i,(function(){return this})),s(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=P,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(L),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(this.prev>=i.tryLoc){var c=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(c&&s){if(i.catchLoc>this.prev)return r(i.catchLoc,!0);if(i.finallyLoc>this.prev)return r(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return r(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(this.prev>=o.tryLoc&&n.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function n(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,o)}function o(t){return function(){var e=this,r=arguments;return new Promise((function(o,i){var a=t.apply(e,r);function c(t){n(a,o,i,c,s,"next",t)}function s(t){n(a,o,i,c,s,"throw",t)}c(void 0)}))}}function i(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,a(t,e)}function a(t,e){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},a(t,e)}function c(t,e){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},c(t,e)}var s=e.Syringe.defineToken(""),u=e.Syringe.defineToken("");function h(t,e){var r=e.r;t.arc(r,r,r,0,2*Math.PI,!1)}function l(t,e){var r=e.rx,n=e.ry;if(t.ellipse)t.ellipse(r,n,r,n,0,0,2*Math.PI,!1);else{var o=r>n?r:n,i=r>n?1:r/n,a=r>n?n/r:1;t.save(),t.scale(i,a),t.arc(0,0,o,0,2*Math.PI)}}function f(t,r){var n,o,i=r.x1,a=r.y1,c=r.x2,s=r.y2,u=r.defX,h=void 0===u?0:u,l=r.defY,f=void 0===l?0:l,p=r.markerStart,d=r.markerEnd,v=r.markerStartOffset,y=r.markerEndOffset,g=0,m=0,w=0,b=0,x=0;p&&p instanceof e.DisplayObject&&v&&(n=c-i,o=s-a,x=Math.atan2(o,n),g=Math.cos(x)*(v||0),m=Math.sin(x)*(v||0)),d&&d instanceof e.DisplayObject&&y&&(n=i-c,o=a-s,x=Math.atan2(o,n),w=Math.cos(x)*(y||0),b=Math.sin(x)*(y||0)),t.moveTo(i-h+g,a-f+m),t.lineTo(c-h+w,s-f+b)}function p(t,r){var n=r.defX,o=void 0===n?0:n,i=r.defY,a=void 0===i?0:i,c=r.markerStart,s=r.markerEnd,u=r.markerStartOffset,h=r.markerEndOffset,l=r.path,f=l.zCommandIndexes,p=[].concat(l.curve);f.forEach((function(t,e){p.splice(t+e,1,["Z"])}));var d,v,y=p.length&&"Z"===p[p.length-1][0],g=0,m=0,w=0,b=0,x=0;if(c&&c instanceof e.DisplayObject&&u){var E=c.parentNode.getStartTangent(),L=E[0],O=E[1];d=L[0]-O[0],v=L[1]-O[1],x=Math.atan2(v,d),g=Math.cos(x)*(u||0),m=Math.sin(x)*(u||0)}if(s&&s instanceof e.DisplayObject&&h){var P=s.parentNode.getEndTangent(),S=P[0],k=P[1];d=S[0]-k[0],v=S[1]-k[1],x=Math.atan2(v,d),w=Math.cos(x)*(h||0),b=Math.sin(x)*(h||0)}for(var C=0;p.length>C;C++){var M=p[C];switch(M[0]){case"M":t.moveTo(M[1]-o+g,M[2]-a+m);break;case"C":t.bezierCurveTo(M[1]-o,M[2]-a,M[3]-o,M[4]-a,M[5]-o+(C===p.length-(y?2:1)?w:0),M[6]-a+(C===p.length-(y?2:1)?b:0));break;case"Z":t.closePath()}}}function d(t,r){var n,o,i=r.defX,a=void 0===i?0:i,c=r.defY,s=void 0===c?0:c,u=r.markerStart,h=r.markerEnd,l=r.markerStartOffset,f=r.markerEndOffset,p=r.points.points,d=p.length,v=p[0][0]-a,y=p[0][1]-s,g=p[d-1][0]-a,m=p[d-1][1]-s,w=0,b=0,x=0,E=0,L=0;u&&u instanceof e.DisplayObject&&l&&(n=p[1][0]-p[0][0],o=p[1][1]-p[0][1],L=Math.atan2(o,n),w=Math.cos(L)*(l||0),b=Math.sin(L)*(l||0)),h&&h instanceof e.DisplayObject&&f&&(n=p[d-1][0]-p[0][0],o=p[d-1][1]-p[0][1],L=Math.atan2(o,n),x=Math.cos(L)*(f||0),E=Math.sin(L)*(f||0)),t.moveTo(v+(w||x),y+(b||E));for(var O=1;d-1>O;O++){var P=p[O];t.lineTo(P[0]-a,P[1]-s)}t.lineTo(g,m)}function v(t,r){var n,o,i=r.defX,a=void 0===i?0:i,c=r.defY,s=void 0===c?0:c,u=r.markerStart,h=r.markerEnd,l=r.markerStartOffset,f=r.markerEndOffset,p=r.points.points,d=p.length,v=p[0][0]-a,y=p[0][1]-s,g=p[d-1][0]-a,m=p[d-1][1]-s,w=0,b=0,x=0,E=0,L=0;u&&u instanceof e.DisplayObject&&l&&(n=p[1][0]-p[0][0],o=p[1][1]-p[0][1],L=Math.atan2(o,n),w=Math.cos(L)*(l||0),b=Math.sin(L)*(l||0)),h&&h instanceof e.DisplayObject&&f&&(n=p[d-2][0]-p[d-1][0],o=p[d-2][1]-p[d-1][1],L=Math.atan2(o,n),x=Math.cos(L)*(f||0),E=Math.sin(L)*(f||0)),t.moveTo(v+w,y+b);for(var O=1;d-1>O;O++){var P=p[O];t.lineTo(P[0]-a,P[1]-s)}t.lineTo(g+x,m+E)}function y(t,r){var n=r.radius,o=r.width,i=r.height,a=o,c=i;if(n&&n.some((function(t){return 0!==t}))){var s=o>0?1:-1,u=i>0?1:-1,h=s+u===0,l=n.map((function(t){return e.clamp(t,0,Math.min(Math.abs(a)/2,Math.abs(c)/2))})),f=l[0],p=l[1],d=l[2],v=l[3];t.moveTo(s*f,0),t.lineTo(a-s*p,0),0!==p&&t.arc(a-s*p,u*p,p,-u*Math.PI/2,s>0?0:Math.PI,h),t.lineTo(a,c-u*d),0!==d&&t.arc(a-s*d,c-u*d,d,s>0?0:Math.PI,u>0?Math.PI/2:1.5*Math.PI,h),t.lineTo(s*v,c),0!==v&&t.arc(s*v,c-u*v,v,u>0?Math.PI/2:-Math.PI/2,s>0?Math.PI:0,h),t.lineTo(0,u*f),0!==f&&t.arc(s*f,u*f,f,s>0?Math.PI:0,u>0?1.5*Math.PI:Math.PI/2,h)}else t.rect(0,0,a,c)}var g=e.Module((function(t){t({token:{token:u,named:e.Shape.CIRCLE},useValue:h}),t({token:{token:u,named:e.Shape.ELLIPSE},useValue:l}),t({token:{token:u,named:e.Shape.RECT},useValue:y}),t({token:{token:u,named:e.Shape.LINE},useValue:f}),t({token:{token:u,named:e.Shape.POLYLINE},useValue:v}),t({token:{token:u,named:e.Shape.POLYGON},useValue:d}),t({token:{token:u,named:e.Shape.PATH},useValue:p}),t({token:s,useFactory:function(t){return function(e){return t.container.isBoundNamed(u,e)?t.container.getNamed(u,e):null}}})})),m=function(t){var e,r;function n(){for(var e,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return(e=t.call.apply(t,[this].concat(n))||this).name="canvas-path-generator",e}r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,c(e,r);var o=n.prototype;return o.init=function(){this.container.load(g,!0)},o.destroy=function(){this.container.unload(g)},n}(e.AbstractRendererPlugin),w=Object.freeze({__proto__:null,PathGenerator:u,PathGeneratorFactory:s,Plugin:m});function b(t,e,r,n){var o,i=arguments.length,a=3>i?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(o=t[c])&&(a=(3>i?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a}function x(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function E(){
4
4
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
5
- E=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=Object.create((e&&e.prototype instanceof l?e:l).prototype),i=new O(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return S()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=b(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=u(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===h)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),o}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var h={};function l(){}function f(){}function p(){}var d={};c(d,o,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(P([])));y&&y!==e&&r.call(y,o)&&(d=y);var g=p.prototype=l.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(o,i,a,c){var s=u(t[o],t,i);if("throw"!==s.type){var h=s.arg,l=h.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){h.value=t,a(h)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function b(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,h;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function P(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:S}}function S(){return{value:void 0,done:!0}}return f.prototype=p,c(g,"constructor",p),c(p,"constructor",f),f.displayName=c(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=P,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(L),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(this.prev>=i.tryLoc){var c=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(c&&s){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function L(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,o)}function O(t,e){return O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},O(t,e)}var P="undefined"!=typeof Float32Array?Float32Array:Array;function S(){var t=new P(16);return P!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function k(){var t=new P(3);return P!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function C(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var M;M=k();!function(){var t,e=(t=new P(2),P!=Float32Array&&(t[0]=0,t[1]=0),t)}();var j,T,_=e.Syringe.defineToken(""),N=(j=function(){function t(){var t=this;this.displayObjectPool=void 0,this.canvasConfig=void 0,this.offscreenCanvas=void 0,this.rBush=void 0,this.pathGeneratorFactory=void 0,this.pathGeneratorFactoryCache={},this.pointInPathPickerFactory=void 0,this.tmpVec3a=k(),this.tmpVec3b=k(),this.tmpVec3c=k(),this.isHit=function(r,n,o){var i,a,c,s,u,h,l,f,p,d,v,y,g,m,w,b,x,E,L,O,P,k,M,j,T,_,N,A,R,I,F,G=t.pointInPathPickerFactory(r.nodeName);if(G){var B=(i=S(),(F=(L=(c=(a=o)[0])*(f=a[5])-(s=a[1])*(l=a[4]))*(I=(g=a[10])*(E=a[15])-(m=a[11])*(x=a[14]))-(O=c*(p=a[6])-(u=a[2])*l)*(R=(y=a[9])*E-m*(b=a[13]))+(P=c*(d=a[7])-(h=a[3])*l)*(A=y*x-g*b)+(k=s*p-u*f)*(N=(v=a[8])*E-m*(w=a[12]))-(M=s*d-h*f)*(_=v*x-g*w)+(j=u*d-h*p)*(T=v*b-y*w))?(i[0]=(f*I-p*R+d*A)*(F=1/F),i[1]=(u*R-s*I-h*A)*F,i[2]=(b*j-x*M+E*k)*F,i[3]=(g*M-y*j-m*k)*F,i[4]=(p*N-l*I-d*_)*F,i[5]=(c*I-u*N+h*_)*F,i[6]=(x*P-w*j-E*O)*F,i[7]=(v*j-g*P+m*O)*F,i[8]=(l*R-f*N+d*T)*F,i[9]=(s*N-c*R-h*T)*F,i[10]=(w*M-b*P+E*L)*F,i[11]=(y*P-v*M-m*L)*F,i[12]=(f*_-l*A-p*T)*F,i[13]=(c*A-s*_+u*T)*F,i[14]=(b*O-w*k-x*L)*F,i[15]=(v*k-y*O+g*L)*F,i):null),D=function(t,e,r){var n=e[0],o=e[1],i=e[2],a=r[3]*n+r[7]*o+r[11]*i+r[15];return t[0]=(r[0]*n+r[4]*o+r[8]*i+r[12])/(a=a||1),t[1]=(r[1]*n+r[5]*o+r[9]*i+r[13])/a,t[2]=(r[2]*n+r[6]*o+r[10]*i+r[14])/a,t}(t.tmpVec3b,C(t.tmpVec3c,n[0],n[1],0),B),Y=r.getGeometryBounds().halfExtents,W=r.parsedStyle.anchor;if(D[0]+=(W&&W[0]||0)*Y[0]*2,D[1]+=(W&&W[1]||0)*Y[1]*2,G(r,new e.Point(D[0],D[1]),t.isPointInPath))return!0}return!1},this.isPointInPath=function(e,r){var n=t.offscreenCanvas.getOrCreateContext(t.canvasConfig.offscreenCanvas);void 0===t.pathGeneratorFactoryCache[e.nodeName]&&(t.pathGeneratorFactoryCache[e.nodeName]=t.pathGeneratorFactory(e.nodeName));var o=t.pathGeneratorFactoryCache[e.nodeName];return o&&(n.beginPath(),o(n,e.parsedStyle),n.closePath()),n.isPointInPath(r.x,r.y)}}var r=t.prototype;return r.apply=function(t){var e=this;t.hooks.pick.tapPromise(T.tag,function(){var t,r=(t=E().mark((function t(r){var n,o,i,a,c,s,u,h,l,f,p,d,v;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=r.topmost,i=C(e.tmpVec3a,(o=r.position).x,o.y,0),a=e.rBush.search({minX:i[0],minY:i[1],maxX:i[0],maxY:i[1]}),c=a.map((function(t){return t.id})),s=[],a.forEach((function(t){var r=e.displayObjectPool.getByEntity(t.id),n=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(r.parsedStyle.pointerEvents);if((!n||n&&r.isVisible())&&!r.isCulled()&&r.isInteractive()){if(r.parentNode&&-1===c.indexOf(r.parentNode.entity))return;s.push(r)}})),s.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),u=[],h=0,l=s;case 9:if(h>=l.length){t.next=37;break}if(p=(f=l[h]).getWorldTransform(),!e.isHit(f,i,p)){t.next=34;break}if(!(d=e.findClosestClipPath(f))){t.next=28;break}if(v=d.style.clipPath,y=S(),g=d===f?p:d.getWorldTransform(),m=v.getLocalTransform(),w=void 0,b=void 0,x=void 0,E=void 0,L=void 0,O=void 0,P=void 0,k=void 0,M=void 0,j=void 0,T=void 0,_=void 0,N=void 0,A=void 0,R=void 0,I=void 0,F=void 0,G=void 0,B=void 0,D=void 0,b=g[1],x=g[2],E=g[3],O=g[5],P=g[6],k=g[7],j=g[9],T=g[10],_=g[11],A=g[13],R=g[14],I=g[15],y[0]=(F=m[0])*(w=g[0])+(G=m[1])*(L=g[4])+(B=m[2])*(M=g[8])+(D=m[3])*(N=g[12]),y[1]=F*b+G*O+B*j+D*A,y[2]=F*x+G*P+B*T+D*R,y[3]=F*E+G*k+B*_+D*I,y[4]=(F=m[4])*w+(G=m[5])*L+(B=m[6])*M+(D=m[7])*N,y[5]=F*b+G*O+B*j+D*A,y[6]=F*x+G*P+B*T+D*R,y[7]=F*E+G*k+B*_+D*I,y[8]=(F=m[8])*w+(G=m[9])*L+(B=m[10])*M+(D=m[11])*N,y[9]=F*b+G*O+B*j+D*A,y[10]=F*x+G*P+B*T+D*R,y[11]=F*E+G*k+B*_+D*I,y[12]=(F=m[12])*w+(G=m[13])*L+(B=m[14])*M+(D=m[15])*N,y[13]=F*b+G*O+B*j+D*A,y[14]=F*x+G*P+B*T+D*R,y[15]=F*E+G*k+B*_+D*I,!e.isHit(v,i,p=y)){t.next=26;break}if(!n){t.next=25;break}return r.picked=[f],t.abrupt("return",r);case 25:u.push(f);case 26:t.next=34;break;case 28:if(!n){t.next=33;break}return r.picked=[f],t.abrupt("return",r);case 33:u.push(f);case 34:h++,t.next=9;break;case 37:return r.picked=u,t.abrupt("return",r);case 39:case"end":return t.stop()}var y,g,m,w,b,x,E,L,O,P,k,M,j,T,_,N,A,R,I,F,G,B,D}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){L(i,n,o,a,c,"next",t)}function c(t){L(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(t){return r.apply(this,arguments)}}())},r.findClosestClipPath=function(t){var e=t;do{var r;if(null===(r=e.style)||void 0===r?void 0:r.clipPath)return e;e=e.parentElement}while(null!==e);return null},t}(),j.tag="CanvasPicker",T=j);function A(t,e,r,n){var o=t-r,i=e-n;return Math.sqrt(o*o+i*i)}function R(t,e){return.001>Math.abs(t-e)}function I(t,e){var r=Math.min.apply(Math,t),n=Math.min.apply(Math,e);return{x:r,y:n,width:Math.max.apply(Math,t)-r,height:Math.max.apply(Math,e)-n}}b([e.inject(e.DisplayObjectPool),x("design:type",e.DisplayObjectPool)],N.prototype,"displayObjectPool",void 0),b([e.inject(e.CanvasConfig),x("design:type",Object)],N.prototype,"canvasConfig",void 0),b([e.inject(e.OffscreenCanvasCreator),x("design:type",e.OffscreenCanvasCreator)],N.prototype,"offscreenCanvas",void 0),b([e.inject(e.RBushRoot),x("design:type",e.RBush)],N.prototype,"rBush",void 0),b([e.inject(s),x("design:type",Function)],N.prototype,"pathGeneratorFactory",void 0),b([e.inject(_),x("design:type",Function)],N.prototype,"pointInPathPickerFactory",void 0),N=T=b([e.singleton({contrib:e.RenderingPluginContribution})],N);var F=function(t,e,r,n,o){return{x:(1-o)*t+o*r,y:(1-o)*e+o*n}},G=function(t,e,r,n,o,i){var a=[r-t,n-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(a,[0,0]))return Math.sqrt((o-t)*(o-t)+(i-e)*(i-e));var c=[-a[1],a[0]];return function(t,e){var r=e[0],n=e[1],o=r*r+n*n;o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o}(c,c),Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}([o-t,i-e],c))};function B(t,e,r,n,o){var i=1-o;return i*i*i*t+3*e*o*i*i+3*r*o*o*i+n*o*o*o}function D(t,e,r,n,o){var i=1-o;return 3*(i*i*(e-t)+2*i*o*(r-e)+o*o*(n-r))}function Y(t,e,r,n){var o,i,a,c=-3*t+9*e-9*r+3*n,s=6*t-12*e+6*r,u=3*e-3*t,h=[];if(R(c,0))R(s,0)||0>(o=-u/s)||o>1||h.push(o);else{var l=s*s-4*c*u;R(l,0)?h.push(-s/(2*c)):l>0&&(i=(-s-(a=Math.sqrt(l)))/(2*c),0>(o=(-s+a)/(2*c))||o>1||h.push(o),0>i||i>1||h.push(i))}return h}function W(t,e,r,n,o,i,a,c,s){var u=B(t,r,o,a,s),h=B(e,n,i,c,s),l=F(t,e,r,n,s),f=F(r,n,o,i,s),p=F(o,i,a,c,s),d=F(l.x,l.y,f.x,f.y,s),v=F(f.x,f.y,p.x,p.y,s);return[[t,e,l.x,l.y,d.x,d.y,u,h],[u,h,v.x,v.y,p.x,p.y,a,c]]}function $(t,e,r,n,o,i,a,c,s){if(0===s)return function(t,e){for(var r=0,n=t.length,o=0;n>o;o++)r+=A(t[o],e[o],t[(o+1)%n],e[(o+1)%n]);return r/2}([t,r,o,a],[e,n,i,c]);var u=W(t,e,r,n,o,i,a,c,.5),h=[].concat(u[0],[s-1]),l=[].concat(u[1],[s-1]);return $.apply(void 0,h)+$.apply(void 0,l)}var H={extrema:Y,box:function(t,e,r,n,o,i,a,c){for(var s=[t,a],u=[e,c],h=Y(t,r,o,a),l=Y(e,n,i,c),f=0;h.length>f;f++)s.push(B(t,r,o,a,h[f]));for(var p=0;l.length>p;p++)u.push(B(e,n,i,c,l[p]));return I(s,u)},length:function(t,e,r,n,o,i,a,c){return $(t,e,r,n,o,i,a,c,3)},nearestPoint:function(t,e,r,n,o,i,a,c,s,u,h){return function(t,e,r,n,o,i){var a=-1,c=1/0,s=[r,n],u=20;i&&i>200&&(u=i/10);for(var h=1/u,l=h/10,f=0;u>=f;f++){var p=f*h,d=[o.apply(void 0,t.concat([p])),o.apply(void 0,e.concat([p]))],v=A(s[0],s[1],d[0],d[1]);c>v&&(a=p,c=v)}if(0===a)return{x:t[0],y:e[0]};if(1===a){var y=t.length;return{x:t[y-1],y:e[y-1]}}c=1/0;for(var g=0;32>g&&l>=1e-4;g++){var m=a-l,w=a+l,b=[o.apply(void 0,t.concat([m])),o.apply(void 0,e.concat([m]))],x=A(s[0],s[1],b[0],b[1]);if(m>=0&&c>x)a=m,c=x;else{var E=[o.apply(void 0,t.concat([w])),o.apply(void 0,e.concat([w]))],L=A(s[0],s[1],E[0],E[1]);1>=w&&c>L?(a=w,c=L):l*=.5}}return{x:o.apply(void 0,t.concat([a])),y:o.apply(void 0,e.concat([a]))}}([t,r,o,a],[e,n,i,c],s,u,B,h)},pointDistance:function(t,e,r,n,o,i,a,c,s,u,h){var l=this.nearestPoint(t,e,r,n,o,i,a,c,s,u,h);return A(l.x,l.y,s,u)},interpolationAt:B,pointAt:function(t,e,r,n,o,i,a,c,s){return{x:B(t,r,o,a,s),y:B(e,n,i,c,s)}},divide:function(t,e,r,n,o,i,a,c,s){return W(t,e,r,n,o,i,a,c,s)},tangentAngle:function(t,e,r,n,o,i,a,c,s){var u=D(t,r,o,a,s),h=D(e,n,i,c,s);return(Math.atan2(h,u)+2*Math.PI)%(2*Math.PI)}};function U(t,e,r,n){var o=t-r,i=e-n;return Math.sqrt(o*o+i*i)}function V(t,e,r,n,o,i){return!(t>o||o>t+r||e>i||i>e+n)}function X(t,e,r,n,o,i,a,c){var s=(Math.atan2(c-e,a-t)+2*Math.PI)%(2*Math.PI);if(n>s||s>o)return!1;var u={x:t+r*Math.cos(s),y:e+r*Math.sin(s)};return U(u.x,u.y,a,c)<=i/2}function z(t,e,r,n,o,i,a){var c=Math.min(t,r),s=Math.max(t,r),u=Math.min(e,n),h=Math.max(e,n),l=o/2;return!(c-l>i||i>s+l||u-l>a||a>h+l)&&G(t,e,r,n,i,a)<=o/2}function q(t,e,r,n,o){var i=t.length;if(2>i)return!1;for(var a=0;i-1>a;a++){if(z(t[a][0],t[a][1],t[a+1][0],t[a+1][1],e,r,n))return!0}if(o){var c=t[0],s=t[i-1];if(z(c[0],c[1],s[0],s[1],e,r,n))return!0}return!1}function Q(t){return 1e-6>Math.abs(t)?0:0>t?-1:1}function Z(t,e,r){return!((r[0]-t[0])*(e[1]-t[1])!=(e[0]-t[0])*(r[1]-t[1])||Math.min(t[0],e[0])>r[0]||r[0]>Math.max(t[0],e[0])||Math.min(t[1],e[1])>r[1]||r[1]>Math.max(t[1],e[1]))}function J(t,e,r){var n=!1,o=t.length;if(2>=o)return!1;for(var i=0;o>i;i++){var a=t[i],c=t[(i+1)%o];if(Z(a,c,[e,r]))return!0;Q(a[1]-r)>0!=Q(c[1]-r)>0&&0>Q(e-(r-a[1])*(a[0]-c[0])/(a[1]-c[1])-a[0])&&(n=!n)}return n}function K(t,e,r){for(var n=!1,o=0;t.length>o;o++){if(n=J(t[o],e,r))break}return n}function tt(t,r){var n=t.parsedStyle,o=n.r,i=n.fill,a=n.stroke,c=n.clipPathTargets,s=n.pointerEvents,u=((n.lineWidth||0)+(n.increasedLineWidthForHitTesting||0))/2,h=U(o,o,r.x,r.y),l=!!(null==c?void 0:c.length),f=e.isFillOrStrokeAffected(s,i,a),p=f[0],d=f[1];return p&&d||l?o+u>=h:p?o>=h:!!d&&(h>=o-u&&o+u>=h)}function et(t,e,r,n){return t/(r*r)+e/(n*n)}function rt(t,r){var n=r.x,o=r.y,i=t.parsedStyle,a=i.rx,c=i.ry,s=i.lineWidth,u=i.increasedLineWidthForHitTesting,h=i.clipPathTargets,l=!!(null==h?void 0:h.length),f=e.isFillOrStrokeAffected(i.pointerEvents,i.fill,i.stroke),p=f[0],d=f[1],v=((s||0)+(u||0))/2,y=(n-a)*(n-a),g=(o-c)*(o-c);return p&&d||l?1>=et(y,g,a+v,c+v):p?1>=et(y,g,a,c):!!d&&(et(y,g,a-v,c-v)>=1&&1>=et(y,g,a+v,c+v))}function nt(t,r){var n=t.parsedStyle,o=n.x1,i=n.y1,a=n.x2,c=n.y2,s=n.lineWidth,u=n.increasedLineWidthForHitTesting,h=n.defX,l=void 0===h?0:h,f=n.defY,p=void 0===f?0:f,d=n.clipPathTargets,v=!!(null==d?void 0:d.length),y=e.isFillOrStrokeAffected(n.pointerEvents,n.fill,n.stroke);return!(!y[1]&&!v||!s)&&z(o,i,a,c,(s||0)+(u||0),r.x+l,r.y+p)}function ot(t,r,n){var o=t.parsedStyle,i=o.lineWidth,a=o.increasedLineWidthForHitTesting,c=o.defX,s=void 0===c?0:c,u=o.defY,h=void 0===u?0:u,l=o.clipPathTargets,f=o.path,p=e.isFillOrStrokeAffected(o.pointerEvents,o.fill,o.stroke),d=p[1],v=f.segments,y=f.polylines,g=f.polygons,m=f.totalLength,w=!!(null==l?void 0:l.length),b=!1;return p[0]||w?b=f.hasArc?n(t,r):K(g,r.x+s,r.y+h)||K(y,r.x+s,r.y+h):((d||w)&&(b=function(t,e,r,n,o){for(var i=!1,a=0;t.length>a;a++){var c=t[a],s=c.currentPoint,u=c.params,h=c.prePoint;switch(c.command){case"L":case"Z":i=z(h[0],h[1],s[0],s[1],e,r,n);break;case"C":i=e/2>=H.pointDistance(h[0],h[1],u[1],u[2],u[3],u[4],u[5],u[6],r,n,o)}if(i)break}return i}(v,(i||0)+(a||0),r.x+s,r.y+h,m)),b)}function it(t,r){var n=t.parsedStyle,o=n.lineWidth,i=n.increasedLineWidthForHitTesting,a=n.points,c=n.defX,s=void 0===c?0:c,u=n.defY,h=void 0===u?0:u,l=n.clipPathTargets,f=!!(null==l?void 0:l.length),p=e.isFillOrStrokeAffected(n.pointerEvents,n.fill,n.stroke),d=p[0],v=!1;return(p[1]||f)&&(v=q(a.points,(o||0)+(i||0),r.x+s,r.y+h,!0)),v||!d&&!f||(v=J(a.points,r.x+s,r.y+h)),v}function at(t,r){var n=t.parsedStyle,o=n.lineWidth,i=n.increasedLineWidthForHitTesting,a=n.points,c=n.defX,s=void 0===c?0:c,u=n.defY,h=void 0===u?0:u,l=n.clipPathTargets,f=!!(null==l?void 0:l.length),p=e.isFillOrStrokeAffected(n.pointerEvents,n.fill,n.stroke);return!(!p[1]&&!f||!o)&&q(a.points,(o||0)+(i||0),r.x+s,r.y+h,!1)}function ct(t,r,n){var o=t.parsedStyle,i=o.radius,a=o.lineWidth,c=o.increasedLineWidthForHitTesting,s=o.width,u=o.height,h=o.clipPathTargets,l=!!(null==h?void 0:h.length),f=e.isFillOrStrokeAffected(o.pointerEvents,o.fill,o.stroke),p=f[0],d=f[1],v=(a||0)+(c||0);if(i&&i.some((function(t){return 0!==t}))){var y=!1;return(d||l)&&(y=function(t,e,r,n,o,i,a,c){var s=o[0],u=o[1],h=o[2],l=o[3];return z(t+s,e,t+r-u,e,i,a,c)||z(t+r,e+u,t+r,e+n-h,i,a,c)||z(t+r-h,e+n,t+l,e+n,i,a,c)||z(t,e+n-l,t,e+s,i,a,c)||X(t+r-u,e+u,u,1.5*Math.PI,2*Math.PI,i,a,c)||X(t+r-h,e+n-h,h,0,.5*Math.PI,i,a,c)||X(t+l,e+n-l,l,.5*Math.PI,Math.PI,i,a,c)||X(t+s,e+s,s,Math.PI,1.5*Math.PI,i,a,c)}(0,0,s,u,i.map((function(t){return e.clamp(t,0,Math.min(Math.abs(s)/2,Math.abs(u)/2))})),v,r.x,r.y)),y||!p&&!l||(y=n(t,r)),y}var g=v/2;return p&&d||l?V(0-g,0-g,s+g,u+g,r.x,r.y):p?V(0,0,s,u,r.x,r.y):!!d&&function(t,e,r,n,o,i,a){var c=o/2;return V(t-c,e-c,r,o,i,a)||V(t+r-c,e-c,o,n,i,a)||V(t+c,e+n-c,r,o,i,a)||V(t-c,e+c,o,n,i,a)}(0,0,s,u,v,r.x,r.y)}var st=e.Module((function(t){t({token:_,useFactory:function(t){return function(t){return t===e.Shape.CIRCLE?tt:t===e.Shape.ELLIPSE?rt:t===e.Shape.RECT?ct:t===e.Shape.LINE?nt:t===e.Shape.POLYLINE?at:t===e.Shape.POLYGON?it:t===e.Shape.PATH?ot:t===e.Shape.IMAGE||t===e.Shape.TEXT?function(){return!0}:null}}}),t(N)})),ut=function(t){var e,r;function n(){for(var e,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return(e=t.call.apply(t,[this].concat(n))||this).name="canvas-picker",e}r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,O(e,r);var o=n.prototype;return o.init=function(){this.container.load(st,!0)},o.destroy=function(){this.container.unload(st)},n}(e.AbstractRendererPlugin),ht=Object.freeze({__proto__:null,Plugin:ut});function lt(){
5
+ E=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=Object.create((e&&e.prototype instanceof l?e:l).prototype),i=new O(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return S()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=b(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=u(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===h)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),o}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var h={};function l(){}function f(){}function p(){}var d={};c(d,o,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(P([])));y&&y!==e&&r.call(y,o)&&(d=y);var g=p.prototype=l.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(o,i,a,c){var s=u(t[o],t,i);if("throw"!==s.type){var h=s.arg,l=h.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){h.value=t,a(h)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function b(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,h;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function P(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:S}}function S(){return{value:void 0,done:!0}}return f.prototype=p,c(g,"constructor",p),c(p,"constructor",f),f.displayName=c(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=P,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(L),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(this.prev>=i.tryLoc){var c=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(c&&s){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function L(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,o)}function O(t,e){return O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},O(t,e)}var P="undefined"!=typeof Float32Array?Float32Array:Array;function S(){var t=new P(16);return P!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function k(){var t=new P(3);return P!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function C(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var M;M=k();!function(){var t,e=(t=new P(2),P!=Float32Array&&(t[0]=0,t[1]=0),t)}();var j,T,_=e.Syringe.defineToken(""),N=(j=function(){function t(){var t=this;this.displayObjectPool=void 0,this.canvasConfig=void 0,this.offscreenCanvas=void 0,this.rBush=void 0,this.pathGeneratorFactory=void 0,this.pathGeneratorFactoryCache={},this.pointInPathPickerFactory=void 0,this.tmpVec3a=k(),this.tmpVec3b=k(),this.tmpVec3c=k(),this.isHit=function(r,n,o){var i,a,c,s,u,h,l,f,p,d,v,y,g,m,w,b,x,E,L,O,P,k,M,j,T,_,N,A,R,I,F,G=t.pointInPathPickerFactory(r.nodeName);if(G){var B=(i=S(),(F=(L=(c=(a=o)[0])*(f=a[5])-(s=a[1])*(l=a[4]))*(I=(g=a[10])*(E=a[15])-(m=a[11])*(x=a[14]))-(O=c*(p=a[6])-(u=a[2])*l)*(R=(y=a[9])*E-m*(b=a[13]))+(P=c*(d=a[7])-(h=a[3])*l)*(A=y*x-g*b)+(k=s*p-u*f)*(N=(v=a[8])*E-m*(w=a[12]))-(M=s*d-h*f)*(_=v*x-g*w)+(j=u*d-h*p)*(T=v*b-y*w))?(i[0]=(f*I-p*R+d*A)*(F=1/F),i[1]=(u*R-s*I-h*A)*F,i[2]=(b*j-x*M+E*k)*F,i[3]=(g*M-y*j-m*k)*F,i[4]=(p*N-l*I-d*_)*F,i[5]=(c*I-u*N+h*_)*F,i[6]=(x*P-w*j-E*O)*F,i[7]=(v*j-g*P+m*O)*F,i[8]=(l*R-f*N+d*T)*F,i[9]=(s*N-c*R-h*T)*F,i[10]=(w*M-b*P+E*L)*F,i[11]=(y*P-v*M-m*L)*F,i[12]=(f*_-l*A-p*T)*F,i[13]=(c*A-s*_+u*T)*F,i[14]=(b*O-w*k-x*L)*F,i[15]=(v*k-y*O+g*L)*F,i):null),D=function(t,e,r){var n=e[0],o=e[1],i=e[2],a=r[3]*n+r[7]*o+r[11]*i+r[15];return t[0]=(r[0]*n+r[4]*o+r[8]*i+r[12])/(a=a||1),t[1]=(r[1]*n+r[5]*o+r[9]*i+r[13])/a,t[2]=(r[2]*n+r[6]*o+r[10]*i+r[14])/a,t}(t.tmpVec3b,C(t.tmpVec3c,n[0],n[1],0),B),Y=r.getGeometryBounds().halfExtents,W=r.parsedStyle.anchor;if(D[0]+=(W&&W[0]||0)*Y[0]*2,D[1]+=(W&&W[1]||0)*Y[1]*2,G(r,new e.Point(D[0],D[1]),t.isPointInPath))return!0}return!1},this.isPointInPath=function(e,r){var n=t.offscreenCanvas.getOrCreateContext(t.canvasConfig.offscreenCanvas);void 0===t.pathGeneratorFactoryCache[e.nodeName]&&(t.pathGeneratorFactoryCache[e.nodeName]=t.pathGeneratorFactory(e.nodeName));var o=t.pathGeneratorFactoryCache[e.nodeName];return o&&(n.beginPath(),o(n,e.parsedStyle),n.closePath()),n.isPointInPath(r.x,r.y)}}var r=t.prototype;return r.apply=function(t){var r=this;t.hooks.pick.tapPromise(T.tag,function(){var t,n=(t=E().mark((function t(n){var o,i,a,c,s,u,h,l,f,p,d,v,y;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=n.topmost,a=C(r.tmpVec3a,(i=n.position).x,i.y,0),c=r.rBush.search({minX:a[0],minY:a[1],maxX:a[0],maxY:a[1]}),s=c.map((function(t){return t.id})),u=[],c.forEach((function(t){var e=r.displayObjectPool.getByEntity(t.id),n=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(e.parsedStyle.pointerEvents);if((!n||n&&e.isVisible())&&!e.isCulled()&&e.isInteractive()){if(e.parentNode&&-1===s.indexOf(e.parentNode.entity))return;u.push(e)}})),u.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),h=[],l=0,f=u;case 9:if(l>=f.length){t.next=37;break}if(d=(p=f[l]).getWorldTransform(),!r.isHit(p,a,d)){t.next=34;break}if(!(v=e.findClosestClipPathTarget(p))){t.next=28;break}if(y=v.style.clipPath,g=S(),m=v===p?d:v.getWorldTransform(),w=y.getLocalTransform(),b=void 0,x=void 0,E=void 0,L=void 0,O=void 0,P=void 0,k=void 0,M=void 0,j=void 0,T=void 0,_=void 0,N=void 0,A=void 0,R=void 0,I=void 0,F=void 0,G=void 0,B=void 0,D=void 0,Y=void 0,x=m[1],E=m[2],L=m[3],P=m[5],k=m[6],M=m[7],T=m[9],_=m[10],N=m[11],R=m[13],I=m[14],F=m[15],g[0]=(G=w[0])*(b=m[0])+(B=w[1])*(O=m[4])+(D=w[2])*(j=m[8])+(Y=w[3])*(A=m[12]),g[1]=G*x+B*P+D*T+Y*R,g[2]=G*E+B*k+D*_+Y*I,g[3]=G*L+B*M+D*N+Y*F,g[4]=(G=w[4])*b+(B=w[5])*O+(D=w[6])*j+(Y=w[7])*A,g[5]=G*x+B*P+D*T+Y*R,g[6]=G*E+B*k+D*_+Y*I,g[7]=G*L+B*M+D*N+Y*F,g[8]=(G=w[8])*b+(B=w[9])*O+(D=w[10])*j+(Y=w[11])*A,g[9]=G*x+B*P+D*T+Y*R,g[10]=G*E+B*k+D*_+Y*I,g[11]=G*L+B*M+D*N+Y*F,g[12]=(G=w[12])*b+(B=w[13])*O+(D=w[14])*j+(Y=w[15])*A,g[13]=G*x+B*P+D*T+Y*R,g[14]=G*E+B*k+D*_+Y*I,g[15]=G*L+B*M+D*N+Y*F,!r.isHit(y,a,d=g)){t.next=26;break}if(!o){t.next=25;break}return n.picked=[p],t.abrupt("return",n);case 25:h.push(p);case 26:t.next=34;break;case 28:if(!o){t.next=33;break}return n.picked=[p],t.abrupt("return",n);case 33:h.push(p);case 34:l++,t.next=9;break;case 37:return n.picked=h,t.abrupt("return",n);case 39:case"end":return t.stop()}var g,m,w,b,x,E,L,O,P,k,M,j,T,_,N,A,R,I,F,G,B,D,Y}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){L(i,n,o,a,c,"next",t)}function c(t){L(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(t){return n.apply(this,arguments)}}())},r.findClosestClipPath=function(t){var e=t;do{var r;if(null===(r=e.style)||void 0===r?void 0:r.clipPath)return e;e=e.parentElement}while(null!==e);return null},t}(),j.tag="CanvasPicker",T=j);function A(t,e,r,n){var o=t-r,i=e-n;return Math.sqrt(o*o+i*i)}function R(t,e){return.001>Math.abs(t-e)}function I(t,e){var r=Math.min.apply(Math,t),n=Math.min.apply(Math,e);return{x:r,y:n,width:Math.max.apply(Math,t)-r,height:Math.max.apply(Math,e)-n}}b([e.inject(e.DisplayObjectPool),x("design:type",e.DisplayObjectPool)],N.prototype,"displayObjectPool",void 0),b([e.inject(e.CanvasConfig),x("design:type",Object)],N.prototype,"canvasConfig",void 0),b([e.inject(e.OffscreenCanvasCreator),x("design:type",e.OffscreenCanvasCreator)],N.prototype,"offscreenCanvas",void 0),b([e.inject(e.RBushRoot),x("design:type",e.RBush)],N.prototype,"rBush",void 0),b([e.inject(s),x("design:type",Function)],N.prototype,"pathGeneratorFactory",void 0),b([e.inject(_),x("design:type",Function)],N.prototype,"pointInPathPickerFactory",void 0),N=T=b([e.singleton({contrib:e.RenderingPluginContribution})],N);var F=function(t,e,r,n,o){return{x:(1-o)*t+o*r,y:(1-o)*e+o*n}},G=function(t,e,r,n,o,i){var a=[r-t,n-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(a,[0,0]))return Math.sqrt((o-t)*(o-t)+(i-e)*(i-e));var c=[-a[1],a[0]];return function(t,e){var r=e[0],n=e[1],o=r*r+n*n;o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o}(c,c),Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}([o-t,i-e],c))};function B(t,e,r,n,o){var i=1-o;return i*i*i*t+3*e*o*i*i+3*r*o*o*i+n*o*o*o}function D(t,e,r,n,o){var i=1-o;return 3*(i*i*(e-t)+2*i*o*(r-e)+o*o*(n-r))}function Y(t,e,r,n){var o,i,a,c=-3*t+9*e-9*r+3*n,s=6*t-12*e+6*r,u=3*e-3*t,h=[];if(R(c,0))R(s,0)||0>(o=-u/s)||o>1||h.push(o);else{var l=s*s-4*c*u;R(l,0)?h.push(-s/(2*c)):l>0&&(i=(-s-(a=Math.sqrt(l)))/(2*c),0>(o=(-s+a)/(2*c))||o>1||h.push(o),0>i||i>1||h.push(i))}return h}function W(t,e,r,n,o,i,a,c,s){var u=B(t,r,o,a,s),h=B(e,n,i,c,s),l=F(t,e,r,n,s),f=F(r,n,o,i,s),p=F(o,i,a,c,s),d=F(l.x,l.y,f.x,f.y,s),v=F(f.x,f.y,p.x,p.y,s);return[[t,e,l.x,l.y,d.x,d.y,u,h],[u,h,v.x,v.y,p.x,p.y,a,c]]}function $(t,e,r,n,o,i,a,c,s){if(0===s)return function(t,e){for(var r=0,n=t.length,o=0;n>o;o++)r+=A(t[o],e[o],t[(o+1)%n],e[(o+1)%n]);return r/2}([t,r,o,a],[e,n,i,c]);var u=W(t,e,r,n,o,i,a,c,.5),h=[].concat(u[0],[s-1]),l=[].concat(u[1],[s-1]);return $.apply(void 0,h)+$.apply(void 0,l)}var H={extrema:Y,box:function(t,e,r,n,o,i,a,c){for(var s=[t,a],u=[e,c],h=Y(t,r,o,a),l=Y(e,n,i,c),f=0;h.length>f;f++)s.push(B(t,r,o,a,h[f]));for(var p=0;l.length>p;p++)u.push(B(e,n,i,c,l[p]));return I(s,u)},length:function(t,e,r,n,o,i,a,c){return $(t,e,r,n,o,i,a,c,3)},nearestPoint:function(t,e,r,n,o,i,a,c,s,u,h){return function(t,e,r,n,o,i){var a=-1,c=1/0,s=[r,n],u=20;i&&i>200&&(u=i/10);for(var h=1/u,l=h/10,f=0;u>=f;f++){var p=f*h,d=[o.apply(void 0,t.concat([p])),o.apply(void 0,e.concat([p]))],v=A(s[0],s[1],d[0],d[1]);c>v&&(a=p,c=v)}if(0===a)return{x:t[0],y:e[0]};if(1===a){var y=t.length;return{x:t[y-1],y:e[y-1]}}c=1/0;for(var g=0;32>g&&l>=1e-4;g++){var m=a-l,w=a+l,b=[o.apply(void 0,t.concat([m])),o.apply(void 0,e.concat([m]))],x=A(s[0],s[1],b[0],b[1]);if(m>=0&&c>x)a=m,c=x;else{var E=[o.apply(void 0,t.concat([w])),o.apply(void 0,e.concat([w]))],L=A(s[0],s[1],E[0],E[1]);1>=w&&c>L?(a=w,c=L):l*=.5}}return{x:o.apply(void 0,t.concat([a])),y:o.apply(void 0,e.concat([a]))}}([t,r,o,a],[e,n,i,c],s,u,B,h)},pointDistance:function(t,e,r,n,o,i,a,c,s,u,h){var l=this.nearestPoint(t,e,r,n,o,i,a,c,s,u,h);return A(l.x,l.y,s,u)},interpolationAt:B,pointAt:function(t,e,r,n,o,i,a,c,s){return{x:B(t,r,o,a,s),y:B(e,n,i,c,s)}},divide:function(t,e,r,n,o,i,a,c,s){return W(t,e,r,n,o,i,a,c,s)},tangentAngle:function(t,e,r,n,o,i,a,c,s){var u=D(t,r,o,a,s),h=D(e,n,i,c,s);return(Math.atan2(h,u)+2*Math.PI)%(2*Math.PI)}};function U(t,e,r,n){var o=t-r,i=e-n;return Math.sqrt(o*o+i*i)}function V(t,e,r,n,o,i){return!(t>o||o>t+r||e>i||i>e+n)}function X(t,e,r,n,o,i,a,c){var s=(Math.atan2(c-e,a-t)+2*Math.PI)%(2*Math.PI);if(n>s||s>o)return!1;var u={x:t+r*Math.cos(s),y:e+r*Math.sin(s)};return U(u.x,u.y,a,c)<=i/2}function z(t,e,r,n,o,i,a){var c=Math.min(t,r),s=Math.max(t,r),u=Math.min(e,n),h=Math.max(e,n),l=o/2;return!(c-l>i||i>s+l||u-l>a||a>h+l)&&G(t,e,r,n,i,a)<=o/2}function q(t,e,r,n,o){var i=t.length;if(2>i)return!1;for(var a=0;i-1>a;a++){if(z(t[a][0],t[a][1],t[a+1][0],t[a+1][1],e,r,n))return!0}if(o){var c=t[0],s=t[i-1];if(z(c[0],c[1],s[0],s[1],e,r,n))return!0}return!1}function Q(t){return 1e-6>Math.abs(t)?0:0>t?-1:1}function Z(t,e,r){return!((r[0]-t[0])*(e[1]-t[1])!=(e[0]-t[0])*(r[1]-t[1])||Math.min(t[0],e[0])>r[0]||r[0]>Math.max(t[0],e[0])||Math.min(t[1],e[1])>r[1]||r[1]>Math.max(t[1],e[1]))}function J(t,e,r){var n=!1,o=t.length;if(2>=o)return!1;for(var i=0;o>i;i++){var a=t[i],c=t[(i+1)%o];if(Z(a,c,[e,r]))return!0;Q(a[1]-r)>0!=Q(c[1]-r)>0&&0>Q(e-(r-a[1])*(a[0]-c[0])/(a[1]-c[1])-a[0])&&(n=!n)}return n}function K(t,e,r){for(var n=!1,o=0;t.length>o;o++){if(n=J(t[o],e,r))break}return n}function tt(t,r){var n=t.parsedStyle,o=n.r,i=n.fill,a=n.stroke,c=n.clipPathTargets,s=n.pointerEvents,u=((n.lineWidth||0)+(n.increasedLineWidthForHitTesting||0))/2,h=U(o,o,r.x,r.y),l=!!(null==c?void 0:c.length),f=e.isFillOrStrokeAffected(s,i,a),p=f[0],d=f[1];return p&&d||l?o+u>=h:p?o>=h:!!d&&(h>=o-u&&o+u>=h)}function et(t,e,r,n){return t/(r*r)+e/(n*n)}function rt(t,r){var n=r.x,o=r.y,i=t.parsedStyle,a=i.rx,c=i.ry,s=i.lineWidth,u=i.increasedLineWidthForHitTesting,h=i.clipPathTargets,l=!!(null==h?void 0:h.length),f=e.isFillOrStrokeAffected(i.pointerEvents,i.fill,i.stroke),p=f[0],d=f[1],v=((s||0)+(u||0))/2,y=(n-a)*(n-a),g=(o-c)*(o-c);return p&&d||l?1>=et(y,g,a+v,c+v):p?1>=et(y,g,a,c):!!d&&(et(y,g,a-v,c-v)>=1&&1>=et(y,g,a+v,c+v))}function nt(t,r){var n=t.parsedStyle,o=n.x1,i=n.y1,a=n.x2,c=n.y2,s=n.lineWidth,u=n.increasedLineWidthForHitTesting,h=n.defX,l=void 0===h?0:h,f=n.defY,p=void 0===f?0:f,d=n.clipPathTargets,v=!!(null==d?void 0:d.length),y=e.isFillOrStrokeAffected(n.pointerEvents,n.fill,n.stroke);return!(!y[1]&&!v||!s)&&z(o,i,a,c,(s||0)+(u||0),r.x+l,r.y+p)}function ot(t,r,n){var o=t.parsedStyle,i=o.lineWidth,a=o.increasedLineWidthForHitTesting,c=o.defX,s=void 0===c?0:c,u=o.defY,h=void 0===u?0:u,l=o.clipPathTargets,f=o.path,p=e.isFillOrStrokeAffected(o.pointerEvents,o.fill,o.stroke),d=p[0],v=p[1],y=f.segments,g=f.hasArc,m=f.polylines,w=f.polygons,b=e.getOrCalculatePathTotalLength(t),x=!!(null==l?void 0:l.length),E=!1;return d||x?E=g?n(t,r):K(w,r.x+s,r.y+h)||K(m,r.x+s,r.y+h):((v||x)&&(E=function(t,e,r,n,o){for(var i=!1,a=0;t.length>a;a++){var c=t[a],s=c.currentPoint,u=c.params,h=c.prePoint;switch(c.command){case"L":case"Z":i=z(h[0],h[1],s[0],s[1],e,r,n);break;case"C":i=e/2>=H.pointDistance(h[0],h[1],u[1],u[2],u[3],u[4],u[5],u[6],r,n,o)}if(i)break}return i}(y,(i||0)+(a||0),r.x+s,r.y+h,b)),E)}function it(t,r){var n=t.parsedStyle,o=n.lineWidth,i=n.increasedLineWidthForHitTesting,a=n.points,c=n.defX,s=void 0===c?0:c,u=n.defY,h=void 0===u?0:u,l=n.clipPathTargets,f=!!(null==l?void 0:l.length),p=e.isFillOrStrokeAffected(n.pointerEvents,n.fill,n.stroke),d=p[0],v=!1;return(p[1]||f)&&(v=q(a.points,(o||0)+(i||0),r.x+s,r.y+h,!0)),v||!d&&!f||(v=J(a.points,r.x+s,r.y+h)),v}function at(t,r){var n=t.parsedStyle,o=n.lineWidth,i=n.increasedLineWidthForHitTesting,a=n.points,c=n.defX,s=void 0===c?0:c,u=n.defY,h=void 0===u?0:u,l=n.clipPathTargets,f=!!(null==l?void 0:l.length),p=e.isFillOrStrokeAffected(n.pointerEvents,n.fill,n.stroke);return!(!p[1]&&!f||!o)&&q(a.points,(o||0)+(i||0),r.x+s,r.y+h,!1)}function ct(t,r,n){var o=t.parsedStyle,i=o.radius,a=o.lineWidth,c=o.increasedLineWidthForHitTesting,s=o.width,u=o.height,h=o.clipPathTargets,l=!!(null==h?void 0:h.length),f=e.isFillOrStrokeAffected(o.pointerEvents,o.fill,o.stroke),p=f[0],d=f[1],v=(a||0)+(c||0);if(i&&i.some((function(t){return 0!==t}))){var y=!1;return(d||l)&&(y=function(t,e,r,n,o,i,a,c){var s=o[0],u=o[1],h=o[2],l=o[3];return z(t+s,e,t+r-u,e,i,a,c)||z(t+r,e+u,t+r,e+n-h,i,a,c)||z(t+r-h,e+n,t+l,e+n,i,a,c)||z(t,e+n-l,t,e+s,i,a,c)||X(t+r-u,e+u,u,1.5*Math.PI,2*Math.PI,i,a,c)||X(t+r-h,e+n-h,h,0,.5*Math.PI,i,a,c)||X(t+l,e+n-l,l,.5*Math.PI,Math.PI,i,a,c)||X(t+s,e+s,s,Math.PI,1.5*Math.PI,i,a,c)}(0,0,s,u,i.map((function(t){return e.clamp(t,0,Math.min(Math.abs(s)/2,Math.abs(u)/2))})),v,r.x,r.y)),y||!p&&!l||(y=n(t,r)),y}var g=v/2;return p&&d||l?V(0-g,0-g,s+g,u+g,r.x,r.y):p?V(0,0,s,u,r.x,r.y):!!d&&function(t,e,r,n,o,i,a){var c=o/2;return V(t-c,e-c,r,o,i,a)||V(t+r-c,e-c,o,n,i,a)||V(t+c,e+n-c,r,o,i,a)||V(t-c,e+c,o,n,i,a)}(0,0,s,u,v,r.x,r.y)}var st=e.Module((function(t){t({token:_,useFactory:function(t){return function(t){return t===e.Shape.CIRCLE?tt:t===e.Shape.ELLIPSE?rt:t===e.Shape.RECT?ct:t===e.Shape.LINE?nt:t===e.Shape.POLYLINE?at:t===e.Shape.POLYGON?it:t===e.Shape.PATH?ot:t===e.Shape.IMAGE||t===e.Shape.TEXT?function(){return!0}:null}}}),t(N)})),ut=function(t){var e,r;function n(){for(var e,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return(e=t.call.apply(t,[this].concat(n))||this).name="canvas-picker",e}r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,O(e,r);var o=n.prototype;return o.init=function(){this.container.load(st,!0)},o.destroy=function(){this.container.unload(st)},n}(e.AbstractRendererPlugin),ht=Object.freeze({__proto__:null,Plugin:ut});function lt(){
6
6
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
7
7
  lt=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=Object.create((e&&e.prototype instanceof l?e:l).prototype),i=new L(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return P()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=b(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=u(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===h)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),o}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var h={};function l(){}function f(){}function p(){}var d={};c(d,o,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(O([])));y&&y!==e&&r.call(y,o)&&(d=y);var g=p.prototype=l.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(o,i,a,c){var s=u(t[o],t,i);if("throw"!==s.type){var h=s.arg,l=h.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){h.value=t,a(h)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function b(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,h;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function O(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:P}}function P(){return{value:void 0,done:!0}}return f.prototype=p,c(g,"constructor",p),c(p,"constructor",f),f.displayName=c(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=O,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(this.prev>=i.tryLoc){var c=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(c&&s){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function ft(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,o)}function pt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){ft(i,n,o,a,c,"next",t)}function c(t){ft(i,n,o,a,c,"throw",t)}a(void 0)}))}}function dt(t,e){return dt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},dt(t,e)}var vt,yt,gt=function(){function t(){this.imageCache={},this.gradientCache={},this.patternCache={},this.canvasConfig=void 0}var r=t.prototype;return r.getImageSync=function(t,e){return this.imageCache[t]?e&&e():this.getOrCreateImage(t).then((function(){e&&e()})),this.imageCache[t]},r.getOrCreateImage=function(t){var r=this;if(this.imageCache[t])return Promise.resolve(this.imageCache[t]);var n=this.canvasConfig.createImage;return new Promise((function(o,i){var a;n?a=n(t):e.isBrowser&&(a=new window.Image),a&&(a.onload=function(){o(a)},a.onerror=function(t){i(t)},a.crossOrigin="Anonymous",a.src=t,r.imageCache[t]=a)}))},r.getOrCreatePatternSync=function(t,r,n){var o=this.generatePatternKey(t);if(o&&this.patternCache[o])return this.patternCache[o];var i,a=t.image,c=t.repetition,s=(i=e.isString(a)?this.getImageSync(a,n):a)&&r.createPattern(i,c);return o&&s&&(this.patternCache[o]=s),s},r.getOrCreateGradient=function(t,r){var n=this.generateGradientKey(t),o=t.type,i=t.steps,a=t.width,c=t.height,s=t.cx,u=t.cy;if(this.gradientCache[n])return this.gradientCache[n];var h=null;if(o===e.GradientType.LinearGradient){var l=e.computeLinearGradient(a,c,t.angle);h=r.createLinearGradient(l.x1,l.y1,l.x2,l.y2)}else if(o===e.GradientType.RadialGradient){var f=e.computeRadialGradient(a,c,s,u),p=f.x,d=f.y;h=r.createRadialGradient(p,d,0,p,d,f.r)}return h&&(i.forEach((function(t){var e;null===(e=h)||void 0===e||e.addColorStop(t[0],t[1])})),this.gradientCache[n]=h),this.gradientCache[n]},r.generateGradientKey=function(t){return"gradient-"+t.type+"-"+(t.angle||0)+"-"+(t.cx||0)+"-"+(t.cy||0)+"-"+t.width+"-"+t.height+"-"+t.steps.map((function(t){return t.join("")})).join("-")},r.generatePatternKey=function(t){var r=t.image,n=t.repetition;if(e.isString(r))return"pattern-"+r+"-"+n},t}();b([e.inject(e.CanvasConfig),x("design:type",Object)],gt.prototype,"canvasConfig",void 0),gt=b([e.singleton()],gt);var mt=(vt=function(){function t(){this.imagePool=void 0,this.renderingContext=void 0}return t.prototype.apply=function(t){var r=this,n=function(n){var o=n.target;if(o.nodeName===e.Shape.IMAGE){var i=o.attributes.img;e.isString(i)&&r.imagePool.getImageSync(i,(function(){o.renderable.dirty=!0,t.dirtify()}))}},o=function(n){var o=n.target,i=n.newValue;o.nodeName===e.Shape.IMAGE&&"img"===n.attrName&&e.isString(i)&&r.imagePool.getOrCreateImage(i).then((function(){o.renderable.dirty=!0,t.dirtify()}))};t.hooks.init.tapPromise(yt.tag,pt(lt().mark((function t(){return lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r.renderingContext.root.addEventListener(e.ElementEvent.MOUNTED,n),r.renderingContext.root.addEventListener(e.ElementEvent.ATTR_MODIFIED,o);case 2:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(yt.tag,(function(){r.renderingContext.root.removeEventListener(e.ElementEvent.MOUNTED,n),r.renderingContext.root.removeEventListener(e.ElementEvent.ATTR_MODIFIED,o)}))},t}(),vt.tag="LoadImage",yt=vt);b([e.inject(gt),x("design:type",gt)],mt.prototype,"imagePool",void 0),b([e.inject(e.RenderingContext),x("design:type",Object)],mt.prototype,"renderingContext",void 0),mt=yt=b([e.singleton({contrib:e.RenderingPluginContribution})],mt);var wt=e.Module((function(t){t(gt),t(mt)})),bt=function(t){var e,r;function n(){for(var e,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return(e=t.call.apply(t,[this].concat(n))||this).name="image-loader",e}r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,dt(e,r);var o=n.prototype;return o.init=function(){this.container.load(wt,!0)},o.destroy=function(){this.container.unload(wt)},n}(e.AbstractRendererPlugin),xt=Object.freeze({__proto__:null,get ImagePool(){return gt},Plugin:bt});function Et(){
8
8
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/g-canvas",
3
- "version": "1.8.5",
3
+ "version": "1.8.8",
4
4
  "description": "A renderer implemented by Canvas 2D API",
5
5
  "keywords": [
6
6
  "antv",
@@ -30,12 +30,12 @@
30
30
  "README.md"
31
31
  ],
32
32
  "dependencies": {
33
- "@antv/g-plugin-canvas-path-generator": "^1.1.8",
34
- "@antv/g-plugin-canvas-picker": "^1.8.5",
35
- "@antv/g-plugin-canvas-renderer": "^1.7.11",
36
- "@antv/g-plugin-dom-interaction": "^1.7.8",
37
- "@antv/g-plugin-html-renderer": "^1.7.8",
38
- "@antv/g-plugin-image-loader": "^1.1.9",
33
+ "@antv/g-plugin-canvas-path-generator": "^1.1.11",
34
+ "@antv/g-plugin-canvas-picker": "^1.8.8",
35
+ "@antv/g-plugin-canvas-renderer": "^1.7.14",
36
+ "@antv/g-plugin-dom-interaction": "^1.7.11",
37
+ "@antv/g-plugin-html-renderer": "^1.7.11",
38
+ "@antv/g-plugin-image-loader": "^1.1.12",
39
39
  "tslib": "^2.3.1"
40
40
  },
41
41
  "devDependencies": {
@@ -48,5 +48,5 @@
48
48
  "publishConfig": {
49
49
  "access": "public"
50
50
  },
51
- "gitHead": "f52c300726725c7e4774d37ddfa10a1ade4c494d"
51
+ "gitHead": "32c0eab45e1b2350b9d1b12895b05e90e1fc7971"
52
52
  }