@antv/g-canvas 1.0.22 → 1.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.umd.min.js +2 -2
- package/es/Canvas2DContextService.js +1 -2
- package/es/ContextRegisterPlugin.d.ts +1 -0
- package/es/ContextRegisterPlugin.js +3 -1
- package/lib/Canvas2DContextService.js +1 -3
- package/lib/ContextRegisterPlugin.d.ts +1 -0
- package/lib/ContextRegisterPlugin.js +3 -1
- package/package.json +6 -6
- package/es/utils/dom.d.ts +0 -2
- package/es/utils/dom.js +0 -11
- package/lib/utils/dom.d.ts +0 -2
- package/lib/utils/dom.js +0 -20
package/dist/index.umd.min.js
CHANGED
|
@@ -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 i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.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 i in t)e.d(r,i,function(n){return t[n]}.bind(null,i));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,i,o,a){!function t(e,r,i,o,a){for(;o>i;){if(o-i>600){var u=o-i+1,c=r-i+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(i,Math.floor(r-c*f/u+h)),Math.min(o,Math.floor(r+(u-c)*f/u+h)),a)}var l=e[r],d=i,p=o;for(n(e,i,r),a(e[o],l)>0&&n(e,i,o);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[i],l)?n(e,i,p):n(e,++p,o),p<=r&&(i=p+1),r<=p&&(o=p-1)}}(t,r,i||0,o||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 i(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 o(t,n){a(t,0,t.children.length,n,t)}function a(t,n,e,r,i){i||(i=p(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o=n;o<e;o++){var a=t.children[o];u(i,t.leaf?r(a):a)}return i}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,i,o){for(var a=[e,r];a.length;)if(!((r=a.pop())-(e=a.pop())<=i)){var u=e+Math.ceil((r-e)/i/2)*i;t(n,u,e,r,o),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,i=[];n;){for(var o=0;o<n.children.length;o++){var a=n.children[o],u=n.leaf?r(a):a;d(t,u)&&(n.leaf?e.push(a):l(t,u)?this._all(a,e):i.push(a))}n=i.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 i=n.children[r],o=n.leaf?this.toBBox(i):i;if(d(t,o)){if(n.leaf||l(t,o))return!0;e.push(i)}}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,o,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(),o=!0),a.leaf){var f=i(t,a.children,n);if(-1!==f)return a.children.splice(f,1),c.push(a),this._condense(c),this}o||a.leaf||!l(a,u)?r?(e++,a=r.children[e],o=!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 i,a=e-n+1,u=this._maxEntries;if(a<=u)return o(i=p(t.slice(n,e+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(a)/Math.log(u)),u=Math.ceil(a/Math.pow(u,r-1))),(i=p([])).leaf=!1,i.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);i.children.push(this._build(t,l,d,r-1))}}return o(i,this.toBBox),i},r.prototype._chooseSubtree=function(t,n,e,r){for(;r.push(n),!n.leaf&&r.length-1!==e;){for(var i=1/0,o=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<o?(o=h,i=s<i?s:i,a=c):h===o&&s<i&&(i=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),i=[],o=this._chooseSubtree(r,this.data,n,i);for(o.children.push(t),u(o,r);n>=0&&i[n].children.length>this._maxEntries;)this._split(i,n),n--;this._adjustParentBBoxes(r,i,n)},r.prototype._split=function(t,n){var e=t[n],r=e.children.length,i=this._minEntries;this._chooseSplitAxis(e,i,r);var a=this._chooseSplitIndex(e,i,r),u=p(e.children.splice(a,e.children.length-a));u.height=e.height,u.leaf=e.leaf,o(e,this.toBBox),o(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,o(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,n,e){for(var r,i,o,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=(i=v,o=y,u=Math.max(i.minX,o.minX),c=Math.max(i.minY,o.minY),s=Math.min(i.maxX,o.maxX),h=Math.min(i.maxY,o.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,i=t.leaf?this.compareMinY:s;this._allDistMargin(t,n,e,r)<this._allDistMargin(t,n,e,i)&&t.children.sort(r)},r.prototype._allDistMargin=function(t,n,e,r){t.children.sort(r);for(var i=this.toBBox,o=a(t,0,n,i),c=a(t,e-n,e,i),s=h(o)+h(c),f=n;f<e-n;f++){var l=t.children[f];u(o,t.leaf?i(l):l),s+=h(o)}for(var d=e-n-1;d>=n;d--){var p=t.children[d];u(c,t.leaf?i(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():o(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 co}));var r={};e.r(r),e.d(r,"Plugin",(function(){return j}));var i={};e.r(i),e.d(i,"create",(function(){return rt})),e.d(i,"fromMat4",(function(){return it})),e.d(i,"clone",(function(){return ot})),e.d(i,"copy",(function(){return at})),e.d(i,"fromValues",(function(){return ut})),e.d(i,"set",(function(){return ct})),e.d(i,"identity",(function(){return st})),e.d(i,"transpose",(function(){return ft})),e.d(i,"invert",(function(){return ht})),e.d(i,"adjoint",(function(){return lt})),e.d(i,"determinant",(function(){return dt})),e.d(i,"multiply",(function(){return pt})),e.d(i,"translate",(function(){return vt})),e.d(i,"rotate",(function(){return yt})),e.d(i,"scale",(function(){return mt})),e.d(i,"fromTranslation",(function(){return gt})),e.d(i,"fromRotation",(function(){return Mt})),e.d(i,"fromScaling",(function(){return bt})),e.d(i,"fromMat2d",(function(){return xt})),e.d(i,"fromQuat",(function(){return Ot})),e.d(i,"normalFromMat4",(function(){return St})),e.d(i,"projection",(function(){return Pt})),e.d(i,"str",(function(){return Ct})),e.d(i,"frob",(function(){return Et})),e.d(i,"add",(function(){return jt})),e.d(i,"subtract",(function(){return Tt})),e.d(i,"multiplyScalar",(function(){return At})),e.d(i,"multiplyScalarAndAdd",(function(){return Rt})),e.d(i,"exactEquals",(function(){return wt})),e.d(i,"equals",(function(){return Bt})),e.d(i,"mul",(function(){return kt})),e.d(i,"sub",(function(){return Lt}));var o={};e.r(o),e.d(o,"create",(function(){return Nt})),e.d(o,"clone",(function(){return Dt})),e.d(o,"copy",(function(){return It})),e.d(o,"fromValues",(function(){return Yt})),e.d(o,"set",(function(){return Xt})),e.d(o,"identity",(function(){return qt})),e.d(o,"transpose",(function(){return Gt})),e.d(o,"invert",(function(){return _t})),e.d(o,"adjoint",(function(){return Ft})),e.d(o,"determinant",(function(){return Vt})),e.d(o,"multiply",(function(){return $t})),e.d(o,"translate",(function(){return Ht})),e.d(o,"scale",(function(){return Ut})),e.d(o,"rotate",(function(){return Wt})),e.d(o,"rotateX",(function(){return zt})),e.d(o,"rotateY",(function(){return Qt})),e.d(o,"rotateZ",(function(){return Zt})),e.d(o,"fromTranslation",(function(){return Jt})),e.d(o,"fromScaling",(function(){return Kt})),e.d(o,"fromRotation",(function(){return tn})),e.d(o,"fromXRotation",(function(){return nn})),e.d(o,"fromYRotation",(function(){return en})),e.d(o,"fromZRotation",(function(){return rn})),e.d(o,"fromRotationTranslation",(function(){return on})),e.d(o,"fromQuat2",(function(){return an})),e.d(o,"getTranslation",(function(){return un})),e.d(o,"getScaling",(function(){return cn})),e.d(o,"getRotation",(function(){return sn})),e.d(o,"fromRotationTranslationScale",(function(){return fn})),e.d(o,"fromRotationTranslationScaleOrigin",(function(){return hn})),e.d(o,"fromQuat",(function(){return ln})),e.d(o,"frustum",(function(){return dn})),e.d(o,"perspectiveNO",(function(){return pn})),e.d(o,"perspective",(function(){return vn})),e.d(o,"perspectiveZO",(function(){return yn})),e.d(o,"perspectiveFromFieldOfView",(function(){return mn})),e.d(o,"orthoNO",(function(){return gn})),e.d(o,"ortho",(function(){return Mn})),e.d(o,"orthoZO",(function(){return bn})),e.d(o,"lookAt",(function(){return xn})),e.d(o,"targetTo",(function(){return On})),e.d(o,"str",(function(){return Sn})),e.d(o,"frob",(function(){return Pn})),e.d(o,"add",(function(){return Cn})),e.d(o,"subtract",(function(){return En})),e.d(o,"multiplyScalar",(function(){return jn})),e.d(o,"multiplyScalarAndAdd",(function(){return Tn})),e.d(o,"exactEquals",(function(){return An})),e.d(o,"equals",(function(){return Rn})),e.d(o,"mul",(function(){return wn})),e.d(o,"sub",(function(){return Bn}));var a={};e.r(a),e.d(a,"create",(function(){return kn})),e.d(a,"clone",(function(){return Ln})),e.d(a,"length",(function(){return Nn})),e.d(a,"fromValues",(function(){return Dn})),e.d(a,"copy",(function(){return In})),e.d(a,"set",(function(){return Yn})),e.d(a,"add",(function(){return Xn})),e.d(a,"subtract",(function(){return qn})),e.d(a,"multiply",(function(){return Gn})),e.d(a,"divide",(function(){return _n})),e.d(a,"ceil",(function(){return Fn})),e.d(a,"floor",(function(){return Vn})),e.d(a,"min",(function(){return $n})),e.d(a,"max",(function(){return Hn})),e.d(a,"round",(function(){return Un})),e.d(a,"scale",(function(){return Wn})),e.d(a,"scaleAndAdd",(function(){return zn})),e.d(a,"distance",(function(){return Qn})),e.d(a,"squaredDistance",(function(){return Zn})),e.d(a,"squaredLength",(function(){return Jn})),e.d(a,"negate",(function(){return Kn})),e.d(a,"inverse",(function(){return te})),e.d(a,"normalize",(function(){return ne})),e.d(a,"dot",(function(){return ee})),e.d(a,"cross",(function(){return re})),e.d(a,"lerp",(function(){return ie})),e.d(a,"hermite",(function(){return oe})),e.d(a,"bezier",(function(){return ae})),e.d(a,"random",(function(){return ue})),e.d(a,"transformMat4",(function(){return ce})),e.d(a,"transformMat3",(function(){return se})),e.d(a,"transformQuat",(function(){return fe})),e.d(a,"rotateX",(function(){return he})),e.d(a,"rotateY",(function(){return le})),e.d(a,"rotateZ",(function(){return de})),e.d(a,"angle",(function(){return pe})),e.d(a,"zero",(function(){return ve})),e.d(a,"str",(function(){return ye})),e.d(a,"exactEquals",(function(){return me})),e.d(a,"equals",(function(){return ge})),e.d(a,"sub",(function(){return be})),e.d(a,"mul",(function(){return xe})),e.d(a,"div",(function(){return Oe})),e.d(a,"dist",(function(){return Se})),e.d(a,"sqrDist",(function(){return Pe})),e.d(a,"len",(function(){return Ce})),e.d(a,"sqrLen",(function(){return Ee})),e.d(a,"forEach",(function(){return je}));var u={};e.r(u),e.d(u,"create",(function(){return Re})),e.d(u,"identity",(function(){return we})),e.d(u,"setAxisAngle",(function(){return Be})),e.d(u,"getAxisAngle",(function(){return ke})),e.d(u,"getAngle",(function(){return Le})),e.d(u,"multiply",(function(){return Ne})),e.d(u,"rotateX",(function(){return De})),e.d(u,"rotateY",(function(){return Ie})),e.d(u,"rotateZ",(function(){return Ye})),e.d(u,"calculateW",(function(){return Xe})),e.d(u,"exp",(function(){return qe})),e.d(u,"ln",(function(){return Ge})),e.d(u,"pow",(function(){return _e})),e.d(u,"slerp",(function(){return Fe})),e.d(u,"random",(function(){return Ve})),e.d(u,"invert",(function(){return $e})),e.d(u,"conjugate",(function(){return He})),e.d(u,"fromMat3",(function(){return Ue})),e.d(u,"fromEuler",(function(){return We})),e.d(u,"str",(function(){return ze})),e.d(u,"clone",(function(){return er})),e.d(u,"fromValues",(function(){return rr})),e.d(u,"copy",(function(){return ir})),e.d(u,"set",(function(){return or})),e.d(u,"add",(function(){return ar})),e.d(u,"mul",(function(){return ur})),e.d(u,"scale",(function(){return cr})),e.d(u,"dot",(function(){return sr})),e.d(u,"lerp",(function(){return fr})),e.d(u,"length",(function(){return hr})),e.d(u,"len",(function(){return lr})),e.d(u,"squaredLength",(function(){return dr})),e.d(u,"sqrLen",(function(){return pr})),e.d(u,"normalize",(function(){return vr})),e.d(u,"exactEquals",(function(){return yr})),e.d(u,"equals",(function(){return mr})),e.d(u,"rotationTo",(function(){return gr})),e.d(u,"sqlerp",(function(){return Mr})),e.d(u,"setAxes",(function(){return br}));var c={};e.r(c),e.d(c,"create",(function(){return xr})),e.d(c,"clone",(function(){return Or})),e.d(c,"fromValues",(function(){return Sr})),e.d(c,"copy",(function(){return Pr})),e.d(c,"set",(function(){return Cr})),e.d(c,"add",(function(){return Er})),e.d(c,"subtract",(function(){return jr})),e.d(c,"multiply",(function(){return Tr})),e.d(c,"divide",(function(){return Ar})),e.d(c,"ceil",(function(){return Rr})),e.d(c,"floor",(function(){return wr})),e.d(c,"min",(function(){return Br})),e.d(c,"max",(function(){return kr})),e.d(c,"round",(function(){return Lr})),e.d(c,"scale",(function(){return Nr})),e.d(c,"scaleAndAdd",(function(){return Dr})),e.d(c,"distance",(function(){return Ir})),e.d(c,"squaredDistance",(function(){return Yr})),e.d(c,"length",(function(){return Xr})),e.d(c,"squaredLength",(function(){return qr})),e.d(c,"negate",(function(){return Gr})),e.d(c,"inverse",(function(){return _r})),e.d(c,"normalize",(function(){return Fr})),e.d(c,"dot",(function(){return Vr})),e.d(c,"cross",(function(){return $r})),e.d(c,"lerp",(function(){return Hr})),e.d(c,"random",(function(){return Ur})),e.d(c,"transformMat2",(function(){return Wr})),e.d(c,"transformMat2d",(function(){return zr})),e.d(c,"transformMat3",(function(){return Qr})),e.d(c,"transformMat4",(function(){return Zr})),e.d(c,"rotate",(function(){return Jr})),e.d(c,"angle",(function(){return Kr})),e.d(c,"zero",(function(){return ti})),e.d(c,"str",(function(){return ni})),e.d(c,"exactEquals",(function(){return ei})),e.d(c,"equals",(function(){return ri})),e.d(c,"len",(function(){return ii})),e.d(c,"sub",(function(){return oi})),e.d(c,"mul",(function(){return ai})),e.d(c,"div",(function(){return ui})),e.d(c,"dist",(function(){return ci})),e.d(c,"sqrDist",(function(){return si})),e.d(c,"sqrLen",(function(){return fi})),e.d(c,"forEach",(function(){return hi}));var s={};e.r(s),e.d(s,"PathGeneratorFactory",(function(){return J})),e.d(s,"PathGenerator",(function(){return K})),e.d(s,"RBushNode",(function(){return li})),e.d(s,"RBushRoot",(function(){return di})),e.d(s,"RBush",(function(){return A.a})),e.d(s,"StyleRendererFactory",(function(){return R})),e.d(s,"CircleRendererContribution",(function(){return w})),e.d(s,"EllipseRendererContribution",(function(){return B})),e.d(s,"RectRendererContribution",(function(){return k})),e.d(s,"LineRendererContribution",(function(){return L})),e.d(s,"PolylineRendererContribution",(function(){return N})),e.d(s,"PolygonRendererContribution",(function(){return D})),e.d(s,"PathRendererContribution",(function(){return I})),e.d(s,"TextRendererContribution",(function(){return Y})),e.d(s,"ImageRendererContribution",(function(){return X})),e.d(s,"ImageRenderer",(function(){return G})),e.d(s,"TextRenderer",(function(){return _})),e.d(s,"RectRenderer",(function(){return V})),e.d(s,"CircleRenderer",(function(){return $})),e.d(s,"EllipseRenderer",(function(){return H})),e.d(s,"LineRenderer",(function(){return U})),e.d(s,"PolylineRenderer",(function(){return W})),e.d(s,"PolygonRenderer",(function(){return z})),e.d(s,"PathRenderer",(function(){return Q})),e.d(s,"Plugin",(function(){return mi}));var f={};e.r(f),e.d(f,"Plugin",(function(){return no}));var h={};e.r(h),e.d(h,"Plugin",(function(){return io}));
|
|
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 i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.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 i in t)e.d(r,i,function(n){return t[n]}.bind(null,i));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,i,o,a){!function t(e,r,i,o,a){for(;o>i;){if(o-i>600){var u=o-i+1,c=r-i+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(i,Math.floor(r-c*f/u+h)),Math.min(o,Math.floor(r+(u-c)*f/u+h)),a)}var l=e[r],d=i,p=o;for(n(e,i,r),a(e[o],l)>0&&n(e,i,o);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[i],l)?n(e,i,p):n(e,++p,o),p<=r&&(i=p+1),r<=p&&(o=p-1)}}(t,r,i||0,o||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 i(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 o(t,n){a(t,0,t.children.length,n,t)}function a(t,n,e,r,i){i||(i=p(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o=n;o<e;o++){var a=t.children[o];u(i,t.leaf?r(a):a)}return i}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,i,o){for(var a=[e,r];a.length;)if(!((r=a.pop())-(e=a.pop())<=i)){var u=e+Math.ceil((r-e)/i/2)*i;t(n,u,e,r,o),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,i=[];n;){for(var o=0;o<n.children.length;o++){var a=n.children[o],u=n.leaf?r(a):a;d(t,u)&&(n.leaf?e.push(a):l(t,u)?this._all(a,e):i.push(a))}n=i.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 i=n.children[r],o=n.leaf?this.toBBox(i):i;if(d(t,o)){if(n.leaf||l(t,o))return!0;e.push(i)}}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,o,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(),o=!0),a.leaf){var f=i(t,a.children,n);if(-1!==f)return a.children.splice(f,1),c.push(a),this._condense(c),this}o||a.leaf||!l(a,u)?r?(e++,a=r.children[e],o=!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 i,a=e-n+1,u=this._maxEntries;if(a<=u)return o(i=p(t.slice(n,e+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(a)/Math.log(u)),u=Math.ceil(a/Math.pow(u,r-1))),(i=p([])).leaf=!1,i.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);i.children.push(this._build(t,l,d,r-1))}}return o(i,this.toBBox),i},r.prototype._chooseSubtree=function(t,n,e,r){for(;r.push(n),!n.leaf&&r.length-1!==e;){for(var i=1/0,o=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<o?(o=h,i=s<i?s:i,a=c):h===o&&s<i&&(i=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),i=[],o=this._chooseSubtree(r,this.data,n,i);for(o.children.push(t),u(o,r);n>=0&&i[n].children.length>this._maxEntries;)this._split(i,n),n--;this._adjustParentBBoxes(r,i,n)},r.prototype._split=function(t,n){var e=t[n],r=e.children.length,i=this._minEntries;this._chooseSplitAxis(e,i,r);var a=this._chooseSplitIndex(e,i,r),u=p(e.children.splice(a,e.children.length-a));u.height=e.height,u.leaf=e.leaf,o(e,this.toBBox),o(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,o(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,n,e){for(var r,i,o,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=(i=v,o=y,u=Math.max(i.minX,o.minX),c=Math.max(i.minY,o.minY),s=Math.min(i.maxX,o.maxX),h=Math.min(i.maxY,o.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,i=t.leaf?this.compareMinY:s;this._allDistMargin(t,n,e,r)<this._allDistMargin(t,n,e,i)&&t.children.sort(r)},r.prototype._allDistMargin=function(t,n,e,r){t.children.sort(r);for(var i=this.toBBox,o=a(t,0,n,i),c=a(t,e-n,e,i),s=h(o)+h(c),f=n;f<e-n;f++){var l=t.children[f];u(o,t.leaf?i(l):l),s+=h(o)}for(var d=e-n-1;d>=n;d--){var p=t.children[d];u(c,t.leaf?i(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():o(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 co}));var r={};e.r(r),e.d(r,"Plugin",(function(){return j}));var i={};e.r(i),e.d(i,"create",(function(){return rt})),e.d(i,"fromMat4",(function(){return it})),e.d(i,"clone",(function(){return ot})),e.d(i,"copy",(function(){return at})),e.d(i,"fromValues",(function(){return ut})),e.d(i,"set",(function(){return ct})),e.d(i,"identity",(function(){return st})),e.d(i,"transpose",(function(){return ft})),e.d(i,"invert",(function(){return ht})),e.d(i,"adjoint",(function(){return lt})),e.d(i,"determinant",(function(){return dt})),e.d(i,"multiply",(function(){return pt})),e.d(i,"translate",(function(){return vt})),e.d(i,"rotate",(function(){return yt})),e.d(i,"scale",(function(){return mt})),e.d(i,"fromTranslation",(function(){return gt})),e.d(i,"fromRotation",(function(){return Mt})),e.d(i,"fromScaling",(function(){return bt})),e.d(i,"fromMat2d",(function(){return xt})),e.d(i,"fromQuat",(function(){return Ot})),e.d(i,"normalFromMat4",(function(){return St})),e.d(i,"projection",(function(){return Pt})),e.d(i,"str",(function(){return Ct})),e.d(i,"frob",(function(){return Et})),e.d(i,"add",(function(){return jt})),e.d(i,"subtract",(function(){return Tt})),e.d(i,"multiplyScalar",(function(){return At})),e.d(i,"multiplyScalarAndAdd",(function(){return Rt})),e.d(i,"exactEquals",(function(){return Bt})),e.d(i,"equals",(function(){return wt})),e.d(i,"mul",(function(){return kt})),e.d(i,"sub",(function(){return Lt}));var o={};e.r(o),e.d(o,"create",(function(){return Nt})),e.d(o,"clone",(function(){return Dt})),e.d(o,"copy",(function(){return It})),e.d(o,"fromValues",(function(){return Yt})),e.d(o,"set",(function(){return Xt})),e.d(o,"identity",(function(){return qt})),e.d(o,"transpose",(function(){return Gt})),e.d(o,"invert",(function(){return _t})),e.d(o,"adjoint",(function(){return Ft})),e.d(o,"determinant",(function(){return Ht})),e.d(o,"multiply",(function(){return Vt})),e.d(o,"translate",(function(){return $t})),e.d(o,"scale",(function(){return Wt})),e.d(o,"rotate",(function(){return Ut})),e.d(o,"rotateX",(function(){return zt})),e.d(o,"rotateY",(function(){return Qt})),e.d(o,"rotateZ",(function(){return Zt})),e.d(o,"fromTranslation",(function(){return Jt})),e.d(o,"fromScaling",(function(){return Kt})),e.d(o,"fromRotation",(function(){return tn})),e.d(o,"fromXRotation",(function(){return nn})),e.d(o,"fromYRotation",(function(){return en})),e.d(o,"fromZRotation",(function(){return rn})),e.d(o,"fromRotationTranslation",(function(){return on})),e.d(o,"fromQuat2",(function(){return an})),e.d(o,"getTranslation",(function(){return un})),e.d(o,"getScaling",(function(){return cn})),e.d(o,"getRotation",(function(){return sn})),e.d(o,"fromRotationTranslationScale",(function(){return fn})),e.d(o,"fromRotationTranslationScaleOrigin",(function(){return hn})),e.d(o,"fromQuat",(function(){return ln})),e.d(o,"frustum",(function(){return dn})),e.d(o,"perspectiveNO",(function(){return pn})),e.d(o,"perspective",(function(){return vn})),e.d(o,"perspectiveZO",(function(){return yn})),e.d(o,"perspectiveFromFieldOfView",(function(){return mn})),e.d(o,"orthoNO",(function(){return gn})),e.d(o,"ortho",(function(){return Mn})),e.d(o,"orthoZO",(function(){return bn})),e.d(o,"lookAt",(function(){return xn})),e.d(o,"targetTo",(function(){return On})),e.d(o,"str",(function(){return Sn})),e.d(o,"frob",(function(){return Pn})),e.d(o,"add",(function(){return Cn})),e.d(o,"subtract",(function(){return En})),e.d(o,"multiplyScalar",(function(){return jn})),e.d(o,"multiplyScalarAndAdd",(function(){return Tn})),e.d(o,"exactEquals",(function(){return An})),e.d(o,"equals",(function(){return Rn})),e.d(o,"mul",(function(){return Bn})),e.d(o,"sub",(function(){return wn}));var a={};e.r(a),e.d(a,"create",(function(){return kn})),e.d(a,"clone",(function(){return Ln})),e.d(a,"length",(function(){return Nn})),e.d(a,"fromValues",(function(){return Dn})),e.d(a,"copy",(function(){return In})),e.d(a,"set",(function(){return Yn})),e.d(a,"add",(function(){return Xn})),e.d(a,"subtract",(function(){return qn})),e.d(a,"multiply",(function(){return Gn})),e.d(a,"divide",(function(){return _n})),e.d(a,"ceil",(function(){return Fn})),e.d(a,"floor",(function(){return Hn})),e.d(a,"min",(function(){return Vn})),e.d(a,"max",(function(){return $n})),e.d(a,"round",(function(){return Wn})),e.d(a,"scale",(function(){return Un})),e.d(a,"scaleAndAdd",(function(){return zn})),e.d(a,"distance",(function(){return Qn})),e.d(a,"squaredDistance",(function(){return Zn})),e.d(a,"squaredLength",(function(){return Jn})),e.d(a,"negate",(function(){return Kn})),e.d(a,"inverse",(function(){return te})),e.d(a,"normalize",(function(){return ne})),e.d(a,"dot",(function(){return ee})),e.d(a,"cross",(function(){return re})),e.d(a,"lerp",(function(){return ie})),e.d(a,"hermite",(function(){return oe})),e.d(a,"bezier",(function(){return ae})),e.d(a,"random",(function(){return ue})),e.d(a,"transformMat4",(function(){return ce})),e.d(a,"transformMat3",(function(){return se})),e.d(a,"transformQuat",(function(){return fe})),e.d(a,"rotateX",(function(){return he})),e.d(a,"rotateY",(function(){return le})),e.d(a,"rotateZ",(function(){return de})),e.d(a,"angle",(function(){return pe})),e.d(a,"zero",(function(){return ve})),e.d(a,"str",(function(){return ye})),e.d(a,"exactEquals",(function(){return me})),e.d(a,"equals",(function(){return ge})),e.d(a,"sub",(function(){return be})),e.d(a,"mul",(function(){return xe})),e.d(a,"div",(function(){return Oe})),e.d(a,"dist",(function(){return Se})),e.d(a,"sqrDist",(function(){return Pe})),e.d(a,"len",(function(){return Ce})),e.d(a,"sqrLen",(function(){return Ee})),e.d(a,"forEach",(function(){return je}));var u={};e.r(u),e.d(u,"create",(function(){return Re})),e.d(u,"identity",(function(){return Be})),e.d(u,"setAxisAngle",(function(){return we})),e.d(u,"getAxisAngle",(function(){return ke})),e.d(u,"getAngle",(function(){return Le})),e.d(u,"multiply",(function(){return Ne})),e.d(u,"rotateX",(function(){return De})),e.d(u,"rotateY",(function(){return Ie})),e.d(u,"rotateZ",(function(){return Ye})),e.d(u,"calculateW",(function(){return Xe})),e.d(u,"exp",(function(){return qe})),e.d(u,"ln",(function(){return Ge})),e.d(u,"pow",(function(){return _e})),e.d(u,"slerp",(function(){return Fe})),e.d(u,"random",(function(){return He})),e.d(u,"invert",(function(){return Ve})),e.d(u,"conjugate",(function(){return $e})),e.d(u,"fromMat3",(function(){return We})),e.d(u,"fromEuler",(function(){return Ue})),e.d(u,"str",(function(){return ze})),e.d(u,"clone",(function(){return er})),e.d(u,"fromValues",(function(){return rr})),e.d(u,"copy",(function(){return ir})),e.d(u,"set",(function(){return or})),e.d(u,"add",(function(){return ar})),e.d(u,"mul",(function(){return ur})),e.d(u,"scale",(function(){return cr})),e.d(u,"dot",(function(){return sr})),e.d(u,"lerp",(function(){return fr})),e.d(u,"length",(function(){return hr})),e.d(u,"len",(function(){return lr})),e.d(u,"squaredLength",(function(){return dr})),e.d(u,"sqrLen",(function(){return pr})),e.d(u,"normalize",(function(){return vr})),e.d(u,"exactEquals",(function(){return yr})),e.d(u,"equals",(function(){return mr})),e.d(u,"rotationTo",(function(){return gr})),e.d(u,"sqlerp",(function(){return Mr})),e.d(u,"setAxes",(function(){return br}));var c={};e.r(c),e.d(c,"create",(function(){return xr})),e.d(c,"clone",(function(){return Or})),e.d(c,"fromValues",(function(){return Sr})),e.d(c,"copy",(function(){return Pr})),e.d(c,"set",(function(){return Cr})),e.d(c,"add",(function(){return Er})),e.d(c,"subtract",(function(){return jr})),e.d(c,"multiply",(function(){return Tr})),e.d(c,"divide",(function(){return Ar})),e.d(c,"ceil",(function(){return Rr})),e.d(c,"floor",(function(){return Br})),e.d(c,"min",(function(){return wr})),e.d(c,"max",(function(){return kr})),e.d(c,"round",(function(){return Lr})),e.d(c,"scale",(function(){return Nr})),e.d(c,"scaleAndAdd",(function(){return Dr})),e.d(c,"distance",(function(){return Ir})),e.d(c,"squaredDistance",(function(){return Yr})),e.d(c,"length",(function(){return Xr})),e.d(c,"squaredLength",(function(){return qr})),e.d(c,"negate",(function(){return Gr})),e.d(c,"inverse",(function(){return _r})),e.d(c,"normalize",(function(){return Fr})),e.d(c,"dot",(function(){return Hr})),e.d(c,"cross",(function(){return Vr})),e.d(c,"lerp",(function(){return $r})),e.d(c,"random",(function(){return Wr})),e.d(c,"transformMat2",(function(){return Ur})),e.d(c,"transformMat2d",(function(){return zr})),e.d(c,"transformMat3",(function(){return Qr})),e.d(c,"transformMat4",(function(){return Zr})),e.d(c,"rotate",(function(){return Jr})),e.d(c,"angle",(function(){return Kr})),e.d(c,"zero",(function(){return ti})),e.d(c,"str",(function(){return ni})),e.d(c,"exactEquals",(function(){return ei})),e.d(c,"equals",(function(){return ri})),e.d(c,"len",(function(){return ii})),e.d(c,"sub",(function(){return oi})),e.d(c,"mul",(function(){return ai})),e.d(c,"div",(function(){return ui})),e.d(c,"dist",(function(){return ci})),e.d(c,"sqrDist",(function(){return si})),e.d(c,"sqrLen",(function(){return fi})),e.d(c,"forEach",(function(){return hi}));var s={};e.r(s),e.d(s,"PathGeneratorFactory",(function(){return J})),e.d(s,"PathGenerator",(function(){return K})),e.d(s,"RBushNode",(function(){return li})),e.d(s,"RBushRoot",(function(){return di})),e.d(s,"RBush",(function(){return A.a})),e.d(s,"StyleRendererFactory",(function(){return R})),e.d(s,"CircleRendererContribution",(function(){return B})),e.d(s,"EllipseRendererContribution",(function(){return w})),e.d(s,"RectRendererContribution",(function(){return k})),e.d(s,"LineRendererContribution",(function(){return L})),e.d(s,"PolylineRendererContribution",(function(){return N})),e.d(s,"PolygonRendererContribution",(function(){return D})),e.d(s,"PathRendererContribution",(function(){return I})),e.d(s,"TextRendererContribution",(function(){return Y})),e.d(s,"ImageRendererContribution",(function(){return X})),e.d(s,"ImageRenderer",(function(){return G})),e.d(s,"TextRenderer",(function(){return _})),e.d(s,"RectRenderer",(function(){return H})),e.d(s,"CircleRenderer",(function(){return V})),e.d(s,"EllipseRenderer",(function(){return $})),e.d(s,"LineRenderer",(function(){return W})),e.d(s,"PolylineRenderer",(function(){return U})),e.d(s,"PolygonRenderer",(function(){return z})),e.d(s,"PathRenderer",(function(){return Q})),e.d(s,"Plugin",(function(){return mi}));var f={};e.r(f),e.d(f,"Plugin",(function(){return no}));var h={};e.r(h),e.d(h,"Plugin",(function(){return io}));
|
|
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)};function d(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)}var p=function(){return(p=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var i in n=arguments[e])Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i]);return t}).apply(this,arguments)};function v(t,n,e,r){var i,o=arguments.length,a=o<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--)(i=t[u])&&(a=(o<3?i(a):o>3?i(n,e,a):i(n,e))||a);return o>3&&a&&Object.defineProperty(n,e,a),a}function y(t,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,n)}function m(t,n,e,r){return new(e||(e=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function u(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var n;t.done?i(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(a,u)}c((r=r.apply(t,n||[])).next())}))}function g(t,n){var e,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;a;)try{if(e=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=n.call(t,a)}catch(t){o=[6,t],r=0}finally{e=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}}Object.create;function M(t){var n="function"==typeof Symbol&&Symbol.iterator,e=n&&t[n],r=0;if(e)return e.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function b(t,n){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var r,i,o=e.call(t),a=[];try{for(;(void 0===n||n-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(i)throw i.error}}return a}function x(t,n,e){if(e||2===arguments.length)for(var r,i=0,o=n.length;i<o;i++)!r&&i in n||(r||(r=Array.prototype.slice.call(n,0,i)),r[i]=n[i]);return t.concat(r||Array.prototype.slice.call(n))}Object.create;var O=e(0),S=e(1),P=/mobile|tablet|ip(ad|hone|od)|android/i,C=function(){function t(){}var n;return n=t,t.prototype.apply=function(t){var e=this,r=this.renderingContext.root.ownerDocument.defaultView,i=r.supportTouchEvent&&P.test(navigator.userAgent),o=function(n){t.hooks.pointerMove.call(n)},a=function(n){t.hooks.pointerUp.call(n)},u=function(n){t.hooks.pointerDown.call(n)},c=function(n){t.hooks.pointerOver.call(n)},s=function(n){t.hooks.pointerOut.call(n)},f=function(n){t.hooks.pointerCancel.call(n)},h=function(n){t.hooks.pointerWheel.call(n)},l=function(t){t.addEventListener("touchstart",u,!0),t.addEventListener("touchend",a,!0),t.addEventListener("touchmove",o,!0),t.addEventListener("touchcancel",f,!0)},d=function(t){globalThis.document.addEventListener("mousemove",o,!0),t.addEventListener("mousedown",u,!0),t.addEventListener("mouseout",s,!0),t.addEventListener("mouseover",c,!0),globalThis.addEventListener("mouseup",a,!0)},p=function(t){t.removeEventListener("touchstart",u,!0),t.removeEventListener("touchend",a,!0),t.removeEventListener("touchmove",o,!0)},v=function(t){globalThis.document.removeEventListener("mousemove",o,!0),t.removeEventListener("mousedown",u,!0),t.removeEventListener("mouseout",s,!0),t.removeEventListener("mouseover",c,!0),globalThis.removeEventListener("mouseup",a,!0)};t.hooks.init.tapPromise(n.tag,(function(){return m(e,void 0,void 0,(function(){var t;return g(this,(function(n){return t=this.contextService.getDomElement(),r.supportPointerEvent&&function(t){globalThis.document.addEventListener("pointermove",o,!0),t.addEventListener("pointerdown",u,!0),t.addEventListener("pointerleave",s,!0),t.addEventListener("pointerover",c,!0),globalThis.addEventListener("pointerup",a,!0)}(t),i?l(t):r.supportTouchEvent?(l(t),r.supportPointerEvent||d(t)):r.supportPointerEvent||d(t),t.addEventListener("wheel",h,{passive:!0,capture:!0}),[2]}))}))})),t.hooks.destroy.tap(n.tag,(function(){var t=e.contextService.getDomElement();r.supportPointerEvent&&function(t){globalThis.document.removeEventListener("pointermove",o,!0),t.removeEventListener("pointerdown",u,!0),t.removeEventListener("pointerleave",s,!0),t.removeEventListener("pointerover",c,!0),globalThis.removeEventListener("pointerup",a,!0)}(t),i?p(t):r.supportTouchEvent?(p(t),r.supportPointerEvent||v(t)):r.supportPointerEvent||v(t),t.removeEventListener("wheel",h,!0)}))},t.tag="DOMInteraction",v([Object(S.inject)(O.ContextService),y("design:type",Object)],t.prototype,"contextService",void 0),v([Object(S.inject)(O.RenderingContext),y("design:type",Object)],t.prototype,"renderingContext",void 0),t=n=v([Object(S.singleton)({contrib:O.RenderingPluginContribution})],t)}(),E=Object(S.Module)((function(t){t(C)})),j=function(){function t(){}return t.prototype.init=function(t){t.load(E,!0)},t.prototype.destroy=function(t){t.unload(E)},t}(),T=e(2),A=e.n(T),R=S.Syringe.defineToken("StyleRendererFactory"),w=S.Syringe.defineToken("CircleRenderer",{multiple:!1}),B=S.Syringe.defineToken("EllipseRenderer",{multiple:!1}),k=S.Syringe.defineToken("RectRenderer",{multiple:!1}),L=S.Syringe.defineToken("LineRenderer",{multiple:!1}),N=S.Syringe.defineToken("PolylineRenderer",{multiple:!1}),D=S.Syringe.defineToken("PolygonRenderer",{multiple:!1}),I=S.Syringe.defineToken("PathRenderer",{multiple:!1}),Y=S.Syringe.defineToken("TextRenderer",{multiple:!1}),X=S.Syringe.defineToken("ImageRenderer",{multiple:!1}),q=function(){function t(){this.imageCache={},this.patternCache={}}return t.prototype.getImageSync=function(t){return this.imageCache[t]},t.prototype.getOrCreateImage=function(t){var n=this;if(this.imageCache[t])return Promise.resolve(this.imageCache[t]);var e=this.canvasConfig.createImage;return new Promise((function(r,i){var o;e?o=e():O.isBrowser&&(o=new window.Image),o&&(o.onload=function(){r(o)},o.onerror=function(t){i(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 i=e.generatePatternKey(t),o=n.createPattern(r,t.repetition);return o&&(e.patternCache[i]=o),e.patternCache[i]}))},t.prototype.generatePatternKey=function(t){var n=t.src,e=t.repetition;return"pattern-".concat(n,"-").concat(e)},v([Object(S.inject)(O.CanvasConfig),y("design:type",Object)],t.prototype,"canvasConfig",void 0),t=v([Object(S.singleton)()],t)}(),G=function(){function t(){}return t.prototype.hash=function(t){return""},t.prototype.render=function(t,n){var e,r=n.width,i=n.height,o=n.img,a=r.value,u=i.value;Object(O.isString)(o)?e=this.imagePool.getImageSync(o):(a||(a=o.width),u||(u=o.height),e=o),e&&t.drawImage(e,0,0,a,u)},v([Object(S.inject)(q),y("design:type",q)],t.prototype,"imagePool",void 0),t=v([Object(S.singleton)({token:X})],t)}(),_=function(){function t(){}return t.prototype.hash=function(t){return""},t.prototype.render=function(t,n,e){var r=n,i=r.lineWidth,o=r.textAlign,a=r.textBaseline,u=r.lineJoin,c=r.miterLimit,s=void 0===c?0:c,f=r.letterSpacing,h=void 0===f?0:f,l=r.stroke,d=r.fill,p=r.fillOpacity,v=r.strokeOpacity,y=r.opacity,m=r.metrics,g=r.dx,M=r.dy,b=m.font,x=m.lines,S=m.height,P=m.lineHeight,C=m.lineMetrics;t.font=b,t.lineWidth=i.value,t.textAlign=o.value,t.textBaseline=a.value,t.lineJoin=u.value,t.miterLimit=s;var E=0;"middle"===a.value?E=-S/2-P/2:"bottom"===a.value||"alphabetic"===a.value||"ideographic"===a.value?E=-S:"top"!==a.value&&"hanging"!==a.value||(E=-P);var j=0;g&&g.unit===O.UnitType.kPixels&&(j+=g.value),M&&M.unit===O.UnitType.kPixels&&(E+=M.value);for(var T=0;T<x.length;T++){var A=i.value/2+j;E+=P,!Object(O.isNil)(l)&&i&&i.value&&this.drawLetterSpacing(t,x[T],C[T],o.value,A,E,h,p.value,v.value,y.value,!0),Object(O.isNil)(d)||this.drawLetterSpacing(t,x[T],C[T],o.value,A,E,h,p.value,v.value,y.value)}},t.prototype.drawLetterSpacing=function(t,n,e,r,i,o,a,u,c,s,f){if(void 0===f&&(f=!1),0!==a){var h=t.textAlign;t.textAlign="left";var l=i;"center"===r?l=i-e.width/2:"right"!==r&&"end"!==r||(l=i-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,o,c):this.fillText(t,m,l,o,u,s),l+=p-(v=t.measureText(n.substring(y+1)).width)+a,p=v}t.textAlign=h}else f?this.strokeText(t,n,i,o,c):this.fillText(t,n,i,o,u,s)},t.prototype.fillText=function(t,n,e,r,i,o){var a,u=!Object(O.isNil)(i)&&1!==i;u&&(a=t.globalAlpha,t.globalAlpha=i*o),t.fillText(n,e,r),u&&(t.globalAlpha=a)},t.prototype.strokeText=function(t,n,e,r,i){var o,a=!Object(O.isNil)(i)&&1!==i;a&&(o=t.globalAlpha,t.globalAlpha=i),t.strokeText(n,e,r),a&&(t.globalAlpha=o)},t=v([Object(S.singleton)({token:Y})],t)}(),F=function(){function t(){}return t.prototype.hash=function(t){return""},t.prototype.render=function(t,n){var e=n.fill,r=n.opacity,i=n.fillOpacity,o=n.stroke,a=n.strokeOpacity,u=n.lineWidth,c=n.lineCap,s=n.lineJoin,f=n.shadowColor,h=n.filter,l=n.miterLimit,d=!Object(O.isNil)(e),p=!Object(O.isNil)(o),v=0===e.alpha;if(d&&(Object(O.isNil)(i)||1===i.value?t.fill():(t.globalAlpha=i.value,t.fill(),t.globalAlpha=r.value)),p&&u&&u.value>0){!Object(O.isNil)(a)&&1!==a.value&&(t.globalAlpha=a.value),t.lineWidth=u.value,Object(O.isNil)(l)||(t.miterLimit=l),Object(O.isNil)(c)||(t.lineCap=c.value),Object(O.isNil)(s)||(t.lineJoin=s.value);var y=void 0,m=void 0,g=void 0,M=!Object(O.isNil)(f),b=!Object(O.isNil)(h);M&&(y=t.shadowBlur,m=t.shadowColor,Object(O.isNil)(y)||(t.shadowColor="transparent",t.shadowBlur=0)),b&&(g=t.filter,!Object(O.isNil)(g)&&g.indexOf("drop-shadow")>-1&&(t.filter=g.replace(/drop-shadow\([^)]*\)/,"").trim()||"none"));var x=d&&!v;x&&t.stroke(),M&&(t.shadowColor=m,t.shadowBlur=y),b&&(t.filter=g),x||t.stroke()}},t=v([Object(S.singleton)()],t)}(),V=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return d(n,t),n=v([Object(S.singleton)({token:k})],n)}(F),$=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return d(n,t),n=v([Object(S.singleton)({token:w})],n)}(F),H=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return d(n,t),n=v([Object(S.singleton)({token:B})],n)}(F),U=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return d(n,t),n=v([Object(S.singleton)({token:L})],n)}(F),W=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return d(n,t),n=v([Object(S.singleton)({token:N})],n)}(F),z=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return d(n,t),n=v([Object(S.singleton)({token:D})],n)}(F),Q=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return d(n,t),n=v([Object(S.singleton)({token:I})],n)}(F),Z=function(){function t(){this.gradientCache={}}return t.prototype.getOrCreateGradient=function(t,n){var e=this.generateCacheKey(t),r=t.type,i=t.x0,o=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===O.GradientPatternType.LinearGradient)h=n.createLinearGradient(i*s,o*f,a*s,u*f);else if(r===O.GradientPatternType.RadialGradient){var l=Math.sqrt(s*s+f*f)/2;h=n.createRadialGradient(i*s,o*f,0,a*s,u*f,t.r1*l)}return h&&(c.forEach((function(t){var n=b(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,i=t.x1,o=t.y1,a=t.r1,u=t.steps,c=t.width,s=t.height;return"gradient-".concat(n,"-").concat(e,"-").concat(r,"-").concat(i,"-").concat(o,"-").concat(a||0,"-").concat(c,"-").concat(s,"-").concat(u.map((function(t){return t.join("")})).join("-"))},t=v([Object(S.singleton)()],t)}();var J=S.Syringe.defineToken("PathGeneratorFactory"),K=S.Syringe.defineToken("PathGenerator"),tt=1e-6,nt="undefined"!=typeof Float32Array?Float32Array:Array,et=Math.random;Math.PI;function rt(){var t=new nt(9);return nt!=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 it(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 ot(t){var n=new nt(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 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],t}function ut(t,n,e,r,i,o,a,u,c){var s=new nt(9);return s[0]=t,s[1]=n,s[2]=e,s[3]=r,s[4]=i,s[5]=o,s[6]=a,s[7]=u,s[8]=c,s}function ct(t,n,e,r,i,o,a,u,c,s){return t[0]=n,t[1]=e,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=u,t[7]=c,t[8]=s,t}function st(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 ft(t,n){if(t===n){var e=n[1],r=n[2],i=n[5];t[1]=n[3],t[2]=n[6],t[3]=e,t[5]=n[7],t[6]=r,t[7]=i}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 ht(t,n){var e=n[0],r=n[1],i=n[2],o=n[3],a=n[4],u=n[5],c=n[6],s=n[7],f=n[8],h=f*a-u*s,l=-f*o+u*c,d=s*o-a*c,p=e*h+r*l+i*d;return p?(p=1/p,t[0]=h*p,t[1]=(-f*r+i*s)*p,t[2]=(u*r-i*a)*p,t[3]=l*p,t[4]=(f*e-i*c)*p,t[5]=(-u*e+i*o)*p,t[6]=d*p,t[7]=(-s*e+r*c)*p,t[8]=(a*e-r*o)*p,t):null}function lt(t,n){var e=n[0],r=n[1],i=n[2],o=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]=i*s-r*f,t[2]=r*u-i*a,t[3]=u*c-o*f,t[4]=e*f-i*c,t[5]=i*o-e*u,t[6]=o*s-a*c,t[7]=r*c-e*s,t[8]=e*a-r*o,t}function dt(t){var n=t[0],e=t[1],r=t[2],i=t[3],o=t[4],a=t[5],u=t[6],c=t[7],s=t[8];return n*(s*o-a*c)+e*(-s*i+a*u)+r*(c*i-o*u)}function pt(t,n,e){var r=n[0],i=n[1],o=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*i+d*u+p*f,t[2]=l*o+d*c+p*h,t[3]=v*r+y*a+m*s,t[4]=v*i+y*u+m*f,t[5]=v*o+y*c+m*h,t[6]=g*r+M*a+b*s,t[7]=g*i+M*u+b*f,t[8]=g*o+M*c+b*h,t}function vt(t,n,e){var r=n[0],i=n[1],o=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]=i,t[2]=o,t[3]=a,t[4]=u,t[5]=c,t[6]=l*r+d*a+s,t[7]=l*i+d*u+f,t[8]=l*o+d*c+h,t}function yt(t,n,e){var r=n[0],i=n[1],o=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*i+l*u,t[2]=d*o+l*c,t[3]=d*a-l*r,t[4]=d*u-l*i,t[5]=d*c-l*o,t[6]=s,t[7]=f,t[8]=h,t}function mt(t,n,e){var r=e[0],i=e[1];return t[0]=r*n[0],t[1]=r*n[1],t[2]=r*n[2],t[3]=i*n[3],t[4]=i*n[4],t[5]=i*n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t}function gt(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 Mt(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 bt(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 xt(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 Ot(t,n){var e=n[0],r=n[1],i=n[2],o=n[3],a=e+e,u=r+r,c=i+i,s=e*a,f=r*a,h=r*u,l=i*a,d=i*u,p=i*c,v=o*a,y=o*u,m=o*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 St(t,n){var e=n[0],r=n[1],i=n[2],o=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-i*a,b=e*s-o*a,x=r*c-i*u,O=r*s-o*u,S=i*s-o*c,P=f*v-h*p,C=f*y-l*p,E=f*m-d*p,j=h*y-l*v,T=h*m-d*v,A=l*m-d*y,R=g*A-M*T+b*j+x*E-O*C+S*P;return R?(R=1/R,t[0]=(u*A-c*T+s*j)*R,t[1]=(c*E-a*A-s*C)*R,t[2]=(a*T-u*E+s*P)*R,t[3]=(i*T-r*A-o*j)*R,t[4]=(e*A-i*E+o*C)*R,t[5]=(r*E-e*T-o*P)*R,t[6]=(v*S-y*O+m*x)*R,t[7]=(y*b-p*S-m*M)*R,t[8]=(p*O-v*b+m*g)*R,t):null}function Pt(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 Ct(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function Et(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function jt(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t[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 Tt(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 At(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 Rt(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 wt(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 Bt(t,n){var e=t[0],r=t[1],i=t[2],o=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)<=tt*Math.max(1,Math.abs(e),Math.abs(h))&&Math.abs(r-l)<=tt*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(i-d)<=tt*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(o-p)<=tt*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(a-v)<=tt*Math.max(1,Math.abs(a),Math.abs(v))&&Math.abs(u-y)<=tt*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(c-m)<=tt*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(s-g)<=tt*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(f-M)<=tt*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 kt=pt,Lt=Tt;function Nt(){var t=new nt(16);return nt!=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 Dt(t){var n=new nt(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 It(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 Yt(t,n,e,r,i,o,a,u,c,s,f,h,l,d,p,v){var y=new nt(16);return y[0]=t,y[1]=n,y[2]=e,y[3]=r,y[4]=i,y[5]=o,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 Xt(t,n,e,r,i,o,a,u,c,s,f,h,l,d,p,v,y){return t[0]=n,t[1]=e,t[2]=r,t[3]=i,t[4]=o,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 qt(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 Gt(t,n){if(t===n){var e=n[1],r=n[2],i=n[3],o=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]=o,t[11]=n[14],t[12]=i,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 _t(t,n){var e=n[0],r=n[1],i=n[2],o=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-i*a,b=e*s-o*a,x=r*c-i*u,O=r*s-o*u,S=i*s-o*c,P=f*v-h*p,C=f*y-l*p,E=f*m-d*p,j=h*y-l*v,T=h*m-d*v,A=l*m-d*y,R=g*A-M*T+b*j+x*E-O*C+S*P;return R?(R=1/R,t[0]=(u*A-c*T+s*j)*R,t[1]=(i*T-r*A-o*j)*R,t[2]=(v*S-y*O+m*x)*R,t[3]=(l*O-h*S-d*x)*R,t[4]=(c*E-a*A-s*C)*R,t[5]=(e*A-i*E+o*C)*R,t[6]=(y*b-p*S-m*M)*R,t[7]=(f*S-l*b+d*M)*R,t[8]=(a*T-u*E+s*P)*R,t[9]=(r*E-e*T-o*P)*R,t[10]=(p*O-v*b+m*g)*R,t[11]=(h*b-f*O-d*g)*R,t[12]=(u*C-a*j-c*P)*R,t[13]=(e*j-r*C+i*P)*R,t[14]=(v*M-p*x-y*g)*R,t[15]=(f*x-h*M+l*g)*R,t):null}function Ft(t,n){var e=n[0],r=n[1],i=n[2],o=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*(i*m-o*y)+v*(i*d-o*l)),t[2]=r*(c*m-s*y)-u*(i*m-o*y)+v*(i*s-o*c),t[3]=-(r*(c*d-s*l)-u*(i*d-o*l)+h*(i*s-o*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*(i*m-o*y)+p*(i*d-o*l),t[6]=-(e*(c*m-s*y)-a*(i*m-o*y)+p*(i*s-o*c)),t[7]=e*(c*d-s*l)-a*(i*d-o*l)+f*(i*s-o*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-o*v)+p*(r*d-o*h)),t[10]=e*(u*m-s*v)-a*(r*m-o*v)+p*(r*s-o*u),t[11]=-(e*(u*d-s*h)-a*(r*d-o*h)+f*(r*s-o*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-i*v)+p*(r*l-i*h),t[14]=-(e*(u*y-c*v)-a*(r*y-i*v)+p*(r*c-i*u)),t[15]=e*(u*l-c*h)-a*(r*l-i*h)+f*(r*c-i*u),t}function Vt(t){var n=t[0],e=t[1],r=t[2],i=t[3],o=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*o)*(h*y-l*v)-(n*u-r*o)*(f*y-l*p)+(n*c-i*o)*(f*v-h*p)+(e*u-r*a)*(s*y-l*d)-(e*c-i*a)*(s*v-h*d)+(r*c-i*u)*(s*p-f*d)}function $t(t,n,e){var r=n[0],i=n[1],o=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],O=e[3];return t[0]=M*r+b*u+x*h+O*v,t[1]=M*i+b*c+x*l+O*y,t[2]=M*o+b*s+x*d+O*m,t[3]=M*a+b*f+x*p+O*g,M=e[4],b=e[5],x=e[6],O=e[7],t[4]=M*r+b*u+x*h+O*v,t[5]=M*i+b*c+x*l+O*y,t[6]=M*o+b*s+x*d+O*m,t[7]=M*a+b*f+x*p+O*g,M=e[8],b=e[9],x=e[10],O=e[11],t[8]=M*r+b*u+x*h+O*v,t[9]=M*i+b*c+x*l+O*y,t[10]=M*o+b*s+x*d+O*m,t[11]=M*a+b*f+x*p+O*g,M=e[12],b=e[13],x=e[14],O=e[15],t[12]=M*r+b*u+x*h+O*v,t[13]=M*i+b*c+x*l+O*y,t[14]=M*o+b*s+x*d+O*m,t[15]=M*a+b*f+x*p+O*g,t}function Ht(t,n,e){var r,i,o,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],i=n[1],o=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]=i,t[2]=o,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]=i*v+c*y+l*m+n[13],t[14]=o*v+s*y+d*m+n[14],t[15]=a*v+f*y+p*m+n[15]),t}function Ut(t,n,e){var r=e[0],i=e[1],o=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]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=n[7]*i,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=n[11]*o,t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],t}function Wt(t,n,e,r){var i,o,a,u,c,s,f,h,l,d,p,v,y,m,g,M,b,x,O,S,P,C,E,j,T=r[0],A=r[1],R=r[2],w=Math.hypot(T,A,R);return w<tt?null:(T*=w=1/w,A*=w,R*=w,i=Math.sin(e),a=1-(o=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=T*T*a+o,b=A*T*a+R*i,x=R*T*a-A*i,O=T*A*a-R*i,S=A*A*a+o,P=R*A*a+T*i,C=T*R*a+A*i,E=A*R*a-T*i,j=R*R*a+o,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*O+h*S+v*P,t[5]=c*O+l*S+y*P,t[6]=s*O+d*S+m*P,t[7]=f*O+p*S+g*P,t[8]=u*C+h*E+v*j,t[9]=c*C+l*E+y*j,t[10]=s*C+d*E+m*j,t[11]=f*C+p*E+g*j,n!==t&&(t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t)}function zt(t,n,e){var r=Math.sin(e),i=Math.cos(e),o=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]=o*i+s*r,t[5]=a*i+f*r,t[6]=u*i+h*r,t[7]=c*i+l*r,t[8]=s*i-o*r,t[9]=f*i-a*r,t[10]=h*i-u*r,t[11]=l*i-c*r,t}function Qt(t,n,e){var r=Math.sin(e),i=Math.cos(e),o=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]=o*i-s*r,t[1]=a*i-f*r,t[2]=u*i-h*r,t[3]=c*i-l*r,t[8]=o*r+s*i,t[9]=a*r+f*i,t[10]=u*r+h*i,t[11]=c*r+l*i,t}function Zt(t,n,e){var r=Math.sin(e),i=Math.cos(e),o=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]=o*i+s*r,t[1]=a*i+f*r,t[2]=u*i+h*r,t[3]=c*i+l*r,t[4]=s*i-o*r,t[5]=f*i-a*r,t[6]=h*i-u*r,t[7]=l*i-c*r,t}function Jt(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 Kt(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 tn(t,n,e){var r,i,o,a=e[0],u=e[1],c=e[2],s=Math.hypot(a,u,c);return s<tt?null:(a*=s=1/s,u*=s,c*=s,r=Math.sin(n),o=1-(i=Math.cos(n)),t[0]=a*a*o+i,t[1]=u*a*o+c*r,t[2]=c*a*o-u*r,t[3]=0,t[4]=a*u*o-c*r,t[5]=u*u*o+i,t[6]=c*u*o+a*r,t[7]=0,t[8]=a*c*o+u*r,t[9]=u*c*o-a*r,t[10]=c*c*o+i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function nn(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 en(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 rn(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 on(t,n,e){var r=n[0],i=n[1],o=n[2],a=n[3],u=r+r,c=i+i,s=o+o,f=r*u,h=r*c,l=r*s,d=i*c,p=i*s,v=o*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 an(t,n){var e=new nt(3),r=-n[0],i=-n[1],o=-n[2],a=n[3],u=n[4],c=n[5],s=n[6],f=n[7],h=r*r+i*i+o*o+a*a;return h>0?(e[0]=2*(u*a+f*r+c*o-s*i)/h,e[1]=2*(c*a+f*i+s*r-u*o)/h,e[2]=2*(s*a+f*o+u*i-c*r)/h):(e[0]=2*(u*a+f*r+c*o-s*i),e[1]=2*(c*a+f*i+s*r-u*o),e[2]=2*(s*a+f*o+u*i-c*r)),on(t,n,e),t}function un(t,n){return t[0]=n[12],t[1]=n[13],t[2]=n[14],t}function cn(t,n){var e=n[0],r=n[1],i=n[2],o=n[4],a=n[5],u=n[6],c=n[8],s=n[9],f=n[10];return t[0]=Math.hypot(e,r,i),t[1]=Math.hypot(o,a,u),t[2]=Math.hypot(c,s,f),t}function sn(t,n){var e=new nt(3);cn(e,n);var r=1/e[0],i=1/e[1],o=1/e[2],a=n[0]*r,u=n[1]*i,c=n[2]*o,s=n[4]*r,f=n[5]*i,h=n[6]*o,l=n[8]*r,d=n[9]*i,p=n[10]*o,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 fn(t,n,e,r){var i=n[0],o=n[1],a=n[2],u=n[3],c=i+i,s=o+o,f=a+a,h=i*c,l=i*s,d=i*f,p=o*s,v=o*f,y=a*f,m=u*c,g=u*s,M=u*f,b=r[0],x=r[1],O=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)*O,t[9]=(v-m)*O,t[10]=(1-(h+p))*O,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function hn(t,n,e,r,i){var o=n[0],a=n[1],u=n[2],c=n[3],s=o+o,f=a+a,h=u+u,l=o*s,d=o*f,p=o*h,v=a*f,y=a*h,m=u*h,g=c*s,M=c*f,b=c*h,x=r[0],O=r[1],S=r[2],P=i[0],C=i[1],E=i[2],j=(1-(v+m))*x,T=(d+b)*x,A=(p-M)*x,R=(d-b)*O,w=(1-(l+m))*O,B=(y+g)*O,k=(p+M)*S,L=(y-g)*S,N=(1-(l+v))*S;return t[0]=j,t[1]=T,t[2]=A,t[3]=0,t[4]=R,t[5]=w,t[6]=B,t[7]=0,t[8]=k,t[9]=L,t[10]=N,t[11]=0,t[12]=e[0]+P-(j*P+R*C+k*E),t[13]=e[1]+C-(T*P+w*C+L*E),t[14]=e[2]+E-(A*P+B*C+N*E),t[15]=1,t}function ln(t,n){var e=n[0],r=n[1],i=n[2],o=n[3],a=e+e,u=r+r,c=i+i,s=e*a,f=r*a,h=r*u,l=i*a,d=i*u,p=i*c,v=o*a,y=o*u,m=o*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 dn(t,n,e,r,i,o,a){var u=1/(e-n),c=1/(i-r),s=1/(o-a);return t[0]=2*o*u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*c,t[6]=0,t[7]=0,t[8]=(e+n)*u,t[9]=(i+r)*c,t[10]=(a+o)*s,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*s,t[15]=0,t}function pn(t,n,e,r,i){var o,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!=i&&i!==1/0?(o=1/(r-i),t[10]=(i+r)*o,t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t}var vn=pn;function yn(t,n,e,r,i){var o,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!=i&&i!==1/0?(o=1/(r-i),t[10]=i*o,t[14]=i*r*o):(t[10]=-1,t[14]=-r),t}function mn(t,n,e,r){var i=Math.tan(n.upDegrees*Math.PI/180),o=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/(i+o);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]=(i-o)*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 gn(t,n,e,r,i,o,a){var u=1/(n-e),c=1/(r-i),s=1/(o-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]=(i+r)*c,t[14]=(a+o)*s,t[15]=1,t}var Mn=gn;function bn(t,n,e,r,i,o,a){var u=1/(n-e),c=1/(r-i),s=1/(o-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]=(i+r)*c,t[14]=o*s,t[15]=1,t}function xn(t,n,e,r){var i,o,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],O=e[2];return Math.abs(p-b)<tt&&Math.abs(v-x)<tt&&Math.abs(y-O)<tt?qt(t):(f=p-b,h=v-x,l=y-O,i=g*(l*=d=1/Math.hypot(f,h,l))-M*(h*=d),o=M*(f*=d)-m*l,a=m*h-g*f,(d=Math.hypot(i,o,a))?(i*=d=1/d,o*=d,a*=d):(i=0,o=0,a=0),u=h*a-l*o,c=l*i-f*a,s=f*o-h*i,(d=Math.hypot(u,c,s))?(u*=d=1/d,c*=d,s*=d):(u=0,c=0,s=0),t[0]=i,t[1]=u,t[2]=f,t[3]=0,t[4]=o,t[5]=c,t[6]=h,t[7]=0,t[8]=a,t[9]=s,t[10]=l,t[11]=0,t[12]=-(i*p+o*v+a*y),t[13]=-(u*p+c*v+s*y),t[14]=-(f*p+h*v+l*y),t[15]=1,t)}function On(t,n,e,r){var i=n[0],o=n[1],a=n[2],u=r[0],c=r[1],s=r[2],f=i-e[0],h=o-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]=i,t[13]=o,t[14]=a,t[15]=1,t}function Sn(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 Pn(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 Cn(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[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 jn(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 Tn(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 An(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 Rn(t,n){var e=t[0],r=t[1],i=t[2],o=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],O=n[4],S=n[5],P=n[6],C=n[7],E=n[8],j=n[9],T=n[10],A=n[11],R=n[12],w=n[13],B=n[14],k=n[15];return Math.abs(e-g)<=tt*Math.max(1,Math.abs(e),Math.abs(g))&&Math.abs(r-M)<=tt*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(i-b)<=tt*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(o-x)<=tt*Math.max(1,Math.abs(o),Math.abs(x))&&Math.abs(a-O)<=tt*Math.max(1,Math.abs(a),Math.abs(O))&&Math.abs(u-S)<=tt*Math.max(1,Math.abs(u),Math.abs(S))&&Math.abs(c-P)<=tt*Math.max(1,Math.abs(c),Math.abs(P))&&Math.abs(s-C)<=tt*Math.max(1,Math.abs(s),Math.abs(C))&&Math.abs(f-E)<=tt*Math.max(1,Math.abs(f),Math.abs(E))&&Math.abs(h-j)<=tt*Math.max(1,Math.abs(h),Math.abs(j))&&Math.abs(l-T)<=tt*Math.max(1,Math.abs(l),Math.abs(T))&&Math.abs(d-A)<=tt*Math.max(1,Math.abs(d),Math.abs(A))&&Math.abs(p-R)<=tt*Math.max(1,Math.abs(p),Math.abs(R))&&Math.abs(v-w)<=tt*Math.max(1,Math.abs(v),Math.abs(w))&&Math.abs(y-B)<=tt*Math.max(1,Math.abs(y),Math.abs(B))&&Math.abs(m-k)<=tt*Math.max(1,Math.abs(m),Math.abs(k))}var wn=$t,Bn=En;function kn(){var t=new nt(3);return nt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Ln(t){var n=new nt(3);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n}function Nn(t){var n=t[0],e=t[1],r=t[2];return Math.hypot(n,e,r)}function Dn(t,n,e){var r=new nt(3);return r[0]=t,r[1]=n,r[2]=e,r}function In(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t}function Yn(t,n,e,r){return t[0]=n,t[1]=e,t[2]=r,t}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}function qn(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t}function Gn(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 Fn(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t[2]=Math.ceil(n[2]),t}function Vn(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 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 Un(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t[2]=Math.round(n[2]),t}function Wn(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t}function zn(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 Qn(t,n){var e=n[0]-t[0],r=n[1]-t[1],i=n[2]-t[2];return Math.hypot(e,r,i)}function Zn(t,n){var e=n[0]-t[0],r=n[1]-t[1],i=n[2]-t[2];return e*e+r*r+i*i}function Jn(t){var n=t[0],e=t[1],r=t[2];return n*n+e*e+r*r}function Kn(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t}function te(t,n){return t[0]=1/n[0],t[1]=1/n[1],t[2]=1/n[2],t}function ne(t,n){var e=n[0],r=n[1],i=n[2],o=e*e+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=n[0]*o,t[1]=n[1]*o,t[2]=n[2]*o,t}function ee(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function re(t,n,e){var r=n[0],i=n[1],o=n[2],a=e[0],u=e[1],c=e[2];return t[0]=i*c-o*u,t[1]=o*a-r*c,t[2]=r*u-i*a,t}function ie(t,n,e,r){var i=n[0],o=n[1],a=n[2];return t[0]=i+r*(e[0]-i),t[1]=o+r*(e[1]-o),t[2]=a+r*(e[2]-a),t}function oe(t,n,e,r,i,o){var a=o*o,u=a*(2*o-3)+1,c=a*(o-2)+o,s=a*(o-1),f=a*(3-2*o);return t[0]=n[0]*u+e[0]*c+r[0]*s+i[0]*f,t[1]=n[1]*u+e[1]*c+r[1]*s+i[1]*f,t[2]=n[2]*u+e[2]*c+r[2]*s+i[2]*f,t}function ae(t,n,e,r,i,o){var a=1-o,u=a*a,c=o*o,s=u*a,f=3*o*u,h=3*c*a,l=c*o;return t[0]=n[0]*s+e[0]*f+r[0]*h+i[0]*l,t[1]=n[1]*s+e[1]*f+r[1]*h+i[1]*l,t[2]=n[2]*s+e[2]*f+r[2]*h+i[2]*l,t}function ue(t,n){n=n||1;var e=2*et()*Math.PI,r=2*et()-1,i=Math.sqrt(1-r*r)*n;return t[0]=Math.cos(e)*i,t[1]=Math.sin(e)*i,t[2]=r*n,t}function ce(t,n,e){var r=n[0],i=n[1],o=n[2],a=e[3]*r+e[7]*i+e[11]*o+e[15];return a=a||1,t[0]=(e[0]*r+e[4]*i+e[8]*o+e[12])/a,t[1]=(e[1]*r+e[5]*i+e[9]*o+e[13])/a,t[2]=(e[2]*r+e[6]*i+e[10]*o+e[14])/a,t}function se(t,n,e){var r=n[0],i=n[1],o=n[2];return t[0]=r*e[0]+i*e[3]+o*e[6],t[1]=r*e[1]+i*e[4]+o*e[7],t[2]=r*e[2]+i*e[5]+o*e[8],t}function fe(t,n,e){var r=e[0],i=e[1],o=e[2],a=e[3],u=n[0],c=n[1],s=n[2],f=i*s-o*c,h=o*u-r*s,l=r*c-i*u,d=i*l-o*h,p=o*f-r*l,v=r*h-i*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 he(t,n,e,r){var i=[],o=[];return i[0]=n[0]-e[0],i[1]=n[1]-e[1],i[2]=n[2]-e[2],o[0]=i[0],o[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),o[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),t[0]=o[0]+e[0],t[1]=o[1]+e[1],t[2]=o[2]+e[2],t}function le(t,n,e,r){var i=[],o=[];return i[0]=n[0]-e[0],i[1]=n[1]-e[1],i[2]=n[2]-e[2],o[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),o[1]=i[1],o[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),t[0]=o[0]+e[0],t[1]=o[1]+e[1],t[2]=o[2]+e[2],t}function de(t,n,e,r){var i=[],o=[];return i[0]=n[0]-e[0],i[1]=n[1]-e[1],i[2]=n[2]-e[2],o[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),o[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),o[2]=i[2],t[0]=o[0]+e[0],t[1]=o[1]+e[1],t[2]=o[2]+e[2],t}function pe(t,n){var e=t[0],r=t[1],i=t[2],o=n[0],a=n[1],u=n[2],c=Math.sqrt(e*e+r*r+i*i)*Math.sqrt(o*o+a*a+u*u),s=c&&ee(t,n)/c;return Math.acos(Math.min(Math.max(s,-1),1))}function ve(t){return t[0]=0,t[1]=0,t[2]=0,t}function ye(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function me(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]}function ge(t,n){var e=t[0],r=t[1],i=t[2],o=n[0],a=n[1],u=n[2];return Math.abs(e-o)<=tt*Math.max(1,Math.abs(e),Math.abs(o))&&Math.abs(r-a)<=tt*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-u)<=tt*Math.max(1,Math.abs(i),Math.abs(u))}var Me,be=qn,xe=Gn,Oe=_n,Se=Qn,Pe=Zn,Ce=Nn,Ee=Jn,je=(Me=kn(),function(t,n,e,r,i,o){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)Me[0]=t[a],Me[1]=t[a+1],Me[2]=t[a+2],i(Me,Me,o),t[a]=Me[0],t[a+1]=Me[1],t[a+2]=Me[2];return t});function Te(t){var n=t[0],e=t[1],r=t[2],i=t[3];return Math.hypot(n,e,r,i)}function Ae(t){var n=t[0],e=t[1],r=t[2],i=t[3];return n*n+e*e+r*r+i*i}!function(){var t,n=(t=new nt(4),nt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}();function Re(){var t=new nt(4);return nt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function we(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function Be(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 ke(t,n){var e=2*Math.acos(n[3]),r=Math.sin(e/2);return r>tt?(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 Le(t,n){var e=sr(t,n);return Math.acos(2*e*e-1)}function Ne(t,n,e){var r=n[0],i=n[1],o=n[2],a=n[3],u=e[0],c=e[1],s=e[2],f=e[3];return t[0]=r*f+a*u+i*s-o*c,t[1]=i*f+a*c+o*u-r*s,t[2]=o*f+a*s+r*c-i*u,t[3]=a*f-r*u-i*c-o*s,t}function De(t,n,e){e*=.5;var r=n[0],i=n[1],o=n[2],a=n[3],u=Math.sin(e),c=Math.cos(e);return t[0]=r*c+a*u,t[1]=i*c+o*u,t[2]=o*c-i*u,t[3]=a*c-r*u,t}function Ie(t,n,e){e*=.5;var r=n[0],i=n[1],o=n[2],a=n[3],u=Math.sin(e),c=Math.cos(e);return t[0]=r*c-o*u,t[1]=i*c+a*u,t[2]=o*c+r*u,t[3]=a*c-i*u,t}function Ye(t,n,e){e*=.5;var r=n[0],i=n[1],o=n[2],a=n[3],u=Math.sin(e),c=Math.cos(e);return t[0]=r*c+i*u,t[1]=i*c-r*u,t[2]=o*c+a*u,t[3]=a*c-o*u,t}function Xe(t,n){var e=n[0],r=n[1],i=n[2];return t[0]=e,t[1]=r,t[2]=i,t[3]=Math.sqrt(Math.abs(1-e*e-r*r-i*i)),t}function qe(t,n){var e=n[0],r=n[1],i=n[2],o=n[3],a=Math.sqrt(e*e+r*r+i*i),u=Math.exp(o),c=a>0?u*Math.sin(a)/a:0;return t[0]=e*c,t[1]=r*c,t[2]=i*c,t[3]=u*Math.cos(a),t}function Ge(t,n){var e=n[0],r=n[1],i=n[2],o=n[3],a=Math.sqrt(e*e+r*r+i*i),u=a>0?Math.atan2(a,o)/a:0;return t[0]=e*u,t[1]=r*u,t[2]=i*u,t[3]=.5*Math.log(e*e+r*r+i*i+o*o),t}function _e(t,n,e){return Ge(t,n),cr(t,t,e),qe(t,t),t}function Fe(t,n,e,r){var i,o,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(o=s*d+f*p+h*v+l*y)<0&&(o=-o,d=-d,p=-p,v=-v,y=-y),1-o>tt?(i=Math.acos(o),a=Math.sin(i),u=Math.sin((1-r)*i)/a,c=Math.sin(r*i)/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 Ve(t){var n=et(),e=et(),r=et(),i=Math.sqrt(1-n),o=Math.sqrt(n);return t[0]=i*Math.sin(2*Math.PI*e),t[1]=i*Math.cos(2*Math.PI*e),t[2]=o*Math.sin(2*Math.PI*r),t[3]=o*Math.cos(2*Math.PI*r),t}function $e(t,n){var e=n[0],r=n[1],i=n[2],o=n[3],a=e*e+r*r+i*i+o*o,u=a?1/a:0;return t[0]=-e*u,t[1]=-r*u,t[2]=-i*u,t[3]=o*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 Ue(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 i=0;n[4]>n[0]&&(i=1),n[8]>n[3*i+i]&&(i=2);var o=(i+1)%3,a=(i+2)%3;e=Math.sqrt(n[3*i+i]-n[3*o+o]-n[3*a+a]+1),t[i]=.5*e,e=.5/e,t[3]=(n[3*o+a]-n[3*a+o])*e,t[o]=(n[3*o+i]+n[3*i+o])*e,t[a]=(n[3*a+i]+n[3*i+a])*e}return t}function We(t,n,e,r){var i=.5*Math.PI/180;n*=i,e*=i,r*=i;var o=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]=o*c*f-a*u*s,t[1]=a*u*f+o*c*s,t[2]=a*c*s-o*u*f,t[3]=a*c*f+o*u*s,t}function ze(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var Qe,Ze,Je,Ke,tr,nr,er=function(t){var n=new nt(4);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n},rr=function(t,n,e,r){var i=new nt(4);return i[0]=t,i[1]=n,i[2]=e,i[3]=r,i},ir=function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t},or=function(t,n,e,r,i){return t[0]=n,t[1]=e,t[2]=r,t[3]=i,t},ar=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},ur=Ne,cr=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},sr=function(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+t[3]*n[3]},fr=function(t,n,e,r){var i=n[0],o=n[1],a=n[2],u=n[3];return t[0]=i+r*(e[0]-i),t[1]=o+r*(e[1]-o),t[2]=a+r*(e[2]-a),t[3]=u+r*(e[3]-u),t},hr=Te,lr=hr,dr=Ae,pr=dr,vr=function(t,n){var e=n[0],r=n[1],i=n[2],o=n[3],a=e*e+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=e*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t},yr=function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]},mr=function(t,n){var e=t[0],r=t[1],i=t[2],o=t[3],a=n[0],u=n[1],c=n[2],s=n[3];return Math.abs(e-a)<=tt*Math.max(1,Math.abs(e),Math.abs(a))&&Math.abs(r-u)<=tt*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(i-c)<=tt*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(o-s)<=tt*Math.max(1,Math.abs(o),Math.abs(s))},gr=(Qe=kn(),Ze=Dn(1,0,0),Je=Dn(0,1,0),function(t,n,e){var r=ee(n,e);return r<-.999999?(re(Qe,Ze,n),Ce(Qe)<1e-6&&re(Qe,Je,n),ne(Qe,Qe),Be(t,Qe,Math.PI),t):r>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(re(Qe,n,e),t[0]=Qe[0],t[1]=Qe[1],t[2]=Qe[2],t[3]=1+r,vr(t,t))}),Mr=(Ke=Re(),tr=Re(),function(t,n,e,r,i,o){return Fe(Ke,n,i,o),Fe(tr,e,r,o),Fe(t,Ke,tr,2*o*(1-o)),t}),br=(nr=rt(),function(t,n,e,r){return nr[0]=e[0],nr[3]=e[1],nr[6]=e[2],nr[1]=r[0],nr[4]=r[1],nr[7]=r[2],nr[2]=-n[0],nr[5]=-n[1],nr[8]=-n[2],vr(t,Ue(t,nr))});function xr(){var t=new nt(2);return nt!=Float32Array&&(t[0]=0,t[1]=0),t}function Or(t){var n=new nt(2);return n[0]=t[0],n[1]=t[1],n}function Sr(t,n){var e=new nt(2);return e[0]=t,e[1]=n,e}function Pr(t,n){return t[0]=n[0],t[1]=n[1],t}function Cr(t,n,e){return t[0]=n,t[1]=e,t}function Er(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t}function jr(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t}function Tr(t,n,e){return t[0]=n[0]*e[0],t[1]=n[1]*e[1],t}function Ar(t,n,e){return t[0]=n[0]/e[0],t[1]=n[1]/e[1],t}function Rr(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t}function wr(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t}function Br(t,n,e){return t[0]=Math.min(n[0],e[0]),t[1]=Math.min(n[1],e[1]),t}function kr(t,n,e){return t[0]=Math.max(n[0],e[0]),t[1]=Math.max(n[1],e[1]),t}function Lr(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t}function Nr(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t}function Dr(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t}function Ir(t,n){var e=n[0]-t[0],r=n[1]-t[1];return Math.hypot(e,r)}function Yr(t,n){var e=n[0]-t[0],r=n[1]-t[1];return e*e+r*r}function Xr(t){var n=t[0],e=t[1];return Math.hypot(n,e)}function qr(t){var n=t[0],e=t[1];return n*n+e*e}function Gr(t,n){return t[0]=-n[0],t[1]=-n[1],t}function _r(t,n){return t[0]=1/n[0],t[1]=1/n[1],t}function Fr(t,n){var e=n[0],r=n[1],i=e*e+r*r;return i>0&&(i=1/Math.sqrt(i)),t[0]=n[0]*i,t[1]=n[1]*i,t}function Vr(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 Hr(t,n,e,r){var i=n[0],o=n[1];return t[0]=i+r*(e[0]-i),t[1]=o+r*(e[1]-o),t}function Ur(t,n){n=n||1;var e=2*et()*Math.PI;return t[0]=Math.cos(e)*n,t[1]=Math.sin(e)*n,t}function Wr(t,n,e){var r=n[0],i=n[1];return t[0]=e[0]*r+e[2]*i,t[1]=e[1]*r+e[3]*i,t}function zr(t,n,e){var r=n[0],i=n[1];return t[0]=e[0]*r+e[2]*i+e[4],t[1]=e[1]*r+e[3]*i+e[5],t}function Qr(t,n,e){var r=n[0],i=n[1];return t[0]=e[0]*r+e[3]*i+e[6],t[1]=e[1]*r+e[4]*i+e[7],t}function Zr(t,n,e){var r=n[0],i=n[1];return t[0]=e[0]*r+e[4]*i+e[12],t[1]=e[1]*r+e[5]*i+e[13],t}function Jr(t,n,e,r){var i=n[0]-e[0],o=n[1]-e[1],a=Math.sin(r),u=Math.cos(r);return t[0]=i*u-o*a+e[0],t[1]=i*a+o*u+e[1],t}function Kr(t,n){var e=t[0],r=t[1],i=n[0],o=n[1],a=Math.sqrt(e*e+r*r)*Math.sqrt(i*i+o*o),u=a&&(e*i+r*o)/a;return Math.acos(Math.min(Math.max(u,-1),1))}function ti(t){return t[0]=0,t[1]=0,t}function ni(t){return"vec2("+t[0]+", "+t[1]+")"}function ei(t,n){return t[0]===n[0]&&t[1]===n[1]}function ri(t,n){var e=t[0],r=t[1],i=n[0],o=n[1];return Math.abs(e-i)<=tt*Math.max(1,Math.abs(e),Math.abs(i))&&Math.abs(r-o)<=tt*Math.max(1,Math.abs(r),Math.abs(o))}var ii=Xr,oi=jr,ai=Tr,ui=Ar,ci=Ir,si=Yr,fi=qr,hi=function(){var t=xr();return function(n,e,r,i,o,a){var u,c;for(e||(e=2),r||(r=0),c=i?Math.min(i*e+r,n.length):n.length,u=r;u<c;u+=e)t[0]=n[u],t[1]=n[u+1],o(t,t,a),n[u]=t[0],n[u+1]=t[1];return n}}(),li=function(){function t(){}return t.tag="c-canvas-rbush-node",t}(),di="RBushRoot",pi=function(){function t(){this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreen=!1,this.enableBatch=!1,this.batchedStyleHash="",this.batchedDisplayObject=null,this.toSync=new Set}var n;return n=t,t.prototype.syncRTree=function(){var t=this,n=[];Array.from(this.toSync).filter((function(t){return t.isConnected})).forEach((function(e){var r=e.rBushNode;r&&t.rBush.remove(r.aabb);var i=e.getRenderBounds();if(i){var o=b(i.getMin(),2),a=o[0],u=o[1],c=b(i.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 li,e.pushToSync(t.composedPath().slice(0,-2))},i=function(t){var n=t.target,r=n.rBushNode;r.aabb&&(e.rBush.remove(r.aabb),e.toSync.delete(n),e.removedRBushNodeAABBs.push(r.aabb))},o=function(t){var n,r=t.target;(null===(n=r.ownerDocument)||void 0===n?void 0:n.documentElement)===e.renderingContext.root&&(t.detail.affectChildren&&r.forEach((function(t){e.pushToSync([t])})),e.pushToSync(t.composedPath().slice(0,-2)))};t.hooks.init.tapPromise(n.tag,(function(){return m(e,void 0,void 0,(function(){return g(this,(function(t){return this.renderingContext.root.addEventListener(O.ElementEvent.MOUNTED,r),this.renderingContext.root.addEventListener(O.ElementEvent.UNMOUNTED,i),this.renderingContext.root.addEventListener(O.ElementEvent.BOUNDS_CHANGED,o),[2]}))}))})),t.hooks.destroy.tap(n.tag,(function(){e.renderingContext.root.removeEventListener(O.ElementEvent.MOUNTED,r),e.renderingContext.root.removeEventListener(O.ElementEvent.UNMOUNTED,i),e.renderingContext.root.removeEventListener(O.ElementEvent.BOUNDS_CHANGED,o)})),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(O.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,i=n.enableDirtyRectangleRenderingDebug,o=e.contextService.getContext(),u=e.renderQueue;if(r){if(!e.clearFullScreen){var c=e.safeMergeAABB.apply(e,x([e.mergeDirtyAABBs(e.renderQueue)],b(e.removedRBushNodeAABBs.map((function(t){var n=t.minX,e=t.minY,r=t.maxX,i=t.maxY,o=new O.AABB;return o.setMinMax(a.fromValues(n,e,0),a.fromValues(r,i,0)),o}))),!1));if(e.removedRBushNodeAABBs=[],O.AABB.isEmpty(c))return void(e.renderQueue=[]);var s=e.convertAABB2Rect(c),f=s.x,h=s.y,l=s.width,d=s.height;o.clearRect(f,h,l,d),o.beginPath(),o.rect(f,h,l,d),o.clip(),i&&(o.lineWidth=4,o.strokeStyle="rgba(".concat(255*Math.random(),", ").concat(255*Math.random(),", ").concat(255*Math.random(),", 1)"),o.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()&&!n.isCulled()&&e.renderDisplayObject(n,t)})),e.enableBatch&&e.batchedStyleHash&&e.flush(o,t),e.renderQueue.forEach((function(t){e.saveDirtyAABB(t)})),e.renderQueue=[]}e.restoreStack.forEach((function(t){o.restore()})),e.restoreStack=[],e.clearFullScreen=!1,o.restore()})),t.hooks.render.tap(n.tag,(function(n){e.canvasConfig.renderer.getConfig().enableDirtyRectangleRendering?e.renderQueue.push(n):n.isVisible()&&!n.isCulled()&&e.renderDisplayObject(n,t)}))},t.prototype.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(),i=this.restoreStack[this.restoreStack.length-1];i&&t.parentNode!==i;)r.restore(),this.restoreStack.pop(),i=this.restoreStack[this.restoreStack.length-1];var o=t.nodeName,a=this.styleRendererFactory(o),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===O.Shape.LINE||t.nodeName===O.Shape.PATH||t.nodeName===O.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]),i=Math.floor(n[1]);return{x:r,y:i,width:Math.ceil(e[0])-r,height:Math.ceil(e[1])-i}},t.prototype.mergeDirtyAABBs=function(t){var n=new O.AABB;return t.forEach((function(t){var e=t.getRenderBounds();n.add(e);var r=t.renderable.dirtyRenderBounds;r&&n.add(r)})),n},t.prototype.searchDirtyObjects=function(t){var n=this,e=b(t.getMin(),2),r=e[0],i=e[1],o=b(t.getMax(),2),a=o[0],u=o[1];return this.rBush.search({minX:r,minY:i,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 O.AABB);var e=t.getRenderBounds();e&&n.dirtyRenderBounds.update(e.center,e.halfExtents)},t.prototype.applyTransform=function(t,n){var e=b(o.getTranslation(a.create(),n),2),r=e[0],i=e[1],c=b(o.getScaling(a.create(),n),2),s=c[0],f=c[1],h=o.getRotation(u.create(),n),l=b(Object(O.getEuler)(a.create(),h),3),d=l[0],p=(l[1],l[2]),v=Object(O.fromRotationTranslationScale)(d||p,r,i,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 i;if(t instanceof O.CSSGradientValue){if(t.type===O.GradientPatternType.LinearGradient||t.type===O.GradientPatternType.RadialGradient){var o=n.getGeometryBounds(),a=o&&2*o.halfExtents[0]||0,u=o&&2*o.halfExtents[1]||0;i=this.gradientPool.getOrCreateGradient(p(p({type:t.type},t.value),{width:a,height:u}),e)}else if(t.type===O.GradientPatternType.Pattern){var c=this.imagePool.getPatternSync(t.value);c?i=c:this.imagePool.createPattern(t.value,e).then((function(){n.renderable.dirty=!0,r.dirtify()}))}}else i=t.toString();return i},t.prototype.applyAttributesToContext=function(t,n,e){var r=n.parsedStyle,i=r.stroke,o=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&&Array.isArray(u)&&t.setLineDash(u.map((function(t){return t.value}))),Object(O.isNil)(c)||(t.lineDashOffset=c.value),Object(O.isNil)(a)||(t.globalAlpha*=a.value),Object(O.isNil)(i)||(t.strokeStyle=this.getColor(i,n,t,e)),Object(O.isNil)(o)||(t.fillStyle=this.getColor(o,n,t,e)),Object(O.isNil)(s)||(t.filter=n.style.filter),Object(O.isNil)(f)||(t.shadowColor=f.toString(),t.shadowBlur=h&&h.value||0,t.shadowOffsetX=l&&l.value||0,t.shadowOffsetY=d&&d.value||0)},t.prototype.useAnchor=function(t,n,e){var r=n.getGeometryBounds();if(r){var i=r.halfExtents,o=(n.parsedStyle||{}).anchor;t.translate(-(o&&o[0].value||0)*i[0]*2,-(o&&o[1].value||0)*i[1]*2),e()}else e()},t.prototype.safeMergeAABB=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var e=new O.AABB;return t.forEach((function(t){e.add(t)})),e},t.tag="CanvasRenderer",v([Object(S.inject)(O.CanvasConfig),y("design:type",Object)],t.prototype,"canvasConfig",void 0),v([Object(S.inject)(O.DefaultCamera),y("design:type",O.Camera)],t.prototype,"camera",void 0),v([Object(S.inject)(O.ContextService),y("design:type",Object)],t.prototype,"contextService",void 0),v([Object(S.inject)(O.RenderingContext),y("design:type",Object)],t.prototype,"renderingContext",void 0),v([Object(S.inject)(q),y("design:type",q)],t.prototype,"imagePool",void 0),v([Object(S.inject)(Z),y("design:type",Z)],t.prototype,"gradientPool",void 0),v([Object(S.inject)(J),y("design:type",Function)],t.prototype,"pathGeneratorFactory",void 0),v([Object(S.inject)(R),y("design:type",Function)],t.prototype,"styleRendererFactory",void 0),v([Object(S.inject)(O.DisplayObjectPool),y("design:type",O.DisplayObjectPool)],t.prototype,"displayObjectPool",void 0),v([Object(S.inject)(di),y("design:type",A.a)],t.prototype,"rBush",void 0),t=n=v([Object(S.singleton)({contrib:O.RenderingPluginContribution})],t)}(),vi=function(){function t(){}var n;return n=t,t.prototype.apply=function(t){var e=this,r=function(n){var r=n.target,i=r.nodeName,o=r.attributes;if(i===O.Shape.IMAGE){var a=o.img;Object(O.isString)(a)&&e.imagePool.getOrCreateImage(a).then((function(){r.renderable.dirty=!0,t.dirtify()}))}},i=function(n){var r=n.target,i=n.attrName,o=n.newValue;r.nodeName===O.Shape.IMAGE&&"img"===i&&Object(O.isString)(o)&&e.imagePool.getOrCreateImage(o).then((function(){r.renderable.dirty=!0,t.dirtify()}))};t.hooks.init.tapPromise(n.tag,(function(){return m(e,void 0,void 0,(function(){return g(this,(function(t){return this.renderingContext.root.addEventListener(O.ElementEvent.MOUNTED,r),this.renderingContext.root.addEventListener(O.ElementEvent.ATTR_MODIFIED,i),[2]}))}))})),t.hooks.destroy.tap(n.tag,(function(){e.renderingContext.root.removeEventListener(O.ElementEvent.MOUNTED,r),e.renderingContext.root.removeEventListener(O.ElementEvent.ATTR_MODIFIED,i)}))},t.tag="LoadImage",v([Object(S.inject)(q),y("design:type",q)],t.prototype,"imagePool",void 0),v([Object(S.inject)(O.RenderingContext),y("design:type",Object)],t.prototype,"renderingContext",void 0),t=n=v([Object(S.singleton)({contrib:O.RenderingPluginContribution})],t)}();S.GlobalContainer.register({token:{token:K,named:O.Shape.CIRCLE},useValue:function(t,n){var e=n.r;t.arc(e.value,e.value,e.value,0,2*Math.PI,!1)}}),S.GlobalContainer.register({token:{token:K,named:O.Shape.ELLIPSE},useValue:function(t,n){var e=n.rx,r=n.ry,i=e.value,o=r.value;if(t.ellipse)t.ellipse(i,o,i,o,0,0,2*Math.PI,!1);else{var a=i>o?i:o,u=i>o?1:i/o,c=i>o?o/i:1;t.save(),t.scale(u,c),t.arc(0,0,a,0,2*Math.PI)}}}),S.GlobalContainer.register({token:{token:K,named:O.Shape.RECT},useValue:function(t,n){var e=n.radius,r=n.width,i=n.height,o=r.value,a=i.value,u=e&&e.value||0;if(0===u)t.rect(0,0,o,a);else{var c=b(function(t){var n=0,e=0,r=0,i=0;return Array.isArray(t)?1===t.length?n=e=r=i=t[0]:2===t.length?(n=r=t[0],e=i=t[1]):3===t.length?(n=t[0],e=i=t[1],r=t[2]):(n=t[0],e=t[1],r=t[2],i=t[3]):n=e=r=i=t,[n,e,r,i]}(u),4),s=c[0],f=c[1],h=c[2],l=c[3];t.moveTo(s,0),t.lineTo(o-f,0),0!==f&&t.arc(o-f,f,f,-Math.PI/2,0),t.lineTo(o,a-h),0!==h&&t.arc(o-h,a-h,h,0,Math.PI/2),t.lineTo(l,a),0!==l&&t.arc(l,a-l,l,Math.PI/2,Math.PI),t.lineTo(0,s),0!==s&&t.arc(s,s,s,Math.PI,1.5*Math.PI)}}}),S.GlobalContainer.register({token:{token:K,named:O.Shape.LINE},useValue:function(t,n){var e=n.x1,r=n.y1,i=n.x2,o=n.y2,a=n.defX,u=void 0===a?0:a,c=n.defY,s=void 0===c?0:c;t.moveTo(e.value-u,r.value-s),t.lineTo(i.value-u,o.value-s)}}),S.GlobalContainer.register({token:{token:K,named:O.Shape.POLYLINE},useValue:function(t,n){var e=n.defX,r=void 0===e?0:e,i=n.defY,o=void 0===i?0:i,a=n.points.points,u=a.length,c=a[0][0]-r,s=a[0][1]-o,f=a[u-1][0]-r,h=a[u-1][1]-o;t.moveTo(c,s);for(var l=0;l<u-1;l++){var d=a[l];t.lineTo(d[0]-r,d[1]-o)}t.lineTo(f,h)}}),S.GlobalContainer.register({token:{token:K,named:O.Shape.POLYGON},useValue:function(t,n){var e=n.defX,r=void 0===e?0:e,i=n.defY,o=void 0===i?0:i,a=n.points.points,u=a.length,c=a[0][0]-r,s=a[0][1]-o,f=a[u-1][0]-r,h=a[u-1][1]-o;t.moveTo(c,s);for(var l=0;l<u-1;l++){var d=a[l];t.lineTo(d[0]-r,d[1]-o)}t.lineTo(f,h)}}),S.GlobalContainer.register({token:{token:K,named:O.Shape.PATH},useValue:function(t,n){var e=n.defX,r=void 0===e?0:e,i=n.defY,o=void 0===i?0:i,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=0;f<s.length;f++){var h=s[f];switch(h[0]){case"M":t.moveTo(h[1]-r,h[2]-o);break;case"C":t.bezierCurveTo(h[1]-r,h[2]-o,h[3]-r,h[4]-o,h[5]-r,h[6]-o);break;case"Z":t.closePath()}}}}),S.GlobalContainer.register({token:J,useFactory:function(t){var n={};return function(e){return n[e]||t.container.isBoundNamed(K,e)&&(n[e]=t.container.getNamed(K,e)),n[e]}}});var yi=Object(S.Module)((function(t){var n;t(q),t({token:di,useValue:new A.a}),t($),t(H),t(V),t(G),t(_),t(U),t(W),t(z),t(Q);var e=((n={})[O.Shape.CIRCLE]=w,n[O.Shape.ELLIPSE]=B,n[O.Shape.RECT]=k,n[O.Shape.IMAGE]=X,n[O.Shape.TEXT]=Y,n[O.Shape.LINE]=L,n[O.Shape.POLYLINE]=N,n[O.Shape.POLYGON]=D,n[O.Shape.PATH]=I,n);t({token:R,useFactory:function(t){var n={};return function(r){var i=e[r];return i&&!n[r]&&t.container.isBound(i)&&(n[r]=t.container.get(i)),n[r]}}}),t(Z),t(pi),t(vi)})),mi=function(){function t(){}return t.prototype.init=function(t){t.load(yi,!0)},t.prototype.destroy=function(t){t.unload(yi)},t}(),gi=S.Syringe.defineToken("PointInPathPicker"),Mi=function(){function t(){var t=this;this.isHit=function(n,e,r){var i=t.pointInPathPickerFactory(n.nodeName);if(i){var u=o.invert(o.create(),r),c=a.transformMat4(a.create(),a.fromValues(e[0],e[1],0),u),s=n.getGeometryBounds().halfExtents,f=n.parsedStyle.anchor;if(c[0]+=(f&&f[0].value||0)*s[0]*2,c[1]+=(f&&f[1].value||0)*s[1]*2,i(n,new O.Point(c[0],c[1]),t.isPointInPath))return!0}return!1},this.isPointInPath=function(n,e){var r=t.offscreenCanvas.getOrCreateContext(t.canvasConfig.offscreenCanvas),i=t.pathGeneratorFactory(n.nodeName);return i&&i(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.tapPromise(n.tag,(function(t){return m(e,void 0,void 0,(function(){var n,e,r,i,u,c,s,f,h,l,d,p,v,y,m,b,x,O=this;return g(this,(function(g){n=t.topmost,e=t.position,r=e.x,i=e.y,u=a.fromValues(r,i,0),c=this.rBush.search({minX:u[0],minY:u[1],maxX:u[0],maxY:u[1]}),s=c.map((function(t){return t.id})),f=[],c.forEach((function(t){var n=t.id,e=O.displayObjectPool.getByEntity(n);if(e.isVisible()&&!e.isCulled()&&e.isInteractive()){if(e.parentNode&&-1===s.indexOf(e.parentNode.entity))return;f.push(e)}})),f.sort((function(t,n){return n.sortable.renderOrder-t.sortable.renderOrder})),h=[];try{for(l=M(f),d=l.next();!d.done;d=l.next())if(p=d.value,v=p.parsedStyle.clipPath,y=v||p,m=p.getWorldTransform(),v&&(m=o.multiply(o.create(),m,v.getLocalTransform())),this.isHit(y,u,m)){if(n)return t.picked=[p],[2,t];h.push(p)}}catch(t){b={error:t}}finally{try{d&&!d.done&&(x=l.return)&&x.call(l)}finally{if(b)throw b.error}}return t.picked=h,[2,t]}))}))}))},t.tag="CanvasPicker",v([Object(S.inject)(O.DisplayObjectPool),y("design:type",O.DisplayObjectPool)],t.prototype,"displayObjectPool",void 0),v([Object(S.inject)(O.CanvasConfig),y("design:type",Object)],t.prototype,"canvasConfig",void 0),v([Object(S.inject)(O.OffscreenCanvasCreator),y("design:type",O.OffscreenCanvasCreator)],t.prototype,"offscreenCanvas",void 0),v([Object(S.inject)(di),y("design:type",Function)],t.prototype,"rBush",void 0),v([Object(S.inject)(J),y("design:type",Function)],t.prototype,"pathGeneratorFactory",void 0),v([Object(S.inject)(gi),y("design:type",Function)],t.prototype,"pointInPathPickerFactory",void 0),t=n=v([Object(S.singleton)({contrib:O.RenderingPluginContribution})],t)}();function bi(t,n,e,r){var i=t-e,o=n-r;return Math.sqrt(i*i+o*o)}function xi(t,n){return Math.abs(t-n)<.001}function Oi(t,n){var e=Math.min.apply(Math,x([],b(t),!1)),r=Math.min.apply(Math,x([],b(n),!1));return{x:e,y:r,width:Math.max.apply(Math,x([],b(t),!1))-e,height:Math.max.apply(Math,x([],b(n),!1))-r}}function Si(t){return(t+2*Math.PI)%(2*Math.PI)}var Pi={box:function(t,n,e,r){return Oi([t,e],[n,r])},length:function(t,n,e,r){return bi(t,n,e,r)},pointAt:function(t,n,e,r,i){return{x:(1-i)*t+i*e,y:(1-i)*n+i*r}},pointDistance:function(t,n,e,r,i,o){var a=(e-t)*(i-t)+(r-n)*(o-n);return a<0?bi(t,n,i,o):a>(e-t)*(e-t)+(r-n)*(r-n)?bi(e,r,i,o):this.pointToLine(t,n,e,r,i,o)},pointToLine:function(t,n,e,r,i,o){var a=[e-t,r-n];if(c.exactEquals(a,[0,0]))return Math.sqrt((i-t)*(i-t)+(o-n)*(o-n));var u=[-a[1],a[0]];c.normalize(u,u);var s=[i-t,o-n];return Math.abs(c.dot(s,u))},tangentAngle:function(t,n,e,r){return Math.atan2(r-n,e-t)}};function Ci(t,n,e,r,i,o){var a=-1,u=1/0,c=[e,r],s=20;o&&o>200&&(s=o/10);for(var f=1/s,h=f/10,l=0;l<=s;l++){var d=l*f,p=[i.apply(void 0,x([],b(t.concat([d])),!1)),i.apply(void 0,x([],b(n.concat([d])),!1))];(g=bi(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=[i.apply(void 0,x([],b(t.concat([y])),!1)),i.apply(void 0,x([],b(n.concat([y])),!1))],bi(c[0],c[1],p[0],p[1]));if(y>=0&&g<u)a=y,u=g;else{var M=[i.apply(void 0,x([],b(t.concat([m])),!1)),i.apply(void 0,x([],b(n.concat([m])),!1))],O=bi(c[0],c[1],M[0],M[1]);m<=1&&O<u?(a=m,u=O):h*=.5}}return{x:i.apply(void 0,x([],b(t.concat([a])),!1)),y:i.apply(void 0,x([],b(n.concat([a])),!1))}}function Ei(t,n,e,r){var i=1-r;return i*i*t+2*r*i*n+r*r*e}function ji(t,n,e){var r=t+e-2*n;if(xi(r,0))return[.5];var i=(t-n)/r;return i<=1&&i>=0?[i]:[]}function Ti(t,n,e,r){return 2*(1-r)*(n-t)+2*r*(e-n)}function Ai(t,n,e,r,i,o,a){var u=Ei(t,e,i,a),c=Ei(n,r,o,a),s=Pi.pointAt(t,n,e,r,a),f=Pi.pointAt(e,r,i,o,a);return[[t,n,s.x,s.y,u,c],[u,c,f.x,f.y,i,o]]}var Ri={box:function(t,n,e,r,i,o){var a=ji(t,e,i)[0],u=ji(n,r,o)[0],c=[t,i],s=[n,o];return void 0!==a&&c.push(Ei(t,e,i,a)),void 0!==u&&s.push(Ei(n,r,o,u)),Oi(c,s)},length:function(t,n,e,r,i,o){return function t(n,e,r,i,o,a,u){if(0===u)return(bi(n,e,r,i)+bi(r,i,o,a)+bi(n,e,o,a))/2;var c=Ai(n,e,r,i,o,a,.5),s=c[0],f=c[1];return s.push(u-1),f.push(u-1),t.apply(void 0,x([],b(s),!1))+t.apply(void 0,x([],b(f),!1))}(t,n,e,r,i,o,3)},nearestPoint:function(t,n,e,r,i,o,a,u){return Ci([t,e,i],[n,r,o],a,u,Ei)},pointDistance:function(t,n,e,r,i,o,a,u){var c=this.nearestPoint(t,n,e,r,i,o,a,u);return bi(c.x,c.y,a,u)},interpolationAt:Ei,pointAt:function(t,n,e,r,i,o,a){return{x:Ei(t,e,i,a),y:Ei(n,r,o,a)}},divide:function(t,n,e,r,i,o,a){return Ai(t,n,e,r,i,o,a)},tangentAngle:function(t,n,e,r,i,o,a){var u=Ti(t,e,i,a),c=Ti(n,r,o,a);return Si(Math.atan2(c,u))}};function wi(t,n,e,r,i){var o=1-i;return o*o*o*t+3*n*i*o*o+3*e*i*i*o+r*i*i*i}function Bi(t,n,e,r,i){var o=1-i;return 3*(o*o*(n-t)+2*o*i*(e-n)+i*i*(r-e))}function ki(t,n,e,r){var i,o,a,u=-3*t+9*n-9*e+3*r,c=6*t-12*n+6*e,s=3*n-3*t,f=[];if(xi(u,0))xi(c,0)||(i=-s/c)>=0&&i<=1&&f.push(i);else{var h=c*c-4*u*s;xi(h,0)?f.push(-c/(2*u)):h>0&&(o=(-c-(a=Math.sqrt(h)))/(2*u),(i=(-c+a)/(2*u))>=0&&i<=1&&f.push(i),o>=0&&o<=1&&f.push(o))}return f}function Li(t,n,e,r,i,o,a,u,c){var s=wi(t,e,i,a,c),f=wi(n,r,o,u,c),h=Pi.pointAt(t,n,e,r,c),l=Pi.pointAt(e,r,i,o,c),d=Pi.pointAt(i,o,a,u,c),p=Pi.pointAt(h.x,h.y,l.x,l.y,c),v=Pi.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 Ni(t,n,e,r,i,o,a,u,c){if(0===c)return function(t,n){for(var e=0,r=t.length,i=0;i<r;i++){e+=bi(t[i],n[i],t[(i+1)%r],n[(i+1)%r])}return e/2}([t,e,i,a],[n,r,o,u]);var s=Li(t,n,e,r,i,o,a,u,.5),f=x(x([],b(s[0]),!1),[c-1],!1),h=x(x([],b(s[1]),!1),[c-1],!1);return Ni.apply(void 0,x([],b(f),!1))+Ni.apply(void 0,x([],b(h),!1))}var Di={extrema:ki,box:function(t,n,e,r,i,o,a,u){for(var c=[t,a],s=[n,u],f=ki(t,e,i,a),h=ki(n,r,o,u),l=0;l<f.length;l++)c.push(wi(t,e,i,a,f[l]));for(l=0;l<h.length;l++)s.push(wi(n,r,o,u,h[l]));return Oi(c,s)},length:function(t,n,e,r,i,o,a,u){return Ni(t,n,e,r,i,o,a,u,3)},nearestPoint:function(t,n,e,r,i,o,a,u,c,s,f){return Ci([t,e,i,a],[n,r,o,u],c,s,wi,f)},pointDistance:function(t,n,e,r,i,o,a,u,c,s,f){var h=this.nearestPoint(t,n,e,r,i,o,a,u,c,s,f);return bi(h.x,h.y,c,s)},interpolationAt:wi,pointAt:function(t,n,e,r,i,o,a,u,c){return{x:wi(t,e,i,a,c),y:wi(n,r,o,u,c)}},divide:function(t,n,e,r,i,o,a,u,c){return Li(t,n,e,r,i,o,a,u,c)},tangentAngle:function(t,n,e,r,i,o,a,u,c){var s=Bi(t,e,i,a,c),f=Bi(n,r,o,u,c);return Si(Math.atan2(f,s))}};function Ii(t,n,e,r){var i=t-e,o=n-r;return Math.sqrt(i*i+o*o)}function Yi(t,n,e,r,i,o){return i>=t&&i<=t+e&&o>=n&&o<=n+r}function Xi(t,n,e,r,i,o,a,u){var c=(Math.atan2(u-n,a-t)+2*Math.PI)%(2*Math.PI);if(c<r||c>i)return!1;var s={x:t+e*Math.cos(c),y:n+e*Math.sin(c)};return Ii(s.x,s.y,a,u)<=o/2}function qi(t,n,e,r,i,o,a){var u=Math.min(t,e),c=Math.max(t,e),s=Math.min(n,r),f=Math.max(n,r),h=i/2;return o>=u-h&&o<=c+h&&a>=s-h&&a<=f+h&&Pi.pointToLine(t,n,e,r,o,a)<=i/2}function Gi(t,n,e,r,i){var o=t.length;if(o<2)return!1;for(var a=0;a<o-1;a++){if(qi(t[a][0],t[a][1],t[a+1][0],t[a+1][1],n,e,r))return!0}if(i){var u=t[0],c=t[o-1];if(qi(u[0],u[1],c[0],c[1],n,e,r))return!0}return!1}function _i(t){return Math.abs(t)<1e-6?0:t<0?-1:1}function Fi(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 Vi(t,n,e){var r=!1,i=t.length;if(i<=2)return!1;for(var o=0;o<i;o++){var a=t[o],u=t[(o+1)%i];if(Fi(a,u,[n,e]))return!0;_i(a[1]-e)>0!=_i(u[1]-e)>0&&_i(n-(e-a[1])*(a[0]-u[0])/(a[1]-u[1])-a[0])<0&&(r=!r)}return r}function $i(t,n,e){for(var r=!1,i=0;i<t.length;i++){if(r=Vi(t[i],n,e))break}return r}function Hi(t,n){var e=t.parsedStyle,r=e.r,i=e.fill,o=e.stroke,a=e.lineWidth,u=e.clipPathTargets,c=r.value,s=a.value/2,f=Ii(c,c,n.x,n.y),h=!!(null==u?void 0:u.length),l=i&&!i.isNone,d=o&&!o.isNone;return l&&d||h?f<=c+s:l?f<=c:!!d&&(f>=c-s&&f<=c+s)}function Ui(t,n,e,r){return t/(e*e)+n/(r*r)}function Wi(t,n){var e=n.x,r=n.y,i=t.parsedStyle,o=i.rx,a=i.ry,u=i.fill,c=i.stroke,s=i.lineWidth,f=i.clipPathTargets,h=!!(null==f?void 0:f.length),l=u&&!u.isNone,d=c&&!c.isNone,p=o.value,v=a.value,y=s.value/2,m=(e-p)*(e-p),g=(r-v)*(r-v);return l&&d||h?Ui(m,g,p+y,v+y)<=1:l?Ui(m,g,p,v)<=1:!!d&&(Ui(m,g,p-y,v-y)>=1&&Ui(m,g,p+y,v+y)<=1)}function zi(t,n){var e=t.parsedStyle,r=e.x1,i=e.y1,o=e.x2,a=e.y2,u=e.lineWidth,c=e.defX,s=void 0===c?0:c,f=e.defY,h=void 0===f?0:f;return qi(r.value,i.value,o.value,a.value,u.value,n.x+s,n.y+h)}function Qi(t,n){var e=t.parsedStyle,r=e.stroke,i=e.lineWidth,o=e.points,a=e.defX,u=void 0===a?0:a,c=e.defY,s=void 0===c?0:c,f=e.clipPathTargets,h=!!(null==f?void 0:f.length);return!(("none"===t.attributes.stroke||!r)&&!h||!i)&&Gi(o.points,i.value,n.x+u,n.y+s,!1)}function Zi(t,n,e){var r=t.parsedStyle,o=r.lineWidth,a=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=u&&!u.isNone,y=a&&!a.isNone,m=p.segments,g=p.hasArc,M=p.polylines,b=p.polygons,x=p.totalLength,O=!!(null==d?void 0:d.length),S=!1;return(y||O)&&(S=function(t,n,e,r,o,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||Yi(y.x-f,y.y-f,y.width+n,y.height+n,e,r)){switch(l.command){case"L":case"Z":s=qi(v[0],v[1],d[0],d[1],n,e,r);break;case"Q":s=Ri.pointDistance(v[0],v[1],p[1],p[2],p[3],p[4],e,r)<=n/2;break;case"C":s=Di.pointDistance(v[0],v[1],p[1],p[2],p[3],p[4],p[5],p[6],e,r,o)<=n/2;break;case"A":var m=l.arcParams,g=m.cx,M=m.cy,b=m.rx,x=m.ry,O=m.startAngle,S=m.endAngle,P=m.xRotation,C=b>x?b:x,E=b>x?1:b/x,j=b>x?x/b:1,T=i.fromTranslation(i.create(),[-g,-M]);i.multiply(T,i.fromRotation(i.create(),-P),T),i.multiply(T,i.fromScaling(i.create(),[1/E,1/j]),T);var A=c.fromValues(e,r);s=Xi(0,0,C,O,S,n,(A=c.transformMat3(A,A,T))[0],A[1])}if(s)break}}return s}(m,o.value,n.x+f,n.y+l,x)),S||!v&&!O||(S=g?e(t,n):$i(b,n.x+f,n.y+l)||$i(M,n.x+f,n.y+l)),S}function Ji(t,n,e){var r=t.parsedStyle,i=r.radius,o=r.fill,a=r.stroke,u=r.lineWidth,c=r.width,s=r.height,f=r.clipPathTargets,h=!!(null==f?void 0:f.length),l=o&&!o.isNone,d=a&&!a.isNone,p=c.unit,v=c.value,y=s.unit,m=s.value,g=0,M=0;if(p!==O.UnitType.kNumber&&p!==O.UnitType.kPixels||(g=v),y!==O.UnitType.kNumber&&y!==O.UnitType.kPixels||(M=m),i){var b=!1;return(d||h)&&(b=function(t,n,e,r,i,o,a,u){return qi(t+i,n,t+e-i,n,o,a,u)||qi(t+e,n+i,t+e,n+r-i,o,a,u)||qi(t+e-i,n+r,t+i,n+r,o,a,u)||qi(t,n+r-i,t,n+i,o,a,u)||Xi(t+e-i,n+i,i,1.5*Math.PI,2*Math.PI,o,a,u)||Xi(t+e-i,n+r-i,i,0,.5*Math.PI,o,a,u)||Xi(t+i,n+r-i,i,.5*Math.PI,Math.PI,o,a,u)||Xi(t+i,n+i,i,Math.PI,1.5*Math.PI,o,a,u)}(0,0,g,M,i.value,u.value,n.x,n.y)),b||!l&&!h||(b=e(t,n)),b}var x=u.value/2;return l&&d||h?Yi(0-x,0-x,g+x,M+x,n.x,n.y):l?Yi(0,0,g,M,n.x,n.y):!!d&&function(t,n,e,r,i,o,a){var u=i/2;return Yi(t-u,n-u,e,i,o,a)||Yi(t+e-u,n-u,i,r,o,a)||Yi(t+u,n+r-u,e,i,o,a)||Yi(t-u,n+u,i,r,o,a)}(0,0,g,M,u.value,n.x,n.y)}function Ki(t,n){var e=t.parsedStyle,r=e.stroke,i=e.fill,o=e.lineWidth,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),d=i&&!i.isNone,p=!1;return(r&&!r.isNone||l)&&(p=Gi(a.points,o.value,n.x+c,n.y+f,!0)),p||!d&&!l||(p=Vi(a.points,n.x+c,n.y+f)),p}var to=Object(S.Module)((function(t){t({token:gi,useFactory:function(t){return function(t){return t===O.Shape.CIRCLE?Hi:t===O.Shape.ELLIPSE?Wi:t===O.Shape.RECT?Ji:t===O.Shape.LINE?zi:t===O.Shape.POLYLINE?Qi:t===O.Shape.POLYGON?Ki:t===O.Shape.PATH?Zi:t===O.Shape.IMAGE||t===O.Shape.TEXT?function(){return!0}:null}}}),t(Mi)})),no=function(){function t(){}return t.prototype.init=function(t){t.load(to,!0)},t.prototype.destroy=function(t){t.unload(to)},t}(),eo=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===O.Shape.HTML){var r=n.parsedStyle.innerHTML,i="g-html-"+n.entity,o=e.contextService.getDomElement().parentNode;if(o)if(!o.querySelector("#"+i)){var a=document.createElement("div");n.parsedStyle.$el=a,a.id=i,Object(O.isString)(r)?a.innerHTML=r:a.appendChild(r),o.appendChild(a)}}},i=function(t){var n=t.target;if(n.nodeName===O.Shape.HTML){var r="g-html-"+n.entity,i=e.contextService.getDomElement().parentNode;if(i){var o=i.querySelector("#"+r);o&&i.removeChild(o)}}};t.hooks.init.tapPromise(n.tag,(function(){return m(e,void 0,void 0,(function(){return g(this,(function(t){return this.renderingContext.root.addEventListener(O.ElementEvent.MOUNTED,r),this.renderingContext.root.addEventListener(O.ElementEvent.UNMOUNTED,i),[2]}))}))})),t.hooks.destroy.tap(n.tag,(function(){e.renderingContext.root.removeEventListener(O.ElementEvent.MOUNTED,r),e.renderingContext.root.removeEventListener(O.ElementEvent.UNMOUNTED,i)})),t.hooks.render.tap(n.tag,(function(t){if(t.nodeName===O.Shape.HTML){var n="g-html-"+t.entity,r=e.contextService.getDomElement().parentNode;if(r){var i=r.querySelector("#"+n);e.updateCSSStyle(i,t.parsedStyle,t)}}}))},t.prototype.updateCSSStyle=function(t,n,e){var r,i,o=n.zIndex,a=n.visibility,u=n.opacity,c=n.fill,s=n.lineWidth,f=n.lineDash,h=n.stroke,l=n.width,d=n.height,p=n.style,v=void 0===p?"":p,y=n.className,m=void 0===y?"":y;r=l.value,i=d.value;var g={position:"absolute",top:0,left:0};if(g.width="".concat(r,"px"),g.height="".concat(i,"px"),g.transform="matrix3d(".concat(e.getWorldTransform().join(","),")"),e.style.transformOrigin&&(g["transform-origin"]=e.style.transformOrigin),g["z-index"]=o.value,g.visibility=a.value,g.opacity=u.value,c){var M="";if(c instanceof O.CSSRGB)M=c.toString();else if(c instanceof O.CSSGradientValue&&c.type===O.GradientPatternType.LinearGradient){var b=c.value.steps.map((function(t){return"".concat(t[1]," ").concat(100*Number(t[0]),"%")})).join(",");M="linear-gradient(to right, ".concat(b,");")}g.background=M}g["border-width"]="".concat((null==s?void 0:s.value)||0,"px"),h&&(g["border-color"]=h.toString(),g["border-style"]="solid"),f&&(g["border-style"]="dashed"),e.style.filter&&(g.filter=e.style.filter),m&&(Array.isArray(m)?m.forEach((function(n){t.classList.add(n)})):t.classList.add(m)),t.setAttribute("style",Object.keys(g).map((function(t){return"".concat(t,":").concat(g[t])})).join(";")+v)},t.tag="HTMLRendering",v([Object(S.inject)(O.ContextService),y("design:type",Object)],t.prototype,"contextService",void 0),v([Object(S.inject)(O.RenderingContext),y("design:type",Object)],t.prototype,"renderingContext",void 0),t=n=v([Object(S.singleton)({contrib:O.RenderingPluginContribution})],t)}(),ro=Object(S.Module)((function(t){t(eo)})),io=function(){function t(){}return t.prototype.init=function(t){t.load(ro,!0)},t.prototype.destroy=function(t){t.unload(ro)},t}();var oo=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=Object(O.isString)(n)?document.getElementById(n):n,this.$container)){var i=document.createElement("canvas");this.$container.appendChild(i),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=i}this.context=this.$canvas.getContext("2d");var o=r||O.isBrowser&&window.devicePixelRatio||1;o=o>=1?Math.ceil(o):1,this.dpr=o,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){O.isBrowser&&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)},v([Object(S.inject)(O.CanvasConfig),y("design:type",Object)],t.prototype,"canvasConfig",void 0),t=v([Object(S.singleton)({token:O.ContextService})],t)}(),ao=Object(S.Module)((function(t){t(oo)})),uo=function(){function t(){}return t.prototype.init=function(t){t.load(ao,!0)},t.prototype.destroy=function(t){t.unload(ao)},t}(),co=function(t){function n(n){var e=t.call(this,n)||this;return e.registerPlugin(new uo),e.registerPlugin(new mi),e.registerPlugin(new j),e.registerPlugin(new no),e.registerPlugin(new io),e}return d(n,t),n}(O.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)};function d(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)}var p=function(){return(p=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var i in n=arguments[e])Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i]);return t}).apply(this,arguments)};function v(t,n,e,r){var i,o=arguments.length,a=o<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--)(i=t[u])&&(a=(o<3?i(a):o>3?i(n,e,a):i(n,e))||a);return o>3&&a&&Object.defineProperty(n,e,a),a}function y(t,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,n)}function m(t,n,e,r){return new(e||(e=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function u(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var n;t.done?i(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(a,u)}c((r=r.apply(t,n||[])).next())}))}function g(t,n){var e,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;a;)try{if(e=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=n.call(t,a)}catch(t){o=[6,t],r=0}finally{e=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}}Object.create;function M(t){var n="function"==typeof Symbol&&Symbol.iterator,e=n&&t[n],r=0;if(e)return e.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function b(t,n){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var r,i,o=e.call(t),a=[];try{for(;(void 0===n||n-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(i)throw i.error}}return a}function x(t,n,e){if(e||2===arguments.length)for(var r,i=0,o=n.length;i<o;i++)!r&&i in n||(r||(r=Array.prototype.slice.call(n,0,i)),r[i]=n[i]);return t.concat(r||Array.prototype.slice.call(n))}Object.create;var O=e(0),S=e(1),P=/mobile|tablet|ip(ad|hone|od)|android/i,C=function(){function t(){}var n;return n=t,t.prototype.apply=function(t){var e=this,r=this.renderingContext.root.ownerDocument.defaultView,i=r.supportTouchEvent&&P.test(navigator.userAgent),o=function(n){t.hooks.pointerMove.call(n)},a=function(n){t.hooks.pointerUp.call(n)},u=function(n){t.hooks.pointerDown.call(n)},c=function(n){t.hooks.pointerOver.call(n)},s=function(n){t.hooks.pointerOut.call(n)},f=function(n){t.hooks.pointerCancel.call(n)},h=function(n){t.hooks.pointerWheel.call(n)},l=function(t){t.addEventListener("touchstart",u,!0),t.addEventListener("touchend",a,!0),t.addEventListener("touchmove",o,!0),t.addEventListener("touchcancel",f,!0)},d=function(t){globalThis.document.addEventListener("mousemove",o,!0),t.addEventListener("mousedown",u,!0),t.addEventListener("mouseout",s,!0),t.addEventListener("mouseover",c,!0),globalThis.addEventListener("mouseup",a,!0)},p=function(t){t.removeEventListener("touchstart",u,!0),t.removeEventListener("touchend",a,!0),t.removeEventListener("touchmove",o,!0)},v=function(t){globalThis.document.removeEventListener("mousemove",o,!0),t.removeEventListener("mousedown",u,!0),t.removeEventListener("mouseout",s,!0),t.removeEventListener("mouseover",c,!0),globalThis.removeEventListener("mouseup",a,!0)};t.hooks.init.tapPromise(n.tag,(function(){return m(e,void 0,void 0,(function(){var t;return g(this,(function(n){return t=this.contextService.getDomElement(),r.supportPointerEvent&&function(t){globalThis.document.addEventListener("pointermove",o,!0),t.addEventListener("pointerdown",u,!0),t.addEventListener("pointerleave",s,!0),t.addEventListener("pointerover",c,!0),globalThis.addEventListener("pointerup",a,!0)}(t),i?l(t):r.supportTouchEvent?(l(t),r.supportPointerEvent||d(t)):r.supportPointerEvent||d(t),t.addEventListener("wheel",h,{passive:!0,capture:!0}),[2]}))}))})),t.hooks.destroy.tap(n.tag,(function(){var t=e.contextService.getDomElement();r.supportPointerEvent&&function(t){globalThis.document.removeEventListener("pointermove",o,!0),t.removeEventListener("pointerdown",u,!0),t.removeEventListener("pointerleave",s,!0),t.removeEventListener("pointerover",c,!0),globalThis.removeEventListener("pointerup",a,!0)}(t),i?p(t):r.supportTouchEvent?(p(t),r.supportPointerEvent||v(t)):r.supportPointerEvent||v(t),t.removeEventListener("wheel",h,!0)}))},t.tag="DOMInteraction",v([Object(S.inject)(O.ContextService),y("design:type",Object)],t.prototype,"contextService",void 0),v([Object(S.inject)(O.RenderingContext),y("design:type",Object)],t.prototype,"renderingContext",void 0),t=n=v([Object(S.singleton)({contrib:O.RenderingPluginContribution})],t)}(),E=Object(S.Module)((function(t){t(C)})),j=function(){function t(){this.name="dom-interaction"}return t.prototype.init=function(t){t.load(E,!0)},t.prototype.destroy=function(t){t.unload(E)},t}(),T=e(2),A=e.n(T),R=S.Syringe.defineToken("StyleRendererFactory"),B=S.Syringe.defineToken("CircleRenderer",{multiple:!1}),w=S.Syringe.defineToken("EllipseRenderer",{multiple:!1}),k=S.Syringe.defineToken("RectRenderer",{multiple:!1}),L=S.Syringe.defineToken("LineRenderer",{multiple:!1}),N=S.Syringe.defineToken("PolylineRenderer",{multiple:!1}),D=S.Syringe.defineToken("PolygonRenderer",{multiple:!1}),I=S.Syringe.defineToken("PathRenderer",{multiple:!1}),Y=S.Syringe.defineToken("TextRenderer",{multiple:!1}),X=S.Syringe.defineToken("ImageRenderer",{multiple:!1}),q=function(){function t(){this.imageCache={},this.patternCache={}}return t.prototype.getImageSync=function(t){return this.imageCache[t]},t.prototype.getOrCreateImage=function(t){var n=this;if(this.imageCache[t])return Promise.resolve(this.imageCache[t]);var e=this.canvasConfig.createImage;return new Promise((function(r,i){var o;e?o=e():O.isBrowser&&(o=new window.Image),o&&(o.onload=function(){r(o)},o.onerror=function(t){i(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 i=e.generatePatternKey(t),o=n.createPattern(r,t.repetition);return o&&(e.patternCache[i]=o),e.patternCache[i]}))},t.prototype.generatePatternKey=function(t){var n=t.src,e=t.repetition;return"pattern-".concat(n,"-").concat(e)},v([Object(S.inject)(O.CanvasConfig),y("design:type",Object)],t.prototype,"canvasConfig",void 0),t=v([Object(S.singleton)()],t)}(),G=function(){function t(){}return t.prototype.hash=function(t){return""},t.prototype.render=function(t,n){var e,r=n.width,i=n.height,o=n.img,a=r.value,u=i.value;Object(O.isString)(o)?e=this.imagePool.getImageSync(o):(a||(a=o.width),u||(u=o.height),e=o),e&&t.drawImage(e,0,0,a,u)},v([Object(S.inject)(q),y("design:type",q)],t.prototype,"imagePool",void 0),t=v([Object(S.singleton)({token:X})],t)}(),_=function(){function t(){}return t.prototype.hash=function(t){return""},t.prototype.render=function(t,n,e){var r=n,i=r.lineWidth,o=r.textAlign,a=r.textBaseline,u=r.lineJoin,c=r.miterLimit,s=void 0===c?0:c,f=r.letterSpacing,h=void 0===f?0:f,l=r.stroke,d=r.fill,p=r.fillOpacity,v=r.strokeOpacity,y=r.opacity,m=r.metrics,g=r.dx,M=r.dy,b=m.font,x=m.lines,S=m.height,P=m.lineHeight,C=m.lineMetrics;t.font=b,t.lineWidth=i.value,t.textAlign=o.value,t.textBaseline=a.value,t.lineJoin=u.value,t.miterLimit=s;var E=0;"middle"===a.value?E=-S/2-P/2:"bottom"===a.value||"alphabetic"===a.value||"ideographic"===a.value?E=-S:"top"!==a.value&&"hanging"!==a.value||(E=-P);var j=0;g&&g.unit===O.UnitType.kPixels&&(j+=g.value),M&&M.unit===O.UnitType.kPixels&&(E+=M.value);for(var T=0;T<x.length;T++){var A=i.value/2+j;E+=P,!Object(O.isNil)(l)&&i&&i.value&&this.drawLetterSpacing(t,x[T],C[T],o.value,A,E,h,p.value,v.value,y.value,!0),Object(O.isNil)(d)||this.drawLetterSpacing(t,x[T],C[T],o.value,A,E,h,p.value,v.value,y.value)}},t.prototype.drawLetterSpacing=function(t,n,e,r,i,o,a,u,c,s,f){if(void 0===f&&(f=!1),0!==a){var h=t.textAlign;t.textAlign="left";var l=i;"center"===r?l=i-e.width/2:"right"!==r&&"end"!==r||(l=i-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,o,c):this.fillText(t,m,l,o,u,s),l+=p-(v=t.measureText(n.substring(y+1)).width)+a,p=v}t.textAlign=h}else f?this.strokeText(t,n,i,o,c):this.fillText(t,n,i,o,u,s)},t.prototype.fillText=function(t,n,e,r,i,o){var a,u=!Object(O.isNil)(i)&&1!==i;u&&(a=t.globalAlpha,t.globalAlpha=i*o),t.fillText(n,e,r),u&&(t.globalAlpha=a)},t.prototype.strokeText=function(t,n,e,r,i){var o,a=!Object(O.isNil)(i)&&1!==i;a&&(o=t.globalAlpha,t.globalAlpha=i),t.strokeText(n,e,r),a&&(t.globalAlpha=o)},t=v([Object(S.singleton)({token:Y})],t)}(),F=function(){function t(){}return t.prototype.hash=function(t){return""},t.prototype.render=function(t,n){var e=n.fill,r=n.opacity,i=n.fillOpacity,o=n.stroke,a=n.strokeOpacity,u=n.lineWidth,c=n.lineCap,s=n.lineJoin,f=n.shadowColor,h=n.filter,l=n.miterLimit,d=!Object(O.isNil)(e),p=!Object(O.isNil)(o),v=0===e.alpha;if(d&&(Object(O.isNil)(i)||1===i.value?t.fill():(t.globalAlpha=i.value,t.fill(),t.globalAlpha=r.value)),p&&u&&u.value>0){!Object(O.isNil)(a)&&1!==a.value&&(t.globalAlpha=a.value),t.lineWidth=u.value,Object(O.isNil)(l)||(t.miterLimit=l),Object(O.isNil)(c)||(t.lineCap=c.value),Object(O.isNil)(s)||(t.lineJoin=s.value);var y=void 0,m=void 0,g=void 0,M=!Object(O.isNil)(f),b=!Object(O.isNil)(h);M&&(y=t.shadowBlur,m=t.shadowColor,Object(O.isNil)(y)||(t.shadowColor="transparent",t.shadowBlur=0)),b&&(g=t.filter,!Object(O.isNil)(g)&&g.indexOf("drop-shadow")>-1&&(t.filter=g.replace(/drop-shadow\([^)]*\)/,"").trim()||"none"));var x=d&&!v;x&&t.stroke(),M&&(t.shadowColor=m,t.shadowBlur=y),b&&(t.filter=g),x||t.stroke()}},t=v([Object(S.singleton)()],t)}(),H=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return d(n,t),n=v([Object(S.singleton)({token:k})],n)}(F),V=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return d(n,t),n=v([Object(S.singleton)({token:B})],n)}(F),$=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return d(n,t),n=v([Object(S.singleton)({token:w})],n)}(F),W=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return d(n,t),n=v([Object(S.singleton)({token:L})],n)}(F),U=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return d(n,t),n=v([Object(S.singleton)({token:N})],n)}(F),z=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return d(n,t),n=v([Object(S.singleton)({token:D})],n)}(F),Q=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return d(n,t),n=v([Object(S.singleton)({token:I})],n)}(F),Z=function(){function t(){this.gradientCache={}}return t.prototype.getOrCreateGradient=function(t,n){var e=this.generateCacheKey(t),r=t.type,i=t.x0,o=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===O.GradientPatternType.LinearGradient)h=n.createLinearGradient(i*s,o*f,a*s,u*f);else if(r===O.GradientPatternType.RadialGradient){var l=Math.sqrt(s*s+f*f)/2;h=n.createRadialGradient(i*s,o*f,0,a*s,u*f,t.r1*l)}return h&&(c.forEach((function(t){var n=b(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,i=t.x1,o=t.y1,a=t.r1,u=t.steps,c=t.width,s=t.height;return"gradient-".concat(n,"-").concat(e,"-").concat(r,"-").concat(i,"-").concat(o,"-").concat(a||0,"-").concat(c,"-").concat(s,"-").concat(u.map((function(t){return t.join("")})).join("-"))},t=v([Object(S.singleton)()],t)}();var J=S.Syringe.defineToken("PathGeneratorFactory"),K=S.Syringe.defineToken("PathGenerator"),tt=1e-6,nt="undefined"!=typeof Float32Array?Float32Array:Array,et=Math.random;Math.PI;function rt(){var t=new nt(9);return nt!=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 it(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 ot(t){var n=new nt(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 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],t}function ut(t,n,e,r,i,o,a,u,c){var s=new nt(9);return s[0]=t,s[1]=n,s[2]=e,s[3]=r,s[4]=i,s[5]=o,s[6]=a,s[7]=u,s[8]=c,s}function ct(t,n,e,r,i,o,a,u,c,s){return t[0]=n,t[1]=e,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=u,t[7]=c,t[8]=s,t}function st(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 ft(t,n){if(t===n){var e=n[1],r=n[2],i=n[5];t[1]=n[3],t[2]=n[6],t[3]=e,t[5]=n[7],t[6]=r,t[7]=i}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 ht(t,n){var e=n[0],r=n[1],i=n[2],o=n[3],a=n[4],u=n[5],c=n[6],s=n[7],f=n[8],h=f*a-u*s,l=-f*o+u*c,d=s*o-a*c,p=e*h+r*l+i*d;return p?(p=1/p,t[0]=h*p,t[1]=(-f*r+i*s)*p,t[2]=(u*r-i*a)*p,t[3]=l*p,t[4]=(f*e-i*c)*p,t[5]=(-u*e+i*o)*p,t[6]=d*p,t[7]=(-s*e+r*c)*p,t[8]=(a*e-r*o)*p,t):null}function lt(t,n){var e=n[0],r=n[1],i=n[2],o=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]=i*s-r*f,t[2]=r*u-i*a,t[3]=u*c-o*f,t[4]=e*f-i*c,t[5]=i*o-e*u,t[6]=o*s-a*c,t[7]=r*c-e*s,t[8]=e*a-r*o,t}function dt(t){var n=t[0],e=t[1],r=t[2],i=t[3],o=t[4],a=t[5],u=t[6],c=t[7],s=t[8];return n*(s*o-a*c)+e*(-s*i+a*u)+r*(c*i-o*u)}function pt(t,n,e){var r=n[0],i=n[1],o=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*i+d*u+p*f,t[2]=l*o+d*c+p*h,t[3]=v*r+y*a+m*s,t[4]=v*i+y*u+m*f,t[5]=v*o+y*c+m*h,t[6]=g*r+M*a+b*s,t[7]=g*i+M*u+b*f,t[8]=g*o+M*c+b*h,t}function vt(t,n,e){var r=n[0],i=n[1],o=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]=i,t[2]=o,t[3]=a,t[4]=u,t[5]=c,t[6]=l*r+d*a+s,t[7]=l*i+d*u+f,t[8]=l*o+d*c+h,t}function yt(t,n,e){var r=n[0],i=n[1],o=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*i+l*u,t[2]=d*o+l*c,t[3]=d*a-l*r,t[4]=d*u-l*i,t[5]=d*c-l*o,t[6]=s,t[7]=f,t[8]=h,t}function mt(t,n,e){var r=e[0],i=e[1];return t[0]=r*n[0],t[1]=r*n[1],t[2]=r*n[2],t[3]=i*n[3],t[4]=i*n[4],t[5]=i*n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t}function gt(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 Mt(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 bt(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 xt(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 Ot(t,n){var e=n[0],r=n[1],i=n[2],o=n[3],a=e+e,u=r+r,c=i+i,s=e*a,f=r*a,h=r*u,l=i*a,d=i*u,p=i*c,v=o*a,y=o*u,m=o*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 St(t,n){var e=n[0],r=n[1],i=n[2],o=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-i*a,b=e*s-o*a,x=r*c-i*u,O=r*s-o*u,S=i*s-o*c,P=f*v-h*p,C=f*y-l*p,E=f*m-d*p,j=h*y-l*v,T=h*m-d*v,A=l*m-d*y,R=g*A-M*T+b*j+x*E-O*C+S*P;return R?(R=1/R,t[0]=(u*A-c*T+s*j)*R,t[1]=(c*E-a*A-s*C)*R,t[2]=(a*T-u*E+s*P)*R,t[3]=(i*T-r*A-o*j)*R,t[4]=(e*A-i*E+o*C)*R,t[5]=(r*E-e*T-o*P)*R,t[6]=(v*S-y*O+m*x)*R,t[7]=(y*b-p*S-m*M)*R,t[8]=(p*O-v*b+m*g)*R,t):null}function Pt(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 Ct(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function Et(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function jt(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t[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 Tt(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 At(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 Rt(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 Bt(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 wt(t,n){var e=t[0],r=t[1],i=t[2],o=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)<=tt*Math.max(1,Math.abs(e),Math.abs(h))&&Math.abs(r-l)<=tt*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(i-d)<=tt*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(o-p)<=tt*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(a-v)<=tt*Math.max(1,Math.abs(a),Math.abs(v))&&Math.abs(u-y)<=tt*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(c-m)<=tt*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(s-g)<=tt*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(f-M)<=tt*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 kt=pt,Lt=Tt;function Nt(){var t=new nt(16);return nt!=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 Dt(t){var n=new nt(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 It(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 Yt(t,n,e,r,i,o,a,u,c,s,f,h,l,d,p,v){var y=new nt(16);return y[0]=t,y[1]=n,y[2]=e,y[3]=r,y[4]=i,y[5]=o,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 Xt(t,n,e,r,i,o,a,u,c,s,f,h,l,d,p,v,y){return t[0]=n,t[1]=e,t[2]=r,t[3]=i,t[4]=o,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 qt(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 Gt(t,n){if(t===n){var e=n[1],r=n[2],i=n[3],o=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]=o,t[11]=n[14],t[12]=i,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 _t(t,n){var e=n[0],r=n[1],i=n[2],o=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-i*a,b=e*s-o*a,x=r*c-i*u,O=r*s-o*u,S=i*s-o*c,P=f*v-h*p,C=f*y-l*p,E=f*m-d*p,j=h*y-l*v,T=h*m-d*v,A=l*m-d*y,R=g*A-M*T+b*j+x*E-O*C+S*P;return R?(R=1/R,t[0]=(u*A-c*T+s*j)*R,t[1]=(i*T-r*A-o*j)*R,t[2]=(v*S-y*O+m*x)*R,t[3]=(l*O-h*S-d*x)*R,t[4]=(c*E-a*A-s*C)*R,t[5]=(e*A-i*E+o*C)*R,t[6]=(y*b-p*S-m*M)*R,t[7]=(f*S-l*b+d*M)*R,t[8]=(a*T-u*E+s*P)*R,t[9]=(r*E-e*T-o*P)*R,t[10]=(p*O-v*b+m*g)*R,t[11]=(h*b-f*O-d*g)*R,t[12]=(u*C-a*j-c*P)*R,t[13]=(e*j-r*C+i*P)*R,t[14]=(v*M-p*x-y*g)*R,t[15]=(f*x-h*M+l*g)*R,t):null}function Ft(t,n){var e=n[0],r=n[1],i=n[2],o=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*(i*m-o*y)+v*(i*d-o*l)),t[2]=r*(c*m-s*y)-u*(i*m-o*y)+v*(i*s-o*c),t[3]=-(r*(c*d-s*l)-u*(i*d-o*l)+h*(i*s-o*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*(i*m-o*y)+p*(i*d-o*l),t[6]=-(e*(c*m-s*y)-a*(i*m-o*y)+p*(i*s-o*c)),t[7]=e*(c*d-s*l)-a*(i*d-o*l)+f*(i*s-o*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-o*v)+p*(r*d-o*h)),t[10]=e*(u*m-s*v)-a*(r*m-o*v)+p*(r*s-o*u),t[11]=-(e*(u*d-s*h)-a*(r*d-o*h)+f*(r*s-o*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-i*v)+p*(r*l-i*h),t[14]=-(e*(u*y-c*v)-a*(r*y-i*v)+p*(r*c-i*u)),t[15]=e*(u*l-c*h)-a*(r*l-i*h)+f*(r*c-i*u),t}function Ht(t){var n=t[0],e=t[1],r=t[2],i=t[3],o=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*o)*(h*y-l*v)-(n*u-r*o)*(f*y-l*p)+(n*c-i*o)*(f*v-h*p)+(e*u-r*a)*(s*y-l*d)-(e*c-i*a)*(s*v-h*d)+(r*c-i*u)*(s*p-f*d)}function Vt(t,n,e){var r=n[0],i=n[1],o=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],O=e[3];return t[0]=M*r+b*u+x*h+O*v,t[1]=M*i+b*c+x*l+O*y,t[2]=M*o+b*s+x*d+O*m,t[3]=M*a+b*f+x*p+O*g,M=e[4],b=e[5],x=e[6],O=e[7],t[4]=M*r+b*u+x*h+O*v,t[5]=M*i+b*c+x*l+O*y,t[6]=M*o+b*s+x*d+O*m,t[7]=M*a+b*f+x*p+O*g,M=e[8],b=e[9],x=e[10],O=e[11],t[8]=M*r+b*u+x*h+O*v,t[9]=M*i+b*c+x*l+O*y,t[10]=M*o+b*s+x*d+O*m,t[11]=M*a+b*f+x*p+O*g,M=e[12],b=e[13],x=e[14],O=e[15],t[12]=M*r+b*u+x*h+O*v,t[13]=M*i+b*c+x*l+O*y,t[14]=M*o+b*s+x*d+O*m,t[15]=M*a+b*f+x*p+O*g,t}function $t(t,n,e){var r,i,o,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],i=n[1],o=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]=i,t[2]=o,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]=i*v+c*y+l*m+n[13],t[14]=o*v+s*y+d*m+n[14],t[15]=a*v+f*y+p*m+n[15]),t}function Wt(t,n,e){var r=e[0],i=e[1],o=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]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=n[7]*i,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=n[11]*o,t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],t}function Ut(t,n,e,r){var i,o,a,u,c,s,f,h,l,d,p,v,y,m,g,M,b,x,O,S,P,C,E,j,T=r[0],A=r[1],R=r[2],B=Math.hypot(T,A,R);return B<tt?null:(T*=B=1/B,A*=B,R*=B,i=Math.sin(e),a=1-(o=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=T*T*a+o,b=A*T*a+R*i,x=R*T*a-A*i,O=T*A*a-R*i,S=A*A*a+o,P=R*A*a+T*i,C=T*R*a+A*i,E=A*R*a-T*i,j=R*R*a+o,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*O+h*S+v*P,t[5]=c*O+l*S+y*P,t[6]=s*O+d*S+m*P,t[7]=f*O+p*S+g*P,t[8]=u*C+h*E+v*j,t[9]=c*C+l*E+y*j,t[10]=s*C+d*E+m*j,t[11]=f*C+p*E+g*j,n!==t&&(t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t)}function zt(t,n,e){var r=Math.sin(e),i=Math.cos(e),o=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]=o*i+s*r,t[5]=a*i+f*r,t[6]=u*i+h*r,t[7]=c*i+l*r,t[8]=s*i-o*r,t[9]=f*i-a*r,t[10]=h*i-u*r,t[11]=l*i-c*r,t}function Qt(t,n,e){var r=Math.sin(e),i=Math.cos(e),o=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]=o*i-s*r,t[1]=a*i-f*r,t[2]=u*i-h*r,t[3]=c*i-l*r,t[8]=o*r+s*i,t[9]=a*r+f*i,t[10]=u*r+h*i,t[11]=c*r+l*i,t}function Zt(t,n,e){var r=Math.sin(e),i=Math.cos(e),o=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]=o*i+s*r,t[1]=a*i+f*r,t[2]=u*i+h*r,t[3]=c*i+l*r,t[4]=s*i-o*r,t[5]=f*i-a*r,t[6]=h*i-u*r,t[7]=l*i-c*r,t}function Jt(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 Kt(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 tn(t,n,e){var r,i,o,a=e[0],u=e[1],c=e[2],s=Math.hypot(a,u,c);return s<tt?null:(a*=s=1/s,u*=s,c*=s,r=Math.sin(n),o=1-(i=Math.cos(n)),t[0]=a*a*o+i,t[1]=u*a*o+c*r,t[2]=c*a*o-u*r,t[3]=0,t[4]=a*u*o-c*r,t[5]=u*u*o+i,t[6]=c*u*o+a*r,t[7]=0,t[8]=a*c*o+u*r,t[9]=u*c*o-a*r,t[10]=c*c*o+i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function nn(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 en(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 rn(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 on(t,n,e){var r=n[0],i=n[1],o=n[2],a=n[3],u=r+r,c=i+i,s=o+o,f=r*u,h=r*c,l=r*s,d=i*c,p=i*s,v=o*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 an(t,n){var e=new nt(3),r=-n[0],i=-n[1],o=-n[2],a=n[3],u=n[4],c=n[5],s=n[6],f=n[7],h=r*r+i*i+o*o+a*a;return h>0?(e[0]=2*(u*a+f*r+c*o-s*i)/h,e[1]=2*(c*a+f*i+s*r-u*o)/h,e[2]=2*(s*a+f*o+u*i-c*r)/h):(e[0]=2*(u*a+f*r+c*o-s*i),e[1]=2*(c*a+f*i+s*r-u*o),e[2]=2*(s*a+f*o+u*i-c*r)),on(t,n,e),t}function un(t,n){return t[0]=n[12],t[1]=n[13],t[2]=n[14],t}function cn(t,n){var e=n[0],r=n[1],i=n[2],o=n[4],a=n[5],u=n[6],c=n[8],s=n[9],f=n[10];return t[0]=Math.hypot(e,r,i),t[1]=Math.hypot(o,a,u),t[2]=Math.hypot(c,s,f),t}function sn(t,n){var e=new nt(3);cn(e,n);var r=1/e[0],i=1/e[1],o=1/e[2],a=n[0]*r,u=n[1]*i,c=n[2]*o,s=n[4]*r,f=n[5]*i,h=n[6]*o,l=n[8]*r,d=n[9]*i,p=n[10]*o,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 fn(t,n,e,r){var i=n[0],o=n[1],a=n[2],u=n[3],c=i+i,s=o+o,f=a+a,h=i*c,l=i*s,d=i*f,p=o*s,v=o*f,y=a*f,m=u*c,g=u*s,M=u*f,b=r[0],x=r[1],O=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)*O,t[9]=(v-m)*O,t[10]=(1-(h+p))*O,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function hn(t,n,e,r,i){var o=n[0],a=n[1],u=n[2],c=n[3],s=o+o,f=a+a,h=u+u,l=o*s,d=o*f,p=o*h,v=a*f,y=a*h,m=u*h,g=c*s,M=c*f,b=c*h,x=r[0],O=r[1],S=r[2],P=i[0],C=i[1],E=i[2],j=(1-(v+m))*x,T=(d+b)*x,A=(p-M)*x,R=(d-b)*O,B=(1-(l+m))*O,w=(y+g)*O,k=(p+M)*S,L=(y-g)*S,N=(1-(l+v))*S;return t[0]=j,t[1]=T,t[2]=A,t[3]=0,t[4]=R,t[5]=B,t[6]=w,t[7]=0,t[8]=k,t[9]=L,t[10]=N,t[11]=0,t[12]=e[0]+P-(j*P+R*C+k*E),t[13]=e[1]+C-(T*P+B*C+L*E),t[14]=e[2]+E-(A*P+w*C+N*E),t[15]=1,t}function ln(t,n){var e=n[0],r=n[1],i=n[2],o=n[3],a=e+e,u=r+r,c=i+i,s=e*a,f=r*a,h=r*u,l=i*a,d=i*u,p=i*c,v=o*a,y=o*u,m=o*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 dn(t,n,e,r,i,o,a){var u=1/(e-n),c=1/(i-r),s=1/(o-a);return t[0]=2*o*u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*c,t[6]=0,t[7]=0,t[8]=(e+n)*u,t[9]=(i+r)*c,t[10]=(a+o)*s,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*s,t[15]=0,t}function pn(t,n,e,r,i){var o,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!=i&&i!==1/0?(o=1/(r-i),t[10]=(i+r)*o,t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t}var vn=pn;function yn(t,n,e,r,i){var o,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!=i&&i!==1/0?(o=1/(r-i),t[10]=i*o,t[14]=i*r*o):(t[10]=-1,t[14]=-r),t}function mn(t,n,e,r){var i=Math.tan(n.upDegrees*Math.PI/180),o=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/(i+o);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]=(i-o)*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 gn(t,n,e,r,i,o,a){var u=1/(n-e),c=1/(r-i),s=1/(o-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]=(i+r)*c,t[14]=(a+o)*s,t[15]=1,t}var Mn=gn;function bn(t,n,e,r,i,o,a){var u=1/(n-e),c=1/(r-i),s=1/(o-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]=(i+r)*c,t[14]=o*s,t[15]=1,t}function xn(t,n,e,r){var i,o,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],O=e[2];return Math.abs(p-b)<tt&&Math.abs(v-x)<tt&&Math.abs(y-O)<tt?qt(t):(f=p-b,h=v-x,l=y-O,i=g*(l*=d=1/Math.hypot(f,h,l))-M*(h*=d),o=M*(f*=d)-m*l,a=m*h-g*f,(d=Math.hypot(i,o,a))?(i*=d=1/d,o*=d,a*=d):(i=0,o=0,a=0),u=h*a-l*o,c=l*i-f*a,s=f*o-h*i,(d=Math.hypot(u,c,s))?(u*=d=1/d,c*=d,s*=d):(u=0,c=0,s=0),t[0]=i,t[1]=u,t[2]=f,t[3]=0,t[4]=o,t[5]=c,t[6]=h,t[7]=0,t[8]=a,t[9]=s,t[10]=l,t[11]=0,t[12]=-(i*p+o*v+a*y),t[13]=-(u*p+c*v+s*y),t[14]=-(f*p+h*v+l*y),t[15]=1,t)}function On(t,n,e,r){var i=n[0],o=n[1],a=n[2],u=r[0],c=r[1],s=r[2],f=i-e[0],h=o-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]=i,t[13]=o,t[14]=a,t[15]=1,t}function Sn(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 Pn(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 Cn(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[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 jn(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 Tn(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 An(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 Rn(t,n){var e=t[0],r=t[1],i=t[2],o=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],O=n[4],S=n[5],P=n[6],C=n[7],E=n[8],j=n[9],T=n[10],A=n[11],R=n[12],B=n[13],w=n[14],k=n[15];return Math.abs(e-g)<=tt*Math.max(1,Math.abs(e),Math.abs(g))&&Math.abs(r-M)<=tt*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(i-b)<=tt*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(o-x)<=tt*Math.max(1,Math.abs(o),Math.abs(x))&&Math.abs(a-O)<=tt*Math.max(1,Math.abs(a),Math.abs(O))&&Math.abs(u-S)<=tt*Math.max(1,Math.abs(u),Math.abs(S))&&Math.abs(c-P)<=tt*Math.max(1,Math.abs(c),Math.abs(P))&&Math.abs(s-C)<=tt*Math.max(1,Math.abs(s),Math.abs(C))&&Math.abs(f-E)<=tt*Math.max(1,Math.abs(f),Math.abs(E))&&Math.abs(h-j)<=tt*Math.max(1,Math.abs(h),Math.abs(j))&&Math.abs(l-T)<=tt*Math.max(1,Math.abs(l),Math.abs(T))&&Math.abs(d-A)<=tt*Math.max(1,Math.abs(d),Math.abs(A))&&Math.abs(p-R)<=tt*Math.max(1,Math.abs(p),Math.abs(R))&&Math.abs(v-B)<=tt*Math.max(1,Math.abs(v),Math.abs(B))&&Math.abs(y-w)<=tt*Math.max(1,Math.abs(y),Math.abs(w))&&Math.abs(m-k)<=tt*Math.max(1,Math.abs(m),Math.abs(k))}var Bn=Vt,wn=En;function kn(){var t=new nt(3);return nt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Ln(t){var n=new nt(3);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n}function Nn(t){var n=t[0],e=t[1],r=t[2];return Math.hypot(n,e,r)}function Dn(t,n,e){var r=new nt(3);return r[0]=t,r[1]=n,r[2]=e,r}function In(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t}function Yn(t,n,e,r){return t[0]=n,t[1]=e,t[2]=r,t}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}function qn(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t}function Gn(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 Fn(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t[2]=Math.ceil(n[2]),t}function Hn(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t[2]=Math.floor(n[2]),t}function Vn(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 $n(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 Wn(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t[2]=Math.round(n[2]),t}function Un(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t}function zn(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 Qn(t,n){var e=n[0]-t[0],r=n[1]-t[1],i=n[2]-t[2];return Math.hypot(e,r,i)}function Zn(t,n){var e=n[0]-t[0],r=n[1]-t[1],i=n[2]-t[2];return e*e+r*r+i*i}function Jn(t){var n=t[0],e=t[1],r=t[2];return n*n+e*e+r*r}function Kn(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t}function te(t,n){return t[0]=1/n[0],t[1]=1/n[1],t[2]=1/n[2],t}function ne(t,n){var e=n[0],r=n[1],i=n[2],o=e*e+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=n[0]*o,t[1]=n[1]*o,t[2]=n[2]*o,t}function ee(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function re(t,n,e){var r=n[0],i=n[1],o=n[2],a=e[0],u=e[1],c=e[2];return t[0]=i*c-o*u,t[1]=o*a-r*c,t[2]=r*u-i*a,t}function ie(t,n,e,r){var i=n[0],o=n[1],a=n[2];return t[0]=i+r*(e[0]-i),t[1]=o+r*(e[1]-o),t[2]=a+r*(e[2]-a),t}function oe(t,n,e,r,i,o){var a=o*o,u=a*(2*o-3)+1,c=a*(o-2)+o,s=a*(o-1),f=a*(3-2*o);return t[0]=n[0]*u+e[0]*c+r[0]*s+i[0]*f,t[1]=n[1]*u+e[1]*c+r[1]*s+i[1]*f,t[2]=n[2]*u+e[2]*c+r[2]*s+i[2]*f,t}function ae(t,n,e,r,i,o){var a=1-o,u=a*a,c=o*o,s=u*a,f=3*o*u,h=3*c*a,l=c*o;return t[0]=n[0]*s+e[0]*f+r[0]*h+i[0]*l,t[1]=n[1]*s+e[1]*f+r[1]*h+i[1]*l,t[2]=n[2]*s+e[2]*f+r[2]*h+i[2]*l,t}function ue(t,n){n=n||1;var e=2*et()*Math.PI,r=2*et()-1,i=Math.sqrt(1-r*r)*n;return t[0]=Math.cos(e)*i,t[1]=Math.sin(e)*i,t[2]=r*n,t}function ce(t,n,e){var r=n[0],i=n[1],o=n[2],a=e[3]*r+e[7]*i+e[11]*o+e[15];return a=a||1,t[0]=(e[0]*r+e[4]*i+e[8]*o+e[12])/a,t[1]=(e[1]*r+e[5]*i+e[9]*o+e[13])/a,t[2]=(e[2]*r+e[6]*i+e[10]*o+e[14])/a,t}function se(t,n,e){var r=n[0],i=n[1],o=n[2];return t[0]=r*e[0]+i*e[3]+o*e[6],t[1]=r*e[1]+i*e[4]+o*e[7],t[2]=r*e[2]+i*e[5]+o*e[8],t}function fe(t,n,e){var r=e[0],i=e[1],o=e[2],a=e[3],u=n[0],c=n[1],s=n[2],f=i*s-o*c,h=o*u-r*s,l=r*c-i*u,d=i*l-o*h,p=o*f-r*l,v=r*h-i*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 he(t,n,e,r){var i=[],o=[];return i[0]=n[0]-e[0],i[1]=n[1]-e[1],i[2]=n[2]-e[2],o[0]=i[0],o[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),o[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),t[0]=o[0]+e[0],t[1]=o[1]+e[1],t[2]=o[2]+e[2],t}function le(t,n,e,r){var i=[],o=[];return i[0]=n[0]-e[0],i[1]=n[1]-e[1],i[2]=n[2]-e[2],o[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),o[1]=i[1],o[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),t[0]=o[0]+e[0],t[1]=o[1]+e[1],t[2]=o[2]+e[2],t}function de(t,n,e,r){var i=[],o=[];return i[0]=n[0]-e[0],i[1]=n[1]-e[1],i[2]=n[2]-e[2],o[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),o[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),o[2]=i[2],t[0]=o[0]+e[0],t[1]=o[1]+e[1],t[2]=o[2]+e[2],t}function pe(t,n){var e=t[0],r=t[1],i=t[2],o=n[0],a=n[1],u=n[2],c=Math.sqrt(e*e+r*r+i*i)*Math.sqrt(o*o+a*a+u*u),s=c&&ee(t,n)/c;return Math.acos(Math.min(Math.max(s,-1),1))}function ve(t){return t[0]=0,t[1]=0,t[2]=0,t}function ye(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function me(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]}function ge(t,n){var e=t[0],r=t[1],i=t[2],o=n[0],a=n[1],u=n[2];return Math.abs(e-o)<=tt*Math.max(1,Math.abs(e),Math.abs(o))&&Math.abs(r-a)<=tt*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-u)<=tt*Math.max(1,Math.abs(i),Math.abs(u))}var Me,be=qn,xe=Gn,Oe=_n,Se=Qn,Pe=Zn,Ce=Nn,Ee=Jn,je=(Me=kn(),function(t,n,e,r,i,o){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)Me[0]=t[a],Me[1]=t[a+1],Me[2]=t[a+2],i(Me,Me,o),t[a]=Me[0],t[a+1]=Me[1],t[a+2]=Me[2];return t});function Te(t){var n=t[0],e=t[1],r=t[2],i=t[3];return Math.hypot(n,e,r,i)}function Ae(t){var n=t[0],e=t[1],r=t[2],i=t[3];return n*n+e*e+r*r+i*i}!function(){var t,n=(t=new nt(4),nt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}();function Re(){var t=new nt(4);return nt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Be(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function we(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 ke(t,n){var e=2*Math.acos(n[3]),r=Math.sin(e/2);return r>tt?(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 Le(t,n){var e=sr(t,n);return Math.acos(2*e*e-1)}function Ne(t,n,e){var r=n[0],i=n[1],o=n[2],a=n[3],u=e[0],c=e[1],s=e[2],f=e[3];return t[0]=r*f+a*u+i*s-o*c,t[1]=i*f+a*c+o*u-r*s,t[2]=o*f+a*s+r*c-i*u,t[3]=a*f-r*u-i*c-o*s,t}function De(t,n,e){e*=.5;var r=n[0],i=n[1],o=n[2],a=n[3],u=Math.sin(e),c=Math.cos(e);return t[0]=r*c+a*u,t[1]=i*c+o*u,t[2]=o*c-i*u,t[3]=a*c-r*u,t}function Ie(t,n,e){e*=.5;var r=n[0],i=n[1],o=n[2],a=n[3],u=Math.sin(e),c=Math.cos(e);return t[0]=r*c-o*u,t[1]=i*c+a*u,t[2]=o*c+r*u,t[3]=a*c-i*u,t}function Ye(t,n,e){e*=.5;var r=n[0],i=n[1],o=n[2],a=n[3],u=Math.sin(e),c=Math.cos(e);return t[0]=r*c+i*u,t[1]=i*c-r*u,t[2]=o*c+a*u,t[3]=a*c-o*u,t}function Xe(t,n){var e=n[0],r=n[1],i=n[2];return t[0]=e,t[1]=r,t[2]=i,t[3]=Math.sqrt(Math.abs(1-e*e-r*r-i*i)),t}function qe(t,n){var e=n[0],r=n[1],i=n[2],o=n[3],a=Math.sqrt(e*e+r*r+i*i),u=Math.exp(o),c=a>0?u*Math.sin(a)/a:0;return t[0]=e*c,t[1]=r*c,t[2]=i*c,t[3]=u*Math.cos(a),t}function Ge(t,n){var e=n[0],r=n[1],i=n[2],o=n[3],a=Math.sqrt(e*e+r*r+i*i),u=a>0?Math.atan2(a,o)/a:0;return t[0]=e*u,t[1]=r*u,t[2]=i*u,t[3]=.5*Math.log(e*e+r*r+i*i+o*o),t}function _e(t,n,e){return Ge(t,n),cr(t,t,e),qe(t,t),t}function Fe(t,n,e,r){var i,o,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(o=s*d+f*p+h*v+l*y)<0&&(o=-o,d=-d,p=-p,v=-v,y=-y),1-o>tt?(i=Math.acos(o),a=Math.sin(i),u=Math.sin((1-r)*i)/a,c=Math.sin(r*i)/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 He(t){var n=et(),e=et(),r=et(),i=Math.sqrt(1-n),o=Math.sqrt(n);return t[0]=i*Math.sin(2*Math.PI*e),t[1]=i*Math.cos(2*Math.PI*e),t[2]=o*Math.sin(2*Math.PI*r),t[3]=o*Math.cos(2*Math.PI*r),t}function Ve(t,n){var e=n[0],r=n[1],i=n[2],o=n[3],a=e*e+r*r+i*i+o*o,u=a?1/a:0;return t[0]=-e*u,t[1]=-r*u,t[2]=-i*u,t[3]=o*u,t}function $e(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=n[3],t}function We(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 i=0;n[4]>n[0]&&(i=1),n[8]>n[3*i+i]&&(i=2);var o=(i+1)%3,a=(i+2)%3;e=Math.sqrt(n[3*i+i]-n[3*o+o]-n[3*a+a]+1),t[i]=.5*e,e=.5/e,t[3]=(n[3*o+a]-n[3*a+o])*e,t[o]=(n[3*o+i]+n[3*i+o])*e,t[a]=(n[3*a+i]+n[3*i+a])*e}return t}function Ue(t,n,e,r){var i=.5*Math.PI/180;n*=i,e*=i,r*=i;var o=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]=o*c*f-a*u*s,t[1]=a*u*f+o*c*s,t[2]=a*c*s-o*u*f,t[3]=a*c*f+o*u*s,t}function ze(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var Qe,Ze,Je,Ke,tr,nr,er=function(t){var n=new nt(4);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n},rr=function(t,n,e,r){var i=new nt(4);return i[0]=t,i[1]=n,i[2]=e,i[3]=r,i},ir=function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t},or=function(t,n,e,r,i){return t[0]=n,t[1]=e,t[2]=r,t[3]=i,t},ar=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},ur=Ne,cr=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},sr=function(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+t[3]*n[3]},fr=function(t,n,e,r){var i=n[0],o=n[1],a=n[2],u=n[3];return t[0]=i+r*(e[0]-i),t[1]=o+r*(e[1]-o),t[2]=a+r*(e[2]-a),t[3]=u+r*(e[3]-u),t},hr=Te,lr=hr,dr=Ae,pr=dr,vr=function(t,n){var e=n[0],r=n[1],i=n[2],o=n[3],a=e*e+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=e*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t},yr=function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]},mr=function(t,n){var e=t[0],r=t[1],i=t[2],o=t[3],a=n[0],u=n[1],c=n[2],s=n[3];return Math.abs(e-a)<=tt*Math.max(1,Math.abs(e),Math.abs(a))&&Math.abs(r-u)<=tt*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(i-c)<=tt*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(o-s)<=tt*Math.max(1,Math.abs(o),Math.abs(s))},gr=(Qe=kn(),Ze=Dn(1,0,0),Je=Dn(0,1,0),function(t,n,e){var r=ee(n,e);return r<-.999999?(re(Qe,Ze,n),Ce(Qe)<1e-6&&re(Qe,Je,n),ne(Qe,Qe),we(t,Qe,Math.PI),t):r>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(re(Qe,n,e),t[0]=Qe[0],t[1]=Qe[1],t[2]=Qe[2],t[3]=1+r,vr(t,t))}),Mr=(Ke=Re(),tr=Re(),function(t,n,e,r,i,o){return Fe(Ke,n,i,o),Fe(tr,e,r,o),Fe(t,Ke,tr,2*o*(1-o)),t}),br=(nr=rt(),function(t,n,e,r){return nr[0]=e[0],nr[3]=e[1],nr[6]=e[2],nr[1]=r[0],nr[4]=r[1],nr[7]=r[2],nr[2]=-n[0],nr[5]=-n[1],nr[8]=-n[2],vr(t,We(t,nr))});function xr(){var t=new nt(2);return nt!=Float32Array&&(t[0]=0,t[1]=0),t}function Or(t){var n=new nt(2);return n[0]=t[0],n[1]=t[1],n}function Sr(t,n){var e=new nt(2);return e[0]=t,e[1]=n,e}function Pr(t,n){return t[0]=n[0],t[1]=n[1],t}function Cr(t,n,e){return t[0]=n,t[1]=e,t}function Er(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t}function jr(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t}function Tr(t,n,e){return t[0]=n[0]*e[0],t[1]=n[1]*e[1],t}function Ar(t,n,e){return t[0]=n[0]/e[0],t[1]=n[1]/e[1],t}function Rr(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t}function Br(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t}function wr(t,n,e){return t[0]=Math.min(n[0],e[0]),t[1]=Math.min(n[1],e[1]),t}function kr(t,n,e){return t[0]=Math.max(n[0],e[0]),t[1]=Math.max(n[1],e[1]),t}function Lr(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t}function Nr(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t}function Dr(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t}function Ir(t,n){var e=n[0]-t[0],r=n[1]-t[1];return Math.hypot(e,r)}function Yr(t,n){var e=n[0]-t[0],r=n[1]-t[1];return e*e+r*r}function Xr(t){var n=t[0],e=t[1];return Math.hypot(n,e)}function qr(t){var n=t[0],e=t[1];return n*n+e*e}function Gr(t,n){return t[0]=-n[0],t[1]=-n[1],t}function _r(t,n){return t[0]=1/n[0],t[1]=1/n[1],t}function Fr(t,n){var e=n[0],r=n[1],i=e*e+r*r;return i>0&&(i=1/Math.sqrt(i)),t[0]=n[0]*i,t[1]=n[1]*i,t}function Hr(t,n){return t[0]*n[0]+t[1]*n[1]}function Vr(t,n,e){var r=n[0]*e[1]-n[1]*e[0];return t[0]=t[1]=0,t[2]=r,t}function $r(t,n,e,r){var i=n[0],o=n[1];return t[0]=i+r*(e[0]-i),t[1]=o+r*(e[1]-o),t}function Wr(t,n){n=n||1;var e=2*et()*Math.PI;return t[0]=Math.cos(e)*n,t[1]=Math.sin(e)*n,t}function Ur(t,n,e){var r=n[0],i=n[1];return t[0]=e[0]*r+e[2]*i,t[1]=e[1]*r+e[3]*i,t}function zr(t,n,e){var r=n[0],i=n[1];return t[0]=e[0]*r+e[2]*i+e[4],t[1]=e[1]*r+e[3]*i+e[5],t}function Qr(t,n,e){var r=n[0],i=n[1];return t[0]=e[0]*r+e[3]*i+e[6],t[1]=e[1]*r+e[4]*i+e[7],t}function Zr(t,n,e){var r=n[0],i=n[1];return t[0]=e[0]*r+e[4]*i+e[12],t[1]=e[1]*r+e[5]*i+e[13],t}function Jr(t,n,e,r){var i=n[0]-e[0],o=n[1]-e[1],a=Math.sin(r),u=Math.cos(r);return t[0]=i*u-o*a+e[0],t[1]=i*a+o*u+e[1],t}function Kr(t,n){var e=t[0],r=t[1],i=n[0],o=n[1],a=Math.sqrt(e*e+r*r)*Math.sqrt(i*i+o*o),u=a&&(e*i+r*o)/a;return Math.acos(Math.min(Math.max(u,-1),1))}function ti(t){return t[0]=0,t[1]=0,t}function ni(t){return"vec2("+t[0]+", "+t[1]+")"}function ei(t,n){return t[0]===n[0]&&t[1]===n[1]}function ri(t,n){var e=t[0],r=t[1],i=n[0],o=n[1];return Math.abs(e-i)<=tt*Math.max(1,Math.abs(e),Math.abs(i))&&Math.abs(r-o)<=tt*Math.max(1,Math.abs(r),Math.abs(o))}var ii=Xr,oi=jr,ai=Tr,ui=Ar,ci=Ir,si=Yr,fi=qr,hi=function(){var t=xr();return function(n,e,r,i,o,a){var u,c;for(e||(e=2),r||(r=0),c=i?Math.min(i*e+r,n.length):n.length,u=r;u<c;u+=e)t[0]=n[u],t[1]=n[u+1],o(t,t,a),n[u]=t[0],n[u+1]=t[1];return n}}(),li=function(){function t(){}return t.tag="c-canvas-rbush-node",t}(),di="RBushRoot",pi=function(){function t(){this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreen=!1,this.enableBatch=!1,this.batchedStyleHash="",this.batchedDisplayObject=null,this.toSync=new Set}var n;return n=t,t.prototype.syncRTree=function(){var t=this,n=[];Array.from(this.toSync).filter((function(t){return t.isConnected})).forEach((function(e){var r=e.rBushNode;r&&t.rBush.remove(r.aabb);var i=e.getRenderBounds();if(i){var o=b(i.getMin(),2),a=o[0],u=o[1],c=b(i.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 li,e.pushToSync(t.composedPath().slice(0,-2))},i=function(t){var n=t.target,r=n.rBushNode;r.aabb&&(e.rBush.remove(r.aabb),e.toSync.delete(n),e.removedRBushNodeAABBs.push(r.aabb))},o=function(t){var n,r=t.target;(null===(n=r.ownerDocument)||void 0===n?void 0:n.documentElement)===e.renderingContext.root&&(t.detail.affectChildren&&r.forEach((function(t){e.pushToSync([t])})),e.pushToSync(t.composedPath().slice(0,-2)))};t.hooks.init.tapPromise(n.tag,(function(){return m(e,void 0,void 0,(function(){return g(this,(function(t){return this.renderingContext.root.addEventListener(O.ElementEvent.MOUNTED,r),this.renderingContext.root.addEventListener(O.ElementEvent.UNMOUNTED,i),this.renderingContext.root.addEventListener(O.ElementEvent.BOUNDS_CHANGED,o),[2]}))}))})),t.hooks.destroy.tap(n.tag,(function(){e.renderingContext.root.removeEventListener(O.ElementEvent.MOUNTED,r),e.renderingContext.root.removeEventListener(O.ElementEvent.UNMOUNTED,i),e.renderingContext.root.removeEventListener(O.ElementEvent.BOUNDS_CHANGED,o)})),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(O.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,i=n.enableDirtyRectangleRenderingDebug,o=e.contextService.getContext(),u=e.renderQueue;if(r){if(!e.clearFullScreen){var c=e.safeMergeAABB.apply(e,x([e.mergeDirtyAABBs(e.renderQueue)],b(e.removedRBushNodeAABBs.map((function(t){var n=t.minX,e=t.minY,r=t.maxX,i=t.maxY,o=new O.AABB;return o.setMinMax(a.fromValues(n,e,0),a.fromValues(r,i,0)),o}))),!1));if(e.removedRBushNodeAABBs=[],O.AABB.isEmpty(c))return void(e.renderQueue=[]);var s=e.convertAABB2Rect(c),f=s.x,h=s.y,l=s.width,d=s.height;o.clearRect(f,h,l,d),o.beginPath(),o.rect(f,h,l,d),o.clip(),i&&(o.lineWidth=4,o.strokeStyle="rgba(".concat(255*Math.random(),", ").concat(255*Math.random(),", ").concat(255*Math.random(),", 1)"),o.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()&&!n.isCulled()&&e.renderDisplayObject(n,t)})),e.enableBatch&&e.batchedStyleHash&&e.flush(o,t),e.renderQueue.forEach((function(t){e.saveDirtyAABB(t)})),e.renderQueue=[]}e.restoreStack.forEach((function(t){o.restore()})),e.restoreStack=[],e.clearFullScreen=!1,o.restore()})),t.hooks.render.tap(n.tag,(function(n){e.canvasConfig.renderer.getConfig().enableDirtyRectangleRendering?e.renderQueue.push(n):n.isVisible()&&!n.isCulled()&&e.renderDisplayObject(n,t)}))},t.prototype.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(),i=this.restoreStack[this.restoreStack.length-1];i&&t.parentNode!==i;)r.restore(),this.restoreStack.pop(),i=this.restoreStack[this.restoreStack.length-1];var o=t.nodeName,a=this.styleRendererFactory(o),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===O.Shape.LINE||t.nodeName===O.Shape.PATH||t.nodeName===O.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]),i=Math.floor(n[1]);return{x:r,y:i,width:Math.ceil(e[0])-r,height:Math.ceil(e[1])-i}},t.prototype.mergeDirtyAABBs=function(t){var n=new O.AABB;return t.forEach((function(t){var e=t.getRenderBounds();n.add(e);var r=t.renderable.dirtyRenderBounds;r&&n.add(r)})),n},t.prototype.searchDirtyObjects=function(t){var n=this,e=b(t.getMin(),2),r=e[0],i=e[1],o=b(t.getMax(),2),a=o[0],u=o[1];return this.rBush.search({minX:r,minY:i,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 O.AABB);var e=t.getRenderBounds();e&&n.dirtyRenderBounds.update(e.center,e.halfExtents)},t.prototype.applyTransform=function(t,n){var e=b(o.getTranslation(a.create(),n),2),r=e[0],i=e[1],c=b(o.getScaling(a.create(),n),2),s=c[0],f=c[1],h=o.getRotation(u.create(),n),l=b(Object(O.getEuler)(a.create(),h),3),d=l[0],p=(l[1],l[2]),v=Object(O.fromRotationTranslationScale)(d||p,r,i,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 i;if(t instanceof O.CSSGradientValue){if(t.type===O.GradientPatternType.LinearGradient||t.type===O.GradientPatternType.RadialGradient){var o=n.getGeometryBounds(),a=o&&2*o.halfExtents[0]||0,u=o&&2*o.halfExtents[1]||0;i=this.gradientPool.getOrCreateGradient(p(p({type:t.type},t.value),{width:a,height:u}),e)}else if(t.type===O.GradientPatternType.Pattern){var c=this.imagePool.getPatternSync(t.value);c?i=c:this.imagePool.createPattern(t.value,e).then((function(){n.renderable.dirty=!0,r.dirtify()}))}}else i=t.toString();return i},t.prototype.applyAttributesToContext=function(t,n,e){var r=n.parsedStyle,i=r.stroke,o=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&&Array.isArray(u)&&t.setLineDash(u.map((function(t){return t.value}))),Object(O.isNil)(c)||(t.lineDashOffset=c.value),Object(O.isNil)(a)||(t.globalAlpha*=a.value),Object(O.isNil)(i)||(t.strokeStyle=this.getColor(i,n,t,e)),Object(O.isNil)(o)||(t.fillStyle=this.getColor(o,n,t,e)),Object(O.isNil)(s)||(t.filter=n.style.filter),Object(O.isNil)(f)||(t.shadowColor=f.toString(),t.shadowBlur=h&&h.value||0,t.shadowOffsetX=l&&l.value||0,t.shadowOffsetY=d&&d.value||0)},t.prototype.useAnchor=function(t,n,e){var r=n.getGeometryBounds();if(r){var i=r.halfExtents,o=(n.parsedStyle||{}).anchor;t.translate(-(o&&o[0].value||0)*i[0]*2,-(o&&o[1].value||0)*i[1]*2),e()}else e()},t.prototype.safeMergeAABB=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var e=new O.AABB;return t.forEach((function(t){e.add(t)})),e},t.tag="CanvasRenderer",v([Object(S.inject)(O.CanvasConfig),y("design:type",Object)],t.prototype,"canvasConfig",void 0),v([Object(S.inject)(O.DefaultCamera),y("design:type",O.Camera)],t.prototype,"camera",void 0),v([Object(S.inject)(O.ContextService),y("design:type",Object)],t.prototype,"contextService",void 0),v([Object(S.inject)(O.RenderingContext),y("design:type",Object)],t.prototype,"renderingContext",void 0),v([Object(S.inject)(q),y("design:type",q)],t.prototype,"imagePool",void 0),v([Object(S.inject)(Z),y("design:type",Z)],t.prototype,"gradientPool",void 0),v([Object(S.inject)(J),y("design:type",Function)],t.prototype,"pathGeneratorFactory",void 0),v([Object(S.inject)(R),y("design:type",Function)],t.prototype,"styleRendererFactory",void 0),v([Object(S.inject)(O.DisplayObjectPool),y("design:type",O.DisplayObjectPool)],t.prototype,"displayObjectPool",void 0),v([Object(S.inject)(di),y("design:type",A.a)],t.prototype,"rBush",void 0),t=n=v([Object(S.singleton)({contrib:O.RenderingPluginContribution})],t)}(),vi=function(){function t(){}var n;return n=t,t.prototype.apply=function(t){var e=this,r=function(n){var r=n.target,i=r.nodeName,o=r.attributes;if(i===O.Shape.IMAGE){var a=o.img;Object(O.isString)(a)&&e.imagePool.getOrCreateImage(a).then((function(){r.renderable.dirty=!0,t.dirtify()}))}},i=function(n){var r=n.target,i=n.attrName,o=n.newValue;r.nodeName===O.Shape.IMAGE&&"img"===i&&Object(O.isString)(o)&&e.imagePool.getOrCreateImage(o).then((function(){r.renderable.dirty=!0,t.dirtify()}))};t.hooks.init.tapPromise(n.tag,(function(){return m(e,void 0,void 0,(function(){return g(this,(function(t){return this.renderingContext.root.addEventListener(O.ElementEvent.MOUNTED,r),this.renderingContext.root.addEventListener(O.ElementEvent.ATTR_MODIFIED,i),[2]}))}))})),t.hooks.destroy.tap(n.tag,(function(){e.renderingContext.root.removeEventListener(O.ElementEvent.MOUNTED,r),e.renderingContext.root.removeEventListener(O.ElementEvent.ATTR_MODIFIED,i)}))},t.tag="LoadImage",v([Object(S.inject)(q),y("design:type",q)],t.prototype,"imagePool",void 0),v([Object(S.inject)(O.RenderingContext),y("design:type",Object)],t.prototype,"renderingContext",void 0),t=n=v([Object(S.singleton)({contrib:O.RenderingPluginContribution})],t)}();S.GlobalContainer.register({token:{token:K,named:O.Shape.CIRCLE},useValue:function(t,n){var e=n.r;t.arc(e.value,e.value,e.value,0,2*Math.PI,!1)}}),S.GlobalContainer.register({token:{token:K,named:O.Shape.ELLIPSE},useValue:function(t,n){var e=n.rx,r=n.ry,i=e.value,o=r.value;if(t.ellipse)t.ellipse(i,o,i,o,0,0,2*Math.PI,!1);else{var a=i>o?i:o,u=i>o?1:i/o,c=i>o?o/i:1;t.save(),t.scale(u,c),t.arc(0,0,a,0,2*Math.PI)}}}),S.GlobalContainer.register({token:{token:K,named:O.Shape.RECT},useValue:function(t,n){var e=n.radius,r=n.width,i=n.height,o=r.value,a=i.value,u=e&&e.value||0;if(0===u)t.rect(0,0,o,a);else{var c=b(function(t){var n=0,e=0,r=0,i=0;return Array.isArray(t)?1===t.length?n=e=r=i=t[0]:2===t.length?(n=r=t[0],e=i=t[1]):3===t.length?(n=t[0],e=i=t[1],r=t[2]):(n=t[0],e=t[1],r=t[2],i=t[3]):n=e=r=i=t,[n,e,r,i]}(u),4),s=c[0],f=c[1],h=c[2],l=c[3];t.moveTo(s,0),t.lineTo(o-f,0),0!==f&&t.arc(o-f,f,f,-Math.PI/2,0),t.lineTo(o,a-h),0!==h&&t.arc(o-h,a-h,h,0,Math.PI/2),t.lineTo(l,a),0!==l&&t.arc(l,a-l,l,Math.PI/2,Math.PI),t.lineTo(0,s),0!==s&&t.arc(s,s,s,Math.PI,1.5*Math.PI)}}}),S.GlobalContainer.register({token:{token:K,named:O.Shape.LINE},useValue:function(t,n){var e=n.x1,r=n.y1,i=n.x2,o=n.y2,a=n.defX,u=void 0===a?0:a,c=n.defY,s=void 0===c?0:c;t.moveTo(e.value-u,r.value-s),t.lineTo(i.value-u,o.value-s)}}),S.GlobalContainer.register({token:{token:K,named:O.Shape.POLYLINE},useValue:function(t,n){var e=n.defX,r=void 0===e?0:e,i=n.defY,o=void 0===i?0:i,a=n.points.points,u=a.length,c=a[0][0]-r,s=a[0][1]-o,f=a[u-1][0]-r,h=a[u-1][1]-o;t.moveTo(c,s);for(var l=0;l<u-1;l++){var d=a[l];t.lineTo(d[0]-r,d[1]-o)}t.lineTo(f,h)}}),S.GlobalContainer.register({token:{token:K,named:O.Shape.POLYGON},useValue:function(t,n){var e=n.defX,r=void 0===e?0:e,i=n.defY,o=void 0===i?0:i,a=n.points.points,u=a.length,c=a[0][0]-r,s=a[0][1]-o,f=a[u-1][0]-r,h=a[u-1][1]-o;t.moveTo(c,s);for(var l=0;l<u-1;l++){var d=a[l];t.lineTo(d[0]-r,d[1]-o)}t.lineTo(f,h)}}),S.GlobalContainer.register({token:{token:K,named:O.Shape.PATH},useValue:function(t,n){var e=n.defX,r=void 0===e?0:e,i=n.defY,o=void 0===i?0:i,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=0;f<s.length;f++){var h=s[f];switch(h[0]){case"M":t.moveTo(h[1]-r,h[2]-o);break;case"C":t.bezierCurveTo(h[1]-r,h[2]-o,h[3]-r,h[4]-o,h[5]-r,h[6]-o);break;case"Z":t.closePath()}}}}),S.GlobalContainer.register({token:J,useFactory:function(t){var n={};return function(e){return n[e]||t.container.isBoundNamed(K,e)&&(n[e]=t.container.getNamed(K,e)),n[e]}}});var yi=Object(S.Module)((function(t){var n;t(q),t({token:di,useValue:new A.a}),t(V),t($),t(H),t(G),t(_),t(W),t(U),t(z),t(Q);var e=((n={})[O.Shape.CIRCLE]=B,n[O.Shape.ELLIPSE]=w,n[O.Shape.RECT]=k,n[O.Shape.IMAGE]=X,n[O.Shape.TEXT]=Y,n[O.Shape.LINE]=L,n[O.Shape.POLYLINE]=N,n[O.Shape.POLYGON]=D,n[O.Shape.PATH]=I,n);t({token:R,useFactory:function(t){var n={};return function(r){var i=e[r];return i&&!n[r]&&t.container.isBound(i)&&(n[r]=t.container.get(i)),n[r]}}}),t(Z),t(pi),t(vi)})),mi=function(){function t(){this.name="canvas-renderer"}return t.prototype.init=function(t){t.load(yi,!0)},t.prototype.destroy=function(t){t.unload(yi)},t}(),gi=S.Syringe.defineToken("PointInPathPicker"),Mi=function(){function t(){var t=this;this.isHit=function(n,e,r){var i=t.pointInPathPickerFactory(n.nodeName);if(i){var u=o.invert(o.create(),r),c=a.transformMat4(a.create(),a.fromValues(e[0],e[1],0),u),s=n.getGeometryBounds().halfExtents,f=n.parsedStyle.anchor;if(c[0]+=(f&&f[0].value||0)*s[0]*2,c[1]+=(f&&f[1].value||0)*s[1]*2,i(n,new O.Point(c[0],c[1]),t.isPointInPath))return!0}return!1},this.isPointInPath=function(n,e){var r=t.offscreenCanvas.getOrCreateContext(t.canvasConfig.offscreenCanvas),i=t.pathGeneratorFactory(n.nodeName);return i&&i(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.tapPromise(n.tag,(function(t){return m(e,void 0,void 0,(function(){var n,e,r,i,u,c,s,f,h,l,d,p,v,y,m,b,x,O=this;return g(this,(function(g){n=t.topmost,e=t.position,r=e.x,i=e.y,u=a.fromValues(r,i,0),c=this.rBush.search({minX:u[0],minY:u[1],maxX:u[0],maxY:u[1]}),s=c.map((function(t){return t.id})),f=[],c.forEach((function(t){var n=t.id,e=O.displayObjectPool.getByEntity(n);if(e.isVisible()&&!e.isCulled()&&e.isInteractive()){if(e.parentNode&&-1===s.indexOf(e.parentNode.entity))return;f.push(e)}})),f.sort((function(t,n){return n.sortable.renderOrder-t.sortable.renderOrder})),h=[];try{for(l=M(f),d=l.next();!d.done;d=l.next())if(p=d.value,v=p.parsedStyle.clipPath,y=v||p,m=p.getWorldTransform(),v&&(m=o.multiply(o.create(),m,v.getLocalTransform())),this.isHit(y,u,m)){if(n)return t.picked=[p],[2,t];h.push(p)}}catch(t){b={error:t}}finally{try{d&&!d.done&&(x=l.return)&&x.call(l)}finally{if(b)throw b.error}}return t.picked=h,[2,t]}))}))}))},t.tag="CanvasPicker",v([Object(S.inject)(O.DisplayObjectPool),y("design:type",O.DisplayObjectPool)],t.prototype,"displayObjectPool",void 0),v([Object(S.inject)(O.CanvasConfig),y("design:type",Object)],t.prototype,"canvasConfig",void 0),v([Object(S.inject)(O.OffscreenCanvasCreator),y("design:type",O.OffscreenCanvasCreator)],t.prototype,"offscreenCanvas",void 0),v([Object(S.inject)(di),y("design:type",A.a)],t.prototype,"rBush",void 0),v([Object(S.inject)(J),y("design:type",Function)],t.prototype,"pathGeneratorFactory",void 0),v([Object(S.inject)(gi),y("design:type",Function)],t.prototype,"pointInPathPickerFactory",void 0),t=n=v([Object(S.singleton)({contrib:O.RenderingPluginContribution})],t)}();function bi(t,n,e,r){var i=t-e,o=n-r;return Math.sqrt(i*i+o*o)}function xi(t,n){return Math.abs(t-n)<.001}function Oi(t,n){var e=Math.min.apply(Math,x([],b(t),!1)),r=Math.min.apply(Math,x([],b(n),!1));return{x:e,y:r,width:Math.max.apply(Math,x([],b(t),!1))-e,height:Math.max.apply(Math,x([],b(n),!1))-r}}function Si(t){return(t+2*Math.PI)%(2*Math.PI)}var Pi={box:function(t,n,e,r){return Oi([t,e],[n,r])},length:function(t,n,e,r){return bi(t,n,e,r)},pointAt:function(t,n,e,r,i){return{x:(1-i)*t+i*e,y:(1-i)*n+i*r}},pointDistance:function(t,n,e,r,i,o){var a=(e-t)*(i-t)+(r-n)*(o-n);return a<0?bi(t,n,i,o):a>(e-t)*(e-t)+(r-n)*(r-n)?bi(e,r,i,o):this.pointToLine(t,n,e,r,i,o)},pointToLine:function(t,n,e,r,i,o){var a=[e-t,r-n];if(c.exactEquals(a,[0,0]))return Math.sqrt((i-t)*(i-t)+(o-n)*(o-n));var u=[-a[1],a[0]];c.normalize(u,u);var s=[i-t,o-n];return Math.abs(c.dot(s,u))},tangentAngle:function(t,n,e,r){return Math.atan2(r-n,e-t)}};function Ci(t,n,e,r,i,o){var a=-1,u=1/0,c=[e,r],s=20;o&&o>200&&(s=o/10);for(var f=1/s,h=f/10,l=0;l<=s;l++){var d=l*f,p=[i.apply(void 0,x([],b(t.concat([d])),!1)),i.apply(void 0,x([],b(n.concat([d])),!1))];(g=bi(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=[i.apply(void 0,x([],b(t.concat([y])),!1)),i.apply(void 0,x([],b(n.concat([y])),!1))],bi(c[0],c[1],p[0],p[1]));if(y>=0&&g<u)a=y,u=g;else{var M=[i.apply(void 0,x([],b(t.concat([m])),!1)),i.apply(void 0,x([],b(n.concat([m])),!1))],O=bi(c[0],c[1],M[0],M[1]);m<=1&&O<u?(a=m,u=O):h*=.5}}return{x:i.apply(void 0,x([],b(t.concat([a])),!1)),y:i.apply(void 0,x([],b(n.concat([a])),!1))}}function Ei(t,n,e,r){var i=1-r;return i*i*t+2*r*i*n+r*r*e}function ji(t,n,e){var r=t+e-2*n;if(xi(r,0))return[.5];var i=(t-n)/r;return i<=1&&i>=0?[i]:[]}function Ti(t,n,e,r){return 2*(1-r)*(n-t)+2*r*(e-n)}function Ai(t,n,e,r,i,o,a){var u=Ei(t,e,i,a),c=Ei(n,r,o,a),s=Pi.pointAt(t,n,e,r,a),f=Pi.pointAt(e,r,i,o,a);return[[t,n,s.x,s.y,u,c],[u,c,f.x,f.y,i,o]]}var Ri={box:function(t,n,e,r,i,o){var a=ji(t,e,i)[0],u=ji(n,r,o)[0],c=[t,i],s=[n,o];return void 0!==a&&c.push(Ei(t,e,i,a)),void 0!==u&&s.push(Ei(n,r,o,u)),Oi(c,s)},length:function(t,n,e,r,i,o){return function t(n,e,r,i,o,a,u){if(0===u)return(bi(n,e,r,i)+bi(r,i,o,a)+bi(n,e,o,a))/2;var c=Ai(n,e,r,i,o,a,.5),s=c[0],f=c[1];return s.push(u-1),f.push(u-1),t.apply(void 0,x([],b(s),!1))+t.apply(void 0,x([],b(f),!1))}(t,n,e,r,i,o,3)},nearestPoint:function(t,n,e,r,i,o,a,u){return Ci([t,e,i],[n,r,o],a,u,Ei)},pointDistance:function(t,n,e,r,i,o,a,u){var c=this.nearestPoint(t,n,e,r,i,o,a,u);return bi(c.x,c.y,a,u)},interpolationAt:Ei,pointAt:function(t,n,e,r,i,o,a){return{x:Ei(t,e,i,a),y:Ei(n,r,o,a)}},divide:function(t,n,e,r,i,o,a){return Ai(t,n,e,r,i,o,a)},tangentAngle:function(t,n,e,r,i,o,a){var u=Ti(t,e,i,a),c=Ti(n,r,o,a);return Si(Math.atan2(c,u))}};function Bi(t,n,e,r,i){var o=1-i;return o*o*o*t+3*n*i*o*o+3*e*i*i*o+r*i*i*i}function wi(t,n,e,r,i){var o=1-i;return 3*(o*o*(n-t)+2*o*i*(e-n)+i*i*(r-e))}function ki(t,n,e,r){var i,o,a,u=-3*t+9*n-9*e+3*r,c=6*t-12*n+6*e,s=3*n-3*t,f=[];if(xi(u,0))xi(c,0)||(i=-s/c)>=0&&i<=1&&f.push(i);else{var h=c*c-4*u*s;xi(h,0)?f.push(-c/(2*u)):h>0&&(o=(-c-(a=Math.sqrt(h)))/(2*u),(i=(-c+a)/(2*u))>=0&&i<=1&&f.push(i),o>=0&&o<=1&&f.push(o))}return f}function Li(t,n,e,r,i,o,a,u,c){var s=Bi(t,e,i,a,c),f=Bi(n,r,o,u,c),h=Pi.pointAt(t,n,e,r,c),l=Pi.pointAt(e,r,i,o,c),d=Pi.pointAt(i,o,a,u,c),p=Pi.pointAt(h.x,h.y,l.x,l.y,c),v=Pi.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 Ni(t,n,e,r,i,o,a,u,c){if(0===c)return function(t,n){for(var e=0,r=t.length,i=0;i<r;i++){e+=bi(t[i],n[i],t[(i+1)%r],n[(i+1)%r])}return e/2}([t,e,i,a],[n,r,o,u]);var s=Li(t,n,e,r,i,o,a,u,.5),f=x(x([],b(s[0]),!1),[c-1],!1),h=x(x([],b(s[1]),!1),[c-1],!1);return Ni.apply(void 0,x([],b(f),!1))+Ni.apply(void 0,x([],b(h),!1))}var Di={extrema:ki,box:function(t,n,e,r,i,o,a,u){for(var c=[t,a],s=[n,u],f=ki(t,e,i,a),h=ki(n,r,o,u),l=0;l<f.length;l++)c.push(Bi(t,e,i,a,f[l]));for(l=0;l<h.length;l++)s.push(Bi(n,r,o,u,h[l]));return Oi(c,s)},length:function(t,n,e,r,i,o,a,u){return Ni(t,n,e,r,i,o,a,u,3)},nearestPoint:function(t,n,e,r,i,o,a,u,c,s,f){return Ci([t,e,i,a],[n,r,o,u],c,s,Bi,f)},pointDistance:function(t,n,e,r,i,o,a,u,c,s,f){var h=this.nearestPoint(t,n,e,r,i,o,a,u,c,s,f);return bi(h.x,h.y,c,s)},interpolationAt:Bi,pointAt:function(t,n,e,r,i,o,a,u,c){return{x:Bi(t,e,i,a,c),y:Bi(n,r,o,u,c)}},divide:function(t,n,e,r,i,o,a,u,c){return Li(t,n,e,r,i,o,a,u,c)},tangentAngle:function(t,n,e,r,i,o,a,u,c){var s=wi(t,e,i,a,c),f=wi(n,r,o,u,c);return Si(Math.atan2(f,s))}};function Ii(t,n,e,r){var i=t-e,o=n-r;return Math.sqrt(i*i+o*o)}function Yi(t,n,e,r,i,o){return i>=t&&i<=t+e&&o>=n&&o<=n+r}function Xi(t,n,e,r,i,o,a,u){var c=(Math.atan2(u-n,a-t)+2*Math.PI)%(2*Math.PI);if(c<r||c>i)return!1;var s={x:t+e*Math.cos(c),y:n+e*Math.sin(c)};return Ii(s.x,s.y,a,u)<=o/2}function qi(t,n,e,r,i,o,a){var u=Math.min(t,e),c=Math.max(t,e),s=Math.min(n,r),f=Math.max(n,r),h=i/2;return o>=u-h&&o<=c+h&&a>=s-h&&a<=f+h&&Pi.pointToLine(t,n,e,r,o,a)<=i/2}function Gi(t,n,e,r,i){var o=t.length;if(o<2)return!1;for(var a=0;a<o-1;a++){if(qi(t[a][0],t[a][1],t[a+1][0],t[a+1][1],n,e,r))return!0}if(i){var u=t[0],c=t[o-1];if(qi(u[0],u[1],c[0],c[1],n,e,r))return!0}return!1}function _i(t){return Math.abs(t)<1e-6?0:t<0?-1:1}function Fi(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 Hi(t,n,e){var r=!1,i=t.length;if(i<=2)return!1;for(var o=0;o<i;o++){var a=t[o],u=t[(o+1)%i];if(Fi(a,u,[n,e]))return!0;_i(a[1]-e)>0!=_i(u[1]-e)>0&&_i(n-(e-a[1])*(a[0]-u[0])/(a[1]-u[1])-a[0])<0&&(r=!r)}return r}function Vi(t,n,e){for(var r=!1,i=0;i<t.length;i++){if(r=Hi(t[i],n,e))break}return r}function $i(t,n){var e=t.parsedStyle,r=e.r,i=e.fill,o=e.stroke,a=e.lineWidth,u=e.increasedLineWidthForHitTesting,c=e.clipPathTargets,s=r.value,f=(a.value+u.value)/2,h=Ii(s,s,n.x,n.y),l=!!(null==c?void 0:c.length),d=i&&!i.isNone,p=o&&!o.isNone;return d&&p||l?h<=s+f:d?h<=s:!!p&&(h>=s-f&&h<=s+f)}function Wi(t,n,e,r){return t/(e*e)+n/(r*r)}function Ui(t,n){var e=n.x,r=n.y,i=t.parsedStyle,o=i.rx,a=i.ry,u=i.fill,c=i.stroke,s=i.lineWidth,f=i.increasedLineWidthForHitTesting,h=i.clipPathTargets,l=!!(null==h?void 0:h.length),d=u&&!u.isNone,p=c&&!c.isNone,v=o.value,y=a.value,m=(s.value+f.value)/2,g=(e-v)*(e-v),M=(r-y)*(r-y);return d&&p||l?Wi(g,M,v+m,y+m)<=1:d?Wi(g,M,v,y)<=1:!!p&&(Wi(g,M,v-m,y-m)>=1&&Wi(g,M,v+m,y+m)<=1)}function zi(t,n){var e=t.parsedStyle,r=e.x1,i=e.y1,o=e.x2,a=e.y2,u=e.lineWidth,c=e.increasedLineWidthForHitTesting,s=e.defX,f=void 0===s?0:s,h=e.defY,l=void 0===h?0:h;return qi(r.value,i.value,o.value,a.value,u.value+c.value,n.x+f,n.y+l)}function Qi(t,n){var e=t.parsedStyle,r=e.stroke,i=e.lineWidth,o=e.increasedLineWidthForHitTesting,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||r.isNone)&&!l||!i)&&Gi(a.points,i.value+o.value,n.x+c,n.y+f,!1)}function Zi(t,n,e){var r=t.parsedStyle,o=r.lineWidth,a=r.increasedLineWidthForHitTesting,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=s&&!s.isNone,m=u&&!u.isNone,g=v.segments,M=v.hasArc,b=v.polylines,x=v.polygons,O=v.totalLength,S=!!(null==p?void 0:p.length),P=!1;return(m||S)&&(P=function(t,n,e,r,o,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||Yi(y.x-f,y.y-f,y.width+n,y.height+n,e,r)){switch(l.command){case"L":case"Z":s=qi(v[0],v[1],d[0],d[1],n,e,r);break;case"Q":s=Ri.pointDistance(v[0],v[1],p[1],p[2],p[3],p[4],e,r)<=n/2;break;case"C":s=Di.pointDistance(v[0],v[1],p[1],p[2],p[3],p[4],p[5],p[6],e,r,o)<=n/2;break;case"A":var m=l.arcParams,g=m.cx,M=m.cy,b=m.rx,x=m.ry,O=m.startAngle,S=m.endAngle,P=m.xRotation,C=b>x?b:x,E=b>x?1:b/x,j=b>x?x/b:1,T=i.fromTranslation(i.create(),[-g,-M]);i.multiply(T,i.fromRotation(i.create(),-P),T),i.multiply(T,i.fromScaling(i.create(),[1/E,1/j]),T);var A=c.fromValues(e,r);s=Xi(0,0,C,O,S,n,(A=c.transformMat3(A,A,T))[0],A[1])}if(s)break}}return s}(g,o.value+a.value,n.x+h,n.y+d,O)),P||!y&&!S||(P=M?e(t,n):Vi(x,n.x+h,n.y+d)||Vi(b,n.x+h,n.y+d)),P}function Ji(t,n,e){var r=t.parsedStyle,i=r.radius,o=r.fill,a=r.stroke,u=r.lineWidth,c=r.increasedLineWidthForHitTesting,s=r.width,f=r.height,h=r.clipPathTargets,l=!!(null==h?void 0:h.length),d=o&&!o.isNone,p=a&&!a.isNone,v=s.unit,y=s.value,m=f.unit,g=f.value,M=0,b=0;v!==O.UnitType.kNumber&&v!==O.UnitType.kPixels||(M=y),m!==O.UnitType.kNumber&&m!==O.UnitType.kPixels||(b=g);var x=u.value+c.value;if(i){var S=!1;return(p||l)&&(S=function(t,n,e,r,i,o,a,u){return qi(t+i,n,t+e-i,n,o,a,u)||qi(t+e,n+i,t+e,n+r-i,o,a,u)||qi(t+e-i,n+r,t+i,n+r,o,a,u)||qi(t,n+r-i,t,n+i,o,a,u)||Xi(t+e-i,n+i,i,1.5*Math.PI,2*Math.PI,o,a,u)||Xi(t+e-i,n+r-i,i,0,.5*Math.PI,o,a,u)||Xi(t+i,n+r-i,i,.5*Math.PI,Math.PI,o,a,u)||Xi(t+i,n+i,i,Math.PI,1.5*Math.PI,o,a,u)}(0,0,M,b,i.value,x,n.x,n.y)),S||!d&&!l||(S=e(t,n)),S}var P=x/2;return d&&p||l?Yi(0-P,0-P,M+P,b+P,n.x,n.y):d?Yi(0,0,M,b,n.x,n.y):!!p&&function(t,n,e,r,i,o,a){var u=i/2;return Yi(t-u,n-u,e,i,o,a)||Yi(t+e-u,n-u,i,r,o,a)||Yi(t+u,n+r-u,e,i,o,a)||Yi(t-u,n+u,i,r,o,a)}(0,0,M,b,x,n.x,n.y)}function Ki(t,n){var e=t.parsedStyle,r=e.stroke,i=e.fill,o=e.lineWidth,a=e.increasedLineWidthForHitTesting,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=i&&!i.isNone,v=!1;return(r&&!r.isNone||d)&&(v=Gi(u.points,o.value+a.value,n.x+s,n.y+h,!0)),v||!p&&!d||(v=Hi(u.points,n.x+s,n.y+h)),v}var to=Object(S.Module)((function(t){t({token:gi,useFactory:function(t){return function(t){return t===O.Shape.CIRCLE?$i:t===O.Shape.ELLIPSE?Ui:t===O.Shape.RECT?Ji:t===O.Shape.LINE?zi:t===O.Shape.POLYLINE?Qi:t===O.Shape.POLYGON?Ki:t===O.Shape.PATH?Zi:t===O.Shape.IMAGE||t===O.Shape.TEXT?function(){return!0}:null}}}),t(Mi)})),no=function(){function t(){this.name="canvas-picker"}return t.prototype.init=function(t){t.load(to,!0)},t.prototype.destroy=function(t){t.unload(to)},t}(),eo=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===O.Shape.HTML){var r=n.parsedStyle.innerHTML,i="g-html-"+n.entity,o=e.contextService.getDomElement().parentNode;if(o)if(!o.querySelector("#"+i)){var a=document.createElement("div");n.parsedStyle.$el=a,a.id=i,Object(O.isString)(r)?a.innerHTML=r:a.appendChild(r),o.appendChild(a)}}},i=function(t){var n=t.target;if(n.nodeName===O.Shape.HTML){var r="g-html-"+n.entity,i=e.contextService.getDomElement().parentNode;if(i){var o=i.querySelector("#"+r);o&&i.removeChild(o)}}};t.hooks.init.tapPromise(n.tag,(function(){return m(e,void 0,void 0,(function(){return g(this,(function(t){return this.renderingContext.root.addEventListener(O.ElementEvent.MOUNTED,r),this.renderingContext.root.addEventListener(O.ElementEvent.UNMOUNTED,i),[2]}))}))})),t.hooks.destroy.tap(n.tag,(function(){e.renderingContext.root.removeEventListener(O.ElementEvent.MOUNTED,r),e.renderingContext.root.removeEventListener(O.ElementEvent.UNMOUNTED,i)})),t.hooks.render.tap(n.tag,(function(t){if(t.nodeName===O.Shape.HTML){var n="g-html-"+t.entity,r=e.contextService.getDomElement().parentNode;if(r){var i=r.querySelector("#"+n);e.updateCSSStyle(i,t.parsedStyle,t)}}}))},t.prototype.updateCSSStyle=function(t,n,e){var r,i,o=n.zIndex,a=n.visibility,u=n.opacity,c=n.fill,s=n.lineWidth,f=n.lineDash,h=n.stroke,l=n.width,d=n.height,p=n.style,v=void 0===p?"":p,y=n.className,m=void 0===y?"":y;r=l.value,i=d.value;var g={position:"absolute",top:0,left:0};if(g.width="".concat(r,"px"),g.height="".concat(i,"px"),g.transform="matrix3d(".concat(e.getWorldTransform().join(","),")"),e.style.transformOrigin&&(g["transform-origin"]=e.style.transformOrigin),g["z-index"]=o.value,g.visibility=a.value,g.opacity=u.value,c){var M="";if(c instanceof O.CSSRGB)M=c.toString();else if(c instanceof O.CSSGradientValue&&c.type===O.GradientPatternType.LinearGradient){var b=c.value.steps.map((function(t){return"".concat(t[1]," ").concat(100*Number(t[0]),"%")})).join(",");M="linear-gradient(to right, ".concat(b,");")}g.background=M}g["border-width"]="".concat((null==s?void 0:s.value)||0,"px"),h&&(g["border-color"]=h.toString(),g["border-style"]="solid"),f&&(g["border-style"]="dashed"),e.style.filter&&(g.filter=e.style.filter),m&&(Array.isArray(m)?m.forEach((function(n){t.classList.add(n)})):t.classList.add(m)),t.setAttribute("style",Object.keys(g).map((function(t){return"".concat(t,":").concat(g[t])})).join(";")+v)},t.tag="HTMLRendering",v([Object(S.inject)(O.ContextService),y("design:type",Object)],t.prototype,"contextService",void 0),v([Object(S.inject)(O.RenderingContext),y("design:type",Object)],t.prototype,"renderingContext",void 0),t=n=v([Object(S.singleton)({contrib:O.RenderingPluginContribution})],t)}(),ro=Object(S.Module)((function(t){t(eo)})),io=function(){function t(){this.name="html-renderer"}return t.prototype.init=function(t){t.load(ro,!0)},t.prototype.destroy=function(t){t.unload(ro)},t}(),oo=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=Object(O.isString)(n)?document.getElementById(n):n,this.$container)){var i=document.createElement("canvas");this.$container.appendChild(i),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=i}this.context=this.$canvas.getContext("2d");var o=r||O.isBrowser&&window.devicePixelRatio||1;o=o>=1?Math.ceil(o):1,this.dpr=o,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,Object(O.setDOMSize)(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)},v([Object(S.inject)(O.CanvasConfig),y("design:type",Object)],t.prototype,"canvasConfig",void 0),t=v([Object(S.singleton)({token:O.ContextService})],t)}(),ao=Object(S.Module)((function(t){t(oo)})),uo=function(){function t(){this.name="canvas-context-register"}return t.prototype.init=function(t){t.load(ao,!0)},t.prototype.destroy=function(t){t.unload(ao)},t}(),co=function(t){function n(n){var e=t.call(this,n)||this;return e.registerPlugin(new uo),e.registerPlugin(new mi),e.registerPlugin(new j),e.registerPlugin(new no),e.registerPlugin(new io),e}return d(n,t),n}(O.AbstractRenderer)}])}));
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import { CanvasConfig, ContextService, isBrowser, isString } from '@antv/g';
|
|
2
|
+
import { CanvasConfig, ContextService, isBrowser, isString, setDOMSize } from '@antv/g';
|
|
3
3
|
import { inject, singleton } from 'mana-syringe';
|
|
4
|
-
import { setDOMSize } from './utils/dom';
|
|
5
4
|
|
|
6
5
|
var Canvas2DContextService =
|
|
7
6
|
/** @class */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Syringe } from 'mana-syringe';
|
|
2
2
|
import type { RendererPlugin } from '@antv/g';
|
|
3
3
|
export declare class ContextRegisterPlugin implements RendererPlugin {
|
|
4
|
+
name: string;
|
|
4
5
|
init(container: Syringe.Container): void;
|
|
5
6
|
destroy(container: Syringe.Container): void;
|
|
6
7
|
}
|
|
@@ -10,7 +10,9 @@ var containerModule = Module(function (register) {
|
|
|
10
10
|
var ContextRegisterPlugin =
|
|
11
11
|
/** @class */
|
|
12
12
|
function () {
|
|
13
|
-
function ContextRegisterPlugin() {
|
|
13
|
+
function ContextRegisterPlugin() {
|
|
14
|
+
this.name = 'canvas-context-register';
|
|
15
|
+
}
|
|
14
16
|
|
|
15
17
|
ContextRegisterPlugin.prototype.init = function (container) {
|
|
16
18
|
container.load(containerModule, true);
|
|
@@ -11,8 +11,6 @@ var _g = require("@antv/g");
|
|
|
11
11
|
|
|
12
12
|
var _manaSyringe = require("mana-syringe");
|
|
13
13
|
|
|
14
|
-
var _dom = require("./utils/dom");
|
|
15
|
-
|
|
16
14
|
var Canvas2DContextService =
|
|
17
15
|
/** @class */
|
|
18
16
|
function () {
|
|
@@ -91,7 +89,7 @@ function () {
|
|
|
91
89
|
this.$canvas.width = this.dpr * width;
|
|
92
90
|
this.$canvas.height = this.dpr * height; // set CSS style width & height
|
|
93
91
|
|
|
94
|
-
(0,
|
|
92
|
+
(0, _g.setDOMSize)(this.$canvas, width, height);
|
|
95
93
|
var dpr = this.getDPR(); // scale all drawing operations by the dpr
|
|
96
94
|
// @see https://www.html5rocks.com/en/tutorials/canvas/hidpi/
|
|
97
95
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Syringe } from 'mana-syringe';
|
|
2
2
|
import type { RendererPlugin } from '@antv/g';
|
|
3
3
|
export declare class ContextRegisterPlugin implements RendererPlugin {
|
|
4
|
+
name: string;
|
|
4
5
|
init(container: Syringe.Container): void;
|
|
5
6
|
destroy(container: Syringe.Container): void;
|
|
6
7
|
}
|
|
@@ -19,7 +19,9 @@ var containerModule = (0, _manaSyringe.Module)(function (register) {
|
|
|
19
19
|
var ContextRegisterPlugin =
|
|
20
20
|
/** @class */
|
|
21
21
|
function () {
|
|
22
|
-
function ContextRegisterPlugin() {
|
|
22
|
+
function ContextRegisterPlugin() {
|
|
23
|
+
this.name = 'canvas-context-register';
|
|
24
|
+
}
|
|
23
25
|
|
|
24
26
|
ContextRegisterPlugin.prototype.init = function (container) {
|
|
25
27
|
container.load(containerModule, true);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/g-canvas",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.23",
|
|
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.
|
|
41
|
-
"@antv/g-plugin-canvas-renderer": "^1.0.
|
|
42
|
-
"@antv/g-plugin-dom-interaction": "^1.0.
|
|
43
|
-
"@antv/g-plugin-html-renderer": "^1.0.
|
|
40
|
+
"@antv/g-plugin-canvas-picker": "^1.0.21",
|
|
41
|
+
"@antv/g-plugin-canvas-renderer": "^1.0.21",
|
|
42
|
+
"@antv/g-plugin-dom-interaction": "^1.0.21",
|
|
43
|
+
"@antv/g-plugin-html-renderer": "^1.0.22",
|
|
44
44
|
"tslib": "^2.3.1"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"scripts": {
|
|
51
51
|
"umd": "webpack"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "98a28060c701e8c9c6c23fca672534677c4401b3"
|
|
54
54
|
}
|
package/es/utils/dom.d.ts
DELETED
package/es/utils/dom.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { isBrowser } from '@antv/g';
|
|
2
|
-
var PX_SUFFIX = 'px';
|
|
3
|
-
export function setDOMSize($el, width, height) {
|
|
4
|
-
// @ts-ignore
|
|
5
|
-
if (isBrowser && $el.style) {
|
|
6
|
-
// @ts-ignore
|
|
7
|
-
$el.style.width = width + PX_SUFFIX; // @ts-ignore
|
|
8
|
-
|
|
9
|
-
$el.style.height = height + PX_SUFFIX;
|
|
10
|
-
}
|
|
11
|
-
}
|
package/lib/utils/dom.d.ts
DELETED
package/lib/utils/dom.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.setDOMSize = setDOMSize;
|
|
7
|
-
|
|
8
|
-
var _g = require("@antv/g");
|
|
9
|
-
|
|
10
|
-
var PX_SUFFIX = 'px';
|
|
11
|
-
|
|
12
|
-
function setDOMSize($el, width, height) {
|
|
13
|
-
// @ts-ignore
|
|
14
|
-
if (_g.isBrowser && $el.style) {
|
|
15
|
-
// @ts-ignore
|
|
16
|
-
$el.style.width = width + PX_SUFFIX; // @ts-ignore
|
|
17
|
-
|
|
18
|
-
$el.style.height = height + PX_SUFFIX;
|
|
19
|
-
}
|
|
20
|
-
}
|