@antv/g-canvas 1.1.0 → 1.1.3-alpha.0
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/{es → dist}/Canvas2DContextService.d.ts +18 -17
- package/dist/Canvas2DContextService.d.ts.map +1 -0
- package/{lib → dist}/ContextRegisterPlugin.d.ts +8 -7
- package/dist/ContextRegisterPlugin.d.ts.map +1 -0
- package/{lib → dist}/index.d.ts +11 -10
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +191 -0
- package/dist/index.js +216 -0
- package/dist/index.umd.js +6901 -0
- package/dist/index.umd.min.js +9 -16
- package/package.json +29 -33
- package/es/Canvas2DContextService.js +0 -105
- package/es/ContextRegisterPlugin.d.ts +0 -7
- package/es/ContextRegisterPlugin.js +0 -28
- package/es/index.d.ts +0 -10
- package/es/index.js +0 -38
- package/lib/Canvas2DContextService.d.ts +0 -17
- package/lib/Canvas2DContextService.js +0 -113
- package/lib/ContextRegisterPlugin.js +0 -37
- package/lib/index.js +0 -64
package/dist/index.umd.min.js
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
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),l=.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+l)),Math.min(o,Math.floor(r+(u-c)*f/u+l)),a)}var h=e[r],d=i,p=o;for(n(e,i,r),a(e[o],h)>0&&n(e,i,o);d<p;){for(n(e,d,p),d++,p--;a(e[d],h)<0;)d++;for(;a(e[p],h)>0;)p--}0===a(e[i],h)?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 l(t){return t.maxX-t.minX+(t.maxY-t.minY)}function h(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):h(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||h(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||!h(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 l=Math.min(f+s-1,e);v(t,f,l,c,this.compareMinY);for(var h=f;h<=l;h+=c){var d=Math.min(h+c-1,l);i.children.push(this._build(t,h,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),l=(h=t,d=c,(Math.max(d.maxX,h.maxX)-Math.min(d.minX,h.minX))*(Math.max(d.maxY,h.maxY)-Math.min(d.minY,h.minY))-s);l<o?(o=l,i=s<i?s:i,a=c):l===o&&s<i&&(i=s,a=c)}n=a||n.children[0]}var h,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,l,h=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),l=Math.min(i.maxY,o.maxY),Math.max(0,s-u)*Math.max(0,l-c)),g=f(v)+f(y);m<h?(h=m,r=p,d=g<d?g:d):m===h&&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=l(o)+l(c),f=n;f<e-n;f++){var h=t.children[f];u(o,t.leaf?i(h):h),s+=l(o)}for(var d=e-n-1;d>=n;d--){var p=t.children[d];u(c,t.leaf?i(p):p),s+=l(c)}return s},r.prototype._adjustParentBBoxes=function(t,n,e){for(var r=e;r>=0;r--)u(n[r],t)},r.prototype._condense=function(t){for(var n=t.length-1,e=void 0;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children).splice(e.indexOf(t[n]),1):this.clear():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 l})),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 lt})),e.d(i,"adjoint",(function(){return ht})),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 Et})),e.d(i,"projection",(function(){return St})),e.d(i,"str",(function(){return Ct})),e.d(i,"frob",(function(){return Pt})),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 kt})),e.d(i,"exactEquals",(function(){return Rt})),e.d(i,"equals",(function(){return wt})),e.d(i,"mul",(function(){return Bt})),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 It})),e.d(o,"copy",(function(){return Dt})),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 _t})),e.d(o,"invert",(function(){return Gt})),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 Wt})),e.d(o,"scale",(function(){return $t})),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 ln})),e.d(o,"fromQuat",(function(){return hn})),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 En})),e.d(o,"frob",(function(){return Sn})),e.d(o,"add",(function(){return Cn})),e.d(o,"subtract",(function(){return Pn})),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 kn})),e.d(o,"mul",(function(){return Rn})),e.d(o,"sub",(function(){return wn}));var a={};e.r(a),e.d(a,"create",(function(){return Bn})),e.d(a,"clone",(function(){return Ln})),e.d(a,"length",(function(){return Nn})),e.d(a,"fromValues",(function(){return In})),e.d(a,"copy",(function(){return Dn})),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 _n})),e.d(a,"divide",(function(){return Gn})),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 Wn})),e.d(a,"round",(function(){return $n})),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 le})),e.d(a,"rotateY",(function(){return he})),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 Ee})),e.d(a,"sqrDist",(function(){return Se})),e.d(a,"len",(function(){return Ce})),e.d(a,"sqrLen",(function(){return Pe})),e.d(a,"forEach",(function(){return je}));var u={};e.r(u),e.d(u,"create",(function(){return ke})),e.d(u,"identity",(function(){return Re})),e.d(u,"setAxisAngle",(function(){return we})),e.d(u,"getAxisAngle",(function(){return Be})),e.d(u,"getAngle",(function(){return Le})),e.d(u,"multiply",(function(){return Ne})),e.d(u,"rotateX",(function(){return Ie})),e.d(u,"rotateY",(function(){return De})),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 _e})),e.d(u,"pow",(function(){return Ge})),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 We})),e.d(u,"fromMat3",(function(){return $e})),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 lr})),e.d(u,"len",(function(){return hr})),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 Er})),e.d(c,"copy",(function(){return Sr})),e.d(c,"set",(function(){return Cr})),e.d(c,"add",(function(){return Pr})),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 kr})),e.d(c,"floor",(function(){return Rr})),e.d(c,"min",(function(){return wr})),e.d(c,"max",(function(){return Br})),e.d(c,"round",(function(){return Lr})),e.d(c,"scale",(function(){return Nr})),e.d(c,"scaleAndAdd",(function(){return Ir})),e.d(c,"distance",(function(){return Dr})),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 _r})),e.d(c,"inverse",(function(){return Gr})),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 Wr})),e.d(c,"random",(function(){return $r})),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 li}));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 hi})),e.d(s,"RBushRoot",(function(){return di})),e.d(s,"RBush",(function(){return A.a})),e.d(s,"StyleRendererFactory",(function(){return k})),e.d(s,"CircleRendererContribution",(function(){return R})),e.d(s,"EllipseRendererContribution",(function(){return w})),e.d(s,"RectRendererContribution",(function(){return B})),e.d(s,"LineRendererContribution",(function(){return L})),e.d(s,"PolylineRendererContribution",(function(){return N})),e.d(s,"PolygonRendererContribution",(function(){return I})),e.d(s,"PathRendererContribution",(function(){return D})),e.d(s,"TextRendererContribution",(function(){return Y})),e.d(s,"ImageRendererContribution",(function(){return X})),e.d(s,"ImageRenderer",(function(){return _})),e.d(s,"TextRenderer",(function(){return G})),e.d(s,"RectRenderer",(function(){return H})),e.d(s,"CircleRenderer",(function(){return V})),e.d(s,"EllipseRenderer",(function(){return W})),e.d(s,"LineRenderer",(function(){return $})),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 l={};e.r(l),e.d(l,"Plugin",(function(){return io}));
|
|
2
|
-
/*!
|
|
3
|
-
Copyright (c) Microsoft Corporation.
|
|
4
|
-
|
|
5
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */
|
|
16
|
-
var h=function(t,n){return(h=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}h(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),E=e(1),S=/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&&S.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)},l=function(n){t.hooks.pointerWheel.call(n)},h=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?h(t):r.supportTouchEvent?(h(t),r.supportPointerEvent||d(t)):r.supportPointerEvent||d(t),t.addEventListener("wheel",l,{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",l,!0)}))},t.tag="DOMInteraction",v([Object(E.inject)(O.ContextService),y("design:type",Object)],t.prototype,"contextService",void 0),v([Object(E.inject)(O.RenderingContext),y("design:type",Object)],t.prototype,"renderingContext",void 0),t=n=v([Object(E.singleton)({contrib:O.RenderingPluginContribution})],t)}(),P=Object(E.Module)((function(t){t(C)})),j=function(){function t(){this.name="dom-interaction"}return t.prototype.init=function(t){t.load(P,!0)},t.prototype.destroy=function(t){t.unload(P)},t}(),T=e(2),A=e.n(T),k=E.Syringe.defineToken("StyleRendererFactory"),R=E.Syringe.defineToken("CircleRenderer",{multiple:!1}),w=E.Syringe.defineToken("EllipseRenderer",{multiple:!1}),B=E.Syringe.defineToken("RectRenderer",{multiple:!1}),L=E.Syringe.defineToken("LineRenderer",{multiple:!1}),N=E.Syringe.defineToken("PolylineRenderer",{multiple:!1}),I=E.Syringe.defineToken("PolygonRenderer",{multiple:!1}),D=E.Syringe.defineToken("PathRenderer",{multiple:!1}),Y=E.Syringe.defineToken("TextRenderer",{multiple:!1}),X=E.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(t):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(E.inject)(O.CanvasConfig),y("design:type",Object)],t.prototype,"canvasConfig",void 0),t=v([Object(E.singleton)()],t)}(),_=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;if(Object(O.isString)(o)?e=this.imagePool.getImageSync(o):(a||(a=o.width),u||(u=o.height),e=o),e)try{t.drawImage(e,0,0,a,u)}catch(t){}},v([Object(E.inject)(q),y("design:type",q)],t.prototype,"imagePool",void 0),t=v([Object(E.singleton)({token:X})],t)}(),G=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,l=void 0===f?0:f,h=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,E=m.height,S=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 P=0;"middle"===a.value?P=-E/2-S/2:"bottom"===a.value||"alphabetic"===a.value||"ideographic"===a.value?P=-E:"top"!==a.value&&"hanging"!==a.value||(P=-S);var j=0;g&&g.unit===O.UnitType.kPixels&&(j+=g.value),M&&M.unit===O.UnitType.kPixels&&(P+=M.value);for(var T=0;T<x.length;T++){var A=i.value/2+j;P+=S,!Object(O.isNil)(h)&&i&&i.value&&this.drawLetterSpacing(t,x[T],C[T],o.value,A,P,l,p.value,v.value,y.value,!0),Object(O.isNil)(d)||this.drawLetterSpacing(t,x[T],C[T],o.value,A,P,l,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 l=t.textAlign;t.textAlign="left";var h=i;"center"===r?h=i-e.width/2:"right"!==r&&"end"!==r||(h=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,h,o,c):this.fillText(t,m,h,o,u,s),h+=p-(v=t.measureText(n.substring(y+1)).width)+a,p=v}t.textAlign=l}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(E.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,l=n.filter,h=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)(h)||(t.miterLimit=h),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)(l);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(E.singleton)()],t)}(),H=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return d(n,t),n=v([Object(E.singleton)({token:B})],n)}(F),V=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return d(n,t),n=v([Object(E.singleton)({token:R})],n)}(F),W=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return d(n,t),n=v([Object(E.singleton)({token:w})],n)}(F),$=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return d(n,t),n=v([Object(E.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(E.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(E.singleton)({token:I})],n)}(F),Q=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return d(n,t),n=v([Object(E.singleton)({token:D})],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 l=null;if(r===O.GradientPatternType.LinearGradient)l=n.createLinearGradient(i*s,o*f,a*s,u*f);else if(r===O.GradientPatternType.RadialGradient){var h=Math.sqrt(s*s+f*f)/2;l=n.createRadialGradient(i*s,o*f,0,a*s,u*f,t.r1*h)}return l&&(c.forEach((function(t){var n=b(t,2),e=n[0],r=n[1];null==l||l.addColorStop(Number(e),r)})),this.gradientCache[e]=l),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(E.singleton)()],t)}();var J=E.Syringe.defineToken("PathGeneratorFactory"),K=E.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 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],l=f*a-u*s,h=-f*o+u*c,d=s*o-a*c,p=e*l+r*h+i*d;return p?(p=1/p,t[0]=l*p,t[1]=(-f*r+i*s)*p,t[2]=(u*r-i*a)*p,t[3]=h*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 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];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],l=n[8],h=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]=h*r+d*a+p*s,t[1]=h*i+d*u+p*f,t[2]=h*o+d*c+p*l,t[3]=v*r+y*a+m*s,t[4]=v*i+y*u+m*f,t[5]=v*o+y*c+m*l,t[6]=g*r+M*a+b*s,t[7]=g*i+M*u+b*f,t[8]=g*o+M*c+b*l,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],l=n[8],h=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]=h*r+d*a+s,t[7]=h*i+d*u+f,t[8]=h*o+d*c+l,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],l=n[8],h=Math.sin(e),d=Math.cos(e);return t[0]=d*r+h*a,t[1]=d*i+h*u,t[2]=d*o+h*c,t[3]=d*a-h*r,t[4]=d*u-h*i,t[5]=d*c-h*o,t[6]=s,t[7]=f,t[8]=l,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,l=r*u,h=i*a,d=i*u,p=i*c,v=o*a,y=o*u,m=o*c;return t[0]=1-l-p,t[3]=f-m,t[6]=h+y,t[1]=f+m,t[4]=1-s-p,t[7]=d-v,t[2]=h-y,t[5]=d+v,t[8]=1-s-l,t}function Et(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],l=n[9],h=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,E=i*s-o*c,S=f*v-l*p,C=f*y-h*p,P=f*m-d*p,j=l*y-h*v,T=l*m-d*v,A=h*m-d*y,k=g*A-M*T+b*j+x*P-O*C+E*S;return k?(k=1/k,t[0]=(u*A-c*T+s*j)*k,t[1]=(c*P-a*A-s*C)*k,t[2]=(a*T-u*P+s*S)*k,t[3]=(i*T-r*A-o*j)*k,t[4]=(e*A-i*P+o*C)*k,t[5]=(r*P-e*T-o*S)*k,t[6]=(v*E-y*O+m*x)*k,t[7]=(y*b-p*E-m*M)*k,t[8]=(p*O-v*b+m*g)*k,t):null}function St(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 Pt(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 kt(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 Rt(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]}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],l=n[0],h=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-l)<=tt*Math.max(1,Math.abs(e),Math.abs(l))&&Math.abs(r-h)<=tt*Math.max(1,Math.abs(r),Math.abs(h))&&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 Bt=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 It(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 Dt(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,l,h,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]=l,y[12]=h,y[13]=d,y[14]=p,y[15]=v,y}function Xt(t,n,e,r,i,o,a,u,c,s,f,l,h,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]=l,t[11]=h,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 _t(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 Gt(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],l=n[9],h=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,E=i*s-o*c,S=f*v-l*p,C=f*y-h*p,P=f*m-d*p,j=l*y-h*v,T=l*m-d*v,A=h*m-d*y,k=g*A-M*T+b*j+x*P-O*C+E*S;return k?(k=1/k,t[0]=(u*A-c*T+s*j)*k,t[1]=(i*T-r*A-o*j)*k,t[2]=(v*E-y*O+m*x)*k,t[3]=(h*O-l*E-d*x)*k,t[4]=(c*P-a*A-s*C)*k,t[5]=(e*A-i*P+o*C)*k,t[6]=(y*b-p*E-m*M)*k,t[7]=(f*E-h*b+d*M)*k,t[8]=(a*T-u*P+s*S)*k,t[9]=(r*P-e*T-o*S)*k,t[10]=(p*O-v*b+m*g)*k,t[11]=(l*b-f*O-d*g)*k,t[12]=(u*C-a*j-c*S)*k,t[13]=(e*j-r*C+i*S)*k,t[14]=(v*M-p*x-y*g)*k,t[15]=(f*x-l*M+h*g)*k,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],l=n[9],h=n[10],d=n[11],p=n[12],v=n[13],y=n[14],m=n[15];return t[0]=u*(h*m-d*y)-l*(c*m-s*y)+v*(c*d-s*h),t[1]=-(r*(h*m-d*y)-l*(i*m-o*y)+v*(i*d-o*h)),t[2]=r*(c*m-s*y)-u*(i*m-o*y)+v*(i*s-o*c),t[3]=-(r*(c*d-s*h)-u*(i*d-o*h)+l*(i*s-o*c)),t[4]=-(a*(h*m-d*y)-f*(c*m-s*y)+p*(c*d-s*h)),t[5]=e*(h*m-d*y)-f*(i*m-o*y)+p*(i*d-o*h),t[6]=-(e*(c*m-s*y)-a*(i*m-o*y)+p*(i*s-o*c)),t[7]=e*(c*d-s*h)-a*(i*d-o*h)+f*(i*s-o*c),t[8]=a*(l*m-d*v)-f*(u*m-s*v)+p*(u*d-s*l),t[9]=-(e*(l*m-d*v)-f*(r*m-o*v)+p*(r*d-o*l)),t[10]=e*(u*m-s*v)-a*(r*m-o*v)+p*(r*s-o*u),t[11]=-(e*(u*d-s*l)-a*(r*d-o*l)+f*(r*s-o*u)),t[12]=-(a*(l*y-h*v)-f*(u*y-c*v)+p*(u*h-c*l)),t[13]=e*(l*y-h*v)-f*(r*y-i*v)+p*(r*h-i*l),t[14]=-(e*(u*y-c*v)-a*(r*y-i*v)+p*(r*c-i*u)),t[15]=e*(u*h-c*l)-a*(r*h-i*l)+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],l=t[10],h=t[11],d=t[12],p=t[13],v=t[14],y=t[15];return(n*a-e*o)*(l*y-h*v)-(n*u-r*o)*(f*y-h*p)+(n*c-i*o)*(f*v-l*p)+(e*u-r*a)*(s*y-h*d)-(e*c-i*a)*(s*v-l*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],l=n[8],h=n[9],d=n[10],p=n[11],v=n[12],y=n[13],m=n[14],g=n[15],M=e[0],b=e[1],x=e[2],O=e[3];return t[0]=M*r+b*u+x*l+O*v,t[1]=M*i+b*c+x*h+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*l+O*v,t[5]=M*i+b*c+x*h+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*l+O*v,t[9]=M*i+b*c+x*h+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*l+O*v,t[13]=M*i+b*c+x*h+O*y,t[14]=M*o+b*s+x*d+O*m,t[15]=M*a+b*f+x*p+O*g,t}function Wt(t,n,e){var r,i,o,a,u,c,s,f,l,h,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],l=n[8],h=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]=l,t[9]=h,t[10]=d,t[11]=p,t[12]=r*v+u*y+l*m+n[12],t[13]=i*v+c*y+h*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 $t(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,l,h,d,p,v,y,m,g,M,b,x,O,E,S,C,P,j,T=r[0],A=r[1],k=r[2],R=Math.hypot(T,A,k);return R<tt?null:(T*=R=1/R,A*=R,k*=R,i=Math.sin(e),a=1-(o=Math.cos(e)),u=n[0],c=n[1],s=n[2],f=n[3],l=n[4],h=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+k*i,x=k*T*a-A*i,O=T*A*a-k*i,E=A*A*a+o,S=k*A*a+T*i,C=T*k*a+A*i,P=A*k*a-T*i,j=k*k*a+o,t[0]=u*M+l*b+v*x,t[1]=c*M+h*b+y*x,t[2]=s*M+d*b+m*x,t[3]=f*M+p*b+g*x,t[4]=u*O+l*E+v*S,t[5]=c*O+h*E+y*S,t[6]=s*O+d*E+m*S,t[7]=f*O+p*E+g*S,t[8]=u*C+l*P+v*j,t[9]=c*C+h*P+y*j,t[10]=s*C+d*P+m*j,t[11]=f*C+p*P+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],l=n[10],h=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+l*r,t[7]=c*i+h*r,t[8]=s*i-o*r,t[9]=f*i-a*r,t[10]=l*i-u*r,t[11]=h*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],l=n[10],h=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-l*r,t[3]=c*i-h*r,t[8]=o*r+s*i,t[9]=a*r+f*i,t[10]=u*r+l*i,t[11]=c*r+h*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],l=n[6],h=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+l*r,t[3]=c*i+h*r,t[4]=s*i-o*r,t[5]=f*i-a*r,t[6]=l*i-u*r,t[7]=h*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,l=r*c,h=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]=l+g,t[2]=h-m,t[3]=0,t[4]=l-g,t[5]=1-(f+v),t[6]=p+y,t[7]=0,t[8]=h+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],l=r*r+i*i+o*o+a*a;return l>0?(e[0]=2*(u*a+f*r+c*o-s*i)/l,e[1]=2*(c*a+f*i+s*r-u*o)/l,e[2]=2*(s*a+f*o+u*i-c*r)/l):(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,l=n[6]*o,h=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]=(l-d)/y,t[1]=(h-c)/y,t[2]=(u-s)/y):a>f&&a>p?(y=2*Math.sqrt(1+a-f-p),t[3]=(l-d)/y,t[0]=.25*y,t[1]=(u+s)/y,t[2]=(h+c)/y):f>p?(y=2*Math.sqrt(1+f-a-p),t[3]=(h-c)/y,t[0]=(u+s)/y,t[1]=.25*y,t[2]=(l+d)/y):(y=2*Math.sqrt(1+p-a-f),t[3]=(u-s)/y,t[0]=(h+c)/y,t[1]=(l+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,l=i*c,h=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]=(h+M)*b,t[2]=(d-g)*b,t[3]=0,t[4]=(h-M)*x,t[5]=(1-(l+y))*x,t[6]=(v+m)*x,t[7]=0,t[8]=(d+g)*O,t[9]=(v-m)*O,t[10]=(1-(l+p))*O,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function ln(t,n,e,r,i){var o=n[0],a=n[1],u=n[2],c=n[3],s=o+o,f=a+a,l=u+u,h=o*s,d=o*f,p=o*l,v=a*f,y=a*l,m=u*l,g=c*s,M=c*f,b=c*l,x=r[0],O=r[1],E=r[2],S=i[0],C=i[1],P=i[2],j=(1-(v+m))*x,T=(d+b)*x,A=(p-M)*x,k=(d-b)*O,R=(1-(h+m))*O,w=(y+g)*O,B=(p+M)*E,L=(y-g)*E,N=(1-(h+v))*E;return t[0]=j,t[1]=T,t[2]=A,t[3]=0,t[4]=k,t[5]=R,t[6]=w,t[7]=0,t[8]=B,t[9]=L,t[10]=N,t[11]=0,t[12]=e[0]+S-(j*S+k*C+B*P),t[13]=e[1]+C-(T*S+R*C+L*P),t[14]=e[2]+P-(A*S+w*C+N*P),t[15]=1,t}function hn(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,l=r*u,h=i*a,d=i*u,p=i*c,v=o*a,y=o*u,m=o*c;return t[0]=1-l-p,t[1]=f+m,t[2]=h-y,t[3]=0,t[4]=f-m,t[5]=1-s-p,t[6]=d+v,t[7]=0,t[8]=h+y,t[9]=d-v,t[10]=1-s-l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function 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,l,h,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,l=v-x,h=y-O,i=g*(h*=d=1/Math.hypot(f,l,h))-M*(l*=d),o=M*(f*=d)-m*h,a=m*l-g*f,(d=Math.hypot(i,o,a))?(i*=d=1/d,o*=d,a*=d):(i=0,o=0,a=0),u=l*a-h*o,c=h*i-f*a,s=f*o-l*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]=l,t[7]=0,t[8]=a,t[9]=s,t[10]=h,t[11]=0,t[12]=-(i*p+o*v+a*y),t[13]=-(u*p+c*v+s*y),t[14]=-(f*p+l*v+h*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],l=o-e[1],h=a-e[2],d=f*f+l*l+h*h;d>0&&(f*=d=1/Math.sqrt(d),l*=d,h*=d);var p=c*h-s*l,v=s*f-u*h,y=u*l-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]=l*y-h*v,t[5]=h*p-f*y,t[6]=f*v-l*p,t[7]=0,t[8]=f,t[9]=l,t[10]=h,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t}function En(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 Sn(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 Pn(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t[3]=n[3]-e[3],t[4]=n[4]-e[4],t[5]=n[5]-e[5],t[6]=n[6]-e[6],t[7]=n[7]-e[7],t[8]=n[8]-e[8],t[9]=n[9]-e[9],t[10]=n[10]-e[10],t[11]=n[11]-e[11],t[12]=n[12]-e[12],t[13]=n[13]-e[13],t[14]=n[14]-e[14],t[15]=n[15]-e[15],t}function 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 kn(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],l=t[9],h=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],E=n[5],S=n[6],C=n[7],P=n[8],j=n[9],T=n[10],A=n[11],k=n[12],R=n[13],w=n[14],B=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-E)<=tt*Math.max(1,Math.abs(u),Math.abs(E))&&Math.abs(c-S)<=tt*Math.max(1,Math.abs(c),Math.abs(S))&&Math.abs(s-C)<=tt*Math.max(1,Math.abs(s),Math.abs(C))&&Math.abs(f-P)<=tt*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(l-j)<=tt*Math.max(1,Math.abs(l),Math.abs(j))&&Math.abs(h-T)<=tt*Math.max(1,Math.abs(h),Math.abs(T))&&Math.abs(d-A)<=tt*Math.max(1,Math.abs(d),Math.abs(A))&&Math.abs(p-k)<=tt*Math.max(1,Math.abs(p),Math.abs(k))&&Math.abs(v-R)<=tt*Math.max(1,Math.abs(v),Math.abs(R))&&Math.abs(y-w)<=tt*Math.max(1,Math.abs(y),Math.abs(w))&&Math.abs(m-B)<=tt*Math.max(1,Math.abs(m),Math.abs(B))}var Rn=Vt,wn=Pn;function Bn(){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 In(t,n,e){var r=new nt(3);return r[0]=t,r[1]=n,r[2]=e,r}function Dn(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 _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 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 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 Wn(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 $n(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,l=3*c*a,h=c*o;return t[0]=n[0]*s+e[0]*f+r[0]*l+i[0]*h,t[1]=n[1]*s+e[1]*f+r[1]*l+i[1]*h,t[2]=n[2]*s+e[2]*f+r[2]*l+i[2]*h,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,l=o*u-r*s,h=r*c-i*u,d=i*h-o*l,p=o*f-r*h,v=r*l-i*f,y=2*a;return f*=y,l*=y,h*=y,d*=2,p*=2,v*=2,t[0]=u+f+d,t[1]=c+l+p,t[2]=s+h+v,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[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 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[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=_n,Oe=Gn,Ee=Qn,Se=Zn,Ce=Nn,Pe=Jn,je=(Me=Bn(),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 ke(){var t=new nt(4);return nt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Re(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 Be(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 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+a*u,t[1]=i*c+o*u,t[2]=o*c-i*u,t[3]=a*c-r*u,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-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 _e(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 Ge(t,n,e){return _e(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],l=n[2],h=n[3],d=e[0],p=e[1],v=e[2],y=e[3];return(o=s*d+f*p+l*v+h*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*l+c*v,t[3]=u*h+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 We(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=n[3],t}function $e(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},lr=Te,hr=lr,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=Bn(),Ze=In(1,0,0),Je=In(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=ke(),tr=ke(),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,$e(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 Er(t,n){var e=new nt(2);return e[0]=t,e[1]=n,e}function Sr(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 Pr(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 kr(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t}function Rr(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 Br(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 Ir(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t}function Dr(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 _r(t,n){return t[0]=-n[0],t[1]=-n[1],t}function Gr(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 Wr(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 $r(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=Dr,si=Yr,fi=qr,li=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}}(),hi=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 hi,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,l=s.y,h=s.width,d=s.height;o.clearRect(f,l,h,d),o.beginPath(),o.rect(f,l,h,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,l,h,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],l=o.getRotation(u.create(),n),h=b(Object(O.getEuler)(a.create(),l),3),d=h[0],p=(h[1],h[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,l=r.shadowBlur,h=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=l&&l.value||0,t.shadowOffsetX=h&&h.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(E.inject)(O.CanvasConfig),y("design:type",Object)],t.prototype,"canvasConfig",void 0),v([Object(E.inject)(O.DefaultCamera),y("design:type",O.Camera)],t.prototype,"camera",void 0),v([Object(E.inject)(O.ContextService),y("design:type",Object)],t.prototype,"contextService",void 0),v([Object(E.inject)(O.RenderingContext),y("design:type",Object)],t.prototype,"renderingContext",void 0),v([Object(E.inject)(q),y("design:type",q)],t.prototype,"imagePool",void 0),v([Object(E.inject)(Z),y("design:type",Z)],t.prototype,"gradientPool",void 0),v([Object(E.inject)(J),y("design:type",Function)],t.prototype,"pathGeneratorFactory",void 0),v([Object(E.inject)(k),y("design:type",Function)],t.prototype,"styleRendererFactory",void 0),v([Object(E.inject)(O.DisplayObjectPool),y("design:type",O.DisplayObjectPool)],t.prototype,"displayObjectPool",void 0),v([Object(E.inject)(di),y("design:type",A.a)],t.prototype,"rBush",void 0),t=n=v([Object(E.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(E.inject)(q),y("design:type",q)],t.prototype,"imagePool",void 0),v([Object(E.inject)(O.RenderingContext),y("design:type",Object)],t.prototype,"renderingContext",void 0),t=n=v([Object(E.singleton)({contrib:O.RenderingPluginContribution})],t)}();E.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)}}),E.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)}}}),E.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],l=c[2],h=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-l),0!==l&&t.arc(o-l,a-l,l,0,Math.PI/2),t.lineTo(h,a),0!==h&&t.arc(h,a-h,h,Math.PI/2,Math.PI),t.lineTo(0,s),0!==s&&t.arc(s,s,s,Math.PI,1.5*Math.PI)}}}),E.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)}}),E.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,l=a[u-1][1]-o;t.moveTo(c,s);for(var h=0;h<u-1;h++){var d=a[h];t.lineTo(d[0]-r,d[1]-o)}t.lineTo(f,l)}}),E.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,l=a[u-1][1]-o;t.moveTo(c,s);for(var h=0;h<u-1;h++){var d=a[h];t.lineTo(d[0]-r,d[1]-o)}t.lineTo(f,l)}}),E.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=x([],b(u),!1);c.forEach((function(t,n){s.splice(t+n,1,["Z"])}));for(var f=0;f<s.length;f++){var l=s[f];switch(l[0]){case"M":t.moveTo(l[1]-r,l[2]-o);break;case"C":t.bezierCurveTo(l[1]-r,l[2]-o,l[3]-r,l[4]-o,l[5]-r,l[6]-o);break;case"Z":t.closePath()}}}}),E.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(E.Module)((function(t){var n;t(q),t({token:di,useValue:new A.a}),t(V),t(W),t(H),t(_),t(G),t($),t(U),t(z),t(Q);var e=((n={})[O.Shape.CIRCLE]=R,n[O.Shape.ELLIPSE]=w,n[O.Shape.RECT]=B,n[O.Shape.IMAGE]=X,n[O.Shape.TEXT]=Y,n[O.Shape.LINE]=L,n[O.Shape.POLYLINE]=N,n[O.Shape.POLYGON]=I,n[O.Shape.PATH]=D,n);t({token:k,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=E.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,l,h,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})),l=[];try{for(h=M(f),d=h.next();!d.done;d=h.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];l.push(p)}}catch(t){b={error:t}}finally{try{d&&!d.done&&(x=h.return)&&x.call(h)}finally{if(b)throw b.error}}return t.picked=l,[2,t]}))}))}))},t.tag="CanvasPicker",v([Object(E.inject)(O.DisplayObjectPool),y("design:type",O.DisplayObjectPool)],t.prototype,"displayObjectPool",void 0),v([Object(E.inject)(O.CanvasConfig),y("design:type",Object)],t.prototype,"canvasConfig",void 0),v([Object(E.inject)(O.OffscreenCanvasCreator),y("design:type",O.OffscreenCanvasCreator)],t.prototype,"offscreenCanvas",void 0),v([Object(E.inject)(di),y("design:type",A.a)],t.prototype,"rBush",void 0),v([Object(E.inject)(J),y("design:type",Function)],t.prototype,"pathGeneratorFactory",void 0),v([Object(E.inject)(gi),y("design:type",Function)],t.prototype,"pointInPathPickerFactory",void 0),t=n=v([Object(E.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 Ei(t){return(t+2*Math.PI)%(2*Math.PI)}var Si={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,l=f/10,h=0;h<=s;h++){var d=h*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(h=0;h<32&&!(l<1e-4);h++){var y=a-l,m=a+l,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):l*=.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 Pi(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=Pi(t,e,i,a),c=Pi(n,r,o,a),s=Si.pointAt(t,n,e,r,a),f=Si.pointAt(e,r,i,o,a);return[[t,n,s.x,s.y,u,c],[u,c,f.x,f.y,i,o]]}var ki={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(Pi(t,e,i,a)),void 0!==u&&s.push(Pi(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,Pi)},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:Pi,pointAt:function(t,n,e,r,i,o,a){return{x:Pi(t,e,i,a),y:Pi(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 Ei(Math.atan2(c,u))}};function Ri(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 Bi(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 l=c*c-4*u*s;xi(l,0)?f.push(-c/(2*u)):l>0&&(o=(-c-(a=Math.sqrt(l)))/(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=Ri(t,e,i,a,c),f=Ri(n,r,o,u,c),l=Si.pointAt(t,n,e,r,c),h=Si.pointAt(e,r,i,o,c),d=Si.pointAt(i,o,a,u,c),p=Si.pointAt(l.x,l.y,h.x,h.y,c),v=Si.pointAt(h.x,h.y,d.x,d.y,c);return[[t,n,l.x,l.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),l=x(x([],b(s[1]),!1),[c-1],!1);return Ni.apply(void 0,x([],b(f),!1))+Ni.apply(void 0,x([],b(l),!1))}var Ii={extrema:Bi,box:function(t,n,e,r,i,o,a,u){for(var c=[t,a],s=[n,u],f=Bi(t,e,i,a),l=Bi(n,r,o,u),h=0;h<f.length;h++)c.push(Ri(t,e,i,a,f[h]));for(h=0;h<l.length;h++)s.push(Ri(n,r,o,u,l[h]));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,Ri,f)},pointDistance:function(t,n,e,r,i,o,a,u,c,s,f){var l=this.nearestPoint(t,n,e,r,i,o,a,u,c,s,f);return bi(l.x,l.y,c,s)},interpolationAt:Ri,pointAt:function(t,n,e,r,i,o,a,u,c){return{x:Ri(t,e,i,a,c),y:Ri(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 Ei(Math.atan2(f,s))}};function Di(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 Di(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),l=i/2;return o>=u-l&&o<=c+l&&a>=s-l&&a<=f+l&&Si.pointToLine(t,n,e,r,o,a)<=i/2}function _i(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 Gi(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;Gi(a[1]-e)>0!=Gi(u[1]-e)>0&&Gi(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 Wi(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,l=Di(s,s,n.x,n.y),h=!!(null==c?void 0:c.length),d=i&&!i.isNone,p=o&&!o.isNone;return d&&p||h?l<=s+f:d?l<=s:!!p&&(l>=s-f&&l<=s+f)}function $i(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,l=i.clipPathTargets,h=!!(null==l?void 0:l.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||h?$i(g,M,v+m,y+m)<=1:d?$i(g,M,v,y)<=1:!!p&&($i(g,M,v-m,y-m)>=1&&$i(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,l=e.defY,h=void 0===l?0:l;return qi(r.value,i.value,o.value,a.value,u.value+c.value,n.x+f,n.y+h)}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,l=e.clipPathTargets,h=!!(null==l?void 0:l.length);return!((!r||r.isNone)&&!h||!i)&&_i(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,l=void 0===f?0:f,h=r.defY,d=void 0===h?0:h,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,E=!!(null==p?void 0:p.length),S=!1;return(m||E)&&(S=function(t,n,e,r,o,a,u){for(var s=!1,f=n/2,l=0;l<t.length;l++){var h=t[l],d=h.currentPoint,p=h.params,v=h.prePoint,y=h.box;if(!y||Yi(y.x-f,y.y-f,y.width+n,y.height+n,e,r)){switch(h.command){case"L":case"Z":s=qi(v[0],v[1],d[0],d[1],n,e,r);break;case"Q":s=ki.pointDistance(v[0],v[1],p[1],p[2],p[3],p[4],e,r)<=n/2;break;case"C":s=Ii.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=h.arcParams,g=m.cx,M=m.cy,b=m.rx,x=m.ry,O=m.startAngle,E=m.endAngle,S=m.xRotation,C=b>x?b:x,P=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(),-S),T),i.multiply(T,i.fromScaling(i.create(),[1/P,1/j]),T);var A=c.fromValues(e,r);s=Xi(0,0,C,O,E,n,(A=c.transformMat3(A,A,T))[0],A[1])}if(s)break}}return s}(g,o.value+a.value,n.x+l,n.y+d,O)),S||!y&&!E||(S=M?e(t,n):Vi(x,n.x+l,n.y+d)||Vi(b,n.x+l,n.y+d)),S}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,l=r.clipPathTargets,h=!!(null==l?void 0:l.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 E=!1;return(p||h)&&(E=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)),E||!d&&!h||(E=e(t,n)),E}var S=x/2;return d&&p||h?Yi(0-S,0-S,M+S,b+S,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,l=void 0===f?0:f,h=e.clipPathTargets,d=!!(null==h?void 0:h.length),p=i&&!i.isNone,v=!1;return(r&&!r.isNone||d)&&(v=_i(u.points,o.value+a.value,n.x+s,n.y+l,!0)),v||!p&&!d||(v=Hi(u.points,n.x+s,n.y+l)),v}var to=Object(E.Module)((function(t){t({token:gi,useFactory:function(t){return function(t){return t===O.Shape.CIRCLE?Wi: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=e.getOrCreateEl(n),i=n.ownerDocument.documentElement.attributes;Object.keys(i).forEach((function(t){r.style[t]=i[t]})),Object.keys(n.attributes).forEach((function(t){e.updateAttribute(t,n)}))}},i=function(t){var n=t.target;if(n.nodeName===O.Shape.HTML){var r=e.getId(n),i=e.contextService.getDomElement().parentNode;if(i){var o=i.querySelector("#"+r);o&&i.removeChild(o)}}},o=function(t){var n=t.target;if(n.nodeName===O.Shape.HTML){var r=t.attrName;e.updateAttribute(r,n)}};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.ATTR_MODIFIED,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.ATTR_MODIFIED,o)}))},t.prototype.getId=function(t){return t.id||"g-html-"+t.entity},t.prototype.getOrCreateEl=function(t){var n=this.getId(t),e=this.contextService.getDomElement().parentNode;if(e){var r=e.querySelector("#"+n);if(!r){r=document.createElement("div"),t.parsedStyle.$el=r,r.id=n,t.name&&r.setAttribute("name",t.name),t.className&&r.setAttribute("className",t.className),e.appendChild(r),r.style.position="absolute",r.style.left="0",r.style.top="0",r.style["will-change"]="transform";var i=t.getWorldTransform();r.style.transform="matrix(".concat([i[0],i[1],i[4],i[5],i[12],i[13]].join(","),")")}return r}return null},t.prototype.updateAttribute=function(t,n){var e=this.getOrCreateEl(n);switch(t){case"innerHTML":var r=n.parsedStyle.innerHTML;Object(O.isString)(r)?e.innerHTML=r:(e.innerHTML="",e.appendChild(r));break;case"modelMatrix":case"transformOrigin":var i=n.parsedStyle.transformOrigin;e.style["transform-origin"]="".concat(i[0].value," ").concat(i[1].value);var o=n.getWorldTransform();e.style.transform="matrix(".concat([o[0],o[1],o[4],o[5],o[12],o[13]].join(","),")");break;case"width":var a=n.parsedStyle.width;e.style.width="".concat((null==a?void 0:a.value)||0,"px");break;case"height":var u=n.parsedStyle.height;e.style.height="".concat((null==u?void 0:u.value)||0,"px");break;case"zIndex":var c=n.parsedStyle.zIndex;e.style["z-index"]="".concat(c.value);break;case"visibility":var s=n.parsedStyle.visibility;e.style.visibility=s.value;break;case"pointerEvents":var f=n.parsedStyle.pointerEvents;e.style.pointerEvents=f.value;break;case"opacity":var l=n.parsedStyle.opacity;e.style.opacity="".concat(l.value);break;case"fill":var h=n.parsedStyle.fill,d="";if(h instanceof O.CSSRGB)d=h.toString();else if(h instanceof O.CSSGradientValue&&h.type===O.GradientPatternType.LinearGradient){var p=h.value.steps.map((function(t){return"".concat(t[1]," ").concat(100*Number(t[0]),"%")})).join(",");d="linear-gradient(to right, ".concat(p,");")}e.style.background=d;break;case"stroke":var v=n.parsedStyle.stroke;e.style["border-color"]=v.toString(),e.style["border-style"]="solid";break;case"lineWidth":var y=n.parsedStyle.lineWidth;e.style["border-width"]="".concat(y.value||0,"px");break;case"lineDash":e.style["border-style"]="dashed";break;case"filter":var m=n.parsedStyle.filter;e.style.filter=m}},t.tag="HTMLRendering",v([Object(E.inject)(O.ContextService),y("design:type",Object)],t.prototype,"contextService",void 0),v([Object(E.inject)(O.RenderingContext),y("design:type",Object)],t.prototype,"renderingContext",void 0),t=n=v([Object(E.singleton)({contrib:O.RenderingPluginContribution})],t)}(),ro=Object(E.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(E.inject)(O.CanvasConfig),y("design:type",Object)],t.prototype,"canvasConfig",void 0),t=v([Object(E.singleton)({token:O.ContextService})],t)}(),ao=Object(E.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
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@antv/g"),require("mana-syringe")):"function"==typeof define&&define.amd?define(["exports","@antv/g","mana-syringe"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).G=t.G||{},t.G.Canvas2D={}),t.window.G,t.window.G.ManaSyringe)}(this,(function(t,e,n){"use strict";function r(t,e){return r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},r(t,e)}function i(t,e,n,r){var i,o=arguments.length,a=3>o?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var c=t.length-1;c>=0;c--)(i=t[c])&&(a=(3>o?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function o(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function a(){
|
|
2
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
3
|
+
a=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",c=r.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var i=Object.create((e&&e.prototype instanceof f?e:f).prototype),o=new P(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return C()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var c=w(a,n);if(c){if(c===h)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var s=l(t,e,n);if("normal"===s.type){if(r=n.done?"completed":"suspendedYield",s.arg===h)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r="completed",n.method="throw",n.arg=s.arg)}}}(t,n,o),i}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var h={};function f(){}function d(){}function v(){}var p={};s(p,i,(function(){return this}));var y=Object.getPrototypeOf,g=y&&y(y(S([])));g&&g!==e&&n.call(g,i)&&(p=g);var m=v.prototype=f.prototype=Object.create(p);function x(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(i,o,a,c){var s=l(t[i],t,o);if("throw"!==s.type){var u=s.arg,h=u.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(h).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,c)}))}c(s.arg)}var i;this._invoke=function(t,n){function o(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(o,o):o()}}function w(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var r=l(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,h;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function S(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:C}}function C(){return{value:void 0,done:!0}}return d.prototype=v,s(m,"constructor",v),s(v,"constructor",d),d.displayName=s(v,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,s(t,c,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},x(b.prototype),s(b.prototype,o,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new b(u(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(m),s(m,c,"Generator"),s(m,i,(function(){return this})),s(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=S,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(L),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(this.prev>=o.tryLoc){var c=n.call(o,"catchLoc"),s=n.call(o,"finallyLoc");if(c&&s){if(o.catchLoc>this.prev)return r(o.catchLoc,!0);if(o.finallyLoc>this.prev)return r(o.finallyLoc)}else if(c){if(o.catchLoc>this.prev)return r(o.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(this.prev>=i.tryLoc&&n.call(i,"finallyLoc")&&i.finallyLoc>this.prev){var o=i;break}}o&&("break"===t||"continue"===t)&&e>=o.tryLoc&&o.finallyLoc>=e&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),L(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;L(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},t}function c(t,e,n,r,i,o,a){try{var c=t[o](a),s=c.value}catch(t){return void n(t)}c.done?e(s):Promise.resolve(s).then(r,i)}function s(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){c(o,r,i,a,s,"next",t)}function s(t){c(o,r,i,a,s,"throw",t)}a(void 0)}))}}var u,l,h=/mobile|tablet|ip(ad|hone|od)|android/i,f=(u=function(){function t(){this.contextService=void 0,this.renderingContext=void 0}return t.prototype.apply=function(t){var e=this,n=this.renderingContext.root.ownerDocument.defaultView,r=n.supportTouchEvent&&h.test(navigator.userAgent),i=function(e){t.hooks.pointerMove.call(e)},o=function(e){t.hooks.pointerUp.call(e)},c=function(e){t.hooks.pointerDown.call(e)},u=function(e){t.hooks.pointerOver.call(e)},f=function(e){t.hooks.pointerOut.call(e)},d=function(e){t.hooks.pointerCancel.call(e)},v=function(e){t.hooks.pointerWheel.call(e)},p=function(t){globalThis.document.addEventListener("pointermove",i,!0),t.addEventListener("pointerdown",c,!0),t.addEventListener("pointerleave",f,!0),t.addEventListener("pointerover",u,!0),globalThis.addEventListener("pointerup",o,!0)},y=function(t){t.addEventListener("touchstart",c,!0),t.addEventListener("touchend",o,!0),t.addEventListener("touchmove",i,!0),t.addEventListener("touchcancel",d,!0)},g=function(t){globalThis.document.addEventListener("mousemove",i,!0),t.addEventListener("mousedown",c,!0),t.addEventListener("mouseout",f,!0),t.addEventListener("mouseover",u,!0),globalThis.addEventListener("mouseup",o,!0)},m=function(t){t.removeEventListener("touchstart",c,!0),t.removeEventListener("touchend",o,!0),t.removeEventListener("touchmove",i,!0)},x=function(t){globalThis.document.removeEventListener("mousemove",i,!0),t.removeEventListener("mousedown",c,!0),t.removeEventListener("mouseout",f,!0),t.removeEventListener("mouseover",u,!0),globalThis.removeEventListener("mouseup",o,!0)};t.hooks.init.tapPromise(l.tag,s(a().mark((function t(){var i;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=e.contextService.getDomElement(),n.supportPointerEvent&&p(i),r?y(i):n.supportTouchEvent?(y(i),n.supportPointerEvent||g(i)):n.supportPointerEvent||g(i),i.addEventListener("wheel",v,{passive:!0,capture:!0});case 4:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(l.tag,(function(){var t=e.contextService.getDomElement();n.supportPointerEvent&&function(t){globalThis.document.removeEventListener("pointermove",i,!0),t.removeEventListener("pointerdown",c,!0),t.removeEventListener("pointerleave",f,!0),t.removeEventListener("pointerover",u,!0),globalThis.removeEventListener("pointerup",o,!0)}(t),r?m(t):n.supportTouchEvent?(m(t),n.supportPointerEvent||x(t)):n.supportPointerEvent||x(t),t.removeEventListener("wheel",v,!0)}))},t}(),u.tag="DOMInteraction",l=u);i([n.inject(e.ContextService),o("design:type",Object)],f.prototype,"contextService",void 0),i([n.inject(e.RenderingContext),o("design:type",Object)],f.prototype,"renderingContext",void 0),f=l=i([n.singleton({contrib:e.RenderingPluginContribution})],f);var d=n.Module((function(t){t(f)})),v=function(){function t(){this.name="dom-interaction"}var e=t.prototype;return e.init=function(t){t.load(d,!0)},e.destroy=function(t){t.unload(d)},t}(),p=Object.freeze({__proto__:null,Plugin:v});function y(t,e,n,r,i){g(t,e,n||0,r||t.length-1,i||x)}function g(t,e,n,r,i){for(;r>n;){if(r-n>600){var o=r-n+1,a=e-n+1,c=Math.log(o),s=.5*Math.exp(2*c/3),u=.5*Math.sqrt(c*s*(o-s)/o)*(0>a-o/2?-1:1);g(t,e,Math.max(n,Math.floor(e-a*s/o+u)),Math.min(r,Math.floor(e+(o-a)*s/o+u)),i)}var l=t[e],h=n,f=r;for(m(t,n,e),i(t[r],l)>0&&m(t,n,r);f>h;){for(m(t,h,f),h++,f--;0>i(t[h],l);)h++;for(;i(t[f],l)>0;)f--}0===i(t[n],l)?m(t,n,f):m(t,++f,r),f>e||(n=f+1),e>f||(r=f-1)}}function m(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function x(t,e){return e>t?-1:t>e?1:0}class b{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const n=[];if(!N(t,e))return n;const r=this.toBBox,i=[];for(;e;){for(let o=0;e.children.length>o;o++){const a=e.children[o],c=e.leaf?r(a):a;N(t,c)&&(e.leaf?n.push(a):T(t,c)?this._all(a,n):i.push(a))}e=i.pop()}return n}collides(t){let e=this.data;if(!N(t,e))return!1;const n=[];for(;e;){for(let r=0;e.children.length>r;r++){const i=e.children[r],o=e.leaf?this.toBBox(i):i;if(N(t,o)){if(e.leaf||T(t,o))return!0;n.push(i)}}e=n.pop()}return!1}load(t){if(!t||!t.length)return this;if(this._minEntries>t.length){for(let e=0;t.length>e;e++)this.insert(t[e]);return this}let 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(e.height>this.data.height){const t=this.data;this.data=e,e=t}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=j([]),this}remove(t,e){if(!t)return this;let n=this.data;const r=this.toBBox(t),i=[],o=[];let a,c,s;for(;n||i.length;){if(n||(n=i.pop(),c=i[i.length-1],a=o.pop(),s=!0),n.leaf){const r=w(t,n.children,e);if(-1!==r)return n.children.splice(r,1),i.push(n),this._condense(i),this}s||n.leaf||!T(n,r)?c?(a++,n=c.children[a],s=!1):n=null:(i.push(n),o.push(a),a=0,c=n,n=n.children[0])}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const n=[];for(;t;)t.leaf?e.push(...t.children):n.push(...t.children),t=n.pop();return e}_build(t,e,n,r){const i=n-e+1;let o,a=this._maxEntries;if(a>=i)return o=j(t.slice(e,n+1)),E(o,this.toBBox),o;r||(a=Math.ceil(i/Math.pow(a,(r=Math.ceil(Math.log(i)/Math.log(a)))-1))),o=j([]),o.leaf=!1,o.height=r;const c=Math.ceil(i/a),s=c*Math.ceil(Math.sqrt(a));_(t,e,n,s,this.compareMinX);for(let i=e;n>=i;i+=s){const e=Math.min(i+s-1,n);_(t,i,e,c,this.compareMinY);for(let n=i;e>=n;n+=c){o.children.push(this._build(t,n,Math.min(n+c-1,e),r-1))}}return E(o,this.toBBox),o}_chooseSubtree(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){let n,r=1/0,a=1/0;for(let c=0;e.children.length>c;c++){const s=e.children[c],u=M(s),l=(Math.max((o=s).maxX,(i=t).maxX)-Math.min(o.minX,i.minX))*(Math.max(o.maxY,i.maxY)-Math.min(o.minY,i.minY))-u;a>l?(a=l,r=r>u?u:r,n=s):l===a&&r>u&&(r=u,n=s)}e=n||e.children[0]}var i,o;return e}_insert(t,e,n){const r=n?t:this.toBBox(t),i=[],o=this._chooseSubtree(r,this.data,e,i);for(o.children.push(t),P(o,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)}_split(t,e){const n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);const o=this._chooseSplitIndex(n,i,r),a=j(n.children.splice(o,n.children.length-o));a.height=n.height,a.leaf=n.leaf,E(n,this.toBBox),E(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)}_splitRoot(t,e){this.data=j([t,e]),this.data.height=t.height+1,this.data.leaf=!1,E(this.data,this.toBBox)}_chooseSplitIndex(t,e,n){let r,i=1/0,o=1/0;for(let a=e;n-e>=a;a++){const e=L(t,0,a,this.toBBox),c=L(t,a,n,this.toBBox),s=O(e,c),u=M(e)+M(c);i>s?(i=s,r=a,o=o>u?u:o):s===i&&o>u&&(o=u,r=a)}return r||n-e}_chooseSplitAxis(t,e,n){const r=t.leaf?this.compareMinX:S,i=t.leaf?this.compareMinY:C,o=this._allDistMargin(t,e,n,r);this._allDistMargin(t,e,n,i)>o&&t.children.sort(r)}_allDistMargin(t,e,n,r){t.children.sort(r);const i=this.toBBox,o=L(t,0,e,i),a=L(t,n-e,n,i);let c=k(o)+k(a);for(let r=e;n-e>r;r++){const e=t.children[r];P(o,t.leaf?i(e):e),c+=k(o)}for(let r=n-e-1;r>=e;r--){const e=t.children[r];P(a,t.leaf?i(e):e),c+=k(a)}return c}_adjustParentBBoxes(t,e,n){for(let r=n;r>=0;r--)P(e[r],t)}_condense(t){for(let e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children,e.splice(e.indexOf(t[n]),1)):this.clear():E(t[n],this.toBBox)}}function w(t,e,n){if(!n)return e.indexOf(t);for(let r=0;e.length>r;r++)if(n(t,e[r]))return r;return-1}function E(t,e){L(t,0,t.children.length,e,t)}function L(t,e,n,r,i){i||(i=j(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let o=e;n>o;o++){const e=t.children[o];P(i,t.leaf?r(e):e)}return i}function P(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function S(t,e){return t.minX-e.minX}function C(t,e){return t.minY-e.minY}function M(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function k(t){return t.maxX-t.minX+(t.maxY-t.minY)}function O(t,e){const n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function T(t,e){return!(t.minX>e.minX||t.minY>e.minY||e.maxX>t.maxX||e.maxY>t.maxY)}function N(t,e){return!(e.minX>t.maxX||e.minY>t.maxY||t.minX>e.maxX||t.minY>e.maxY)}function j(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function _(t,e,n,r,i){const o=[e,n];for(;o.length;){if(r>=(n=o.pop())-(e=o.pop()))continue;const a=e+Math.ceil((n-e)/r/2)*r;y(t,a,e,n,i),o.push(e,a,a,n)}}var B=n.Syringe.defineToken("StyleRendererFactory"),R=n.Syringe.defineToken("CircleRenderer",{multiple:!1}),A=n.Syringe.defineToken("EllipseRenderer",{multiple:!1}),I=n.Syringe.defineToken("RectRenderer",{multiple:!1}),G=n.Syringe.defineToken("LineRenderer",{multiple:!1}),D=n.Syringe.defineToken("PolylineRenderer",{multiple:!1}),F=n.Syringe.defineToken("PolygonRenderer",{multiple:!1}),Y=n.Syringe.defineToken("PathRenderer",{multiple:!1}),X=n.Syringe.defineToken("TextRenderer",{multiple:!1}),H=n.Syringe.defineToken("ImageRenderer",{multiple:!1}),$=function(){function t(){this.imageCache={},this.patternCache={},this.canvasConfig=void 0}var n=t.prototype;return n.getImageSync=function(t){return this.imageCache[t]},n.getOrCreateImage=function(t){var n=this;if(this.imageCache[t])return Promise.resolve(this.imageCache[t]);var r=this.canvasConfig.createImage;return new Promise((function(i,o){var a;r?a=r(t):e.isBrowser&&(a=new window.Image),a&&(a.onload=function(){i(a)},a.onerror=function(t){o(t)},a.crossOrigin="Anonymous",a.src=t,n.imageCache[t]=a)}))},n.getPatternSync=function(t){var e=this.generatePatternKey(t);if(this.patternCache[e])return this.patternCache[e]},n.createPattern=function(t,e){var n=this;return this.getOrCreateImage(t.src).then((function(r){var i=n.generatePatternKey(t),o=e.createPattern(r,t.repetition);return o&&(n.patternCache[i]=o),n.patternCache[i]}))},n.generatePatternKey=function(t){return"pattern-"+t.src+"-"+t.repetition},t}();i([n.inject(e.CanvasConfig),o("design:type",Object)],$.prototype,"canvasConfig",void 0),$=i([n.singleton()],$);var W=function(){function t(){this.imagePool=void 0}var n=t.prototype;return n.hash=function(t){return""},n.render=function(t,n){var r,i=n.img,o=n.width.value,a=n.height.value;if(e.isString(i)?r=this.imagePool.getImageSync(i):(o||(o=i.width),a||(a=i.height),r=i),r)try{t.drawImage(r,0,0,o,a)}catch(t){}},t}();i([n.inject($),o("design:type",$)],W.prototype,"imagePool",void 0),W=i([n.singleton({token:H})],W);var U=function(){function t(){}var n=t.prototype;return n.hash=function(t){return""},n.render=function(t,n,r){var i=n.lineWidth,o=n.textAlign,a=n.textBaseline,c=n.lineJoin,s=n.miterLimit,u=void 0===s?0:s,l=n.letterSpacing,h=void 0===l?0:l,f=n.stroke,d=n.fill,v=n.fillOpacity,p=n.strokeOpacity,y=n.opacity,g=n.metrics,m=n.dx,x=n.dy,b=g.lines,w=g.height,E=g.lineHeight,L=g.lineMetrics;t.font=g.font,t.lineWidth=i.value,t.textAlign=o.value,t.textBaseline=a.value,t.lineJoin=c.value,t.miterLimit=u;var P=0;"middle"===a.value?P=-w/2-E/2:"bottom"===a.value||"alphabetic"===a.value||"ideographic"===a.value?P=-w:"top"!==a.value&&"hanging"!==a.value||(P=-E);var S=0;m&&m.unit===e.UnitType.kPixels&&(S+=m.value),x&&x.unit===e.UnitType.kPixels&&(P+=x.value);for(var C=0;b.length>C;C++){var M=i.value/2+S;P+=E,!e.isNil(f)&&i&&i.value&&this.drawLetterSpacing(t,b[C],L[C],o.value,M,P,h,v.value,p.value,y.value,!0),e.isNil(d)||this.drawLetterSpacing(t,b[C],L[C],o.value,M,P,h,v.value,p.value,y.value)}},n.drawLetterSpacing=function(t,e,n,r,i,o,a,c,s,u,l){if(void 0===l&&(l=!1),0!==a){var h=t.textAlign;t.textAlign="left";var f=i;"center"===r?f=i-n.width/2:"right"!==r&&"end"!==r||(f=i-n.width);for(var d=Array.from(e),v=t.measureText(e).width,p=0,y=0;d.length>y;++y){var g=d[y];l?this.strokeText(t,g,f,o,s):this.fillText(t,g,f,o,c,u),f+=v-(p=t.measureText(e.substring(y+1)).width)+a,v=p}t.textAlign=h}else l?this.strokeText(t,e,i,o,s):this.fillText(t,e,i,o,c,u)},n.fillText=function(t,n,r,i,o,a){var c,s=!e.isNil(o)&&1!==o;s&&(c=t.globalAlpha,t.globalAlpha=o*a),t.fillText(n,r,i),s&&(t.globalAlpha=c)},n.strokeText=function(t,n,r,i,o){var a,c=!e.isNil(o)&&1!==o;c&&(a=t.globalAlpha,t.globalAlpha=o),t.strokeText(n,r,i),c&&(t.globalAlpha=a)},t}();function q(){
|
|
4
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
5
|
+
q=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i=Object.create((e&&e.prototype instanceof h?e:h).prototype),o=new L(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return S()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var c=b(a,n);if(c){if(c===l)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var s=u(t,e,n);if("normal"===s.type){if(r=n.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r="completed",n.method="throw",n.arg=s.arg)}}}(t,n,o),i}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var l={};function h(){}function f(){}function d(){}var v={};c(v,i,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(P([])));y&&y!==e&&n.call(y,i)&&(v=y);var g=d.prototype=h.prototype=Object.create(v);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(i,o,a,c){var s=u(t[i],t,o);if("throw"!==s.type){var l=s.arg,h=l.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(s.arg)}var i;this._invoke=function(t,n){function o(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(o,o):o()}}function b(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=u(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,l;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function w(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function P(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:S}}function S(){return{value:void 0,done:!0}}return f.prototype=d,c(g,"constructor",d),c(d,"constructor",f),f.displayName=c(d,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(x.prototype),c(x.prototype,o,(function(){return this})),t.AsyncIterator=x,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new x(s(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,i,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=P,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(this.prev>=o.tryLoc){var c=n.call(o,"catchLoc"),s=n.call(o,"finallyLoc");if(c&&s){if(o.catchLoc>this.prev)return r(o.catchLoc,!0);if(o.finallyLoc>this.prev)return r(o.finallyLoc)}else if(c){if(o.catchLoc>this.prev)return r(o.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(this.prev>=i.tryLoc&&n.call(i,"finallyLoc")&&i.finallyLoc>this.prev){var o=i;break}}o&&("break"===t||"continue"===t)&&e>=o.tryLoc&&o.finallyLoc>=e&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),E(n),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;E(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:P(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},t}function V(t,e,n,r,i,o,a){try{var c=t[o](a),s=c.value}catch(t){return void n(t)}c.done?e(s):Promise.resolve(s).then(r,i)}function z(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){V(o,r,i,a,c,"next",t)}function c(t){V(o,r,i,a,c,"throw",t)}a(void 0)}))}}function Q(){return Q=Object.assign||function(t){for(var e=1;arguments.length>e;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Q.apply(this,arguments)}function J(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,K(t,e)}function K(t,e){return K=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},K(t,e)}U=i([n.singleton({token:X})],U);var Z=function(){function t(){}var n=t.prototype;return n.hash=function(t){return""},n.render=function(t,n){var r=n.fill,i=n.opacity,o=n.fillOpacity,a=n.stroke,c=n.strokeOpacity,s=n.lineWidth,u=n.lineCap,l=n.lineJoin,h=n.shadowColor,f=n.filter,d=n.miterLimit,v=!e.isNil(r),p=!e.isNil(a),y=0===r.alpha;if(v&&(e.isNil(o)||1===o.value?t.fill():(t.globalAlpha=o.value,t.fill(),t.globalAlpha=i.value)),p&&s&&s.value>0){var g,m,x;!e.isNil(c)&&1!==c.value&&(t.globalAlpha=c.value),t.lineWidth=s.value,e.isNil(d)||(t.miterLimit=d),e.isNil(u)||(t.lineCap=u.value),e.isNil(l)||(t.lineJoin=l.value);var b=!e.isNil(h),w=!e.isNil(f);b&&(m=t.shadowColor,e.isNil(g=t.shadowBlur)||(t.shadowColor="transparent",t.shadowBlur=0)),w&&!e.isNil(x=t.filter)&&x.indexOf("drop-shadow")>-1&&(t.filter=x.replace(/drop-shadow\([^)]*\)/,"").trim()||"none");var E=v&&!y;E&&t.stroke(),b&&(t.shadowColor=m,t.shadowBlur=g),w&&(t.filter=x),E||t.stroke()}},t}(),tt=function(t){function e(){return t.apply(this,arguments)||this}return J(e,t),e}(Z=i([n.singleton()],Z));tt=i([n.singleton({token:I})],tt);var et=function(t){function e(){return t.apply(this,arguments)||this}return J(e,t),e}(Z);et=i([n.singleton({token:R})],et);var nt=function(t){function e(){return t.apply(this,arguments)||this}return J(e,t),e}(Z);nt=i([n.singleton({token:A})],nt);var rt=function(t){function e(){return t.apply(this,arguments)||this}return J(e,t),e}(Z);rt=i([n.singleton({token:G})],rt);var it=function(t){function e(){return t.apply(this,arguments)||this}return J(e,t),e}(Z);it=i([n.singleton({token:D})],it);var ot=function(t){function e(){return t.apply(this,arguments)||this}return J(e,t),e}(Z);ot=i([n.singleton({token:F})],ot);var at=function(t){function e(){return t.apply(this,arguments)||this}return J(e,t),e}(Z);at=i([n.singleton({token:Y})],at);var ct=function(){function t(){this.gradientCache={}}var n=t.prototype;return n.getOrCreateGradient=function(t,n){var r=this.generateCacheKey(t),i=t.type,o=t.x0,a=t.y0,c=t.x1,s=t.y1,u=t.steps,l=t.width,h=t.height;if(this.gradientCache[r])return this.gradientCache[r];var f=null;if(i===e.GradientPatternType.LinearGradient)f=n.createLinearGradient(o*l,a*h,c*l,s*h);else if(i===e.GradientPatternType.RadialGradient){f=n.createRadialGradient(o*l,a*h,0,c*l,s*h,t.r1*(Math.sqrt(l*l+h*h)/2))}return f&&(u.forEach((function(t){var e,n=t[1];null===(e=f)||void 0===e||e.addColorStop(Number(t[0]),n)})),this.gradientCache[r]=f),this.gradientCache[r]},n.generateCacheKey=function(t){return"gradient-"+t.type+"-"+t.x0+"-"+t.y0+"-"+t.x1+"-"+t.y1+"-"+(t.r1||0)+"-"+t.width+"-"+t.height+"-"+t.steps.map((function(t){return t.join("")})).join("-")},t}();ct=i([n.singleton()],ct);var st=n.Syringe.defineToken("PathGeneratorFactory"),ut=n.Syringe.defineToken("PathGenerator"),lt="undefined"!=typeof Float32Array?Float32Array:Array;function ht(t,e){var n=e[4],r=e[5],i=e[6],o=e[8],a=e[9],c=e[10];return t[0]=Math.hypot(e[0],e[1],e[2]),t[1]=Math.hypot(n,r,i),t[2]=Math.hypot(o,a,c),t}function ft(){var t=new lt(3);return lt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function dt(t,e,n){var r=new lt(3);return r[0]=t,r[1]=e,r[2]=n,r}function vt(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],c=n[1],s=n[2];return t[0]=i*s-o*c,t[1]=o*a-r*s,t[2]=r*c-i*a,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var pt,yt=function(t){return Math.hypot(t[0],t[1],t[2])};pt=ft();!function(){var t,e=(t=new lt(4),lt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}();function gt(){var t=new lt(4);return lt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function mt(t,e,n,r){var i,o,a,c,s,u=e[0],l=e[1],h=e[2],f=e[3],d=n[0],v=n[1],p=n[2],y=n[3];return 0>(o=u*d+l*v+h*p+f*y)&&(o=-o,d=-d,v=-v,p=-p,y=-y),1-o>1e-6?(a=Math.sin(i=Math.acos(o)),c=Math.sin((1-r)*i)/a,s=Math.sin(r*i)/a):(c=1-r,s=r),t[0]=c*u+s*d,t[1]=c*l+s*v,t[2]=c*h+s*p,t[3]=c*f+s*y,t}var xt,bt,wt,Et,Lt,Pt,St,Ct,Mt,kt=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t},Ot=(xt=ft(),bt=dt(1,0,0),wt=dt(0,1,0),Et=gt(),Lt=gt(),Pt=new lt(9),lt!=Float32Array&&(Pt[1]=0,Pt[2]=0,Pt[3]=0,Pt[5]=0,Pt[6]=0,Pt[7]=0),Pt[0]=1,Pt[4]=1,Pt[8]=1,St=Pt,function(){this.aabb=void 0});Ot.tag="c-canvas-rbush-node";var Tt,Nt,jt="RBushRoot",_t=(Ct=function(){function t(){this.canvasConfig=void 0,this.camera=void 0,this.contextService=void 0,this.renderingContext=void 0,this.imagePool=void 0,this.gradientPool=void 0,this.pathGeneratorFactory=void 0,this.styleRendererFactory=void 0,this.displayObjectPool=void 0,this.rBush=void 0,this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreen=!1,this.enableBatch=!1,this.batchedStyleHash="",this.batchedDisplayObject=null,this.toSync=new Set}var n=t.prototype;return n.syncRTree=function(){var t=this,e=[];Array.from(this.toSync).filter((function(t){return t.isConnected})).forEach((function(n){var r=n.rBushNode;r&&t.rBush.remove(r.aabb);var i=n.getRenderBounds();if(i){var o=i.getMin(),a=o[0],c=o[1],s=i.getMax();r.aabb={id:n.entity,minX:a,minY:c,maxX:s[0],maxY:s[1]}}r.aabb&&e.push(r.aabb)})),this.rBush.load(e),this.toSync.clear()},n.pushToSync=function(t){var e=this;t.forEach((function(t){e.toSync.add(t)}))},n.apply=function(t){var n=this,r=function(t){t.target.rBushNode=new Ot,n.pushToSync(t.composedPath().slice(0,-2))},i=function(t){var e=t.target,r=e.rBushNode;r.aabb&&(n.rBush.remove(r.aabb),n.toSync.delete(e),n.removedRBushNodeAABBs.push(r.aabb))},o=function(t){var e,r=t.target;(null===(e=r.ownerDocument)||void 0===e?void 0:e.documentElement)===n.renderingContext.root&&(t.detail.affectChildren&&r.forEach((function(t){n.pushToSync([t])})),n.pushToSync(t.composedPath().slice(0,-2)))};t.hooks.init.tapPromise(Mt.tag,z(q().mark((function t(){var a,c,s,u;return q().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n.renderingContext.root.addEventListener(e.ElementEvent.MOUNTED,r),n.renderingContext.root.addEventListener(e.ElementEvent.UNMOUNTED,i),n.renderingContext.root.addEventListener(e.ElementEvent.BOUNDS_CHANGED,o),c=(a=n.canvasConfig).width,s=a.height,u=n.contextService.getContext(),n.clearRect(u,0,0,c,s);case 6:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(Mt.tag,(function(){n.renderingContext.root.removeEventListener(e.ElementEvent.MOUNTED,r),n.renderingContext.root.removeEventListener(e.ElementEvent.UNMOUNTED,i),n.renderingContext.root.removeEventListener(e.ElementEvent.BOUNDS_CHANGED,o)})),t.hooks.beginFrame.tap(Mt.tag,(function(){var t=n.contextService.getContext(),r=n.canvasConfig,i=r.width,o=r.height,a=r.renderer.getConfig();n.clearFullScreen=!a.enableDirtyRectangleRendering||n.renderingContext.renderReasons.has(e.RenderReason.CAMERA_CHANGED),t&&(t.save(),n.clearFullScreen&&n.clearRect(t,0,0,i,o),n.applyTransform(t,n.camera.getOrthoMatrix()))})),t.hooks.endFrame.tap(Mt.tag,(function(){n.syncRTree();var r=n.canvasConfig.renderer.getConfig(),i=r.enableDirtyRectangleRendering,o=r.enableDirtyRectangleRenderingDebug,a=n.contextService.getContext(),c=n.renderQueue;if(i){if(!n.clearFullScreen){var s=n.safeMergeAABB.apply(n,[n.mergeDirtyAABBs(n.renderQueue)].concat(n.removedRBushNodeAABBs.map((function(t){var n=t.minX,r=t.minY,i=t.maxX,o=t.maxY,a=new e.AABB;return a.setMinMax(dt(n,r,0),dt(i,o,0)),a}))));if(n.removedRBushNodeAABBs=[],e.AABB.isEmpty(s))return void(n.renderQueue=[]);var u=n.convertAABB2Rect(s),l=u.x,h=u.y,f=u.width,d=u.height;n.clearRect(a,l,h,f,d),a.beginPath(),a.rect(l,h,f,d),a.clip(),o&&(a.lineWidth=4,a.strokeStyle="rgba("+255*Math.random()+", "+255*Math.random()+", "+255*Math.random()+", 1)",a.strokeRect(l,h,f,d)),c=n.searchDirtyObjects(s)}c.sort((function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder})).forEach((function(e){e&&e.isVisible()&&!e.isCulled()&&n.renderDisplayObject(e,t)})),n.enableBatch&&n.batchedStyleHash&&n.flush(a,t),n.renderQueue.forEach((function(t){n.saveDirtyAABB(t)})),n.renderQueue=[]}n.restoreStack.forEach((function(t){a.restore()})),n.restoreStack=[],n.clearFullScreen=!1,a.restore()})),t.hooks.render.tap(Mt.tag,(function(e){n.canvasConfig.renderer.getConfig().enableDirtyRectangleRendering?n.renderQueue.push(e):e.isVisible()&&!e.isCulled()&&n.renderDisplayObject(e,t)}))},n.clearRect=function(t,e,n,r,i){t.clearRect(e,n,r,i);var o=this.canvasConfig.background;o&&(t.fillStyle=o,t.fillRect(e,n,r,i))},n.flush=function(t,e){if(this.batchedDisplayObject){var n=this.styleRendererFactory(this.batchedDisplayObject.nodeName);n&&(this.applyAttributesToContext(t,this.batchedDisplayObject,e),t.closePath(),n.render(t,this.batchedDisplayObject.parsedStyle,this.batchedDisplayObject),t.restore()),this.batchedStyleHash="",this.batchedDisplayObject=null}},n.renderDisplayObject=function(t,n){for(var r=this,i=this.contextService.getContext(),o=this.restoreStack[this.restoreStack.length-1];o&&t.parentNode!==o;)i.restore(),this.restoreStack.pop(),o=this.restoreStack[this.restoreStack.length-1];var a=this.styleRendererFactory(t.nodeName),c=!1;if(this.enableBatch&&a){var s=a.hash(t.attributes);this.batchedStyleHash&&s!==this.batchedStyleHash&&this.flush(i,n),this.batchedStyleHash||(this.batchedStyleHash=s,this.batchedDisplayObject=t,c=!0)}i.save(),this.applyTransform(i,t.getLocalTransform());var u=t.style.clipPath;if(u){i.save(),this.applyTransform(i,u.getLocalTransform());var l=this.pathGeneratorFactory(u.nodeName);l&&this.useAnchor(i,u,(function(){i.beginPath(),l(i,u.parsedStyle),i.closePath()})),i.restore(),i.clip()}this.enableBatch||(i.save(),this.applyAttributesToContext(i,t,n)),this.useAnchor(i,t,(function(){var n=r.pathGeneratorFactory(t.nodeName);n&&(!c&&r.enableBatch||i.beginPath(),n(i,t.parsedStyle),r.enableBatch||t.nodeName===e.Shape.LINE||t.nodeName===e.Shape.PATH||t.nodeName===e.Shape.POLYLINE||i.closePath()),a&&!r.enableBatch&&a.render(i,t.parsedStyle,t)})),this.enableBatch||i.restore(),t.renderable.dirty=!1,this.restoreStack.push(t)},n.convertAABB2Rect=function(t){var e=t.getMin(),n=t.getMax(),r=Math.floor(e[0]),i=Math.floor(e[1]);return{x:r,y:i,width:Math.ceil(n[0])-r,height:Math.ceil(n[1])-i}},n.mergeDirtyAABBs=function(t){var n=new e.AABB;return t.forEach((function(t){var e=t.getRenderBounds();n.add(e);var r=t.renderable.dirtyRenderBounds;r&&n.add(r)})),n},n.searchDirtyObjects=function(t){var e=this,n=t.getMin(),r=n[0],i=n[1],o=t.getMax();return this.rBush.search({minX:r,minY:i,maxX:o[0],maxY:o[1]}).map((function(t){return e.displayObjectPool.getByEntity(t.id)}))},n.saveDirtyAABB=function(t){var n=t.renderable;n.dirtyRenderBounds||(n.dirtyRenderBounds=new e.AABB);var r=t.getRenderBounds();r&&n.dirtyRenderBounds.update(r.center,r.halfExtents)},n.applyTransform=function(t,n){var r=function(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}(ft(),n),i=r[0],o=r[1],a=ht(ft(),n),c=a[0],s=a[1],u=function(t,e){var n=new lt(3);ht(n,e);var r=1/n[0],i=1/n[1],o=1/n[2],a=e[0]*r,c=e[1]*i,s=e[2]*o,u=e[4]*r,l=e[5]*i,h=e[6]*o,f=e[8]*r,d=e[9]*i,v=e[10]*o,p=a+l+v,y=0;return p>0?(t[3]=.25*(y=2*Math.sqrt(p+1)),t[0]=(h-d)/y,t[1]=(f-s)/y,t[2]=(c-u)/y):a>l&&a>v?(t[3]=(h-d)/(y=2*Math.sqrt(1+a-l-v)),t[0]=.25*y,t[1]=(c+u)/y,t[2]=(f+s)/y):l>v?(t[3]=(f-s)/(y=2*Math.sqrt(1+l-a-v)),t[0]=(c+u)/y,t[1]=.25*y,t[2]=(h+d)/y):(t[3]=(c-u)/(y=2*Math.sqrt(1+v-a-l)),t[0]=(f+s)/y,t[1]=(h+d)/y,t[2]=.25*y),t}(gt(),n),l=e.getEuler(ft(),u),h=e.fromRotationTranslationScale(l[0]||l[2],i,o,c,s);t.transform(h[0],h[1],h[3],h[4],h[6],h[7])},n.getColor=function(t,n,r,i){var o;if(t instanceof e.CSSGradientValue){if(t.type===e.GradientPatternType.LinearGradient||t.type===e.GradientPatternType.RadialGradient){var a=n.getGeometryBounds();o=this.gradientPool.getOrCreateGradient(Q({type:t.type},t.value,{width:a&&2*a.halfExtents[0]||0,height:a&&2*a.halfExtents[1]||0}),r)}else if(t.type===e.GradientPatternType.Pattern){var c=this.imagePool.getPatternSync(t.value);c?o=c:this.imagePool.createPattern(t.value,r).then((function(){n.renderable.dirty=!0,i.dirtify()}))}}else o=""+t;return o},n.applyAttributesToContext=function(t,n,r){var i=n.parsedStyle,o=i.stroke,a=i.fill,c=i.opacity,s=i.lineDash,u=i.lineDashOffset,l=i.filter,h=i.shadowColor,f=i.shadowBlur,d=i.shadowOffsetX,v=i.shadowOffsetY;s&&Array.isArray(s)&&t.setLineDash(s.map((function(t){return t.value}))),e.isNil(u)||(t.lineDashOffset=u.value),e.isNil(c)||(t.globalAlpha*=c.value),e.isNil(o)||(t.strokeStyle=this.getColor(o,n,t,r)),e.isNil(a)||(t.fillStyle=this.getColor(a,n,t,r)),e.isNil(l)||(t.filter=n.style.filter),e.isNil(h)||(t.shadowColor=""+h,t.shadowBlur=f&&f.value||0,t.shadowOffsetX=d&&d.value||0,t.shadowOffsetY=v&&v.value||0)},n.useAnchor=function(t,e,n){var r=e.getGeometryBounds();if(r){var i=r.halfExtents,o=(e.parsedStyle||{}).anchor;t.translate(-(o&&o[0].value||0)*i[0]*2,-(o&&o[1].value||0)*i[1]*2),n()}else n()},n.safeMergeAABB=function(){for(var t=new e.AABB,n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return r.forEach((function(e){t.add(e)})),t},t}(),Ct.tag="CanvasRenderer",Mt=Ct);i([n.inject(e.CanvasConfig),o("design:type",Object)],_t.prototype,"canvasConfig",void 0),i([n.inject(e.DefaultCamera),o("design:type",e.Camera)],_t.prototype,"camera",void 0),i([n.inject(e.ContextService),o("design:type",Object)],_t.prototype,"contextService",void 0),i([n.inject(e.RenderingContext),o("design:type",Object)],_t.prototype,"renderingContext",void 0),i([n.inject($),o("design:type",$)],_t.prototype,"imagePool",void 0),i([n.inject(ct),o("design:type",ct)],_t.prototype,"gradientPool",void 0),i([n.inject(st),o("design:type",Function)],_t.prototype,"pathGeneratorFactory",void 0),i([n.inject(B),o("design:type",Function)],_t.prototype,"styleRendererFactory",void 0),i([n.inject(e.DisplayObjectPool),o("design:type",e.DisplayObjectPool)],_t.prototype,"displayObjectPool",void 0),i([n.inject(jt),o("design:type",b)],_t.prototype,"rBush",void 0),_t=Mt=i([n.singleton({contrib:e.RenderingPluginContribution})],_t);var Bt=(Tt=function(){function t(){this.imagePool=void 0,this.renderingContext=void 0}return t.prototype.apply=function(t){var n=this,r=function(r){var i=r.target;if(i.nodeName===e.Shape.IMAGE){var o=i.attributes.img;e.isString(o)&&n.imagePool.getOrCreateImage(o).then((function(){i.renderable.dirty=!0,t.dirtify()}))}},i=function(r){var i=r.target,o=r.newValue;i.nodeName===e.Shape.IMAGE&&"img"===r.attrName&&e.isString(o)&&n.imagePool.getOrCreateImage(o).then((function(){i.renderable.dirty=!0,t.dirtify()}))};t.hooks.init.tapPromise(Nt.tag,z(q().mark((function t(){return q().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n.renderingContext.root.addEventListener(e.ElementEvent.MOUNTED,r),n.renderingContext.root.addEventListener(e.ElementEvent.ATTR_MODIFIED,i);case 2:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(Nt.tag,(function(){n.renderingContext.root.removeEventListener(e.ElementEvent.MOUNTED,r),n.renderingContext.root.removeEventListener(e.ElementEvent.ATTR_MODIFIED,i)}))},t}(),Tt.tag="LoadImage",Nt=Tt);i([n.inject($),o("design:type",$)],Bt.prototype,"imagePool",void 0),i([n.inject(e.RenderingContext),o("design:type",Object)],Bt.prototype,"renderingContext",void 0),Bt=Nt=i([n.singleton({contrib:e.RenderingPluginContribution})],Bt),n.GlobalContainer.register({token:{token:ut,named:e.Shape.CIRCLE},useValue:function(t,e){var n=e.r;t.arc(n.value,n.value,n.value,0,2*Math.PI,!1)}}),n.GlobalContainer.register({token:{token:ut,named:e.Shape.ELLIPSE},useValue:function(t,e){var n=e.rx.value,r=e.ry.value;if(t.ellipse)t.ellipse(n,r,n,r,0,0,2*Math.PI,!1);else{var i=n>r?n:r,o=n>r?1:n/r,a=n>r?r/n:1;t.save(),t.scale(o,a),t.arc(0,0,i,0,2*Math.PI)}}}),n.GlobalContainer.register({token:{token:ut,named:e.Shape.RECT},useValue:function(t,e){var n=e.radius,r=e.width.value,i=e.height.value;if(n&&n.some((function(t){return 0!==t.value}))){var o=n.map((function(t){return t.value})),a=o[0],c=o[1],s=o[2],u=o[3];t.moveTo(a,0),t.lineTo(r-c,0),0!==c&&t.arc(r-c,c,c,-Math.PI/2,0),t.lineTo(r,i-s),0!==s&&t.arc(r-s,i-s,s,0,Math.PI/2),t.lineTo(u,i),0!==u&&t.arc(u,i-u,u,Math.PI/2,Math.PI),t.lineTo(0,a),0!==a&&t.arc(a,a,a,Math.PI,1.5*Math.PI)}else t.rect(0,0,r,i)}}),n.GlobalContainer.register({token:{token:ut,named:e.Shape.LINE},useValue:function(t,e){var n=e.x2,r=e.y2,i=e.defX,o=void 0===i?0:i,a=e.defY,c=void 0===a?0:a;t.moveTo(e.x1.value-o,e.y1.value-c),t.lineTo(n.value-o,r.value-c)}}),n.GlobalContainer.register({token:{token:ut,named:e.Shape.POLYLINE},useValue:function(t,e){var n=e.defX,r=void 0===n?0:n,i=e.defY,o=void 0===i?0:i,a=e.points.points,c=a.length,s=a[c-1][0]-r,u=a[c-1][1]-o;t.moveTo(a[0][0]-r,a[0][1]-o);for(var l=0;c-1>l;l++){var h=a[l];t.lineTo(h[0]-r,h[1]-o)}t.lineTo(s,u)}}),n.GlobalContainer.register({token:{token:ut,named:e.Shape.POLYGON},useValue:function(t,e){var n=e.defX,r=void 0===n?0:n,i=e.defY,o=void 0===i?0:i,a=e.points.points,c=a.length,s=a[c-1][0]-r,u=a[c-1][1]-o;t.moveTo(a[0][0]-r,a[0][1]-o);for(var l=0;c-1>l;l++){var h=a[l];t.lineTo(h[0]-r,h[1]-o)}t.lineTo(s,u)}}),n.GlobalContainer.register({token:{token:ut,named:e.Shape.PATH},useValue:function(t,e){var n=e.defX,r=void 0===n?0:n,i=e.defY,o=void 0===i?0:i,a=e.path,c=a.zCommandIndexes,s=[].concat(a.curve);c.forEach((function(t,e){s.splice(t+e,1,["Z"])}));for(var u=0;s.length>u;u++){var l=s[u];switch(l[0]){case"M":t.moveTo(l[1]-r,l[2]-o);break;case"C":t.bezierCurveTo(l[1]-r,l[2]-o,l[3]-r,l[4]-o,l[5]-r,l[6]-o);break;case"Z":t.closePath()}}}}),n.GlobalContainer.register({token:st,useFactory:function(t){var e={};return function(n){return e[n]||t.container.isBoundNamed(ut,n)&&(e[n]=t.container.getNamed(ut,n)),e[n]}}});var Rt=n.Module((function(t){var n;t($),t({token:jt,useValue:new b}),t(et),t(nt),t(tt),t(W),t(U),t(rt),t(it),t(ot),t(at);var r=((n={})[e.Shape.CIRCLE]=R,n[e.Shape.ELLIPSE]=A,n[e.Shape.RECT]=I,n[e.Shape.IMAGE]=H,n[e.Shape.TEXT]=X,n[e.Shape.LINE]=G,n[e.Shape.POLYLINE]=D,n[e.Shape.POLYGON]=F,n[e.Shape.PATH]=Y,n);t({token:B,useFactory:function(t){var e={};return function(n){var i=r[n];return i&&!e[n]&&t.container.isBound(i)&&(e[n]=t.container.get(i)),e[n]}}}),t(ct),t(_t),t(Bt)})),At=function(){function t(){this.name="canvas-renderer"}var e=t.prototype;return e.init=function(t){t.load(Rt,!0)},e.destroy=function(t){t.unload(Rt)},t}(),It=Object.freeze({__proto__:null,get CircleRenderer(){return et},CircleRendererContribution:R,get EllipseRenderer(){return nt},EllipseRendererContribution:A,get ImageRenderer(){return W},ImageRendererContribution:H,get LineRenderer(){return rt},LineRendererContribution:G,PathGenerator:ut,PathGeneratorFactory:st,get PathRenderer(){return at},PathRendererContribution:Y,Plugin:At,get PolygonRenderer(){return ot},PolygonRendererContribution:F,get PolylineRenderer(){return it},PolylineRendererContribution:D,RBushNode:Ot,RBushRoot:jt,get RectRenderer(){return tt},RectRendererContribution:I,StyleRendererFactory:B,get TextRenderer(){return U},TextRendererContribution:X,RBush:b});function Gt(){
|
|
6
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
7
|
+
Gt=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i=Object.create((e&&e.prototype instanceof h?e:h).prototype),o=new L(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return S()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var c=b(a,n);if(c){if(c===l)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var s=u(t,e,n);if("normal"===s.type){if(r=n.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r="completed",n.method="throw",n.arg=s.arg)}}}(t,n,o),i}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var l={};function h(){}function f(){}function d(){}var v={};c(v,i,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(P([])));y&&y!==e&&n.call(y,i)&&(v=y);var g=d.prototype=h.prototype=Object.create(v);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(i,o,a,c){var s=u(t[i],t,o);if("throw"!==s.type){var l=s.arg,h=l.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(s.arg)}var i;this._invoke=function(t,n){function o(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(o,o):o()}}function b(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=u(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,l;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function w(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function P(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:S}}function S(){return{value:void 0,done:!0}}return f.prototype=d,c(g,"constructor",d),c(d,"constructor",f),f.displayName=c(d,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(x.prototype),c(x.prototype,o,(function(){return this})),t.AsyncIterator=x,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new x(s(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,i,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=P,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(this.prev>=o.tryLoc){var c=n.call(o,"catchLoc"),s=n.call(o,"finallyLoc");if(c&&s){if(o.catchLoc>this.prev)return r(o.catchLoc,!0);if(o.finallyLoc>this.prev)return r(o.finallyLoc)}else if(c){if(o.catchLoc>this.prev)return r(o.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(this.prev>=i.tryLoc&&n.call(i,"finallyLoc")&&i.finallyLoc>this.prev){var o=i;break}}o&&("break"===t||"continue"===t)&&e>=o.tryLoc&&o.finallyLoc>=e&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),E(n),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;E(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:P(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},t}function Dt(t,e,n,r,i,o,a){try{var c=t[o](a),s=c.value}catch(t){return void n(t)}c.done?e(s):Promise.resolve(s).then(r,i)}var Ft="undefined"!=typeof Float32Array?Float32Array:Array;function Yt(){var t=new Ft(9);return Ft!=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 Xt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],c=e[4],s=e[5],u=e[6],l=e[7],h=e[8],f=n[0],d=n[1],v=n[2],p=n[3],y=n[4],g=n[5],m=n[6],x=n[7],b=n[8];return t[0]=f*r+d*a+v*u,t[1]=f*i+d*c+v*l,t[2]=f*o+d*s+v*h,t[3]=p*r+y*a+g*u,t[4]=p*i+y*c+g*l,t[5]=p*o+y*s+g*h,t[6]=m*r+x*a+b*u,t[7]=m*i+x*c+b*l,t[8]=m*o+x*s+b*h,t}function Ht(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function $t(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Wt(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Ut(){var t=new Ft(16);return Ft!=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 qt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],c=e[4],s=e[5],u=e[6],l=e[7],h=e[8],f=e[9],d=e[10],v=e[11],p=e[12],y=e[13],g=e[14],m=e[15],x=n[0],b=n[1],w=n[2],E=n[3];return t[0]=x*r+b*c+w*h+E*p,t[1]=x*i+b*s+w*f+E*y,t[2]=x*o+b*u+w*d+E*g,t[3]=x*a+b*l+w*v+E*m,t[4]=(x=n[4])*r+(b=n[5])*c+(w=n[6])*h+(E=n[7])*p,t[5]=x*i+b*s+w*f+E*y,t[6]=x*o+b*u+w*d+E*g,t[7]=x*a+b*l+w*v+E*m,t[8]=(x=n[8])*r+(b=n[9])*c+(w=n[10])*h+(E=n[11])*p,t[9]=x*i+b*s+w*f+E*y,t[10]=x*o+b*u+w*d+E*g,t[11]=x*a+b*l+w*v+E*m,t[12]=(x=n[12])*r+(b=n[13])*c+(w=n[14])*h+(E=n[15])*p,t[13]=x*i+b*s+w*f+E*y,t[14]=x*o+b*u+w*d+E*g,t[15]=x*a+b*l+w*v+E*m,t}function Vt(){var t=new Ft(3);return Ft!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function zt(t,e,n){var r=new Ft(3);return r[0]=t,r[1]=e,r[2]=n,r}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});!function(){var t=Vt()}();function Qt(t,e){var n=new Ft(2);return n[0]=t,n[1]=e,n}function Jt(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t}!function(){var t=function(){var t=new Ft(2);return Ft!=Float32Array&&(t[0]=0,t[1]=0),t}()}();var Kt,Zt,te=n.Syringe.defineToken("PointInPathPicker"),ee=(Kt=function(){function t(){var t=this;this.displayObjectPool=void 0,this.canvasConfig=void 0,this.offscreenCanvas=void 0,this.rBush=void 0,this.pathGeneratorFactory=void 0,this.pointInPathPickerFactory=void 0,this.isHit=function(n,r,i){var o=t.pointInPathPickerFactory(n.nodeName);if(o){var a=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],c=e[5],s=e[6],u=e[7],l=e[8],h=e[9],f=e[10],d=e[11],v=e[12],p=e[13],y=e[14],g=e[15],m=n*c-r*a,x=n*s-i*a,b=n*u-o*a,w=r*s-i*c,E=r*u-o*c,L=i*u-o*s,P=l*p-h*v,S=l*y-f*v,C=l*g-d*v,M=h*y-f*p,k=h*g-d*p,O=f*g-d*y,T=m*O-x*k+b*M+w*C-E*S+L*P;return T?(t[0]=(c*O-s*k+u*M)*(T=1/T),t[1]=(i*k-r*O-o*M)*T,t[2]=(p*L-y*E+g*w)*T,t[3]=(f*E-h*L-d*w)*T,t[4]=(s*C-a*O-u*S)*T,t[5]=(n*O-i*C+o*S)*T,t[6]=(y*b-v*L-g*x)*T,t[7]=(l*L-f*b+d*x)*T,t[8]=(a*k-c*C+u*P)*T,t[9]=(r*C-n*k-o*P)*T,t[10]=(v*E-p*b+g*m)*T,t[11]=(h*b-l*E-d*m)*T,t[12]=(c*S-a*M-s*P)*T,t[13]=(n*M-r*S+i*P)*T,t[14]=(p*x-v*w-y*m)*T,t[15]=(l*w-h*x+f*m)*T,t):null}(Ut(),i),c=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/(a=a||1),t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}(Vt(),zt(r[0],r[1],0),a),s=n.getGeometryBounds().halfExtents,u=n.parsedStyle.anchor;if(c[0]+=(u&&u[0].value||0)*s[0]*2,c[1]+=(u&&u[1].value||0)*s[1]*2,o(n,new e.Point(c[0],c[1]),t.isPointInPath))return!0}return!1},this.isPointInPath=function(e,n){var r=t.offscreenCanvas.getOrCreateContext(t.canvasConfig.offscreenCanvas),i=t.pathGeneratorFactory(e.nodeName);return i&&i(r,e.parsedStyle),r.isPointInPath(n.x,n.y)}}return t.prototype.apply=function(t){var e=this;t.hooks.pick.tapPromise(Zt.tag,function(){var t,n=(t=Gt().mark((function t(n){var r,i,o,a,c,s,u,l,h,f,d,v,p;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=n.topmost,o=zt((i=n.position).x,i.y,0),a=e.rBush.search({minX:o[0],minY:o[1],maxX:o[0],maxY:o[1]}),c=a.map((function(t){return t.id})),s=[],a.forEach((function(t){var n=e.displayObjectPool.getByEntity(t.id);if(n.isVisible()&&!n.isCulled()&&n.isInteractive()){if(n.parentNode&&-1===c.indexOf(n.parentNode.entity))return;s.push(n)}})),s.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),u=[],l=0,h=s;case 9:if(l>=h.length){t.next=25;break}if(v=(d=(f=h[l]).parsedStyle.clipPath)||f,p=f.getWorldTransform(),d&&(p=qt(Ut(),p,d.getLocalTransform())),!e.isHit(v,o,p)){t.next=22;break}if(!r){t.next=21;break}return n.picked=[f],t.abrupt("return",n);case 21:u.push(f);case 22:l++,t.next=9;break;case 25:return n.picked=u,t.abrupt("return",n);case 27:case"end":return t.stop()}}),t)})),function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){Dt(o,r,i,a,c,"next",t)}function c(t){Dt(o,r,i,a,c,"throw",t)}a(void 0)}))});return function(t){return n.apply(this,arguments)}}())},t}(),Kt.tag="CanvasPicker",Zt=Kt);function ne(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function re(t,e){return.001>Math.abs(t-e)}function ie(t,e){var n=Math.min.apply(Math,t),r=Math.min.apply(Math,e);return{x:n,y:r,width:Math.max.apply(Math,t)-n,height:Math.max.apply(Math,e)-r}}function oe(t){return(t+2*Math.PI)%(2*Math.PI)}i([n.inject(e.DisplayObjectPool),o("design:type",e.DisplayObjectPool)],ee.prototype,"displayObjectPool",void 0),i([n.inject(e.CanvasConfig),o("design:type",Object)],ee.prototype,"canvasConfig",void 0),i([n.inject(e.OffscreenCanvasCreator),o("design:type",e.OffscreenCanvasCreator)],ee.prototype,"offscreenCanvas",void 0),i([n.inject(jt),o("design:type",b)],ee.prototype,"rBush",void 0),i([n.inject(st),o("design:type",Function)],ee.prototype,"pathGeneratorFactory",void 0),i([n.inject(te),o("design:type",Function)],ee.prototype,"pointInPathPickerFactory",void 0),ee=Zt=i([n.singleton({contrib:e.RenderingPluginContribution})],ee);var ae=function(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}},ce=function(t,e,n,r,i,o){var a=[n-t,r-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(a,[0,0]))return Math.sqrt((i-t)*(i-t)+(o-e)*(o-e));var c=[-a[1],a[0]];return function(t,e){var n=e[0],r=e[1],i=n*n+r*r;i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i}(c,c),Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}([i-t,o-e],c))};function se(t,e,n,r,i,o){var a=-1,c=1/0,s=[n,r],u=20;o&&o>200&&(u=o/10);for(var l=1/u,h=l/10,f=0;u>=f;f++){var d=f*l,v=[i.apply(void 0,t.concat([d])),i.apply(void 0,e.concat([d]))],p=ne(s[0],s[1],v[0],v[1]);c>p&&(a=d,c=p)}if(0===a)return{x:t[0],y:e[0]};if(1===a){var y=t.length;return{x:t[y-1],y:e[y-1]}}c=1/0;for(var g=0;32>g&&1e-4<=h;g++){var m=a-h,x=a+h,b=[i.apply(void 0,t.concat([m])),i.apply(void 0,e.concat([m]))],w=ne(s[0],s[1],b[0],b[1]);if(m>=0&&c>w)a=m,c=w;else{var E=[i.apply(void 0,t.concat([x])),i.apply(void 0,e.concat([x]))],L=ne(s[0],s[1],E[0],E[1]);1>=x&&c>L?(a=x,c=L):h*=.5}}return{x:i.apply(void 0,t.concat([a])),y:i.apply(void 0,e.concat([a]))}}function ue(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function le(t,e,n){var r=t+n-2*e;if(re(r,0))return[.5];var i=(t-e)/r;return i>1||0>i?[]:[i]}function he(t,e,n,r){return 2*(1-r)*(e-t)+2*r*(n-e)}function fe(t,e,n,r,i,o,a){var c=ue(t,n,i,a),s=ue(e,r,o,a),u=ae(t,e,n,r,a),l=ae(n,r,i,o,a);return[[t,e,u.x,u.y,c,s],[c,s,l.x,l.y,i,o]]}function de(t,e,n,r,i,o,a){if(0===a)return(ne(t,e,n,r)+ne(n,r,i,o)+ne(t,e,i,o))/2;var c=fe(t,e,n,r,i,o,.5),s=c[0],u=c[1];return s.push(a-1),u.push(a-1),de.apply(void 0,s)+de.apply(void 0,u)}var ve={box:function(t,e,n,r,i,o){var a=le(t,n,i)[0],c=le(e,r,o)[0],s=[t,i],u=[e,o];return void 0!==a&&s.push(ue(t,n,i,a)),void 0!==c&&u.push(ue(e,r,o,c)),ie(s,u)},length:function(t,e,n,r,i,o){return de(t,e,n,r,i,o,3)},nearestPoint:function(t,e,n,r,i,o,a,c){return se([t,n,i],[e,r,o],a,c,ue)},pointDistance:function(t,e,n,r,i,o,a,c){var s=this.nearestPoint(t,e,n,r,i,o,a,c);return ne(s.x,s.y,a,c)},interpolationAt:ue,pointAt:function(t,e,n,r,i,o,a){return{x:ue(t,n,i,a),y:ue(e,r,o,a)}},divide:function(t,e,n,r,i,o,a){return fe(t,e,n,r,i,o,a)},tangentAngle:function(t,e,n,r,i,o,a){var c=he(t,n,i,a),s=he(e,r,o,a);return oe(Math.atan2(s,c))}};function pe(t,e,n,r,i){var o=1-i;return o*o*o*t+3*e*i*o*o+3*n*i*i*o+r*i*i*i}function ye(t,e,n,r,i){var o=1-i;return 3*(o*o*(e-t)+2*o*i*(n-e)+i*i*(r-n))}function ge(t,e,n,r){var i,o,a,c=-3*t+9*e-9*n+3*r,s=6*t-12*e+6*n,u=3*e-3*t,l=[];if(re(c,0))re(s,0)||0>(i=-u/s)||i>1||l.push(i);else{var h=s*s-4*c*u;re(h,0)?l.push(-s/(2*c)):h>0&&(o=(-s-(a=Math.sqrt(h)))/(2*c),0>(i=(-s+a)/(2*c))||i>1||l.push(i),0>o||o>1||l.push(o))}return l}function me(t,e,n,r,i,o,a,c,s){var u=pe(t,n,i,a,s),l=pe(e,r,o,c,s),h=ae(t,e,n,r,s),f=ae(n,r,i,o,s),d=ae(i,o,a,c,s),v=ae(h.x,h.y,f.x,f.y,s),p=ae(f.x,f.y,d.x,d.y,s);return[[t,e,h.x,h.y,v.x,v.y,u,l],[u,l,p.x,p.y,d.x,d.y,a,c]]}function xe(t,e,n,r,i,o,a,c,s){if(0===s)return function(t,e){for(var n=0,r=t.length,i=0;r>i;i++)n+=ne(t[i],e[i],t[(i+1)%r],e[(i+1)%r]);return n/2}([t,n,i,a],[e,r,o,c]);var u=me(t,e,n,r,i,o,a,c,.5),l=[].concat(u[0],[s-1]),h=[].concat(u[1],[s-1]);return xe.apply(void 0,l)+xe.apply(void 0,h)}var be={extrema:ge,box:function(t,e,n,r,i,o,a,c){for(var s=[t,a],u=[e,c],l=ge(t,n,i,a),h=ge(e,r,o,c),f=0;l.length>f;f++)s.push(pe(t,n,i,a,l[f]));for(var d=0;h.length>d;d++)u.push(pe(e,r,o,c,h[d]));return ie(s,u)},length:function(t,e,n,r,i,o,a,c){return xe(t,e,n,r,i,o,a,c,3)},nearestPoint:function(t,e,n,r,i,o,a,c,s,u,l){return se([t,n,i,a],[e,r,o,c],s,u,pe,l)},pointDistance:function(t,e,n,r,i,o,a,c,s,u,l){var h=this.nearestPoint(t,e,n,r,i,o,a,c,s,u,l);return ne(h.x,h.y,s,u)},interpolationAt:pe,pointAt:function(t,e,n,r,i,o,a,c,s){return{x:pe(t,n,i,a,s),y:pe(e,r,o,c,s)}},divide:function(t,e,n,r,i,o,a,c,s){return me(t,e,n,r,i,o,a,c,s)},tangentAngle:function(t,e,n,r,i,o,a,c,s){var u=ye(t,n,i,a,s),l=ye(e,r,o,c,s);return oe(Math.atan2(l,u))}};function we(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function Ee(t,e,n,r,i,o){return!(t>i||i>t+n||e>o||o>e+r)}function Le(t,e,n,r,i,o,a,c){var s=(Math.atan2(c-e,a-t)+2*Math.PI)%(2*Math.PI);if(r>s||s>i)return!1;var u={x:t+n*Math.cos(s),y:e+n*Math.sin(s)};return we(u.x,u.y,a,c)<=o/2}function Pe(t,e,n,r,i,o,a){var c=i/2;return!(Math.min(t,n)-c>o||o>Math.max(t,n)+c||Math.min(e,r)-c>a||a>Math.max(e,r)+c)&&ce(t,e,n,r,o,a)<=i/2}function Se(t,e,n,r,i){var o=t.length;if(2>o)return!1;for(var a=0;o-1>a;a++){if(Pe(t[a][0],t[a][1],t[a+1][0],t[a+1][1],e,n,r))return!0}if(i){var c=t[0],s=t[o-1];if(Pe(c[0],c[1],s[0],s[1],e,n,r))return!0}return!1}function Ce(t){return 1e-6>Math.abs(t)?0:0>t?-1:1}function Me(t,e,n){return!((n[0]-t[0])*(e[1]-t[1])!=(e[0]-t[0])*(n[1]-t[1])||Math.min(t[0],e[0])>n[0]||n[0]>Math.max(t[0],e[0])||Math.min(t[1],e[1])>n[1]||n[1]>Math.max(t[1],e[1]))}function ke(t,e,n){var r=!1,i=t.length;if(2>=i)return!1;for(var o=0;i>o;o++){var a=t[o],c=t[(o+1)%i];if(Me(a,c,[e,n]))return!0;Ce(a[1]-n)>0!=Ce(c[1]-n)>0&&0>Ce(e-(n-a[1])*(a[0]-c[0])/(a[1]-c[1])-a[0])&&(r=!r)}return r}function Oe(t,e,n){for(var r=!1,i=0;t.length>i;i++){if(r=ke(t[i],e,n))break}return r}function Te(t,e){var n=t.parsedStyle,r=n.fill,i=n.stroke,o=n.clipPathTargets,a=n.r.value,c=(n.lineWidth.value+n.increasedLineWidthForHitTesting.value)/2,s=we(a,a,e.x,e.y),u=r&&!r.isNone,l=i&&!i.isNone;return u&&l||!!(null==o?void 0:o.length)?a+c>=s:u?a>=s:!!l&&(s>=a-c&&a+c>=s)}function Ne(t,e,n,r){return t/(n*n)+e/(r*r)}function je(t,e){var n=e.x,r=e.y,i=t.parsedStyle,o=i.fill,a=i.stroke,c=i.clipPathTargets,s=o&&!o.isNone,u=a&&!a.isNone,l=i.rx.value,h=i.ry.value,f=(i.lineWidth.value+i.increasedLineWidthForHitTesting.value)/2,d=(n-l)*(n-l),v=(r-h)*(r-h);return s&&u||!!(null==c?void 0:c.length)?1>=Ne(d,v,l+f,h+f):s?1>=Ne(d,v,l,h):!!u&&(Ne(d,v,l-f,h-f)>=1&&1>=Ne(d,v,l+f,h+f))}function _e(t,e){var n=t.parsedStyle,r=n.defX,i=n.defY;return Pe(n.x1.value,n.y1.value,n.x2.value,n.y2.value,n.lineWidth.value+n.increasedLineWidthForHitTesting.value,e.x+(void 0===r?0:r),e.y+(void 0===i?0:i))}function Be(t,e){var n=t.parsedStyle,r=n.stroke,i=n.lineWidth,o=n.defX,a=n.defY,c=n.clipPathTargets;return!((!r||r.isNone)&&!(null==c?void 0:c.length)||!i)&&Se(n.points.points,i.value+n.increasedLineWidthForHitTesting.value,e.x+(void 0===o?0:o),e.y+(void 0===a?0:a),!1)}function Re(t,e,n){var r=t.parsedStyle,i=r.stroke,o=r.fill,a=r.defX,c=void 0===a?0:a,s=r.defY,u=void 0===s?0:s,l=r.clipPathTargets,h=r.path,f=o&&!o.isNone,d=h.hasArc,v=h.polylines,p=h.polygons,y=!!(null==l?void 0:l.length),g=!1;return(i&&!i.isNone||y)&&(g=function(t,e,n,r,i,o,a){for(var c=!1,s=e/2,u=0;t.length>u;u++){var l=t[u],h=l.currentPoint,f=l.params,d=l.prePoint,v=l.box;if(!v||Ee(v.x-s,v.y-s,v.width+e,v.height+e,n,r)){switch(l.command){case"L":case"Z":c=Pe(d[0],d[1],h[0],h[1],e,n,r);break;case"Q":c=e/2>=ve.pointDistance(d[0],d[1],f[1],f[2],f[3],f[4],n,r);break;case"C":c=e/2>=be.pointDistance(d[0],d[1],f[1],f[2],f[3],f[4],f[5],f[6],n,r,i);break;case"A":var p=l.arcParams,y=p.cx,g=p.cy,m=p.rx,x=p.ry,b=p.startAngle,w=p.endAngle,E=p.xRotation,L=m>x?m:x,P=m>x?1:m/x,S=m>x?x/m:1,C=Ht(Yt(),[-y,-g]);Xt(C,$t(Yt(),-E),C),Xt(C,Wt(Yt(),[1/P,1/S]),C);var M=Qt(n,r);c=Le(0,0,L,b,w,e,(M=Jt(M,M,C))[0],M[1])}if(c)break}}return c}(h.segments,r.lineWidth.value+r.increasedLineWidthForHitTesting.value,e.x+c,e.y+u,h.totalLength)),g||!f&&!y||(g=d?n(t,e):Oe(p,e.x+c,e.y+u)||Oe(v,e.x+c,e.y+u)),g}function Ae(t,n,r){var i=t.parsedStyle,o=i.radius,a=i.fill,c=i.stroke,s=i.lineWidth,u=i.increasedLineWidthForHitTesting,l=i.width,h=i.height,f=i.clipPathTargets,d=!!(null==f?void 0:f.length),v=a&&!a.isNone,p=c&&!c.isNone,y=o&&o.some((function(t){return 0!==t.value})),g=l.unit,m=h.unit,x=0,b=0;g!==e.UnitType.kNumber&&g!==e.UnitType.kPixels||(x=l.value),m!==e.UnitType.kNumber&&m!==e.UnitType.kPixels||(b=h.value);var w=s.value+u.value;if(y){var E=!1;return(p||d)&&(E=function(t,e,n,r,i,o,a,c){var s=i[0],u=i[1],l=i[2],h=i[3];return Pe(t+s,e,t+n-u,e,o,a,c)||Pe(t+n,e+u,t+n,e+r-l,o,a,c)||Pe(t+n-l,e+r,t+h,e+r,o,a,c)||Pe(t,e+r-h,t,e+s,o,a,c)||Le(t+n-u,e+u,u,1.5*Math.PI,2*Math.PI,o,a,c)||Le(t+n-l,e+r-l,l,0,.5*Math.PI,o,a,c)||Le(t+h,e+r-h,h,.5*Math.PI,Math.PI,o,a,c)||Le(t+s,e+s,s,Math.PI,1.5*Math.PI,o,a,c)}(0,0,x,b,o.map((function(t){return t.value})),w,n.x,n.y)),E||!v&&!d||(E=r(t,n)),E}var L=w/2;return v&&p||d?Ee(0-L,0-L,x+L,b+L,n.x,n.y):v?Ee(0,0,x,b,n.x,n.y):!!p&&function(t,e,n,r,i,o,a){var c=i/2;return Ee(t-c,e-c,n,i,o,a)||Ee(t+n-c,e-c,i,r,o,a)||Ee(t+c,e+r-c,n,i,o,a)||Ee(t-c,e+c,i,r,o,a)}(0,0,x,b,w,n.x,n.y)}function Ie(t,e){var n=t.parsedStyle,r=n.stroke,i=n.fill,o=n.points,a=n.defX,c=void 0===a?0:a,s=n.defY,u=void 0===s?0:s,l=n.clipPathTargets,h=!!(null==l?void 0:l.length),f=i&&!i.isNone,d=!1;return(r&&!r.isNone||h)&&(d=Se(o.points,n.lineWidth.value+n.increasedLineWidthForHitTesting.value,e.x+c,e.y+u,!0)),d||!f&&!h||(d=ke(o.points,e.x+c,e.y+u)),d}var Ge,De,Fe=n.Module((function(t){t({token:te,useFactory:function(t){return function(t){return t===e.Shape.CIRCLE?Te:t===e.Shape.ELLIPSE?je:t===e.Shape.RECT?Ae:t===e.Shape.LINE?_e:t===e.Shape.POLYLINE?Be:t===e.Shape.POLYGON?Ie:t===e.Shape.PATH?Re:t===e.Shape.IMAGE||t===e.Shape.TEXT?function(){return!0}:null}}}),t(ee)})),Ye=function(){function t(){this.name="canvas-picker"}var e=t.prototype;return e.init=function(t){t.load(Fe,!0)},e.destroy=function(t){t.unload(Fe)},t}(),Xe=Object.freeze({__proto__:null,Plugin:Ye});function He(){
|
|
8
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
9
|
+
He=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i=Object.create((e&&e.prototype instanceof h?e:h).prototype),o=new L(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return S()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var c=b(a,n);if(c){if(c===l)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var s=u(t,e,n);if("normal"===s.type){if(r=n.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r="completed",n.method="throw",n.arg=s.arg)}}}(t,n,o),i}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var l={};function h(){}function f(){}function d(){}var v={};c(v,i,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(P([])));y&&y!==e&&n.call(y,i)&&(v=y);var g=d.prototype=h.prototype=Object.create(v);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(i,o,a,c){var s=u(t[i],t,o);if("throw"!==s.type){var l=s.arg,h=l.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(s.arg)}var i;this._invoke=function(t,n){function o(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(o,o):o()}}function b(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=u(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,l;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function w(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function P(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:S}}function S(){return{value:void 0,done:!0}}return f.prototype=d,c(g,"constructor",d),c(d,"constructor",f),f.displayName=c(d,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(x.prototype),c(x.prototype,o,(function(){return this})),t.AsyncIterator=x,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new x(s(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,i,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=P,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(this.prev>=o.tryLoc){var c=n.call(o,"catchLoc"),s=n.call(o,"finallyLoc");if(c&&s){if(o.catchLoc>this.prev)return r(o.catchLoc,!0);if(o.finallyLoc>this.prev)return r(o.finallyLoc)}else if(c){if(o.catchLoc>this.prev)return r(o.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(this.prev>=i.tryLoc&&n.call(i,"finallyLoc")&&i.finallyLoc>this.prev){var o=i;break}}o&&("break"===t||"continue"===t)&&e>=o.tryLoc&&o.finallyLoc>=e&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),E(n),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;E(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:P(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},t}function $e(t,e,n,r,i,o,a){try{var c=t[o](a),s=c.value}catch(t){return void n(t)}c.done?e(s):Promise.resolve(s).then(r,i)}function We(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){$e(o,r,i,a,c,"next",t)}function c(t){$e(o,r,i,a,c,"throw",t)}a(void 0)}))}}var Ue=(Ge=function(){function t(){this.contextService=void 0,this.renderingContext=void 0,this.$camera=void 0}var n=t.prototype;return n.apply=function(t){var n=this,r=function(t){var r=t.target;if(r.nodeName===e.Shape.HTML){var i=n.getOrCreateEl(r),o=r.ownerDocument.documentElement.attributes;Object.keys(o).forEach((function(t){i.style[t]=o[t]})),Object.keys(r.attributes).forEach((function(t){n.updateAttribute(t,r)}))}},i=function(t){var r=t.target;if(r.nodeName===e.Shape.HTML){var i=n.getId(r),o=n.contextService.getDomElement().parentNode;if(o){var a=o.querySelector("#"+i);a&&o.removeChild(a)}}},o=function(t){var r=t.target;r.nodeName===e.Shape.HTML&&n.updateAttribute(t.attrName,r)};t.hooks.init.tapPromise(De.tag,We(He().mark((function t(){return He().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n.renderingContext.root.addEventListener(e.ElementEvent.MOUNTED,r),n.renderingContext.root.addEventListener(e.ElementEvent.UNMOUNTED,i),n.renderingContext.root.addEventListener(e.ElementEvent.ATTR_MODIFIED,o);case 3:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(De.tag,(function(){n.renderingContext.root.removeEventListener(e.ElementEvent.MOUNTED,r),n.renderingContext.root.removeEventListener(e.ElementEvent.UNMOUNTED,i),n.renderingContext.root.removeEventListener(e.ElementEvent.ATTR_MODIFIED,o)}))},n.getId=function(t){return t.id||"g-html-"+t.entity},n.getOrCreateEl=function(t){var e=this.getId(t),n=this.contextService.getDomElement().parentNode;if(n){var r=n.querySelector("#"+e);if(!r){r=document.createElement("div"),t.parsedStyle.$el=r,r.id=e,t.name&&r.setAttribute("name",t.name),t.className&&(r.className=t.className),n.appendChild(r),r.style.position="absolute",r.style.left="0",r.style.top="0",r.style["will-change"]="transform";var i=t.getWorldTransform();r.style.transform="matrix("+[i[0],i[1],i[4],i[5],i[12],i[13]].join(",")+")"}return r}return null},n.updateAttribute=function(t,n){var r=this.getOrCreateEl(n);switch(t){case"innerHTML":var i=n.parsedStyle.innerHTML;e.isString(i)?r.innerHTML=i:(r.innerHTML="",r.appendChild(i));break;case"modelMatrix":case"transformOrigin":var o=n.parsedStyle.transformOrigin;r.style["transform-origin"]=o[0].value+" "+o[1].value;var a=n.getWorldTransform();r.style.transform="matrix("+[a[0],a[1],a[4],a[5],a[12],a[13]].join(",")+")";break;case"width":var c=n.computedStyleMap().get("width");r.style.width=""+c;break;case"height":var s=n.computedStyleMap().get("height");r.style.height=""+s;break;case"zIndex":r.style["z-index"]=""+n.parsedStyle.zIndex.value;break;case"visibility":r.style.visibility=n.parsedStyle.visibility.value;break;case"pointerEvents":r.style.pointerEvents=n.parsedStyle.pointerEvents.value;break;case"opacity":r.style.opacity=""+n.parsedStyle.opacity.value;break;case"fill":var u=n.parsedStyle.fill,l="";if(u instanceof e.CSSRGB)l=""+u;else if(u instanceof e.CSSGradientValue){if(u.type===e.GradientPatternType.LinearGradient)l="linear-gradient(to right, "+u.value.steps.map((function(t){return t[1]+" "+100*Number(t[0])+"%"})).join(",")+");"}r.style.background=l;break;case"stroke":r.style["border-color"]=""+n.parsedStyle.stroke,r.style["border-style"]="solid";break;case"lineWidth":r.style["border-width"]=(n.parsedStyle.lineWidth.value||0)+"px";break;case"lineDash":r.style["border-style"]="dashed";break;case"filter":r.style.filter=n.parsedStyle.filter}},t}(),Ge.tag="HTMLRendering",De=Ge);i([n.inject(e.ContextService),o("design:type",Object)],Ue.prototype,"contextService",void 0),i([n.inject(e.RenderingContext),o("design:type",Object)],Ue.prototype,"renderingContext",void 0),Ue=De=i([n.singleton({contrib:e.RenderingPluginContribution})],Ue);var qe=n.Module((function(t){t(Ue)})),Ve=function(){function t(){this.name="html-renderer"}var e=t.prototype;return e.init=function(t){t.load(qe,!0)},e.destroy=function(t){t.unload(qe)},t}(),ze=Object.freeze({__proto__:null,Plugin:Ve}),Qe=function(){function t(){this.$container=void 0,this.$canvas=void 0,this.dpr=void 0,this.context=void 0,this.canvasConfig=void 0}var n=t.prototype;return n.init=function(){var t=this.canvasConfig,n=t.container,r=t.canvas,i=t.devicePixelRatio;if(r)this.$canvas=r,n&&r.parentElement!==n&&n.appendChild(r),this.$container=r.parentElement,this.canvasConfig.container=this.$container;else if(n&&(this.$container=e.isString(n)?document.getElementById(n):n,this.$container)){var o=document.createElement("canvas");this.$container.appendChild(o),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=o}this.context=this.$canvas.getContext("2d");var a=i||e.isBrowser&&window.devicePixelRatio||1;this.dpr=a=1>a?1:Math.ceil(a),this.resize(this.canvasConfig.width,this.canvasConfig.height)},n.getContext=function(){return this.context},n.getDomElement=function(){return this.$canvas},n.getDPR=function(){return this.dpr},n.getBoundingClientRect=function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()},n.destroy=function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)},n.resize=function(t,n){if(this.$canvas){this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*n,e.setDOMSize(this.$canvas,t,n);var r=this.getDPR();this.context.scale(r,r)}},n.applyCursorStyle=function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)},t}();i([n.inject(e.CanvasConfig),o("design:type",Object)],Qe.prototype,"canvasConfig",void 0),Qe=i([n.singleton({token:e.ContextService})],Qe);var Je=n.Module((function(t){t(Qe)})),Ke=function(){function t(){this.name="canvas-context-register"}var e=t.prototype;return e.init=function(t){t.load(Je,!0)},e.destroy=function(t){t.unload(Je)},t}(),Ze=function(t){var e,n;function i(e){var n;return(n=t.call(this,e)||this).registerPlugin(new Ke),n.registerPlugin(new At),n.registerPlugin(new v),n.registerPlugin(new Ye),n.registerPlugin(new Ve),n}return(e=i).prototype=Object.create((n=t).prototype),e.prototype.constructor=e,r(e,n),i}(e.AbstractRenderer);t.CanvasPicker=Xe,t.CanvasRenderer=It,t.DomInteraction=p,t.HTMLRenderer=ze,t.Renderer=Ze,Object.defineProperty(t,"__esModule",{value:!0})}));
|
package/package.json
CHANGED
|
@@ -1,54 +1,50 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/g-canvas",
|
|
3
|
-
"version": "1.1.0",
|
|
3
|
+
"version": "1.1.3-alpha.0",
|
|
4
4
|
"description": "A renderer implemented by Canvas 2D API",
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
"keywords": [
|
|
6
|
+
"antv",
|
|
7
|
+
"g",
|
|
8
|
+
"renderer",
|
|
9
|
+
"Canvas2D"
|
|
10
|
+
],
|
|
11
|
+
"homepage": "https://github.com/antvis/g#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/antvis/g/issues"
|
|
14
|
+
},
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/antvis/g.git"
|
|
18
|
+
},
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"author": "https://github.com/orgs/antvis/people",
|
|
21
|
+
"main": "dist/index.js",
|
|
8
22
|
"unpkg": "dist/index.umd.min.js",
|
|
23
|
+
"module": "dist/index.esm.js",
|
|
24
|
+
"types": "dist/index.d.ts",
|
|
9
25
|
"files": [
|
|
10
26
|
"package.json",
|
|
11
27
|
"dist",
|
|
12
|
-
"es",
|
|
13
|
-
"lib",
|
|
14
28
|
"LICENSE",
|
|
15
29
|
"README.md"
|
|
16
30
|
],
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
"antv",
|
|
24
|
-
"g"
|
|
25
|
-
],
|
|
26
|
-
"publishConfig": {
|
|
27
|
-
"access": "public"
|
|
28
|
-
},
|
|
29
|
-
"author": "https://github.com/orgs/antvis/people",
|
|
30
|
-
"license": "MIT",
|
|
31
|
-
"bugs": {
|
|
32
|
-
"url": "https://github.com/antvis/g/issues"
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@antv/g-plugin-canvas-picker": "^1.1.3-alpha.0",
|
|
33
|
+
"@antv/g-plugin-canvas-renderer": "^1.1.3-alpha.0",
|
|
34
|
+
"@antv/g-plugin-dom-interaction": "^1.1.3-alpha.0",
|
|
35
|
+
"@antv/g-plugin-html-renderer": "^1.1.3-alpha.0",
|
|
36
|
+
"tslib": "^2.3.1"
|
|
33
37
|
},
|
|
34
38
|
"devDependencies": {
|
|
35
39
|
"@types/gl-matrix": "^2.4.5",
|
|
36
40
|
"@types/jest": "^25.0.0"
|
|
37
41
|
},
|
|
38
|
-
"homepage": "https://github.com/antvis/g#readme",
|
|
39
|
-
"dependencies": {
|
|
40
|
-
"@antv/g-plugin-canvas-picker": "^1.1.0",
|
|
41
|
-
"@antv/g-plugin-canvas-renderer": "^1.1.0",
|
|
42
|
-
"@antv/g-plugin-dom-interaction": "^1.1.0",
|
|
43
|
-
"@antv/g-plugin-html-renderer": "^1.1.0",
|
|
44
|
-
"tslib": "^2.3.1"
|
|
45
|
-
},
|
|
46
42
|
"peerDependencies": {
|
|
47
43
|
"@antv/g": "^5.0.1",
|
|
48
44
|
"mana-syringe": "^0.3.0"
|
|
49
45
|
},
|
|
50
|
-
"
|
|
51
|
-
"
|
|
46
|
+
"publishConfig": {
|
|
47
|
+
"access": "public"
|
|
52
48
|
},
|
|
53
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "d8b58d9c45bd5e41e47696a006aad8027c416409"
|
|
54
50
|
}
|