Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@antv/g-plugin-canvas-renderer

Package Overview
Dependencies
Maintainers
58
Versions
261
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@antv/g-plugin-canvas-renderer - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3-alpha.0

dist/CanvasRendererPlugin.d.ts

4

dist/index.umd.min.js

@@ -1,1 +0,3 @@

!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("@antv/g"),require("mana-syringe")):"function"==typeof define&&define.amd?define(["@antv/g","mana-syringe"],n):"object"==typeof exports?exports.CanvasRenderer=n(require("@antv/g"),require("mana-syringe")):(t.G=t.G||{},t.G.CanvasRenderer=n(t.G,t.G.ManaSyringe))}(window,(function(t,n){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var a=n[r]={i:r,l:!1,exports:{}};return t[r].call(a.exports,a,a.exports,e),a.l=!0,a.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var a in t)e.d(r,a,function(n){return t[n]}.bind(null,a));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=7)}([function(n,e){n.exports=t},function(t,e){t.exports=n},function(t,n,e){t.exports=function(){"use strict";function t(t,r,a,i,o){!function t(e,r,a,i,o){for(;i>a;){if(i-a>600){var u=i-a+1,c=r-a+1,s=Math.log(u),h=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*h*(u-h)/u)*(c-u/2<0?-1:1);t(e,r,Math.max(a,Math.floor(r-c*h/u+l)),Math.min(i,Math.floor(r+(u-c)*h/u+l)),o)}var f=e[r],d=a,p=i;for(n(e,a,r),o(e[i],f)>0&&n(e,a,i);d<p;){for(n(e,d,p),d++,p--;o(e[d],f)<0;)d++;for(;o(e[p],f)>0;)p--}0===o(e[a],f)?n(e,a,p):n(e,++p,i),p<=r&&(a=p+1),r<=p&&(i=p-1)}}(t,r,a||0,i||t.length-1,o||e)}function n(t,n,e){var r=t[n];t[n]=t[e],t[e]=r}function e(t,n){return t<n?-1:t>n?1:0}var r=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(t,n,e){if(!e)return n.indexOf(t);for(var r=0;r<n.length;r++)if(e(t,n[r]))return r;return-1}function i(t,n){o(t,0,t.children.length,n,t)}function o(t,n,e,r,a){a||(a=p(null)),a.minX=1/0,a.minY=1/0,a.maxX=-1/0,a.maxY=-1/0;for(var i=n;i<e;i++){var o=t.children[i];u(a,t.leaf?r(o):o)}return a}function u(t,n){return t.minX=Math.min(t.minX,n.minX),t.minY=Math.min(t.minY,n.minY),t.maxX=Math.max(t.maxX,n.maxX),t.maxY=Math.max(t.maxY,n.maxY),t}function c(t,n){return t.minX-n.minX}function s(t,n){return t.minY-n.minY}function h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function l(t){return t.maxX-t.minX+(t.maxY-t.minY)}function f(t,n){return t.minX<=n.minX&&t.minY<=n.minY&&n.maxX<=t.maxX&&n.maxY<=t.maxY}function d(t,n){return n.minX<=t.maxX&&n.minY<=t.maxY&&n.maxX>=t.minX&&n.maxY>=t.minY}function p(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function v(n,e,r,a,i){for(var o=[e,r];o.length;)if(!((r=o.pop())-(e=o.pop())<=a)){var u=e+Math.ceil((r-e)/a/2)*a;t(n,u,e,r,i),o.push(e,u,u,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(t){var n=this.data,e=[];if(!d(t,n))return e;for(var r=this.toBBox,a=[];n;){for(var i=0;i<n.children.length;i++){var o=n.children[i],u=n.leaf?r(o):o;d(t,u)&&(n.leaf?e.push(o):f(t,u)?this._all(o,e):a.push(o))}n=a.pop()}return e},r.prototype.collides=function(t){var n=this.data;if(!d(t,n))return!1;for(var e=[];n;){for(var r=0;r<n.children.length;r++){var a=n.children[r],i=n.leaf?this.toBBox(a):a;if(d(t,i)){if(n.leaf||f(t,i))return!0;e.push(a)}}n=e.pop()}return!1},r.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var n=0;n<t.length;n++)this.insert(t[n]);return this}var e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){var r=this.data;this.data=e,e=r}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this},r.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},r.prototype.clear=function(){return this.data=p([]),this},r.prototype.remove=function(t,n){if(!t)return this;for(var e,r,i,o=this.data,u=this.toBBox(t),c=[],s=[];o||c.length;){if(o||(o=c.pop(),r=c[c.length-1],e=s.pop(),i=!0),o.leaf){var h=a(t,o.children,n);if(-1!==h)return o.children.splice(h,1),c.push(o),this._condense(c),this}i||o.leaf||!f(o,u)?r?(e++,o=r.children[e],i=!1):o=null:(c.push(o),s.push(e),e=0,r=o,o=o.children[0])}return this},r.prototype.toBBox=function(t){return t},r.prototype.compareMinX=function(t,n){return t.minX-n.minX},r.prototype.compareMinY=function(t,n){return t.minY-n.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(t){return this.data=t,this},r.prototype._all=function(t,n){for(var e=[];t;)t.leaf?n.push.apply(n,t.children):e.push.apply(e,t.children),t=e.pop();return n},r.prototype._build=function(t,n,e,r){var a,o=e-n+1,u=this._maxEntries;if(o<=u)return i(a=p(t.slice(n,e+1)),this.toBBox),a;r||(r=Math.ceil(Math.log(o)/Math.log(u)),u=Math.ceil(o/Math.pow(u,r-1))),(a=p([])).leaf=!1,a.height=r;var c=Math.ceil(o/u),s=c*Math.ceil(Math.sqrt(u));v(t,n,e,s,this.compareMinX);for(var h=n;h<=e;h+=s){var l=Math.min(h+s-1,e);v(t,h,l,c,this.compareMinY);for(var f=h;f<=l;f+=c){var d=Math.min(f+c-1,l);a.children.push(this._build(t,f,d,r-1))}}return i(a,this.toBBox),a},r.prototype._chooseSubtree=function(t,n,e,r){for(;r.push(n),!n.leaf&&r.length-1!==e;){for(var a=1/0,i=1/0,o=void 0,u=0;u<n.children.length;u++){var c=n.children[u],s=h(c),l=(f=t,d=c,(Math.max(d.maxX,f.maxX)-Math.min(d.minX,f.minX))*(Math.max(d.maxY,f.maxY)-Math.min(d.minY,f.minY))-s);l<i?(i=l,a=s<a?s:a,o=c):l===i&&s<a&&(a=s,o=c)}n=o||n.children[0]}var f,d;return n},r.prototype._insert=function(t,n,e){var r=e?t:this.toBBox(t),a=[],i=this._chooseSubtree(r,this.data,n,a);for(i.children.push(t),u(i,r);n>=0&&a[n].children.length>this._maxEntries;)this._split(a,n),n--;this._adjustParentBBoxes(r,a,n)},r.prototype._split=function(t,n){var e=t[n],r=e.children.length,a=this._minEntries;this._chooseSplitAxis(e,a,r);var o=this._chooseSplitIndex(e,a,r),u=p(e.children.splice(o,e.children.length-o));u.height=e.height,u.leaf=e.leaf,i(e,this.toBBox),i(u,this.toBBox),n?t[n-1].children.push(u):this._splitRoot(e,u)},r.prototype._splitRoot=function(t,n){this.data=p([t,n]),this.data.height=t.height+1,this.data.leaf=!1,i(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,n,e){for(var r,a,i,u,c,s,l,f=1/0,d=1/0,p=n;p<=e-n;p++){var v=o(t,0,p,this.toBBox),y=o(t,p,e,this.toBBox),m=(a=v,i=y,u=Math.max(a.minX,i.minX),c=Math.max(a.minY,i.minY),s=Math.min(a.maxX,i.maxX),l=Math.min(a.maxY,i.maxY),Math.max(0,s-u)*Math.max(0,l-c)),g=h(v)+h(y);m<f?(f=m,r=p,d=g<d?g:d):m===f&&g<d&&(d=g,r=p)}return r||e-n},r.prototype._chooseSplitAxis=function(t,n,e){var r=t.leaf?this.compareMinX:c,a=t.leaf?this.compareMinY:s;this._allDistMargin(t,n,e,r)<this._allDistMargin(t,n,e,a)&&t.children.sort(r)},r.prototype._allDistMargin=function(t,n,e,r){t.children.sort(r);for(var a=this.toBBox,i=o(t,0,n,a),c=o(t,e-n,e,a),s=l(i)+l(c),h=n;h<e-n;h++){var f=t.children[h];u(i,t.leaf?a(f):f),s+=l(i)}for(var d=e-n-1;d>=n;d--){var p=t.children[d];u(c,t.leaf?a(p):p),s+=l(c)}return s},r.prototype._adjustParentBBoxes=function(t,n,e){for(var r=e;r>=0;r--)u(n[r],t)},r.prototype._condense=function(t){for(var n=t.length-1,e=void 0;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children).splice(e.indexOf(t[n]),1):this.clear():i(t[n],this.toBBox)},r}()},,,,,function(t,n,e){"use strict";e.r(n),e.d(n,"PathGeneratorFactory",(function(){return G})),e.d(n,"PathGenerator",(function(){return q})),e.d(n,"RBushNode",(function(){return ke})),e.d(n,"RBushRoot",(function(){return Ne})),e.d(n,"RBush",(function(){return s.a})),e.d(n,"StyleRendererFactory",(function(){return h})),e.d(n,"CircleRendererContribution",(function(){return l})),e.d(n,"EllipseRendererContribution",(function(){return f})),e.d(n,"RectRendererContribution",(function(){return d})),e.d(n,"LineRendererContribution",(function(){return p})),e.d(n,"PolylineRendererContribution",(function(){return v})),e.d(n,"PolygonRendererContribution",(function(){return y})),e.d(n,"PathRendererContribution",(function(){return m})),e.d(n,"TextRendererContribution",(function(){return g})),e.d(n,"ImageRendererContribution",(function(){return M})),e.d(n,"ImageRenderer",(function(){return E})),e.d(n,"TextRenderer",(function(){return T})),e.d(n,"RectRenderer",(function(){return k})),e.d(n,"CircleRenderer",(function(){return N})),e.d(n,"EllipseRenderer",(function(){return Y})),e.d(n,"LineRenderer",(function(){return D})),e.d(n,"PolylineRenderer",(function(){return I})),e.d(n,"PolygonRenderer",(function(){return X})),e.d(n,"PathRenderer",(function(){return _})),e.d(n,"Plugin",(function(){return Xe}));var r={};e.r(r),e.d(r,"create",(function(){return U})),e.d(r,"clone",(function(){return Q})),e.d(r,"copy",(function(){return Z})),e.d(r,"fromValues",(function(){return z})),e.d(r,"set",(function(){return J})),e.d(r,"identity",(function(){return W})),e.d(r,"transpose",(function(){return K})),e.d(r,"invert",(function(){return $})),e.d(r,"adjoint",(function(){return tt})),e.d(r,"determinant",(function(){return nt})),e.d(r,"multiply",(function(){return et})),e.d(r,"translate",(function(){return rt})),e.d(r,"scale",(function(){return at})),e.d(r,"rotate",(function(){return it})),e.d(r,"rotateX",(function(){return ot})),e.d(r,"rotateY",(function(){return ut})),e.d(r,"rotateZ",(function(){return ct})),e.d(r,"fromTranslation",(function(){return st})),e.d(r,"fromScaling",(function(){return ht})),e.d(r,"fromRotation",(function(){return lt})),e.d(r,"fromXRotation",(function(){return ft})),e.d(r,"fromYRotation",(function(){return dt})),e.d(r,"fromZRotation",(function(){return pt})),e.d(r,"fromRotationTranslation",(function(){return vt})),e.d(r,"fromQuat2",(function(){return yt})),e.d(r,"getTranslation",(function(){return mt})),e.d(r,"getScaling",(function(){return gt})),e.d(r,"getRotation",(function(){return Mt})),e.d(r,"fromRotationTranslationScale",(function(){return bt})),e.d(r,"fromRotationTranslationScaleOrigin",(function(){return xt})),e.d(r,"fromQuat",(function(){return Ot})),e.d(r,"frustum",(function(){return St})),e.d(r,"perspectiveNO",(function(){return Ct})),e.d(r,"perspective",(function(){return jt})),e.d(r,"perspectiveZO",(function(){return Bt})),e.d(r,"perspectiveFromFieldOfView",(function(){return Rt})),e.d(r,"orthoNO",(function(){return Pt})),e.d(r,"ortho",(function(){return At})),e.d(r,"orthoZO",(function(){return Et})),e.d(r,"lookAt",(function(){return Tt})),e.d(r,"targetTo",(function(){return wt})),e.d(r,"str",(function(){return kt})),e.d(r,"frob",(function(){return Nt})),e.d(r,"add",(function(){return Yt})),e.d(r,"subtract",(function(){return Dt})),e.d(r,"multiplyScalar",(function(){return It})),e.d(r,"multiplyScalarAndAdd",(function(){return Xt})),e.d(r,"exactEquals",(function(){return _t})),e.d(r,"equals",(function(){return Lt})),e.d(r,"mul",(function(){return Gt})),e.d(r,"sub",(function(){return qt}));var a={};e.r(a),e.d(a,"create",(function(){return Ft})),e.d(a,"clone",(function(){return Vt})),e.d(a,"length",(function(){return Ht})),e.d(a,"fromValues",(function(){return Ut})),e.d(a,"copy",(function(){return Qt})),e.d(a,"set",(function(){return Zt})),e.d(a,"add",(function(){return zt})),e.d(a,"subtract",(function(){return Jt})),e.d(a,"multiply",(function(){return Wt})),e.d(a,"divide",(function(){return Kt})),e.d(a,"ceil",(function(){return $t})),e.d(a,"floor",(function(){return tn})),e.d(a,"min",(function(){return nn})),e.d(a,"max",(function(){return en})),e.d(a,"round",(function(){return rn})),e.d(a,"scale",(function(){return an})),e.d(a,"scaleAndAdd",(function(){return on})),e.d(a,"distance",(function(){return un})),e.d(a,"squaredDistance",(function(){return cn})),e.d(a,"squaredLength",(function(){return sn})),e.d(a,"negate",(function(){return hn})),e.d(a,"inverse",(function(){return ln})),e.d(a,"normalize",(function(){return fn})),e.d(a,"dot",(function(){return dn})),e.d(a,"cross",(function(){return pn})),e.d(a,"lerp",(function(){return vn})),e.d(a,"hermite",(function(){return yn})),e.d(a,"bezier",(function(){return mn})),e.d(a,"random",(function(){return gn})),e.d(a,"transformMat4",(function(){return Mn})),e.d(a,"transformMat3",(function(){return bn})),e.d(a,"transformQuat",(function(){return xn})),e.d(a,"rotateX",(function(){return On})),e.d(a,"rotateY",(function(){return Sn})),e.d(a,"rotateZ",(function(){return Cn})),e.d(a,"angle",(function(){return jn})),e.d(a,"zero",(function(){return Bn})),e.d(a,"str",(function(){return Rn})),e.d(a,"exactEquals",(function(){return Pn})),e.d(a,"equals",(function(){return An})),e.d(a,"sub",(function(){return Tn})),e.d(a,"mul",(function(){return wn})),e.d(a,"div",(function(){return kn})),e.d(a,"dist",(function(){return Nn})),e.d(a,"sqrDist",(function(){return Yn})),e.d(a,"len",(function(){return Dn})),e.d(a,"sqrLen",(function(){return In})),e.d(a,"forEach",(function(){return Xn}));var i={};e.r(i),e.d(i,"create",(function(){return Gn})),e.d(i,"identity",(function(){return qn})),e.d(i,"setAxisAngle",(function(){return Fn})),e.d(i,"getAxisAngle",(function(){return Vn})),e.d(i,"getAngle",(function(){return Hn})),e.d(i,"multiply",(function(){return Un})),e.d(i,"rotateX",(function(){return Qn})),e.d(i,"rotateY",(function(){return Zn})),e.d(i,"rotateZ",(function(){return zn})),e.d(i,"calculateW",(function(){return Jn})),e.d(i,"exp",(function(){return Wn})),e.d(i,"ln",(function(){return Kn})),e.d(i,"pow",(function(){return $n})),e.d(i,"slerp",(function(){return te})),e.d(i,"random",(function(){return ne})),e.d(i,"invert",(function(){return ee})),e.d(i,"conjugate",(function(){return re})),e.d(i,"fromMat3",(function(){return ae})),e.d(i,"fromEuler",(function(){return ie})),e.d(i,"str",(function(){return oe})),e.d(i,"clone",(function(){return pe})),e.d(i,"fromValues",(function(){return ve})),e.d(i,"copy",(function(){return ye})),e.d(i,"set",(function(){return me})),e.d(i,"add",(function(){return ge})),e.d(i,"mul",(function(){return Me})),e.d(i,"scale",(function(){return be})),e.d(i,"dot",(function(){return xe})),e.d(i,"lerp",(function(){return Oe})),e.d(i,"length",(function(){return Se})),e.d(i,"len",(function(){return Ce})),e.d(i,"squaredLength",(function(){return je})),e.d(i,"sqrLen",(function(){return Be})),e.d(i,"normalize",(function(){return Re})),e.d(i,"exactEquals",(function(){return Pe})),e.d(i,"equals",(function(){return Ae})),e.d(i,"rotationTo",(function(){return Ee})),e.d(i,"sqlerp",(function(){return Te})),e.d(i,"setAxes",(function(){return we}));var o=e(0),u=e(1),c=e(2),s=e.n(c),h=u.Syringe.defineToken("StyleRendererFactory"),l=u.Syringe.defineToken("CircleRenderer",{multiple:!1}),f=u.Syringe.defineToken("EllipseRenderer",{multiple:!1}),d=u.Syringe.defineToken("RectRenderer",{multiple:!1}),p=u.Syringe.defineToken("LineRenderer",{multiple:!1}),v=u.Syringe.defineToken("PolylineRenderer",{multiple:!1}),y=u.Syringe.defineToken("PolygonRenderer",{multiple:!1}),m=u.Syringe.defineToken("PathRenderer",{multiple:!1}),g=u.Syringe.defineToken("TextRenderer",{multiple:!1}),M=u.Syringe.defineToken("ImageRenderer",{multiple:!1}),b=function(t,n){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(t,n)};function x(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}b(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}var O=function(){return(O=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var a in n=arguments[e])Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a]);return t}).apply(this,arguments)};function S(t,n,e,r){var a,i=arguments.length,o=i<3?n:null===r?r=Object.getOwnPropertyDescriptor(n,e):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,n,e,r);else for(var u=t.length-1;u>=0;u--)(a=t[u])&&(o=(i<3?a(o):i>3?a(n,e,o):a(n,e))||o);return i>3&&o&&Object.defineProperty(n,e,o),o}function C(t,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,n)}function j(t,n,e,r){return new(e||(e=Promise))((function(a,i){function o(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var n;t.done?a(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(o,u)}c((r=r.apply(t,n||[])).next())}))}function B(t,n){var e,r,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;o;)try{if(e=1,r&&(a=2&i[0]?r.return:i[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,i[1])).done)return a;switch(r=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,r=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(a=o.trys,(a=a.length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){o.label=i[1];break}if(6===i[0]&&o.label<a[1]){o.label=a[1],a=i;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(i);break}a[2]&&o.ops.pop(),o.trys.pop();continue}i=n.call(t,o)}catch(t){i=[6,t],r=0}finally{e=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}Object.create;function R(t,n){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var r,a,i=e.call(t),o=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)o.push(r.value)}catch(t){a={error:t}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(a)throw a.error}}return o}function P(t,n,e){if(e||2===arguments.length)for(var r,a=0,i=n.length;a<i;a++)!r&&a in n||(r||(r=Array.prototype.slice.call(n,0,a)),r[a]=n[a]);return t.concat(r||Array.prototype.slice.call(n))}Object.create;var A=function(){function t(){this.imageCache={},this.patternCache={}}return t.prototype.getImageSync=function(t){return this.imageCache[t]},t.prototype.getOrCreateImage=function(t){var n=this;if(this.imageCache[t])return Promise.resolve(this.imageCache[t]);var e=this.canvasConfig.createImage;return new Promise((function(r,a){var i;e?i=e(t):o.isBrowser&&(i=new window.Image),i&&(i.onload=function(){r(i)},i.onerror=function(t){a(t)},i.crossOrigin="Anonymous",i.src=t,n.imageCache[t]=i)}))},t.prototype.getPatternSync=function(t){var n=this.generatePatternKey(t);if(this.patternCache[n])return this.patternCache[n]},t.prototype.createPattern=function(t,n){var e=this;return this.getOrCreateImage(t.src).then((function(r){var a=e.generatePatternKey(t),i=n.createPattern(r,t.repetition);return i&&(e.patternCache[a]=i),e.patternCache[a]}))},t.prototype.generatePatternKey=function(t){var n=t.src,e=t.repetition;return"pattern-".concat(n,"-").concat(e)},S([Object(u.inject)(o.CanvasConfig),C("design:type",Object)],t.prototype,"canvasConfig",void 0),t=S([Object(u.singleton)()],t)}(),E=function(){function t(){}return t.prototype.hash=function(t){return""},t.prototype.render=function(t,n){var e,r=n.width,a=n.height,i=n.img,u=r.value,c=a.value;if(Object(o.isString)(i)?e=this.imagePool.getImageSync(i):(u||(u=i.width),c||(c=i.height),e=i),e)try{t.drawImage(e,0,0,u,c)}catch(t){}},S([Object(u.inject)(A),C("design:type",A)],t.prototype,"imagePool",void 0),t=S([Object(u.singleton)({token:M})],t)}(),T=function(){function t(){}return t.prototype.hash=function(t){return""},t.prototype.render=function(t,n,e){var r=n,a=r.lineWidth,i=r.textAlign,u=r.textBaseline,c=r.lineJoin,s=r.miterLimit,h=void 0===s?0:s,l=r.letterSpacing,f=void 0===l?0:l,d=r.stroke,p=r.fill,v=r.fillOpacity,y=r.strokeOpacity,m=r.opacity,g=r.metrics,M=r.dx,b=r.dy,x=g.font,O=g.lines,S=g.height,C=g.lineHeight,j=g.lineMetrics;t.font=x,t.lineWidth=a.value,t.textAlign=i.value,t.textBaseline=u.value,t.lineJoin=c.value,t.miterLimit=h;var B=0;"middle"===u.value?B=-S/2-C/2:"bottom"===u.value||"alphabetic"===u.value||"ideographic"===u.value?B=-S:"top"!==u.value&&"hanging"!==u.value||(B=-C);var R=0;M&&M.unit===o.UnitType.kPixels&&(R+=M.value),b&&b.unit===o.UnitType.kPixels&&(B+=b.value);for(var P=0;P<O.length;P++){var A=a.value/2+R;B+=C,!Object(o.isNil)(d)&&a&&a.value&&this.drawLetterSpacing(t,O[P],j[P],i.value,A,B,f,v.value,y.value,m.value,!0),Object(o.isNil)(p)||this.drawLetterSpacing(t,O[P],j[P],i.value,A,B,f,v.value,y.value,m.value)}},t.prototype.drawLetterSpacing=function(t,n,e,r,a,i,o,u,c,s,h){if(void 0===h&&(h=!1),0!==o){var l=t.textAlign;t.textAlign="left";var f=a;"center"===r?f=a-e.width/2:"right"!==r&&"end"!==r||(f=a-e.width);for(var d=Array.from(n),p=t.measureText(n).width,v=0,y=0;y<d.length;++y){var m=d[y];h?this.strokeText(t,m,f,i,c):this.fillText(t,m,f,i,u,s),f+=p-(v=t.measureText(n.substring(y+1)).width)+o,p=v}t.textAlign=l}else h?this.strokeText(t,n,a,i,c):this.fillText(t,n,a,i,u,s)},t.prototype.fillText=function(t,n,e,r,a,i){var u,c=!Object(o.isNil)(a)&&1!==a;c&&(u=t.globalAlpha,t.globalAlpha=a*i),t.fillText(n,e,r),c&&(t.globalAlpha=u)},t.prototype.strokeText=function(t,n,e,r,a){var i,u=!Object(o.isNil)(a)&&1!==a;u&&(i=t.globalAlpha,t.globalAlpha=a),t.strokeText(n,e,r),u&&(t.globalAlpha=i)},t=S([Object(u.singleton)({token:g})],t)}(),w=function(){function t(){}return t.prototype.hash=function(t){return""},t.prototype.render=function(t,n){var e=n.fill,r=n.opacity,a=n.fillOpacity,i=n.stroke,u=n.strokeOpacity,c=n.lineWidth,s=n.lineCap,h=n.lineJoin,l=n.shadowColor,f=n.filter,d=n.miterLimit,p=!Object(o.isNil)(e),v=!Object(o.isNil)(i),y=0===e.alpha;if(p&&(Object(o.isNil)(a)||1===a.value?t.fill():(t.globalAlpha=a.value,t.fill(),t.globalAlpha=r.value)),v&&c&&c.value>0){!Object(o.isNil)(u)&&1!==u.value&&(t.globalAlpha=u.value),t.lineWidth=c.value,Object(o.isNil)(d)||(t.miterLimit=d),Object(o.isNil)(s)||(t.lineCap=s.value),Object(o.isNil)(h)||(t.lineJoin=h.value);var m=void 0,g=void 0,M=void 0,b=!Object(o.isNil)(l),x=!Object(o.isNil)(f);b&&(m=t.shadowBlur,g=t.shadowColor,Object(o.isNil)(m)||(t.shadowColor="transparent",t.shadowBlur=0)),x&&(M=t.filter,!Object(o.isNil)(M)&&M.indexOf("drop-shadow")>-1&&(t.filter=M.replace(/drop-shadow\([^)]*\)/,"").trim()||"none"));var O=p&&!y;O&&t.stroke(),b&&(t.shadowColor=g,t.shadowBlur=m),x&&(t.filter=M),O||t.stroke()}},t=S([Object(u.singleton)()],t)}(),k=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return x(n,t),n=S([Object(u.singleton)({token:d})],n)}(w),N=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return x(n,t),n=S([Object(u.singleton)({token:l})],n)}(w),Y=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return x(n,t),n=S([Object(u.singleton)({token:f})],n)}(w),D=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return x(n,t),n=S([Object(u.singleton)({token:p})],n)}(w),I=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return x(n,t),n=S([Object(u.singleton)({token:v})],n)}(w),X=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return x(n,t),n=S([Object(u.singleton)({token:y})],n)}(w),_=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return x(n,t),n=S([Object(u.singleton)({token:m})],n)}(w),L=function(){function t(){this.gradientCache={}}return t.prototype.getOrCreateGradient=function(t,n){var e=this.generateCacheKey(t),r=t.type,a=t.x0,i=t.y0,u=t.x1,c=t.y1,s=t.steps,h=t.width,l=t.height;if(this.gradientCache[e])return this.gradientCache[e];var f=null;if(r===o.GradientPatternType.LinearGradient)f=n.createLinearGradient(a*h,i*l,u*h,c*l);else if(r===o.GradientPatternType.RadialGradient){var d=Math.sqrt(h*h+l*l)/2;f=n.createRadialGradient(a*h,i*l,0,u*h,c*l,t.r1*d)}return f&&(s.forEach((function(t){var n=R(t,2),e=n[0],r=n[1];null==f||f.addColorStop(Number(e),r)})),this.gradientCache[e]=f),this.gradientCache[e]},t.prototype.generateCacheKey=function(t){var n=t.type,e=t.x0,r=t.y0,a=t.x1,i=t.y1,o=t.r1,u=t.steps,c=t.width,s=t.height;return"gradient-".concat(n,"-").concat(e,"-").concat(r,"-").concat(a,"-").concat(i,"-").concat(o||0,"-").concat(c,"-").concat(s,"-").concat(u.map((function(t){return t.join("")})).join("-"))},t=S([Object(u.singleton)()],t)}();var G=u.Syringe.defineToken("PathGeneratorFactory"),q=u.Syringe.defineToken("PathGenerator"),F=1e-6,V="undefined"!=typeof Float32Array?Float32Array:Array,H=Math.random;Math.PI;function U(){var t=new V(16);return V!=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 Q(t){var n=new V(16);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n}function Z(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],t}function z(t,n,e,r,a,i,o,u,c,s,h,l,f,d,p,v){var y=new V(16);return y[0]=t,y[1]=n,y[2]=e,y[3]=r,y[4]=a,y[5]=i,y[6]=o,y[7]=u,y[8]=c,y[9]=s,y[10]=h,y[11]=l,y[12]=f,y[13]=d,y[14]=p,y[15]=v,y}function J(t,n,e,r,a,i,o,u,c,s,h,l,f,d,p,v,y){return t[0]=n,t[1]=e,t[2]=r,t[3]=a,t[4]=i,t[5]=o,t[6]=u,t[7]=c,t[8]=s,t[9]=h,t[10]=l,t[11]=f,t[12]=d,t[13]=p,t[14]=v,t[15]=y,t}function W(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function K(t,n){if(t===n){var e=n[1],r=n[2],a=n[3],i=n[6],o=n[7],u=n[11];t[1]=n[4],t[2]=n[8],t[3]=n[12],t[4]=e,t[6]=n[9],t[7]=n[13],t[8]=r,t[9]=i,t[11]=n[14],t[12]=a,t[13]=o,t[14]=u}else t[0]=n[0],t[1]=n[4],t[2]=n[8],t[3]=n[12],t[4]=n[1],t[5]=n[5],t[6]=n[9],t[7]=n[13],t[8]=n[2],t[9]=n[6],t[10]=n[10],t[11]=n[14],t[12]=n[3],t[13]=n[7],t[14]=n[11],t[15]=n[15];return t}function $(t,n){var e=n[0],r=n[1],a=n[2],i=n[3],o=n[4],u=n[5],c=n[6],s=n[7],h=n[8],l=n[9],f=n[10],d=n[11],p=n[12],v=n[13],y=n[14],m=n[15],g=e*u-r*o,M=e*c-a*o,b=e*s-i*o,x=r*c-a*u,O=r*s-i*u,S=a*s-i*c,C=h*v-l*p,j=h*y-f*p,B=h*m-d*p,R=l*y-f*v,P=l*m-d*v,A=f*m-d*y,E=g*A-M*P+b*R+x*B-O*j+S*C;return E?(E=1/E,t[0]=(u*A-c*P+s*R)*E,t[1]=(a*P-r*A-i*R)*E,t[2]=(v*S-y*O+m*x)*E,t[3]=(f*O-l*S-d*x)*E,t[4]=(c*B-o*A-s*j)*E,t[5]=(e*A-a*B+i*j)*E,t[6]=(y*b-p*S-m*M)*E,t[7]=(h*S-f*b+d*M)*E,t[8]=(o*P-u*B+s*C)*E,t[9]=(r*B-e*P-i*C)*E,t[10]=(p*O-v*b+m*g)*E,t[11]=(l*b-h*O-d*g)*E,t[12]=(u*j-o*R-c*C)*E,t[13]=(e*R-r*j+a*C)*E,t[14]=(v*M-p*x-y*g)*E,t[15]=(h*x-l*M+f*g)*E,t):null}function tt(t,n){var e=n[0],r=n[1],a=n[2],i=n[3],o=n[4],u=n[5],c=n[6],s=n[7],h=n[8],l=n[9],f=n[10],d=n[11],p=n[12],v=n[13],y=n[14],m=n[15];return t[0]=u*(f*m-d*y)-l*(c*m-s*y)+v*(c*d-s*f),t[1]=-(r*(f*m-d*y)-l*(a*m-i*y)+v*(a*d-i*f)),t[2]=r*(c*m-s*y)-u*(a*m-i*y)+v*(a*s-i*c),t[3]=-(r*(c*d-s*f)-u*(a*d-i*f)+l*(a*s-i*c)),t[4]=-(o*(f*m-d*y)-h*(c*m-s*y)+p*(c*d-s*f)),t[5]=e*(f*m-d*y)-h*(a*m-i*y)+p*(a*d-i*f),t[6]=-(e*(c*m-s*y)-o*(a*m-i*y)+p*(a*s-i*c)),t[7]=e*(c*d-s*f)-o*(a*d-i*f)+h*(a*s-i*c),t[8]=o*(l*m-d*v)-h*(u*m-s*v)+p*(u*d-s*l),t[9]=-(e*(l*m-d*v)-h*(r*m-i*v)+p*(r*d-i*l)),t[10]=e*(u*m-s*v)-o*(r*m-i*v)+p*(r*s-i*u),t[11]=-(e*(u*d-s*l)-o*(r*d-i*l)+h*(r*s-i*u)),t[12]=-(o*(l*y-f*v)-h*(u*y-c*v)+p*(u*f-c*l)),t[13]=e*(l*y-f*v)-h*(r*y-a*v)+p*(r*f-a*l),t[14]=-(e*(u*y-c*v)-o*(r*y-a*v)+p*(r*c-a*u)),t[15]=e*(u*f-c*l)-o*(r*f-a*l)+h*(r*c-a*u),t}function nt(t){var n=t[0],e=t[1],r=t[2],a=t[3],i=t[4],o=t[5],u=t[6],c=t[7],s=t[8],h=t[9],l=t[10],f=t[11],d=t[12],p=t[13],v=t[14],y=t[15];return(n*o-e*i)*(l*y-f*v)-(n*u-r*i)*(h*y-f*p)+(n*c-a*i)*(h*v-l*p)+(e*u-r*o)*(s*y-f*d)-(e*c-a*o)*(s*v-l*d)+(r*c-a*u)*(s*p-h*d)}function et(t,n,e){var r=n[0],a=n[1],i=n[2],o=n[3],u=n[4],c=n[5],s=n[6],h=n[7],l=n[8],f=n[9],d=n[10],p=n[11],v=n[12],y=n[13],m=n[14],g=n[15],M=e[0],b=e[1],x=e[2],O=e[3];return t[0]=M*r+b*u+x*l+O*v,t[1]=M*a+b*c+x*f+O*y,t[2]=M*i+b*s+x*d+O*m,t[3]=M*o+b*h+x*p+O*g,M=e[4],b=e[5],x=e[6],O=e[7],t[4]=M*r+b*u+x*l+O*v,t[5]=M*a+b*c+x*f+O*y,t[6]=M*i+b*s+x*d+O*m,t[7]=M*o+b*h+x*p+O*g,M=e[8],b=e[9],x=e[10],O=e[11],t[8]=M*r+b*u+x*l+O*v,t[9]=M*a+b*c+x*f+O*y,t[10]=M*i+b*s+x*d+O*m,t[11]=M*o+b*h+x*p+O*g,M=e[12],b=e[13],x=e[14],O=e[15],t[12]=M*r+b*u+x*l+O*v,t[13]=M*a+b*c+x*f+O*y,t[14]=M*i+b*s+x*d+O*m,t[15]=M*o+b*h+x*p+O*g,t}function rt(t,n,e){var r,a,i,o,u,c,s,h,l,f,d,p,v=e[0],y=e[1],m=e[2];return n===t?(t[12]=n[0]*v+n[4]*y+n[8]*m+n[12],t[13]=n[1]*v+n[5]*y+n[9]*m+n[13],t[14]=n[2]*v+n[6]*y+n[10]*m+n[14],t[15]=n[3]*v+n[7]*y+n[11]*m+n[15]):(r=n[0],a=n[1],i=n[2],o=n[3],u=n[4],c=n[5],s=n[6],h=n[7],l=n[8],f=n[9],d=n[10],p=n[11],t[0]=r,t[1]=a,t[2]=i,t[3]=o,t[4]=u,t[5]=c,t[6]=s,t[7]=h,t[8]=l,t[9]=f,t[10]=d,t[11]=p,t[12]=r*v+u*y+l*m+n[12],t[13]=a*v+c*y+f*m+n[13],t[14]=i*v+s*y+d*m+n[14],t[15]=o*v+h*y+p*m+n[15]),t}function at(t,n,e){var r=e[0],a=e[1],i=e[2];return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=n[3]*r,t[4]=n[4]*a,t[5]=n[5]*a,t[6]=n[6]*a,t[7]=n[7]*a,t[8]=n[8]*i,t[9]=n[9]*i,t[10]=n[10]*i,t[11]=n[11]*i,t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],t}function it(t,n,e,r){var a,i,o,u,c,s,h,l,f,d,p,v,y,m,g,M,b,x,O,S,C,j,B,R,P=r[0],A=r[1],E=r[2],T=Math.hypot(P,A,E);return T<F?null:(P*=T=1/T,A*=T,E*=T,a=Math.sin(e),o=1-(i=Math.cos(e)),u=n[0],c=n[1],s=n[2],h=n[3],l=n[4],f=n[5],d=n[6],p=n[7],v=n[8],y=n[9],m=n[10],g=n[11],M=P*P*o+i,b=A*P*o+E*a,x=E*P*o-A*a,O=P*A*o-E*a,S=A*A*o+i,C=E*A*o+P*a,j=P*E*o+A*a,B=A*E*o-P*a,R=E*E*o+i,t[0]=u*M+l*b+v*x,t[1]=c*M+f*b+y*x,t[2]=s*M+d*b+m*x,t[3]=h*M+p*b+g*x,t[4]=u*O+l*S+v*C,t[5]=c*O+f*S+y*C,t[6]=s*O+d*S+m*C,t[7]=h*O+p*S+g*C,t[8]=u*j+l*B+v*R,t[9]=c*j+f*B+y*R,t[10]=s*j+d*B+m*R,t[11]=h*j+p*B+g*R,n!==t&&(t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t)}function ot(t,n,e){var r=Math.sin(e),a=Math.cos(e),i=n[4],o=n[5],u=n[6],c=n[7],s=n[8],h=n[9],l=n[10],f=n[11];return n!==t&&(t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t[4]=i*a+s*r,t[5]=o*a+h*r,t[6]=u*a+l*r,t[7]=c*a+f*r,t[8]=s*a-i*r,t[9]=h*a-o*r,t[10]=l*a-u*r,t[11]=f*a-c*r,t}function ut(t,n,e){var r=Math.sin(e),a=Math.cos(e),i=n[0],o=n[1],u=n[2],c=n[3],s=n[8],h=n[9],l=n[10],f=n[11];return n!==t&&(t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t[0]=i*a-s*r,t[1]=o*a-h*r,t[2]=u*a-l*r,t[3]=c*a-f*r,t[8]=i*r+s*a,t[9]=o*r+h*a,t[10]=u*r+l*a,t[11]=c*r+f*a,t}function ct(t,n,e){var r=Math.sin(e),a=Math.cos(e),i=n[0],o=n[1],u=n[2],c=n[3],s=n[4],h=n[5],l=n[6],f=n[7];return n!==t&&(t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t[0]=i*a+s*r,t[1]=o*a+h*r,t[2]=u*a+l*r,t[3]=c*a+f*r,t[4]=s*a-i*r,t[5]=h*a-o*r,t[6]=l*a-u*r,t[7]=f*a-c*r,t}function st(t,n){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function ht(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=n[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function lt(t,n,e){var r,a,i,o=e[0],u=e[1],c=e[2],s=Math.hypot(o,u,c);return s<F?null:(o*=s=1/s,u*=s,c*=s,r=Math.sin(n),i=1-(a=Math.cos(n)),t[0]=o*o*i+a,t[1]=u*o*i+c*r,t[2]=c*o*i-u*r,t[3]=0,t[4]=o*u*i-c*r,t[5]=u*u*i+a,t[6]=c*u*i+o*r,t[7]=0,t[8]=o*c*i+u*r,t[9]=u*c*i-o*r,t[10]=c*c*i+a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function ft(t,n){var e=Math.sin(n),r=Math.cos(n);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=e,t[7]=0,t[8]=0,t[9]=-e,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function dt(t,n){var e=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1]=0,t[2]=-e,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=e,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function pt(t,n){var e=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1]=e,t[2]=0,t[3]=0,t[4]=-e,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function vt(t,n,e){var r=n[0],a=n[1],i=n[2],o=n[3],u=r+r,c=a+a,s=i+i,h=r*u,l=r*c,f=r*s,d=a*c,p=a*s,v=i*s,y=o*u,m=o*c,g=o*s;return t[0]=1-(d+v),t[1]=l+g,t[2]=f-m,t[3]=0,t[4]=l-g,t[5]=1-(h+v),t[6]=p+y,t[7]=0,t[8]=f+m,t[9]=p-y,t[10]=1-(h+d),t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function yt(t,n){var e=new V(3),r=-n[0],a=-n[1],i=-n[2],o=n[3],u=n[4],c=n[5],s=n[6],h=n[7],l=r*r+a*a+i*i+o*o;return l>0?(e[0]=2*(u*o+h*r+c*i-s*a)/l,e[1]=2*(c*o+h*a+s*r-u*i)/l,e[2]=2*(s*o+h*i+u*a-c*r)/l):(e[0]=2*(u*o+h*r+c*i-s*a),e[1]=2*(c*o+h*a+s*r-u*i),e[2]=2*(s*o+h*i+u*a-c*r)),vt(t,n,e),t}function mt(t,n){return t[0]=n[12],t[1]=n[13],t[2]=n[14],t}function gt(t,n){var e=n[0],r=n[1],a=n[2],i=n[4],o=n[5],u=n[6],c=n[8],s=n[9],h=n[10];return t[0]=Math.hypot(e,r,a),t[1]=Math.hypot(i,o,u),t[2]=Math.hypot(c,s,h),t}function Mt(t,n){var e=new V(3);gt(e,n);var r=1/e[0],a=1/e[1],i=1/e[2],o=n[0]*r,u=n[1]*a,c=n[2]*i,s=n[4]*r,h=n[5]*a,l=n[6]*i,f=n[8]*r,d=n[9]*a,p=n[10]*i,v=o+h+p,y=0;return v>0?(y=2*Math.sqrt(v+1),t[3]=.25*y,t[0]=(l-d)/y,t[1]=(f-c)/y,t[2]=(u-s)/y):o>h&&o>p?(y=2*Math.sqrt(1+o-h-p),t[3]=(l-d)/y,t[0]=.25*y,t[1]=(u+s)/y,t[2]=(f+c)/y):h>p?(y=2*Math.sqrt(1+h-o-p),t[3]=(f-c)/y,t[0]=(u+s)/y,t[1]=.25*y,t[2]=(l+d)/y):(y=2*Math.sqrt(1+p-o-h),t[3]=(u-s)/y,t[0]=(f+c)/y,t[1]=(l+d)/y,t[2]=.25*y),t}function bt(t,n,e,r){var a=n[0],i=n[1],o=n[2],u=n[3],c=a+a,s=i+i,h=o+o,l=a*c,f=a*s,d=a*h,p=i*s,v=i*h,y=o*h,m=u*c,g=u*s,M=u*h,b=r[0],x=r[1],O=r[2];return t[0]=(1-(p+y))*b,t[1]=(f+M)*b,t[2]=(d-g)*b,t[3]=0,t[4]=(f-M)*x,t[5]=(1-(l+y))*x,t[6]=(v+m)*x,t[7]=0,t[8]=(d+g)*O,t[9]=(v-m)*O,t[10]=(1-(l+p))*O,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function xt(t,n,e,r,a){var i=n[0],o=n[1],u=n[2],c=n[3],s=i+i,h=o+o,l=u+u,f=i*s,d=i*h,p=i*l,v=o*h,y=o*l,m=u*l,g=c*s,M=c*h,b=c*l,x=r[0],O=r[1],S=r[2],C=a[0],j=a[1],B=a[2],R=(1-(v+m))*x,P=(d+b)*x,A=(p-M)*x,E=(d-b)*O,T=(1-(f+m))*O,w=(y+g)*O,k=(p+M)*S,N=(y-g)*S,Y=(1-(f+v))*S;return t[0]=R,t[1]=P,t[2]=A,t[3]=0,t[4]=E,t[5]=T,t[6]=w,t[7]=0,t[8]=k,t[9]=N,t[10]=Y,t[11]=0,t[12]=e[0]+C-(R*C+E*j+k*B),t[13]=e[1]+j-(P*C+T*j+N*B),t[14]=e[2]+B-(A*C+w*j+Y*B),t[15]=1,t}function Ot(t,n){var e=n[0],r=n[1],a=n[2],i=n[3],o=e+e,u=r+r,c=a+a,s=e*o,h=r*o,l=r*u,f=a*o,d=a*u,p=a*c,v=i*o,y=i*u,m=i*c;return t[0]=1-l-p,t[1]=h+m,t[2]=f-y,t[3]=0,t[4]=h-m,t[5]=1-s-p,t[6]=d+v,t[7]=0,t[8]=f+y,t[9]=d-v,t[10]=1-s-l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function St(t,n,e,r,a,i,o){var u=1/(e-n),c=1/(a-r),s=1/(i-o);return t[0]=2*i*u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*i*c,t[6]=0,t[7]=0,t[8]=(e+n)*u,t[9]=(a+r)*c,t[10]=(o+i)*s,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*i*2*s,t[15]=0,t}function Ct(t,n,e,r,a){var i,o=1/Math.tan(n/2);return t[0]=o/e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=a&&a!==1/0?(i=1/(r-a),t[10]=(a+r)*i,t[14]=2*a*r*i):(t[10]=-1,t[14]=-2*r),t}Math.hypot||(Math.hypot=function(){for(var t=0,n=arguments.length;n--;)t+=arguments[n]*arguments[n];return Math.sqrt(t)});var jt=Ct;function Bt(t,n,e,r,a){var i,o=1/Math.tan(n/2);return t[0]=o/e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=a&&a!==1/0?(i=1/(r-a),t[10]=a*i,t[14]=a*r*i):(t[10]=-1,t[14]=-r),t}function Rt(t,n,e,r){var a=Math.tan(n.upDegrees*Math.PI/180),i=Math.tan(n.downDegrees*Math.PI/180),o=Math.tan(n.leftDegrees*Math.PI/180),u=Math.tan(n.rightDegrees*Math.PI/180),c=2/(o+u),s=2/(a+i);return t[0]=c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=-(o-u)*c*.5,t[9]=(a-i)*s*.5,t[10]=r/(e-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*e/(e-r),t[15]=0,t}function Pt(t,n,e,r,a,i,o){var u=1/(n-e),c=1/(r-a),s=1/(i-o);return t[0]=-2*u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*s,t[11]=0,t[12]=(n+e)*u,t[13]=(a+r)*c,t[14]=(o+i)*s,t[15]=1,t}var At=Pt;function Et(t,n,e,r,a,i,o){var u=1/(n-e),c=1/(r-a),s=1/(i-o);return t[0]=-2*u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=s,t[11]=0,t[12]=(n+e)*u,t[13]=(a+r)*c,t[14]=i*s,t[15]=1,t}function Tt(t,n,e,r){var a,i,o,u,c,s,h,l,f,d,p=n[0],v=n[1],y=n[2],m=r[0],g=r[1],M=r[2],b=e[0],x=e[1],O=e[2];return Math.abs(p-b)<F&&Math.abs(v-x)<F&&Math.abs(y-O)<F?W(t):(h=p-b,l=v-x,f=y-O,a=g*(f*=d=1/Math.hypot(h,l,f))-M*(l*=d),i=M*(h*=d)-m*f,o=m*l-g*h,(d=Math.hypot(a,i,o))?(a*=d=1/d,i*=d,o*=d):(a=0,i=0,o=0),u=l*o-f*i,c=f*a-h*o,s=h*i-l*a,(d=Math.hypot(u,c,s))?(u*=d=1/d,c*=d,s*=d):(u=0,c=0,s=0),t[0]=a,t[1]=u,t[2]=h,t[3]=0,t[4]=i,t[5]=c,t[6]=l,t[7]=0,t[8]=o,t[9]=s,t[10]=f,t[11]=0,t[12]=-(a*p+i*v+o*y),t[13]=-(u*p+c*v+s*y),t[14]=-(h*p+l*v+f*y),t[15]=1,t)}function wt(t,n,e,r){var a=n[0],i=n[1],o=n[2],u=r[0],c=r[1],s=r[2],h=a-e[0],l=i-e[1],f=o-e[2],d=h*h+l*l+f*f;d>0&&(h*=d=1/Math.sqrt(d),l*=d,f*=d);var p=c*f-s*l,v=s*h-u*f,y=u*l-c*h;return(d=p*p+v*v+y*y)>0&&(p*=d=1/Math.sqrt(d),v*=d,y*=d),t[0]=p,t[1]=v,t[2]=y,t[3]=0,t[4]=l*y-f*v,t[5]=f*p-h*y,t[6]=h*v-l*p,t[7]=0,t[8]=h,t[9]=l,t[10]=f,t[11]=0,t[12]=a,t[13]=i,t[14]=o,t[15]=1,t}function kt(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function Nt(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function Yt(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t[3]=n[3]+e[3],t[4]=n[4]+e[4],t[5]=n[5]+e[5],t[6]=n[6]+e[6],t[7]=n[7]+e[7],t[8]=n[8]+e[8],t[9]=n[9]+e[9],t[10]=n[10]+e[10],t[11]=n[11]+e[11],t[12]=n[12]+e[12],t[13]=n[13]+e[13],t[14]=n[14]+e[14],t[15]=n[15]+e[15],t}function Dt(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t[3]=n[3]-e[3],t[4]=n[4]-e[4],t[5]=n[5]-e[5],t[6]=n[6]-e[6],t[7]=n[7]-e[7],t[8]=n[8]-e[8],t[9]=n[9]-e[9],t[10]=n[10]-e[10],t[11]=n[11]-e[11],t[12]=n[12]-e[12],t[13]=n[13]-e[13],t[14]=n[14]-e[14],t[15]=n[15]-e[15],t}function It(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t[3]=n[3]*e,t[4]=n[4]*e,t[5]=n[5]*e,t[6]=n[6]*e,t[7]=n[7]*e,t[8]=n[8]*e,t[9]=n[9]*e,t[10]=n[10]*e,t[11]=n[11]*e,t[12]=n[12]*e,t[13]=n[13]*e,t[14]=n[14]*e,t[15]=n[15]*e,t}function Xt(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t[2]=n[2]+e[2]*r,t[3]=n[3]+e[3]*r,t[4]=n[4]+e[4]*r,t[5]=n[5]+e[5]*r,t[6]=n[6]+e[6]*r,t[7]=n[7]+e[7]*r,t[8]=n[8]+e[8]*r,t[9]=n[9]+e[9]*r,t[10]=n[10]+e[10]*r,t[11]=n[11]+e[11]*r,t[12]=n[12]+e[12]*r,t[13]=n[13]+e[13]*r,t[14]=n[14]+e[14]*r,t[15]=n[15]+e[15]*r,t}function _t(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]&&t[9]===n[9]&&t[10]===n[10]&&t[11]===n[11]&&t[12]===n[12]&&t[13]===n[13]&&t[14]===n[14]&&t[15]===n[15]}function Lt(t,n){var e=t[0],r=t[1],a=t[2],i=t[3],o=t[4],u=t[5],c=t[6],s=t[7],h=t[8],l=t[9],f=t[10],d=t[11],p=t[12],v=t[13],y=t[14],m=t[15],g=n[0],M=n[1],b=n[2],x=n[3],O=n[4],S=n[5],C=n[6],j=n[7],B=n[8],R=n[9],P=n[10],A=n[11],E=n[12],T=n[13],w=n[14],k=n[15];return Math.abs(e-g)<=F*Math.max(1,Math.abs(e),Math.abs(g))&&Math.abs(r-M)<=F*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(a-b)<=F*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(i-x)<=F*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(o-O)<=F*Math.max(1,Math.abs(o),Math.abs(O))&&Math.abs(u-S)<=F*Math.max(1,Math.abs(u),Math.abs(S))&&Math.abs(c-C)<=F*Math.max(1,Math.abs(c),Math.abs(C))&&Math.abs(s-j)<=F*Math.max(1,Math.abs(s),Math.abs(j))&&Math.abs(h-B)<=F*Math.max(1,Math.abs(h),Math.abs(B))&&Math.abs(l-R)<=F*Math.max(1,Math.abs(l),Math.abs(R))&&Math.abs(f-P)<=F*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(d-A)<=F*Math.max(1,Math.abs(d),Math.abs(A))&&Math.abs(p-E)<=F*Math.max(1,Math.abs(p),Math.abs(E))&&Math.abs(v-T)<=F*Math.max(1,Math.abs(v),Math.abs(T))&&Math.abs(y-w)<=F*Math.max(1,Math.abs(y),Math.abs(w))&&Math.abs(m-k)<=F*Math.max(1,Math.abs(m),Math.abs(k))}var Gt=et,qt=Dt;function Ft(){var t=new V(3);return V!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Vt(t){var n=new V(3);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n}function Ht(t){var n=t[0],e=t[1],r=t[2];return Math.hypot(n,e,r)}function Ut(t,n,e){var r=new V(3);return r[0]=t,r[1]=n,r[2]=e,r}function Qt(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t}function Zt(t,n,e,r){return t[0]=n,t[1]=e,t[2]=r,t}function zt(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t}function Jt(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t}function Wt(t,n,e){return t[0]=n[0]*e[0],t[1]=n[1]*e[1],t[2]=n[2]*e[2],t}function Kt(t,n,e){return t[0]=n[0]/e[0],t[1]=n[1]/e[1],t[2]=n[2]/e[2],t}function $t(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t[2]=Math.ceil(n[2]),t}function tn(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t[2]=Math.floor(n[2]),t}function nn(t,n,e){return t[0]=Math.min(n[0],e[0]),t[1]=Math.min(n[1],e[1]),t[2]=Math.min(n[2],e[2]),t}function en(t,n,e){return t[0]=Math.max(n[0],e[0]),t[1]=Math.max(n[1],e[1]),t[2]=Math.max(n[2],e[2]),t}function rn(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t[2]=Math.round(n[2]),t}function an(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t}function on(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t[2]=n[2]+e[2]*r,t}function un(t,n){var e=n[0]-t[0],r=n[1]-t[1],a=n[2]-t[2];return Math.hypot(e,r,a)}function cn(t,n){var e=n[0]-t[0],r=n[1]-t[1],a=n[2]-t[2];return e*e+r*r+a*a}function sn(t){var n=t[0],e=t[1],r=t[2];return n*n+e*e+r*r}function hn(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t}function ln(t,n){return t[0]=1/n[0],t[1]=1/n[1],t[2]=1/n[2],t}function fn(t,n){var e=n[0],r=n[1],a=n[2],i=e*e+r*r+a*a;return i>0&&(i=1/Math.sqrt(i)),t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t}function dn(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function pn(t,n,e){var r=n[0],a=n[1],i=n[2],o=e[0],u=e[1],c=e[2];return t[0]=a*c-i*u,t[1]=i*o-r*c,t[2]=r*u-a*o,t}function vn(t,n,e,r){var a=n[0],i=n[1],o=n[2];return t[0]=a+r*(e[0]-a),t[1]=i+r*(e[1]-i),t[2]=o+r*(e[2]-o),t}function yn(t,n,e,r,a,i){var o=i*i,u=o*(2*i-3)+1,c=o*(i-2)+i,s=o*(i-1),h=o*(3-2*i);return t[0]=n[0]*u+e[0]*c+r[0]*s+a[0]*h,t[1]=n[1]*u+e[1]*c+r[1]*s+a[1]*h,t[2]=n[2]*u+e[2]*c+r[2]*s+a[2]*h,t}function mn(t,n,e,r,a,i){var o=1-i,u=o*o,c=i*i,s=u*o,h=3*i*u,l=3*c*o,f=c*i;return t[0]=n[0]*s+e[0]*h+r[0]*l+a[0]*f,t[1]=n[1]*s+e[1]*h+r[1]*l+a[1]*f,t[2]=n[2]*s+e[2]*h+r[2]*l+a[2]*f,t}function gn(t,n){n=n||1;var e=2*H()*Math.PI,r=2*H()-1,a=Math.sqrt(1-r*r)*n;return t[0]=Math.cos(e)*a,t[1]=Math.sin(e)*a,t[2]=r*n,t}function Mn(t,n,e){var r=n[0],a=n[1],i=n[2],o=e[3]*r+e[7]*a+e[11]*i+e[15];return o=o||1,t[0]=(e[0]*r+e[4]*a+e[8]*i+e[12])/o,t[1]=(e[1]*r+e[5]*a+e[9]*i+e[13])/o,t[2]=(e[2]*r+e[6]*a+e[10]*i+e[14])/o,t}function bn(t,n,e){var r=n[0],a=n[1],i=n[2];return t[0]=r*e[0]+a*e[3]+i*e[6],t[1]=r*e[1]+a*e[4]+i*e[7],t[2]=r*e[2]+a*e[5]+i*e[8],t}function xn(t,n,e){var r=e[0],a=e[1],i=e[2],o=e[3],u=n[0],c=n[1],s=n[2],h=a*s-i*c,l=i*u-r*s,f=r*c-a*u,d=a*f-i*l,p=i*h-r*f,v=r*l-a*h,y=2*o;return h*=y,l*=y,f*=y,d*=2,p*=2,v*=2,t[0]=u+h+d,t[1]=c+l+p,t[2]=s+f+v,t}function On(t,n,e,r){var a=[],i=[];return a[0]=n[0]-e[0],a[1]=n[1]-e[1],a[2]=n[2]-e[2],i[0]=a[0],i[1]=a[1]*Math.cos(r)-a[2]*Math.sin(r),i[2]=a[1]*Math.sin(r)+a[2]*Math.cos(r),t[0]=i[0]+e[0],t[1]=i[1]+e[1],t[2]=i[2]+e[2],t}function Sn(t,n,e,r){var a=[],i=[];return a[0]=n[0]-e[0],a[1]=n[1]-e[1],a[2]=n[2]-e[2],i[0]=a[2]*Math.sin(r)+a[0]*Math.cos(r),i[1]=a[1],i[2]=a[2]*Math.cos(r)-a[0]*Math.sin(r),t[0]=i[0]+e[0],t[1]=i[1]+e[1],t[2]=i[2]+e[2],t}function Cn(t,n,e,r){var a=[],i=[];return a[0]=n[0]-e[0],a[1]=n[1]-e[1],a[2]=n[2]-e[2],i[0]=a[0]*Math.cos(r)-a[1]*Math.sin(r),i[1]=a[0]*Math.sin(r)+a[1]*Math.cos(r),i[2]=a[2],t[0]=i[0]+e[0],t[1]=i[1]+e[1],t[2]=i[2]+e[2],t}function jn(t,n){var e=t[0],r=t[1],a=t[2],i=n[0],o=n[1],u=n[2],c=Math.sqrt(e*e+r*r+a*a)*Math.sqrt(i*i+o*o+u*u),s=c&&dn(t,n)/c;return Math.acos(Math.min(Math.max(s,-1),1))}function Bn(t){return t[0]=0,t[1]=0,t[2]=0,t}function Rn(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function Pn(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]}function An(t,n){var e=t[0],r=t[1],a=t[2],i=n[0],o=n[1],u=n[2];return Math.abs(e-i)<=F*Math.max(1,Math.abs(e),Math.abs(i))&&Math.abs(r-o)<=F*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(a-u)<=F*Math.max(1,Math.abs(a),Math.abs(u))}var En,Tn=Jt,wn=Wt,kn=Kt,Nn=un,Yn=cn,Dn=Ht,In=sn,Xn=(En=Ft(),function(t,n,e,r,a,i){var o,u;for(n||(n=3),e||(e=0),u=r?Math.min(r*n+e,t.length):t.length,o=e;o<u;o+=n)En[0]=t[o],En[1]=t[o+1],En[2]=t[o+2],a(En,En,i),t[o]=En[0],t[o+1]=En[1],t[o+2]=En[2];return t});function _n(t){var n=t[0],e=t[1],r=t[2],a=t[3];return Math.hypot(n,e,r,a)}function Ln(t){var n=t[0],e=t[1],r=t[2],a=t[3];return n*n+e*e+r*r+a*a}!function(){var t,n=(t=new V(4),V!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}();function Gn(){var t=new V(4);return V!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function qn(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function Fn(t,n,e){e*=.5;var r=Math.sin(e);return t[0]=r*n[0],t[1]=r*n[1],t[2]=r*n[2],t[3]=Math.cos(e),t}function Vn(t,n){var e=2*Math.acos(n[3]),r=Math.sin(e/2);return r>F?(t[0]=n[0]/r,t[1]=n[1]/r,t[2]=n[2]/r):(t[0]=1,t[1]=0,t[2]=0),e}function Hn(t,n){var e=xe(t,n);return Math.acos(2*e*e-1)}function Un(t,n,e){var r=n[0],a=n[1],i=n[2],o=n[3],u=e[0],c=e[1],s=e[2],h=e[3];return t[0]=r*h+o*u+a*s-i*c,t[1]=a*h+o*c+i*u-r*s,t[2]=i*h+o*s+r*c-a*u,t[3]=o*h-r*u-a*c-i*s,t}function Qn(t,n,e){e*=.5;var r=n[0],a=n[1],i=n[2],o=n[3],u=Math.sin(e),c=Math.cos(e);return t[0]=r*c+o*u,t[1]=a*c+i*u,t[2]=i*c-a*u,t[3]=o*c-r*u,t}function Zn(t,n,e){e*=.5;var r=n[0],a=n[1],i=n[2],o=n[3],u=Math.sin(e),c=Math.cos(e);return t[0]=r*c-i*u,t[1]=a*c+o*u,t[2]=i*c+r*u,t[3]=o*c-a*u,t}function zn(t,n,e){e*=.5;var r=n[0],a=n[1],i=n[2],o=n[3],u=Math.sin(e),c=Math.cos(e);return t[0]=r*c+a*u,t[1]=a*c-r*u,t[2]=i*c+o*u,t[3]=o*c-i*u,t}function Jn(t,n){var e=n[0],r=n[1],a=n[2];return t[0]=e,t[1]=r,t[2]=a,t[3]=Math.sqrt(Math.abs(1-e*e-r*r-a*a)),t}function Wn(t,n){var e=n[0],r=n[1],a=n[2],i=n[3],o=Math.sqrt(e*e+r*r+a*a),u=Math.exp(i),c=o>0?u*Math.sin(o)/o:0;return t[0]=e*c,t[1]=r*c,t[2]=a*c,t[3]=u*Math.cos(o),t}function Kn(t,n){var e=n[0],r=n[1],a=n[2],i=n[3],o=Math.sqrt(e*e+r*r+a*a),u=o>0?Math.atan2(o,i)/o:0;return t[0]=e*u,t[1]=r*u,t[2]=a*u,t[3]=.5*Math.log(e*e+r*r+a*a+i*i),t}function $n(t,n,e){return Kn(t,n),be(t,t,e),Wn(t,t),t}function te(t,n,e,r){var a,i,o,u,c,s=n[0],h=n[1],l=n[2],f=n[3],d=e[0],p=e[1],v=e[2],y=e[3];return(i=s*d+h*p+l*v+f*y)<0&&(i=-i,d=-d,p=-p,v=-v,y=-y),1-i>F?(a=Math.acos(i),o=Math.sin(a),u=Math.sin((1-r)*a)/o,c=Math.sin(r*a)/o):(u=1-r,c=r),t[0]=u*s+c*d,t[1]=u*h+c*p,t[2]=u*l+c*v,t[3]=u*f+c*y,t}function ne(t){var n=H(),e=H(),r=H(),a=Math.sqrt(1-n),i=Math.sqrt(n);return t[0]=a*Math.sin(2*Math.PI*e),t[1]=a*Math.cos(2*Math.PI*e),t[2]=i*Math.sin(2*Math.PI*r),t[3]=i*Math.cos(2*Math.PI*r),t}function ee(t,n){var e=n[0],r=n[1],a=n[2],i=n[3],o=e*e+r*r+a*a+i*i,u=o?1/o:0;return t[0]=-e*u,t[1]=-r*u,t[2]=-a*u,t[3]=i*u,t}function re(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=n[3],t}function ae(t,n){var e,r=n[0]+n[4]+n[8];if(r>0)e=Math.sqrt(r+1),t[3]=.5*e,e=.5/e,t[0]=(n[5]-n[7])*e,t[1]=(n[6]-n[2])*e,t[2]=(n[1]-n[3])*e;else{var a=0;n[4]>n[0]&&(a=1),n[8]>n[3*a+a]&&(a=2);var i=(a+1)%3,o=(a+2)%3;e=Math.sqrt(n[3*a+a]-n[3*i+i]-n[3*o+o]+1),t[a]=.5*e,e=.5/e,t[3]=(n[3*i+o]-n[3*o+i])*e,t[i]=(n[3*i+a]+n[3*a+i])*e,t[o]=(n[3*o+a]+n[3*a+o])*e}return t}function ie(t,n,e,r){var a=.5*Math.PI/180;n*=a,e*=a,r*=a;var i=Math.sin(n),o=Math.cos(n),u=Math.sin(e),c=Math.cos(e),s=Math.sin(r),h=Math.cos(r);return t[0]=i*c*h-o*u*s,t[1]=o*u*h+i*c*s,t[2]=o*c*s-i*u*h,t[3]=o*c*h+i*u*s,t}function oe(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var ue,ce,se,he,le,fe,de,pe=function(t){var n=new V(4);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n},ve=function(t,n,e,r){var a=new V(4);return a[0]=t,a[1]=n,a[2]=e,a[3]=r,a},ye=function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t},me=function(t,n,e,r,a){return t[0]=n,t[1]=e,t[2]=r,t[3]=a,t},ge=function(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t[3]=n[3]+e[3],t},Me=Un,be=function(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t[3]=n[3]*e,t},xe=function(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+t[3]*n[3]},Oe=function(t,n,e,r){var a=n[0],i=n[1],o=n[2],u=n[3];return t[0]=a+r*(e[0]-a),t[1]=i+r*(e[1]-i),t[2]=o+r*(e[2]-o),t[3]=u+r*(e[3]-u),t},Se=_n,Ce=Se,je=Ln,Be=je,Re=function(t,n){var e=n[0],r=n[1],a=n[2],i=n[3],o=e*e+r*r+a*a+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e*o,t[1]=r*o,t[2]=a*o,t[3]=i*o,t},Pe=function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]},Ae=function(t,n){var e=t[0],r=t[1],a=t[2],i=t[3],o=n[0],u=n[1],c=n[2],s=n[3];return Math.abs(e-o)<=F*Math.max(1,Math.abs(e),Math.abs(o))&&Math.abs(r-u)<=F*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(a-c)<=F*Math.max(1,Math.abs(a),Math.abs(c))&&Math.abs(i-s)<=F*Math.max(1,Math.abs(i),Math.abs(s))},Ee=(ue=Ft(),ce=Ut(1,0,0),se=Ut(0,1,0),function(t,n,e){var r=dn(n,e);return r<-.999999?(pn(ue,ce,n),Dn(ue)<1e-6&&pn(ue,se,n),fn(ue,ue),Fn(t,ue,Math.PI),t):r>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(pn(ue,n,e),t[0]=ue[0],t[1]=ue[1],t[2]=ue[2],t[3]=1+r,Re(t,t))}),Te=(he=Gn(),le=Gn(),function(t,n,e,r,a,i){return te(he,n,a,i),te(le,e,r,i),te(t,he,le,2*i*(1-i)),t}),we=(fe=new V(9),V!=Float32Array&&(fe[1]=0,fe[2]=0,fe[3]=0,fe[5]=0,fe[6]=0,fe[7]=0),fe[0]=1,fe[4]=1,fe[8]=1,de=fe,function(t,n,e,r){return de[0]=e[0],de[3]=e[1],de[6]=e[2],de[1]=r[0],de[4]=r[1],de[7]=r[2],de[2]=-n[0],de[5]=-n[1],de[8]=-n[2],Re(t,ae(t,de))}),ke=function(){function t(){}return t.tag="c-canvas-rbush-node",t}(),Ne="RBushRoot",Ye=function(){function t(){this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreen=!1,this.enableBatch=!1,this.batchedStyleHash="",this.batchedDisplayObject=null,this.toSync=new Set}var n;return n=t,t.prototype.syncRTree=function(){var t=this,n=[];Array.from(this.toSync).filter((function(t){return t.isConnected})).forEach((function(e){var r=e.rBushNode;r&&t.rBush.remove(r.aabb);var a=e.getRenderBounds();if(a){var i=R(a.getMin(),2),o=i[0],u=i[1],c=R(a.getMax(),2),s=c[0],h=c[1];r.aabb={id:e.entity,minX:o,minY:u,maxX:s,maxY:h}}r.aabb&&n.push(r.aabb)})),this.rBush.load(n),this.toSync.clear()},t.prototype.pushToSync=function(t){var n=this;t.forEach((function(t){n.toSync.add(t)}))},t.prototype.apply=function(t){var e=this,r=function(t){t.target.rBushNode=new ke,e.pushToSync(t.composedPath().slice(0,-2))},i=function(t){var n=t.target,r=n.rBushNode;r.aabb&&(e.rBush.remove(r.aabb),e.toSync.delete(n),e.removedRBushNodeAABBs.push(r.aabb))},u=function(t){var n,r=t.target;(null===(n=r.ownerDocument)||void 0===n?void 0:n.documentElement)===e.renderingContext.root&&(t.detail.affectChildren&&r.forEach((function(t){e.pushToSync([t])})),e.pushToSync(t.composedPath().slice(0,-2)))};t.hooks.init.tapPromise(n.tag,(function(){return j(e,void 0,void 0,(function(){var t,n,e,a;return B(this,(function(c){return this.renderingContext.root.addEventListener(o.ElementEvent.MOUNTED,r),this.renderingContext.root.addEventListener(o.ElementEvent.UNMOUNTED,i),this.renderingContext.root.addEventListener(o.ElementEvent.BOUNDS_CHANGED,u),t=this.canvasConfig,n=t.width,e=t.height,a=this.contextService.getContext(),this.clearRect(a,0,0,n,e),[2]}))}))})),t.hooks.destroy.tap(n.tag,(function(){e.renderingContext.root.removeEventListener(o.ElementEvent.MOUNTED,r),e.renderingContext.root.removeEventListener(o.ElementEvent.UNMOUNTED,i),e.renderingContext.root.removeEventListener(o.ElementEvent.BOUNDS_CHANGED,u)})),t.hooks.beginFrame.tap(n.tag,(function(){var t=e.contextService.getContext(),n=e.canvasConfig,r=n.renderer,a=n.width,i=n.height,u=r.getConfig().enableDirtyRectangleRendering;e.clearFullScreen=!u||e.renderingContext.renderReasons.has(o.RenderReason.CAMERA_CHANGED),t&&(t.save(),e.clearFullScreen&&e.clearRect(t,0,0,a,i),e.applyTransform(t,e.camera.getOrthoMatrix()))})),t.hooks.endFrame.tap(n.tag,(function(){e.syncRTree();var n=e.canvasConfig.renderer.getConfig(),r=n.enableDirtyRectangleRendering,i=n.enableDirtyRectangleRenderingDebug,u=e.contextService.getContext(),c=e.renderQueue;if(r){if(!e.clearFullScreen){var s=e.safeMergeAABB.apply(e,P([e.mergeDirtyAABBs(e.renderQueue)],R(e.removedRBushNodeAABBs.map((function(t){var n=t.minX,e=t.minY,r=t.maxX,i=t.maxY,u=new o.AABB;return u.setMinMax(a.fromValues(n,e,0),a.fromValues(r,i,0)),u}))),!1));if(e.removedRBushNodeAABBs=[],o.AABB.isEmpty(s))return void(e.renderQueue=[]);var h=e.convertAABB2Rect(s),l=h.x,f=h.y,d=h.width,p=h.height;e.clearRect(u,l,f,d,p),u.beginPath(),u.rect(l,f,d,p),u.clip(),i&&(u.lineWidth=4,u.strokeStyle="rgba(".concat(255*Math.random(),", ").concat(255*Math.random(),", ").concat(255*Math.random(),", 1)"),u.strokeRect(l,f,d,p)),c=e.searchDirtyObjects(s)}c.sort((function(t,n){return t.sortable.renderOrder-n.sortable.renderOrder})).forEach((function(n){n&&n.isVisible()&&!n.isCulled()&&e.renderDisplayObject(n,t)})),e.enableBatch&&e.batchedStyleHash&&e.flush(u,t),e.renderQueue.forEach((function(t){e.saveDirtyAABB(t)})),e.renderQueue=[]}e.restoreStack.forEach((function(t){u.restore()})),e.restoreStack=[],e.clearFullScreen=!1,u.restore()})),t.hooks.render.tap(n.tag,(function(n){e.canvasConfig.renderer.getConfig().enableDirtyRectangleRendering?e.renderQueue.push(n):n.isVisible()&&!n.isCulled()&&e.renderDisplayObject(n,t)}))},t.prototype.clearRect=function(t,n,e,r,a){t.clearRect(n,e,r,a);var i=this.canvasConfig.background;i&&(t.fillStyle=i,t.fillRect(n,e,r,a))},t.prototype.flush=function(t,n){if(this.batchedDisplayObject){var e=this.styleRendererFactory(this.batchedDisplayObject.nodeName);e&&(this.applyAttributesToContext(t,this.batchedDisplayObject,n),t.closePath(),e.render(t,this.batchedDisplayObject.parsedStyle,this.batchedDisplayObject),t.restore()),this.batchedStyleHash="",this.batchedDisplayObject=null}},t.prototype.renderDisplayObject=function(t,n){for(var e=this,r=this.contextService.getContext(),a=this.restoreStack[this.restoreStack.length-1];a&&t.parentNode!==a;)r.restore(),this.restoreStack.pop(),a=this.restoreStack[this.restoreStack.length-1];var i=t.nodeName,u=this.styleRendererFactory(i),c=!1;if(this.enableBatch&&u){var s=u.hash(t.attributes);this.batchedStyleHash&&s!==this.batchedStyleHash&&this.flush(r,n),this.batchedStyleHash||(this.batchedStyleHash=s,this.batchedDisplayObject=t,c=!0)}r.save(),this.applyTransform(r,t.getLocalTransform());var h=t.style.clipPath;if(h){r.save(),this.applyTransform(r,h.getLocalTransform());var l=this.pathGeneratorFactory(h.nodeName);l&&this.useAnchor(r,h,(function(){r.beginPath(),l(r,h.parsedStyle),r.closePath()})),r.restore(),r.clip()}this.enableBatch||(r.save(),this.applyAttributesToContext(r,t,n)),this.useAnchor(r,t,(function(){var n=e.pathGeneratorFactory(t.nodeName);n&&(!c&&e.enableBatch||r.beginPath(),n(r,t.parsedStyle),e.enableBatch||t.nodeName===o.Shape.LINE||t.nodeName===o.Shape.PATH||t.nodeName===o.Shape.POLYLINE||r.closePath()),u&&!e.enableBatch&&u.render(r,t.parsedStyle,t)})),this.enableBatch||r.restore(),t.renderable.dirty=!1,this.restoreStack.push(t)},t.prototype.convertAABB2Rect=function(t){var n=t.getMin(),e=t.getMax(),r=Math.floor(n[0]),a=Math.floor(n[1]);return{x:r,y:a,width:Math.ceil(e[0])-r,height:Math.ceil(e[1])-a}},t.prototype.mergeDirtyAABBs=function(t){var n=new o.AABB;return t.forEach((function(t){var e=t.getRenderBounds();n.add(e);var r=t.renderable.dirtyRenderBounds;r&&n.add(r)})),n},t.prototype.searchDirtyObjects=function(t){var n=this,e=R(t.getMin(),2),r=e[0],a=e[1],i=R(t.getMax(),2),o=i[0],u=i[1];return this.rBush.search({minX:r,minY:a,maxX:o,maxY:u}).map((function(t){var e=t.id;return n.displayObjectPool.getByEntity(e)}))},t.prototype.saveDirtyAABB=function(t){var n=t.renderable;n.dirtyRenderBounds||(n.dirtyRenderBounds=new o.AABB);var e=t.getRenderBounds();e&&n.dirtyRenderBounds.update(e.center,e.halfExtents)},t.prototype.applyTransform=function(t,n){var e=R(r.getTranslation(a.create(),n),2),u=e[0],c=e[1],s=R(r.getScaling(a.create(),n),2),h=s[0],l=s[1],f=r.getRotation(i.create(),n),d=R(Object(o.getEuler)(a.create(),f),3),p=d[0],v=(d[1],d[2]),y=Object(o.fromRotationTranslationScale)(p||v,u,c,h,l);t.transform(y[0],y[1],y[3],y[4],y[6],y[7])},t.prototype.getColor=function(t,n,e,r){var a;if(t instanceof o.CSSGradientValue){if(t.type===o.GradientPatternType.LinearGradient||t.type===o.GradientPatternType.RadialGradient){var i=n.getGeometryBounds(),u=i&&2*i.halfExtents[0]||0,c=i&&2*i.halfExtents[1]||0;a=this.gradientPool.getOrCreateGradient(O(O({type:t.type},t.value),{width:u,height:c}),e)}else if(t.type===o.GradientPatternType.Pattern){var s=this.imagePool.getPatternSync(t.value);s?a=s:this.imagePool.createPattern(t.value,e).then((function(){n.renderable.dirty=!0,r.dirtify()}))}}else a=t.toString();return a},t.prototype.applyAttributesToContext=function(t,n,e){var r=n.parsedStyle,a=r.stroke,i=r.fill,u=r.opacity,c=r.lineDash,s=r.lineDashOffset,h=r.filter,l=r.shadowColor,f=r.shadowBlur,d=r.shadowOffsetX,p=r.shadowOffsetY;c&&Array.isArray(c)&&t.setLineDash(c.map((function(t){return t.value}))),Object(o.isNil)(s)||(t.lineDashOffset=s.value),Object(o.isNil)(u)||(t.globalAlpha*=u.value),Object(o.isNil)(a)||(t.strokeStyle=this.getColor(a,n,t,e)),Object(o.isNil)(i)||(t.fillStyle=this.getColor(i,n,t,e)),Object(o.isNil)(h)||(t.filter=n.style.filter),Object(o.isNil)(l)||(t.shadowColor=l.toString(),t.shadowBlur=f&&f.value||0,t.shadowOffsetX=d&&d.value||0,t.shadowOffsetY=p&&p.value||0)},t.prototype.useAnchor=function(t,n,e){var r=n.getGeometryBounds();if(r){var a=r.halfExtents,i=(n.parsedStyle||{}).anchor;t.translate(-(i&&i[0].value||0)*a[0]*2,-(i&&i[1].value||0)*a[1]*2),e()}else e()},t.prototype.safeMergeAABB=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var e=new o.AABB;return t.forEach((function(t){e.add(t)})),e},t.tag="CanvasRenderer",S([Object(u.inject)(o.CanvasConfig),C("design:type",Object)],t.prototype,"canvasConfig",void 0),S([Object(u.inject)(o.DefaultCamera),C("design:type",o.Camera)],t.prototype,"camera",void 0),S([Object(u.inject)(o.ContextService),C("design:type",Object)],t.prototype,"contextService",void 0),S([Object(u.inject)(o.RenderingContext),C("design:type",Object)],t.prototype,"renderingContext",void 0),S([Object(u.inject)(A),C("design:type",A)],t.prototype,"imagePool",void 0),S([Object(u.inject)(L),C("design:type",L)],t.prototype,"gradientPool",void 0),S([Object(u.inject)(G),C("design:type",Function)],t.prototype,"pathGeneratorFactory",void 0),S([Object(u.inject)(h),C("design:type",Function)],t.prototype,"styleRendererFactory",void 0),S([Object(u.inject)(o.DisplayObjectPool),C("design:type",o.DisplayObjectPool)],t.prototype,"displayObjectPool",void 0),S([Object(u.inject)(Ne),C("design:type",s.a)],t.prototype,"rBush",void 0),t=n=S([Object(u.singleton)({contrib:o.RenderingPluginContribution})],t)}(),De=function(){function t(){}var n;return n=t,t.prototype.apply=function(t){var e=this,r=function(n){var r=n.target,a=r.nodeName,i=r.attributes;if(a===o.Shape.IMAGE){var u=i.img;Object(o.isString)(u)&&e.imagePool.getOrCreateImage(u).then((function(){r.renderable.dirty=!0,t.dirtify()}))}},a=function(n){var r=n.target,a=n.attrName,i=n.newValue;r.nodeName===o.Shape.IMAGE&&"img"===a&&Object(o.isString)(i)&&e.imagePool.getOrCreateImage(i).then((function(){r.renderable.dirty=!0,t.dirtify()}))};t.hooks.init.tapPromise(n.tag,(function(){return j(e,void 0,void 0,(function(){return B(this,(function(t){return this.renderingContext.root.addEventListener(o.ElementEvent.MOUNTED,r),this.renderingContext.root.addEventListener(o.ElementEvent.ATTR_MODIFIED,a),[2]}))}))})),t.hooks.destroy.tap(n.tag,(function(){e.renderingContext.root.removeEventListener(o.ElementEvent.MOUNTED,r),e.renderingContext.root.removeEventListener(o.ElementEvent.ATTR_MODIFIED,a)}))},t.tag="LoadImage",S([Object(u.inject)(A),C("design:type",A)],t.prototype,"imagePool",void 0),S([Object(u.inject)(o.RenderingContext),C("design:type",Object)],t.prototype,"renderingContext",void 0),t=n=S([Object(u.singleton)({contrib:o.RenderingPluginContribution})],t)}();u.GlobalContainer.register({token:{token:q,named:o.Shape.CIRCLE},useValue:function(t,n){var e=n.r;t.arc(e.value,e.value,e.value,0,2*Math.PI,!1)}}),u.GlobalContainer.register({token:{token:q,named:o.Shape.ELLIPSE},useValue:function(t,n){var e=n.rx,r=n.ry,a=e.value,i=r.value;if(t.ellipse)t.ellipse(a,i,a,i,0,0,2*Math.PI,!1);else{var o=a>i?a:i,u=a>i?1:a/i,c=a>i?i/a:1;t.save(),t.scale(u,c),t.arc(0,0,o,0,2*Math.PI)}}}),u.GlobalContainer.register({token:{token:q,named:o.Shape.RECT},useValue:function(t,n){var e=n.radius,r=n.width,a=n.height,i=r.value,o=a.value;if(e&&e.some((function(t){return 0!==t.value}))){var u=R(e.map((function(t){return t.value})),4),c=u[0],s=u[1],h=u[2],l=u[3];t.moveTo(c,0),t.lineTo(i-s,0),0!==s&&t.arc(i-s,s,s,-Math.PI/2,0),t.lineTo(i,o-h),0!==h&&t.arc(i-h,o-h,h,0,Math.PI/2),t.lineTo(l,o),0!==l&&t.arc(l,o-l,l,Math.PI/2,Math.PI),t.lineTo(0,c),0!==c&&t.arc(c,c,c,Math.PI,1.5*Math.PI)}else t.rect(0,0,i,o)}}),u.GlobalContainer.register({token:{token:q,named:o.Shape.LINE},useValue:function(t,n){var e=n.x1,r=n.y1,a=n.x2,i=n.y2,o=n.defX,u=void 0===o?0:o,c=n.defY,s=void 0===c?0:c;t.moveTo(e.value-u,r.value-s),t.lineTo(a.value-u,i.value-s)}}),u.GlobalContainer.register({token:{token:q,named:o.Shape.POLYLINE},useValue:function(t,n){var e=n.defX,r=void 0===e?0:e,a=n.defY,i=void 0===a?0:a,o=n.points.points,u=o.length,c=o[0][0]-r,s=o[0][1]-i,h=o[u-1][0]-r,l=o[u-1][1]-i;t.moveTo(c,s);for(var f=0;f<u-1;f++){var d=o[f];t.lineTo(d[0]-r,d[1]-i)}t.lineTo(h,l)}}),u.GlobalContainer.register({token:{token:q,named:o.Shape.POLYGON},useValue:function(t,n){var e=n.defX,r=void 0===e?0:e,a=n.defY,i=void 0===a?0:a,o=n.points.points,u=o.length,c=o[0][0]-r,s=o[0][1]-i,h=o[u-1][0]-r,l=o[u-1][1]-i;t.moveTo(c,s);for(var f=0;f<u-1;f++){var d=o[f];t.lineTo(d[0]-r,d[1]-i)}t.lineTo(h,l)}}),u.GlobalContainer.register({token:{token:q,named:o.Shape.PATH},useValue:function(t,n){var e=n.defX,r=void 0===e?0:e,a=n.defY,i=void 0===a?0:a,o=n.path,u=o.curve,c=o.zCommandIndexes,s=P([],R(u),!1);c.forEach((function(t,n){s.splice(t+n,1,["Z"])}));for(var h=0;h<s.length;h++){var l=s[h];switch(l[0]){case"M":t.moveTo(l[1]-r,l[2]-i);break;case"C":t.bezierCurveTo(l[1]-r,l[2]-i,l[3]-r,l[4]-i,l[5]-r,l[6]-i);break;case"Z":t.closePath()}}}}),u.GlobalContainer.register({token:G,useFactory:function(t){var n={};return function(e){return n[e]||t.container.isBoundNamed(q,e)&&(n[e]=t.container.getNamed(q,e)),n[e]}}});var Ie=Object(u.Module)((function(t){var n;t(A),t({token:Ne,useValue:new s.a}),t(N),t(Y),t(k),t(E),t(T),t(D),t(I),t(X),t(_);var e=((n={})[o.Shape.CIRCLE]=l,n[o.Shape.ELLIPSE]=f,n[o.Shape.RECT]=d,n[o.Shape.IMAGE]=M,n[o.Shape.TEXT]=g,n[o.Shape.LINE]=p,n[o.Shape.POLYLINE]=v,n[o.Shape.POLYGON]=y,n[o.Shape.PATH]=m,n);t({token:h,useFactory:function(t){var n={};return function(r){var a=e[r];return a&&!n[r]&&t.container.isBound(a)&&(n[r]=t.container.get(a)),n[r]}}}),t(L),t(Ye),t(De)})),Xe=function(){function t(){this.name="canvas-renderer"}return t.prototype.init=function(t){t.load(Ie,!0)},t.prototype.destroy=function(t){t.unload(Ie)},t}()}])}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@antv/g"),require("mana-syringe")):"function"==typeof define&&define.amd?define(["exports","@antv/g","mana-syringe"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).G=e.G||{},e.G.CanvasRenderer={}),e.window.G,e.window.G.ManaSyringe)}(this,(function(e,t,n){"use strict";function r(e,t,n,r,o){i(e,t,n||0,r||e.length-1,o||a)}function i(e,t,n,r,a){for(;r>n;){if(r-n>600){var l=r-n+1,s=t-n+1,h=Math.log(l),c=.5*Math.exp(2*h/3),u=.5*Math.sqrt(h*c*(l-c)/l)*(0>s-l/2?-1:1);i(e,t,Math.max(n,Math.floor(t-s*c/l+u)),Math.min(r,Math.floor(t+(l-s)*c/l+u)),a)}var d=e[t],f=n,p=r;for(o(e,n,t),a(e[r],d)>0&&o(e,n,r);p>f;){for(o(e,f,p),f++,p--;0>a(e[f],d);)f++;for(;a(e[p],d)>0;)p--}0===a(e[n],d)?o(e,n,p):o(e,++p,r),p>t||(n=p+1),t>p||(r=p-1)}}function o(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function a(e,t){return t>e?-1:e>t?1:0}class l{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(e){let t=this.data;const n=[];if(!m(e,t))return n;const r=this.toBBox,i=[];for(;t;){for(let o=0;t.children.length>o;o++){const a=t.children[o],l=t.leaf?r(a):a;m(e,l)&&(t.leaf?n.push(a):y(e,l)?this._all(a,n):i.push(a))}t=i.pop()}return n}collides(e){let t=this.data;if(!m(e,t))return!1;const n=[];for(;t;){for(let r=0;t.children.length>r;r++){const i=t.children[r],o=t.leaf?this.toBBox(i):i;if(m(e,o)){if(t.leaf||y(e,o))return!0;n.push(i)}}t=n.pop()}return!1}load(e){if(!e||!e.length)return this;if(this._minEntries>e.length){for(let t=0;e.length>t;t++)this.insert(e[t]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(this.data.children.length)if(this.data.height===t.height)this._splitRoot(this.data,t);else{if(t.height>this.data.height){const e=this.data;this.data=t,t=e}this._insert(t,this.data.height-t.height-1,!0)}else this.data=t;return this}insert(e){return e&&this._insert(e,this.data.height-1),this}clear(){return this.data=x([]),this}remove(e,t){if(!e)return this;let n=this.data;const r=this.toBBox(e),i=[],o=[];let a,l,h;for(;n||i.length;){if(n||(n=i.pop(),l=i[i.length-1],a=o.pop(),h=!0),n.leaf){const r=s(e,n.children,t);if(-1!==r)return n.children.splice(r,1),i.push(n),this._condense(i),this}h||n.leaf||!y(n,r)?l?(a++,n=l.children[a],h=!1):n=null:(i.push(n),o.push(a),a=0,l=n,n=n.children[0])}return this}toBBox(e){return e}compareMinX(e,t){return e.minX-t.minX}compareMinY(e,t){return e.minY-t.minY}toJSON(){return this.data}fromJSON(e){return this.data=e,this}_all(e,t){const n=[];for(;e;)e.leaf?t.push(...e.children):n.push(...e.children),e=n.pop();return t}_build(e,t,n,r){const i=n-t+1;let o,a=this._maxEntries;if(a>=i)return o=x(e.slice(t,n+1)),h(o,this.toBBox),o;r||(a=Math.ceil(i/Math.pow(a,(r=Math.ceil(Math.log(i)/Math.log(a)))-1))),o=x([]),o.leaf=!1,o.height=r;const l=Math.ceil(i/a),s=l*Math.ceil(Math.sqrt(a));b(e,t,n,s,this.compareMinX);for(let i=t;n>=i;i+=s){const t=Math.min(i+s-1,n);b(e,i,t,l,this.compareMinY);for(let n=i;t>=n;n+=l){o.children.push(this._build(e,n,Math.min(n+l-1,t),r-1))}}return h(o,this.toBBox),o}_chooseSubtree(e,t,n,r){for(;r.push(t),!t.leaf&&r.length-1!==n;){let n,r=1/0,a=1/0;for(let l=0;t.children.length>l;l++){const s=t.children[l],h=p(s),c=(Math.max((o=s).maxX,(i=e).maxX)-Math.min(o.minX,i.minX))*(Math.max(o.maxY,i.maxY)-Math.min(o.minY,i.minY))-h;a>c?(a=c,r=r>h?h:r,n=s):c===a&&r>h&&(r=h,n=s)}t=n||t.children[0]}var i,o;return t}_insert(e,t,n){const r=n?e:this.toBBox(e),i=[],o=this._chooseSubtree(r,this.data,t,i);for(o.children.push(e),u(o,r);t>=0&&i[t].children.length>this._maxEntries;)this._split(i,t),t--;this._adjustParentBBoxes(r,i,t)}_split(e,t){const n=e[t],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);const o=this._chooseSplitIndex(n,i,r),a=x(n.children.splice(o,n.children.length-o));a.height=n.height,a.leaf=n.leaf,h(n,this.toBBox),h(a,this.toBBox),t?e[t-1].children.push(a):this._splitRoot(n,a)}_splitRoot(e,t){this.data=x([e,t]),this.data.height=e.height+1,this.data.leaf=!1,h(this.data,this.toBBox)}_chooseSplitIndex(e,t,n){let r,i=1/0,o=1/0;for(let a=t;n-t>=a;a++){const t=c(e,0,a,this.toBBox),l=c(e,a,n,this.toBBox),s=g(t,l),h=p(t)+p(l);i>s?(i=s,r=a,o=o>h?h:o):s===i&&o>h&&(o=h,r=a)}return r||n-t}_chooseSplitAxis(e,t,n){const r=e.leaf?this.compareMinX:d,i=e.leaf?this.compareMinY:f,o=this._allDistMargin(e,t,n,r);this._allDistMargin(e,t,n,i)>o&&e.children.sort(r)}_allDistMargin(e,t,n,r){e.children.sort(r);const i=this.toBBox,o=c(e,0,t,i),a=c(e,n-t,n,i);let l=v(o)+v(a);for(let r=t;n-t>r;r++){const t=e.children[r];u(o,e.leaf?i(t):t),l+=v(o)}for(let r=n-t-1;r>=t;r--){const t=e.children[r];u(a,e.leaf?i(t):t),l+=v(a)}return l}_adjustParentBBoxes(e,t,n){for(let r=n;r>=0;r--)u(t[r],e)}_condense(e){for(let t,n=e.length-1;n>=0;n--)0===e[n].children.length?n>0?(t=e[n-1].children,t.splice(t.indexOf(e[n]),1)):this.clear():h(e[n],this.toBBox)}}function s(e,t,n){if(!n)return t.indexOf(e);for(let r=0;t.length>r;r++)if(n(e,t[r]))return r;return-1}function h(e,t){c(e,0,e.children.length,t,e)}function c(e,t,n,r,i){i||(i=x(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let o=t;n>o;o++){const t=e.children[o];u(i,e.leaf?r(t):t)}return i}function u(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function d(e,t){return e.minX-t.minX}function f(e,t){return e.minY-t.minY}function p(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function v(e){return e.maxX-e.minX+(e.maxY-e.minY)}function g(e,t){const n=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),i=Math.min(e.maxX,t.maxX),o=Math.min(e.maxY,t.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function y(e,t){return!(e.minX>t.minX||e.minY>t.minY||t.maxX>e.maxX||t.maxY>e.maxY)}function m(e,t){return!(t.minX>e.maxX||t.minY>e.maxY||e.minX>t.maxX||e.minY>t.maxY)}function x(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function b(e,t,n,i,o){const a=[t,n];for(;a.length;){if(i>=(n=a.pop())-(t=a.pop()))continue;const l=t+Math.ceil((n-t)/i/2)*i;r(e,l,t,n,o),a.push(t,l,l,n)}}var R=n.Syringe.defineToken("StyleRendererFactory"),C=n.Syringe.defineToken("CircleRenderer",{multiple:!1}),S=n.Syringe.defineToken("EllipseRenderer",{multiple:!1}),B=n.Syringe.defineToken("RectRenderer",{multiple:!1}),E=n.Syringe.defineToken("LineRenderer",{multiple:!1}),w=n.Syringe.defineToken("PolylineRenderer",{multiple:!1}),P=n.Syringe.defineToken("PolygonRenderer",{multiple:!1}),M=n.Syringe.defineToken("PathRenderer",{multiple:!1}),T=n.Syringe.defineToken("TextRenderer",{multiple:!1}),O=n.Syringe.defineToken("ImageRenderer",{multiple:!1});function A(e,t,n,r){var i,o=arguments.length,a=3>o?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(a=(3>o?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}function k(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}var L=function(){function e(){this.imageCache={},this.patternCache={},this.canvasConfig=void 0}var n=e.prototype;return n.getImageSync=function(e){return this.imageCache[e]},n.getOrCreateImage=function(e){var n=this;if(this.imageCache[e])return Promise.resolve(this.imageCache[e]);var r=this.canvasConfig.createImage;return new Promise((function(i,o){var a;r?a=r(e):t.isBrowser&&(a=new window.Image),a&&(a.onload=function(){i(a)},a.onerror=function(e){o(e)},a.crossOrigin="Anonymous",a.src=e,n.imageCache[e]=a)}))},n.getPatternSync=function(e){var t=this.generatePatternKey(e);if(this.patternCache[t])return this.patternCache[t]},n.createPattern=function(e,t){var n=this;return this.getOrCreateImage(e.src).then((function(r){var i=n.generatePatternKey(e),o=t.createPattern(r,e.repetition);return o&&(n.patternCache[i]=o),n.patternCache[i]}))},n.generatePatternKey=function(e){return"pattern-"+e.src+"-"+e.repetition},e}();function N(){
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
N=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var i=Object.create((t&&t.prototype instanceof u?t:u).prototype),o=new S(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return E()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var l=b(a,n);if(l){if(l===c)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var s=h(e,t,n);if("normal"===s.type){if(r=n.done?"completed":"suspendedYield",s.arg===c)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r="completed",n.method="throw",n.arg=s.arg)}}}(e,n,o),i}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var c={};function u(){}function d(){}function f(){}var p={};l(p,i,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(B([])));g&&g!==t&&n.call(g,i)&&(p=g);var y=f.prototype=u.prototype=Object.create(p);function m(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function r(i,o,a,l){var s=h(e[i],e,o);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==typeof u&&n.call(u,"__await")?t.resolve(u.__await).then((function(e){r("next",e,a,l)}),(function(e){r("throw",e,a,l)})):t.resolve(u).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,l)}))}l(s.arg)}var i;this._invoke=function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}}function b(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,b(e,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var r=h(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,c;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,c):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function R(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function B(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return d.prototype=f,l(y,"constructor",f),l(f,"constructor",d),d.displayName=l(f,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,l(e,a,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},m(x.prototype),l(x.prototype,o,(function(){return this})),e.AsyncIterator=x,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new x(s(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},m(y),l(y,a,"Generator"),l(y,i,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=B,S.prototype={constructor:S,reset:function(e){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(C),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(this.prev>=o.tryLoc){var l=n.call(o,"catchLoc"),s=n.call(o,"finallyLoc");if(l&&s){if(o.catchLoc>this.prev)return r(o.catchLoc,!0);if(o.finallyLoc>this.prev)return r(o.finallyLoc)}else if(l){if(o.catchLoc>this.prev)return r(o.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(this.prev>=i.tryLoc&&n.call(i,"finallyLoc")&&i.finallyLoc>this.prev){var o=i;break}}o&&("break"===e||"continue"===e)&&t>=o.tryLoc&&o.finallyLoc>=t&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,c):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),c},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),c}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:B(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),c}},e}function j(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,i)}function _(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){j(o,r,i,a,l,"next",e)}function l(e){j(o,r,i,a,l,"throw",e)}a(void 0)}))}}function Y(){return Y=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Y.apply(this,arguments)}function G(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,X(e,t)}function X(e,t){return X=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},X(e,t)}A([n.inject(t.CanvasConfig),k("design:type",Object)],L.prototype,"canvasConfig",void 0),L=A([n.singleton()],L),e.ImageRenderer=function(){function e(){this.imagePool=void 0}var n=e.prototype;return n.hash=function(e){return""},n.render=function(e,n){var r,i=n.img,o=n.width.value,a=n.height.value;if(t.isString(i)?r=this.imagePool.getImageSync(i):(o||(o=i.width),a||(a=i.height),r=i),r)try{e.drawImage(r,0,0,o,a)}catch(e){}},e}(),A([n.inject(L),k("design:type",L)],e.ImageRenderer.prototype,"imagePool",void 0),e.ImageRenderer=A([n.singleton({token:O})],e.ImageRenderer),e.TextRenderer=function(){function e(){}var n=e.prototype;return n.hash=function(e){return""},n.render=function(e,n,r){var i=n.lineWidth,o=n.textAlign,a=n.textBaseline,l=n.lineJoin,s=n.miterLimit,h=void 0===s?0:s,c=n.letterSpacing,u=void 0===c?0:c,d=n.stroke,f=n.fill,p=n.fillOpacity,v=n.strokeOpacity,g=n.opacity,y=n.metrics,m=n.dx,x=n.dy,b=y.lines,R=y.height,C=y.lineHeight,S=y.lineMetrics;e.font=y.font,e.lineWidth=i.value,e.textAlign=o.value,e.textBaseline=a.value,e.lineJoin=l.value,e.miterLimit=h;var B=0;"middle"===a.value?B=-R/2-C/2:"bottom"===a.value||"alphabetic"===a.value||"ideographic"===a.value?B=-R:"top"!==a.value&&"hanging"!==a.value||(B=-C);var E=0;m&&m.unit===t.UnitType.kPixels&&(E+=m.value),x&&x.unit===t.UnitType.kPixels&&(B+=x.value);for(var w=0;b.length>w;w++){var P=i.value/2+E;B+=C,!t.isNil(d)&&i&&i.value&&this.drawLetterSpacing(e,b[w],S[w],o.value,P,B,u,p.value,v.value,g.value,!0),t.isNil(f)||this.drawLetterSpacing(e,b[w],S[w],o.value,P,B,u,p.value,v.value,g.value)}},n.drawLetterSpacing=function(e,t,n,r,i,o,a,l,s,h,c){if(void 0===c&&(c=!1),0!==a){var u=e.textAlign;e.textAlign="left";var d=i;"center"===r?d=i-n.width/2:"right"!==r&&"end"!==r||(d=i-n.width);for(var f=Array.from(t),p=e.measureText(t).width,v=0,g=0;f.length>g;++g){var y=f[g];c?this.strokeText(e,y,d,o,s):this.fillText(e,y,d,o,l,h),d+=p-(v=e.measureText(t.substring(g+1)).width)+a,p=v}e.textAlign=u}else c?this.strokeText(e,t,i,o,s):this.fillText(e,t,i,o,l,h)},n.fillText=function(e,n,r,i,o,a){var l,s=!t.isNil(o)&&1!==o;s&&(l=e.globalAlpha,e.globalAlpha=o*a),e.fillText(n,r,i),s&&(e.globalAlpha=l)},n.strokeText=function(e,n,r,i,o){var a,l=!t.isNil(o)&&1!==o;l&&(a=e.globalAlpha,e.globalAlpha=o),e.strokeText(n,r,i),l&&(e.globalAlpha=a)},e}(),e.TextRenderer=A([n.singleton({token:T})],e.TextRenderer);var D=function(){function e(){}var n=e.prototype;return n.hash=function(e){return""},n.render=function(e,n){var r=n.fill,i=n.opacity,o=n.fillOpacity,a=n.stroke,l=n.strokeOpacity,s=n.lineWidth,h=n.lineCap,c=n.lineJoin,u=n.shadowColor,d=n.filter,f=n.miterLimit,p=!t.isNil(r),v=!t.isNil(a),g=0===r.alpha;if(p&&(t.isNil(o)||1===o.value?e.fill():(e.globalAlpha=o.value,e.fill(),e.globalAlpha=i.value)),v&&s&&s.value>0){var y,m,x;!t.isNil(l)&&1!==l.value&&(e.globalAlpha=l.value),e.lineWidth=s.value,t.isNil(f)||(e.miterLimit=f),t.isNil(h)||(e.lineCap=h.value),t.isNil(c)||(e.lineJoin=c.value);var b=!t.isNil(u),R=!t.isNil(d);b&&(m=e.shadowColor,t.isNil(y=e.shadowBlur)||(e.shadowColor="transparent",e.shadowBlur=0)),R&&!t.isNil(x=e.filter)&&x.indexOf("drop-shadow")>-1&&(e.filter=x.replace(/drop-shadow\([^)]*\)/,"").trim()||"none");var C=p&&!g;C&&e.stroke(),b&&(e.shadowColor=m,e.shadowBlur=y),R&&(e.filter=x),C||e.stroke()}},e}();D=A([n.singleton()],D),e.RectRenderer=function(e){function t(){return e.apply(this,arguments)||this}return G(t,e),t}(D),e.RectRenderer=A([n.singleton({token:B})],e.RectRenderer),e.CircleRenderer=function(e){function t(){return e.apply(this,arguments)||this}return G(t,e),t}(D),e.CircleRenderer=A([n.singleton({token:C})],e.CircleRenderer),e.EllipseRenderer=function(e){function t(){return e.apply(this,arguments)||this}return G(t,e),t}(D),e.EllipseRenderer=A([n.singleton({token:S})],e.EllipseRenderer),e.LineRenderer=function(e){function t(){return e.apply(this,arguments)||this}return G(t,e),t}(D),e.LineRenderer=A([n.singleton({token:E})],e.LineRenderer),e.PolylineRenderer=function(e){function t(){return e.apply(this,arguments)||this}return G(t,e),t}(D),e.PolylineRenderer=A([n.singleton({token:w})],e.PolylineRenderer),e.PolygonRenderer=function(e){function t(){return e.apply(this,arguments)||this}return G(t,e),t}(D),e.PolygonRenderer=A([n.singleton({token:P})],e.PolygonRenderer),e.PathRenderer=function(e){function t(){return e.apply(this,arguments)||this}return G(t,e),t}(D),e.PathRenderer=A([n.singleton({token:M})],e.PathRenderer);var I=function(){function e(){this.gradientCache={}}var n=e.prototype;return n.getOrCreateGradient=function(e,n){var r=this.generateCacheKey(e),i=e.type,o=e.x0,a=e.y0,l=e.x1,s=e.y1,h=e.steps,c=e.width,u=e.height;if(this.gradientCache[r])return this.gradientCache[r];var d=null;if(i===t.GradientPatternType.LinearGradient)d=n.createLinearGradient(o*c,a*u,l*c,s*u);else if(i===t.GradientPatternType.RadialGradient){d=n.createRadialGradient(o*c,a*u,0,l*c,s*u,e.r1*(Math.sqrt(c*c+u*u)/2))}return d&&(h.forEach((function(e){var t,n=e[1];null===(t=d)||void 0===t||t.addColorStop(Number(e[0]),n)})),this.gradientCache[r]=d),this.gradientCache[r]},n.generateCacheKey=function(e){return"gradient-"+e.type+"-"+e.x0+"-"+e.y0+"-"+e.x1+"-"+e.y1+"-"+(e.r1||0)+"-"+e.width+"-"+e.height+"-"+e.steps.map((function(e){return e.join("")})).join("-")},e}();I=A([n.singleton()],I);var F=n.Syringe.defineToken("PathGeneratorFactory"),H=n.Syringe.defineToken("PathGenerator"),U="undefined"!=typeof Float32Array?Float32Array:Array;function V(e,t){var n=t[4],r=t[5],i=t[6],o=t[8],a=t[9],l=t[10];return e[0]=Math.hypot(t[0],t[1],t[2]),e[1]=Math.hypot(n,r,i),e[2]=Math.hypot(o,a,l),e}function q(){var e=new U(3);return U!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function Q(e,t,n){var r=new U(3);return r[0]=e,r[1]=t,r[2]=n,r}function J(e,t,n){var r=t[0],i=t[1],o=t[2],a=n[0],l=n[1],s=n[2];return e[0]=i*s-o*l,e[1]=o*a-r*s,e[2]=r*l-i*a,e}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var K,W=function(e){return Math.hypot(e[0],e[1],e[2])};K=q();!function(){var e,t=(e=new U(4),U!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e)}();function z(){var e=new U(4);return U!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function Z(e,t,n,r){var i,o,a,l,s,h=t[0],c=t[1],u=t[2],d=t[3],f=n[0],p=n[1],v=n[2],g=n[3];return 0>(o=h*f+c*p+u*v+d*g)&&(o=-o,f=-f,p=-p,v=-v,g=-g),1-o>1e-6?(a=Math.sin(i=Math.acos(o)),l=Math.sin((1-r)*i)/a,s=Math.sin(r*i)/a):(l=1-r,s=r),e[0]=l*h+s*f,e[1]=l*c+s*p,e[2]=l*u+s*v,e[3]=l*d+s*g,e}var $,ee,te,ne,re,ie,oe,ae,le,se=function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),e[0]=n*a,e[1]=r*a,e[2]=i*a,e[3]=o*a,e},he=($=q(),ee=Q(1,0,0),te=Q(0,1,0),ne=z(),re=z(),ie=new U(9),U!=Float32Array&&(ie[1]=0,ie[2]=0,ie[3]=0,ie[5]=0,ie[6]=0,ie[7]=0),ie[0]=1,ie[4]=1,ie[8]=1,oe=ie,function(){this.aabb=void 0});he.tag="c-canvas-rbush-node";var ce,ue,de="RBushRoot",fe=(ae=function(){function e(){this.canvasConfig=void 0,this.camera=void 0,this.contextService=void 0,this.renderingContext=void 0,this.imagePool=void 0,this.gradientPool=void 0,this.pathGeneratorFactory=void 0,this.styleRendererFactory=void 0,this.displayObjectPool=void 0,this.rBush=void 0,this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreen=!1,this.enableBatch=!1,this.batchedStyleHash="",this.batchedDisplayObject=null,this.toSync=new Set}var n=e.prototype;return n.syncRTree=function(){var e=this,t=[];Array.from(this.toSync).filter((function(e){return e.isConnected})).forEach((function(n){var r=n.rBushNode;r&&e.rBush.remove(r.aabb);var i=n.getRenderBounds();if(i){var o=i.getMin(),a=o[0],l=o[1],s=i.getMax();r.aabb={id:n.entity,minX:a,minY:l,maxX:s[0],maxY:s[1]}}r.aabb&&t.push(r.aabb)})),this.rBush.load(t),this.toSync.clear()},n.pushToSync=function(e){var t=this;e.forEach((function(e){t.toSync.add(e)}))},n.apply=function(e){var n=this,r=function(e){e.target.rBushNode=new he,n.pushToSync(e.composedPath().slice(0,-2))},i=function(e){var t=e.target,r=t.rBushNode;r.aabb&&(n.rBush.remove(r.aabb),n.toSync.delete(t),n.removedRBushNodeAABBs.push(r.aabb))},o=function(e){var t,r=e.target;(null===(t=r.ownerDocument)||void 0===t?void 0:t.documentElement)===n.renderingContext.root&&(e.detail.affectChildren&&r.forEach((function(e){n.pushToSync([e])})),n.pushToSync(e.composedPath().slice(0,-2)))};e.hooks.init.tapPromise(le.tag,_(N().mark((function e(){var a,l,s,h;return N().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.renderingContext.root.addEventListener(t.ElementEvent.MOUNTED,r),n.renderingContext.root.addEventListener(t.ElementEvent.UNMOUNTED,i),n.renderingContext.root.addEventListener(t.ElementEvent.BOUNDS_CHANGED,o),l=(a=n.canvasConfig).width,s=a.height,h=n.contextService.getContext(),n.clearRect(h,0,0,l,s);case 6:case"end":return e.stop()}}),e)})))),e.hooks.destroy.tap(le.tag,(function(){n.renderingContext.root.removeEventListener(t.ElementEvent.MOUNTED,r),n.renderingContext.root.removeEventListener(t.ElementEvent.UNMOUNTED,i),n.renderingContext.root.removeEventListener(t.ElementEvent.BOUNDS_CHANGED,o)})),e.hooks.beginFrame.tap(le.tag,(function(){var e=n.contextService.getContext(),r=n.canvasConfig,i=r.width,o=r.height,a=r.renderer.getConfig();n.clearFullScreen=!a.enableDirtyRectangleRendering||n.renderingContext.renderReasons.has(t.RenderReason.CAMERA_CHANGED),e&&(e.save(),n.clearFullScreen&&n.clearRect(e,0,0,i,o),n.applyTransform(e,n.camera.getOrthoMatrix()))})),e.hooks.endFrame.tap(le.tag,(function(){n.syncRTree();var r=n.canvasConfig.renderer.getConfig(),i=r.enableDirtyRectangleRendering,o=r.enableDirtyRectangleRenderingDebug,a=n.contextService.getContext(),l=n.renderQueue;if(i){if(!n.clearFullScreen){var s=n.safeMergeAABB.apply(n,[n.mergeDirtyAABBs(n.renderQueue)].concat(n.removedRBushNodeAABBs.map((function(e){var n=e.minX,r=e.minY,i=e.maxX,o=e.maxY,a=new t.AABB;return a.setMinMax(Q(n,r,0),Q(i,o,0)),a}))));if(n.removedRBushNodeAABBs=[],t.AABB.isEmpty(s))return void(n.renderQueue=[]);var h=n.convertAABB2Rect(s),c=h.x,u=h.y,d=h.width,f=h.height;n.clearRect(a,c,u,d,f),a.beginPath(),a.rect(c,u,d,f),a.clip(),o&&(a.lineWidth=4,a.strokeStyle="rgba("+255*Math.random()+", "+255*Math.random()+", "+255*Math.random()+", 1)",a.strokeRect(c,u,d,f)),l=n.searchDirtyObjects(s)}l.sort((function(e,t){return e.sortable.renderOrder-t.sortable.renderOrder})).forEach((function(t){t&&t.isVisible()&&!t.isCulled()&&n.renderDisplayObject(t,e)})),n.enableBatch&&n.batchedStyleHash&&n.flush(a,e),n.renderQueue.forEach((function(e){n.saveDirtyAABB(e)})),n.renderQueue=[]}n.restoreStack.forEach((function(e){a.restore()})),n.restoreStack=[],n.clearFullScreen=!1,a.restore()})),e.hooks.render.tap(le.tag,(function(t){n.canvasConfig.renderer.getConfig().enableDirtyRectangleRendering?n.renderQueue.push(t):t.isVisible()&&!t.isCulled()&&n.renderDisplayObject(t,e)}))},n.clearRect=function(e,t,n,r,i){e.clearRect(t,n,r,i);var o=this.canvasConfig.background;o&&(e.fillStyle=o,e.fillRect(t,n,r,i))},n.flush=function(e,t){if(this.batchedDisplayObject){var n=this.styleRendererFactory(this.batchedDisplayObject.nodeName);n&&(this.applyAttributesToContext(e,this.batchedDisplayObject,t),e.closePath(),n.render(e,this.batchedDisplayObject.parsedStyle,this.batchedDisplayObject),e.restore()),this.batchedStyleHash="",this.batchedDisplayObject=null}},n.renderDisplayObject=function(e,n){for(var r=this,i=this.contextService.getContext(),o=this.restoreStack[this.restoreStack.length-1];o&&e.parentNode!==o;)i.restore(),this.restoreStack.pop(),o=this.restoreStack[this.restoreStack.length-1];var a=this.styleRendererFactory(e.nodeName),l=!1;if(this.enableBatch&&a){var s=a.hash(e.attributes);this.batchedStyleHash&&s!==this.batchedStyleHash&&this.flush(i,n),this.batchedStyleHash||(this.batchedStyleHash=s,this.batchedDisplayObject=e,l=!0)}i.save(),this.applyTransform(i,e.getLocalTransform());var h=e.style.clipPath;if(h){i.save(),this.applyTransform(i,h.getLocalTransform());var c=this.pathGeneratorFactory(h.nodeName);c&&this.useAnchor(i,h,(function(){i.beginPath(),c(i,h.parsedStyle),i.closePath()})),i.restore(),i.clip()}this.enableBatch||(i.save(),this.applyAttributesToContext(i,e,n)),this.useAnchor(i,e,(function(){var n=r.pathGeneratorFactory(e.nodeName);n&&(!l&&r.enableBatch||i.beginPath(),n(i,e.parsedStyle),r.enableBatch||e.nodeName===t.Shape.LINE||e.nodeName===t.Shape.PATH||e.nodeName===t.Shape.POLYLINE||i.closePath()),a&&!r.enableBatch&&a.render(i,e.parsedStyle,e)})),this.enableBatch||i.restore(),e.renderable.dirty=!1,this.restoreStack.push(e)},n.convertAABB2Rect=function(e){var t=e.getMin(),n=e.getMax(),r=Math.floor(t[0]),i=Math.floor(t[1]);return{x:r,y:i,width:Math.ceil(n[0])-r,height:Math.ceil(n[1])-i}},n.mergeDirtyAABBs=function(e){var n=new t.AABB;return e.forEach((function(e){var t=e.getRenderBounds();n.add(t);var r=e.renderable.dirtyRenderBounds;r&&n.add(r)})),n},n.searchDirtyObjects=function(e){var t=this,n=e.getMin(),r=n[0],i=n[1],o=e.getMax();return this.rBush.search({minX:r,minY:i,maxX:o[0],maxY:o[1]}).map((function(e){return t.displayObjectPool.getByEntity(e.id)}))},n.saveDirtyAABB=function(e){var n=e.renderable;n.dirtyRenderBounds||(n.dirtyRenderBounds=new t.AABB);var r=e.getRenderBounds();r&&n.dirtyRenderBounds.update(r.center,r.halfExtents)},n.applyTransform=function(e,n){var r=function(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}(q(),n),i=r[0],o=r[1],a=V(q(),n),l=a[0],s=a[1],h=function(e,t){var n=new U(3);V(n,t);var r=1/n[0],i=1/n[1],o=1/n[2],a=t[0]*r,l=t[1]*i,s=t[2]*o,h=t[4]*r,c=t[5]*i,u=t[6]*o,d=t[8]*r,f=t[9]*i,p=t[10]*o,v=a+c+p,g=0;return v>0?(e[3]=.25*(g=2*Math.sqrt(v+1)),e[0]=(u-f)/g,e[1]=(d-s)/g,e[2]=(l-h)/g):a>c&&a>p?(e[3]=(u-f)/(g=2*Math.sqrt(1+a-c-p)),e[0]=.25*g,e[1]=(l+h)/g,e[2]=(d+s)/g):c>p?(e[3]=(d-s)/(g=2*Math.sqrt(1+c-a-p)),e[0]=(l+h)/g,e[1]=.25*g,e[2]=(u+f)/g):(e[3]=(l-h)/(g=2*Math.sqrt(1+p-a-c)),e[0]=(d+s)/g,e[1]=(u+f)/g,e[2]=.25*g),e}(z(),n),c=t.getEuler(q(),h),u=t.fromRotationTranslationScale(c[0]||c[2],i,o,l,s);e.transform(u[0],u[1],u[3],u[4],u[6],u[7])},n.getColor=function(e,n,r,i){var o;if(e instanceof t.CSSGradientValue){if(e.type===t.GradientPatternType.LinearGradient||e.type===t.GradientPatternType.RadialGradient){var a=n.getGeometryBounds();o=this.gradientPool.getOrCreateGradient(Y({type:e.type},e.value,{width:a&&2*a.halfExtents[0]||0,height:a&&2*a.halfExtents[1]||0}),r)}else if(e.type===t.GradientPatternType.Pattern){var l=this.imagePool.getPatternSync(e.value);l?o=l:this.imagePool.createPattern(e.value,r).then((function(){n.renderable.dirty=!0,i.dirtify()}))}}else o=""+e;return o},n.applyAttributesToContext=function(e,n,r){var i=n.parsedStyle,o=i.stroke,a=i.fill,l=i.opacity,s=i.lineDash,h=i.lineDashOffset,c=i.filter,u=i.shadowColor,d=i.shadowBlur,f=i.shadowOffsetX,p=i.shadowOffsetY;s&&Array.isArray(s)&&e.setLineDash(s.map((function(e){return e.value}))),t.isNil(h)||(e.lineDashOffset=h.value),t.isNil(l)||(e.globalAlpha*=l.value),t.isNil(o)||(e.strokeStyle=this.getColor(o,n,e,r)),t.isNil(a)||(e.fillStyle=this.getColor(a,n,e,r)),t.isNil(c)||(e.filter=n.style.filter),t.isNil(u)||(e.shadowColor=""+u,e.shadowBlur=d&&d.value||0,e.shadowOffsetX=f&&f.value||0,e.shadowOffsetY=p&&p.value||0)},n.useAnchor=function(e,t,n){var r=t.getGeometryBounds();if(r){var i=r.halfExtents,o=(t.parsedStyle||{}).anchor;e.translate(-(o&&o[0].value||0)*i[0]*2,-(o&&o[1].value||0)*i[1]*2),n()}else n()},n.safeMergeAABB=function(){for(var e=new t.AABB,n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return r.forEach((function(t){e.add(t)})),e},e}(),ae.tag="CanvasRenderer",le=ae);A([n.inject(t.CanvasConfig),k("design:type",Object)],fe.prototype,"canvasConfig",void 0),A([n.inject(t.DefaultCamera),k("design:type",t.Camera)],fe.prototype,"camera",void 0),A([n.inject(t.ContextService),k("design:type",Object)],fe.prototype,"contextService",void 0),A([n.inject(t.RenderingContext),k("design:type",Object)],fe.prototype,"renderingContext",void 0),A([n.inject(L),k("design:type",L)],fe.prototype,"imagePool",void 0),A([n.inject(I),k("design:type",I)],fe.prototype,"gradientPool",void 0),A([n.inject(F),k("design:type",Function)],fe.prototype,"pathGeneratorFactory",void 0),A([n.inject(R),k("design:type",Function)],fe.prototype,"styleRendererFactory",void 0),A([n.inject(t.DisplayObjectPool),k("design:type",t.DisplayObjectPool)],fe.prototype,"displayObjectPool",void 0),A([n.inject(de),k("design:type",l)],fe.prototype,"rBush",void 0),fe=le=A([n.singleton({contrib:t.RenderingPluginContribution})],fe);var pe=(ce=function(){function e(){this.imagePool=void 0,this.renderingContext=void 0}return e.prototype.apply=function(e){var n=this,r=function(r){var i=r.target;if(i.nodeName===t.Shape.IMAGE){var o=i.attributes.img;t.isString(o)&&n.imagePool.getOrCreateImage(o).then((function(){i.renderable.dirty=!0,e.dirtify()}))}},i=function(r){var i=r.target,o=r.newValue;i.nodeName===t.Shape.IMAGE&&"img"===r.attrName&&t.isString(o)&&n.imagePool.getOrCreateImage(o).then((function(){i.renderable.dirty=!0,e.dirtify()}))};e.hooks.init.tapPromise(ue.tag,_(N().mark((function e(){return N().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.renderingContext.root.addEventListener(t.ElementEvent.MOUNTED,r),n.renderingContext.root.addEventListener(t.ElementEvent.ATTR_MODIFIED,i);case 2:case"end":return e.stop()}}),e)})))),e.hooks.destroy.tap(ue.tag,(function(){n.renderingContext.root.removeEventListener(t.ElementEvent.MOUNTED,r),n.renderingContext.root.removeEventListener(t.ElementEvent.ATTR_MODIFIED,i)}))},e}(),ce.tag="LoadImage",ue=ce);A([n.inject(L),k("design:type",L)],pe.prototype,"imagePool",void 0),A([n.inject(t.RenderingContext),k("design:type",Object)],pe.prototype,"renderingContext",void 0),pe=ue=A([n.singleton({contrib:t.RenderingPluginContribution})],pe),n.GlobalContainer.register({token:{token:H,named:t.Shape.CIRCLE},useValue:function(e,t){var n=t.r;e.arc(n.value,n.value,n.value,0,2*Math.PI,!1)}}),n.GlobalContainer.register({token:{token:H,named:t.Shape.ELLIPSE},useValue:function(e,t){var n=t.rx.value,r=t.ry.value;if(e.ellipse)e.ellipse(n,r,n,r,0,0,2*Math.PI,!1);else{var i=n>r?n:r,o=n>r?1:n/r,a=n>r?r/n:1;e.save(),e.scale(o,a),e.arc(0,0,i,0,2*Math.PI)}}}),n.GlobalContainer.register({token:{token:H,named:t.Shape.RECT},useValue:function(e,t){var n=t.radius,r=t.width.value,i=t.height.value;if(n&&n.some((function(e){return 0!==e.value}))){var o=n.map((function(e){return e.value})),a=o[0],l=o[1],s=o[2],h=o[3];e.moveTo(a,0),e.lineTo(r-l,0),0!==l&&e.arc(r-l,l,l,-Math.PI/2,0),e.lineTo(r,i-s),0!==s&&e.arc(r-s,i-s,s,0,Math.PI/2),e.lineTo(h,i),0!==h&&e.arc(h,i-h,h,Math.PI/2,Math.PI),e.lineTo(0,a),0!==a&&e.arc(a,a,a,Math.PI,1.5*Math.PI)}else e.rect(0,0,r,i)}}),n.GlobalContainer.register({token:{token:H,named:t.Shape.LINE},useValue:function(e,t){var n=t.x2,r=t.y2,i=t.defX,o=void 0===i?0:i,a=t.defY,l=void 0===a?0:a;e.moveTo(t.x1.value-o,t.y1.value-l),e.lineTo(n.value-o,r.value-l)}}),n.GlobalContainer.register({token:{token:H,named:t.Shape.POLYLINE},useValue:function(e,t){var n=t.defX,r=void 0===n?0:n,i=t.defY,o=void 0===i?0:i,a=t.points.points,l=a.length,s=a[l-1][0]-r,h=a[l-1][1]-o;e.moveTo(a[0][0]-r,a[0][1]-o);for(var c=0;l-1>c;c++){var u=a[c];e.lineTo(u[0]-r,u[1]-o)}e.lineTo(s,h)}}),n.GlobalContainer.register({token:{token:H,named:t.Shape.POLYGON},useValue:function(e,t){var n=t.defX,r=void 0===n?0:n,i=t.defY,o=void 0===i?0:i,a=t.points.points,l=a.length,s=a[l-1][0]-r,h=a[l-1][1]-o;e.moveTo(a[0][0]-r,a[0][1]-o);for(var c=0;l-1>c;c++){var u=a[c];e.lineTo(u[0]-r,u[1]-o)}e.lineTo(s,h)}}),n.GlobalContainer.register({token:{token:H,named:t.Shape.PATH},useValue:function(e,t){var n=t.defX,r=void 0===n?0:n,i=t.defY,o=void 0===i?0:i,a=t.path,l=a.zCommandIndexes,s=[].concat(a.curve);l.forEach((function(e,t){s.splice(e+t,1,["Z"])}));for(var h=0;s.length>h;h++){var c=s[h];switch(c[0]){case"M":e.moveTo(c[1]-r,c[2]-o);break;case"C":e.bezierCurveTo(c[1]-r,c[2]-o,c[3]-r,c[4]-o,c[5]-r,c[6]-o);break;case"Z":e.closePath()}}}}),n.GlobalContainer.register({token:F,useFactory:function(e){var t={};return function(n){return t[n]||e.container.isBoundNamed(H,n)&&(t[n]=e.container.getNamed(H,n)),t[n]}}});var ve=n.Module((function(n){var r;n(L),n({token:de,useValue:new l}),n(e.CircleRenderer),n(e.EllipseRenderer),n(e.RectRenderer),n(e.ImageRenderer),n(e.TextRenderer),n(e.LineRenderer),n(e.PolylineRenderer),n(e.PolygonRenderer),n(e.PathRenderer);var i=((r={})[t.Shape.CIRCLE]=C,r[t.Shape.ELLIPSE]=S,r[t.Shape.RECT]=B,r[t.Shape.IMAGE]=O,r[t.Shape.TEXT]=T,r[t.Shape.LINE]=E,r[t.Shape.POLYLINE]=w,r[t.Shape.POLYGON]=P,r[t.Shape.PATH]=M,r);n({token:R,useFactory:function(e){var t={};return function(n){var r=i[n];return r&&!t[n]&&e.container.isBound(r)&&(t[n]=e.container.get(r)),t[n]}}}),n(I),n(fe),n(pe)})),ge=function(){function e(){this.name="canvas-renderer"}var t=e.prototype;return t.init=function(e){e.load(ve,!0)},t.destroy=function(e){e.unload(ve)},e}();e.CircleRendererContribution=C,e.EllipseRendererContribution=S,e.ImageRendererContribution=O,e.LineRendererContribution=E,e.PathGenerator=H,e.PathGeneratorFactory=F,e.PathRendererContribution=M,e.Plugin=ge,e.PolygonRendererContribution=P,e.PolylineRendererContribution=w,e.RBush=l,e.RBushNode=he,e.RBushRoot=de,e.RectRendererContribution=B,e.StyleRendererFactory=R,e.TextRendererContribution=T,Object.defineProperty(e,"__esModule",{value:!0})}));
{
"name": "@antv/g-plugin-canvas-renderer",
"version": "1.1.2",
"version": "1.1.3-alpha.0",
"description": "A G plugin of renderer implementation with Canvas2D API",
"main": "lib/index.js",
"module": "es/index.js",
"types": "es/index.d.ts",
"keywords": [
"antv",
"g"
],
"homepage": "https://github.com/antvis/g#readme",
"bugs": {
"url": "https://github.com/antvis/g/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/antvis/g.git"
},
"license": "MIT",
"author": "https://github.com/orgs/antvis/people",
"main": "dist/index.js",
"unpkg": "dist/index.umd.min.js",
"module": "dist/index.esm.js",
"types": "dist/index.d.ts",
"files": [
"package.json",
"dist",
"es",
"lib",
"LICENSE",
"README.md"
],
"repository": {
"type": "git",
"url": "git+https://github.com/antvis/g.git"
},
"keywords": [
"util",
"antv",
"g"
],
"publishConfig": {
"access": "public"
},
"author": "https://github.com/orgs/antvis/people",
"license": "MIT",
"bugs": {
"url": "https://github.com/antvis/g/issues"
},
"dependencies": {
"@antv/g-math": "^1.1.2",
"@antv/g-math": "^1.1.3-alpha.0",
"rbush": "^3.0.1",

@@ -47,7 +42,6 @@ "tslib": "^2.3.1"

},
"scripts": {
"umd": "webpack"
"publishConfig": {
"access": "public"
},
"homepage": "https://github.com/antvis/g#readme",
"gitHead": "633cec1df324421b0c0821cb18d3ee351c1a47f3"
"gitHead": "d8b58d9c45bd5e41e47696a006aad8027c416409"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc