@antv/g-canvas 1.0.14 → 1.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- !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.Canvas2D=n(require("@antv/g"),require("mana-syringe")):(t.G=t.G||{},t.G.Canvas2D=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 o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.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 o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));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=6)}([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,o,i,a){!function t(e,r,o,i,a){for(;i>o;){if(i-o>600){var u=i-o+1,c=r-o+1,s=Math.log(u),f=.5*Math.exp(2*s/3),h=.5*Math.sqrt(s*f*(u-f)/u)*(c-u/2<0?-1:1);t(e,r,Math.max(o,Math.floor(r-c*f/u+h)),Math.min(i,Math.floor(r+(u-c)*f/u+h)),a)}var l=e[r],d=o,p=i;for(n(e,o,r),a(e[i],l)>0&&n(e,o,i);d<p;){for(n(e,d,p),d++,p--;a(e[d],l)<0;)d++;for(;a(e[p],l)>0;)p--}0===a(e[o],l)?n(e,o,p):n(e,++p,i),p<=r&&(o=p+1),r<=p&&(i=p-1)}}(t,r,o||0,i||t.length-1,a||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 o(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){a(t,0,t.children.length,n,t)}function a(t,n,e,r,o){o||(o=p(null)),o.minX=1/0,o.minY=1/0,o.maxX=-1/0,o.maxY=-1/0;for(var i=n;i<e;i++){var a=t.children[i];u(o,t.leaf?r(a):a)}return o}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 f(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function h(t){return t.maxX-t.minX+(t.maxY-t.minY)}function l(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,o,i){for(var a=[e,r];a.length;)if(!((r=a.pop())-(e=a.pop())<=o)){var u=e+Math.ceil((r-e)/o/2)*o;t(n,u,e,r,i),a.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,o=[];n;){for(var i=0;i<n.children.length;i++){var a=n.children[i],u=n.leaf?r(a):a;d(t,u)&&(n.leaf?e.push(a):l(t,u)?this._all(a,e):o.push(a))}n=o.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 o=n.children[r],i=n.leaf?this.toBBox(o):o;if(d(t,i)){if(n.leaf||l(t,i))return!0;e.push(o)}}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,a=this.data,u=this.toBBox(t),c=[],s=[];a||c.length;){if(a||(a=c.pop(),r=c[c.length-1],e=s.pop(),i=!0),a.leaf){var f=o(t,a.children,n);if(-1!==f)return a.children.splice(f,1),c.push(a),this._condense(c),this}i||a.leaf||!l(a,u)?r?(e++,a=r.children[e],i=!1):a=null:(c.push(a),s.push(e),e=0,r=a,a=a.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 o,a=e-n+1,u=this._maxEntries;if(a<=u)return i(o=p(t.slice(n,e+1)),this.toBBox),o;r||(r=Math.ceil(Math.log(a)/Math.log(u)),u=Math.ceil(a/Math.pow(u,r-1))),(o=p([])).leaf=!1,o.height=r;var c=Math.ceil(a/u),s=c*Math.ceil(Math.sqrt(u));v(t,n,e,s,this.compareMinX);for(var f=n;f<=e;f+=s){var h=Math.min(f+s-1,e);v(t,f,h,c,this.compareMinY);for(var l=f;l<=h;l+=c){var d=Math.min(l+c-1,h);o.children.push(this._build(t,l,d,r-1))}}return i(o,this.toBBox),o},r.prototype._chooseSubtree=function(t,n,e,r){for(;r.push(n),!n.leaf&&r.length-1!==e;){for(var o=1/0,i=1/0,a=void 0,u=0;u<n.children.length;u++){var c=n.children[u],s=f(c),h=(l=t,d=c,(Math.max(d.maxX,l.maxX)-Math.min(d.minX,l.minX))*(Math.max(d.maxY,l.maxY)-Math.min(d.minY,l.minY))-s);h<i?(i=h,o=s<o?s:o,a=c):h===i&&s<o&&(o=s,a=c)}n=a||n.children[0]}var l,d;return n},r.prototype._insert=function(t,n,e){var r=e?t:this.toBBox(t),o=[],i=this._chooseSubtree(r,this.data,n,o);for(i.children.push(t),u(i,r);n>=0&&o[n].children.length>this._maxEntries;)this._split(o,n),n--;this._adjustParentBBoxes(r,o,n)},r.prototype._split=function(t,n){var e=t[n],r=e.children.length,o=this._minEntries;this._chooseSplitAxis(e,o,r);var a=this._chooseSplitIndex(e,o,r),u=p(e.children.splice(a,e.children.length-a));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,o,i,u,c,s,h,l=1/0,d=1/0,p=n;p<=e-n;p++){var v=a(t,0,p,this.toBBox),y=a(t,p,e,this.toBBox),m=(o=v,i=y,u=Math.max(o.minX,i.minX),c=Math.max(o.minY,i.minY),s=Math.min(o.maxX,i.maxX),h=Math.min(o.maxY,i.maxY),Math.max(0,s-u)*Math.max(0,h-c)),g=f(v)+f(y);m<l?(l=m,r=p,d=g<d?g:d):m===l&&g<d&&(d=g,r=p)}return r||e-n},r.prototype._chooseSplitAxis=function(t,n,e){var r=t.leaf?this.compareMinX:c,o=t.leaf?this.compareMinY:s;this._allDistMargin(t,n,e,r)<this._allDistMargin(t,n,e,o)&&t.children.sort(r)},r.prototype._allDistMargin=function(t,n,e,r){t.children.sort(r);for(var o=this.toBBox,i=a(t,0,n,o),c=a(t,e-n,e,o),s=h(i)+h(c),f=n;f<e-n;f++){var l=t.children[f];u(i,t.leaf?o(l):l),s+=h(i)}for(var d=e-n-1;d>=n;d--){var p=t.children[d];u(c,t.leaf?o(p):p),s+=h(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,"DomInteraction",(function(){return r})),e.d(n,"CanvasRenderer",(function(){return s})),e.d(n,"CanvasPicker",(function(){return f})),e.d(n,"HTMLRenderer",(function(){return h})),e.d(n,"Renderer",(function(){return ii}));var r={};e.r(r),e.d(r,"Plugin",(function(){return O}));var o={};e.r(o),e.d(o,"create",(function(){return K})),e.d(o,"fromMat4",(function(){return tt})),e.d(o,"clone",(function(){return nt})),e.d(o,"copy",(function(){return et})),e.d(o,"fromValues",(function(){return rt})),e.d(o,"set",(function(){return ot})),e.d(o,"identity",(function(){return it})),e.d(o,"transpose",(function(){return at})),e.d(o,"invert",(function(){return ut})),e.d(o,"adjoint",(function(){return ct})),e.d(o,"determinant",(function(){return st})),e.d(o,"multiply",(function(){return ft})),e.d(o,"translate",(function(){return ht})),e.d(o,"rotate",(function(){return lt})),e.d(o,"scale",(function(){return dt})),e.d(o,"fromTranslation",(function(){return pt})),e.d(o,"fromRotation",(function(){return vt})),e.d(o,"fromScaling",(function(){return yt})),e.d(o,"fromMat2d",(function(){return mt})),e.d(o,"fromQuat",(function(){return gt})),e.d(o,"normalFromMat4",(function(){return Mt})),e.d(o,"projection",(function(){return bt})),e.d(o,"str",(function(){return xt})),e.d(o,"frob",(function(){return Pt})),e.d(o,"add",(function(){return Et})),e.d(o,"subtract",(function(){return Ot})),e.d(o,"multiplyScalar",(function(){return St})),e.d(o,"multiplyScalarAndAdd",(function(){return Ct})),e.d(o,"exactEquals",(function(){return At})),e.d(o,"equals",(function(){return jt})),e.d(o,"mul",(function(){return wt})),e.d(o,"sub",(function(){return Rt}));var i={};e.r(i),e.d(i,"create",(function(){return Bt})),e.d(i,"clone",(function(){return Tt})),e.d(i,"copy",(function(){return kt})),e.d(i,"fromValues",(function(){return Lt})),e.d(i,"set",(function(){return Dt})),e.d(i,"identity",(function(){return It})),e.d(i,"transpose",(function(){return _t})),e.d(i,"invert",(function(){return Yt})),e.d(i,"adjoint",(function(){return Nt})),e.d(i,"determinant",(function(){return qt})),e.d(i,"multiply",(function(){return Xt})),e.d(i,"translate",(function(){return Ht})),e.d(i,"scale",(function(){return Ft})),e.d(i,"rotate",(function(){return Gt})),e.d(i,"rotateX",(function(){return $t})),e.d(i,"rotateY",(function(){return Vt})),e.d(i,"rotateZ",(function(){return Ut})),e.d(i,"fromTranslation",(function(){return Wt})),e.d(i,"fromScaling",(function(){return zt})),e.d(i,"fromRotation",(function(){return Qt})),e.d(i,"fromXRotation",(function(){return Zt})),e.d(i,"fromYRotation",(function(){return Jt})),e.d(i,"fromZRotation",(function(){return Kt})),e.d(i,"fromRotationTranslation",(function(){return tn})),e.d(i,"fromQuat2",(function(){return nn})),e.d(i,"getTranslation",(function(){return en})),e.d(i,"getScaling",(function(){return rn})),e.d(i,"getRotation",(function(){return on})),e.d(i,"fromRotationTranslationScale",(function(){return an})),e.d(i,"fromRotationTranslationScaleOrigin",(function(){return un})),e.d(i,"fromQuat",(function(){return cn})),e.d(i,"frustum",(function(){return sn})),e.d(i,"perspectiveNO",(function(){return fn})),e.d(i,"perspective",(function(){return hn})),e.d(i,"perspectiveZO",(function(){return ln})),e.d(i,"perspectiveFromFieldOfView",(function(){return dn})),e.d(i,"orthoNO",(function(){return pn})),e.d(i,"ortho",(function(){return vn})),e.d(i,"orthoZO",(function(){return yn})),e.d(i,"lookAt",(function(){return mn})),e.d(i,"targetTo",(function(){return gn})),e.d(i,"str",(function(){return Mn})),e.d(i,"frob",(function(){return bn})),e.d(i,"add",(function(){return xn})),e.d(i,"subtract",(function(){return Pn})),e.d(i,"multiplyScalar",(function(){return En})),e.d(i,"multiplyScalarAndAdd",(function(){return On})),e.d(i,"exactEquals",(function(){return Sn})),e.d(i,"equals",(function(){return Cn})),e.d(i,"mul",(function(){return An})),e.d(i,"sub",(function(){return jn}));var a={};e.r(a),e.d(a,"create",(function(){return wn})),e.d(a,"clone",(function(){return Rn})),e.d(a,"length",(function(){return Bn})),e.d(a,"fromValues",(function(){return Tn})),e.d(a,"copy",(function(){return kn})),e.d(a,"set",(function(){return Ln})),e.d(a,"add",(function(){return Dn})),e.d(a,"subtract",(function(){return In})),e.d(a,"multiply",(function(){return _n})),e.d(a,"divide",(function(){return Yn})),e.d(a,"ceil",(function(){return Nn})),e.d(a,"floor",(function(){return qn})),e.d(a,"min",(function(){return Xn})),e.d(a,"max",(function(){return Hn})),e.d(a,"round",(function(){return Fn})),e.d(a,"scale",(function(){return Gn})),e.d(a,"scaleAndAdd",(function(){return $n})),e.d(a,"distance",(function(){return Vn})),e.d(a,"squaredDistance",(function(){return Un})),e.d(a,"squaredLength",(function(){return Wn})),e.d(a,"negate",(function(){return zn})),e.d(a,"inverse",(function(){return Qn})),e.d(a,"normalize",(function(){return Zn})),e.d(a,"dot",(function(){return Jn})),e.d(a,"cross",(function(){return Kn})),e.d(a,"lerp",(function(){return te})),e.d(a,"hermite",(function(){return ne})),e.d(a,"bezier",(function(){return ee})),e.d(a,"random",(function(){return re})),e.d(a,"transformMat4",(function(){return oe})),e.d(a,"transformMat3",(function(){return ie})),e.d(a,"transformQuat",(function(){return ae})),e.d(a,"rotateX",(function(){return ue})),e.d(a,"rotateY",(function(){return ce})),e.d(a,"rotateZ",(function(){return se})),e.d(a,"angle",(function(){return fe})),e.d(a,"zero",(function(){return he})),e.d(a,"str",(function(){return le})),e.d(a,"exactEquals",(function(){return de})),e.d(a,"equals",(function(){return pe})),e.d(a,"sub",(function(){return ye})),e.d(a,"mul",(function(){return me})),e.d(a,"div",(function(){return ge})),e.d(a,"dist",(function(){return Me})),e.d(a,"sqrDist",(function(){return be})),e.d(a,"len",(function(){return xe})),e.d(a,"sqrLen",(function(){return Pe})),e.d(a,"forEach",(function(){return Ee}));var u={};e.r(u),e.d(u,"create",(function(){return Ce})),e.d(u,"identity",(function(){return Ae})),e.d(u,"setAxisAngle",(function(){return je})),e.d(u,"getAxisAngle",(function(){return we})),e.d(u,"getAngle",(function(){return Re})),e.d(u,"multiply",(function(){return Be})),e.d(u,"rotateX",(function(){return Te})),e.d(u,"rotateY",(function(){return ke})),e.d(u,"rotateZ",(function(){return Le})),e.d(u,"calculateW",(function(){return De})),e.d(u,"exp",(function(){return Ie})),e.d(u,"ln",(function(){return _e})),e.d(u,"pow",(function(){return Ye})),e.d(u,"slerp",(function(){return Ne})),e.d(u,"random",(function(){return qe})),e.d(u,"invert",(function(){return Xe})),e.d(u,"conjugate",(function(){return He})),e.d(u,"fromMat3",(function(){return Fe})),e.d(u,"fromEuler",(function(){return Ge})),e.d(u,"str",(function(){return $e})),e.d(u,"clone",(function(){return Je})),e.d(u,"fromValues",(function(){return Ke})),e.d(u,"copy",(function(){return tr})),e.d(u,"set",(function(){return nr})),e.d(u,"add",(function(){return er})),e.d(u,"mul",(function(){return rr})),e.d(u,"scale",(function(){return or})),e.d(u,"dot",(function(){return ir})),e.d(u,"lerp",(function(){return ar})),e.d(u,"length",(function(){return ur})),e.d(u,"len",(function(){return cr})),e.d(u,"squaredLength",(function(){return sr})),e.d(u,"sqrLen",(function(){return fr})),e.d(u,"normalize",(function(){return hr})),e.d(u,"exactEquals",(function(){return lr})),e.d(u,"equals",(function(){return dr})),e.d(u,"rotationTo",(function(){return pr})),e.d(u,"sqlerp",(function(){return vr})),e.d(u,"setAxes",(function(){return yr}));var c={};e.r(c),e.d(c,"create",(function(){return mr})),e.d(c,"clone",(function(){return gr})),e.d(c,"fromValues",(function(){return Mr})),e.d(c,"copy",(function(){return br})),e.d(c,"set",(function(){return xr})),e.d(c,"add",(function(){return Pr})),e.d(c,"subtract",(function(){return Er})),e.d(c,"multiply",(function(){return Or})),e.d(c,"divide",(function(){return Sr})),e.d(c,"ceil",(function(){return Cr})),e.d(c,"floor",(function(){return Ar})),e.d(c,"min",(function(){return jr})),e.d(c,"max",(function(){return wr})),e.d(c,"round",(function(){return Rr})),e.d(c,"scale",(function(){return Br})),e.d(c,"scaleAndAdd",(function(){return Tr})),e.d(c,"distance",(function(){return kr})),e.d(c,"squaredDistance",(function(){return Lr})),e.d(c,"length",(function(){return Dr})),e.d(c,"squaredLength",(function(){return Ir})),e.d(c,"negate",(function(){return _r})),e.d(c,"inverse",(function(){return Yr})),e.d(c,"normalize",(function(){return Nr})),e.d(c,"dot",(function(){return qr})),e.d(c,"cross",(function(){return Xr})),e.d(c,"lerp",(function(){return Hr})),e.d(c,"random",(function(){return Fr})),e.d(c,"transformMat2",(function(){return Gr})),e.d(c,"transformMat2d",(function(){return $r})),e.d(c,"transformMat3",(function(){return Vr})),e.d(c,"transformMat4",(function(){return Ur})),e.d(c,"rotate",(function(){return Wr})),e.d(c,"angle",(function(){return zr})),e.d(c,"zero",(function(){return Qr})),e.d(c,"str",(function(){return Zr})),e.d(c,"exactEquals",(function(){return Jr})),e.d(c,"equals",(function(){return Kr})),e.d(c,"len",(function(){return to})),e.d(c,"sub",(function(){return no})),e.d(c,"mul",(function(){return eo})),e.d(c,"div",(function(){return ro})),e.d(c,"dist",(function(){return oo})),e.d(c,"sqrDist",(function(){return io})),e.d(c,"sqrLen",(function(){return ao})),e.d(c,"forEach",(function(){return uo}));var s={};e.r(s),e.d(s,"PathGeneratorFactory",(function(){return W})),e.d(s,"PathGenerator",(function(){return z})),e.d(s,"StyleRenderer",(function(){return j})),e.d(s,"RBushNode",(function(){return co})),e.d(s,"RBushRoot",(function(){return so})),e.d(s,"RBush",(function(){return C.a})),e.d(s,"Plugin",(function(){return po}));var f={};e.r(f),e.d(f,"Plugin",(function(){return Zo}));var h={};e.r(h),e.d(h,"Plugin",(function(){return ti}));
1
+ !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.Canvas2D=n(require("@antv/g"),require("mana-syringe")):(t.G=t.G||{},t.G.Canvas2D=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 o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.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 o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));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=6)}([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,o,a,i){!function t(e,r,o,a,i){for(;a>o;){if(a-o>600){var u=a-o+1,c=r-o+1,s=Math.log(u),f=.5*Math.exp(2*s/3),h=.5*Math.sqrt(s*f*(u-f)/u)*(c-u/2<0?-1:1);t(e,r,Math.max(o,Math.floor(r-c*f/u+h)),Math.min(a,Math.floor(r+(u-c)*f/u+h)),i)}var l=e[r],d=o,p=a;for(n(e,o,r),i(e[a],l)>0&&n(e,o,a);d<p;){for(n(e,d,p),d++,p--;i(e[d],l)<0;)d++;for(;i(e[p],l)>0;)p--}0===i(e[o],l)?n(e,o,p):n(e,++p,a),p<=r&&(o=p+1),r<=p&&(a=p-1)}}(t,r,o||0,a||t.length-1,i||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 o(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 a(t,n){i(t,0,t.children.length,n,t)}function i(t,n,e,r,o){o||(o=p(null)),o.minX=1/0,o.minY=1/0,o.maxX=-1/0,o.maxY=-1/0;for(var a=n;a<e;a++){var i=t.children[a];u(o,t.leaf?r(i):i)}return o}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 f(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function h(t){return t.maxX-t.minX+(t.maxY-t.minY)}function l(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,o,a){for(var i=[e,r];i.length;)if(!((r=i.pop())-(e=i.pop())<=o)){var u=e+Math.ceil((r-e)/o/2)*o;t(n,u,e,r,a),i.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,o=[];n;){for(var a=0;a<n.children.length;a++){var i=n.children[a],u=n.leaf?r(i):i;d(t,u)&&(n.leaf?e.push(i):l(t,u)?this._all(i,e):o.push(i))}n=o.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 o=n.children[r],a=n.leaf?this.toBBox(o):o;if(d(t,a)){if(n.leaf||l(t,a))return!0;e.push(o)}}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,a,i=this.data,u=this.toBBox(t),c=[],s=[];i||c.length;){if(i||(i=c.pop(),r=c[c.length-1],e=s.pop(),a=!0),i.leaf){var f=o(t,i.children,n);if(-1!==f)return i.children.splice(f,1),c.push(i),this._condense(c),this}a||i.leaf||!l(i,u)?r?(e++,i=r.children[e],a=!1):i=null:(c.push(i),s.push(e),e=0,r=i,i=i.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 o,i=e-n+1,u=this._maxEntries;if(i<=u)return a(o=p(t.slice(n,e+1)),this.toBBox),o;r||(r=Math.ceil(Math.log(i)/Math.log(u)),u=Math.ceil(i/Math.pow(u,r-1))),(o=p([])).leaf=!1,o.height=r;var c=Math.ceil(i/u),s=c*Math.ceil(Math.sqrt(u));v(t,n,e,s,this.compareMinX);for(var f=n;f<=e;f+=s){var h=Math.min(f+s-1,e);v(t,f,h,c,this.compareMinY);for(var l=f;l<=h;l+=c){var d=Math.min(l+c-1,h);o.children.push(this._build(t,l,d,r-1))}}return a(o,this.toBBox),o},r.prototype._chooseSubtree=function(t,n,e,r){for(;r.push(n),!n.leaf&&r.length-1!==e;){for(var o=1/0,a=1/0,i=void 0,u=0;u<n.children.length;u++){var c=n.children[u],s=f(c),h=(l=t,d=c,(Math.max(d.maxX,l.maxX)-Math.min(d.minX,l.minX))*(Math.max(d.maxY,l.maxY)-Math.min(d.minY,l.minY))-s);h<a?(a=h,o=s<o?s:o,i=c):h===a&&s<o&&(o=s,i=c)}n=i||n.children[0]}var l,d;return n},r.prototype._insert=function(t,n,e){var r=e?t:this.toBBox(t),o=[],a=this._chooseSubtree(r,this.data,n,o);for(a.children.push(t),u(a,r);n>=0&&o[n].children.length>this._maxEntries;)this._split(o,n),n--;this._adjustParentBBoxes(r,o,n)},r.prototype._split=function(t,n){var e=t[n],r=e.children.length,o=this._minEntries;this._chooseSplitAxis(e,o,r);var i=this._chooseSplitIndex(e,o,r),u=p(e.children.splice(i,e.children.length-i));u.height=e.height,u.leaf=e.leaf,a(e,this.toBBox),a(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,a(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,n,e){for(var r,o,a,u,c,s,h,l=1/0,d=1/0,p=n;p<=e-n;p++){var v=i(t,0,p,this.toBBox),y=i(t,p,e,this.toBBox),m=(o=v,a=y,u=Math.max(o.minX,a.minX),c=Math.max(o.minY,a.minY),s=Math.min(o.maxX,a.maxX),h=Math.min(o.maxY,a.maxY),Math.max(0,s-u)*Math.max(0,h-c)),g=f(v)+f(y);m<l?(l=m,r=p,d=g<d?g:d):m===l&&g<d&&(d=g,r=p)}return r||e-n},r.prototype._chooseSplitAxis=function(t,n,e){var r=t.leaf?this.compareMinX:c,o=t.leaf?this.compareMinY:s;this._allDistMargin(t,n,e,r)<this._allDistMargin(t,n,e,o)&&t.children.sort(r)},r.prototype._allDistMargin=function(t,n,e,r){t.children.sort(r);for(var o=this.toBBox,a=i(t,0,n,o),c=i(t,e-n,e,o),s=h(a)+h(c),f=n;f<e-n;f++){var l=t.children[f];u(a,t.leaf?o(l):l),s+=h(a)}for(var d=e-n-1;d>=n;d--){var p=t.children[d];u(c,t.leaf?o(p):p),s+=h(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():a(t[n],this.toBBox)},r}()},,,,function(t,n,e){"use strict";e.r(n),e.d(n,"DomInteraction",(function(){return r})),e.d(n,"CanvasRenderer",(function(){return s})),e.d(n,"CanvasPicker",(function(){return f})),e.d(n,"HTMLRenderer",(function(){return h})),e.d(n,"Renderer",(function(){return ra}));var r={};e.r(r),e.d(r,"Plugin",(function(){return P}));var o={};e.r(o),e.d(o,"create",(function(){return Z})),e.d(o,"fromMat4",(function(){return J})),e.d(o,"clone",(function(){return K})),e.d(o,"copy",(function(){return tt})),e.d(o,"fromValues",(function(){return nt})),e.d(o,"set",(function(){return et})),e.d(o,"identity",(function(){return rt})),e.d(o,"transpose",(function(){return ot})),e.d(o,"invert",(function(){return at})),e.d(o,"adjoint",(function(){return it})),e.d(o,"determinant",(function(){return ut})),e.d(o,"multiply",(function(){return ct})),e.d(o,"translate",(function(){return st})),e.d(o,"rotate",(function(){return ft})),e.d(o,"scale",(function(){return ht})),e.d(o,"fromTranslation",(function(){return lt})),e.d(o,"fromRotation",(function(){return dt})),e.d(o,"fromScaling",(function(){return pt})),e.d(o,"fromMat2d",(function(){return vt})),e.d(o,"fromQuat",(function(){return yt})),e.d(o,"normalFromMat4",(function(){return mt})),e.d(o,"projection",(function(){return gt})),e.d(o,"str",(function(){return Mt})),e.d(o,"frob",(function(){return bt})),e.d(o,"add",(function(){return xt})),e.d(o,"subtract",(function(){return Pt})),e.d(o,"multiplyScalar",(function(){return Ot})),e.d(o,"multiplyScalarAndAdd",(function(){return Et})),e.d(o,"exactEquals",(function(){return St})),e.d(o,"equals",(function(){return Ct})),e.d(o,"mul",(function(){return At})),e.d(o,"sub",(function(){return jt}));var a={};e.r(a),e.d(a,"create",(function(){return Tt})),e.d(a,"clone",(function(){return Bt})),e.d(a,"copy",(function(){return Rt})),e.d(a,"fromValues",(function(){return wt})),e.d(a,"set",(function(){return Lt})),e.d(a,"identity",(function(){return kt})),e.d(a,"transpose",(function(){return It})),e.d(a,"invert",(function(){return Dt})),e.d(a,"adjoint",(function(){return Yt})),e.d(a,"determinant",(function(){return Nt})),e.d(a,"multiply",(function(){return _t})),e.d(a,"translate",(function(){return Xt})),e.d(a,"scale",(function(){return qt})),e.d(a,"rotate",(function(){return Ft})),e.d(a,"rotateX",(function(){return Gt})),e.d(a,"rotateY",(function(){return $t})),e.d(a,"rotateZ",(function(){return Ht})),e.d(a,"fromTranslation",(function(){return Vt})),e.d(a,"fromScaling",(function(){return Ut})),e.d(a,"fromRotation",(function(){return Wt})),e.d(a,"fromXRotation",(function(){return zt})),e.d(a,"fromYRotation",(function(){return Qt})),e.d(a,"fromZRotation",(function(){return Zt})),e.d(a,"fromRotationTranslation",(function(){return Jt})),e.d(a,"fromQuat2",(function(){return Kt})),e.d(a,"getTranslation",(function(){return tn})),e.d(a,"getScaling",(function(){return nn})),e.d(a,"getRotation",(function(){return en})),e.d(a,"fromRotationTranslationScale",(function(){return rn})),e.d(a,"fromRotationTranslationScaleOrigin",(function(){return on})),e.d(a,"fromQuat",(function(){return an})),e.d(a,"frustum",(function(){return un})),e.d(a,"perspectiveNO",(function(){return cn})),e.d(a,"perspective",(function(){return sn})),e.d(a,"perspectiveZO",(function(){return fn})),e.d(a,"perspectiveFromFieldOfView",(function(){return hn})),e.d(a,"orthoNO",(function(){return ln})),e.d(a,"ortho",(function(){return dn})),e.d(a,"orthoZO",(function(){return pn})),e.d(a,"lookAt",(function(){return vn})),e.d(a,"targetTo",(function(){return yn})),e.d(a,"str",(function(){return mn})),e.d(a,"frob",(function(){return gn})),e.d(a,"add",(function(){return Mn})),e.d(a,"subtract",(function(){return bn})),e.d(a,"multiplyScalar",(function(){return xn})),e.d(a,"multiplyScalarAndAdd",(function(){return Pn})),e.d(a,"exactEquals",(function(){return On})),e.d(a,"equals",(function(){return En})),e.d(a,"mul",(function(){return Sn})),e.d(a,"sub",(function(){return Cn}));var i={};e.r(i),e.d(i,"create",(function(){return An})),e.d(i,"clone",(function(){return jn})),e.d(i,"length",(function(){return Tn})),e.d(i,"fromValues",(function(){return Bn})),e.d(i,"copy",(function(){return Rn})),e.d(i,"set",(function(){return wn})),e.d(i,"add",(function(){return Ln})),e.d(i,"subtract",(function(){return kn})),e.d(i,"multiply",(function(){return In})),e.d(i,"divide",(function(){return Dn})),e.d(i,"ceil",(function(){return Yn})),e.d(i,"floor",(function(){return Nn})),e.d(i,"min",(function(){return _n})),e.d(i,"max",(function(){return Xn})),e.d(i,"round",(function(){return qn})),e.d(i,"scale",(function(){return Fn})),e.d(i,"scaleAndAdd",(function(){return Gn})),e.d(i,"distance",(function(){return $n})),e.d(i,"squaredDistance",(function(){return Hn})),e.d(i,"squaredLength",(function(){return Vn})),e.d(i,"negate",(function(){return Un})),e.d(i,"inverse",(function(){return Wn})),e.d(i,"normalize",(function(){return zn})),e.d(i,"dot",(function(){return Qn})),e.d(i,"cross",(function(){return Zn})),e.d(i,"lerp",(function(){return Jn})),e.d(i,"hermite",(function(){return Kn})),e.d(i,"bezier",(function(){return te})),e.d(i,"random",(function(){return ne})),e.d(i,"transformMat4",(function(){return ee})),e.d(i,"transformMat3",(function(){return re})),e.d(i,"transformQuat",(function(){return oe})),e.d(i,"rotateX",(function(){return ae})),e.d(i,"rotateY",(function(){return ie})),e.d(i,"rotateZ",(function(){return ue})),e.d(i,"angle",(function(){return ce})),e.d(i,"zero",(function(){return se})),e.d(i,"str",(function(){return fe})),e.d(i,"exactEquals",(function(){return he})),e.d(i,"equals",(function(){return le})),e.d(i,"sub",(function(){return pe})),e.d(i,"mul",(function(){return ve})),e.d(i,"div",(function(){return ye})),e.d(i,"dist",(function(){return me})),e.d(i,"sqrDist",(function(){return ge})),e.d(i,"len",(function(){return Me})),e.d(i,"sqrLen",(function(){return be})),e.d(i,"forEach",(function(){return xe}));var u={};e.r(u),e.d(u,"create",(function(){return Ee})),e.d(u,"identity",(function(){return Se})),e.d(u,"setAxisAngle",(function(){return Ce})),e.d(u,"getAxisAngle",(function(){return Ae})),e.d(u,"getAngle",(function(){return je})),e.d(u,"multiply",(function(){return Te})),e.d(u,"rotateX",(function(){return Be})),e.d(u,"rotateY",(function(){return Re})),e.d(u,"rotateZ",(function(){return we})),e.d(u,"calculateW",(function(){return Le})),e.d(u,"exp",(function(){return ke})),e.d(u,"ln",(function(){return Ie})),e.d(u,"pow",(function(){return De})),e.d(u,"slerp",(function(){return Ye})),e.d(u,"random",(function(){return Ne})),e.d(u,"invert",(function(){return _e})),e.d(u,"conjugate",(function(){return Xe})),e.d(u,"fromMat3",(function(){return qe})),e.d(u,"fromEuler",(function(){return Fe})),e.d(u,"str",(function(){return Ge})),e.d(u,"clone",(function(){return Qe})),e.d(u,"fromValues",(function(){return Ze})),e.d(u,"copy",(function(){return Je})),e.d(u,"set",(function(){return Ke})),e.d(u,"add",(function(){return tr})),e.d(u,"mul",(function(){return nr})),e.d(u,"scale",(function(){return er})),e.d(u,"dot",(function(){return rr})),e.d(u,"lerp",(function(){return or})),e.d(u,"length",(function(){return ar})),e.d(u,"len",(function(){return ir})),e.d(u,"squaredLength",(function(){return ur})),e.d(u,"sqrLen",(function(){return cr})),e.d(u,"normalize",(function(){return sr})),e.d(u,"exactEquals",(function(){return fr})),e.d(u,"equals",(function(){return hr})),e.d(u,"rotationTo",(function(){return lr})),e.d(u,"sqlerp",(function(){return dr})),e.d(u,"setAxes",(function(){return pr}));var c={};e.r(c),e.d(c,"create",(function(){return vr})),e.d(c,"clone",(function(){return yr})),e.d(c,"fromValues",(function(){return mr})),e.d(c,"copy",(function(){return gr})),e.d(c,"set",(function(){return Mr})),e.d(c,"add",(function(){return br})),e.d(c,"subtract",(function(){return xr})),e.d(c,"multiply",(function(){return Pr})),e.d(c,"divide",(function(){return Or})),e.d(c,"ceil",(function(){return Er})),e.d(c,"floor",(function(){return Sr})),e.d(c,"min",(function(){return Cr})),e.d(c,"max",(function(){return Ar})),e.d(c,"round",(function(){return jr})),e.d(c,"scale",(function(){return Tr})),e.d(c,"scaleAndAdd",(function(){return Br})),e.d(c,"distance",(function(){return Rr})),e.d(c,"squaredDistance",(function(){return wr})),e.d(c,"length",(function(){return Lr})),e.d(c,"squaredLength",(function(){return kr})),e.d(c,"negate",(function(){return Ir})),e.d(c,"inverse",(function(){return Dr})),e.d(c,"normalize",(function(){return Yr})),e.d(c,"dot",(function(){return Nr})),e.d(c,"cross",(function(){return _r})),e.d(c,"lerp",(function(){return Xr})),e.d(c,"random",(function(){return qr})),e.d(c,"transformMat2",(function(){return Fr})),e.d(c,"transformMat2d",(function(){return Gr})),e.d(c,"transformMat3",(function(){return $r})),e.d(c,"transformMat4",(function(){return Hr})),e.d(c,"rotate",(function(){return Vr})),e.d(c,"angle",(function(){return Ur})),e.d(c,"zero",(function(){return Wr})),e.d(c,"str",(function(){return zr})),e.d(c,"exactEquals",(function(){return Qr})),e.d(c,"equals",(function(){return Zr})),e.d(c,"len",(function(){return Jr})),e.d(c,"sub",(function(){return Kr})),e.d(c,"mul",(function(){return to})),e.d(c,"div",(function(){return no})),e.d(c,"dist",(function(){return eo})),e.d(c,"sqrDist",(function(){return ro})),e.d(c,"sqrLen",(function(){return oo})),e.d(c,"forEach",(function(){return ao}));var s={};e.r(s),e.d(s,"PathGeneratorFactory",(function(){return V})),e.d(s,"PathGenerator",(function(){return U})),e.d(s,"StyleRenderer",(function(){return C})),e.d(s,"RBushNode",(function(){return io})),e.d(s,"RBushRoot",(function(){return uo})),e.d(s,"RBush",(function(){return E.a})),e.d(s,"Plugin",(function(){return ho}));var f={};e.r(f),e.d(f,"Plugin",(function(){return zo}));var h={};e.r(h),e.d(h,"Plugin",(function(){return Jo}));
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -13,4 +13,4 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
15
  ***************************************************************************** */
16
- var l=function(t,n){return(l=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)};var d=function(){return(d=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)};function p(t,n,e,r){var o,i=arguments.length,a=i<3?n:null===r?r=Object.getOwnPropertyDescriptor(n,e):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,n,e,r);else for(var u=t.length-1;u>=0;u--)(o=t[u])&&(a=(i<3?o(a):i>3?o(n,e,a):o(n,e))||a);return i>3&&a&&Object.defineProperty(n,e,a),a}function v(t,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,n)}Object.create;function y(t,n){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var r,o,i=e.call(t),a=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return a}function m(t,n,e){if(e||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return t.concat(r||Array.prototype.slice.call(n))}Object.create;var g=e(0),M=e(1),b="ontouchstart"in self,x=!!self.PointerEvent;var P=function(){function t(){}var n;return n=t,t.prototype.apply=function(t){var e=this,r=function(n){t.hooks.pointerMove.call(n)},o=function(n){t.hooks.pointerUp.call(n)},i=function(n){t.hooks.pointerDown.call(n)},a=function(n){t.hooks.pointerOver.call(n)},u=function(n){t.hooks.pointerOut.call(n)},c=function(n){t.hooks.pointerWheel.call(n)};t.hooks.init.tap(n.tag,(function(){var t=e.contextService.getDomElement();x?(self.document.addEventListener("pointermove",r,!0),t.addEventListener("pointerdown",i,!0),t.addEventListener("pointerleave",u,!0),t.addEventListener("pointerover",a,!0),self.addEventListener("pointerup",o,!0)):(self.document.addEventListener("mousemove",r,!0),t.addEventListener("mousedown",i,!0),t.addEventListener("mouseout",u,!0),t.addEventListener("mouseover",a,!0),self.addEventListener("mouseup",o,!0)),b&&(t.addEventListener("touchstart",i,!0),t.addEventListener("touchend",o,!0),t.addEventListener("touchmove",r,!0)),t.addEventListener("wheel",c,{passive:!0,capture:!0})})),t.hooks.destroy.tap(n.tag,(function(){var t=e.contextService.getDomElement();x?(self.document.removeEventListener("pointermove",r,!0),t.removeEventListener("pointerdown",i,!0),t.removeEventListener("pointerleave",u,!0),t.removeEventListener("pointerover",a,!0),self.removeEventListener("pointerup",o,!0)):(self.document.removeEventListener("mousemove",r,!0),t.removeEventListener("mousedown",i,!0),t.removeEventListener("mouseout",u,!0),t.removeEventListener("mouseover",a,!0),self.removeEventListener("mouseup",o,!0)),b&&(t.removeEventListener("touchstart",i,!0),t.removeEventListener("touchend",o,!0),t.removeEventListener("touchmove",r,!0)),t.removeEventListener("wheel",c,!0)}))},t.tag="DOMInteractionPlugin",p([Object(M.inject)(g.ContextService),v("design:type",Object)],t.prototype,"contextService",void 0),t=n=p([Object(M.singleton)({contrib:g.RenderingPluginContribution})],t)}(),E=Object(M.Module)((function(t){t(P)})),O=function(){function t(){}return t.prototype.init=function(t){t.load(E,!0)},t.prototype.destroy=function(t){t.unload(E)},t}(),S=e(2),C=e.n(S),A=M.Syringe.defineToken("StyleRendererFactory"),j=M.Syringe.defineToken("StyleRenderer"),w={}.toString,R=function(t,n){return w.call(t)==="[object "+n+"]"},B=function(t){return R(t,"Function")},T=function(t){return null==t},k=function(t){return Array.isArray?Array.isArray(t):R(t,"Array")},L=function(t){var n=typeof t;return null!==t&&"object"===n||"function"===n};var D=function(t,n){if(t)if(k(t))for(var e=0,r=t.length;e<r&&!1!==n(t[e],e);e++);else if(L(t))for(var o in t)if(t.hasOwnProperty(o)&&!1===n(t[o],o))break};Object.keys;var I=function(t){if(k(t))return t.reduce((function(t,n){return Math.max(t,n)}),t[0])},_=function(t){if(k(t))return t.reduce((function(t,n){return Math.min(t,n)}),t[0])},Y=Array.prototype,N=(Y.splice,Y.indexOf,Array.prototype.splice,function(t){return R(t,"String")});Object.prototype.hasOwnProperty;var q=function(t){return R(t,"Number")};Number.isInteger&&Number.isInteger;Math.PI,parseInt,Math.PI;var X=Object.values?function(t){return Object.values(t)}:function(t){var n=[];return D(t,(function(e,r){B(t)&&"prototype"===r||n.push(e)})),n};Object.prototype;Object.prototype.hasOwnProperty;var H;Object.prototype.hasOwnProperty;(function(t,n){if(!B(t))throw new TypeError("Expected a function");var e=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];var i=n?n.apply(this,r):r[0],a=e.cache;if(a.has(i))return a.get(i);var u=t.apply(this,r);return a.set(i,u),u};e.cache=new Map})((function(t,n){void 0===n&&(n={});var e=n.fontSize,r=n.fontFamily,o=n.fontWeight,i=n.fontStyle,a=n.fontVariant;return H||(H=document.createElement("canvas").getContext("2d")),H.font=[i,a,o,e+"px",r].join(" "),H.measureText(N(t)?t:"").width}),(function(t,n){return void 0===n&&(n={}),function(){for(var t=0,n=0,e=arguments.length;n<e;n++)t+=arguments[n].length;var r=Array(t),o=0;for(n=0;n<e;n++)for(var i=arguments[n],a=0,u=i.length;a<u;a++,o++)r[o]=i[a];return r}([t],X(n)).join("")})),function(){function t(){this.map={}}t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,n){var e=this.map[t];return void 0===e?n:e},t.prototype.set=function(t,n){this.map[t]=n},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length}}();var F=function(){function t(){}return t.prototype.hash=function(t){t.fill,t.opacity,t.fillOpacity,t.stroke,t.strokeOpacity,t.lineWidth,t.lineCap,t.lineJoin;return""},t.prototype.render=function(t,n){var e=n.fill,r=n.opacity,o=n.fillOpacity,i=n.stroke,a=n.strokeOpacity,u=n.lineWidth,c=n.lineCap,s=n.lineJoin,f=n.shadowColor,h=n.filter;if(T(e)||(T(o)||1===o?t.fill():(t.globalAlpha=o,t.fill(),t.globalAlpha=r)),!T(i)&&u&&u>0){!T(a)&&1!==a&&(t.globalAlpha=a),t.lineWidth=u,T(c)||(t.lineCap=c),T(s)||(t.lineJoin=s);var l=void 0,d=void 0,p=void 0,v=!T(f),y=!T(h);v&&(l=t.shadowBlur,d=t.shadowColor,T(l)||(t.shadowColor="transparent",t.shadowBlur=0)),y&&(p=t.filter,!T(p)&&p.indexOf("drop-shadow")>-1&&(t.filter=p.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")),t.stroke(),v&&(t.shadowColor=d,t.shadowBlur=l),y&&(t.filter=p)}},t=p([Object(M.singleton)({token:[{token:j,named:g.SHAPE.Circle},{token:j,named:g.SHAPE.Ellipse},{token:j,named:g.SHAPE.Rect},{token:j,named:g.SHAPE.Line},{token:j,named:g.SHAPE.Polyline},{token:j,named:g.SHAPE.Polygon},{token:j,named:g.SHAPE.Path}]})],t)}(),G=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;return this.imageCache[t]?Promise.resolve(this.imageCache[t]):new Promise((function(e,r){var o=new window.Image;o.onload=function(){e(o)},o.onerror=function(t){r(t)},o.crossOrigin="Anonymous",o.src=t,n.imageCache[t]=o}))},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 o=e.generatePatternKey(t),i=n.createPattern(r,t.repetition);return i&&(e.patternCache[o]=i),e.patternCache[o]}))},t.prototype.generatePatternKey=function(t){return"pattern-"+t.src+"-"+t.repetition},t=p([Object(M.singleton)()],t)}(),$=function(){function t(){}return t.prototype.hash=function(t){return""},t.prototype.render=function(t,n){var e,r=n.widthInPixels,o=n.heightInPixels,i=n.img,a=r,u=o;N(i)?e=this.imagePool.getImageSync(i):(a||(a=i.width),u||(u=i.height),e=i),t.drawImage(e,0,0,a,u)},p([Object(M.inject)(G),v("design:type",G)],t.prototype,"imagePool",void 0),t=p([Object(M.singleton)({token:{token:j,named:g.SHAPE.Image}})],t)}(),V=function(){function t(){}return t.prototype.hash=function(t){return""},t.prototype.render=function(t,n){n.text;var e=n.lineWidth,r=void 0===e?0:e,o=n.textAlign,i=n.textBaseline,a=n.lineJoin,u=n.miterLimit,c=void 0===u?0:u,s=n.letterSpacing,f=void 0===s?0:s,h=n.stroke,l=n.fill,d=n.fillOpacity,p=n.strokeOpacity,v=n.opacity,y=n.metrics,m=y.font,g=y.lines,M=y.height,b=y.lineHeight,x=y.lineMetrics;t.font=m,t.lineWidth=r,t.textAlign=o,t.textBaseline=i,t.lineJoin=a,t.miterLimit=c;var P=0;"middle"===i?P=-M/2-b/2:"bottom"===i||"alphabetic"===i||"ideographic"===i?P=-M:"top"!==i&&"hanging"!==i||(P=-b);for(var E=0;E<g.length;E++){var O=r/2;P+=b,!T(h)&&r&&this.drawLetterSpacing(t,g[E],x[E],o,O,P,f,d,p,v,!0),T(l)||this.drawLetterSpacing(t,g[E],x[E],o,O,P,f,d,p,v)}},t.prototype.drawLetterSpacing=function(t,n,e,r,o,i,a,u,c,s,f){if(void 0===f&&(f=!1),0!==a){var h=t.textAlign;t.textAlign="left";var l=o;"center"===r?l=o-e.width/2:"right"!==r&&"end"!==r||(l=o-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];f?this.strokeText(t,m,l,i,c):this.fillText(t,m,l,i,u,s),l+=p-(v=t.measureText(n.substring(y+1)).width)+a,p=v}t.textAlign=h}else f?this.strokeText(t,n,o,i,c):this.fillText(t,n,o,i,u,s)},t.prototype.fillText=function(t,n,e,r,o,i){var a,u=!T(o)&&1!==o;u&&(a=t.globalAlpha,t.globalAlpha=o*i),t.fillText(n,e,r),u&&(t.globalAlpha=a)},t.prototype.strokeText=function(t,n,e,r,o){var i,a=!T(o)&&1!==o;a&&(i=t.globalAlpha,t.globalAlpha=o),t.strokeText(n,e,r),a&&(t.globalAlpha=i)},p([Object(M.inject)(g.TextService),v("design:type",g.TextService)],t.prototype,"textService",void 0),t=p([Object(M.singleton)({token:{token:j,named:g.SHAPE.Text}})],t)}(),U=function(){function t(){this.gradientCache={}}return t.prototype.getOrCreateGradient=function(t,n){var e=this.generateCacheKey(t),r=t.type,o=t.x0,i=t.y0,a=t.x1,u=t.y1,c=t.steps,s=t.width,f=t.height;if(this.gradientCache[e])return this.gradientCache[e];var h=null;if(r===g.PARSED_COLOR_TYPE.LinearGradient)h=n.createLinearGradient(o*s,i*f,a*s,u*f);else if(r===g.PARSED_COLOR_TYPE.RadialGradient){var l=Math.sqrt(s*s+f*f)/2;h=n.createRadialGradient(o*s,i*f,0,a*s,u*f,t.r1*l)}return h&&(c.forEach((function(t){var n=y(t,2),e=n[0],r=n[1];null==h||h.addColorStop(Number(e),r)})),this.gradientCache[e]=h),this.gradientCache[e]},t.prototype.generateCacheKey=function(t){var n=t.type,e=t.x0,r=t.y0,o=t.x1,i=t.y1,a=t.r1,u=t.steps;return"gradient-"+n+"-"+e+"-"+r+"-"+o+"-"+i+"-"+(a||0)+"-"+t.width+"-"+t.height+"-"+u.map((function(t){return t.join("")})).join("-")},t=p([Object(M.singleton)()],t)}();var W="PathGeneratorFactory",z="PathGenerator",Q=1e-6,Z="undefined"!=typeof Float32Array?Float32Array:Array,J=Math.random;Math.PI;function K(){var t=new Z(9);return Z!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function tt(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[4],t[4]=n[5],t[5]=n[6],t[6]=n[8],t[7]=n[9],t[8]=n[10],t}function nt(t){var n=new Z(9);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}function et(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}function rt(t,n,e,r,o,i,a,u,c){var s=new Z(9);return s[0]=t,s[1]=n,s[2]=e,s[3]=r,s[4]=o,s[5]=i,s[6]=a,s[7]=u,s[8]=c,s}function ot(t,n,e,r,o,i,a,u,c,s){return t[0]=n,t[1]=e,t[2]=r,t[3]=o,t[4]=i,t[5]=a,t[6]=u,t[7]=c,t[8]=s,t}function it(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function at(t,n){if(t===n){var e=n[1],r=n[2],o=n[5];t[1]=n[3],t[2]=n[6],t[3]=e,t[5]=n[7],t[6]=r,t[7]=o}else t[0]=n[0],t[1]=n[3],t[2]=n[6],t[3]=n[1],t[4]=n[4],t[5]=n[7],t[6]=n[2],t[7]=n[5],t[8]=n[8];return t}function ut(t,n){var e=n[0],r=n[1],o=n[2],i=n[3],a=n[4],u=n[5],c=n[6],s=n[7],f=n[8],h=f*a-u*s,l=-f*i+u*c,d=s*i-a*c,p=e*h+r*l+o*d;return p?(p=1/p,t[0]=h*p,t[1]=(-f*r+o*s)*p,t[2]=(u*r-o*a)*p,t[3]=l*p,t[4]=(f*e-o*c)*p,t[5]=(-u*e+o*i)*p,t[6]=d*p,t[7]=(-s*e+r*c)*p,t[8]=(a*e-r*i)*p,t):null}function ct(t,n){var e=n[0],r=n[1],o=n[2],i=n[3],a=n[4],u=n[5],c=n[6],s=n[7],f=n[8];return t[0]=a*f-u*s,t[1]=o*s-r*f,t[2]=r*u-o*a,t[3]=u*c-i*f,t[4]=e*f-o*c,t[5]=o*i-e*u,t[6]=i*s-a*c,t[7]=r*c-e*s,t[8]=e*a-r*i,t}function st(t){var n=t[0],e=t[1],r=t[2],o=t[3],i=t[4],a=t[5],u=t[6],c=t[7],s=t[8];return n*(s*i-a*c)+e*(-s*o+a*u)+r*(c*o-i*u)}function ft(t,n,e){var r=n[0],o=n[1],i=n[2],a=n[3],u=n[4],c=n[5],s=n[6],f=n[7],h=n[8],l=e[0],d=e[1],p=e[2],v=e[3],y=e[4],m=e[5],g=e[6],M=e[7],b=e[8];return t[0]=l*r+d*a+p*s,t[1]=l*o+d*u+p*f,t[2]=l*i+d*c+p*h,t[3]=v*r+y*a+m*s,t[4]=v*o+y*u+m*f,t[5]=v*i+y*c+m*h,t[6]=g*r+M*a+b*s,t[7]=g*o+M*u+b*f,t[8]=g*i+M*c+b*h,t}function ht(t,n,e){var r=n[0],o=n[1],i=n[2],a=n[3],u=n[4],c=n[5],s=n[6],f=n[7],h=n[8],l=e[0],d=e[1];return t[0]=r,t[1]=o,t[2]=i,t[3]=a,t[4]=u,t[5]=c,t[6]=l*r+d*a+s,t[7]=l*o+d*u+f,t[8]=l*i+d*c+h,t}function lt(t,n,e){var r=n[0],o=n[1],i=n[2],a=n[3],u=n[4],c=n[5],s=n[6],f=n[7],h=n[8],l=Math.sin(e),d=Math.cos(e);return t[0]=d*r+l*a,t[1]=d*o+l*u,t[2]=d*i+l*c,t[3]=d*a-l*r,t[4]=d*u-l*o,t[5]=d*c-l*i,t[6]=s,t[7]=f,t[8]=h,t}function dt(t,n,e){var r=e[0],o=e[1];return t[0]=r*n[0],t[1]=r*n[1],t[2]=r*n[2],t[3]=o*n[3],t[4]=o*n[4],t[5]=o*n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t}function pt(t,n){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=n[0],t[7]=n[1],t[8]=1,t}function vt(t,n){var e=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1]=e,t[2]=0,t[3]=-e,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function yt(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=0,t[4]=n[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function mt(t,n){return t[0]=n[0],t[1]=n[1],t[2]=0,t[3]=n[2],t[4]=n[3],t[5]=0,t[6]=n[4],t[7]=n[5],t[8]=1,t}function gt(t,n){var e=n[0],r=n[1],o=n[2],i=n[3],a=e+e,u=r+r,c=o+o,s=e*a,f=r*a,h=r*u,l=o*a,d=o*u,p=o*c,v=i*a,y=i*u,m=i*c;return t[0]=1-h-p,t[3]=f-m,t[6]=l+y,t[1]=f+m,t[4]=1-s-p,t[7]=d-v,t[2]=l-y,t[5]=d+v,t[8]=1-s-h,t}function Mt(t,n){var e=n[0],r=n[1],o=n[2],i=n[3],a=n[4],u=n[5],c=n[6],s=n[7],f=n[8],h=n[9],l=n[10],d=n[11],p=n[12],v=n[13],y=n[14],m=n[15],g=e*u-r*a,M=e*c-o*a,b=e*s-i*a,x=r*c-o*u,P=r*s-i*u,E=o*s-i*c,O=f*v-h*p,S=f*y-l*p,C=f*m-d*p,A=h*y-l*v,j=h*m-d*v,w=l*m-d*y,R=g*w-M*j+b*A+x*C-P*S+E*O;return R?(R=1/R,t[0]=(u*w-c*j+s*A)*R,t[1]=(c*C-a*w-s*S)*R,t[2]=(a*j-u*C+s*O)*R,t[3]=(o*j-r*w-i*A)*R,t[4]=(e*w-o*C+i*S)*R,t[5]=(r*C-e*j-i*O)*R,t[6]=(v*E-y*P+m*x)*R,t[7]=(y*b-p*E-m*M)*R,t[8]=(p*P-v*b+m*g)*R,t):null}function bt(t,n,e){return t[0]=2/n,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/e,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function xt(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function Pt(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function Et(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}function Ot(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}function St(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}function Ct(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}function At(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]}function jt(t,n){var e=t[0],r=t[1],o=t[2],i=t[3],a=t[4],u=t[5],c=t[6],s=t[7],f=t[8],h=n[0],l=n[1],d=n[2],p=n[3],v=n[4],y=n[5],m=n[6],g=n[7],M=n[8];return Math.abs(e-h)<=Q*Math.max(1,Math.abs(e),Math.abs(h))&&Math.abs(r-l)<=Q*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(o-d)<=Q*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(i-p)<=Q*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(a-v)<=Q*Math.max(1,Math.abs(a),Math.abs(v))&&Math.abs(u-y)<=Q*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(c-m)<=Q*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(s-g)<=Q*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(f-M)<=Q*Math.max(1,Math.abs(f),Math.abs(M))}Math.hypot||(Math.hypot=function(){for(var t=0,n=arguments.length;n--;)t+=arguments[n]*arguments[n];return Math.sqrt(t)});var wt=ft,Rt=Ot;function Bt(){var t=new Z(16);return Z!=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 Tt(t){var n=new Z(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 kt(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 Lt(t,n,e,r,o,i,a,u,c,s,f,h,l,d,p,v){var y=new Z(16);return y[0]=t,y[1]=n,y[2]=e,y[3]=r,y[4]=o,y[5]=i,y[6]=a,y[7]=u,y[8]=c,y[9]=s,y[10]=f,y[11]=h,y[12]=l,y[13]=d,y[14]=p,y[15]=v,y}function Dt(t,n,e,r,o,i,a,u,c,s,f,h,l,d,p,v,y){return t[0]=n,t[1]=e,t[2]=r,t[3]=o,t[4]=i,t[5]=a,t[6]=u,t[7]=c,t[8]=s,t[9]=f,t[10]=h,t[11]=l,t[12]=d,t[13]=p,t[14]=v,t[15]=y,t}function It(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 _t(t,n){if(t===n){var e=n[1],r=n[2],o=n[3],i=n[6],a=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]=o,t[13]=a,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 Yt(t,n){var e=n[0],r=n[1],o=n[2],i=n[3],a=n[4],u=n[5],c=n[6],s=n[7],f=n[8],h=n[9],l=n[10],d=n[11],p=n[12],v=n[13],y=n[14],m=n[15],g=e*u-r*a,M=e*c-o*a,b=e*s-i*a,x=r*c-o*u,P=r*s-i*u,E=o*s-i*c,O=f*v-h*p,S=f*y-l*p,C=f*m-d*p,A=h*y-l*v,j=h*m-d*v,w=l*m-d*y,R=g*w-M*j+b*A+x*C-P*S+E*O;return R?(R=1/R,t[0]=(u*w-c*j+s*A)*R,t[1]=(o*j-r*w-i*A)*R,t[2]=(v*E-y*P+m*x)*R,t[3]=(l*P-h*E-d*x)*R,t[4]=(c*C-a*w-s*S)*R,t[5]=(e*w-o*C+i*S)*R,t[6]=(y*b-p*E-m*M)*R,t[7]=(f*E-l*b+d*M)*R,t[8]=(a*j-u*C+s*O)*R,t[9]=(r*C-e*j-i*O)*R,t[10]=(p*P-v*b+m*g)*R,t[11]=(h*b-f*P-d*g)*R,t[12]=(u*S-a*A-c*O)*R,t[13]=(e*A-r*S+o*O)*R,t[14]=(v*M-p*x-y*g)*R,t[15]=(f*x-h*M+l*g)*R,t):null}function Nt(t,n){var e=n[0],r=n[1],o=n[2],i=n[3],a=n[4],u=n[5],c=n[6],s=n[7],f=n[8],h=n[9],l=n[10],d=n[11],p=n[12],v=n[13],y=n[14],m=n[15];return t[0]=u*(l*m-d*y)-h*(c*m-s*y)+v*(c*d-s*l),t[1]=-(r*(l*m-d*y)-h*(o*m-i*y)+v*(o*d-i*l)),t[2]=r*(c*m-s*y)-u*(o*m-i*y)+v*(o*s-i*c),t[3]=-(r*(c*d-s*l)-u*(o*d-i*l)+h*(o*s-i*c)),t[4]=-(a*(l*m-d*y)-f*(c*m-s*y)+p*(c*d-s*l)),t[5]=e*(l*m-d*y)-f*(o*m-i*y)+p*(o*d-i*l),t[6]=-(e*(c*m-s*y)-a*(o*m-i*y)+p*(o*s-i*c)),t[7]=e*(c*d-s*l)-a*(o*d-i*l)+f*(o*s-i*c),t[8]=a*(h*m-d*v)-f*(u*m-s*v)+p*(u*d-s*h),t[9]=-(e*(h*m-d*v)-f*(r*m-i*v)+p*(r*d-i*h)),t[10]=e*(u*m-s*v)-a*(r*m-i*v)+p*(r*s-i*u),t[11]=-(e*(u*d-s*h)-a*(r*d-i*h)+f*(r*s-i*u)),t[12]=-(a*(h*y-l*v)-f*(u*y-c*v)+p*(u*l-c*h)),t[13]=e*(h*y-l*v)-f*(r*y-o*v)+p*(r*l-o*h),t[14]=-(e*(u*y-c*v)-a*(r*y-o*v)+p*(r*c-o*u)),t[15]=e*(u*l-c*h)-a*(r*l-o*h)+f*(r*c-o*u),t}function qt(t){var n=t[0],e=t[1],r=t[2],o=t[3],i=t[4],a=t[5],u=t[6],c=t[7],s=t[8],f=t[9],h=t[10],l=t[11],d=t[12],p=t[13],v=t[14],y=t[15];return(n*a-e*i)*(h*y-l*v)-(n*u-r*i)*(f*y-l*p)+(n*c-o*i)*(f*v-h*p)+(e*u-r*a)*(s*y-l*d)-(e*c-o*a)*(s*v-h*d)+(r*c-o*u)*(s*p-f*d)}function Xt(t,n,e){var r=n[0],o=n[1],i=n[2],a=n[3],u=n[4],c=n[5],s=n[6],f=n[7],h=n[8],l=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],P=e[3];return t[0]=M*r+b*u+x*h+P*v,t[1]=M*o+b*c+x*l+P*y,t[2]=M*i+b*s+x*d+P*m,t[3]=M*a+b*f+x*p+P*g,M=e[4],b=e[5],x=e[6],P=e[7],t[4]=M*r+b*u+x*h+P*v,t[5]=M*o+b*c+x*l+P*y,t[6]=M*i+b*s+x*d+P*m,t[7]=M*a+b*f+x*p+P*g,M=e[8],b=e[9],x=e[10],P=e[11],t[8]=M*r+b*u+x*h+P*v,t[9]=M*o+b*c+x*l+P*y,t[10]=M*i+b*s+x*d+P*m,t[11]=M*a+b*f+x*p+P*g,M=e[12],b=e[13],x=e[14],P=e[15],t[12]=M*r+b*u+x*h+P*v,t[13]=M*o+b*c+x*l+P*y,t[14]=M*i+b*s+x*d+P*m,t[15]=M*a+b*f+x*p+P*g,t}function Ht(t,n,e){var r,o,i,a,u,c,s,f,h,l,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],o=n[1],i=n[2],a=n[3],u=n[4],c=n[5],s=n[6],f=n[7],h=n[8],l=n[9],d=n[10],p=n[11],t[0]=r,t[1]=o,t[2]=i,t[3]=a,t[4]=u,t[5]=c,t[6]=s,t[7]=f,t[8]=h,t[9]=l,t[10]=d,t[11]=p,t[12]=r*v+u*y+h*m+n[12],t[13]=o*v+c*y+l*m+n[13],t[14]=i*v+s*y+d*m+n[14],t[15]=a*v+f*y+p*m+n[15]),t}function Ft(t,n,e){var r=e[0],o=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]*o,t[5]=n[5]*o,t[6]=n[6]*o,t[7]=n[7]*o,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 Gt(t,n,e,r){var o,i,a,u,c,s,f,h,l,d,p,v,y,m,g,M,b,x,P,E,O,S,C,A,j=r[0],w=r[1],R=r[2],B=Math.hypot(j,w,R);return B<Q?null:(j*=B=1/B,w*=B,R*=B,o=Math.sin(e),a=1-(i=Math.cos(e)),u=n[0],c=n[1],s=n[2],f=n[3],h=n[4],l=n[5],d=n[6],p=n[7],v=n[8],y=n[9],m=n[10],g=n[11],M=j*j*a+i,b=w*j*a+R*o,x=R*j*a-w*o,P=j*w*a-R*o,E=w*w*a+i,O=R*w*a+j*o,S=j*R*a+w*o,C=w*R*a-j*o,A=R*R*a+i,t[0]=u*M+h*b+v*x,t[1]=c*M+l*b+y*x,t[2]=s*M+d*b+m*x,t[3]=f*M+p*b+g*x,t[4]=u*P+h*E+v*O,t[5]=c*P+l*E+y*O,t[6]=s*P+d*E+m*O,t[7]=f*P+p*E+g*O,t[8]=u*S+h*C+v*A,t[9]=c*S+l*C+y*A,t[10]=s*S+d*C+m*A,t[11]=f*S+p*C+g*A,n!==t&&(t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t)}function $t(t,n,e){var r=Math.sin(e),o=Math.cos(e),i=n[4],a=n[5],u=n[6],c=n[7],s=n[8],f=n[9],h=n[10],l=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*o+s*r,t[5]=a*o+f*r,t[6]=u*o+h*r,t[7]=c*o+l*r,t[8]=s*o-i*r,t[9]=f*o-a*r,t[10]=h*o-u*r,t[11]=l*o-c*r,t}function Vt(t,n,e){var r=Math.sin(e),o=Math.cos(e),i=n[0],a=n[1],u=n[2],c=n[3],s=n[8],f=n[9],h=n[10],l=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*o-s*r,t[1]=a*o-f*r,t[2]=u*o-h*r,t[3]=c*o-l*r,t[8]=i*r+s*o,t[9]=a*r+f*o,t[10]=u*r+h*o,t[11]=c*r+l*o,t}function Ut(t,n,e){var r=Math.sin(e),o=Math.cos(e),i=n[0],a=n[1],u=n[2],c=n[3],s=n[4],f=n[5],h=n[6],l=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*o+s*r,t[1]=a*o+f*r,t[2]=u*o+h*r,t[3]=c*o+l*r,t[4]=s*o-i*r,t[5]=f*o-a*r,t[6]=h*o-u*r,t[7]=l*o-c*r,t}function Wt(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 zt(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 Qt(t,n,e){var r,o,i,a=e[0],u=e[1],c=e[2],s=Math.hypot(a,u,c);return s<Q?null:(a*=s=1/s,u*=s,c*=s,r=Math.sin(n),i=1-(o=Math.cos(n)),t[0]=a*a*i+o,t[1]=u*a*i+c*r,t[2]=c*a*i-u*r,t[3]=0,t[4]=a*u*i-c*r,t[5]=u*u*i+o,t[6]=c*u*i+a*r,t[7]=0,t[8]=a*c*i+u*r,t[9]=u*c*i-a*r,t[10]=c*c*i+o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function Zt(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 Jt(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 Kt(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 tn(t,n,e){var r=n[0],o=n[1],i=n[2],a=n[3],u=r+r,c=o+o,s=i+i,f=r*u,h=r*c,l=r*s,d=o*c,p=o*s,v=i*s,y=a*u,m=a*c,g=a*s;return t[0]=1-(d+v),t[1]=h+g,t[2]=l-m,t[3]=0,t[4]=h-g,t[5]=1-(f+v),t[6]=p+y,t[7]=0,t[8]=l+m,t[9]=p-y,t[10]=1-(f+d),t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function nn(t,n){var e=new Z(3),r=-n[0],o=-n[1],i=-n[2],a=n[3],u=n[4],c=n[5],s=n[6],f=n[7],h=r*r+o*o+i*i+a*a;return h>0?(e[0]=2*(u*a+f*r+c*i-s*o)/h,e[1]=2*(c*a+f*o+s*r-u*i)/h,e[2]=2*(s*a+f*i+u*o-c*r)/h):(e[0]=2*(u*a+f*r+c*i-s*o),e[1]=2*(c*a+f*o+s*r-u*i),e[2]=2*(s*a+f*i+u*o-c*r)),tn(t,n,e),t}function en(t,n){return t[0]=n[12],t[1]=n[13],t[2]=n[14],t}function rn(t,n){var e=n[0],r=n[1],o=n[2],i=n[4],a=n[5],u=n[6],c=n[8],s=n[9],f=n[10];return t[0]=Math.hypot(e,r,o),t[1]=Math.hypot(i,a,u),t[2]=Math.hypot(c,s,f),t}function on(t,n){var e=new Z(3);rn(e,n);var r=1/e[0],o=1/e[1],i=1/e[2],a=n[0]*r,u=n[1]*o,c=n[2]*i,s=n[4]*r,f=n[5]*o,h=n[6]*i,l=n[8]*r,d=n[9]*o,p=n[10]*i,v=a+f+p,y=0;return v>0?(y=2*Math.sqrt(v+1),t[3]=.25*y,t[0]=(h-d)/y,t[1]=(l-c)/y,t[2]=(u-s)/y):a>f&&a>p?(y=2*Math.sqrt(1+a-f-p),t[3]=(h-d)/y,t[0]=.25*y,t[1]=(u+s)/y,t[2]=(l+c)/y):f>p?(y=2*Math.sqrt(1+f-a-p),t[3]=(l-c)/y,t[0]=(u+s)/y,t[1]=.25*y,t[2]=(h+d)/y):(y=2*Math.sqrt(1+p-a-f),t[3]=(u-s)/y,t[0]=(l+c)/y,t[1]=(h+d)/y,t[2]=.25*y),t}function an(t,n,e,r){var o=n[0],i=n[1],a=n[2],u=n[3],c=o+o,s=i+i,f=a+a,h=o*c,l=o*s,d=o*f,p=i*s,v=i*f,y=a*f,m=u*c,g=u*s,M=u*f,b=r[0],x=r[1],P=r[2];return t[0]=(1-(p+y))*b,t[1]=(l+M)*b,t[2]=(d-g)*b,t[3]=0,t[4]=(l-M)*x,t[5]=(1-(h+y))*x,t[6]=(v+m)*x,t[7]=0,t[8]=(d+g)*P,t[9]=(v-m)*P,t[10]=(1-(h+p))*P,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function un(t,n,e,r,o){var i=n[0],a=n[1],u=n[2],c=n[3],s=i+i,f=a+a,h=u+u,l=i*s,d=i*f,p=i*h,v=a*f,y=a*h,m=u*h,g=c*s,M=c*f,b=c*h,x=r[0],P=r[1],E=r[2],O=o[0],S=o[1],C=o[2],A=(1-(v+m))*x,j=(d+b)*x,w=(p-M)*x,R=(d-b)*P,B=(1-(l+m))*P,T=(y+g)*P,k=(p+M)*E,L=(y-g)*E,D=(1-(l+v))*E;return t[0]=A,t[1]=j,t[2]=w,t[3]=0,t[4]=R,t[5]=B,t[6]=T,t[7]=0,t[8]=k,t[9]=L,t[10]=D,t[11]=0,t[12]=e[0]+O-(A*O+R*S+k*C),t[13]=e[1]+S-(j*O+B*S+L*C),t[14]=e[2]+C-(w*O+T*S+D*C),t[15]=1,t}function cn(t,n){var e=n[0],r=n[1],o=n[2],i=n[3],a=e+e,u=r+r,c=o+o,s=e*a,f=r*a,h=r*u,l=o*a,d=o*u,p=o*c,v=i*a,y=i*u,m=i*c;return t[0]=1-h-p,t[1]=f+m,t[2]=l-y,t[3]=0,t[4]=f-m,t[5]=1-s-p,t[6]=d+v,t[7]=0,t[8]=l+y,t[9]=d-v,t[10]=1-s-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function sn(t,n,e,r,o,i,a){var u=1/(e-n),c=1/(o-r),s=1/(i-a);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]=(o+r)*c,t[10]=(a+i)*s,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*i*2*s,t[15]=0,t}function fn(t,n,e,r,o){var i,a=1/Math.tan(n/2);return t[0]=a/e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,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!=o&&o!==1/0?(i=1/(r-o),t[10]=(o+r)*i,t[14]=2*o*r*i):(t[10]=-1,t[14]=-2*r),t}var hn=fn;function ln(t,n,e,r,o){var i,a=1/Math.tan(n/2);return t[0]=a/e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,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!=o&&o!==1/0?(i=1/(r-o),t[10]=o*i,t[14]=o*r*i):(t[10]=-1,t[14]=-r),t}function dn(t,n,e,r){var o=Math.tan(n.upDegrees*Math.PI/180),i=Math.tan(n.downDegrees*Math.PI/180),a=Math.tan(n.leftDegrees*Math.PI/180),u=Math.tan(n.rightDegrees*Math.PI/180),c=2/(a+u),s=2/(o+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]=-(a-u)*c*.5,t[9]=(o-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 pn(t,n,e,r,o,i,a){var u=1/(n-e),c=1/(r-o),s=1/(i-a);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]=(o+r)*c,t[14]=(a+i)*s,t[15]=1,t}var vn=pn;function yn(t,n,e,r,o,i,a){var u=1/(n-e),c=1/(r-o),s=1/(i-a);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]=(o+r)*c,t[14]=i*s,t[15]=1,t}function mn(t,n,e,r){var o,i,a,u,c,s,f,h,l,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],P=e[2];return Math.abs(p-b)<Q&&Math.abs(v-x)<Q&&Math.abs(y-P)<Q?It(t):(f=p-b,h=v-x,l=y-P,o=g*(l*=d=1/Math.hypot(f,h,l))-M*(h*=d),i=M*(f*=d)-m*l,a=m*h-g*f,(d=Math.hypot(o,i,a))?(o*=d=1/d,i*=d,a*=d):(o=0,i=0,a=0),u=h*a-l*i,c=l*o-f*a,s=f*i-h*o,(d=Math.hypot(u,c,s))?(u*=d=1/d,c*=d,s*=d):(u=0,c=0,s=0),t[0]=o,t[1]=u,t[2]=f,t[3]=0,t[4]=i,t[5]=c,t[6]=h,t[7]=0,t[8]=a,t[9]=s,t[10]=l,t[11]=0,t[12]=-(o*p+i*v+a*y),t[13]=-(u*p+c*v+s*y),t[14]=-(f*p+h*v+l*y),t[15]=1,t)}function gn(t,n,e,r){var o=n[0],i=n[1],a=n[2],u=r[0],c=r[1],s=r[2],f=o-e[0],h=i-e[1],l=a-e[2],d=f*f+h*h+l*l;d>0&&(f*=d=1/Math.sqrt(d),h*=d,l*=d);var p=c*l-s*h,v=s*f-u*l,y=u*h-c*f;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]=h*y-l*v,t[5]=l*p-f*y,t[6]=f*v-h*p,t[7]=0,t[8]=f,t[9]=h,t[10]=l,t[11]=0,t[12]=o,t[13]=i,t[14]=a,t[15]=1,t}function Mn(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 bn(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 xn(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 Pn(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 En(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 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[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 Sn(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 Cn(t,n){var e=t[0],r=t[1],o=t[2],i=t[3],a=t[4],u=t[5],c=t[6],s=t[7],f=t[8],h=t[9],l=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],P=n[4],E=n[5],O=n[6],S=n[7],C=n[8],A=n[9],j=n[10],w=n[11],R=n[12],B=n[13],T=n[14],k=n[15];return Math.abs(e-g)<=Q*Math.max(1,Math.abs(e),Math.abs(g))&&Math.abs(r-M)<=Q*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(o-b)<=Q*Math.max(1,Math.abs(o),Math.abs(b))&&Math.abs(i-x)<=Q*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(a-P)<=Q*Math.max(1,Math.abs(a),Math.abs(P))&&Math.abs(u-E)<=Q*Math.max(1,Math.abs(u),Math.abs(E))&&Math.abs(c-O)<=Q*Math.max(1,Math.abs(c),Math.abs(O))&&Math.abs(s-S)<=Q*Math.max(1,Math.abs(s),Math.abs(S))&&Math.abs(f-C)<=Q*Math.max(1,Math.abs(f),Math.abs(C))&&Math.abs(h-A)<=Q*Math.max(1,Math.abs(h),Math.abs(A))&&Math.abs(l-j)<=Q*Math.max(1,Math.abs(l),Math.abs(j))&&Math.abs(d-w)<=Q*Math.max(1,Math.abs(d),Math.abs(w))&&Math.abs(p-R)<=Q*Math.max(1,Math.abs(p),Math.abs(R))&&Math.abs(v-B)<=Q*Math.max(1,Math.abs(v),Math.abs(B))&&Math.abs(y-T)<=Q*Math.max(1,Math.abs(y),Math.abs(T))&&Math.abs(m-k)<=Q*Math.max(1,Math.abs(m),Math.abs(k))}var An=Xt,jn=Pn;function wn(){var t=new Z(3);return Z!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Rn(t){var n=new Z(3);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n}function Bn(t){var n=t[0],e=t[1],r=t[2];return Math.hypot(n,e,r)}function Tn(t,n,e){var r=new Z(3);return r[0]=t,r[1]=n,r[2]=e,r}function kn(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t}function Ln(t,n,e,r){return t[0]=n,t[1]=e,t[2]=r,t}function Dn(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t}function In(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t}function _n(t,n,e){return t[0]=n[0]*e[0],t[1]=n[1]*e[1],t[2]=n[2]*e[2],t}function Yn(t,n,e){return t[0]=n[0]/e[0],t[1]=n[1]/e[1],t[2]=n[2]/e[2],t}function Nn(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t[2]=Math.ceil(n[2]),t}function qn(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t[2]=Math.floor(n[2]),t}function Xn(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 Hn(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 Fn(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t[2]=Math.round(n[2]),t}function Gn(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t}function $n(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 Vn(t,n){var e=n[0]-t[0],r=n[1]-t[1],o=n[2]-t[2];return Math.hypot(e,r,o)}function Un(t,n){var e=n[0]-t[0],r=n[1]-t[1],o=n[2]-t[2];return e*e+r*r+o*o}function Wn(t){var n=t[0],e=t[1],r=t[2];return n*n+e*e+r*r}function zn(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t}function Qn(t,n){return t[0]=1/n[0],t[1]=1/n[1],t[2]=1/n[2],t}function Zn(t,n){var e=n[0],r=n[1],o=n[2],i=e*e+r*r+o*o;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 Jn(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function Kn(t,n,e){var r=n[0],o=n[1],i=n[2],a=e[0],u=e[1],c=e[2];return t[0]=o*c-i*u,t[1]=i*a-r*c,t[2]=r*u-o*a,t}function te(t,n,e,r){var o=n[0],i=n[1],a=n[2];return t[0]=o+r*(e[0]-o),t[1]=i+r*(e[1]-i),t[2]=a+r*(e[2]-a),t}function ne(t,n,e,r,o,i){var a=i*i,u=a*(2*i-3)+1,c=a*(i-2)+i,s=a*(i-1),f=a*(3-2*i);return t[0]=n[0]*u+e[0]*c+r[0]*s+o[0]*f,t[1]=n[1]*u+e[1]*c+r[1]*s+o[1]*f,t[2]=n[2]*u+e[2]*c+r[2]*s+o[2]*f,t}function ee(t,n,e,r,o,i){var a=1-i,u=a*a,c=i*i,s=u*a,f=3*i*u,h=3*c*a,l=c*i;return t[0]=n[0]*s+e[0]*f+r[0]*h+o[0]*l,t[1]=n[1]*s+e[1]*f+r[1]*h+o[1]*l,t[2]=n[2]*s+e[2]*f+r[2]*h+o[2]*l,t}function re(t,n){n=n||1;var e=2*J()*Math.PI,r=2*J()-1,o=Math.sqrt(1-r*r)*n;return t[0]=Math.cos(e)*o,t[1]=Math.sin(e)*o,t[2]=r*n,t}function oe(t,n,e){var r=n[0],o=n[1],i=n[2],a=e[3]*r+e[7]*o+e[11]*i+e[15];return a=a||1,t[0]=(e[0]*r+e[4]*o+e[8]*i+e[12])/a,t[1]=(e[1]*r+e[5]*o+e[9]*i+e[13])/a,t[2]=(e[2]*r+e[6]*o+e[10]*i+e[14])/a,t}function ie(t,n,e){var r=n[0],o=n[1],i=n[2];return t[0]=r*e[0]+o*e[3]+i*e[6],t[1]=r*e[1]+o*e[4]+i*e[7],t[2]=r*e[2]+o*e[5]+i*e[8],t}function ae(t,n,e){var r=e[0],o=e[1],i=e[2],a=e[3],u=n[0],c=n[1],s=n[2],f=o*s-i*c,h=i*u-r*s,l=r*c-o*u,d=o*l-i*h,p=i*f-r*l,v=r*h-o*f,y=2*a;return f*=y,h*=y,l*=y,d*=2,p*=2,v*=2,t[0]=u+f+d,t[1]=c+h+p,t[2]=s+l+v,t}function ue(t,n,e,r){var o=[],i=[];return o[0]=n[0]-e[0],o[1]=n[1]-e[1],o[2]=n[2]-e[2],i[0]=o[0],i[1]=o[1]*Math.cos(r)-o[2]*Math.sin(r),i[2]=o[1]*Math.sin(r)+o[2]*Math.cos(r),t[0]=i[0]+e[0],t[1]=i[1]+e[1],t[2]=i[2]+e[2],t}function ce(t,n,e,r){var o=[],i=[];return o[0]=n[0]-e[0],o[1]=n[1]-e[1],o[2]=n[2]-e[2],i[0]=o[2]*Math.sin(r)+o[0]*Math.cos(r),i[1]=o[1],i[2]=o[2]*Math.cos(r)-o[0]*Math.sin(r),t[0]=i[0]+e[0],t[1]=i[1]+e[1],t[2]=i[2]+e[2],t}function se(t,n,e,r){var o=[],i=[];return o[0]=n[0]-e[0],o[1]=n[1]-e[1],o[2]=n[2]-e[2],i[0]=o[0]*Math.cos(r)-o[1]*Math.sin(r),i[1]=o[0]*Math.sin(r)+o[1]*Math.cos(r),i[2]=o[2],t[0]=i[0]+e[0],t[1]=i[1]+e[1],t[2]=i[2]+e[2],t}function fe(t,n){var e=t[0],r=t[1],o=t[2],i=n[0],a=n[1],u=n[2],c=Math.sqrt(e*e+r*r+o*o)*Math.sqrt(i*i+a*a+u*u),s=c&&Jn(t,n)/c;return Math.acos(Math.min(Math.max(s,-1),1))}function he(t){return t[0]=0,t[1]=0,t[2]=0,t}function le(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function de(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]}function pe(t,n){var e=t[0],r=t[1],o=t[2],i=n[0],a=n[1],u=n[2];return Math.abs(e-i)<=Q*Math.max(1,Math.abs(e),Math.abs(i))&&Math.abs(r-a)<=Q*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(o-u)<=Q*Math.max(1,Math.abs(o),Math.abs(u))}var ve,ye=In,me=_n,ge=Yn,Me=Vn,be=Un,xe=Bn,Pe=Wn,Ee=(ve=wn(),function(t,n,e,r,o,i){var a,u;for(n||(n=3),e||(e=0),u=r?Math.min(r*n+e,t.length):t.length,a=e;a<u;a+=n)ve[0]=t[a],ve[1]=t[a+1],ve[2]=t[a+2],o(ve,ve,i),t[a]=ve[0],t[a+1]=ve[1],t[a+2]=ve[2];return t});function Oe(t){var n=t[0],e=t[1],r=t[2],o=t[3];return Math.hypot(n,e,r,o)}function Se(t){var n=t[0],e=t[1],r=t[2],o=t[3];return n*n+e*e+r*r+o*o}!function(){var t,n=(t=new Z(4),Z!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}();function Ce(){var t=new Z(4);return Z!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Ae(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function je(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 we(t,n){var e=2*Math.acos(n[3]),r=Math.sin(e/2);return r>Q?(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 Re(t,n){var e=ir(t,n);return Math.acos(2*e*e-1)}function Be(t,n,e){var r=n[0],o=n[1],i=n[2],a=n[3],u=e[0],c=e[1],s=e[2],f=e[3];return t[0]=r*f+a*u+o*s-i*c,t[1]=o*f+a*c+i*u-r*s,t[2]=i*f+a*s+r*c-o*u,t[3]=a*f-r*u-o*c-i*s,t}function Te(t,n,e){e*=.5;var r=n[0],o=n[1],i=n[2],a=n[3],u=Math.sin(e),c=Math.cos(e);return t[0]=r*c+a*u,t[1]=o*c+i*u,t[2]=i*c-o*u,t[3]=a*c-r*u,t}function ke(t,n,e){e*=.5;var r=n[0],o=n[1],i=n[2],a=n[3],u=Math.sin(e),c=Math.cos(e);return t[0]=r*c-i*u,t[1]=o*c+a*u,t[2]=i*c+r*u,t[3]=a*c-o*u,t}function Le(t,n,e){e*=.5;var r=n[0],o=n[1],i=n[2],a=n[3],u=Math.sin(e),c=Math.cos(e);return t[0]=r*c+o*u,t[1]=o*c-r*u,t[2]=i*c+a*u,t[3]=a*c-i*u,t}function De(t,n){var e=n[0],r=n[1],o=n[2];return t[0]=e,t[1]=r,t[2]=o,t[3]=Math.sqrt(Math.abs(1-e*e-r*r-o*o)),t}function Ie(t,n){var e=n[0],r=n[1],o=n[2],i=n[3],a=Math.sqrt(e*e+r*r+o*o),u=Math.exp(i),c=a>0?u*Math.sin(a)/a:0;return t[0]=e*c,t[1]=r*c,t[2]=o*c,t[3]=u*Math.cos(a),t}function _e(t,n){var e=n[0],r=n[1],o=n[2],i=n[3],a=Math.sqrt(e*e+r*r+o*o),u=a>0?Math.atan2(a,i)/a:0;return t[0]=e*u,t[1]=r*u,t[2]=o*u,t[3]=.5*Math.log(e*e+r*r+o*o+i*i),t}function Ye(t,n,e){return _e(t,n),or(t,t,e),Ie(t,t),t}function Ne(t,n,e,r){var o,i,a,u,c,s=n[0],f=n[1],h=n[2],l=n[3],d=e[0],p=e[1],v=e[2],y=e[3];return(i=s*d+f*p+h*v+l*y)<0&&(i=-i,d=-d,p=-p,v=-v,y=-y),1-i>Q?(o=Math.acos(i),a=Math.sin(o),u=Math.sin((1-r)*o)/a,c=Math.sin(r*o)/a):(u=1-r,c=r),t[0]=u*s+c*d,t[1]=u*f+c*p,t[2]=u*h+c*v,t[3]=u*l+c*y,t}function qe(t){var n=J(),e=J(),r=J(),o=Math.sqrt(1-n),i=Math.sqrt(n);return t[0]=o*Math.sin(2*Math.PI*e),t[1]=o*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 Xe(t,n){var e=n[0],r=n[1],o=n[2],i=n[3],a=e*e+r*r+o*o+i*i,u=a?1/a:0;return t[0]=-e*u,t[1]=-r*u,t[2]=-o*u,t[3]=i*u,t}function He(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=n[3],t}function Fe(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 o=0;n[4]>n[0]&&(o=1),n[8]>n[3*o+o]&&(o=2);var i=(o+1)%3,a=(o+2)%3;e=Math.sqrt(n[3*o+o]-n[3*i+i]-n[3*a+a]+1),t[o]=.5*e,e=.5/e,t[3]=(n[3*i+a]-n[3*a+i])*e,t[i]=(n[3*i+o]+n[3*o+i])*e,t[a]=(n[3*a+o]+n[3*o+a])*e}return t}function Ge(t,n,e,r){var o=.5*Math.PI/180;n*=o,e*=o,r*=o;var i=Math.sin(n),a=Math.cos(n),u=Math.sin(e),c=Math.cos(e),s=Math.sin(r),f=Math.cos(r);return t[0]=i*c*f-a*u*s,t[1]=a*u*f+i*c*s,t[2]=a*c*s-i*u*f,t[3]=a*c*f+i*u*s,t}function $e(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var Ve,Ue,We,ze,Qe,Ze,Je=function(t){var n=new Z(4);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n},Ke=function(t,n,e,r){var o=new Z(4);return o[0]=t,o[1]=n,o[2]=e,o[3]=r,o},tr=function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t},nr=function(t,n,e,r,o){return t[0]=n,t[1]=e,t[2]=r,t[3]=o,t},er=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},rr=Be,or=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},ir=function(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+t[3]*n[3]},ar=function(t,n,e,r){var o=n[0],i=n[1],a=n[2],u=n[3];return t[0]=o+r*(e[0]-o),t[1]=i+r*(e[1]-i),t[2]=a+r*(e[2]-a),t[3]=u+r*(e[3]-u),t},ur=Oe,cr=ur,sr=Se,fr=sr,hr=function(t,n){var e=n[0],r=n[1],o=n[2],i=n[3],a=e*e+r*r+o*o+i*i;return a>0&&(a=1/Math.sqrt(a)),t[0]=e*a,t[1]=r*a,t[2]=o*a,t[3]=i*a,t},lr=function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]},dr=function(t,n){var e=t[0],r=t[1],o=t[2],i=t[3],a=n[0],u=n[1],c=n[2],s=n[3];return Math.abs(e-a)<=Q*Math.max(1,Math.abs(e),Math.abs(a))&&Math.abs(r-u)<=Q*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(o-c)<=Q*Math.max(1,Math.abs(o),Math.abs(c))&&Math.abs(i-s)<=Q*Math.max(1,Math.abs(i),Math.abs(s))},pr=(Ve=wn(),Ue=Tn(1,0,0),We=Tn(0,1,0),function(t,n,e){var r=Jn(n,e);return r<-.999999?(Kn(Ve,Ue,n),xe(Ve)<1e-6&&Kn(Ve,We,n),Zn(Ve,Ve),je(t,Ve,Math.PI),t):r>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(Kn(Ve,n,e),t[0]=Ve[0],t[1]=Ve[1],t[2]=Ve[2],t[3]=1+r,hr(t,t))}),vr=(ze=Ce(),Qe=Ce(),function(t,n,e,r,o,i){return Ne(ze,n,o,i),Ne(Qe,e,r,i),Ne(t,ze,Qe,2*i*(1-i)),t}),yr=(Ze=K(),function(t,n,e,r){return Ze[0]=e[0],Ze[3]=e[1],Ze[6]=e[2],Ze[1]=r[0],Ze[4]=r[1],Ze[7]=r[2],Ze[2]=-n[0],Ze[5]=-n[1],Ze[8]=-n[2],hr(t,Fe(t,Ze))});function mr(){var t=new Z(2);return Z!=Float32Array&&(t[0]=0,t[1]=0),t}function gr(t){var n=new Z(2);return n[0]=t[0],n[1]=t[1],n}function Mr(t,n){var e=new Z(2);return e[0]=t,e[1]=n,e}function br(t,n){return t[0]=n[0],t[1]=n[1],t}function xr(t,n,e){return t[0]=n,t[1]=e,t}function Pr(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t}function Er(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t}function Or(t,n,e){return t[0]=n[0]*e[0],t[1]=n[1]*e[1],t}function Sr(t,n,e){return t[0]=n[0]/e[0],t[1]=n[1]/e[1],t}function Cr(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t}function Ar(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t}function jr(t,n,e){return t[0]=Math.min(n[0],e[0]),t[1]=Math.min(n[1],e[1]),t}function wr(t,n,e){return t[0]=Math.max(n[0],e[0]),t[1]=Math.max(n[1],e[1]),t}function Rr(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t}function Br(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t}function Tr(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t}function kr(t,n){var e=n[0]-t[0],r=n[1]-t[1];return Math.hypot(e,r)}function Lr(t,n){var e=n[0]-t[0],r=n[1]-t[1];return e*e+r*r}function Dr(t){var n=t[0],e=t[1];return Math.hypot(n,e)}function Ir(t){var n=t[0],e=t[1];return n*n+e*e}function _r(t,n){return t[0]=-n[0],t[1]=-n[1],t}function Yr(t,n){return t[0]=1/n[0],t[1]=1/n[1],t}function Nr(t,n){var e=n[0],r=n[1],o=e*e+r*r;return o>0&&(o=1/Math.sqrt(o)),t[0]=n[0]*o,t[1]=n[1]*o,t}function qr(t,n){return t[0]*n[0]+t[1]*n[1]}function Xr(t,n,e){var r=n[0]*e[1]-n[1]*e[0];return t[0]=t[1]=0,t[2]=r,t}function Hr(t,n,e,r){var o=n[0],i=n[1];return t[0]=o+r*(e[0]-o),t[1]=i+r*(e[1]-i),t}function Fr(t,n){n=n||1;var e=2*J()*Math.PI;return t[0]=Math.cos(e)*n,t[1]=Math.sin(e)*n,t}function Gr(t,n,e){var r=n[0],o=n[1];return t[0]=e[0]*r+e[2]*o,t[1]=e[1]*r+e[3]*o,t}function $r(t,n,e){var r=n[0],o=n[1];return t[0]=e[0]*r+e[2]*o+e[4],t[1]=e[1]*r+e[3]*o+e[5],t}function Vr(t,n,e){var r=n[0],o=n[1];return t[0]=e[0]*r+e[3]*o+e[6],t[1]=e[1]*r+e[4]*o+e[7],t}function Ur(t,n,e){var r=n[0],o=n[1];return t[0]=e[0]*r+e[4]*o+e[12],t[1]=e[1]*r+e[5]*o+e[13],t}function Wr(t,n,e,r){var o=n[0]-e[0],i=n[1]-e[1],a=Math.sin(r),u=Math.cos(r);return t[0]=o*u-i*a+e[0],t[1]=o*a+i*u+e[1],t}function zr(t,n){var e=t[0],r=t[1],o=n[0],i=n[1],a=Math.sqrt(e*e+r*r)*Math.sqrt(o*o+i*i),u=a&&(e*o+r*i)/a;return Math.acos(Math.min(Math.max(u,-1),1))}function Qr(t){return t[0]=0,t[1]=0,t}function Zr(t){return"vec2("+t[0]+", "+t[1]+")"}function Jr(t,n){return t[0]===n[0]&&t[1]===n[1]}function Kr(t,n){var e=t[0],r=t[1],o=n[0],i=n[1];return Math.abs(e-o)<=Q*Math.max(1,Math.abs(e),Math.abs(o))&&Math.abs(r-i)<=Q*Math.max(1,Math.abs(r),Math.abs(i))}var to=Dr,no=Er,eo=Or,ro=Sr,oo=kr,io=Lr,ao=Ir,uo=function(){var t=mr();return function(n,e,r,o,i,a){var u,c;for(e||(e=2),r||(r=0),c=o?Math.min(o*e+r,n.length):n.length,u=r;u<c;u+=e)t[0]=n[u],t[1]=n[u+1],i(t,t,a),n[u]=t[0],n[u+1]=t[1];return n}}(),co=function(){function t(){}return t.tag="c-canvas-rbush-node",t}(),so="RBushRoot",fo=function(){function t(){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=[];this.toSync.forEach((function(e){var r=e.rBushNode;r&&t.rBush.remove(r.aabb);var o=e.getRenderBounds();if(o){var i=y(o.getMin(),2),a=i[0],u=i[1],c=y(o.getMax(),2),s=c[0],f=c[1];r.aabb={id:e.entity,minX:a,minY:u,maxX:s,maxY:f}}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 co,e.pushToSync(t.composedPath().slice(0,-2))},o=function(t){var n=t.target,r=n.rBushNode;e.rBush.remove(r.aabb),e.toSync.delete(n)},i=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.tap(n.tag,(function(){e.renderingContext.root.addEventListener(g.ElementEvent.MOUNTED,r),e.renderingContext.root.addEventListener(g.ElementEvent.UNMOUNTED,o),e.renderingContext.root.addEventListener(g.ElementEvent.BOUNDS_CHANGED,i)})),t.hooks.destroy.tap(n.tag,(function(){e.renderingContext.root.removeEventListener(g.ElementEvent.MOUNTED,r),e.renderingContext.root.removeEventListener(g.ElementEvent.UNMOUNTED,o),e.renderingContext.root.removeEventListener(g.ElementEvent.BOUNDS_CHANGED,i)})),t.hooks.beginFrame.tap(n.tag,(function(){var t=e.contextService.getContext(),n=e.canvasConfig.renderer.getConfig(),r=n.enableDirtyRectangleRendering;n.enableDirtyRectangleRenderingDebug;e.clearFullScreen=!r||e.renderingContext.renderReasons.has(g.RENDER_REASON.CameraChanged),t&&(t.save(),e.clearFullScreen&&t.clearRect(0,0,e.canvasConfig.width,e.canvasConfig.height),e.applyTransform(t,e.camera.getOrthoMatrix()))})),t.hooks.endFrame.tap(n.tag,(function(){e.syncRTree();var n=e.canvasConfig.renderer.getConfig().enableDirtyRectangleRendering,r=e.contextService.getContext();if(n){var o=e.safeMergeAABB.apply(e,m([e.mergeDirtyAABBs(e.renderQueue)],y(e.renderingContext.removedRenderBoundsList),!1));if(e.renderingContext.removedRenderBoundsList=[],!o)return;var i=e.convertAABB2Rect(o),a=i.x,u=i.y,c=i.width,s=i.height;r.clearRect(a,u,c,s),r.beginPath(),r.rect(a,u,c,s),r.clip(),e.searchDirtyObjects(o).sort((function(t,n){return t.sortable.renderOrder-n.sortable.renderOrder})).forEach((function(n){n.isVisible()&&e.renderDisplayObject(n,t)})),e.enableBatch&&e.batchedStyleHash&&e.flush(r,t),e.renderQueue.forEach((function(t){e.saveDirtyAABB(t)})),e.renderQueue=[]}e.restoreStack.forEach((function(t){r.restore()})),e.restoreStack=[],r.restore()})),t.hooks.render.tap(n.tag,(function(n){e.canvasConfig.renderer.getConfig().enableDirtyRectangleRendering?e.renderQueue.push(n):e.renderDisplayObject(n,t)}))},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(),o=this.restoreStack[this.restoreStack.length-1];o&&t.parentNode!==o;)r.restore(),this.restoreStack.pop(),o=this.restoreStack[this.restoreStack.length-1];var i=t.nodeName,a=this.styleRendererFactory(i),u=!1;if(this.enableBatch&&a){var c=a.hash(t.attributes);this.batchedStyleHash&&c!==this.batchedStyleHash&&this.flush(r,n),this.batchedStyleHash||(this.batchedStyleHash=c,this.batchedDisplayObject=t,u=!0)}r.save(),this.applyTransform(r,t.getLocalTransform());var s=t.style.clipPath;if(s){r.save(),this.applyTransform(r,s.getLocalTransform());var f=this.pathGeneratorFactory(s.nodeName);f&&this.useAnchor(r,s,(function(){r.beginPath(),f(r,s.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&&(!u&&e.enableBatch||r.beginPath(),n(r,t.parsedStyle),e.enableBatch||t.nodeName===g.SHAPE.Line||t.nodeName===g.SHAPE.Path||t.nodeName===g.SHAPE.Polyline||r.closePath()),a&&!e.enableBatch&&a.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]),o=Math.floor(n[1]);return{x:r,y:o,width:Math.ceil(e[0])-r,height:Math.ceil(e[1])-o}},t.prototype.mergeDirtyAABBs=function(t){var n;return t.forEach((function(t){var e=t.getRenderBounds();e&&(n?n.add(e):n=new g.AABB(e.center,e.halfExtents));var r=t.renderable.dirtyRenderBounds;r&&(n?n.add(r):n=new g.AABB(r.center,r.halfExtents))})),n},t.prototype.searchDirtyObjects=function(t){var n=this,e=y(t.getMin(),2),r=e[0],o=e[1],i=y(t.getMax(),2),a=i[0],u=i[1];return this.rBush.search({minX:r,minY:o,maxX:a,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 g.AABB);var e=t.getRenderBounds();e&&n.dirtyRenderBounds.update(e.center,e.halfExtents)},t.prototype.applyTransform=function(t,n){var e=y(i.getTranslation(a.create(),n),2),r=e[0],o=e[1],c=y(i.getScaling(a.create(),n),2),s=c[0],f=c[1],h=i.getRotation(u.create(),n),l=y(Object(g.getEuler)(a.create(),h),3),d=l[0],p=(l[1],l[2]),v=Object(g.fromRotationTranslationScale)(d||p,r,o,s,f);t.transform(v[0],v[1],v[3],v[4],v[6],v[7])},t.prototype.getColor=function(t,n,e,r){var o;if(t.type===g.PARSED_COLOR_TYPE.LinearGradient||t.type===g.PARSED_COLOR_TYPE.RadialGradient){var i=n.getGeometryBounds(),a=i&&2*i.halfExtents[0]||0,u=i&&2*i.halfExtents[1]||0;o=this.gradientPool.getOrCreateGradient(d(d({type:t.type},t.value),{width:a,height:u}),e)}else if(t.type===g.PARSED_COLOR_TYPE.Pattern){var c=this.imagePool.getPatternSync(t.value);c?o=c:this.imagePool.createPattern(t.value,e).then((function(){n.renderable.dirty=!0,r.dirtify()}))}else o=t.formatted;return o},t.prototype.applyAttributesToContext=function(t,n,e){var r=n.parsedStyle,o=r.stroke,i=r.fill,a=r.opacity,u=r.lineDash,c=r.lineDashOffset,s=r.filter,f=r.shadowColor,h=r.shadowBlur,l=r.shadowOffsetX,d=r.shadowOffsetY;u&&k(u)&&t.setLineDash(u),T(c)||(t.lineDashOffset=c),T(a)||(t.globalAlpha*=a),T(o)||(t.strokeStyle=this.getColor(o,n,t,e)),T(i)||(t.fillStyle=this.getColor(i,n,t,e)),T(s)||(t.filter=n.style.filter),T(f)||(t.shadowColor=f.formatted,t.shadowBlur=h,t.shadowOffsetX=l,t.shadowOffsetY=d)},t.prototype.useAnchor=function(t,n,e){var r=n.getGeometryBounds();if(r){var o=r.halfExtents,i=(n.parsedStyle||{}).anchor,a=void 0===i?[0,0]:i;t.translate(-a[0]*o[0]*2,-a[1]*o[1]*2),e()}else e()},t.prototype.safeMergeAABB=function(){for(var t,n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return n.forEach((function(n){n&&(t?t.add(n):t=n)})),t},t.tag="CanvasRendererPlugin",p([Object(M.inject)(g.CanvasConfig),v("design:type",Object)],t.prototype,"canvasConfig",void 0),p([Object(M.inject)(g.DefaultCamera),v("design:type",g.Camera)],t.prototype,"camera",void 0),p([Object(M.inject)(g.ContextService),v("design:type",Object)],t.prototype,"contextService",void 0),p([Object(M.inject)(g.SceneGraphService),v("design:type",Object)],t.prototype,"sceneGraphService",void 0),p([Object(M.inject)(g.RenderingContext),v("design:type",Object)],t.prototype,"renderingContext",void 0),p([Object(M.inject)(G),v("design:type",G)],t.prototype,"imagePool",void 0),p([Object(M.inject)(U),v("design:type",U)],t.prototype,"gradientPool",void 0),p([Object(M.inject)(W),v("design:type",Function)],t.prototype,"pathGeneratorFactory",void 0),p([Object(M.inject)(A),v("design:type",Function)],t.prototype,"styleRendererFactory",void 0),p([Object(M.inject)(g.DisplayObjectPool),v("design:type",g.DisplayObjectPool)],t.prototype,"displayObjectPool",void 0),p([Object(M.inject)(so),v("design:type",C.a)],t.prototype,"rBush",void 0),t=n=p([Object(M.singleton)({contrib:g.RenderingPluginContribution})],t)}(),ho=function(){function t(){}var n;return n=t,t.prototype.apply=function(t){var e=this,r=function(n){var r=n.target,o=r.nodeName,i=r.attributes;if(o===g.SHAPE.Image){var a=i.img;N(a)&&e.imagePool.getOrCreateImage(a).then((function(){r.renderable.dirty=!0,t.dirtify()}))}},o=function(n){var r=n.target,o=n.detail,i=o.attributeName,a=o.newValue;r.nodeName===g.SHAPE.Image&&"img"===i&&N(a)&&e.imagePool.getOrCreateImage(a).then((function(){r.renderable.dirty=!0,t.dirtify()}))};t.hooks.init.tap(n.tag,(function(){e.renderingContext.root.addEventListener(g.ElementEvent.MOUNTED,r),e.renderingContext.root.addEventListener(g.ElementEvent.ATTRIBUTE_CHANGED,o)})),t.hooks.destroy.tap(n.tag,(function(){e.renderingContext.root.removeEventListener(g.ElementEvent.MOUNTED,r),e.renderingContext.root.removeEventListener(g.ElementEvent.ATTRIBUTE_CHANGED,o)}))},t.tag="LoadImagePlugin",p([Object(M.inject)(G),v("design:type",G)],t.prototype,"imagePool",void 0),p([Object(M.inject)(g.RenderingContext),v("design:type",Object)],t.prototype,"renderingContext",void 0),t=n=p([Object(M.singleton)({contrib:g.RenderingPluginContribution})],t)}();g.globalContainer.register({token:{token:z,named:g.SHAPE.Circle},useValue:function(t,n){var e=n.rInPixels;t.arc(e,e,e,0,2*Math.PI,!1)}}),g.globalContainer.register({token:{token:z,named:g.SHAPE.Ellipse},useValue:function(t,n){var e=n.rxInPixels,r=n.ryInPixels;if(t.ellipse)t.ellipse(e,r,e,r,0,0,2*Math.PI,!1);else{var o=e>r?e:r,i=e>r?1:e/r,a=e>r?r/e:1;t.save(),t.scale(i,a),t.arc(0,0,o,0,2*Math.PI)}}}),g.globalContainer.register({token:{token:z,named:g.SHAPE.Rect},useValue:function(t,n){var e=n.radius,r=void 0===e?0:e,o=n.widthInPixels,i=n.heightInPixels;if(0===r)t.rect(0,0,o,i);else{var a=y(function(t){var n=0,e=0,r=0,o=0;return k(t)?1===t.length?n=e=r=o=t[0]:2===t.length?(n=r=t[0],e=o=t[1]):3===t.length?(n=t[0],e=o=t[1],r=t[2]):(n=t[0],e=t[1],r=t[2],o=t[3]):n=e=r=o=t,[n,e,r,o]}(r),4),u=a[0],c=a[1],s=a[2],f=a[3];t.moveTo(u,0),t.lineTo(o-c,0),0!==c&&t.arc(o-c,c,c,-Math.PI/2,0),t.lineTo(o,i-s),0!==s&&t.arc(o-s,i-s,s,0,Math.PI/2),t.lineTo(f,i),0!==f&&t.arc(f,i-f,f,Math.PI/2,Math.PI),t.lineTo(0,u),0!==u&&t.arc(u,u,u,Math.PI,1.5*Math.PI)}}}),g.globalContainer.register({token:{token:z,named:g.SHAPE.Line},useValue:function(t,n){var e=n.x1,r=n.y1,o=n.x2,i=n.y2,a=n.defX,u=void 0===a?0:a,c=n.defY,s=void 0===c?0:c;t.moveTo(e-u,r-s),t.lineTo(o-u,i-s)}}),g.globalContainer.register({token:{token:z,named:g.SHAPE.Polyline},useValue:function(t,n){var e=n.defX,r=void 0===e?0:e,o=n.defY,i=void 0===o?0:o,a=n.points.points,u=a.length,c=a[0][0]-r,s=a[0][1]-i,f=a[u-1][0]-r,h=a[u-1][1]-i;t.moveTo(c,s);for(var l=0;l<u-1;l++){var d=a[l];t.lineTo(d[0]-r,d[1]-i)}t.lineTo(f,h)}}),g.globalContainer.register({token:{token:z,named:g.SHAPE.Polygon},useValue:function(t,n){var e=n.defX,r=void 0===e?0:e,o=n.defY,i=void 0===o?0:o,a=n.points.points,u=a.length,c=a[0][0]-r,s=a[0][1]-i,f=a[u-1][0]-r,h=a[u-1][1]-i;t.moveTo(c,s);for(var l=0;l<u-1;l++){var d=a[l];t.lineTo(d[0]-r,d[1]-i)}t.lineTo(f,h)}}),g.globalContainer.register({token:{token:z,named:g.SHAPE.Path},useValue:function(t,n){var e=n.defX,r=void 0===e?0:e,o=n.defY,i=void 0===o?0:o,a=n.path,u=a.curve,c=a.zCommandIndexes,s=u;c.forEach((function(t,n){s.splice(t+n,0,["Z"])}));for(var f=[-r,-i],h=0;h<s.length;h++){var l=s[h],d=l[0];switch(d){case"M":t.moveTo(l[1]-r,l[2]-i),f=[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()}if("Z"===d)f;else{var p=l.length;[l[p-2]-r,l[p-1]-i]}}}}),g.globalContainer.register({token:W,useFactory:function(t){var n={};return function(e){return n[e]||t.container.isBoundNamed(z,e)&&(n[e]=t.container.getNamed(z,e)),n[e]}}});var lo=Object(M.Module)((function(t){t(G),t({token:so,useValue:new C.a}),t(F),t($),t(V),t({token:A,useFactory:function(t){var n={};return function(e){return n[e]||t.container.isBoundNamed(j,e)&&(n[e]=t.container.getNamed(j,e)),n[e]}}}),t(U),t(fo),t(ho)})),po=function(){function t(){}return t.prototype.init=function(t){t.load(lo,!0)},t.prototype.destroy=function(t){t.unload(lo)},t}(),vo=function(){function t(){var t=this;this.isHit=function(n,e,r){var o=t.pointInPathPickerFactory(n.nodeName);if(o){var u=i.invert(i.create(),r),c=a.transformMat4(a.create(),a.fromValues(e[0],e[1],0),u),s=n.getGeometryBounds().halfExtents,f=n.parsedStyle.anchor,h=void 0===f?[0,0]:f;if(c[0]+=h[0]*s[0]*2,c[1]+=h[1]*s[1]*2,o(n,new g.Point(c[0],c[1]),t.isPointInPath))return!0}return!1},this.isPointInPath=function(n,e){var r=t.offscreenCanvas.getOrCreateContext(),o=t.pathGeneratorFactory(n.nodeName);return o&&o(r,n.parsedStyle),r.isPointInPath(e.x,e.y)}}var n;return n=t,t.prototype.apply=function(t){var e=this;t.hooks.pick.tap(n.tag,(function(t){var n=t.position,r=n.x,o=n.y,u=a.fromValues(r,o,0),c=[],s=e.rBush.search({minX:u[0],minY:u[1],maxX:u[0],maxY:u[1]}),f=s.map((function(t){return t.id}));return s.forEach((function(t){var n=t.id,r=e.displayObjectPool.getByEntity(n);if(r.isVisible()&&r.interactive){if(r.parentNode&&-1===f.indexOf(r.parentNode.entity))return;var o=r.style.clipPath||r,a=r.getWorldTransform();r.style.clipPath&&(a=i.multiply(i.create(),a,r.style.clipPath.getLocalTransform())),e.isHit(o,u,a)&&c.push(r)}})),c.sort((function(t,n){return t.sortable.renderOrder-n.sortable.renderOrder})),t.picked=c[c.length-1]||null,t}))},t.tag="CanvasPickerPlugin",p([Object(M.inject)(g.SceneGraphService),v("design:type",Object)],t.prototype,"sceneGraphService",void 0),p([Object(M.inject)(g.DisplayObjectPool),v("design:type",g.DisplayObjectPool)],t.prototype,"displayObjectPool",void 0),p([Object(M.inject)(g.OffscreenCanvasCreator),v("design:type",g.OffscreenCanvasCreator)],t.prototype,"offscreenCanvas",void 0),p([Object(M.inject)(so),v("design:type",Function)],t.prototype,"rBush",void 0),p([Object(M.inject)(W),v("design:type",Function)],t.prototype,"pathGeneratorFactory",void 0),p([Object(M.inject)("PointInPathPicker"),v("design:type",Function)],t.prototype,"pointInPathPickerFactory",void 0),t=n=p([Object(M.singleton)({contrib:g.RenderingPluginContribution})],t)}();function yo(t,n,e,r){var o=t-e,i=n-r;return Math.sqrt(o*o+i*i)}function mo(t,n){return Math.abs(t-n)<.001}function go(t,n){var e=_(t),r=_(n);return{x:e,y:r,width:I(t)-e,height:I(n)-r}}function Mo(t){return(t+2*Math.PI)%(2*Math.PI)}var bo={box:function(t,n,e,r){return go([t,e],[n,r])},length:function(t,n,e,r){return yo(t,n,e,r)},pointAt:function(t,n,e,r,o){return{x:(1-o)*t+o*e,y:(1-o)*n+o*r}},pointDistance:function(t,n,e,r,o,i){var a=(e-t)*(o-t)+(r-n)*(i-n);return a<0?yo(t,n,o,i):a>(e-t)*(e-t)+(r-n)*(r-n)?yo(e,r,o,i):this.pointToLine(t,n,e,r,o,i)},pointToLine:function(t,n,e,r,o,i){var a=[e-t,r-n];if(c.exactEquals(a,[0,0]))return Math.sqrt((o-t)*(o-t)+(i-n)*(i-n));var u=[-a[1],a[0]];c.normalize(u,u);var s=[o-t,i-n];return Math.abs(c.dot(s,u))},tangentAngle:function(t,n,e,r){return Math.atan2(r-n,e-t)}};function xo(t,n,e,r,o,i){var a=-1,u=1/0,c=[e,r],s=20;i&&i>200&&(s=i/10);for(var f=1/s,h=f/10,l=0;l<=s;l++){var d=l*f,p=[o.apply(null,t.concat([d])),o.apply(null,n.concat([d]))];(g=yo(c[0],c[1],p[0],p[1]))<u&&(a=d,u=g)}if(0===a)return{x:t[0],y:n[0]};if(1===a){var v=t.length;return{x:t[v-1],y:n[v-1]}}u=1/0;for(l=0;l<32&&!(h<1e-4);l++){var y=a-h,m=a+h,g=(p=[o.apply(null,t.concat([y])),o.apply(null,n.concat([y]))],yo(c[0],c[1],p[0],p[1]));if(y>=0&&g<u)a=y,u=g;else{var M=[o.apply(null,t.concat([m])),o.apply(null,n.concat([m]))],b=yo(c[0],c[1],M[0],M[1]);m<=1&&b<u?(a=m,u=b):h*=.5}}return{x:o.apply(null,t.concat([a])),y:o.apply(null,n.concat([a]))}}function Po(t,n,e,r){var o=1-r;return o*o*t+2*r*o*n+r*r*e}function Eo(t,n,e){var r=t+e-2*n;if(mo(r,0))return[.5];var o=(t-n)/r;return o<=1&&o>=0?[o]:[]}function Oo(t,n,e,r){return 2*(1-r)*(n-t)+2*r*(e-n)}function So(t,n,e,r,o,i,a){var u=Po(t,e,o,a),c=Po(n,r,i,a),s=bo.pointAt(t,n,e,r,a),f=bo.pointAt(e,r,o,i,a);return[[t,n,s.x,s.y,u,c],[u,c,f.x,f.y,o,i]]}var Co={box:function(t,n,e,r,o,i){var a=Eo(t,e,o)[0],u=Eo(n,r,i)[0],c=[t,o],s=[n,i];return void 0!==a&&c.push(Po(t,e,o,a)),void 0!==u&&s.push(Po(n,r,i,u)),go(c,s)},length:function(t,n,e,r,o,i){return function t(n,e,r,o,i,a,u){if(0===u)return(yo(n,e,r,o)+yo(r,o,i,a)+yo(n,e,i,a))/2;var c=So(n,e,r,o,i,a,.5),s=c[0],f=c[1];return s.push(u-1),f.push(u-1),t.apply(null,s)+t.apply(null,f)}(t,n,e,r,o,i,3)},nearestPoint:function(t,n,e,r,o,i,a,u){return xo([t,e,o],[n,r,i],a,u,Po)},pointDistance:function(t,n,e,r,o,i,a,u){var c=this.nearestPoint(t,n,e,r,o,i,a,u);return yo(c.x,c.y,a,u)},interpolationAt:Po,pointAt:function(t,n,e,r,o,i,a){return{x:Po(t,e,o,a),y:Po(n,r,i,a)}},divide:function(t,n,e,r,o,i,a){return So(t,n,e,r,o,i,a)},tangentAngle:function(t,n,e,r,o,i,a){var u=Oo(t,e,o,a),c=Oo(n,r,i,a);return Mo(Math.atan2(c,u))}};function Ao(t,n,e,r,o){var i=1-o;return i*i*i*t+3*n*o*i*i+3*e*o*o*i+r*o*o*o}function jo(t,n,e,r,o){var i=1-o;return 3*(i*i*(n-t)+2*i*o*(e-n)+o*o*(r-e))}function wo(t,n,e,r){var o,i,a,u=-3*t+9*n-9*e+3*r,c=6*t-12*n+6*e,s=3*n-3*t,f=[];if(mo(u,0))mo(c,0)||(o=-s/c)>=0&&o<=1&&f.push(o);else{var h=c*c-4*u*s;mo(h,0)?f.push(-c/(2*u)):h>0&&(i=(-c-(a=Math.sqrt(h)))/(2*u),(o=(-c+a)/(2*u))>=0&&o<=1&&f.push(o),i>=0&&i<=1&&f.push(i))}return f}function Ro(t,n,e,r,o,i,a,u,c){var s=Ao(t,e,o,a,c),f=Ao(n,r,i,u,c),h=bo.pointAt(t,n,e,r,c),l=bo.pointAt(e,r,o,i,c),d=bo.pointAt(o,i,a,u,c),p=bo.pointAt(h.x,h.y,l.x,l.y,c),v=bo.pointAt(l.x,l.y,d.x,d.y,c);return[[t,n,h.x,h.y,p.x,p.y,s,f],[s,f,v.x,v.y,d.x,d.y,a,u]]}function Bo(t,n,e,r,o,i,a,u,c){if(0===c)return function(t,n){for(var e=0,r=t.length,o=0;o<r;o++){e+=yo(t[o],n[o],t[(o+1)%r],n[(o+1)%r])}return e/2}([t,e,o,a],[n,r,i,u]);var s=Ro(t,n,e,r,o,i,a,u,.5),f=m(m([],y(s[0]),!1),[c-1],!1),h=m(m([],y(s[1]),!1),[c-1],!1);return Bo.apply(null,f)+Bo.apply(null,h)}var To={extrema:wo,box:function(t,n,e,r,o,i,a,u){for(var c=[t,a],s=[n,u],f=wo(t,e,o,a),h=wo(n,r,i,u),l=0;l<f.length;l++)c.push(Ao(t,e,o,a,f[l]));for(l=0;l<h.length;l++)s.push(Ao(n,r,i,u,h[l]));return go(c,s)},length:function(t,n,e,r,o,i,a,u){return Bo(t,n,e,r,o,i,a,u,3)},nearestPoint:function(t,n,e,r,o,i,a,u,c,s,f){return xo([t,e,o,a],[n,r,i,u],c,s,Ao,f)},pointDistance:function(t,n,e,r,o,i,a,u,c,s,f){var h=this.nearestPoint(t,n,e,r,o,i,a,u,c,s,f);return yo(h.x,h.y,c,s)},interpolationAt:Ao,pointAt:function(t,n,e,r,o,i,a,u,c){return{x:Ao(t,e,o,a,c),y:Ao(n,r,i,u,c)}},divide:function(t,n,e,r,o,i,a,u,c){return Ro(t,n,e,r,o,i,a,u,c)},tangentAngle:function(t,n,e,r,o,i,a,u,c){var s=jo(t,e,o,a,c),f=jo(n,r,i,u,c);return Mo(Math.atan2(f,s))}};function ko(t,n,e,r){var o=t-e,i=n-r;return Math.sqrt(o*o+i*i)}function Lo(t,n,e,r,o,i){return o>=t&&o<=t+e&&i>=n&&i<=n+r}function Do(t,n,e,r,o,i,a,u){var c=(Math.atan2(u-n,a-t)+2*Math.PI)%(2*Math.PI);if(c<r||c>o)return!1;var s={x:t+e*Math.cos(c),y:n+e*Math.sin(c)};return ko(s.x,s.y,a,u)<=i/2}function Io(t,n,e,r,o,i,a){var u=Math.min(t,e),c=Math.max(t,e),s=Math.min(n,r),f=Math.max(n,r),h=o/2;return i>=u-h&&i<=c+h&&a>=s-h&&a<=f+h&&bo.pointToLine(t,n,e,r,i,a)<=o/2}function _o(t,n,e,r,o){var i=t.length;if(i<2)return!1;for(var a=0;a<i-1;a++){if(Io(t[a][0],t[a][1],t[a+1][0],t[a+1][1],n,e,r))return!0}if(o){var u=t[0],c=t[i-1];if(Io(u[0],u[1],c[0],c[1],n,e,r))return!0}return!1}function Yo(t){return Math.abs(t)<1e-6?0:t<0?-1:1}function No(t,n,e){return(e[0]-t[0])*(n[1]-t[1])==(n[0]-t[0])*(e[1]-t[1])&&Math.min(t[0],n[0])<=e[0]&&e[0]<=Math.max(t[0],n[0])&&Math.min(t[1],n[1])<=e[1]&&e[1]<=Math.max(t[1],n[1])}function qo(t,n,e){var r=!1,o=t.length;if(o<=2)return!1;for(var i=0;i<o;i++){var a=t[i],u=t[(i+1)%o];if(No(a,u,[n,e]))return!0;Yo(a[1]-e)>0!=Yo(u[1]-e)>0&&Yo(n-(e-a[1])*(a[0]-u[0])/(a[1]-u[1])-a[0])<0&&(r=!r)}return r}function Xo(t,n,e){for(var r=!1,o=0;o<t.length;o++){if(r=qo(t[o],n,e))break}return r}function Ho(t,n){var e=t.parsedStyle,r=e.rInPixels,o=e.fill,i=e.stroke,a=e.lineWidth,u=void 0===a?0:a,c=e.clipPathTargets,s=u/2,f=ko(r,r,n.x,n.y),h=!!(null==c?void 0:c.length);return o&&i||h?f<=r+s:o?f<=r:!!i&&(f>=r-s&&f<=r+s)}function Fo(t,n,e,r){return t/(e*e)+n/(r*r)}function Go(t,n){var e=n.x,r=n.y,o=t.parsedStyle,i=o.rxInPixels,a=o.ryInPixels,u=o.fill,c=o.stroke,s=o.lineWidth,f=void 0===s?0:s,h=o.clipPathTargets,l=!!(null==h?void 0:h.length),d=f/2,p=(e-i)*(e-i),v=(r-a)*(r-a);return u&&c||l?Fo(p,v,i+d,a+d)<=1:u?Fo(p,v,i,a)<=1:!!c&&(Fo(p,v,i-d,a-d)>=1&&Fo(p,v,i+d,a+d)<=1)}function $o(t,n){var e=t.parsedStyle,r=e.x1,o=e.y1,i=e.x2,a=e.y2,u=e.lineWidth,c=void 0===u?0:u,s=e.defX,f=void 0===s?0:s,h=e.defY,l=void 0===h?0:h;return Io(r,o,i,a,c,n.x+f,n.y+l)}function Vo(t,n){var e=t.parsedStyle,r=e.stroke,o=e.lineWidth,i=void 0===o?0:o,a=e.points,u=e.defX,c=void 0===u?0:u,s=e.defY,f=void 0===s?0:s,h=e.clipPathTargets,l=!!(null==h?void 0:h.length);return!(!r&&!l||!i)&&_o(a.points,i,n.x+c,n.y+f,!1)}function Uo(t,n,e){var r=t.parsedStyle,i=r.lineWidth,a=void 0===i?0:i,u=r.stroke,s=r.fill,f=r.defX,h=void 0===f?0:f,l=r.defY,d=void 0===l?0:l,p=r.clipPathTargets,v=r.path,y=v.segments,m=v.hasArc,g=v.polylines,M=v.polygons,b=v.totalLength,x=!!(null==p?void 0:p.length),P=!1;return(u||x)&&(P=function(t,n,e,r,i,a,u){for(var s=!1,f=n/2,h=0;h<t.length;h++){var l=t[h],d=l.currentPoint,p=l.params,v=l.prePoint,y=l.box;if(!y||Lo(y.x-f,y.y-f,y.width+n,y.height+n,e,r)){switch(l.command){case"L":case"Z":s=Io(v[0],v[1],d[0],d[1],n,e,r);break;case"Q":s=Co.pointDistance(v[0],v[1],p[1],p[2],p[3],p[4],e,r)<=n/2;break;case"C":s=To.pointDistance(v[0],v[1],p[1],p[2],p[3],p[4],p[5],p[6],e,r,i)<=n/2;break;case"A":var m=l.arcParams,g=m.cx,M=m.cy,b=m.rx,x=m.ry,P=m.startAngle,E=m.endAngle,O=m.xRotation,S=b>x?b:x,C=b>x?1:b/x,A=b>x?x/b:1,j=o.fromTranslation(o.create(),[-g,-M]);o.multiply(j,o.fromRotation(o.create(),-O),j),o.multiply(j,o.fromScaling(o.create(),[1/C,1/A]),j);var w=c.fromValues(e,r);s=Do(0,0,S,P,E,n,(w=c.transformMat3(w,w,j))[0],w[1])}if(s)break}}return s}(y,a,n.x+h,n.y+d,b)),P||!s&&!x||(P=m?e(t,n):Xo(M,n.x+h,n.y+d)||Xo(g,n.x+h,n.y+d)),P}function Wo(t,n,e){var r=t.parsedStyle,o=r.radius,i=r.fill,a=r.stroke,u=r.lineWidth,c=void 0===u?0:u,s=r.width,f=r.height,h=r.clipPathTargets,l=!!(null==h?void 0:h.length),d=s.unit,p=s.value,v=f.unit,y=f.value,m=0,g=0;if(""!==d&&"px"!==d||(m=p),""!==v&&"px"!==v||(g=y),o){var M=!1;return(a||l)&&(M=function(t,n,e,r,o,i,a,u){return Io(t+o,n,t+e-o,n,i,a,u)||Io(t+e,n+o,t+e,n+r-o,i,a,u)||Io(t+e-o,n+r,t+o,n+r,i,a,u)||Io(t,n+r-o,t,n+o,i,a,u)||Do(t+e-o,n+o,o,1.5*Math.PI,2*Math.PI,i,a,u)||Do(t+e-o,n+r-o,o,0,.5*Math.PI,i,a,u)||Do(t+o,n+r-o,o,.5*Math.PI,Math.PI,i,a,u)||Do(t+o,n+o,o,Math.PI,1.5*Math.PI,i,a,u)}(0,0,m,g,o,c,n.x,n.y)),M||!i&&!l||(M=e(t,n)),M}var b=c/2;return i&&a||l?Lo(0-b,0-b,m+b,g+b,n.x,n.y):i?Lo(0,0,m,g,n.x,n.y):!!a&&function(t,n,e,r,o,i,a){var u=o/2;return Lo(t-u,n-u,e,o,i,a)||Lo(t+e-u,n-u,o,r,i,a)||Lo(t+u,n+r-u,e,o,i,a)||Lo(t-u,n+u,o,r,i,a)}(0,0,m,g,c,n.x,n.y)}function zo(t,n){var e=t.parsedStyle,r=e.stroke,o=e.fill,i=e.lineWidth,a=void 0===i?0:i,u=e.points,c=e.defX,s=void 0===c?0:c,f=e.defY,h=void 0===f?0:f,l=e.clipPathTargets,d=!!(null==l?void 0:l.length),p=!1;return(r||d)&&(p=_o(u.points,a,n.x+s,n.y+h,!0)),p||!o&&!d||(p=qo(u.points,n.x+s,n.y+h)),p}var Qo=Object(M.Module)((function(t){t({token:"PointInPathPicker",useFactory:function(t){return function(t){return t===g.SHAPE.Circle?Ho:t===g.SHAPE.Ellipse?Go:t===g.SHAPE.Rect?Wo:t===g.SHAPE.Line?$o:t===g.SHAPE.Polyline?Vo:t===g.SHAPE.Polygon?zo:t===g.SHAPE.Path?Uo:t===g.SHAPE.Image||t===g.SHAPE.Text?function(){return!0}:null}}}),t(vo)})),Zo=function(){function t(){}return t.prototype.init=function(t){t.load(Qo,!0)},t.prototype.destroy=function(t){t.unload(Qo)},t}(),Jo=function(){function t(){}var n;return n=t,t.prototype.apply=function(t){var e=this,r=function(t){var n=t.target;if(n.nodeName===g.SHAPE.HTML){var r=n.parsedStyle.innerHTML,o="g-html-"+n.entity,i=e.contextService.getDomElement().parentNode;if(i)if(!i.querySelector("#"+o)){var a=document.createElement("div");n.parsedStyle.$el=a,a.id=o,N(r)?a.innerHTML=r:a.appendChild(r),i.appendChild(a)}}},o=function(t){var n=t.target;if(n.nodeName===g.SHAPE.HTML){var r="g-html-"+n.entity,o=e.contextService.getDomElement().parentNode;if(o){var i=o.querySelector("#"+r);i&&o.removeChild(i)}}};t.hooks.init.tap(n.tag,(function(){e.renderingContext.root.addEventListener(g.ElementEvent.MOUNTED,r),e.renderingContext.root.addEventListener(g.ElementEvent.UNMOUNTED,o)})),t.hooks.destroy.tap(n.tag,(function(){e.renderingContext.root.removeEventListener(g.ElementEvent.MOUNTED,r),e.renderingContext.root.removeEventListener(g.ElementEvent.UNMOUNTED,o)})),t.hooks.render.tap(n.tag,(function(t){if(t.nodeName===g.SHAPE.HTML){var n="g-html-"+t.entity,r=e.contextService.getDomElement().parentNode;if(r){var o=r.querySelector("#"+n);e.updateCSSStyle(o,t.parsedStyle,t)}}}))},t.prototype.updateCSSStyle=function(t,n,e){var r=n.zIndex,o=void 0===r?0:r,i=n.visibility,a=void 0===i?"visible":i,u=n.opacity,c=void 0===u?1:u,s=n.fill,f=n.lineWidth,h=void 0===f?0:f,l=n.lineDash,d=n.stroke,p=n.anchor,v=n.width,y=n.height,m=n.style,M=void 0===m?"":m,b=n.className,x=void 0===b?"":b,P=0,E=0,O=v.unit,S=v.value,C=y.unit,A=y.value;""!==O&&"px"!==O||(P=S),""!==C&&"px"!==C||(E=A);var j={position:"absolute",top:0,left:0};if(j.width=P+"px",j.height=E+"px",j.transform="matrix3d("+e.getWorldTransform().join(",")+")",p&&(j.transform+=" translate("+100*p[0]+"%, "+100*p[0]+"%)"),e.style.transformOrigin&&(j["transform-origin"]=e.style.transformOrigin),j["z-index"]=o,j.visibility=a,j.opacity=c,s){var w="";if(s.type===g.PARSED_COLOR_TYPE.Constant)w=s.formatted;else if(s.type===g.PARSED_COLOR_TYPE.LinearGradient){w="linear-gradient(to right, "+s.value.steps.map((function(t){return t[1]+" "+100*Number(t[0])+"%"})).join(",")+");"}else s.type===g.PARSED_COLOR_TYPE.RadialGradient||(s.type,g.PARSED_COLOR_TYPE.Pattern);j.background=w}j["border-width"]=h+"px",d&&d.type===g.PARSED_COLOR_TYPE.Constant&&(j["border-color"]=d.formatted,j["border-style"]="solid"),l&&(j["border-style"]="dashed"),e.style.filter&&(j.filter=e.style.filter),x&&(Array.isArray(x)?x.forEach((function(n){t.classList.add(n)})):t.classList.add(x)),t.setAttribute("style",Object.keys(j).map((function(t){return t+":"+j[t]})).join(";")+M)},t.tag="HTMLRenderingPlugin",p([Object(M.inject)(g.ContextService),v("design:type",Object)],t.prototype,"contextService",void 0),p([Object(M.inject)(g.RenderingContext),v("design:type",Object)],t.prototype,"renderingContext",void 0),t=n=p([Object(M.singleton)({contrib:g.RenderingPluginContribution})],t)}(),Ko=Object(M.Module)((function(t){t(Jo)})),ti=function(){function t(){}return t.prototype.init=function(t){t.load(Ko,!0)},t.prototype.destroy=function(t){t.unload(Ko)},t}(),ni="undefined"!=typeof window&&void 0!==window.document;var ei=function(){function t(){}return t.prototype.init=function(){var t=this.canvasConfig,n=t.container,e=t.canvas,r=t.devicePixelRatio;if(e)this.$canvas=e,n&&e.parentElement!==n&&n.appendChild(e),this.$container=e.parentElement,this.canvasConfig.container=this.$container;else if(n&&(this.$container=N(n)?document.getElementById(n):n,this.$container)){var o=document.createElement("canvas");this.$container.appendChild(o),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=o}this.context=this.$canvas.getContext("2d");var i=r||ni&&window.devicePixelRatio||1;i=i>=1?Math.ceil(i):1,this.dpr=i,this.resize(this.canvasConfig.width,this.canvasConfig.height)},t.prototype.getContext=function(){return this.context},t.prototype.getDomElement=function(){return this.$canvas},t.prototype.getDPR=function(){return this.dpr},t.prototype.getBoundingClientRect=function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()},t.prototype.destroy=function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)},t.prototype.resize=function(t,n){if(this.$canvas){this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*n,function(t,n,e){ni&&t.style&&(t.style.width=n+"px",t.style.height=e+"px")}(this.$canvas,t,n);var e=this.getDPR();this.context.scale(e,e)}},t.prototype.applyCursorStyle=function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)},p([Object(M.inject)(g.CanvasConfig),v("design:type",Object)],t.prototype,"canvasConfig",void 0),t=p([Object(M.singleton)({token:g.ContextService})],t)}(),ri=Object(M.Module)((function(t){t(ei)})),oi=function(){function t(){}return t.prototype.init=function(t){t.load(ri,!0)},t.prototype.destroy=function(t){t.unload(ri)},t}(),ii=function(t){function n(n){var e=t.call(this,n)||this;return e.registerPlugin(new oi),e.registerPlugin(new po),e.registerPlugin(new O),e.registerPlugin(new Zo),e.registerPlugin(new ti),e}return function(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}l(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}(n,t),n}(g.AbstractRenderer)}])}));
16
+ var l=function(t,n){return(l=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)};var d=function(){return(d=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)};function p(t,n,e,r){var o,a=arguments.length,i=a<3?n:null===r?r=Object.getOwnPropertyDescriptor(n,e):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,n,e,r);else for(var u=t.length-1;u>=0;u--)(o=t[u])&&(i=(a<3?o(i):a>3?o(n,e,i):o(n,e))||i);return a>3&&i&&Object.defineProperty(n,e,i),i}function v(t,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,n)}Object.create;function y(t,n){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var r,o,a=e.call(t),i=[];try{for(;(void 0===n||n-- >0)&&!(r=a.next()).done;)i.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(e=a.return)&&e.call(a)}finally{if(o)throw o.error}}return i}function m(t,n,e){if(e||2===arguments.length)for(var r,o=0,a=n.length;o<a;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return t.concat(r||Array.prototype.slice.call(n))}Object.create;var g=e(0),M=e(1),b=function(){function t(){}var n;return n=t,t.prototype.apply=function(t){var e=this,r=function(n){t.hooks.pointerMove.call(n)},o=function(n){t.hooks.pointerUp.call(n)},a=function(n){t.hooks.pointerDown.call(n)},i=function(n){t.hooks.pointerOver.call(n)},u=function(n){t.hooks.pointerOut.call(n)},c=function(n){t.hooks.pointerWheel.call(n)};t.hooks.init.tap(n.tag,(function(){var t=e.contextService.getDomElement();g.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",r,!0),t.addEventListener("pointerdown",a,!0),t.addEventListener("pointerleave",u,!0),t.addEventListener("pointerover",i,!0),globalThis.addEventListener("pointerup",o,!0)):(globalThis.document.addEventListener("mousemove",r,!0),t.addEventListener("mousedown",a,!0),t.addEventListener("mouseout",u,!0),t.addEventListener("mouseover",i,!0),globalThis.addEventListener("mouseup",o,!0)),g.supportsTouchEvents&&(t.addEventListener("touchstart",a,!0),t.addEventListener("touchend",o,!0),t.addEventListener("touchmove",r,!0)),t.addEventListener("wheel",c,{passive:!0,capture:!0})})),t.hooks.destroy.tap(n.tag,(function(){var t=e.contextService.getDomElement();g.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",r,!0),t.removeEventListener("pointerdown",a,!0),t.removeEventListener("pointerleave",u,!0),t.removeEventListener("pointerover",i,!0),globalThis.removeEventListener("pointerup",o,!0)):(globalThis.document.removeEventListener("mousemove",r,!0),t.removeEventListener("mousedown",a,!0),t.removeEventListener("mouseout",u,!0),t.removeEventListener("mouseover",i,!0),globalThis.removeEventListener("mouseup",o,!0)),g.supportsTouchEvents&&(t.removeEventListener("touchstart",a,!0),t.removeEventListener("touchend",o,!0),t.removeEventListener("touchmove",r,!0)),t.removeEventListener("wheel",c,!0)}))},t.tag="DOMInteractionPlugin",p([Object(M.inject)(g.ContextService),v("design:type",Object)],t.prototype,"contextService",void 0),t=n=p([Object(M.singleton)({contrib:g.RenderingPluginContribution})],t)}(),x=Object(M.Module)((function(t){t(b)})),P=function(){function t(){}return t.prototype.init=function(t){t.load(x,!0)},t.prototype.destroy=function(t){t.unload(x)},t}(),O=e(2),E=e.n(O),S=M.Syringe.defineToken("StyleRendererFactory"),C=M.Syringe.defineToken("StyleRenderer"),A={}.toString,j=function(t,n){return A.call(t)==="[object "+n+"]"},T=function(t){return j(t,"Function")},B=function(t){return null==t},R=function(t){return Array.isArray?Array.isArray(t):j(t,"Array")},w=function(t){var n=typeof t;return null!==t&&"object"===n||"function"===n};var L=function(t,n){if(t)if(R(t))for(var e=0,r=t.length;e<r&&!1!==n(t[e],e);e++);else if(w(t))for(var o in t)if(t.hasOwnProperty(o)&&!1===n(t[o],o))break};Object.keys;var k=function(t){if(R(t))return t.reduce((function(t,n){return Math.max(t,n)}),t[0])},I=function(t){if(R(t))return t.reduce((function(t,n){return Math.min(t,n)}),t[0])},D=Array.prototype,Y=(D.splice,D.indexOf,Array.prototype.splice,function(t){return j(t,"String")});Object.prototype.hasOwnProperty;var N=function(t){return j(t,"Number")};Number.isInteger&&Number.isInteger;Math.PI,parseInt,Math.PI;var _=Object.values?function(t){return Object.values(t)}:function(t){var n=[];return L(t,(function(e,r){T(t)&&"prototype"===r||n.push(e)})),n};Object.prototype;Object.prototype.hasOwnProperty;var X;Object.prototype.hasOwnProperty;(function(t,n){if(!T(t))throw new TypeError("Expected a function");var e=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];var a=n?n.apply(this,r):r[0],i=e.cache;if(i.has(a))return i.get(a);var u=t.apply(this,r);return i.set(a,u),u};e.cache=new Map})((function(t,n){void 0===n&&(n={});var e=n.fontSize,r=n.fontFamily,o=n.fontWeight,a=n.fontStyle,i=n.fontVariant;return X||(X=document.createElement("canvas").getContext("2d")),X.font=[a,i,o,e+"px",r].join(" "),X.measureText(Y(t)?t:"").width}),(function(t,n){return void 0===n&&(n={}),function(){for(var t=0,n=0,e=arguments.length;n<e;n++)t+=arguments[n].length;var r=Array(t),o=0;for(n=0;n<e;n++)for(var a=arguments[n],i=0,u=a.length;i<u;i++,o++)r[o]=a[i];return r}([t],_(n)).join("")})),function(){function t(){this.map={}}t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,n){var e=this.map[t];return void 0===e?n:e},t.prototype.set=function(t,n){this.map[t]=n},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length}}();var q=function(){function t(){}return t.prototype.hash=function(t){return""},t.prototype.render=function(t,n){var e=n.fill,r=n.opacity,o=n.fillOpacity,a=n.stroke,i=n.strokeOpacity,u=n.lineWidth,c=n.lineCap,s=n.lineJoin,f=n.shadowColor,h=n.filter,l=n.miterLimit;if(B(e)||(B(o)||1===o?t.fill():(t.globalAlpha=o,t.fill(),t.globalAlpha=r)),!B(a)&&u&&u.value>0){!B(i)&&1!==i&&(t.globalAlpha=i),t.lineWidth=u.value,B(l)||(t.miterLimit=l),B(c)||(t.lineCap=c),B(s)||(t.lineJoin=s);var d=void 0,p=void 0,v=void 0,y=!B(f),m=!B(h);y&&(d=t.shadowBlur,p=t.shadowColor,B(d)||(t.shadowColor="transparent",t.shadowBlur=0)),m&&(v=t.filter,!B(v)&&v.indexOf("drop-shadow")>-1&&(t.filter=v.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")),t.stroke(),y&&(t.shadowColor=p,t.shadowBlur=d),m&&(t.filter=v)}},t=p([Object(M.singleton)({token:[{token:C,named:g.Shape.CIRCLE},{token:C,named:g.Shape.ELLIPSE},{token:C,named:g.Shape.RECT},{token:C,named:g.Shape.LINE},{token:C,named:g.Shape.POLYLINE},{token:C,named:g.Shape.POLYGON},{token:C,named:g.Shape.PATH}]})],t)}(),F=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;return this.imageCache[t]?Promise.resolve(this.imageCache[t]):new Promise((function(e,r){var o=new window.Image;o.onload=function(){e(o)},o.onerror=function(t){r(t)},o.crossOrigin="Anonymous",o.src=t,n.imageCache[t]=o}))},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 o=e.generatePatternKey(t),a=n.createPattern(r,t.repetition);return a&&(e.patternCache[o]=a),e.patternCache[o]}))},t.prototype.generatePatternKey=function(t){var n=t.src,e=t.repetition;return"pattern-".concat(n,"-").concat(e)},t=p([Object(M.singleton)()],t)}(),G=function(){function t(){}return t.prototype.hash=function(t){return""},t.prototype.render=function(t,n){var e,r=n.widthInPixels,o=n.heightInPixels,a=n.img,i=r,u=o;Y(a)?e=this.imagePool.getImageSync(a):(i||(i=a.width),u||(u=a.height),e=a),t.drawImage(e,0,0,i,u)},p([Object(M.inject)(F),v("design:type",F)],t.prototype,"imagePool",void 0),t=p([Object(M.singleton)({token:{token:C,named:g.Shape.IMAGE}})],t)}(),$=function(){function t(){}return t.prototype.hash=function(t){return""},t.prototype.render=function(t,n,e){var r=n.lineWidth,o=n.textAlign,a=n.textBaseline,i=n.lineJoin,u=n.miterLimit,c=void 0===u?0:u,s=n.letterSpacing,f=void 0===s?0:s,h=n.stroke,l=n.fill,d=n.fillOpacity,p=n.strokeOpacity,v=n.opacity,y=n.metrics,m=n.dx,g=n.dy,M=y.font,b=y.lines,x=y.height,P=y.lineHeight,O=y.lineMetrics;t.font=M,t.lineWidth=r.value,t.textAlign=o,t.textBaseline=a,t.lineJoin=i,t.miterLimit=c;var E=0;"middle"===a?E=-x/2-P/2:"bottom"===a||"alphabetic"===a||"ideographic"===a?E=-x:"top"!==a&&"hanging"!==a||(E=-P);var S=0;m&&"px"===m.unit&&(S+=m.value),g&&"px"===g.unit&&(E+=g.value);for(var C=0;C<b.length;C++){var A=r.value/2+S;E+=P,!B(h)&&r&&r.value&&this.drawLetterSpacing(t,b[C],O[C],o,A,E,f,d,p,v,!0),B(l)||this.drawLetterSpacing(t,b[C],O[C],o,A,E,f,d,p,v)}},t.prototype.drawLetterSpacing=function(t,n,e,r,o,a,i,u,c,s,f){if(void 0===f&&(f=!1),0!==i){var h=t.textAlign;t.textAlign="left";var l=o;"center"===r?l=o-e.width/2:"right"!==r&&"end"!==r||(l=o-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];f?this.strokeText(t,m,l,a,c):this.fillText(t,m,l,a,u,s),l+=p-(v=t.measureText(n.substring(y+1)).width)+i,p=v}t.textAlign=h}else f?this.strokeText(t,n,o,a,c):this.fillText(t,n,o,a,u,s)},t.prototype.fillText=function(t,n,e,r,o,a){var i,u=!B(o)&&1!==o;u&&(i=t.globalAlpha,t.globalAlpha=o*a),t.fillText(n,e,r),u&&(t.globalAlpha=i)},t.prototype.strokeText=function(t,n,e,r,o){var a,i=!B(o)&&1!==o;i&&(a=t.globalAlpha,t.globalAlpha=o),t.strokeText(n,e,r),i&&(t.globalAlpha=a)},p([Object(M.inject)(g.TextService),v("design:type",g.TextService)],t.prototype,"textService",void 0),t=p([Object(M.singleton)({token:{token:C,named:g.Shape.TEXT}})],t)}(),H=function(){function t(){this.gradientCache={}}return t.prototype.getOrCreateGradient=function(t,n){var e=this.generateCacheKey(t),r=t.type,o=t.x0,a=t.y0,i=t.x1,u=t.y1,c=t.steps,s=t.width,f=t.height;if(this.gradientCache[e])return this.gradientCache[e];var h=null;if(r===g.PARSED_COLOR_TYPE.LinearGradient)h=n.createLinearGradient(o*s,a*f,i*s,u*f);else if(r===g.PARSED_COLOR_TYPE.RadialGradient){var l=Math.sqrt(s*s+f*f)/2;h=n.createRadialGradient(o*s,a*f,0,i*s,u*f,t.r1*l)}return h&&(c.forEach((function(t){var n=y(t,2),e=n[0],r=n[1];null==h||h.addColorStop(Number(e),r)})),this.gradientCache[e]=h),this.gradientCache[e]},t.prototype.generateCacheKey=function(t){var n=t.type,e=t.x0,r=t.y0,o=t.x1,a=t.y1,i=t.r1,u=t.steps,c=t.width,s=t.height;return"gradient-".concat(n,"-").concat(e,"-").concat(r,"-").concat(o,"-").concat(a,"-").concat(i||0,"-").concat(c,"-").concat(s,"-").concat(u.map((function(t){return t.join("")})).join("-"))},t=p([Object(M.singleton)()],t)}();var V="PathGeneratorFactory",U="PathGenerator",W=1e-6,z="undefined"!=typeof Float32Array?Float32Array:Array,Q=Math.random;Math.PI;function Z(){var t=new z(9);return z!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function J(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[4],t[4]=n[5],t[5]=n[6],t[6]=n[8],t[7]=n[9],t[8]=n[10],t}function K(t){var n=new z(9);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}function tt(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}function nt(t,n,e,r,o,a,i,u,c){var s=new z(9);return s[0]=t,s[1]=n,s[2]=e,s[3]=r,s[4]=o,s[5]=a,s[6]=i,s[7]=u,s[8]=c,s}function et(t,n,e,r,o,a,i,u,c,s){return t[0]=n,t[1]=e,t[2]=r,t[3]=o,t[4]=a,t[5]=i,t[6]=u,t[7]=c,t[8]=s,t}function rt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function ot(t,n){if(t===n){var e=n[1],r=n[2],o=n[5];t[1]=n[3],t[2]=n[6],t[3]=e,t[5]=n[7],t[6]=r,t[7]=o}else t[0]=n[0],t[1]=n[3],t[2]=n[6],t[3]=n[1],t[4]=n[4],t[5]=n[7],t[6]=n[2],t[7]=n[5],t[8]=n[8];return t}function at(t,n){var e=n[0],r=n[1],o=n[2],a=n[3],i=n[4],u=n[5],c=n[6],s=n[7],f=n[8],h=f*i-u*s,l=-f*a+u*c,d=s*a-i*c,p=e*h+r*l+o*d;return p?(p=1/p,t[0]=h*p,t[1]=(-f*r+o*s)*p,t[2]=(u*r-o*i)*p,t[3]=l*p,t[4]=(f*e-o*c)*p,t[5]=(-u*e+o*a)*p,t[6]=d*p,t[7]=(-s*e+r*c)*p,t[8]=(i*e-r*a)*p,t):null}function it(t,n){var e=n[0],r=n[1],o=n[2],a=n[3],i=n[4],u=n[5],c=n[6],s=n[7],f=n[8];return t[0]=i*f-u*s,t[1]=o*s-r*f,t[2]=r*u-o*i,t[3]=u*c-a*f,t[4]=e*f-o*c,t[5]=o*a-e*u,t[6]=a*s-i*c,t[7]=r*c-e*s,t[8]=e*i-r*a,t}function ut(t){var n=t[0],e=t[1],r=t[2],o=t[3],a=t[4],i=t[5],u=t[6],c=t[7],s=t[8];return n*(s*a-i*c)+e*(-s*o+i*u)+r*(c*o-a*u)}function ct(t,n,e){var r=n[0],o=n[1],a=n[2],i=n[3],u=n[4],c=n[5],s=n[6],f=n[7],h=n[8],l=e[0],d=e[1],p=e[2],v=e[3],y=e[4],m=e[5],g=e[6],M=e[7],b=e[8];return t[0]=l*r+d*i+p*s,t[1]=l*o+d*u+p*f,t[2]=l*a+d*c+p*h,t[3]=v*r+y*i+m*s,t[4]=v*o+y*u+m*f,t[5]=v*a+y*c+m*h,t[6]=g*r+M*i+b*s,t[7]=g*o+M*u+b*f,t[8]=g*a+M*c+b*h,t}function st(t,n,e){var r=n[0],o=n[1],a=n[2],i=n[3],u=n[4],c=n[5],s=n[6],f=n[7],h=n[8],l=e[0],d=e[1];return t[0]=r,t[1]=o,t[2]=a,t[3]=i,t[4]=u,t[5]=c,t[6]=l*r+d*i+s,t[7]=l*o+d*u+f,t[8]=l*a+d*c+h,t}function ft(t,n,e){var r=n[0],o=n[1],a=n[2],i=n[3],u=n[4],c=n[5],s=n[6],f=n[7],h=n[8],l=Math.sin(e),d=Math.cos(e);return t[0]=d*r+l*i,t[1]=d*o+l*u,t[2]=d*a+l*c,t[3]=d*i-l*r,t[4]=d*u-l*o,t[5]=d*c-l*a,t[6]=s,t[7]=f,t[8]=h,t}function ht(t,n,e){var r=e[0],o=e[1];return t[0]=r*n[0],t[1]=r*n[1],t[2]=r*n[2],t[3]=o*n[3],t[4]=o*n[4],t[5]=o*n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t}function lt(t,n){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=n[0],t[7]=n[1],t[8]=1,t}function dt(t,n){var e=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1]=e,t[2]=0,t[3]=-e,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function pt(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=0,t[4]=n[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function vt(t,n){return t[0]=n[0],t[1]=n[1],t[2]=0,t[3]=n[2],t[4]=n[3],t[5]=0,t[6]=n[4],t[7]=n[5],t[8]=1,t}function yt(t,n){var e=n[0],r=n[1],o=n[2],a=n[3],i=e+e,u=r+r,c=o+o,s=e*i,f=r*i,h=r*u,l=o*i,d=o*u,p=o*c,v=a*i,y=a*u,m=a*c;return t[0]=1-h-p,t[3]=f-m,t[6]=l+y,t[1]=f+m,t[4]=1-s-p,t[7]=d-v,t[2]=l-y,t[5]=d+v,t[8]=1-s-h,t}function mt(t,n){var e=n[0],r=n[1],o=n[2],a=n[3],i=n[4],u=n[5],c=n[6],s=n[7],f=n[8],h=n[9],l=n[10],d=n[11],p=n[12],v=n[13],y=n[14],m=n[15],g=e*u-r*i,M=e*c-o*i,b=e*s-a*i,x=r*c-o*u,P=r*s-a*u,O=o*s-a*c,E=f*v-h*p,S=f*y-l*p,C=f*m-d*p,A=h*y-l*v,j=h*m-d*v,T=l*m-d*y,B=g*T-M*j+b*A+x*C-P*S+O*E;return B?(B=1/B,t[0]=(u*T-c*j+s*A)*B,t[1]=(c*C-i*T-s*S)*B,t[2]=(i*j-u*C+s*E)*B,t[3]=(o*j-r*T-a*A)*B,t[4]=(e*T-o*C+a*S)*B,t[5]=(r*C-e*j-a*E)*B,t[6]=(v*O-y*P+m*x)*B,t[7]=(y*b-p*O-m*M)*B,t[8]=(p*P-v*b+m*g)*B,t):null}function gt(t,n,e){return t[0]=2/n,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/e,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function Mt(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function bt(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function xt(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}function Pt(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}function Ot(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}function Et(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}function St(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]}function Ct(t,n){var e=t[0],r=t[1],o=t[2],a=t[3],i=t[4],u=t[5],c=t[6],s=t[7],f=t[8],h=n[0],l=n[1],d=n[2],p=n[3],v=n[4],y=n[5],m=n[6],g=n[7],M=n[8];return Math.abs(e-h)<=W*Math.max(1,Math.abs(e),Math.abs(h))&&Math.abs(r-l)<=W*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(o-d)<=W*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(a-p)<=W*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(i-v)<=W*Math.max(1,Math.abs(i),Math.abs(v))&&Math.abs(u-y)<=W*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(c-m)<=W*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(s-g)<=W*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(f-M)<=W*Math.max(1,Math.abs(f),Math.abs(M))}Math.hypot||(Math.hypot=function(){for(var t=0,n=arguments.length;n--;)t+=arguments[n]*arguments[n];return Math.sqrt(t)});var At=ct,jt=Pt;function Tt(){var t=new z(16);return z!=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 Bt(t){var n=new z(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 Rt(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 wt(t,n,e,r,o,a,i,u,c,s,f,h,l,d,p,v){var y=new z(16);return y[0]=t,y[1]=n,y[2]=e,y[3]=r,y[4]=o,y[5]=a,y[6]=i,y[7]=u,y[8]=c,y[9]=s,y[10]=f,y[11]=h,y[12]=l,y[13]=d,y[14]=p,y[15]=v,y}function Lt(t,n,e,r,o,a,i,u,c,s,f,h,l,d,p,v,y){return t[0]=n,t[1]=e,t[2]=r,t[3]=o,t[4]=a,t[5]=i,t[6]=u,t[7]=c,t[8]=s,t[9]=f,t[10]=h,t[11]=l,t[12]=d,t[13]=p,t[14]=v,t[15]=y,t}function kt(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 It(t,n){if(t===n){var e=n[1],r=n[2],o=n[3],a=n[6],i=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]=a,t[11]=n[14],t[12]=o,t[13]=i,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 Dt(t,n){var e=n[0],r=n[1],o=n[2],a=n[3],i=n[4],u=n[5],c=n[6],s=n[7],f=n[8],h=n[9],l=n[10],d=n[11],p=n[12],v=n[13],y=n[14],m=n[15],g=e*u-r*i,M=e*c-o*i,b=e*s-a*i,x=r*c-o*u,P=r*s-a*u,O=o*s-a*c,E=f*v-h*p,S=f*y-l*p,C=f*m-d*p,A=h*y-l*v,j=h*m-d*v,T=l*m-d*y,B=g*T-M*j+b*A+x*C-P*S+O*E;return B?(B=1/B,t[0]=(u*T-c*j+s*A)*B,t[1]=(o*j-r*T-a*A)*B,t[2]=(v*O-y*P+m*x)*B,t[3]=(l*P-h*O-d*x)*B,t[4]=(c*C-i*T-s*S)*B,t[5]=(e*T-o*C+a*S)*B,t[6]=(y*b-p*O-m*M)*B,t[7]=(f*O-l*b+d*M)*B,t[8]=(i*j-u*C+s*E)*B,t[9]=(r*C-e*j-a*E)*B,t[10]=(p*P-v*b+m*g)*B,t[11]=(h*b-f*P-d*g)*B,t[12]=(u*S-i*A-c*E)*B,t[13]=(e*A-r*S+o*E)*B,t[14]=(v*M-p*x-y*g)*B,t[15]=(f*x-h*M+l*g)*B,t):null}function Yt(t,n){var e=n[0],r=n[1],o=n[2],a=n[3],i=n[4],u=n[5],c=n[6],s=n[7],f=n[8],h=n[9],l=n[10],d=n[11],p=n[12],v=n[13],y=n[14],m=n[15];return t[0]=u*(l*m-d*y)-h*(c*m-s*y)+v*(c*d-s*l),t[1]=-(r*(l*m-d*y)-h*(o*m-a*y)+v*(o*d-a*l)),t[2]=r*(c*m-s*y)-u*(o*m-a*y)+v*(o*s-a*c),t[3]=-(r*(c*d-s*l)-u*(o*d-a*l)+h*(o*s-a*c)),t[4]=-(i*(l*m-d*y)-f*(c*m-s*y)+p*(c*d-s*l)),t[5]=e*(l*m-d*y)-f*(o*m-a*y)+p*(o*d-a*l),t[6]=-(e*(c*m-s*y)-i*(o*m-a*y)+p*(o*s-a*c)),t[7]=e*(c*d-s*l)-i*(o*d-a*l)+f*(o*s-a*c),t[8]=i*(h*m-d*v)-f*(u*m-s*v)+p*(u*d-s*h),t[9]=-(e*(h*m-d*v)-f*(r*m-a*v)+p*(r*d-a*h)),t[10]=e*(u*m-s*v)-i*(r*m-a*v)+p*(r*s-a*u),t[11]=-(e*(u*d-s*h)-i*(r*d-a*h)+f*(r*s-a*u)),t[12]=-(i*(h*y-l*v)-f*(u*y-c*v)+p*(u*l-c*h)),t[13]=e*(h*y-l*v)-f*(r*y-o*v)+p*(r*l-o*h),t[14]=-(e*(u*y-c*v)-i*(r*y-o*v)+p*(r*c-o*u)),t[15]=e*(u*l-c*h)-i*(r*l-o*h)+f*(r*c-o*u),t}function Nt(t){var n=t[0],e=t[1],r=t[2],o=t[3],a=t[4],i=t[5],u=t[6],c=t[7],s=t[8],f=t[9],h=t[10],l=t[11],d=t[12],p=t[13],v=t[14],y=t[15];return(n*i-e*a)*(h*y-l*v)-(n*u-r*a)*(f*y-l*p)+(n*c-o*a)*(f*v-h*p)+(e*u-r*i)*(s*y-l*d)-(e*c-o*i)*(s*v-h*d)+(r*c-o*u)*(s*p-f*d)}function _t(t,n,e){var r=n[0],o=n[1],a=n[2],i=n[3],u=n[4],c=n[5],s=n[6],f=n[7],h=n[8],l=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],P=e[3];return t[0]=M*r+b*u+x*h+P*v,t[1]=M*o+b*c+x*l+P*y,t[2]=M*a+b*s+x*d+P*m,t[3]=M*i+b*f+x*p+P*g,M=e[4],b=e[5],x=e[6],P=e[7],t[4]=M*r+b*u+x*h+P*v,t[5]=M*o+b*c+x*l+P*y,t[6]=M*a+b*s+x*d+P*m,t[7]=M*i+b*f+x*p+P*g,M=e[8],b=e[9],x=e[10],P=e[11],t[8]=M*r+b*u+x*h+P*v,t[9]=M*o+b*c+x*l+P*y,t[10]=M*a+b*s+x*d+P*m,t[11]=M*i+b*f+x*p+P*g,M=e[12],b=e[13],x=e[14],P=e[15],t[12]=M*r+b*u+x*h+P*v,t[13]=M*o+b*c+x*l+P*y,t[14]=M*a+b*s+x*d+P*m,t[15]=M*i+b*f+x*p+P*g,t}function Xt(t,n,e){var r,o,a,i,u,c,s,f,h,l,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],o=n[1],a=n[2],i=n[3],u=n[4],c=n[5],s=n[6],f=n[7],h=n[8],l=n[9],d=n[10],p=n[11],t[0]=r,t[1]=o,t[2]=a,t[3]=i,t[4]=u,t[5]=c,t[6]=s,t[7]=f,t[8]=h,t[9]=l,t[10]=d,t[11]=p,t[12]=r*v+u*y+h*m+n[12],t[13]=o*v+c*y+l*m+n[13],t[14]=a*v+s*y+d*m+n[14],t[15]=i*v+f*y+p*m+n[15]),t}function qt(t,n,e){var r=e[0],o=e[1],a=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]*o,t[5]=n[5]*o,t[6]=n[6]*o,t[7]=n[7]*o,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=n[11]*a,t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],t}function Ft(t,n,e,r){var o,a,i,u,c,s,f,h,l,d,p,v,y,m,g,M,b,x,P,O,E,S,C,A,j=r[0],T=r[1],B=r[2],R=Math.hypot(j,T,B);return R<W?null:(j*=R=1/R,T*=R,B*=R,o=Math.sin(e),i=1-(a=Math.cos(e)),u=n[0],c=n[1],s=n[2],f=n[3],h=n[4],l=n[5],d=n[6],p=n[7],v=n[8],y=n[9],m=n[10],g=n[11],M=j*j*i+a,b=T*j*i+B*o,x=B*j*i-T*o,P=j*T*i-B*o,O=T*T*i+a,E=B*T*i+j*o,S=j*B*i+T*o,C=T*B*i-j*o,A=B*B*i+a,t[0]=u*M+h*b+v*x,t[1]=c*M+l*b+y*x,t[2]=s*M+d*b+m*x,t[3]=f*M+p*b+g*x,t[4]=u*P+h*O+v*E,t[5]=c*P+l*O+y*E,t[6]=s*P+d*O+m*E,t[7]=f*P+p*O+g*E,t[8]=u*S+h*C+v*A,t[9]=c*S+l*C+y*A,t[10]=s*S+d*C+m*A,t[11]=f*S+p*C+g*A,n!==t&&(t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t)}function Gt(t,n,e){var r=Math.sin(e),o=Math.cos(e),a=n[4],i=n[5],u=n[6],c=n[7],s=n[8],f=n[9],h=n[10],l=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]=a*o+s*r,t[5]=i*o+f*r,t[6]=u*o+h*r,t[7]=c*o+l*r,t[8]=s*o-a*r,t[9]=f*o-i*r,t[10]=h*o-u*r,t[11]=l*o-c*r,t}function $t(t,n,e){var r=Math.sin(e),o=Math.cos(e),a=n[0],i=n[1],u=n[2],c=n[3],s=n[8],f=n[9],h=n[10],l=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]=a*o-s*r,t[1]=i*o-f*r,t[2]=u*o-h*r,t[3]=c*o-l*r,t[8]=a*r+s*o,t[9]=i*r+f*o,t[10]=u*r+h*o,t[11]=c*r+l*o,t}function Ht(t,n,e){var r=Math.sin(e),o=Math.cos(e),a=n[0],i=n[1],u=n[2],c=n[3],s=n[4],f=n[5],h=n[6],l=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]=a*o+s*r,t[1]=i*o+f*r,t[2]=u*o+h*r,t[3]=c*o+l*r,t[4]=s*o-a*r,t[5]=f*o-i*r,t[6]=h*o-u*r,t[7]=l*o-c*r,t}function Vt(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 Ut(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 Wt(t,n,e){var r,o,a,i=e[0],u=e[1],c=e[2],s=Math.hypot(i,u,c);return s<W?null:(i*=s=1/s,u*=s,c*=s,r=Math.sin(n),a=1-(o=Math.cos(n)),t[0]=i*i*a+o,t[1]=u*i*a+c*r,t[2]=c*i*a-u*r,t[3]=0,t[4]=i*u*a-c*r,t[5]=u*u*a+o,t[6]=c*u*a+i*r,t[7]=0,t[8]=i*c*a+u*r,t[9]=u*c*a-i*r,t[10]=c*c*a+o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function zt(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 Qt(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 Zt(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 Jt(t,n,e){var r=n[0],o=n[1],a=n[2],i=n[3],u=r+r,c=o+o,s=a+a,f=r*u,h=r*c,l=r*s,d=o*c,p=o*s,v=a*s,y=i*u,m=i*c,g=i*s;return t[0]=1-(d+v),t[1]=h+g,t[2]=l-m,t[3]=0,t[4]=h-g,t[5]=1-(f+v),t[6]=p+y,t[7]=0,t[8]=l+m,t[9]=p-y,t[10]=1-(f+d),t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function Kt(t,n){var e=new z(3),r=-n[0],o=-n[1],a=-n[2],i=n[3],u=n[4],c=n[5],s=n[6],f=n[7],h=r*r+o*o+a*a+i*i;return h>0?(e[0]=2*(u*i+f*r+c*a-s*o)/h,e[1]=2*(c*i+f*o+s*r-u*a)/h,e[2]=2*(s*i+f*a+u*o-c*r)/h):(e[0]=2*(u*i+f*r+c*a-s*o),e[1]=2*(c*i+f*o+s*r-u*a),e[2]=2*(s*i+f*a+u*o-c*r)),Jt(t,n,e),t}function tn(t,n){return t[0]=n[12],t[1]=n[13],t[2]=n[14],t}function nn(t,n){var e=n[0],r=n[1],o=n[2],a=n[4],i=n[5],u=n[6],c=n[8],s=n[9],f=n[10];return t[0]=Math.hypot(e,r,o),t[1]=Math.hypot(a,i,u),t[2]=Math.hypot(c,s,f),t}function en(t,n){var e=new z(3);nn(e,n);var r=1/e[0],o=1/e[1],a=1/e[2],i=n[0]*r,u=n[1]*o,c=n[2]*a,s=n[4]*r,f=n[5]*o,h=n[6]*a,l=n[8]*r,d=n[9]*o,p=n[10]*a,v=i+f+p,y=0;return v>0?(y=2*Math.sqrt(v+1),t[3]=.25*y,t[0]=(h-d)/y,t[1]=(l-c)/y,t[2]=(u-s)/y):i>f&&i>p?(y=2*Math.sqrt(1+i-f-p),t[3]=(h-d)/y,t[0]=.25*y,t[1]=(u+s)/y,t[2]=(l+c)/y):f>p?(y=2*Math.sqrt(1+f-i-p),t[3]=(l-c)/y,t[0]=(u+s)/y,t[1]=.25*y,t[2]=(h+d)/y):(y=2*Math.sqrt(1+p-i-f),t[3]=(u-s)/y,t[0]=(l+c)/y,t[1]=(h+d)/y,t[2]=.25*y),t}function rn(t,n,e,r){var o=n[0],a=n[1],i=n[2],u=n[3],c=o+o,s=a+a,f=i+i,h=o*c,l=o*s,d=o*f,p=a*s,v=a*f,y=i*f,m=u*c,g=u*s,M=u*f,b=r[0],x=r[1],P=r[2];return t[0]=(1-(p+y))*b,t[1]=(l+M)*b,t[2]=(d-g)*b,t[3]=0,t[4]=(l-M)*x,t[5]=(1-(h+y))*x,t[6]=(v+m)*x,t[7]=0,t[8]=(d+g)*P,t[9]=(v-m)*P,t[10]=(1-(h+p))*P,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function on(t,n,e,r,o){var a=n[0],i=n[1],u=n[2],c=n[3],s=a+a,f=i+i,h=u+u,l=a*s,d=a*f,p=a*h,v=i*f,y=i*h,m=u*h,g=c*s,M=c*f,b=c*h,x=r[0],P=r[1],O=r[2],E=o[0],S=o[1],C=o[2],A=(1-(v+m))*x,j=(d+b)*x,T=(p-M)*x,B=(d-b)*P,R=(1-(l+m))*P,w=(y+g)*P,L=(p+M)*O,k=(y-g)*O,I=(1-(l+v))*O;return t[0]=A,t[1]=j,t[2]=T,t[3]=0,t[4]=B,t[5]=R,t[6]=w,t[7]=0,t[8]=L,t[9]=k,t[10]=I,t[11]=0,t[12]=e[0]+E-(A*E+B*S+L*C),t[13]=e[1]+S-(j*E+R*S+k*C),t[14]=e[2]+C-(T*E+w*S+I*C),t[15]=1,t}function an(t,n){var e=n[0],r=n[1],o=n[2],a=n[3],i=e+e,u=r+r,c=o+o,s=e*i,f=r*i,h=r*u,l=o*i,d=o*u,p=o*c,v=a*i,y=a*u,m=a*c;return t[0]=1-h-p,t[1]=f+m,t[2]=l-y,t[3]=0,t[4]=f-m,t[5]=1-s-p,t[6]=d+v,t[7]=0,t[8]=l+y,t[9]=d-v,t[10]=1-s-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function un(t,n,e,r,o,a,i){var u=1/(e-n),c=1/(o-r),s=1/(a-i);return t[0]=2*a*u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*c,t[6]=0,t[7]=0,t[8]=(e+n)*u,t[9]=(o+r)*c,t[10]=(i+a)*s,t[11]=-1,t[12]=0,t[13]=0,t[14]=i*a*2*s,t[15]=0,t}function cn(t,n,e,r,o){var a,i=1/Math.tan(n/2);return t[0]=i/e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=i,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!=o&&o!==1/0?(a=1/(r-o),t[10]=(o+r)*a,t[14]=2*o*r*a):(t[10]=-1,t[14]=-2*r),t}var sn=cn;function fn(t,n,e,r,o){var a,i=1/Math.tan(n/2);return t[0]=i/e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=i,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!=o&&o!==1/0?(a=1/(r-o),t[10]=o*a,t[14]=o*r*a):(t[10]=-1,t[14]=-r),t}function hn(t,n,e,r){var o=Math.tan(n.upDegrees*Math.PI/180),a=Math.tan(n.downDegrees*Math.PI/180),i=Math.tan(n.leftDegrees*Math.PI/180),u=Math.tan(n.rightDegrees*Math.PI/180),c=2/(i+u),s=2/(o+a);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]=-(i-u)*c*.5,t[9]=(o-a)*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 ln(t,n,e,r,o,a,i){var u=1/(n-e),c=1/(r-o),s=1/(a-i);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]=(o+r)*c,t[14]=(i+a)*s,t[15]=1,t}var dn=ln;function pn(t,n,e,r,o,a,i){var u=1/(n-e),c=1/(r-o),s=1/(a-i);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]=(o+r)*c,t[14]=a*s,t[15]=1,t}function vn(t,n,e,r){var o,a,i,u,c,s,f,h,l,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],P=e[2];return Math.abs(p-b)<W&&Math.abs(v-x)<W&&Math.abs(y-P)<W?kt(t):(f=p-b,h=v-x,l=y-P,o=g*(l*=d=1/Math.hypot(f,h,l))-M*(h*=d),a=M*(f*=d)-m*l,i=m*h-g*f,(d=Math.hypot(o,a,i))?(o*=d=1/d,a*=d,i*=d):(o=0,a=0,i=0),u=h*i-l*a,c=l*o-f*i,s=f*a-h*o,(d=Math.hypot(u,c,s))?(u*=d=1/d,c*=d,s*=d):(u=0,c=0,s=0),t[0]=o,t[1]=u,t[2]=f,t[3]=0,t[4]=a,t[5]=c,t[6]=h,t[7]=0,t[8]=i,t[9]=s,t[10]=l,t[11]=0,t[12]=-(o*p+a*v+i*y),t[13]=-(u*p+c*v+s*y),t[14]=-(f*p+h*v+l*y),t[15]=1,t)}function yn(t,n,e,r){var o=n[0],a=n[1],i=n[2],u=r[0],c=r[1],s=r[2],f=o-e[0],h=a-e[1],l=i-e[2],d=f*f+h*h+l*l;d>0&&(f*=d=1/Math.sqrt(d),h*=d,l*=d);var p=c*l-s*h,v=s*f-u*l,y=u*h-c*f;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]=h*y-l*v,t[5]=l*p-f*y,t[6]=f*v-h*p,t[7]=0,t[8]=f,t[9]=h,t[10]=l,t[11]=0,t[12]=o,t[13]=a,t[14]=i,t[15]=1,t}function mn(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 gn(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 Mn(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 bn(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 xn(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 Pn(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 On(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 En(t,n){var e=t[0],r=t[1],o=t[2],a=t[3],i=t[4],u=t[5],c=t[6],s=t[7],f=t[8],h=t[9],l=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],P=n[4],O=n[5],E=n[6],S=n[7],C=n[8],A=n[9],j=n[10],T=n[11],B=n[12],R=n[13],w=n[14],L=n[15];return Math.abs(e-g)<=W*Math.max(1,Math.abs(e),Math.abs(g))&&Math.abs(r-M)<=W*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(o-b)<=W*Math.max(1,Math.abs(o),Math.abs(b))&&Math.abs(a-x)<=W*Math.max(1,Math.abs(a),Math.abs(x))&&Math.abs(i-P)<=W*Math.max(1,Math.abs(i),Math.abs(P))&&Math.abs(u-O)<=W*Math.max(1,Math.abs(u),Math.abs(O))&&Math.abs(c-E)<=W*Math.max(1,Math.abs(c),Math.abs(E))&&Math.abs(s-S)<=W*Math.max(1,Math.abs(s),Math.abs(S))&&Math.abs(f-C)<=W*Math.max(1,Math.abs(f),Math.abs(C))&&Math.abs(h-A)<=W*Math.max(1,Math.abs(h),Math.abs(A))&&Math.abs(l-j)<=W*Math.max(1,Math.abs(l),Math.abs(j))&&Math.abs(d-T)<=W*Math.max(1,Math.abs(d),Math.abs(T))&&Math.abs(p-B)<=W*Math.max(1,Math.abs(p),Math.abs(B))&&Math.abs(v-R)<=W*Math.max(1,Math.abs(v),Math.abs(R))&&Math.abs(y-w)<=W*Math.max(1,Math.abs(y),Math.abs(w))&&Math.abs(m-L)<=W*Math.max(1,Math.abs(m),Math.abs(L))}var Sn=_t,Cn=bn;function An(){var t=new z(3);return z!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function jn(t){var n=new z(3);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n}function Tn(t){var n=t[0],e=t[1],r=t[2];return Math.hypot(n,e,r)}function Bn(t,n,e){var r=new z(3);return r[0]=t,r[1]=n,r[2]=e,r}function Rn(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t}function wn(t,n,e,r){return t[0]=n,t[1]=e,t[2]=r,t}function Ln(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t}function kn(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t}function In(t,n,e){return t[0]=n[0]*e[0],t[1]=n[1]*e[1],t[2]=n[2]*e[2],t}function Dn(t,n,e){return t[0]=n[0]/e[0],t[1]=n[1]/e[1],t[2]=n[2]/e[2],t}function Yn(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t[2]=Math.ceil(n[2]),t}function Nn(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t[2]=Math.floor(n[2]),t}function _n(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 Xn(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 qn(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t[2]=Math.round(n[2]),t}function Fn(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t}function Gn(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 $n(t,n){var e=n[0]-t[0],r=n[1]-t[1],o=n[2]-t[2];return Math.hypot(e,r,o)}function Hn(t,n){var e=n[0]-t[0],r=n[1]-t[1],o=n[2]-t[2];return e*e+r*r+o*o}function Vn(t){var n=t[0],e=t[1],r=t[2];return n*n+e*e+r*r}function Un(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t}function Wn(t,n){return t[0]=1/n[0],t[1]=1/n[1],t[2]=1/n[2],t}function zn(t,n){var e=n[0],r=n[1],o=n[2],a=e*e+r*r+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n[0]*a,t[1]=n[1]*a,t[2]=n[2]*a,t}function Qn(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function Zn(t,n,e){var r=n[0],o=n[1],a=n[2],i=e[0],u=e[1],c=e[2];return t[0]=o*c-a*u,t[1]=a*i-r*c,t[2]=r*u-o*i,t}function Jn(t,n,e,r){var o=n[0],a=n[1],i=n[2];return t[0]=o+r*(e[0]-o),t[1]=a+r*(e[1]-a),t[2]=i+r*(e[2]-i),t}function Kn(t,n,e,r,o,a){var i=a*a,u=i*(2*a-3)+1,c=i*(a-2)+a,s=i*(a-1),f=i*(3-2*a);return t[0]=n[0]*u+e[0]*c+r[0]*s+o[0]*f,t[1]=n[1]*u+e[1]*c+r[1]*s+o[1]*f,t[2]=n[2]*u+e[2]*c+r[2]*s+o[2]*f,t}function te(t,n,e,r,o,a){var i=1-a,u=i*i,c=a*a,s=u*i,f=3*a*u,h=3*c*i,l=c*a;return t[0]=n[0]*s+e[0]*f+r[0]*h+o[0]*l,t[1]=n[1]*s+e[1]*f+r[1]*h+o[1]*l,t[2]=n[2]*s+e[2]*f+r[2]*h+o[2]*l,t}function ne(t,n){n=n||1;var e=2*Q()*Math.PI,r=2*Q()-1,o=Math.sqrt(1-r*r)*n;return t[0]=Math.cos(e)*o,t[1]=Math.sin(e)*o,t[2]=r*n,t}function ee(t,n,e){var r=n[0],o=n[1],a=n[2],i=e[3]*r+e[7]*o+e[11]*a+e[15];return i=i||1,t[0]=(e[0]*r+e[4]*o+e[8]*a+e[12])/i,t[1]=(e[1]*r+e[5]*o+e[9]*a+e[13])/i,t[2]=(e[2]*r+e[6]*o+e[10]*a+e[14])/i,t}function re(t,n,e){var r=n[0],o=n[1],a=n[2];return t[0]=r*e[0]+o*e[3]+a*e[6],t[1]=r*e[1]+o*e[4]+a*e[7],t[2]=r*e[2]+o*e[5]+a*e[8],t}function oe(t,n,e){var r=e[0],o=e[1],a=e[2],i=e[3],u=n[0],c=n[1],s=n[2],f=o*s-a*c,h=a*u-r*s,l=r*c-o*u,d=o*l-a*h,p=a*f-r*l,v=r*h-o*f,y=2*i;return f*=y,h*=y,l*=y,d*=2,p*=2,v*=2,t[0]=u+f+d,t[1]=c+h+p,t[2]=s+l+v,t}function ae(t,n,e,r){var o=[],a=[];return o[0]=n[0]-e[0],o[1]=n[1]-e[1],o[2]=n[2]-e[2],a[0]=o[0],a[1]=o[1]*Math.cos(r)-o[2]*Math.sin(r),a[2]=o[1]*Math.sin(r)+o[2]*Math.cos(r),t[0]=a[0]+e[0],t[1]=a[1]+e[1],t[2]=a[2]+e[2],t}function ie(t,n,e,r){var o=[],a=[];return o[0]=n[0]-e[0],o[1]=n[1]-e[1],o[2]=n[2]-e[2],a[0]=o[2]*Math.sin(r)+o[0]*Math.cos(r),a[1]=o[1],a[2]=o[2]*Math.cos(r)-o[0]*Math.sin(r),t[0]=a[0]+e[0],t[1]=a[1]+e[1],t[2]=a[2]+e[2],t}function ue(t,n,e,r){var o=[],a=[];return o[0]=n[0]-e[0],o[1]=n[1]-e[1],o[2]=n[2]-e[2],a[0]=o[0]*Math.cos(r)-o[1]*Math.sin(r),a[1]=o[0]*Math.sin(r)+o[1]*Math.cos(r),a[2]=o[2],t[0]=a[0]+e[0],t[1]=a[1]+e[1],t[2]=a[2]+e[2],t}function ce(t,n){var e=t[0],r=t[1],o=t[2],a=n[0],i=n[1],u=n[2],c=Math.sqrt(e*e+r*r+o*o)*Math.sqrt(a*a+i*i+u*u),s=c&&Qn(t,n)/c;return Math.acos(Math.min(Math.max(s,-1),1))}function se(t){return t[0]=0,t[1]=0,t[2]=0,t}function fe(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function he(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]}function le(t,n){var e=t[0],r=t[1],o=t[2],a=n[0],i=n[1],u=n[2];return Math.abs(e-a)<=W*Math.max(1,Math.abs(e),Math.abs(a))&&Math.abs(r-i)<=W*Math.max(1,Math.abs(r),Math.abs(i))&&Math.abs(o-u)<=W*Math.max(1,Math.abs(o),Math.abs(u))}var de,pe=kn,ve=In,ye=Dn,me=$n,ge=Hn,Me=Tn,be=Vn,xe=(de=An(),function(t,n,e,r,o,a){var i,u;for(n||(n=3),e||(e=0),u=r?Math.min(r*n+e,t.length):t.length,i=e;i<u;i+=n)de[0]=t[i],de[1]=t[i+1],de[2]=t[i+2],o(de,de,a),t[i]=de[0],t[i+1]=de[1],t[i+2]=de[2];return t});function Pe(t){var n=t[0],e=t[1],r=t[2],o=t[3];return Math.hypot(n,e,r,o)}function Oe(t){var n=t[0],e=t[1],r=t[2],o=t[3];return n*n+e*e+r*r+o*o}!function(){var t,n=(t=new z(4),z!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}();function Ee(){var t=new z(4);return z!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Se(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function Ce(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 Ae(t,n){var e=2*Math.acos(n[3]),r=Math.sin(e/2);return r>W?(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 je(t,n){var e=rr(t,n);return Math.acos(2*e*e-1)}function Te(t,n,e){var r=n[0],o=n[1],a=n[2],i=n[3],u=e[0],c=e[1],s=e[2],f=e[3];return t[0]=r*f+i*u+o*s-a*c,t[1]=o*f+i*c+a*u-r*s,t[2]=a*f+i*s+r*c-o*u,t[3]=i*f-r*u-o*c-a*s,t}function Be(t,n,e){e*=.5;var r=n[0],o=n[1],a=n[2],i=n[3],u=Math.sin(e),c=Math.cos(e);return t[0]=r*c+i*u,t[1]=o*c+a*u,t[2]=a*c-o*u,t[3]=i*c-r*u,t}function Re(t,n,e){e*=.5;var r=n[0],o=n[1],a=n[2],i=n[3],u=Math.sin(e),c=Math.cos(e);return t[0]=r*c-a*u,t[1]=o*c+i*u,t[2]=a*c+r*u,t[3]=i*c-o*u,t}function we(t,n,e){e*=.5;var r=n[0],o=n[1],a=n[2],i=n[3],u=Math.sin(e),c=Math.cos(e);return t[0]=r*c+o*u,t[1]=o*c-r*u,t[2]=a*c+i*u,t[3]=i*c-a*u,t}function Le(t,n){var e=n[0],r=n[1],o=n[2];return t[0]=e,t[1]=r,t[2]=o,t[3]=Math.sqrt(Math.abs(1-e*e-r*r-o*o)),t}function ke(t,n){var e=n[0],r=n[1],o=n[2],a=n[3],i=Math.sqrt(e*e+r*r+o*o),u=Math.exp(a),c=i>0?u*Math.sin(i)/i:0;return t[0]=e*c,t[1]=r*c,t[2]=o*c,t[3]=u*Math.cos(i),t}function Ie(t,n){var e=n[0],r=n[1],o=n[2],a=n[3],i=Math.sqrt(e*e+r*r+o*o),u=i>0?Math.atan2(i,a)/i:0;return t[0]=e*u,t[1]=r*u,t[2]=o*u,t[3]=.5*Math.log(e*e+r*r+o*o+a*a),t}function De(t,n,e){return Ie(t,n),er(t,t,e),ke(t,t),t}function Ye(t,n,e,r){var o,a,i,u,c,s=n[0],f=n[1],h=n[2],l=n[3],d=e[0],p=e[1],v=e[2],y=e[3];return(a=s*d+f*p+h*v+l*y)<0&&(a=-a,d=-d,p=-p,v=-v,y=-y),1-a>W?(o=Math.acos(a),i=Math.sin(o),u=Math.sin((1-r)*o)/i,c=Math.sin(r*o)/i):(u=1-r,c=r),t[0]=u*s+c*d,t[1]=u*f+c*p,t[2]=u*h+c*v,t[3]=u*l+c*y,t}function Ne(t){var n=Q(),e=Q(),r=Q(),o=Math.sqrt(1-n),a=Math.sqrt(n);return t[0]=o*Math.sin(2*Math.PI*e),t[1]=o*Math.cos(2*Math.PI*e),t[2]=a*Math.sin(2*Math.PI*r),t[3]=a*Math.cos(2*Math.PI*r),t}function _e(t,n){var e=n[0],r=n[1],o=n[2],a=n[3],i=e*e+r*r+o*o+a*a,u=i?1/i:0;return t[0]=-e*u,t[1]=-r*u,t[2]=-o*u,t[3]=a*u,t}function Xe(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=n[3],t}function qe(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 o=0;n[4]>n[0]&&(o=1),n[8]>n[3*o+o]&&(o=2);var a=(o+1)%3,i=(o+2)%3;e=Math.sqrt(n[3*o+o]-n[3*a+a]-n[3*i+i]+1),t[o]=.5*e,e=.5/e,t[3]=(n[3*a+i]-n[3*i+a])*e,t[a]=(n[3*a+o]+n[3*o+a])*e,t[i]=(n[3*i+o]+n[3*o+i])*e}return t}function Fe(t,n,e,r){var o=.5*Math.PI/180;n*=o,e*=o,r*=o;var a=Math.sin(n),i=Math.cos(n),u=Math.sin(e),c=Math.cos(e),s=Math.sin(r),f=Math.cos(r);return t[0]=a*c*f-i*u*s,t[1]=i*u*f+a*c*s,t[2]=i*c*s-a*u*f,t[3]=i*c*f+a*u*s,t}function Ge(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var $e,He,Ve,Ue,We,ze,Qe=function(t){var n=new z(4);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n},Ze=function(t,n,e,r){var o=new z(4);return o[0]=t,o[1]=n,o[2]=e,o[3]=r,o},Je=function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t},Ke=function(t,n,e,r,o){return t[0]=n,t[1]=e,t[2]=r,t[3]=o,t},tr=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},nr=Te,er=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},rr=function(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+t[3]*n[3]},or=function(t,n,e,r){var o=n[0],a=n[1],i=n[2],u=n[3];return t[0]=o+r*(e[0]-o),t[1]=a+r*(e[1]-a),t[2]=i+r*(e[2]-i),t[3]=u+r*(e[3]-u),t},ar=Pe,ir=ar,ur=Oe,cr=ur,sr=function(t,n){var e=n[0],r=n[1],o=n[2],a=n[3],i=e*e+r*r+o*o+a*a;return i>0&&(i=1/Math.sqrt(i)),t[0]=e*i,t[1]=r*i,t[2]=o*i,t[3]=a*i,t},fr=function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]},hr=function(t,n){var e=t[0],r=t[1],o=t[2],a=t[3],i=n[0],u=n[1],c=n[2],s=n[3];return Math.abs(e-i)<=W*Math.max(1,Math.abs(e),Math.abs(i))&&Math.abs(r-u)<=W*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(o-c)<=W*Math.max(1,Math.abs(o),Math.abs(c))&&Math.abs(a-s)<=W*Math.max(1,Math.abs(a),Math.abs(s))},lr=($e=An(),He=Bn(1,0,0),Ve=Bn(0,1,0),function(t,n,e){var r=Qn(n,e);return r<-.999999?(Zn($e,He,n),Me($e)<1e-6&&Zn($e,Ve,n),zn($e,$e),Ce(t,$e,Math.PI),t):r>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(Zn($e,n,e),t[0]=$e[0],t[1]=$e[1],t[2]=$e[2],t[3]=1+r,sr(t,t))}),dr=(Ue=Ee(),We=Ee(),function(t,n,e,r,o,a){return Ye(Ue,n,o,a),Ye(We,e,r,a),Ye(t,Ue,We,2*a*(1-a)),t}),pr=(ze=Z(),function(t,n,e,r){return ze[0]=e[0],ze[3]=e[1],ze[6]=e[2],ze[1]=r[0],ze[4]=r[1],ze[7]=r[2],ze[2]=-n[0],ze[5]=-n[1],ze[8]=-n[2],sr(t,qe(t,ze))});function vr(){var t=new z(2);return z!=Float32Array&&(t[0]=0,t[1]=0),t}function yr(t){var n=new z(2);return n[0]=t[0],n[1]=t[1],n}function mr(t,n){var e=new z(2);return e[0]=t,e[1]=n,e}function gr(t,n){return t[0]=n[0],t[1]=n[1],t}function Mr(t,n,e){return t[0]=n,t[1]=e,t}function br(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t}function xr(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t}function Pr(t,n,e){return t[0]=n[0]*e[0],t[1]=n[1]*e[1],t}function Or(t,n,e){return t[0]=n[0]/e[0],t[1]=n[1]/e[1],t}function Er(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t}function Sr(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t}function Cr(t,n,e){return t[0]=Math.min(n[0],e[0]),t[1]=Math.min(n[1],e[1]),t}function Ar(t,n,e){return t[0]=Math.max(n[0],e[0]),t[1]=Math.max(n[1],e[1]),t}function jr(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t}function Tr(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t}function Br(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t}function Rr(t,n){var e=n[0]-t[0],r=n[1]-t[1];return Math.hypot(e,r)}function wr(t,n){var e=n[0]-t[0],r=n[1]-t[1];return e*e+r*r}function Lr(t){var n=t[0],e=t[1];return Math.hypot(n,e)}function kr(t){var n=t[0],e=t[1];return n*n+e*e}function Ir(t,n){return t[0]=-n[0],t[1]=-n[1],t}function Dr(t,n){return t[0]=1/n[0],t[1]=1/n[1],t}function Yr(t,n){var e=n[0],r=n[1],o=e*e+r*r;return o>0&&(o=1/Math.sqrt(o)),t[0]=n[0]*o,t[1]=n[1]*o,t}function Nr(t,n){return t[0]*n[0]+t[1]*n[1]}function _r(t,n,e){var r=n[0]*e[1]-n[1]*e[0];return t[0]=t[1]=0,t[2]=r,t}function Xr(t,n,e,r){var o=n[0],a=n[1];return t[0]=o+r*(e[0]-o),t[1]=a+r*(e[1]-a),t}function qr(t,n){n=n||1;var e=2*Q()*Math.PI;return t[0]=Math.cos(e)*n,t[1]=Math.sin(e)*n,t}function Fr(t,n,e){var r=n[0],o=n[1];return t[0]=e[0]*r+e[2]*o,t[1]=e[1]*r+e[3]*o,t}function Gr(t,n,e){var r=n[0],o=n[1];return t[0]=e[0]*r+e[2]*o+e[4],t[1]=e[1]*r+e[3]*o+e[5],t}function $r(t,n,e){var r=n[0],o=n[1];return t[0]=e[0]*r+e[3]*o+e[6],t[1]=e[1]*r+e[4]*o+e[7],t}function Hr(t,n,e){var r=n[0],o=n[1];return t[0]=e[0]*r+e[4]*o+e[12],t[1]=e[1]*r+e[5]*o+e[13],t}function Vr(t,n,e,r){var o=n[0]-e[0],a=n[1]-e[1],i=Math.sin(r),u=Math.cos(r);return t[0]=o*u-a*i+e[0],t[1]=o*i+a*u+e[1],t}function Ur(t,n){var e=t[0],r=t[1],o=n[0],a=n[1],i=Math.sqrt(e*e+r*r)*Math.sqrt(o*o+a*a),u=i&&(e*o+r*a)/i;return Math.acos(Math.min(Math.max(u,-1),1))}function Wr(t){return t[0]=0,t[1]=0,t}function zr(t){return"vec2("+t[0]+", "+t[1]+")"}function Qr(t,n){return t[0]===n[0]&&t[1]===n[1]}function Zr(t,n){var e=t[0],r=t[1],o=n[0],a=n[1];return Math.abs(e-o)<=W*Math.max(1,Math.abs(e),Math.abs(o))&&Math.abs(r-a)<=W*Math.max(1,Math.abs(r),Math.abs(a))}var Jr=Lr,Kr=xr,to=Pr,no=Or,eo=Rr,ro=wr,oo=kr,ao=function(){var t=vr();return function(n,e,r,o,a,i){var u,c;for(e||(e=2),r||(r=0),c=o?Math.min(o*e+r,n.length):n.length,u=r;u<c;u+=e)t[0]=n[u],t[1]=n[u+1],a(t,t,i),n[u]=t[0],n[u+1]=t[1];return n}}(),io=function(){function t(){}return t.tag="c-canvas-rbush-node",t}(),uo="RBushRoot",co=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=[];this.toSync.forEach((function(e){var r=e.rBushNode;r&&t.rBush.remove(r.aabb);var o=e.getRenderBounds();if(o){var a=y(o.getMin(),2),i=a[0],u=a[1],c=y(o.getMax(),2),s=c[0],f=c[1];r.aabb={id:e.entity,minX:i,minY:u,maxX:s,maxY:f}}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 io,e.pushToSync(t.composedPath().slice(0,-2))},o=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))},a=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.tap(n.tag,(function(){e.renderingContext.root.addEventListener(g.ElementEvent.MOUNTED,r),e.renderingContext.root.addEventListener(g.ElementEvent.UNMOUNTED,o),e.renderingContext.root.addEventListener(g.ElementEvent.BOUNDS_CHANGED,a)})),t.hooks.destroy.tap(n.tag,(function(){e.renderingContext.root.removeEventListener(g.ElementEvent.MOUNTED,r),e.renderingContext.root.removeEventListener(g.ElementEvent.UNMOUNTED,o),e.renderingContext.root.removeEventListener(g.ElementEvent.BOUNDS_CHANGED,a)})),t.hooks.beginFrame.tap(n.tag,(function(){var t=e.contextService.getContext(),n=e.canvasConfig.renderer.getConfig().enableDirtyRectangleRendering;e.clearFullScreen=!n||e.renderingContext.renderReasons.has(g.RenderReason.CAMERA_CHANGED),t&&(t.save(),e.clearFullScreen&&t.clearRect(0,0,e.canvasConfig.width,e.canvasConfig.height),e.applyTransform(t,e.camera.getOrthoMatrix()))})),t.hooks.endFrame.tap(n.tag,(function(){e.syncRTree();var n=e.canvasConfig.renderer.getConfig(),r=n.enableDirtyRectangleRendering,o=n.enableDirtyRectangleRenderingDebug,a=e.contextService.getContext(),u=e.renderQueue;if(r){if(!e.clearFullScreen){var c=e.safeMergeAABB.apply(e,m([e.mergeDirtyAABBs(e.renderQueue.filter((function(t){return t.nodeName!==g.Shape.GROUP})))],y(e.removedRBushNodeAABBs.map((function(t){var n=t.minX,e=t.minY,r=t.maxX,o=t.maxY,a=new g.AABB;return a.setMinMax(i.fromValues(n,e,0),i.fromValues(r,o,0)),a}))),!1));if(e.removedRBushNodeAABBs=[],g.AABB.isEmpty(c))return;var s=e.convertAABB2Rect(c),f=s.x,h=s.y,l=s.width,d=s.height;a.clearRect(f,h,l,d),a.beginPath(),a.rect(f,h,l,d),a.clip(),o&&(a.lineWidth=4,a.strokeStyle="rgba(".concat(255*Math.random(),", ").concat(255*Math.random(),", ").concat(255*Math.random(),", 1)"),a.strokeRect(f,h,l,d)),u=e.searchDirtyObjects(c)}u.sort((function(t,n){return t.sortable.renderOrder-n.sortable.renderOrder})).forEach((function(n){n&&n.isVisible()&&e.renderDisplayObject(n,t)})),e.enableBatch&&e.batchedStyleHash&&e.flush(a,t),e.renderQueue.forEach((function(t){e.saveDirtyAABB(t)})),e.renderQueue=[]}e.restoreStack.forEach((function(t){a.restore()})),e.restoreStack=[],e.clearFullScreen=!1,a.restore()})),t.hooks.render.tap(n.tag,(function(n){e.canvasConfig.renderer.getConfig().enableDirtyRectangleRendering?e.renderQueue.push(n):e.renderDisplayObject(n,t)}))},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(),o=this.restoreStack[this.restoreStack.length-1];o&&t.parentNode!==o;)r.restore(),this.restoreStack.pop(),o=this.restoreStack[this.restoreStack.length-1];var a=t.nodeName,i=this.styleRendererFactory(a),u=!1;if(this.enableBatch&&i){var c=i.hash(t.attributes);this.batchedStyleHash&&c!==this.batchedStyleHash&&this.flush(r,n),this.batchedStyleHash||(this.batchedStyleHash=c,this.batchedDisplayObject=t,u=!0)}r.save(),this.applyTransform(r,t.getLocalTransform());var s=t.style.clipPath;if(s){r.save(),this.applyTransform(r,s.getLocalTransform());var f=this.pathGeneratorFactory(s.nodeName);f&&this.useAnchor(r,s,(function(){r.beginPath(),f(r,s.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&&(!u&&e.enableBatch||r.beginPath(),n(r,t.parsedStyle),e.enableBatch||t.nodeName===g.Shape.LINE||t.nodeName===g.Shape.PATH||t.nodeName===g.Shape.POLYLINE||r.closePath()),i&&!e.enableBatch&&i.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]),o=Math.floor(n[1]);return{x:r,y:o,width:Math.ceil(e[0])-r,height:Math.ceil(e[1])-o}},t.prototype.mergeDirtyAABBs=function(t){var n=new g.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=y(t.getMin(),2),r=e[0],o=e[1],a=y(t.getMax(),2),i=a[0],u=a[1];return this.rBush.search({minX:r,minY:o,maxX:i,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 g.AABB);var e=t.getRenderBounds();e&&n.dirtyRenderBounds.update(e.center,e.halfExtents)},t.prototype.applyTransform=function(t,n){var e=y(a.getTranslation(i.create(),n),2),r=e[0],o=e[1],c=y(a.getScaling(i.create(),n),2),s=c[0],f=c[1],h=a.getRotation(u.create(),n),l=y(Object(g.getEuler)(i.create(),h),3),d=l[0],p=(l[1],l[2]),v=Object(g.fromRotationTranslationScale)(d||p,r,o,s,f);t.transform(v[0],v[1],v[3],v[4],v[6],v[7])},t.prototype.getColor=function(t,n,e,r){var o;if(t.type===g.PARSED_COLOR_TYPE.LinearGradient||t.type===g.PARSED_COLOR_TYPE.RadialGradient){var a=n.getGeometryBounds(),i=a&&2*a.halfExtents[0]||0,u=a&&2*a.halfExtents[1]||0;o=this.gradientPool.getOrCreateGradient(d(d({type:t.type},t.value),{width:i,height:u}),e)}else if(t.type===g.PARSED_COLOR_TYPE.Pattern){var c=this.imagePool.getPatternSync(t.value);c?o=c:this.imagePool.createPattern(t.value,e).then((function(){n.renderable.dirty=!0,r.dirtify()}))}else o=t.formatted;return o},t.prototype.applyAttributesToContext=function(t,n,e){var r=n.parsedStyle,o=r.stroke,a=r.fill,i=r.opacity,u=r.lineDash,c=r.lineDashOffset,s=r.filter,f=r.shadowColor,h=r.shadowBlur,l=r.shadowOffsetX,d=r.shadowOffsetY;u&&R(u)&&t.setLineDash(u),B(c)||(t.lineDashOffset=c),B(i)||(t.globalAlpha*=i),B(o)||(t.strokeStyle=this.getColor(o,n,t,e)),B(a)||(t.fillStyle=this.getColor(a,n,t,e)),B(s)||(t.filter=n.style.filter),B(f)||(t.shadowColor=f.formatted,t.shadowBlur=h,t.shadowOffsetX=l,t.shadowOffsetY=d)},t.prototype.useAnchor=function(t,n,e){var r=n.getGeometryBounds();if(r){var o=r.halfExtents,a=(n.parsedStyle||{}).anchor,i=void 0===a?[0,0]:a;t.translate(-i[0]*o[0]*2,-i[1]*o[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 g.AABB;return t.forEach((function(t){e.add(t)})),e},t.tag="CanvasRendererPlugin",p([Object(M.inject)(g.CanvasConfig),v("design:type",Object)],t.prototype,"canvasConfig",void 0),p([Object(M.inject)(g.DefaultCamera),v("design:type",g.Camera)],t.prototype,"camera",void 0),p([Object(M.inject)(g.ContextService),v("design:type",Object)],t.prototype,"contextService",void 0),p([Object(M.inject)(g.RenderingContext),v("design:type",Object)],t.prototype,"renderingContext",void 0),p([Object(M.inject)(F),v("design:type",F)],t.prototype,"imagePool",void 0),p([Object(M.inject)(H),v("design:type",H)],t.prototype,"gradientPool",void 0),p([Object(M.inject)(V),v("design:type",Function)],t.prototype,"pathGeneratorFactory",void 0),p([Object(M.inject)(S),v("design:type",Function)],t.prototype,"styleRendererFactory",void 0),p([Object(M.inject)(g.DisplayObjectPool),v("design:type",g.DisplayObjectPool)],t.prototype,"displayObjectPool",void 0),p([Object(M.inject)(uo),v("design:type",E.a)],t.prototype,"rBush",void 0),t=n=p([Object(M.singleton)({contrib:g.RenderingPluginContribution})],t)}(),so=function(){function t(){}var n;return n=t,t.prototype.apply=function(t){var e=this,r=function(n){var r=n.target,o=r.nodeName,a=r.attributes;if(o===g.Shape.IMAGE){var i=a.img;Y(i)&&e.imagePool.getOrCreateImage(i).then((function(){r.renderable.dirty=!0,t.dirtify()}))}},o=function(n){var r=n.target,o=n.attrName,a=n.newValue;r.nodeName===g.Shape.IMAGE&&"img"===o&&Y(a)&&e.imagePool.getOrCreateImage(a).then((function(){r.renderable.dirty=!0,t.dirtify()}))};t.hooks.init.tap(n.tag,(function(){e.renderingContext.root.addEventListener(g.ElementEvent.MOUNTED,r),e.renderingContext.root.addEventListener(g.ElementEvent.ATTR_MODIFIED,o)})),t.hooks.destroy.tap(n.tag,(function(){e.renderingContext.root.removeEventListener(g.ElementEvent.MOUNTED,r),e.renderingContext.root.removeEventListener(g.ElementEvent.ATTR_MODIFIED,o)}))},t.tag="LoadImagePlugin",p([Object(M.inject)(F),v("design:type",F)],t.prototype,"imagePool",void 0),p([Object(M.inject)(g.RenderingContext),v("design:type",Object)],t.prototype,"renderingContext",void 0),t=n=p([Object(M.singleton)({contrib:g.RenderingPluginContribution})],t)}();g.globalContainer.register({token:{token:U,named:g.Shape.CIRCLE},useValue:function(t,n){var e=n.rInPixels;t.arc(e,e,e,0,2*Math.PI,!1)}}),g.globalContainer.register({token:{token:U,named:g.Shape.ELLIPSE},useValue:function(t,n){var e=n.rxInPixels,r=n.ryInPixels;if(t.ellipse)t.ellipse(e,r,e,r,0,0,2*Math.PI,!1);else{var o=e>r?e:r,a=e>r?1:e/r,i=e>r?r/e:1;t.save(),t.scale(a,i),t.arc(0,0,o,0,2*Math.PI)}}}),g.globalContainer.register({token:{token:U,named:g.Shape.RECT},useValue:function(t,n){var e=n.radius,r=void 0===e?0:e,o=n.widthInPixels,a=n.heightInPixels;if(0===r)t.rect(0,0,o,a);else{var i=y(function(t){var n=0,e=0,r=0,o=0;return R(t)?1===t.length?n=e=r=o=t[0]:2===t.length?(n=r=t[0],e=o=t[1]):3===t.length?(n=t[0],e=o=t[1],r=t[2]):(n=t[0],e=t[1],r=t[2],o=t[3]):n=e=r=o=t,[n,e,r,o]}(r),4),u=i[0],c=i[1],s=i[2],f=i[3];t.moveTo(u,0),t.lineTo(o-c,0),0!==c&&t.arc(o-c,c,c,-Math.PI/2,0),t.lineTo(o,a-s),0!==s&&t.arc(o-s,a-s,s,0,Math.PI/2),t.lineTo(f,a),0!==f&&t.arc(f,a-f,f,Math.PI/2,Math.PI),t.lineTo(0,u),0!==u&&t.arc(u,u,u,Math.PI,1.5*Math.PI)}}}),g.globalContainer.register({token:{token:U,named:g.Shape.LINE},useValue:function(t,n){var e=n.x1,r=n.y1,o=n.x2,a=n.y2,i=n.defX,u=void 0===i?0:i,c=n.defY,s=void 0===c?0:c;t.moveTo(e-u,r-s),t.lineTo(o-u,a-s)}}),g.globalContainer.register({token:{token:U,named:g.Shape.POLYLINE},useValue:function(t,n){var e=n.defX,r=void 0===e?0:e,o=n.defY,a=void 0===o?0:o,i=n.points.points,u=i.length,c=i[0][0]-r,s=i[0][1]-a,f=i[u-1][0]-r,h=i[u-1][1]-a;t.moveTo(c,s);for(var l=0;l<u-1;l++){var d=i[l];t.lineTo(d[0]-r,d[1]-a)}t.lineTo(f,h)}}),g.globalContainer.register({token:{token:U,named:g.Shape.POLYGON},useValue:function(t,n){var e=n.defX,r=void 0===e?0:e,o=n.defY,a=void 0===o?0:o,i=n.points.points,u=i.length,c=i[0][0]-r,s=i[0][1]-a,f=i[u-1][0]-r,h=i[u-1][1]-a;t.moveTo(c,s);for(var l=0;l<u-1;l++){var d=i[l];t.lineTo(d[0]-r,d[1]-a)}t.lineTo(f,h)}}),g.globalContainer.register({token:{token:U,named:g.Shape.PATH},useValue:function(t,n){var e=n.defX,r=void 0===e?0:e,o=n.defY,a=void 0===o?0:o,i=n.path,u=i.curve,c=i.zCommandIndexes,s=u;c.forEach((function(t,n){s.splice(t+n,0,["Z"])}));for(var f=0;f<s.length;f++){var h=s[f];switch(h[0]){case"M":t.moveTo(h[1]-r,h[2]-a);break;case"C":t.bezierCurveTo(h[1]-r,h[2]-a,h[3]-r,h[4]-a,h[5]-r,h[6]-a);break;case"Z":t.closePath()}}}}),g.globalContainer.register({token:V,useFactory:function(t){var n={};return function(e){return n[e]||t.container.isBoundNamed(U,e)&&(n[e]=t.container.getNamed(U,e)),n[e]}}});var fo=Object(M.Module)((function(t){t(F),t({token:uo,useValue:new E.a}),t(q),t(G),t($),t({token:S,useFactory:function(t){var n={};return function(e){return n[e]||t.container.isBoundNamed(C,e)&&(n[e]=t.container.getNamed(C,e)),n[e]}}}),t(H),t(co),t(so)})),ho=function(){function t(){}return t.prototype.init=function(t){t.load(fo,!0)},t.prototype.destroy=function(t){t.unload(fo)},t}(),lo=function(){function t(){var t=this;this.isHit=function(n,e,r){var o=t.pointInPathPickerFactory(n.nodeName);if(o){var u=a.invert(a.create(),r),c=i.transformMat4(i.create(),i.fromValues(e[0],e[1],0),u),s=n.getGeometryBounds().halfExtents,f=n.parsedStyle.anchor,h=void 0===f?[0,0]:f;if(c[0]+=h[0]*s[0]*2,c[1]+=h[1]*s[1]*2,o(n,new g.Point(c[0],c[1]),t.isPointInPath))return!0}return!1},this.isPointInPath=function(n,e){var r=t.offscreenCanvas.getOrCreateContext(),o=t.pathGeneratorFactory(n.nodeName);return o&&o(r,n.parsedStyle),r.isPointInPath(e.x,e.y)}}var n;return n=t,t.prototype.apply=function(t){var e=this;t.hooks.pick.tap(n.tag,(function(t){var n=t.position,r=n.x,o=n.y,u=i.fromValues(r,o,0),c=[],s=e.rBush.search({minX:u[0],minY:u[1],maxX:u[0],maxY:u[1]}),f=s.map((function(t){return t.id}));return s.forEach((function(t){var n=t.id,r=e.displayObjectPool.getByEntity(n);if(r.isVisible()&&r.interactive){if(r.parentNode&&-1===f.indexOf(r.parentNode.entity))return;var o=r.style.clipPath||r,i=r.getWorldTransform();r.style.clipPath&&(i=a.multiply(a.create(),i,r.style.clipPath.getLocalTransform())),e.isHit(o,u,i)&&c.push(r)}})),c.sort((function(t,n){return t.sortable.renderOrder-n.sortable.renderOrder})),t.picked=c[c.length-1]||null,t}))},t.tag="CanvasPickerPlugin",p([Object(M.inject)(g.SceneGraphService),v("design:type",Object)],t.prototype,"sceneGraphService",void 0),p([Object(M.inject)(g.DisplayObjectPool),v("design:type",g.DisplayObjectPool)],t.prototype,"displayObjectPool",void 0),p([Object(M.inject)(g.OffscreenCanvasCreator),v("design:type",g.OffscreenCanvasCreator)],t.prototype,"offscreenCanvas",void 0),p([Object(M.inject)(uo),v("design:type",Function)],t.prototype,"rBush",void 0),p([Object(M.inject)(V),v("design:type",Function)],t.prototype,"pathGeneratorFactory",void 0),p([Object(M.inject)("PointInPathPicker"),v("design:type",Function)],t.prototype,"pointInPathPickerFactory",void 0),t=n=p([Object(M.singleton)({contrib:g.RenderingPluginContribution})],t)}();function po(t,n,e,r){var o=t-e,a=n-r;return Math.sqrt(o*o+a*a)}function vo(t,n){return Math.abs(t-n)<.001}function yo(t,n){var e=I(t),r=I(n);return{x:e,y:r,width:k(t)-e,height:k(n)-r}}function mo(t){return(t+2*Math.PI)%(2*Math.PI)}var go={box:function(t,n,e,r){return yo([t,e],[n,r])},length:function(t,n,e,r){return po(t,n,e,r)},pointAt:function(t,n,e,r,o){return{x:(1-o)*t+o*e,y:(1-o)*n+o*r}},pointDistance:function(t,n,e,r,o,a){var i=(e-t)*(o-t)+(r-n)*(a-n);return i<0?po(t,n,o,a):i>(e-t)*(e-t)+(r-n)*(r-n)?po(e,r,o,a):this.pointToLine(t,n,e,r,o,a)},pointToLine:function(t,n,e,r,o,a){var i=[e-t,r-n];if(c.exactEquals(i,[0,0]))return Math.sqrt((o-t)*(o-t)+(a-n)*(a-n));var u=[-i[1],i[0]];c.normalize(u,u);var s=[o-t,a-n];return Math.abs(c.dot(s,u))},tangentAngle:function(t,n,e,r){return Math.atan2(r-n,e-t)}};function Mo(t,n,e,r,o,a){var i=-1,u=1/0,c=[e,r],s=20;a&&a>200&&(s=a/10);for(var f=1/s,h=f/10,l=0;l<=s;l++){var d=l*f,p=[o.apply(void 0,m([],y(t.concat([d])),!1)),o.apply(void 0,m([],y(n.concat([d])),!1))];(b=po(c[0],c[1],p[0],p[1]))<u&&(i=d,u=b)}if(0===i)return{x:t[0],y:n[0]};if(1===i){var v=t.length;return{x:t[v-1],y:n[v-1]}}u=1/0;for(l=0;l<32&&!(h<1e-4);l++){var g=i-h,M=i+h,b=(p=[o.apply(void 0,m([],y(t.concat([g])),!1)),o.apply(void 0,m([],y(n.concat([g])),!1))],po(c[0],c[1],p[0],p[1]));if(g>=0&&b<u)i=g,u=b;else{var x=[o.apply(void 0,m([],y(t.concat([M])),!1)),o.apply(void 0,m([],y(n.concat([M])),!1))],P=po(c[0],c[1],x[0],x[1]);M<=1&&P<u?(i=M,u=P):h*=.5}}return{x:o.apply(void 0,m([],y(t.concat([i])),!1)),y:o.apply(void 0,m([],y(n.concat([i])),!1))}}function bo(t,n,e,r){var o=1-r;return o*o*t+2*r*o*n+r*r*e}function xo(t,n,e){var r=t+e-2*n;if(vo(r,0))return[.5];var o=(t-n)/r;return o<=1&&o>=0?[o]:[]}function Po(t,n,e,r){return 2*(1-r)*(n-t)+2*r*(e-n)}function Oo(t,n,e,r,o,a,i){var u=bo(t,e,o,i),c=bo(n,r,a,i),s=go.pointAt(t,n,e,r,i),f=go.pointAt(e,r,o,a,i);return[[t,n,s.x,s.y,u,c],[u,c,f.x,f.y,o,a]]}var Eo={box:function(t,n,e,r,o,a){var i=xo(t,e,o)[0],u=xo(n,r,a)[0],c=[t,o],s=[n,a];return void 0!==i&&c.push(bo(t,e,o,i)),void 0!==u&&s.push(bo(n,r,a,u)),yo(c,s)},length:function(t,n,e,r,o,a){return function t(n,e,r,o,a,i,u){if(0===u)return(po(n,e,r,o)+po(r,o,a,i)+po(n,e,a,i))/2;var c=Oo(n,e,r,o,a,i,.5),s=c[0],f=c[1];return s.push(u-1),f.push(u-1),t.apply(void 0,m([],y(s),!1))+t.apply(void 0,m([],y(f),!1))}(t,n,e,r,o,a,3)},nearestPoint:function(t,n,e,r,o,a,i,u){return Mo([t,e,o],[n,r,a],i,u,bo)},pointDistance:function(t,n,e,r,o,a,i,u){var c=this.nearestPoint(t,n,e,r,o,a,i,u);return po(c.x,c.y,i,u)},interpolationAt:bo,pointAt:function(t,n,e,r,o,a,i){return{x:bo(t,e,o,i),y:bo(n,r,a,i)}},divide:function(t,n,e,r,o,a,i){return Oo(t,n,e,r,o,a,i)},tangentAngle:function(t,n,e,r,o,a,i){var u=Po(t,e,o,i),c=Po(n,r,a,i);return mo(Math.atan2(c,u))}};function So(t,n,e,r,o){var a=1-o;return a*a*a*t+3*n*o*a*a+3*e*o*o*a+r*o*o*o}function Co(t,n,e,r,o){var a=1-o;return 3*(a*a*(n-t)+2*a*o*(e-n)+o*o*(r-e))}function Ao(t,n,e,r){var o,a,i,u=-3*t+9*n-9*e+3*r,c=6*t-12*n+6*e,s=3*n-3*t,f=[];if(vo(u,0))vo(c,0)||(o=-s/c)>=0&&o<=1&&f.push(o);else{var h=c*c-4*u*s;vo(h,0)?f.push(-c/(2*u)):h>0&&(a=(-c-(i=Math.sqrt(h)))/(2*u),(o=(-c+i)/(2*u))>=0&&o<=1&&f.push(o),a>=0&&a<=1&&f.push(a))}return f}function jo(t,n,e,r,o,a,i,u,c){var s=So(t,e,o,i,c),f=So(n,r,a,u,c),h=go.pointAt(t,n,e,r,c),l=go.pointAt(e,r,o,a,c),d=go.pointAt(o,a,i,u,c),p=go.pointAt(h.x,h.y,l.x,l.y,c),v=go.pointAt(l.x,l.y,d.x,d.y,c);return[[t,n,h.x,h.y,p.x,p.y,s,f],[s,f,v.x,v.y,d.x,d.y,i,u]]}function To(t,n,e,r,o,a,i,u,c){if(0===c)return function(t,n){for(var e=0,r=t.length,o=0;o<r;o++){e+=po(t[o],n[o],t[(o+1)%r],n[(o+1)%r])}return e/2}([t,e,o,i],[n,r,a,u]);var s=jo(t,n,e,r,o,a,i,u,.5),f=m(m([],y(s[0]),!1),[c-1],!1),h=m(m([],y(s[1]),!1),[c-1],!1);return To.apply(void 0,m([],y(f),!1))+To.apply(void 0,m([],y(h),!1))}var Bo={extrema:Ao,box:function(t,n,e,r,o,a,i,u){for(var c=[t,i],s=[n,u],f=Ao(t,e,o,i),h=Ao(n,r,a,u),l=0;l<f.length;l++)c.push(So(t,e,o,i,f[l]));for(l=0;l<h.length;l++)s.push(So(n,r,a,u,h[l]));return yo(c,s)},length:function(t,n,e,r,o,a,i,u){return To(t,n,e,r,o,a,i,u,3)},nearestPoint:function(t,n,e,r,o,a,i,u,c,s,f){return Mo([t,e,o,i],[n,r,a,u],c,s,So,f)},pointDistance:function(t,n,e,r,o,a,i,u,c,s,f){var h=this.nearestPoint(t,n,e,r,o,a,i,u,c,s,f);return po(h.x,h.y,c,s)},interpolationAt:So,pointAt:function(t,n,e,r,o,a,i,u,c){return{x:So(t,e,o,i,c),y:So(n,r,a,u,c)}},divide:function(t,n,e,r,o,a,i,u,c){return jo(t,n,e,r,o,a,i,u,c)},tangentAngle:function(t,n,e,r,o,a,i,u,c){var s=Co(t,e,o,i,c),f=Co(n,r,a,u,c);return mo(Math.atan2(f,s))}};function Ro(t,n,e,r){var o=t-e,a=n-r;return Math.sqrt(o*o+a*a)}function wo(t,n,e,r,o,a){return o>=t&&o<=t+e&&a>=n&&a<=n+r}function Lo(t,n,e,r,o,a,i,u){var c=(Math.atan2(u-n,i-t)+2*Math.PI)%(2*Math.PI);if(c<r||c>o)return!1;var s={x:t+e*Math.cos(c),y:n+e*Math.sin(c)};return Ro(s.x,s.y,i,u)<=a/2}function ko(t,n,e,r,o,a,i){var u=Math.min(t,e),c=Math.max(t,e),s=Math.min(n,r),f=Math.max(n,r),h=o/2;return a>=u-h&&a<=c+h&&i>=s-h&&i<=f+h&&go.pointToLine(t,n,e,r,a,i)<=o/2}function Io(t,n,e,r,o){var a=t.length;if(a<2)return!1;for(var i=0;i<a-1;i++){if(ko(t[i][0],t[i][1],t[i+1][0],t[i+1][1],n,e,r))return!0}if(o){var u=t[0],c=t[a-1];if(ko(u[0],u[1],c[0],c[1],n,e,r))return!0}return!1}function Do(t){return Math.abs(t)<1e-6?0:t<0?-1:1}function Yo(t,n,e){return(e[0]-t[0])*(n[1]-t[1])==(n[0]-t[0])*(e[1]-t[1])&&Math.min(t[0],n[0])<=e[0]&&e[0]<=Math.max(t[0],n[0])&&Math.min(t[1],n[1])<=e[1]&&e[1]<=Math.max(t[1],n[1])}function No(t,n,e){var r=!1,o=t.length;if(o<=2)return!1;for(var a=0;a<o;a++){var i=t[a],u=t[(a+1)%o];if(Yo(i,u,[n,e]))return!0;Do(i[1]-e)>0!=Do(u[1]-e)>0&&Do(n-(e-i[1])*(i[0]-u[0])/(i[1]-u[1])-i[0])<0&&(r=!r)}return r}function _o(t,n,e){for(var r=!1,o=0;o<t.length;o++){if(r=No(t[o],n,e))break}return r}function Xo(t,n){var e=t.parsedStyle,r=e.rInPixels,o=e.fill,a=e.stroke,i=e.lineWidth,u=e.clipPathTargets,c=i.value/2,s=Ro(r,r,n.x,n.y),f=!!(null==u?void 0:u.length);return o&&a||f?s<=r+c:o?s<=r:!!a&&(s>=r-c&&s<=r+c)}function qo(t,n,e,r){return t/(e*e)+n/(r*r)}function Fo(t,n){var e=n.x,r=n.y,o=t.parsedStyle,a=o.rxInPixels,i=o.ryInPixels,u=o.fill,c=o.stroke,s=o.lineWidth,f=o.clipPathTargets,h=!!(null==f?void 0:f.length),l=s.value/2,d=(e-a)*(e-a),p=(r-i)*(r-i);return u&&c||h?qo(d,p,a+l,i+l)<=1:u?qo(d,p,a,i)<=1:!!c&&(qo(d,p,a-l,i-l)>=1&&qo(d,p,a+l,i+l)<=1)}function Go(t,n){var e=t.parsedStyle,r=e.x1,o=e.y1,a=e.x2,i=e.y2,u=e.lineWidth,c=e.defX,s=void 0===c?0:c,f=e.defY,h=void 0===f?0:f;return ko(r,o,a,i,u.value,n.x+s,n.y+h)}function $o(t,n){var e=t.parsedStyle,r=e.stroke,o=e.lineWidth,a=e.points,i=e.defX,u=void 0===i?0:i,c=e.defY,s=void 0===c?0:c,f=e.clipPathTargets,h=!!(null==f?void 0:f.length);return!(!r&&!h||!o)&&Io(a.points,o.value,n.x+u,n.y+s,!1)}function Ho(t,n,e){var r=t.parsedStyle,a=r.lineWidth,i=r.stroke,u=r.fill,s=r.defX,f=void 0===s?0:s,h=r.defY,l=void 0===h?0:h,d=r.clipPathTargets,p=r.path,v=p.segments,y=p.hasArc,m=p.polylines,g=p.polygons,M=p.totalLength,b=!!(null==d?void 0:d.length),x=!1;return(i||b)&&(x=function(t,n,e,r,a,i,u){for(var s=!1,f=n/2,h=0;h<t.length;h++){var l=t[h],d=l.currentPoint,p=l.params,v=l.prePoint,y=l.box;if(!y||wo(y.x-f,y.y-f,y.width+n,y.height+n,e,r)){switch(l.command){case"L":case"Z":s=ko(v[0],v[1],d[0],d[1],n,e,r);break;case"Q":s=Eo.pointDistance(v[0],v[1],p[1],p[2],p[3],p[4],e,r)<=n/2;break;case"C":s=Bo.pointDistance(v[0],v[1],p[1],p[2],p[3],p[4],p[5],p[6],e,r,a)<=n/2;break;case"A":var m=l.arcParams,g=m.cx,M=m.cy,b=m.rx,x=m.ry,P=m.startAngle,O=m.endAngle,E=m.xRotation,S=b>x?b:x,C=b>x?1:b/x,A=b>x?x/b:1,j=o.fromTranslation(o.create(),[-g,-M]);o.multiply(j,o.fromRotation(o.create(),-E),j),o.multiply(j,o.fromScaling(o.create(),[1/C,1/A]),j);var T=c.fromValues(e,r);s=Lo(0,0,S,P,O,n,(T=c.transformMat3(T,T,j))[0],T[1])}if(s)break}}return s}(v,a.value,n.x+f,n.y+l,M)),x||!u&&!b||(x=y?e(t,n):_o(g,n.x+f,n.y+l)||_o(m,n.x+f,n.y+l)),x}function Vo(t,n,e){var r=t.parsedStyle,o=r.radius,a=r.fill,i=r.stroke,u=r.lineWidth,c=r.width,s=r.height,f=r.clipPathTargets,h=!!(null==f?void 0:f.length),l=c.unit,d=c.value,p=s.unit,v=s.value,y=0,m=0;if(""!==l&&"px"!==l||(y=d),""!==p&&"px"!==p||(m=v),o){var g=!1;return(i||h)&&(g=function(t,n,e,r,o,a,i,u){return ko(t+o,n,t+e-o,n,a,i,u)||ko(t+e,n+o,t+e,n+r-o,a,i,u)||ko(t+e-o,n+r,t+o,n+r,a,i,u)||ko(t,n+r-o,t,n+o,a,i,u)||Lo(t+e-o,n+o,o,1.5*Math.PI,2*Math.PI,a,i,u)||Lo(t+e-o,n+r-o,o,0,.5*Math.PI,a,i,u)||Lo(t+o,n+r-o,o,.5*Math.PI,Math.PI,a,i,u)||Lo(t+o,n+o,o,Math.PI,1.5*Math.PI,a,i,u)}(0,0,y,m,o,u.value,n.x,n.y)),g||!a&&!h||(g=e(t,n)),g}var M=u.value/2;return a&&i||h?wo(0-M,0-M,y+M,m+M,n.x,n.y):a?wo(0,0,y,m,n.x,n.y):!!i&&function(t,n,e,r,o,a,i){var u=o/2;return wo(t-u,n-u,e,o,a,i)||wo(t+e-u,n-u,o,r,a,i)||wo(t+u,n+r-u,e,o,a,i)||wo(t-u,n+u,o,r,a,i)}(0,0,y,m,u.value,n.x,n.y)}function Uo(t,n){var e=t.parsedStyle,r=e.stroke,o=e.fill,a=e.lineWidth,i=e.points,u=e.defX,c=void 0===u?0:u,s=e.defY,f=void 0===s?0:s,h=e.clipPathTargets,l=!!(null==h?void 0:h.length),d=!1;return(r||l)&&(d=Io(i.points,a.value,n.x+c,n.y+f,!0)),d||!o&&!l||(d=No(i.points,n.x+c,n.y+f)),d}var Wo=Object(M.Module)((function(t){t({token:"PointInPathPicker",useFactory:function(t){return function(t){return t===g.Shape.CIRCLE?Xo:t===g.Shape.ELLIPSE?Fo:t===g.Shape.RECT?Vo:t===g.Shape.LINE?Go:t===g.Shape.POLYLINE?$o:t===g.Shape.POLYGON?Uo:t===g.Shape.PATH?Ho:t===g.Shape.IMAGE||t===g.Shape.TEXT?function(){return!0}:null}}}),t(lo)})),zo=function(){function t(){}return t.prototype.init=function(t){t.load(Wo,!0)},t.prototype.destroy=function(t){t.unload(Wo)},t}(),Qo=function(){function t(){}var n;return n=t,t.prototype.apply=function(t){var e=this,r=function(t){var n=t.target;if(n.nodeName===g.Shape.HTML){var r=n.parsedStyle.innerHTML,o="g-html-"+n.entity,a=e.contextService.getDomElement().parentNode;if(a)if(!a.querySelector("#"+o)){var i=document.createElement("div");n.parsedStyle.$el=i,i.id=o,Y(r)?i.innerHTML=r:i.appendChild(r),a.appendChild(i)}}},o=function(t){var n=t.target;if(n.nodeName===g.Shape.HTML){var r="g-html-"+n.entity,o=e.contextService.getDomElement().parentNode;if(o){var a=o.querySelector("#"+r);a&&o.removeChild(a)}}};t.hooks.init.tap(n.tag,(function(){e.renderingContext.root.addEventListener(g.ElementEvent.MOUNTED,r),e.renderingContext.root.addEventListener(g.ElementEvent.UNMOUNTED,o)})),t.hooks.destroy.tap(n.tag,(function(){e.renderingContext.root.removeEventListener(g.ElementEvent.MOUNTED,r),e.renderingContext.root.removeEventListener(g.ElementEvent.UNMOUNTED,o)})),t.hooks.render.tap(n.tag,(function(t){if(t.nodeName===g.Shape.HTML){var n="g-html-"+t.entity,r=e.contextService.getDomElement().parentNode;if(r){var o=r.querySelector("#"+n);e.updateCSSStyle(o,t.parsedStyle,t)}}}))},t.prototype.updateCSSStyle=function(t,n,e){var r=n.zIndex,o=void 0===r?0:r,a=n.visibility,i=void 0===a?"visible":a,u=n.opacity,c=void 0===u?1:u,s=n.fill,f=n.lineWidth,h=n.lineDash,l=n.stroke,d=n.anchor,p=n.width,v=n.height,y=n.style,m=void 0===y?"":y,M=n.className,b=void 0===M?"":M,x=0,P=0,O=p.unit,E=p.value,S=v.unit,C=v.value;""!==O&&"px"!==O||(x=E),""!==S&&"px"!==S||(P=C);var A={position:"absolute",top:0,left:0};if(A.width="".concat(x,"px"),A.height="".concat(P,"px"),A.transform="matrix3d(".concat(e.getWorldTransform().join(","),")"),d&&(A.transform+=" translate(".concat(100*d[0],"%, ").concat(100*d[0],"%)")),e.style.transformOrigin&&(A["transform-origin"]=e.style.transformOrigin),A["z-index"]=o,A.visibility=i,A.opacity=c,s){var j="";if(s.type===g.PARSED_COLOR_TYPE.Constant)j=s.formatted;else if(s.type===g.PARSED_COLOR_TYPE.LinearGradient){var T=s.value.steps.map((function(t){return"".concat(t[1]," ").concat(100*Number(t[0]),"%")})).join(",");j="linear-gradient(to right, ".concat(T,");")}else s.type===g.PARSED_COLOR_TYPE.RadialGradient||(s.type,g.PARSED_COLOR_TYPE.Pattern);A.background=j}A["border-width"]="".concat(f.value,"px"),l&&l.type===g.PARSED_COLOR_TYPE.Constant&&(A["border-color"]=l.formatted,A["border-style"]="solid"),h&&(A["border-style"]="dashed"),e.style.filter&&(A.filter=e.style.filter),b&&(Array.isArray(b)?b.forEach((function(n){t.classList.add(n)})):t.classList.add(b)),t.setAttribute("style",Object.keys(A).map((function(t){return"".concat(t,":").concat(A[t])})).join(";")+m)},t.tag="HTMLRenderingPlugin",p([Object(M.inject)(g.ContextService),v("design:type",Object)],t.prototype,"contextService",void 0),p([Object(M.inject)(g.RenderingContext),v("design:type",Object)],t.prototype,"renderingContext",void 0),t=n=p([Object(M.singleton)({contrib:g.RenderingPluginContribution})],t)}(),Zo=Object(M.Module)((function(t){t(Qo)})),Jo=function(){function t(){}return t.prototype.init=function(t){t.load(Zo,!0)},t.prototype.destroy=function(t){t.unload(Zo)},t}(),Ko="undefined"!=typeof window&&void 0!==window.document;var ta=function(){function t(){}return t.prototype.init=function(){var t=this.canvasConfig,n=t.container,e=t.canvas,r=t.devicePixelRatio;if(e)this.$canvas=e,n&&e.parentElement!==n&&n.appendChild(e),this.$container=e.parentElement,this.canvasConfig.container=this.$container;else if(n&&(this.$container=Y(n)?document.getElementById(n):n,this.$container)){var o=document.createElement("canvas");this.$container.appendChild(o),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=o}this.context=this.$canvas.getContext("2d");var a=r||Ko&&window.devicePixelRatio||1;a=a>=1?Math.ceil(a):1,this.dpr=a,this.resize(this.canvasConfig.width,this.canvasConfig.height)},t.prototype.getContext=function(){return this.context},t.prototype.getDomElement=function(){return this.$canvas},t.prototype.getDPR=function(){return this.dpr},t.prototype.getBoundingClientRect=function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()},t.prototype.destroy=function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)},t.prototype.resize=function(t,n){if(this.$canvas){this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*n,function(t,n,e){Ko&&t.style&&(t.style.width=n+"px",t.style.height=e+"px")}(this.$canvas,t,n);var e=this.getDPR();this.context.scale(e,e)}},t.prototype.applyCursorStyle=function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)},p([Object(M.inject)(g.CanvasConfig),v("design:type",Object)],t.prototype,"canvasConfig",void 0),t=p([Object(M.singleton)({token:g.ContextService})],t)}(),na=Object(M.Module)((function(t){t(ta)})),ea=function(){function t(){}return t.prototype.init=function(t){t.load(na,!0)},t.prototype.destroy=function(t){t.unload(na)},t}(),ra=function(t){function n(n){var e=t.call(this,n)||this;return e.registerPlugin(new ea),e.registerPlugin(new ho),e.registerPlugin(new P),e.registerPlugin(new zo),e.registerPlugin(new Jo),e}return function(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}l(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}(n,t),n}(g.AbstractRenderer)}])}));
@@ -1,5 +1,5 @@
1
- import { Syringe } from 'mana-syringe';
2
- import { RendererPlugin } from '@antv/g';
1
+ import type { Syringe } from 'mana-syringe';
2
+ import type { RendererPlugin } from '@antv/g';
3
3
  export declare class ContextRegisterPlugin implements RendererPlugin {
4
4
  init(container: Syringe.Container): void;
5
5
  destroy(container: Syringe.Container): void;
@@ -1,5 +1,5 @@
1
- import { Syringe } from 'mana-syringe';
2
- import { RendererPlugin } from '@antv/g';
1
+ import type { Syringe } from 'mana-syringe';
2
+ import type { RendererPlugin } from '@antv/g';
3
3
  export declare class ContextRegisterPlugin implements RendererPlugin {
4
4
  init(container: Syringe.Container): void;
5
5
  destroy(container: Syringe.Container): void;
package/lib/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
4
 
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/g-canvas",
3
- "version": "1.0.14",
3
+ "version": "1.0.17",
4
4
  "description": "A renderer implemented by Canvas 2D API",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -37,10 +37,10 @@
37
37
  },
38
38
  "homepage": "https://github.com/antvis/g#readme",
39
39
  "dependencies": {
40
- "@antv/g-plugin-canvas-picker": "^1.0.12",
41
- "@antv/g-plugin-canvas-renderer": "^1.0.12",
42
- "@antv/g-plugin-dom-interaction": "^1.0.12",
43
- "@antv/g-plugin-html-renderer": "^1.0.13",
40
+ "@antv/g-plugin-canvas-picker": "^1.0.15",
41
+ "@antv/g-plugin-canvas-renderer": "^1.0.15",
42
+ "@antv/g-plugin-dom-interaction": "^1.0.15",
43
+ "@antv/g-plugin-html-renderer": "^1.0.16",
44
44
  "@antv/util": "^2.0.13",
45
45
  "tslib": "^2.3.1"
46
46
  },
@@ -51,5 +51,5 @@
51
51
  "scripts": {
52
52
  "umd": "webpack"
53
53
  },
54
- "gitHead": "d16e3247e33491b76e38a6deb6cc1ee4f737ab1d"
54
+ "gitHead": "c32d65599adc9e7c3d31ca5710fb3968e01bff43"
55
55
  }