1&&(r*=S=Math.sqrt(S),i*=S);var E=r*r,_=i*i,O=(a===s?-1:1)*Math.sqrt(Math.abs((E*_-E*w*w-_*x*x)/(E*w*w+_*x*x)));p=O*r*w/i+(e+u)/2,g=O*-i*x/r+(n+c)/2,h=Math.asin(((n-g)/i).toFixed(9)),d=Math.asin(((c-g)/i).toFixed(9)),h=ed&&(h-=2*Math.PI),!s&&d>h&&(d-=2*Math.PI)}var k=d-h;if(Math.abs(k)>v){var M=d,A=u,T=c;d=h+v*(s&&d>h?1:-1),m=t(u=p+r*Math.cos(d),c=g+i*Math.sin(d),r,i,o,0,s,A,T,[d,M,p,g])}k=d-h;var C=Math.cos(h),I=Math.sin(h),P=Math.cos(d),j=Math.sin(d),D=Math.tan(k/4),N=4/3*r*D,R=4/3*i*D,L=[e,n],B=[e+N*I,n-R*C],G=[u+N*j,c-R*P],F=[u,c];if(B[0]=2*L[0]-B[0],B[1]=2*L[1]-B[1],f)return[B,G,F].concat(m);for(var U=[],z=0,V=(m=[B,G,F].concat(m).join().split(",")).length;z7){t[e].shift();for(var o=t[e];o.length;)s[e]="A",i&&(u[e]="A"),t.splice(e++,0,["C"].concat(o.splice(0,6)));t.splice(e,1),n=Math.max(r.length,i&&i.length||0)}},y=function(t,e,o,a,s){t&&e&&"M"===t[s][0]&&"M"!==e[s][0]&&(e.splice(s,0,["M",a.x,a.y]),o.bx=0,o.by=0,o.x=t[s][1],o.y=t[s][2],n=Math.max(r.length,i&&i.length||0))};n=Math.max(r.length,i&&i.length||0);for(var m=0;m1?1:u<0?0:u)/2,f=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],l=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],h=0,d=0;d<12;d++){var p=c*f[d]+c,g=y(p,t,n,i,a),v=y(p,e,r,o,s),m=g*g+v*v;h+=l[d]*Math.sqrt(m)}return c*h},b=function(t,e,n,r,i,o,a,s){for(var u,c,f,l,h=[],d=[[],[]],p=0;p<2;++p)if(0===p?(c=6*t-12*n+6*i,u=-3*t+9*n-9*i+3*a,f=3*n-3*t):(c=6*e-12*r+6*o,u=-3*e+9*r-9*o+3*s,f=3*r-3*e),Math.abs(u)<1e-12){if(Math.abs(c)<1e-12)continue;(l=-f/c)>0&&l<1&&h.push(l)}else{var g=c*c-4*f*u,v=Math.sqrt(g);if(!(g<0)){var y=(-c+v)/(2*u);y>0&&y<1&&h.push(y);var m=(-c-v)/(2*u);m>0&&m<1&&h.push(m)}}for(var b,x=h.length,w=x;x--;)b=1-(l=h[x]),d[0][x]=b*b*b*t+3*b*b*l*n+3*b*l*l*i+l*l*l*a,d[1][x]=b*b*b*e+3*b*b*l*r+3*b*l*l*o+l*l*l*s;return d[0][w]=t,d[1][w]=e,d[0][w+1]=a,d[1][w+1]=s,d[0].length=d[1].length=w+2,{min:{x:Math.min.apply(0,d[0]),y:Math.min.apply(0,d[1])},max:{x:Math.max.apply(0,d[0]),y:Math.max.apply(0,d[1])}}},x=function(t,e,n,r,i,o,a,s){if(!(Math.max(t,n)Math.max(i,a)||Math.max(e,r)Math.max(o,s))){var u=(t-n)*(o-s)-(e-r)*(i-a);if(u){var c=((t*r-e*n)*(i-a)-(t-n)*(i*s-o*a))/u,f=((t*r-e*n)*(o-s)-(e-r)*(i*s-o*a))/u,l=+c.toFixed(2),h=+f.toFixed(2);if(!(l<+Math.min(t,n).toFixed(2)||l>+Math.max(t,n).toFixed(2)||l<+Math.min(i,a).toFixed(2)||l>+Math.max(i,a).toFixed(2)||h<+Math.min(e,r).toFixed(2)||h>+Math.max(e,r).toFixed(2)||h<+Math.min(o,s).toFixed(2)||h>+Math.max(o,s).toFixed(2)))return{x:c,y:f}}}},w=function(t,e,n){return e>=t.x&&e<=t.x+t.width&&n>=t.y&&n<=t.y+t.height},S=function(t,e,n,r,i){if(i)return[["M",+t+ +i,e],["l",n-2*i,0],["a",i,i,0,0,1,i,i],["l",0,r-2*i],["a",i,i,0,0,1,-i,i],["l",2*i-n,0],["a",i,i,0,0,1,-i,-i],["l",0,2*i-r],["a",i,i,0,0,1,i,-i],["z"]];var o=[["M",t,e],["l",n,0],["l",0,r],["l",-n,0],["z"]];return o.parsePathArray=v,o},E=function(t,e,n,r){return null===t&&(t=e=n=r=0),null===e&&(e=t.y,n=t.width,r=t.height,t=t.x),{x:t,y:e,width:n,w:n,height:r,h:r,x2:t+n,y2:e+r,cx:t+n/2,cy:e+r/2,r1:Math.min(n,r)/2,r2:Math.max(n,r)/2,r0:Math.sqrt(n*n+r*r)/2,path:S(t,e,n,r),vb:[t,e,n,r].join(" ")}},_=function(t,e,n,i,o,a,s,u){Object(r.m)(t)||(t=[t,e,n,i,o,a,s,u]);var c=b.apply(null,t);return E(c.min.x,c.min.y,c.max.x-c.min.x,c.max.y-c.min.y)},O=function(t,e,n,r,i,o,a,s,u){var c=1-u,f=Math.pow(c,3),l=Math.pow(c,2),h=u*u,d=h*u,p=t+2*u*(n-t)+h*(i-2*n+t),g=e+2*u*(r-e)+h*(o-2*r+e),v=n+2*u*(i-n)+h*(a-2*i+n),y=r+2*u*(o-r)+h*(s-2*o+r);return{x:f*t+3*l*u*n+3*c*u*u*i+d*a,y:f*e+3*l*u*r+3*c*u*u*o+d*s,m:{x:p,y:g},n:{x:v,y:y},start:{x:c*t+u*n,y:c*e+u*r},end:{x:c*i+u*a,y:c*o+u*s},alpha:90-180*Math.atan2(p-v,g-y)/Math.PI}},k=function(t,e,n){if(!function(t,e){return t=E(t),e=E(e),w(e,t.x,t.y)||w(e,t.x2,t.y)||w(e,t.x,t.y2)||w(e,t.x2,t.y2)||w(t,e.x,e.y)||w(t,e.x2,e.y)||w(t,e.x,e.y2)||w(t,e.x2,e.y2)||(t.xe.x||e.xt.x)&&(t.ye.y||e.yt.y)}(_(t),_(e)))return n?0:[];for(var r=~~(m.apply(0,t)/8),i=~~(m.apply(0,e)/8),o=[],a=[],s={},u=n?0:[],c=0;c=0&&S<=1&&k>=0&&k<=1&&(n?u+=1:u.push({x:b.x,y:b.y,t1:S,t2:k}))}}return u},M=function(t,e){return function(t,e,n){var r,i,o,a,s,u,c,f,l,h;t=p(t),e=p(e);for(var d=n?0:[],g=0,v=t.length;g=3&&(3===t.length&&e.push("Q"),e=e.concat(t[1])),2===t.length&&e.push("L"),e=e.concat(t[t.length-1])}))}(t,e,n));else{var i=[].concat(t);"M"===i[0]&&(i[0]="L");for(var o=0;o<=n-1;o++)r.push(i)}return r},C=function(t,e){if(1===t.length)return t;var n=t.length-1,r=e.length-1,i=n/r,o=[];if(1===t.length&&"M"===t[0][0]){for(var a=0;a=0;u--)a=o[u].index,"add"===o[u].type?t.splice(a,0,[].concat(t[a])):t.splice(a,1)}var l=i-(r=t.length);if(r0)){t[r]=e[r];break}n=D(n,t[r-1],1)}t[r]=["Q"].concat(n.reduce((function(t,e){return t.concat(e)}),[]));break;case"T":t[r]=["T"].concat(n[0]);break;case"C":if(n.length<3){if(!(r>0)){t[r]=e[r];break}n=D(n,t[r-1],2)}t[r]=["C"].concat(n.reduce((function(t,e){return t.concat(e)}),[]));break;case"S":if(n.length<2){if(!(r>0)){t[r]=e[r];break}n=D(n,t[r-1],1)}t[r]=["S"].concat(n.reduce((function(t,e){return t.concat(e)}),[]));break;default:t[r]=e[r]}return t}},function(t,e,n){"use strict";n(57),n(21);var r=n(269);n.d(e,"Canvas",(function(){return r.a}));n(78),n(92)},function(t,e,n){var r=n(86),i=n(146);t.exports=function(t){return null!=t&&i(t.length)&&!r(t)}},function(t,e,n){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=n(346),o=n(356),a=n(67),s=n(29),u=n(363);t.exports=function(t){return"function"==typeof t?t:null==t?a:"object"==r(t)?s(t)?o(t[0],t[1]):i(t):u(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TargetTypeEnum=e.BindingTypeEnum=e.BindingScopeEnum=void 0;e.BindingScopeEnum={Request:"Request",Singleton:"Singleton",Transient:"Transient"};e.BindingTypeEnum={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"};e.TargetTypeEnum={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"}},function(t,e,n){"use strict";n.r(e),n.d(e,"Base",(function(){return c})),n.d(e,"Circle",(function(){return f})),n.d(e,"Ellipse",(function(){return h})),n.d(e,"Image",(function(){return p})),n.d(e,"Line",(function(){return m})),n.d(e,"Marker",(function(){return S})),n.d(e,"Path",(function(){return j})),n.d(e,"Polygon",(function(){return N})),n.d(e,"Polyline",(function(){return R})),n.d(e,"Rect",(function(){return B})),n.d(e,"Text",(function(){return G}));var r={};n.r(r),n.d(r,"Base",(function(){return c})),n.d(r,"Circle",(function(){return f})),n.d(r,"Ellipse",(function(){return h})),n.d(r,"Image",(function(){return p})),n.d(r,"Line",(function(){return m})),n.d(r,"Marker",(function(){return S})),n.d(r,"Path",(function(){return j})),n.d(r,"Polygon",(function(){return N})),n.d(r,"Polyline",(function(){return R})),n.d(r,"Rect",(function(){return B})),n.d(r,"Text",(function(){return G}));var i=n(1),o=n(21),a=n(16),s=n(30),u=n(78),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.b)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.a)(Object(i.a)({},e),{lineWidth:1,lineAppendWidth:0,strokeOpacity:1,fillOpacity:1})},e.prototype.getShapeBase=function(){return r},e.prototype.getGroupBase=function(){return u.a},e.prototype.onCanvasChange=function(t){Object(s.h)(this,t)},e.prototype.calculateBBox=function(){var t=this.get("type"),e=this.getHitLineWidth(),n=Object(o.getBBoxMethod)(t)(this),r=e/2,i=n.x-r,a=n.y-r,s=n.x+n.width+r,u=n.y+n.height+r;return{x:i,minX:i,y:a,minY:a,width:n.width+e,height:n.height+e,maxX:s,maxY:u}},e.prototype.isFill=function(){return!!this.attrs.fill||this.isClipShape()},e.prototype.isStroke=function(){return!!this.attrs.stroke},e.prototype._applyClip=function(t,e){e&&(t.save(),Object(s.a)(t,e),e.createPath(t),t.restore(),t.clip(),e._afterDraw())},e.prototype.draw=function(t,e){var n=this.cfg.clipShape;if(e){if(!1===this.cfg.refresh)return void this.set("hasChanged",!1);var r=this.getCanvasBBox();if(!Object(a.f)(e,r))return this.set("hasChanged",!1),void(this.cfg.isInView&&this._afterDraw())}t.save(),Object(s.a)(t,this),this._applyClip(t,n),this.drawPath(t),t.restore(),this._afterDraw()},e.prototype.getCanvasViewBox=function(){var t=this.cfg.canvas;return t?t.getViewRange():null},e.prototype.cacheCanvasBBox=function(){var t=this.getCanvasViewBox();if(t){var e=this.getCanvasBBox(),n=Object(a.f)(e,t);this.set("isInView",n),n?this.set("cacheCanvasBBox",e):this.set("cacheCanvasBBox",null)}},e.prototype._afterDraw=function(){this.cacheCanvasBBox(),this.set("hasChanged",!1),this.set("refresh",null)},e.prototype.skipDraw=function(){this.set("cacheCanvasBBox",null),this.set("isInView",null),this.set("hasChanged",!1)},e.prototype.drawPath=function(t){this.createPath(t),this.strokeAndFill(t),this.afterDrawPath(t)},e.prototype.fill=function(t){t.fill()},e.prototype.stroke=function(t){t.stroke()},e.prototype.strokeAndFill=function(t){var e=this.attrs,n=e.lineWidth,r=e.opacity,i=e.strokeOpacity,o=e.fillOpacity;this.isFill()&&(Object(a.i)(o)||1===o?this.fill(t):(t.globalAlpha=o,this.fill(t),t.globalAlpha=r)),this.isStroke()&&n>0&&(Object(a.i)(i)||1===i||(t.globalAlpha=i),this.stroke(t)),this.afterDrawPath(t)},e.prototype.createPath=function(t){},e.prototype.afterDrawPath=function(t){},e.prototype.isInShape=function(t,e){var n=this.isStroke(),r=this.isFill(),i=this.getHitLineWidth();return this.isInStrokeOrPath(t,e,n,r,i)},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){return!1},e.prototype.getHitLineWidth=function(){if(!this.isStroke())return 0;var t=this.attrs;return t.lineWidth+t.lineAppendWidth},e}(o.AbstractShape),f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.b)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.a)(Object(i.a)({},e),{x:0,y:0,r:0})},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){var o=this.attr(),s=o.x,u=o.y,c=o.r,f=i/2,l=Object(a.b)(s,u,t,e);return r&&n?l<=c+f:r?l<=c:!!n&&(l>=c-f&&l<=c+f)},e.prototype.createPath=function(t){var e=this.attr(),n=e.x,r=e.y,i=e.r;t.beginPath(),t.arc(n,r,i,0,2*Math.PI,!1),t.closePath()},e}(c);function l(t,e,n,r){return t/(n*n)+e/(r*r)}var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.b)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.a)(Object(i.a)({},e),{x:0,y:0,rx:0,ry:0})},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){var o=this.attr(),a=i/2,s=o.x,u=o.y,c=o.rx,f=o.ry,h=(t-s)*(t-s),d=(e-u)*(e-u);return r&&n?l(h,d,c+a,f+a)<=1:r?l(h,d,c,f)<=1:!!n&&(l(h,d,c-a,f-a)>=1&&l(h,d,c+a,f+a)<=1)},e.prototype.createPath=function(t){var e=this.attr(),n=e.x,r=e.y,i=e.rx,o=e.ry;if(t.beginPath(),t.ellipse)t.ellipse(n,r,i,o,0,0,2*Math.PI,!1);else{var a=i>o?i:o,s=i>o?1:i/o,u=i>o?o/i:1;t.save(),t.translate(n,r),t.scale(s,u),t.arc(0,0,a,0,2*Math.PI),t.restore(),t.closePath()}},e}(c);function d(t){return t instanceof HTMLElement&&Object(a.k)(t.nodeName)&&"CANVAS"===t.nodeName.toUpperCase()}var p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.b)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.a)(Object(i.a)({},e),{x:0,y:0,width:0,height:0})},e.prototype.initAttrs=function(t){this._setImage(t.img)},e.prototype.isStroke=function(){return!1},e.prototype.isOnlyHitBox=function(){return!0},e.prototype._afterLoading=function(){if(!0===this.get("toDraw")){var t=this.get("canvas");t?t.draw():this.createPath(this.get("context"))}},e.prototype._setImage=function(t){var e=this,n=this.attrs;if(Object(a.k)(t)){var r=new Image;r.onload=function(){if(e.destroyed)return!1;e.attr("img",r),e.set("loading",!1),e._afterLoading();var t=e.get("callback");t&&t.call(e)},r.crossOrigin="Anonymous",r.src=t,this.set("loading",!0)}else t instanceof Image?(n.width||(n.width=t.width),n.height||(n.height=t.height)):d(t)&&(n.width||(n.width=Number(t.getAttribute("width"))),n.height||(n.height,Number(t.getAttribute("height"))))},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),"img"===e&&this._setImage(n)},e.prototype.createPath=function(t){if(this.get("loading"))return this.set("toDraw",!0),void this.set("context",t);var e=this.attr(),n=e.x,r=e.y,i=e.width,o=e.height,s=e.sx,u=e.sy,c=e.swidth,f=e.sheight,l=e.img;(l instanceof Image||d(l))&&(Object(a.i)(s)||Object(a.i)(u)||Object(a.i)(c)||Object(a.i)(f)?t.drawImage(l,n,r,i,o):t.drawImage(l,s,u,c,f,n,r,i,o))},e}(c),g=n(20);function v(t,e,n,r,i,o,a){var s=Math.min(t,n),u=Math.max(t,n),c=Math.min(e,r),f=Math.max(e,r),l=i/2;return o>=s-l&&o<=u+l&&a>=c-l&&a<=f+l&&g.c.pointToLine(t,e,n,r,o,a)<=i/2}var y=n(33),m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.b)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.a)(Object(i.a)({},e),{x1:0,y1:0,x2:0,y2:0,startArrow:!1,endArrow:!1})},e.prototype.initAttrs=function(t){this.setArrow()},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),this.setArrow()},e.prototype.setArrow=function(){var t=this.attr(),e=t.x1,n=t.y1,r=t.x2,i=t.y2,o=t.startArrow,a=t.endArrow;o&&y.b(this,t,r,i,e,n),a&&y.a(this,t,e,n,r,i)},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){if(!n||!i)return!1;var o=this.attr();return v(o.x1,o.y1,o.x2,o.y2,i,t,e)},e.prototype.createPath=function(t){var e=this.attr(),n=e.x1,r=e.y1,i=e.x2,o=e.y2,a=e.startArrow,s=e.endArrow,u={dx:0,dy:0},c={dx:0,dy:0};a&&a.d&&(u=y.c(n,r,i,o,e.startArrow.d)),s&&s.d&&(c=y.c(n,r,i,o,e.endArrow.d)),t.beginPath(),t.moveTo(n+u.dx,r+u.dy),t.lineTo(i-c.dx,o-c.dy)},e.prototype.afterDrawPath=function(t){var e=this.get("startArrowShape"),n=this.get("endArrowShape");e&&e.draw(t),n&&n.draw(t)},e.prototype.getTotalLength=function(){var t=this.attr(),e=t.x1,n=t.y1,r=t.x2,i=t.y2;return g.c.length(e,n,r,i)},e.prototype.getPoint=function(t){var e=this.attr(),n=e.x1,r=e.y1,i=e.x2,o=e.y2;return g.c.pointAt(n,r,i,o,t)},e}(c),b=n(0),x=n(38),w={circle:function(t,e,n){return[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e]]},square:function(t,e,n){return[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]]},diamond:function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]},triangle:function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]},"triangle-down":function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]}},S=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.b)(e,t),e.prototype.initAttrs=function(t){this._resetParamsCache()},e.prototype._resetParamsCache=function(){this.set("paramsCache",{})},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),-1!==["symbol","x","y","r","radius"].indexOf(e)&&this._resetParamsCache()},e.prototype.isOnlyHitBox=function(){return!0},e.prototype._getR=function(t){return Object(b.s)(t.r)?t.radius:t.r},e.prototype._getPath=function(){var t,n,r=this.attr(),i=r.x,o=r.y,s=r.symbol||"circle",u=this._getR(r);if(Object(a.h)(s))n=(t=s)(i,o,u),n=Object(x.c)(n);else{if(!(t=e.Symbols[s]))return console.warn(s+" marker is not supported."),null;n=t(i,o,u)}return n},e.prototype.createPath=function(t){var e=this._getPath(),n=this.get("paramsCache");Object(s.e)(this,t,{path:e},n)},e.Symbols=w,e}(c);function E(t,e,n){var r=Object(o.getOffScreenContext)();return t.createPath(r),r.isPointInPath(e,n)}function _(t){return Math.abs(t)<1e-6?0:t<0?-1:1}function O(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 k(t,e,n){var r=!1,i=t.length;if(i<=2)return!1;for(var o=0;o0!=_(s[1]-n)>0&&_(e-(n-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(r=!r)}return r}var M=n(18),A=n(40);function T(t,e,n,r,i,o,s,u){var c=(Math.atan2(u-e,s-t)+2*Math.PI)%(2*Math.PI);if(ci)return!1;var f={x:t+n*Math.cos(c),y:e+n*Math.sin(c)};return Object(a.b)(f.x,f.y,s,u)<=o/2}var C=M.a.transform;var I=Object(i.a)({hasArc:function(t){for(var e=!1,n=t.length,r=0;r0&&r.push(i),{polygons:n,polylines:r}},isPointInStroke:function(t,e,n,r,i){for(var o=!1,s=e/2,u=0;ux?b:x,k=C(null,[["t",-y,-m],["r",-E],["s",1/(b>x?1:b/x),1/(b>x?x/b:1)]]);A.transformMat3(_,_,k),o=T(0,0,O,w,S,e,_[0],_[1])}if(o)break}}return o}},o.PathUtil);function P(t,e,n){for(var r=!1,i=0;i=r[0]&&t<=r[1]&&(e=(t-r[0])/(r[1]-r[0]),n=i)}));var o=i[n];if(Object(b.s)(o)||Object(b.s)(n))return null;var a=o.length,s=i[n+1];return g.b.pointAt(o[a-2],o[a-1],s[1],s[2],s[3],s[4],s[5],s[6],e)},e.prototype._calculateCurve=function(){var t=this.attr().path;this.set("curve",I.pathToCurve(t))},e.prototype._setTcache=function(){var t,e,n,r,i=0,o=0,a=[],s=this.get("curve");s&&(Object(b.f)(s,(function(t,e){n=s[e+1],r=t.length,n&&(i+=g.b.length(t[r-2],t[r-1],n[1],n[2],n[3],n[4],n[5],n[6])||0)})),this.set("totalLength",i),0!==i?(Object(b.f)(s,(function(u,c){n=s[c+1],r=u.length,n&&((t=[])[0]=o/i,e=g.b.length(u[r-2],u[r-1],n[1],n[2],n[3],n[4],n[5],n[6]),o+=e||0,t[1]=o/i,a.push(t))})),this.set("tCache",a)):this.set("tCache",[]))},e.prototype.getStartTangent=function(){var t,e=this.getSegments();if(e.length>1){var n=e[0].currentPoint,r=e[1].currentPoint,i=e[1].startTangent;t=[],i?(t.push([n[0]-i[0],n[1]-i[1]]),t.push([n[0],n[1]])):(t.push([r[0],r[1]]),t.push([n[0],n[1]]))}return t},e.prototype.getEndTangent=function(){var t,e=this.getSegments(),n=e.length;if(n>1){var r=e[n-2].currentPoint,i=e[n-1].currentPoint,o=e[n-1].endTangent;t=[],o?(t.push([i[0]-o[0],i[1]-o[1]]),t.push([i[0],i[1]])):(t.push([r[0],r[1]]),t.push([i[0],i[1]]))}return t},e}(c);function D(t,e,n,r,i){var o=t.length;if(o<2)return!1;for(var a=0;a=r[0]&&t<=r[1]&&(e=(t-r[0])/(r[1]-r[0]),n=i)})),g.c.pointAt(r[n][0],r[n][1],r[n+1][0],r[n+1][1],e)},e.prototype._setTcache=function(){var t=this.attr().points;if(t&&0!==t.length){var e=this.getTotalLength();if(!(e<=0)){var n,r,i=0,o=[];Object(b.f)(t,(function(a,s){t[s+1]&&((n=[])[0]=i/e,r=g.c.length(a[0],a[1],t[s+1][0],t[s+1][1]),i+=r,n[1]=i/e,o.push(n))})),this.set("tCache",o)}}},e.prototype.getStartTangent=function(){var t=this.attr().points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},e.prototype.getEndTangent=function(){var t=this.attr().points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},e}(c),L=n(140);var B=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.b)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.a)(Object(i.a)({},e),{x:0,y:0,width:0,height:0,radius:0})},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){var o=this.attr(),s=o.x,u=o.y,c=o.width,f=o.height,l=o.radius;if(l){var h=!1;return n&&(h=function(t,e,n,r,i,o,a,s){return v(t+i,e,t+n-i,e,o,a,s)||v(t+n,e+i,t+n,e+r-i,o,a,s)||v(t+n-i,e+r,t+i,e+r,o,a,s)||v(t,e+r-i,t,e+i,o,a,s)||T(t+n-i,e+i,i,1.5*Math.PI,2*Math.PI,o,a,s)||T(t+n-i,e+r-i,i,0,.5*Math.PI,o,a,s)||T(t+i,e+r-i,i,.5*Math.PI,Math.PI,o,a,s)||T(t+i,e+i,i,Math.PI,1.5*Math.PI,o,a,s)}(s,u,c,f,l,i,t,e)),!h&&r&&(h=E(this,t,e)),h}var d=i/2;return r&&n?Object(a.e)(s-d,u-d,c+d,f+d,t,e):r?Object(a.e)(s,u,c,f,t,e):n?function(t,e,n,r,i,o,s){var u=i/2;return Object(a.e)(t-u,e-u,n,i,o,s)||Object(a.e)(t+n-u,e-u,i,r,o,s)||Object(a.e)(t+u,e+r-u,n,i,o,s)||Object(a.e)(t-u,e+u,i,r,o,s)}(s,u,c,f,i,t,e):void 0},e.prototype.createPath=function(t){var e=this.attr(),n=e.x,r=e.y,i=e.width,o=e.height,a=e.radius;if(t.beginPath(),0===a)t.rect(n,r,i,o);else{var s=Object(L.a)(a),u=s[0],c=s[1],f=s[2],l=s[3];t.moveTo(n+u,r),t.lineTo(n+i-c,r),0!==c&&t.arc(n+i-c,r+c,c,-Math.PI/2,0),t.lineTo(n+i,r+o-f),0!==f&&t.arc(n+i-f,r+o-f,f,0,Math.PI/2),t.lineTo(n+l,r+o),0!==l&&t.arc(n+l,r+o-l,l,Math.PI/2,Math.PI),t.lineTo(n,r+u),0!==u&&t.arc(n+u,r+u,u,Math.PI,1.5*Math.PI),t.closePath()}},e}(c),G=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.b)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.a)(Object(i.a)({},e),{x:0,y:0,text:null,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom"})},e.prototype.isOnlyHitBox=function(){return!0},e.prototype.initAttrs=function(t){this._assembleFont(),t.text&&this._setText(t.text)},e.prototype._assembleFont=function(){var t=this.attrs;t.font=Object(o.assembleFont)(t)},e.prototype._setText=function(t){var e=null;Object(a.k)(t)&&-1!==t.indexOf("\\n")&&(e=t.split("\\n")),this.set("textArr",e)},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),e.startsWith("font")&&this._assembleFont(),"text"===e&&this._setText(n)},e.prototype._getSpaceingY=function(){var t=this.attrs,e=t.lineHeight,n=1*t.fontSize;return e?e-n:.14*n},e.prototype._drawTextArr=function(t,e,n){var r,i=this.attrs,s=i.textBaseline,u=i.x,c=i.y,f=1*i.fontSize,l=this._getSpaceingY(),h=Object(o.getTextHeight)(i.text,i.fontSize,i.lineHeight);Object(a.c)(e,(function(e,i){r=c+i*(l+f)-h+f,"middle"===s&&(r+=h-f-(h-f)/2),"top"===s&&(r+=h-f),n?t.fillText(e,u,r):t.strokeText(e,u,r)}))},e.prototype._drawText=function(t,e){var n=this.attr(),r=n.x,i=n.y,o=this.get("textArr");if(o)this._drawTextArr(t,o,e);else{var a=n.text;e?t.fillText(a,r,i):t.strokeText(a,r,i)}},e.prototype.strokeAndFill=function(t){var e=this.attrs,n=e.lineWidth,r=e.opacity,i=e.strokeOpacity,o=e.fillOpacity;this.isStroke()&&n>0&&(Object(a.i)(i)||1===i||(t.globalAlpha=r),this.stroke(t)),this.isFill()&&(Object(a.i)(o)||1===o?this.fill(t):(t.globalAlpha=o,this.fill(t),t.globalAlpha=r)),this.afterDrawPath(t)},e.prototype.fill=function(t){this._drawText(t,!0)},e.prototype.stroke=function(t){this._drawText(t,!1)},e}(c)},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return h}));var r,i=n(62),o=n.n(i),a=n(6),s=n.n(a),u=n(7),c=n.n(u),f=n(2),l=n(127);!function(t){t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE"}(r||(r={}));var h=function(){function t(e){if(s()(this,t),this.planes=[],e)this.planes=e;else for(var n=0;n<6;n++)this.planes.push(new l.a)}return c()(t,[{key:"extractFromVPMatrix",value:function(t){var e=o()(t,16),n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],d=e[9],p=e[10],g=e[11],v=e[12],y=e[13],m=e[14],b=e[15];f.e.set(this.planes[0].normal,a-n,l-s,g-h),this.planes[0].distance=-(b-v),f.e.set(this.planes[1].normal,a+n,l+s,g+h),this.planes[1].distance=-(b+v),f.e.set(this.planes[2].normal,a+r,l+u,g+d),this.planes[2].distance=-(b+y),f.e.set(this.planes[3].normal,a-r,l-u,g-d),this.planes[3].distance=-(b-y),f.e.set(this.planes[4].normal,a-i,l-c,g-p),this.planes[4].distance=-(b-m),f.e.set(this.planes[5].normal,a+i,l+c,g+p),this.planes[5].distance=-(b+m),this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))}}]),t}()},function(t,e,n){var r=n(74),i=n(302),o=n(303),a=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?i(t):o(t)}},function(t,e,n){var r=n(182),i=n(148),o=n(54);t.exports=function(t){return o(t)?r(t):i(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tagProperty=e.tagParameter=e.decorate=void 0;var r=n(41),i=n(31);function o(t,e,n,i,o){var a={},s="number"==typeof o,u=void 0!==o&&s?o.toString():n;if(s&&void 0!==n)throw new Error(r.INVALID_DECORATOR_OPERATION);Reflect.hasOwnMetadata(t,e)&&(a=Reflect.getMetadata(t,e));var c=a[u];if(Array.isArray(c))for(var f=0,l=c;f1?e*i+function(t,e){return e?e-t:.14*t}(e,n)*(i-1):e}function a(t,e){var n=Object(i.a)(),o=0;if(Object(r.e)(t)||""===t)return o;if(n.save(),n.font=e,Object(r.h)(t)&&t.includes("\\n")){var a=t.split("\\n");Object(r.a)(a,(function(t){var e=n.measureText(t).width;o=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function j(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nl||d<0||p>h||p<0))return c(e.pickingFBO,(function(){0===(r=u({x:Math.round(d),y:Math.round(h-(a+1)*window.devicePixelRatio),width:1,height:1,data:new Uint8Array(4),framebuffer:e.pickingFBO}))[0]&&0===r[1]&&0===r[2]||(i=Object(C.a)(r),e.highlightEnabled&&e.highlightPickedFeature(r,n))})),i}}return O()(t,[{key:"enableHighlight",value:function(t){this.highlightEnabled=t}},{key:"setHighlightColor",value:function(t){this.highlightColor=t}},{key:"highlightPickedFeature",value:function(t,e){if(t){var n,r=P(e.getScene().getEntities());try{for(r.s();!(n=r.n()).done;){var i=n.value,o=this.mesh.getComponentByEntity(i).material;o.setUniform("u_PickingStage",N),o.setUniform("u_PickingColor",[t[0],t[1],t[2]]),o.setUniform("u_HighlightColor",this.highlightColor)}}catch(t){r.e(t)}finally{r.f()}}}}]),t}(),p.IDENTIFIER="PixelPicking Pass",c=g,f=M()(c.prototype,"engine",[i],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),l=M()(c.prototype,"resourcePool",[o],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),h=M()(c.prototype,"renderPassFactory",[a],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),d=M()(c.prototype,"mesh",[s],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),u=c))||u)},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return a}));var r=n(34),i=n(25);function o(t,e){e.forEach((function(e){e.draw(t)}))}function a(t,e){var n=t.get("canvas");if(n&&n.get("autoDraw")){var o=n.get("context"),a=t.getParent(),s=a?a.getChildren():[n],u=t.get("el");if("remove"===e)if(t.get("isClipShape")){var c=u&&u.parentNode,f=c&&c.parentNode;c&&f&&f.removeChild(c)}else u&&u.parentNode&&u.parentNode.removeChild(u);else if("show"===e)u.setAttribute("visibility","visible");else if("hide"===e)u.setAttribute("visibility","hidden");else if("zIndex"===e)Object(i.c)(u,s.indexOf(t));else if("sort"===e){var l=t.get("children");l&&l.length&&Object(i.d)(t,(function(t,e){return l.indexOf(t)-l.indexOf(e)?1:0}))}else"clear"===e?u&&(u.innerHTML=""):"matrix"===e?Object(r.c)(t):"clip"===e?Object(r.a)(t,o):"attr"===e||"add"===e&&t.draw(o)}}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,n){var r=n(45).Symbol;t.exports=r},function(t,e,n){(function(t){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=n(45),o=n(322),a="object"==r(e)&&e&&!e.nodeType&&e,s=a&&"object"==r(t)&&t&&!t.nodeType&&t,u=s&&s.exports===a?i.Buffer:void 0,c=(u?u.isBuffer:void 0)||o;t.exports=c}).call(this,n(72)(t))},function(t,e,n){var r=n(331),i=n(143),o=n(332),a=n(191),s=n(333),u=n(59),c=n(180),f=c(r),l=c(i),h=c(o),d=c(a),p=c(s),g=u;(r&&"[object DataView]"!=g(new r(new ArrayBuffer(1)))||i&&"[object Map]"!=g(new i)||o&&"[object Promise]"!=g(o.resolve())||a&&"[object Set]"!=g(new a)||s&&"[object WeakMap]"!=g(new s))&&(g=function(t){var e=u(t),n="[object Object]"==e?t.constructor:void 0,r=n?c(n):"";if(r)switch(r){case f:return"[object DataView]";case l:return"[object Map]";case h:return"[object Promise]";case d:return"[object Set]";case p:return"[object WeakMap]"}return e}),t.exports=g},function(t,e,n){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=n(59),o=n(46);t.exports=function(t){return"symbol"==r(t)||o(t)&&"[object Symbol]"==i(t)}},function(t,e,n){"use strict";var r=n(1),i=n(21),o=n(57),a=n(30),s=n(0),u=n(16),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(r.b)(e,t),e.prototype.onCanvasChange=function(t){Object(a.h)(this,t)},e.prototype.getShapeBase=function(){return o},e.prototype.getGroupBase=function(){return e},e.prototype._applyClip=function(t,e){e&&(t.save(),Object(a.a)(t,e),e.createPath(t),t.restore(),t.clip(),e._afterDraw())},e.prototype.cacheCanvasBBox=function(){var t=this.cfg.children,e=[],n=[];Object(s.f)(t,(function(t){var r=t.cfg.cacheCanvasBBox;r&&t.cfg.isInView&&(e.push(r.minX,r.maxX),n.push(r.minY,r.maxY))}));var r=null;if(e.length){var i=Math.min.apply(null,e),o=Math.max.apply(null,e),a=Math.min.apply(null,n),c=Math.max.apply(null,n);r={minX:i,minY:a,x:i,y:a,maxX:o,maxY:c,width:o-i,height:c-a};var f=this.cfg.canvas;if(f){var l=f.getViewRange();this.set("isInView",Object(u.f)(r,l))}}else this.set("isInView",!1);this.set("cacheCanvasBBox",r)},e.prototype.draw=function(t,e){var n=this.cfg.children,r=!e||this.cfg.refresh;n.length&&r&&(t.save(),Object(a.a)(t,this),this._applyClip(t,this.getClip()),Object(a.d)(t,n,e),t.restore(),this.cacheCanvasBBox()),this.cfg.refresh=null,this.set("hasChanged",!1)},e.prototype.skipDraw=function(){this.set("cacheCanvasBBox",null),this.set("hasChanged",!1)},e}(i.AbstractGroup);e.a=c},function(t,e,n){"use strict";var r=n(1),i=n(21),o=n(0),a=n(81),s=n(71),u=n(34),c=n(15),f=n(25),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(r.b)(e,t),e.prototype.isEntityGroup=function(){return!0},e.prototype.createDom=function(){var t=Object(f.b)("g");this.set("el",t);var e=this.getParent();if(e){var n=e.get("el");n||(n=e.createDom(),e.set("el",n)),n.appendChild(t)}return t},e.prototype.afterAttrsChange=function(e){t.prototype.afterAttrsChange.call(this,e);var n=this.get("canvas");if(n&&n.get("autoDraw")){var r=n.get("context");this.createPath(r,e)}},e.prototype.onCanvasChange=function(t){Object(s.b)(this,t)},e.prototype.getShapeBase=function(){return a},e.prototype.getGroupBase=function(){return e},e.prototype.draw=function(t){var e=this.getChildren(),n=this.get("el");this.get("destroyed")?n&&n.parentNode.removeChild(n):(n||this.createDom(),Object(u.a)(this,t),this.createPath(t),e.length&&Object(s.a)(t,e))},e.prototype.createPath=function(t,e){var n=this.attr(),r=this.get("el");Object(o.f)(e||n,(function(t,e){c.b[e]&&r.setAttribute(c.b[e],t)})),Object(u.c)(this)},e}(i.AbstractGroup);e.a=l},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(6),i=n.n(r),o=n(7),a=n.n(o),s=n(2),u=function(){function t(e,n){i()(this,t),this.center=void 0,this.halfExtents=void 0,this.min=s.e.create(),this.max=s.e.create(),this.update(e,n)}return a()(t,[{key:"update",value:function(t,e){this.center=t||s.e.create(),this.halfExtents=e||s.e.fromValues(.5,.5,.5),this.min=s.e.sub(this.min,this.center,this.halfExtents),this.max=s.e.add(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(t,e){s.e.add(this.center,e,t),s.e.scale(this.center,this.center,.5),s.e.sub(this.halfExtents,e,t),s.e.scale(this.halfExtents,this.halfExtents,.5),s.e.copy(this.min,t),s.e.copy(this.max,e)}},{key:"getMin",value:function(){return this.min}},{key:"getMax",value:function(){return this.max}},{key:"add",value:function(t){var e=this.center,n=e[0],r=e[1],i=e[2],o=this.halfExtents,a=o[0],s=o[1],u=o[2],c=n-a,f=n+a,l=r-s,h=r+s,d=i-u,p=i+u,g=t.center,v=g[0],y=g[1],m=g[2],b=t.halfExtents,x=b[0],w=b[1],S=b[2],E=v-x,_=v+x,O=y-w,k=y+w,M=m-S,A=m+S;Ef&&(f=_),Oh&&(h=k),Mp&&(p=A),e[0]=.5*(c+f),e[1]=.5*(l+h),e[2]=.5*(d+p),o[0]=.5*(f-c),o[1]=.5*(h-l),o[2]=.5*(p-d),this.min[0]=c,this.min[1]=l,this.min[2]=d,this.max[0]=f,this.max[1]=h,this.max[2]=p}},{key:"intersects",value:function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),i=t.getMin();return n[0]<=r[0]&&e[0]>=i[0]&&n[1]<=r[1]&&e[1]>=i[1]&&n[2]<=r[2]&&e[2]>=i[2]}},{key:"containsPoint",value:function(t){var e=this.getMin(),n=this.getMax();return!(t[0]n[0]||t[1]n[1]||t[2]n[2])}},{key:"getNegativeFarPoint",value:function(t){return 273===t.pnVertexFlag?s.e.copy(s.e.create(),this.min):272===t.pnVertexFlag?s.e.fromValues(this.min[0],this.min[1],this.max[2]):257===t.pnVertexFlag?s.e.fromValues(this.min[0],this.max[1],this.min[2]):256===t.pnVertexFlag?s.e.fromValues(this.min[0],this.max[1],this.max[2]):17===t.pnVertexFlag?s.e.fromValues(this.max[0],this.min[1],this.min[2]):16===t.pnVertexFlag?s.e.fromValues(this.max[0],this.min[1],this.max[2]):1===t.pnVertexFlag?s.e.fromValues(this.max[0],this.max[1],this.min[2]):s.e.fromValues(this.max[0],this.max[1],this.max[2])}},{key:"getPositiveFarPoint",value:function(t){return 273===t.pnVertexFlag?s.e.copy(s.e.create(),this.max):272===t.pnVertexFlag?s.e.fromValues(this.max[0],this.max[1],this.min[2]):257===t.pnVertexFlag?s.e.fromValues(this.max[0],this.min[1],this.max[2]):256===t.pnVertexFlag?s.e.fromValues(this.max[0],this.min[1],this.min[2]):17===t.pnVertexFlag?s.e.fromValues(this.min[0],this.max[1],this.max[2]):16===t.pnVertexFlag?s.e.fromValues(this.min[0],this.max[1],this.min[2]):1===t.pnVertexFlag?s.e.fromValues(this.min[0],this.min[1],this.max[2]):s.e.fromValues(this.min[0],this.min[1],this.min[2])}}]),t}()},function(t,e,n){"use strict";n.r(e),n.d(e,"Base",(function(){return l})),n.d(e,"Circle",(function(){return d})),n.d(e,"Dom",(function(){return p})),n.d(e,"Ellipse",(function(){return g})),n.d(e,"Image",(function(){return v})),n.d(e,"Line",(function(){return m})),n.d(e,"Marker",(function(){return w})),n.d(e,"Path",(function(){return S})),n.d(e,"Polygon",(function(){return E})),n.d(e,"Polyline",(function(){return _})),n.d(e,"Rect",(function(){return O})),n.d(e,"Text",(function(){return C}));var r={};n.r(r),n.d(r,"Base",(function(){return l})),n.d(r,"Circle",(function(){return d})),n.d(r,"Dom",(function(){return p})),n.d(r,"Ellipse",(function(){return g})),n.d(r,"Image",(function(){return v})),n.d(r,"Line",(function(){return m})),n.d(r,"Marker",(function(){return w})),n.d(r,"Path",(function(){return S})),n.d(r,"Polygon",(function(){return E})),n.d(r,"Polyline",(function(){return _})),n.d(r,"Rect",(function(){return O})),n.d(r,"Text",(function(){return C}));var i=n(1),o=n(21),a=n(34),s=n(25),u=n(71),c=n(15),f=n(79),l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="svg",e.canFill=!1,e.canStroke=!1,e}return Object(i.b)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.a)(Object(i.a)({},e),{lineWidth:1,lineAppendWidth:0,strokeOpacity:1,fillOpacity:1})},e.prototype.afterAttrsChange=function(e){t.prototype.afterAttrsChange.call(this,e);var n=this.get("canvas");if(n&&n.get("autoDraw")){var r=n.get("context");this.draw(r,e)}},e.prototype.getShapeBase=function(){return r},e.prototype.getGroupBase=function(){return f.a},e.prototype.onCanvasChange=function(t){Object(u.b)(this,t)},e.prototype.calculateBBox=function(){var t=this.get("el"),e=null;if(t)e=t.getBBox();else{var n=Object(o.getBBoxMethod)(this.get("type"));n&&(e=n(this))}if(e){var r=e.x,i=e.y,a=e.width,s=e.height,u=this.getHitLineWidth(),c=u/2,f=r-c,l=i-c;return{x:f,y:l,minX:f,minY:l,maxX:r+a+c,maxY:i+s+c,width:a+u,height:s+u}}return{x:0,y:0,minX:0,minY:0,maxX:0,maxY:0,width:0,height:0}},e.prototype.isFill=function(){var t=this.attr(),e=t.fill,n=t.fillStyle;return(e||n||this.isClipShape())&&this.canFill},e.prototype.isStroke=function(){var t=this.attr(),e=t.stroke,n=t.strokeStyle;return(e||n)&&this.canStroke},e.prototype.draw=function(t,e){var n=this.get("el");this.get("destroyed")?n&&n.parentNode.removeChild(n):(n||Object(s.a)(this),Object(a.a)(this,t),this.createPath(t,e),this.shadow(t,e),this.strokeAndFill(t,e),this.transform(e))},e.prototype.createPath=function(t,e){},e.prototype.strokeAndFill=function(t,e){var n=e||this.attr(),r=n.fill,i=n.fillStyle,o=n.stroke,a=n.strokeStyle,s=n.fillOpacity,u=n.strokeOpacity,f=n.lineWidth,l=this.get("el");this.canFill&&(e?"fill"in n?this._setColor(t,"fill",r):"fillStyle"in n&&this._setColor(t,"fill",i):this._setColor(t,"fill",r||i),s&&l.setAttribute(c.b.fillOpacity,s)),this.canStroke&&f>0&&(e?"stroke"in n?this._setColor(t,"stroke",o):"strokeStyle"in n&&this._setColor(t,"stroke",a):this._setColor(t,"stroke",o||a),u&&l.setAttribute(c.b.strokeOpacity,u),f&&l.setAttribute(c.b.lineWidth,f))},e.prototype._setColor=function(t,e,n){var r=this.get("el");if(n)if(n=n.trim(),/^[r,R,L,l]{1}[\\s]*\\(/.test(n))(i=t.find("gradient",n))||(i=t.addGradient(n)),r.setAttribute(c.b[e],"url(#"+i+")");else if(/^[p,P]{1}[\\s]*\\(/.test(n)){var i;(i=t.find("pattern",n))||(i=t.addPattern(n)),r.setAttribute(c.b[e],"url(#"+i+")")}else r.setAttribute(c.b[e],n);else r.setAttribute(c.b[e],"none")},e.prototype.shadow=function(t,e){var n=this.attr(),r=e||n,i=r.shadowOffsetX,o=r.shadowOffsetY,s=r.shadowBlur,u=r.shadowColor;(i||o||s||u)&&Object(a.b)(this,t)},e.prototype.transform=function(t){var e=this.attr();(t||e).matrix&&Object(a.c)(this)},e.prototype.isInShape=function(t,e){return this.isPointInPath(t,e)},e.prototype.isPointInPath=function(t,e){var n=this.get("el"),r=this.get("canvas").get("el").getBoundingClientRect(),i=t+r.left,o=e+r.top,a=document.elementFromPoint(i,o);return!(!a||!a.isEqualNode(n))},e.prototype.getHitLineWidth=function(){var t=this.attrs,e=t.lineWidth,n=t.lineAppendWidth;return this.isStroke()?e+n:0},e}(o.AbstractShape),h=n(0),d=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="circle",e.canFill=!0,e.canStroke=!0,e}return Object(i.b)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.a)(Object(i.a)({},e),{x:0,y:0,r:0})},e.prototype.createPath=function(t,e){var n=this.attr(),r=this.get("el");Object(h.f)(e||n,(function(t,e){"x"===e||"y"===e?r.setAttribute("c"+e,t):c.b[e]&&r.setAttribute(c.b[e],t)}))},e}(l),p=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="dom",e.canFill=!1,e.canStroke=!1,e}return Object(i.b)(e,t),e.prototype.createPath=function(t,e){var n=this.attr(),r=this.get("el");if(Object(h.f)(e||n,(function(t,e){c.b[e]&&r.setAttribute(c.b[e],t)})),"function"==typeof n.html){var i=n.html.call(this,n);if(i instanceof Element||i instanceof HTMLDocument){for(var o=r.childNodes,a=o.length-1;a>=0;a--)r.removeChild(o[a]);r.appendChild(i)}else r.innerHTML=i}else r.innerHTML=n.html},e}(l),g=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="ellipse",e.canFill=!0,e.canStroke=!0,e}return Object(i.b)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.a)(Object(i.a)({},e),{x:0,y:0,rx:0,ry:0})},e.prototype.createPath=function(t,e){var n=this.attr(),r=this.get("el");Object(h.f)(e||n,(function(t,e){"x"===e||"y"===e?r.setAttribute("c"+e,t):c.b[e]&&r.setAttribute(c.b[e],t)}))},e}(l),v=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="image",e.canFill=!1,e.canStroke=!1,e}return Object(i.b)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.a)(Object(i.a)({},e),{x:0,y:0,width:0,height:0})},e.prototype.createPath=function(t,e){var n=this,r=this.attr(),i=this.get("el");Object(h.f)(e||r,(function(t,e){"img"===e?n._setImage(r.img):c.b[e]&&i.setAttribute(c.b[e],t)}))},e.prototype.setAttr=function(t,e){this.attrs[t]=e,"img"===t&&this._setImage(e)},e.prototype._setImage=function(t){var e=this.attr(),n=this.get("el");if(Object(h.x)(t))n.setAttribute("href",t);else if(t instanceof window.Image)e.width||(n.setAttribute("width",t.width),this.attr("width",t.width)),e.height||(n.setAttribute("height",t.height),this.attr("height",t.height)),n.setAttribute("href",t.src);else if(t instanceof HTMLElement&&Object(h.x)(t.nodeName)&&"CANVAS"===t.nodeName.toUpperCase())n.setAttribute("href",t.toDataURL());else if(t instanceof ImageData){var r=document.createElement("canvas");r.setAttribute("width",""+t.width),r.setAttribute("height",""+t.height),r.getContext("2d").putImageData(t,0,0),e.width||(n.setAttribute("width",""+t.width),this.attr("width",t.width)),e.height||(n.setAttribute("height",""+t.height),this.attr("height",t.height)),n.setAttribute("href",r.toDataURL())}},e}(l),y=n(20),m=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="line",e.canFill=!1,e.canStroke=!0,e}return Object(i.b)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.a)(Object(i.a)({},e),{x1:0,y1:0,x2:0,y2:0,startArrow:!1,endArrow:!1})},e.prototype.createPath=function(t,e){var n=this.attr(),r=this.get("el");Object(h.f)(e||n,(function(e,i){if("startArrow"===i||"endArrow"===i)if(e){var o=Object(h.v)(e)?t.addArrow(n,c.b[i]):t.getDefaultArrow(n,c.b[i]);r.setAttribute(c.b[i],"url(#"+o+")")}else r.removeAttribute(c.b[i]);else c.b[i]&&r.setAttribute(c.b[i],e)}))},e.prototype.getTotalLength=function(){var t=this.attr(),e=t.x1,n=t.y1,r=t.x2,i=t.y2;return y.c.length(e,n,r,i)},e.prototype.getPoint=function(t){var e=this.attr(),n=e.x1,r=e.y1,i=e.x2,o=e.y2;return y.c.pointAt(n,r,i,o,t)},e}(l),b={circle:function(t,e,n){return[["M",t,e],["m",-n,0],["a",n,n,0,1,0,2*n,0],["a",n,n,0,1,0,2*-n,0]]},square:function(t,e,n){return[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]]},diamond:function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]},triangle:function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["z"]]},triangleDown:function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]}},x={get:function(t){return b[t]},register:function(t,e){b[t]=e},remove:function(t){delete b[t]},getAll:function(){return b}},w=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="marker",e.canFill=!0,e.canStroke=!0,e}return Object(i.b)(e,t),e.prototype.createPath=function(t){this.get("el").setAttribute("d",this._assembleMarker())},e.prototype._assembleMarker=function(){var t=this._getPath();return Object(h.m)(t)?t.map((function(t){return t.join(" ")})).join(""):t},e.prototype._getPath=function(){var t,e=this.attr(),n=e.x,r=e.y,i=e.r||e.radius,o=e.symbol||"circle";return(t=Object(h.r)(o)?o:x.get(o))?t(n,r,i):(console.warn(t+" symbol is not exist."),null)},e.symbolsFactory=x,e}(l),S=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="path",e.canFill=!0,e.canStroke=!0,e}return Object(i.b)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.a)(Object(i.a)({},e),{startArrow:!1,endArrow:!1})},e.prototype.createPath=function(t,e){var n=this,r=this.attr(),i=this.get("el");Object(h.f)(e||r,(function(e,o){if("path"===o&&Object(h.m)(e))i.setAttribute("d",n._formatPath(e));else if("startArrow"===o||"endArrow"===o)if(e){var a=Object(h.v)(e)?t.addArrow(r,c.b[o]):t.getDefaultArrow(r,c.b[o]);i.setAttribute(c.b[o],"url(#"+a+")")}else i.removeAttribute(c.b[o]);else c.b[o]&&i.setAttribute(c.b[o],e)}))},e.prototype._formatPath=function(t){var e=t.map((function(t){return t.join(" ")})).join("");return~e.indexOf("NaN")?"":e},e.prototype.getTotalLength=function(){var t=this.get("el");return t?t.getTotalLength():null},e.prototype.getPoint=function(t){var e=this.get("el"),n=this.getTotalLength();if(0===n)return null;var r=e?e.getPointAtLength(t*n):null;return r?{x:r.x,y:r.y}:null},e}(l),E=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="polygon",e.canFill=!0,e.canStroke=!0,e}return Object(i.b)(e,t),e.prototype.createPath=function(t,e){var n=this.attr(),r=this.get("el");Object(h.f)(e||n,(function(t,e){"points"===e&&Object(h.m)(t)&&t.length>=2?r.setAttribute("points",t.map((function(t){return t[0]+","+t[1]})).join(" ")):c.b[e]&&r.setAttribute(c.b[e],t)}))},e}(l),_=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="polyline",e.canFill=!0,e.canStroke=!0,e}return Object(i.b)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.a)(Object(i.a)({},e),{startArrow:!1,endArrow:!1})},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),-1!==["points"].indexOf(e)&&this._resetCache()},e.prototype._resetCache=function(){this.set("totalLength",null),this.set("tCache",null)},e.prototype.createPath=function(t,e){var n=this.attr(),r=this.get("el");Object(h.f)(e||n,(function(t,e){"points"===e&&Object(h.m)(t)&&t.length>=2?r.setAttribute("points",t.map((function(t){return t[0]+","+t[1]})).join(" ")):c.b[e]&&r.setAttribute(c.b[e],t)}))},e.prototype.getTotalLength=function(){var t=this.attr().points,e=this.get("totalLength");return Object(h.s)(e)?(this.set("totalLength",y.d.length(t)),this.get("totalLength")):e},e.prototype.getPoint=function(t){var e,n,r=this.attr().points,i=this.get("tCache");return i||(this._setTcache(),i=this.get("tCache")),Object(h.f)(i,(function(r,i){t>=r[0]&&t<=r[1]&&(e=(t-r[0])/(r[1]-r[0]),n=i)})),y.c.pointAt(r[n][0],r[n][1],r[n+1][0],r[n+1][1],e)},e.prototype._setTcache=function(){var t=this.attr().points;if(t&&0!==t.length){var e=this.getTotalLength();if(!(e<=0)){var n,r,i=0,o=[];Object(h.f)(t,(function(a,s){t[s+1]&&((n=[])[0]=i/e,r=y.c.length(a[0],a[1],t[s+1][0],t[s+1][1]),i+=r,n[1]=i/e,o.push(n))})),this.set("tCache",o)}}},e.prototype.getStartTangent=function(){var t=this.attr().points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},e.prototype.getEndTangent=function(){var t=this.attr().points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},e}(l);var O=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="rect",e.canFill=!0,e.canStroke=!0,e}return Object(i.b)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.a)(Object(i.a)({},e),{x:0,y:0,width:0,height:0,radius:0})},e.prototype.createPath=function(t,e){var n=this,r=this.attr(),i=this.get("el"),o=!1,a=["x","y","width","height","radius"];Object(h.f)(e||r,(function(t,e){-1===a.indexOf(e)||o?-1===a.indexOf(e)&&c.b[e]&&i.setAttribute(c.b[e],t):(i.setAttribute("d",n._assembleRect(r)),o=!0)}))},e.prototype._assembleRect=function(t){var e=t.x,n=t.y,r=t.width,i=t.height,o=t.radius;if(!o)return"M "+e+","+n+" l "+r+",0 l 0,"+i+" l"+-r+" 0 z";var a=function(t){var e=0,n=0,r=0,i=0;return Object(h.m)(t)?1===t.length?e=n=r=i=t[0]:2===t.length?(e=r=t[0],n=i=t[1]):3===t.length?(e=t[0],n=i=t[1],r=t[2]):(e=t[0],n=t[1],r=t[2],i=t[3]):e=n=r=i=t,{r1:e,r2:n,r3:r,r4:i}}(o);return Object(h.m)(o)?1===o.length?a.r1=a.r2=a.r3=a.r4=o[0]:2===o.length?(a.r1=a.r3=o[0],a.r2=a.r4=o[1]):3===o.length?(a.r1=o[0],a.r2=a.r4=o[1],a.r3=o[2]):(a.r1=o[0],a.r2=o[1],a.r3=o[2],a.r4=o[3]):a.r1=a.r2=a.r3=a.r4=o,[["M "+(e+a.r1)+","+n],["l "+(r-a.r1-a.r2)+",0"],["a "+a.r2+","+a.r2+",0,0,1,"+a.r2+","+a.r2],["l 0,"+(i-a.r2-a.r3)],["a "+a.r3+","+a.r3+",0,0,1,"+-a.r3+","+a.r3],["l "+(a.r3+a.r4-r)+",0"],["a "+a.r4+","+a.r4+",0,0,1,"+-a.r4+","+-a.r4],["l 0,"+(a.r4+a.r1-i)],["a "+a.r1+","+a.r1+",0,0,1,"+a.r1+","+-a.r1],["z"]].join(" ")},e}(l),k=n(139),M={top:"before-edge",middle:"central",bottom:"after-edge",alphabetic:"baseline",hanging:"hanging"},A={top:"text-before-edge",middle:"central",bottom:"text-after-edge",alphabetic:"alphabetic",hanging:"hanging"},T={left:"left",start:"left",center:"middle",right:"end",end:"end"},C=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="text",e.canFill=!0,e.canStroke=!0,e}return Object(i.b)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.a)(Object(i.a)({},e),{x:0,y:0,text:null,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom"})},e.prototype.createPath=function(t,e){var n=this,r=this.attr(),i=this.get("el");this._setFont(),Object(h.f)(e||r,(function(t,e){"text"===e?n._setText(""+t):"matrix"===e&&t?Object(a.c)(n):c.b[e]&&i.setAttribute(c.b[e],t)})),i.setAttribute("paint-order","stroke"),i.setAttribute("style","stroke-linecap:butt; stroke-linejoin:miter;")},e.prototype._setFont=function(){var t=this.get("el"),e=this.attr(),n=e.textBaseline,r=e.textAlign,i=Object(k.a)();i&&"firefox"===i.name?t.setAttribute("dominant-baseline",A[n]||"alphabetic"):t.setAttribute("alignment-baseline",M[n]||"baseline"),t.setAttribute("text-anchor",T[r]||"left")},e.prototype._setText=function(t){var e=this.get("el"),n=this.attr(),r=n.x,i=n.textBaseline,o=void 0===i?"bottom":i;if(t)if(~t.indexOf("\\n")){var a=t.split("\\n"),s=a.length-1,u="";Object(h.f)(a,(function(t,e){0===e?"alphabetic"===o?u+=\'\'+t+"":"top"===o?u+=\'\'+t+"":"middle"===o?u+=\'\'+t+"":"bottom"===o?u+=\'\'+t+"":"hanging"===o&&(u+=\'\'+t+""):u+=\'\'+t+""})),e.innerHTML=u}else e.innerHTML=t;else e.innerHTML=""},e}(l)},function(t,e,n){"use strict";n.r(e),n.d(e,"create",(function(){return i})),n.d(e,"clone",(function(){return o})),n.d(e,"fromValues",(function(){return a})),n.d(e,"copy",(function(){return s})),n.d(e,"set",(function(){return u})),n.d(e,"add",(function(){return c})),n.d(e,"subtract",(function(){return f})),n.d(e,"multiply",(function(){return l})),n.d(e,"divide",(function(){return h})),n.d(e,"ceil",(function(){return d})),n.d(e,"floor",(function(){return p})),n.d(e,"min",(function(){return g})),n.d(e,"max",(function(){return v})),n.d(e,"round",(function(){return y})),n.d(e,"scale",(function(){return m})),n.d(e,"scaleAndAdd",(function(){return b})),n.d(e,"distance",(function(){return x})),n.d(e,"squaredDistance",(function(){return w})),n.d(e,"length",(function(){return S})),n.d(e,"squaredLength",(function(){return E})),n.d(e,"negate",(function(){return _})),n.d(e,"inverse",(function(){return O})),n.d(e,"normalize",(function(){return k})),n.d(e,"dot",(function(){return M})),n.d(e,"cross",(function(){return A})),n.d(e,"lerp",(function(){return T})),n.d(e,"random",(function(){return C})),n.d(e,"transformMat2",(function(){return I})),n.d(e,"transformMat2d",(function(){return P})),n.d(e,"transformMat3",(function(){return j})),n.d(e,"transformMat4",(function(){return D})),n.d(e,"rotate",(function(){return N})),n.d(e,"angle",(function(){return R})),n.d(e,"zero",(function(){return L})),n.d(e,"str",(function(){return B})),n.d(e,"exactEquals",(function(){return G})),n.d(e,"equals",(function(){return F})),n.d(e,"len",(function(){return z})),n.d(e,"sub",(function(){return V})),n.d(e,"mul",(function(){return W})),n.d(e,"div",(function(){return X})),n.d(e,"dist",(function(){return Y})),n.d(e,"sqrDist",(function(){return H})),n.d(e,"sqrLen",(function(){return q})),n.d(e,"forEach",(function(){return K}));var r=n(12);function i(){var t=new r.a(2);return r.a!=Float32Array&&(t[0]=0,t[1]=0),t}function o(t){var e=new r.a(2);return e[0]=t[0],e[1]=t[1],e}function a(t,e){var n=new r.a(2);return n[0]=t,n[1]=e,n}function s(t,e){return t[0]=e[0],t[1]=e[1],t}function u(t,e,n){return t[0]=e,t[1]=n,t}function c(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function f(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function l(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function h(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function d(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function p(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function g(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t}function v(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t}function y(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function m(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}function b(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t}function x(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.hypot(n,r)}function w(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function S(t){var e=t[0],n=t[1];return Math.hypot(e,n)}function E(t){var e=t[0],n=t[1];return e*e+n*n}function _(t,e){return t[0]=-e[0],t[1]=-e[1],t}function O(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function k(t,e){var n=e[0],r=e[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function M(t,e){return t[0]*e[0]+t[1]*e[1]}function A(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t}function T(t,e,n,r){var i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t}function C(t,e){e=e||1;var n=2*r.c()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t}function I(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t}function P(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t}function j(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 D(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t}function N(t,e,n,r){var i=e[0]-n[0],o=e[1]-n[1],a=Math.sin(r),s=Math.cos(r);return t[0]=i*s-o*a+n[0],t[1]=i*a+o*s+n[1],t}function R(t,e){var n=t[0],r=t[1],i=e[0],o=e[1],a=Math.sqrt(n*n+r*r)*Math.sqrt(i*i+o*o),s=a&&(n*i+r*o)/a;return Math.acos(Math.min(Math.max(s,-1),1))}function L(t){return t[0]=0,t[1]=0,t}function B(t){return"vec2("+t[0]+", "+t[1]+")"}function G(t,e){return t[0]===e[0]&&t[1]===e[1]}function F(t,e){var n=t[0],i=t[1],o=e[0],a=e[1];return Math.abs(n-o)<=r.b*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-a)<=r.b*Math.max(1,Math.abs(i),Math.abs(a))}var U,z=S,V=f,W=l,X=h,Y=x,H=w,q=E,K=(U=i(),function(t,e,n,r,i,o){var a,s;for(e||(e=2),n||(n=0),s=r?Math.min(r*e+n,t.length):t.length,a=n;a>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;var d=Object.keys(t);"alpha"in t&&(d.splice(d.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);var g=d.sort().join("");if(!(g in u))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=u[g];var v=o[this.model].labels,y=[];for(n=0;nn?(e+.05)/(n+.05):(n+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},isDark:function(){var t=this.rgb().color;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},isLight:function(){return!this.isDark()},negate:function(){for(var t=this.rgb(),e=0;e<3;e++)t.color[e]=255-t.color[e];return t},lighten:function(t){var e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken:function(t){var e=this.hsl();return e.color[2]-=e.color[2]*t,e},saturate:function(t){var e=this.hsl();return e.color[1]+=e.color[1]*t,e},desaturate:function(t){var e=this.hsl();return e.color[1]-=e.color[1]*t,e},whiten:function(t){var e=this.hwb();return e.color[1]+=e.color[1]*t,e},blacken:function(t){var e=this.hwb();return e.color[2]+=e.color[2]*t,e},grayscale:function(){var t=this.rgb().color,e=.3*t[0]+.59*t[1]+.11*t[2];return f.rgb(e,e,e)},fade:function(t){return this.alpha(this.valpha-this.valpha*t)},opaquer:function(t){return this.alpha(this.valpha+this.valpha*t)},rotate:function(t){var e=this.hsl(),n=e.color[0];return n=(n=(n+t)%360)<0?360+n:n,e.color[0]=n,e},mix:function(t,e){if(!t||!t.rgb)throw new Error(\'Argument to "mix" was not a Color instance, but rather an instance of \'+r(t));var n=t.rgb(),i=this.rgb(),o=void 0===e?.5:e,a=2*o-1,s=n.alpha()-i.alpha(),u=((a*s==-1?a:(a+s)/(1+a*s))+1)/2,c=1-u;return f.rgb(u*n.red()+c*i.red(),u*n.green()+c*i.green(),u*n.blue()+c*i.blue(),n.alpha()*o+i.alpha()*(1-o))}},Object.keys(o).forEach((function(t){if(-1===s.indexOf(t)){var e=o[t].channels;f.prototype[t]=function(){if(this.model===t)return new f(this);if(arguments.length)return new f(arguments,t);var n="number"==typeof arguments[e]?e:this.valpha;return new f(d(o[this.model][t].raw(this.color)).concat(n),t)},f[t]=function(n){return"number"==typeof n&&(n=p(a.call(arguments),e)),new f(n,t)}}})),t.exports=f},function(t,e,n){var r=n(59),i=n(43);t.exports=function(t){if(!i(t))return!1;var e=r(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},function(t,e,n){var r=n(102),i=n(103);t.exports=function(t,e,n,o){var a=!n;n||(n={});for(var s=-1,u=e.length;++s1&&(n*=Math.sqrt(v),i*=Math.sqrt(v));var y=n*n*(g*g)+i*i*(p*p),m=y?Math.sqrt((n*n*(i*i)-y)/y):1;u===c&&(m*=-1),isNaN(m)&&(m=0);var b=i?m*n*g/i:0,x=n?m*-i*p/n:0,w=(f+h)/2+Math.cos(s)*b-Math.sin(s)*x,S=(l+d)/2+Math.sin(s)*b+Math.cos(s)*x,E=[(p-b)/n,(g-x)/i],_=[(-1*p-b)/n,(-1*g-x)/i],O=a([1,0],E),k=a(E,_);return o(E,_)<=-1&&(k=Math.PI),o(E,_)>=1&&(k=0),0===c&&k>0&&(k-=2*Math.PI),1===c&&k<0&&(k+=2*Math.PI),{cx:w,cy:S,rx:Object(r.j)(t,[h,d])?0:n,ry:Object(r.j)(t,[h,d])?0:i,startAngle:O,endAngle:O+k,xRotation:s,arcFlag:u,sweepFlag:c}}},function(t,e){function n(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=n=function(t){return typeof t}:t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(e)}t.exports=n},function(t,e){t.exports=function(t){return null==t}},function(t,e,n){var r;function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(o){var a=/^\\s+/,s=/\\s+$/,u=0,c=o.round,f=o.min,l=o.max,h=o.random;function d(t,e){if(e=e||{},(t=t||"")instanceof d)return t;if(!(this instanceof d))return new d(t,e);var n=function(t){var e={r:0,g:0,b:0},n=1,r=null,u=null,c=null,h=!1,d=!1;"string"==typeof t&&(t=function(t){t=t.replace(a,"").replace(s,"").toLowerCase();var e,n=!1;if(I[t])t=I[t],n=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=W.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=W.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=W.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=W.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=W.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=W.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=W.hex8.exec(t))return{r:R(e[1]),g:R(e[2]),b:R(e[3]),a:F(e[4]),format:n?"name":"hex8"};if(e=W.hex6.exec(t))return{r:R(e[1]),g:R(e[2]),b:R(e[3]),format:n?"name":"hex"};if(e=W.hex4.exec(t))return{r:R(e[1]+""+e[1]),g:R(e[2]+""+e[2]),b:R(e[3]+""+e[3]),a:F(e[4]+""+e[4]),format:n?"name":"hex8"};if(e=W.hex3.exec(t))return{r:R(e[1]+""+e[1]),g:R(e[2]+""+e[2]),b:R(e[3]+""+e[3]),format:n?"name":"hex"};return!1}(t));"object"==i(t)&&(X(t.r)&&X(t.g)&&X(t.b)?(p=t.r,g=t.g,v=t.b,e={r:255*D(p,255),g:255*D(g,255),b:255*D(v,255)},h=!0,d="%"===String(t.r).substr(-1)?"prgb":"rgb"):X(t.h)&&X(t.s)&&X(t.v)?(r=B(t.s),u=B(t.v),e=function(t,e,n){t=6*D(t,360),e=D(e,100),n=D(n,100);var r=o.floor(t),i=t-r,a=n*(1-e),s=n*(1-i*e),u=n*(1-(1-i)*e),c=r%6;return{r:255*[n,s,a,a,u,n][c],g:255*[u,n,n,s,a,a][c],b:255*[a,a,u,n,n,s][c]}}(t.h,r,u),h=!0,d="hsv"):X(t.h)&&X(t.s)&&X(t.l)&&(r=B(t.s),c=B(t.l),e=function(t,e,n){var r,i,o;function a(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(t=D(t,360),e=D(e,100),n=D(n,100),0===e)r=i=o=n;else{var s=n<.5?n*(1+e):n+e-n*e,u=2*n-s;r=a(u,s,t+1/3),i=a(u,s,t),o=a(u,s,t-1/3)}return{r:255*r,g:255*i,b:255*o}}(t.h,r,c),h=!0,d="hsl"),t.hasOwnProperty("a")&&(n=t.a));var p,g,v;return n=j(n),{ok:h,format:t.format||d,r:f(255,l(e.r,0)),g:f(255,l(e.g,0)),b:f(255,l(e.b,0)),a:n}}(t);this._originalInput=t,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=c(100*this._a)/100,this._format=e.format||n.format,this._gradientType=e.gradientType,this._r<1&&(this._r=c(this._r)),this._g<1&&(this._g=c(this._g)),this._b<1&&(this._b=c(this._b)),this._ok=n.ok,this._tc_id=u++}function p(t,e,n){t=D(t,255),e=D(e,255),n=D(n,255);var r,i,o=l(t,e,n),a=f(t,e,n),s=(o+a)/2;if(o==a)r=i=0;else{var u=o-a;switch(i=s>.5?u/(2-o-a):u/(o+a),o){case t:r=(e-n)/u+(e>1)+720)%360;--e;)r.h=(r.h+i)%360,o.push(d(r));return o}function C(t,e){e=e||6;for(var n=d(t).toHsv(),r=n.h,i=n.s,o=n.v,a=[],s=1/e;e--;)a.push(d({h:r,s:i,v:o})),o=(o+s)%1;return a}d.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,n,r=this.toRgb();return t=r.r/255,e=r.g/255,n=r.b/255,.2126*(t<=.03928?t/12.92:o.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:o.pow((e+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:o.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=j(t),this._roundA=c(100*this._a)/100,this},toHsv:function(){var t=g(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=g(this._r,this._g,this._b),e=c(360*t.h),n=c(100*t.s),r=c(100*t.v);return 1==this._a?"hsv("+e+", "+n+"%, "+r+"%)":"hsva("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var t=p(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=p(this._r,this._g,this._b),e=c(360*t.h),n=c(100*t.s),r=c(100*t.l);return 1==this._a?"hsl("+e+", "+n+"%, "+r+"%)":"hsla("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(t){return v(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,n,r,i){var o=[L(c(t).toString(16)),L(c(e).toString(16)),L(c(n).toString(16)),L(G(r))];if(i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:c(this._r),g:c(this._g),b:c(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+c(this._r)+", "+c(this._g)+", "+c(this._b)+")":"rgba("+c(this._r)+", "+c(this._g)+", "+c(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:c(100*D(this._r,255))+"%",g:c(100*D(this._g,255))+"%",b:c(100*D(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+c(100*D(this._r,255))+"%, "+c(100*D(this._g,255))+"%, "+c(100*D(this._b,255))+"%)":"rgba("+c(100*D(this._r,255))+"%, "+c(100*D(this._g,255))+"%, "+c(100*D(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(P[v(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+y(this._r,this._g,this._b,this._a),n=e,r=this._gradientType?"GradientType = 1, ":"";if(t){var i=d(t);n="#"+y(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+e+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var n=!1,r=this._a<1&&this._a>=0;return e||!r||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(n=this.toRgbString()),"prgb"===t&&(n=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(n=this.toHexString()),"hex3"===t&&(n=this.toHexString(!0)),"hex4"===t&&(n=this.toHex8String(!0)),"hex8"===t&&(n=this.toHex8String()),"name"===t&&(n=this.toName()),"hsl"===t&&(n=this.toHslString()),"hsv"===t&&(n=this.toHsvString()),n||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return d(this.toString())},_applyModification:function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(w,arguments)},brighten:function(){return this._applyModification(S,arguments)},darken:function(){return this._applyModification(E,arguments)},desaturate:function(){return this._applyModification(m,arguments)},saturate:function(){return this._applyModification(b,arguments)},greyscale:function(){return this._applyModification(x,arguments)},spin:function(){return this._applyModification(_,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(T,arguments)},complement:function(){return this._applyCombination(O,arguments)},monochromatic:function(){return this._applyCombination(C,arguments)},splitcomplement:function(){return this._applyCombination(A,arguments)},triad:function(){return this._applyCombination(k,arguments)},tetrad:function(){return this._applyCombination(M,arguments)}},d.fromRatio=function(t,e){if("object"==i(t)){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]="a"===r?t[r]:B(t[r]));t=n}return d(t,e)},d.equals=function(t,e){return!(!t||!e)&&d(t).toRgbString()==d(e).toRgbString()},d.random=function(){return d.fromRatio({r:h(),g:h(),b:h()})},d.mix=function(t,e,n){n=0===n?0:n||50;var r=d(t).toRgb(),i=d(e).toRgb(),o=n/100;return d({r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a})},d.readability=function(t,e){var n=d(t),r=d(e);return(o.max(n.getLuminance(),r.getLuminance())+.05)/(o.min(n.getLuminance(),r.getLuminance())+.05)},d.isReadable=function(t,e,n){var r,i,o=d.readability(t,e);switch(i=!1,(r=function(t){var e,n;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),n=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==n&&"large"!==n&&(n="small");return{level:e,size:n}}(n)).level+r.size){case"AAsmall":case"AAAlarge":i=o>=4.5;break;case"AAlarge":i=o>=3;break;case"AAAsmall":i=o>=7}return i},d.mostReadable=function(t,e,n){var r,i,o,a,s=null,u=0;i=(n=n||{}).includeFallbackColors,o=n.level,a=n.size;for(var c=0;cu&&(u=r,s=d(e[c]));return d.isReadable(t,s,{level:o,size:a})||!i?s:(n.includeFallbackColors=!1,d.mostReadable(t,["#fff","#000"],n))};var I=d.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},P=d.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(I);function j(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function D(t,e){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(t);return t=f(e,l(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),o.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function N(t){return f(1,l(0,t))}function R(t){return parseInt(t,16)}function L(t){return 1==t.length?"0"+t:""+t}function B(t){return t<=1&&(t=100*t+"%"),t}function G(t){return o.round(255*parseFloat(t)).toString(16)}function F(t){return R(t)/255}var U,z,V,W=(z="[\\\\s|\\\\(]+("+(U="(?:[-\\\\+]?\\\\d*\\\\.\\\\d+%?)|(?:[-\\\\+]?\\\\d+%?)")+")[,|\\\\s]+("+U+")[,|\\\\s]+("+U+")\\\\s*\\\\)?",V="[\\\\s|\\\\(]+("+U+")[,|\\\\s]+("+U+")[,|\\\\s]+("+U+")[,|\\\\s]+("+U+")\\\\s*\\\\)?",{CSS_UNIT:new RegExp(U),rgb:new RegExp("rgb"+z),rgba:new RegExp("rgba"+V),hsl:new RegExp("hsl"+z),hsla:new RegExp("hsla"+V),hsv:new RegExp("hsv"+z),hsva:new RegExp("hsva"+V),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function X(t){return!!W.CSS_UNIT.exec(t)}t.exports?t.exports=d:void 0===(r=function(){return d}.call(e,n,e,t))||(t.exports=r)}(Math)},function(t,e,n){t.exports={EPSILON:n(253),create:n(254),clone:n(497),fromValues:n(498),copy:n(499),set:n(255),equals:n(500),exactEquals:n(501),add:n(256),subtract:n(167),sub:n(502),multiply:n(257),mul:n(503),divide:n(258),div:n(504),inverse:n(505),min:n(506),max:n(507),rotate:n(508),floor:n(509),ceil:n(510),round:n(511),scale:n(512),scaleAndAdd:n(513),distance:n(259),dist:n(514),squaredDistance:n(260),sqrDist:n(515),length:n(261),len:n(516),squaredLength:n(262),sqrLen:n(517),negate:n(518),normalize:n(263),dot:n(264),cross:n(519),lerp:n(520),random:n(521),transformMat2:n(522),transformMat2d:n(523),transformMat3:n(524),transformMat4:n(525),forEach:n(526),limit:n(527)}},function(t,e,n){var r=n(98),i=n(296),o=n(297),a=n(298),s=n(299),u=n(300);function c(t){var e=this.__data__=new r(t);this.size=e.size}c.prototype.clear=i,c.prototype.delete=o,c.prototype.get=a,c.prototype.has=s,c.prototype.set=u,t.exports=c},function(t,e,n){var r=n(291),i=n(292),o=n(293),a=n(294),s=n(295);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t0&&void 0!==arguments[0]?arguments[0]:{vertexCount:3},e=t.vertexCount,n=Object(E.createEntity)();return this.geometry.create(n,{vertexCount:e})}},{key:"createInstancedBufferGeometry",value:function(t){var e=t.maxInstancedCount,n=t.vertexCount,r=Object(E.createEntity)();return this.geometry.create(r,{maxInstancedCount:e,vertexCount:n})}}]),t}(),u=w()(s.prototype,"geometry",[i],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),c=w()(s.prototype,"engine",[o],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),a=s))||a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return w}));var r=n(4),i=n.n(r),o=n(6),a=n.n(o),s=n(7),u=n.n(s),c=n(22),f=n.n(c),l=n(23),h=n.n(l),d=n(24),p=n.n(d),g=n(17),v=n.n(g),y=n(3);function m(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function b(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function D(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0)return I.b.OUTSIDE;A.e.dot(u,t.getPositiveFarPoint(n[i]))+c>0&&(r|=a)}}return r}}]),t}(),l=M()(f.prototype,"mesh",[i],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),h=M()(f.prototype,"cullable",[o],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),d=M()(f.prototype,"geometry",[a],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),p=M()(f.prototype,"hierarchy",[s],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),g=M()(f.prototype,"transform",[u],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),c=f))||c)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(6),i=n.n(r),o=n(7),a=n.n(o),s=n(2),u=function(){function t(e,n){i()(this,t),this.distance=void 0,this.normal=void 0,this.pnVertexFlag=void 0,this.distance=e||0,this.normal=n||s.e.fromValues(0,1,0),this.updatePNVertexFlag()}return a()(t,[{key:"updatePNVertexFlag",value:function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)}},{key:"distanceToPoint",value:function(t){return s.e.dot(t,this.normal)-this.distance}},{key:"normalize",value:function(){var t=1/s.e.len(this.normal);s.e.scale(this.normal,this.normal,t),this.distance*=t}},{key:"intersectsLine",value:function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),o=i>=0&&i<=1;return o&&n&&s.e.lerp(n,t,e,i),o}}]),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return P}));var r,i,o,a,s,u,c,f,l,h,d,p,g=n(9),v=n.n(g),y=n(14),m=n.n(y),b=n(10),x=n.n(b),w=n(6),S=n.n(w),E=n(7),_=n.n(E),O=n(11),k=n.n(O),M=(n(28),n(5)),A=n(13),T=n(84),C=n(70),I=n(50),P=(r=Object(M.injectable)(),i=Object(M.inject)(A.a.Systems),o=Object(M.named)(A.a.FrameGraphSystem),a=Object(M.inject)(A.a.RenderPassFactory),s=Object(M.inject)(A.a.ConfigService),u=Object(M.inject)(A.a.ResourcePool),r((f=function(){function t(){S()(this,t),x()(this,"frameGraphSystem",l,this),x()(this,"renderPassFactory",h,this),x()(this,"configService",d,this),x()(this,"resourcePool",p,this)}var e;return _()(t,[{key:"execute",value:(e=m()(v.a.mark((function t(e){var n,r,i,o,a,s,u,c;return v.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=this.renderPassFactory(I.a.IDENTIFIER),r=n.setup,i=n.execute,this.frameGraphSystem.addPass(I.a.IDENTIFIER,r,i),o=this.renderPassFactory(T.a.IDENTIFIER),a=o.setup,s=o.execute,u=o.tearDown,c=this.frameGraphSystem.addPass(T.a.IDENTIFIER,a,s,u),this.frameGraphSystem.present(c.data.output);case 5:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"tearDown",value:function(){this.resourcePool.clean()}},{key:"pick",value:function(t,e){return this.renderPassFactory(C.a.IDENTIFIER).pick(t,e)}}]),t}(),l=k()(f.prototype,"frameGraphSystem",[i,o],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),h=k()(f.prototype,"renderPassFactory",[a],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),d=k()(f.prototype,"configService",[s],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),p=k()(f.prototype,"resourcePool",[u],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),c=f))||c)},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var r=n(6),i=n.n(r),o=n(22),a=n.n(o),s=n(23),u=n.n(s),c=n(24),f=n.n(c),l=n(17),h=n.n(l);function d(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=h()(t);if(e){var i=h()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f()(this,n)}}var p=function(t){u()(n,t);var e=d(n);function n(t){var r;return i()(this,n),(r=e.call(this,t)).parentID=void 0,Object.assign(a()(r),t),r}return n}(n(3).Component)},function(t,e,n){"use strict";n.d(e,"a",(function(){return M}));var r,i,o,a,s,u,c,f,l,h=n(9),d=n.n(h),p=n(14),g=n.n(p),v=n(10),y=n.n(v),m=n(6),b=n.n(m),x=n(7),w=n.n(x),S=n(11),E=n.n(S),_=(n(28),n(2)),O=n(5),k=n(13),M=(r=Object(O.injectable)(),i=Object(O.inject)(k.a.HierarchyComponentManager),o=Object(O.inject)(k.a.TransformComponentManager),a=Object(O.inject)(k.a.MeshComponentManager),r((u=function(){function t(){b()(this,t),y()(this,"hierarchy",c,this),y()(this,"transform",f,this),y()(this,"mesh",l,this)}var e;return w()(t,[{key:"execute",value:(e=g()(d.a.mark((function t(){return d.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.runTransformUpdateSystem(),this.runHierarchyUpdateSystem();case 2:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"tearDown",value:function(){this.hierarchy.clear(),this.transform.clear()}},{key:"getHierarchyComponentManager",value:function(){return this.hierarchy}},{key:"getTransformComponentManager",value:function(){return this.transform}},{key:"runTransformUpdateSystem",value:function(){var t=this;this.transform.forEach((function(e,n){(n.isDirty()||n.isLocalDirty())&&(t.setMeshAABBDirty(t.mesh.getComponentByEntity(e)),n.updateTransform())}))}},{key:"runHierarchyUpdateSystem",value:function(){var t=this;this.hierarchy.forEach((function(e,n){var r=t.transform.getComponentByEntity(e),i=t.transform.getComponentByEntity(n.parentID);null!==r&&null!==i&&r.updateTransformWithParent(i)}))}},{key:"attach",value:function(t,e,n){this.hierarchy.contains(t)&&this.detach(t),this.hierarchy.create(t,{parentID:e});var r=this.mesh.getComponentByEntity(e);if(this.setMeshAABBDirty(r),r&&-1===r.children.indexOf(t)&&r.children.push(t),this.hierarchy.getCount()>1)for(var i=this.hierarchy.getCount()-1;i>0;--i)for(var o=this.hierarchy.getEntity(i),a=0;a0&&void 0!==arguments[0])||arguments[0];t?this.dirtyFlag|=n.DIRTY:this.dirtyFlag&=~n.DIRTY}},{key:"isLocalDirty",value:function(){return this.localDirtyFlag}},{key:"setLocalDirty",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t?(this.localDirtyFlag|=n.DIRTY,this.setDirty(!0)):this.localDirtyFlag&=~n.DIRTY}},{key:"updateTransform",value:function(){this.isLocalDirty()&&this.getLocalTransform(),this.isDirty()&&null===this.parent&&(g.b.copy(this.worldTransform,this.getLocalTransform()),this.setDirty(!1))}},{key:"updateTransformWithParent",value:function(t){g.b.multiply(this.worldTransform,t.worldTransform,this.getLocalTransform())}},{key:"applyTransform",value:function(){this.setDirty(),g.b.getScaling(this.localScale,this.worldTransform),g.b.getTranslation(this.localPosition,this.worldTransform),g.b.getRotation(this.localRotation,this.worldTransform)}},{key:"clearTransform",value:function(){this.setDirty(),this.localPosition=g.e.fromValues(0,0,0),this.localRotation=g.c.fromValues(0,0,0,1),this.localScale=g.e.fromValues(1,1,1)}},{key:"scaleLocal",value:function(t){return this.setLocalDirty(),g.e.multiply(this.localScale,this.localScale,t),this}},{key:"getLocalPosition",value:function(){return this.localPosition}},{key:"getLocalRotation",value:function(){return this.localRotation}},{key:"getLocalScale",value:function(){return this.localScale}},{key:"getLocalTransform",value:function(){return this.localDirtyFlag&&(g.b.fromRotationTranslationScale(this.localTransform,this.localRotation,this.localPosition,this.localScale),this.setLocalDirty(!1)),this.localTransform}},{key:"getWorldTransform",value:function(){return this.isLocalDirty()||this.isDirty()?(this.parent&&this.parent.getWorldTransform(),this.updateTransform(),this.worldTransform):this.worldTransform}},{key:"getPosition",value:function(){return g.b.getTranslation(this.position,this.worldTransform),this.position}},{key:"getRotation",value:function(){return g.b.getRotation(this.rotation,this.worldTransform),this.rotation}},{key:"getScale",value:function(){return g.b.getScaling(this.scaling,this.worldTransform),this.scaling}}]),n}(n(35).a);y.DIRTY=1},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r,i=n(6),o=n.n(i),a=n(7),s=n.n(a),u=n(5),c=Object(u.injectable)()(r=function(){function t(){o()(this,t),this.config=void 0}return s()(t,[{key:"get",value:function(){return this.config}},{key:"set",value:function(t){this.config=t}}]),t}())||r},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r,i=n(6),o=n.n(i),a=n(7),s=n.n(a),u=n(5),c=Object(u.injectable)()(r=function(){function t(){o()(this,t)}return s()(t,[{key:"listen",value:function(t){}},{key:"on",value:function(t,e){}},{key:"connect",value:function(){}},{key:"disconnect",value:function(){}},{key:"destroy",value:function(){}}]),t}())||r},function(t,e,n){"use strict";n.d(e,"a",(function(){return B}));var r=n(62),i=n.n(r),o=n(9),a=n.n(o),s=n(14),u=n.n(s),c=n(10),f=n.n(c),l=n(6),h=n.n(l),d=n(7),p=n.n(d),g=n(11),v=n.n(g),y=(n(28),n(5)),m=n(13),b=function t(){h()(this,t),this.index=void 0},x=function t(){h()(this,t),this.name=void 0,this.data=void 0,this.execute=void 0,this.tearDown=void 0},w=function(){function t(){h()(this,t),this.name=void 0,this.refCount=0,this.hasSideEffect=!1,this.devirtualize=[],this.destroy=[],this.reads=[],this.writes=[]}return p()(t,[{key:"read",value:function(t){return this.reads.find((function(e){return e.index===t.index}))||this.reads.push(t),t}},{key:"sample",value:function(t){return this.read(t),t}},{key:"write",value:function(t,e){if(this.writes.find((function(t){return t.index===e.index})))return e;var n=t.getResourceNode(e);n.resource.version++,n.resource.imported&&(this.hasSideEffect=!0);var r=t.createResourceNode(n.resource);return t.getResourceNode(r).writer=this,this.writes.push(r),r}}]),t}(),S=n(23),E=n.n(S),_=n(24),O=n.n(_),k=n(17),M=n.n(k);function A(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=M()(t);if(e){var i=M()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return O()(this,n)}}var T,C,I,P,j,D=function(t){E()(n,t);var e=A(n);function n(){var t;h()(this,n);for(var r=arguments.length,i=new Array(r),o=0;o=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function L(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&(a=i[1].trim()),n){case"bool":a="true"===a;break;case"float":case"int":a=Number(a);break;case"vec2":case"vec3":case"vec4":case"ivec2":case"ivec3":case"ivec4":case"mat2":case"mat3":case"mat4":a=a?a.replace("[","").replace("]","").split(",").reduce((function(t,e){return t.push(Number(e.trim())),t}),[]):new Array(function(t){var e=0;switch(t){case"vec2":case"ivec2":e=2;break;case"vec3":case"ivec3":e=3;break;case"vec4":case"ivec4":case"mat2":e=4;break;case"mat3":e=9;break;case"mat4":e=16}return e}(n)).fill(0)}return e[o]=a,"uniform ".concat(n," ").concat(o,";\\n")})),uniforms:e}}function g(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function v(t){for(var e=1;e 0.0 ) p = vec2(p.x-k*p.y,-k*p.x-p.y)/2.0;\\n p.x -= clamp( p.x, -2.0, 0.0 );\\n return -length(p)*sign(p.y);\\n}\\n\\nfloat sdBox(vec2 p, vec2 b) {\\n vec2 d = abs(p)-b;\\n return length(max(d,vec2(0))) + min(max(d.x,d.y),0.0);\\n}\\n\\nfloat sdPentagon(vec2 p, float r) {\\n vec3 k = vec3(0.809016994,0.587785252,0.726542528);\\n p.x = abs(p.x);\\n p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);\\n p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);\\n p -= vec2(clamp(p.x,-r*k.z,r*k.z),r);\\n return length(p)*sign(p.y);\\n}\\n\\nfloat sdHexagon(vec2 p, float r) {\\n vec3 k = vec3(-0.866025404,0.5,0.577350269);\\n p = abs(p);\\n p -= 2.0*min(dot(k.xy,p),0.0)*k.xy;\\n p -= vec2(clamp(p.x, -k.z*r, k.z*r), r);\\n return length(p)*sign(p.y);\\n}\\n\\nfloat sdOctogon(vec2 p, float r) {\\n vec3 k = vec3(-0.9238795325, 0.3826834323, 0.4142135623 );\\n p = abs(p);\\n p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);\\n p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);\\n p -= vec2(clamp(p.x, -k.z*r, k.z*r), r);\\n return length(p)*sign(p.y);\\n}\\n\\nfloat sdHexagram(vec2 p, float r) {\\n vec4 k=vec4(-0.5,0.8660254038,0.5773502692,1.7320508076);\\n p = abs(p);\\n p -= 2.0*min(dot(k.xy,p),0.0)*k.xy;\\n p -= 2.0*min(dot(k.yx,p),0.0)*k.yx;\\n p -= vec2(clamp(p.x,r*k.z,r*k.w),r);\\n return length(p)*sign(p.y);\\n}\\n\\nfloat sdRhombus(vec2 p, vec2 b) {\\n vec2 q = abs(p);\\n float h = clamp((-2.0*ndot(q,b)+ndot(b,b))/dot(b,b),-1.0,1.0);\\n float d = length( q - 0.5*b*vec2(1.0-h,1.0+h) );\\n return d * sign( q.x*b.y + q.y*b.x - b.x*b.y );\\n}\\n\\nfloat sdVesica(vec2 p, float r, float d) {\\n p = abs(p);\\n float b = sqrt(r*r-d*d); // can delay this sqrt\\n return ((p.y-b)*d>p.x*b)\\n ? length(p-vec2(0.0,b))\\n : length(p-vec2(-d,0.0))-r;\\n}"})}},{key:"registerModule",value:function(t,e){if(!this.rawContentCache[t]){var n=e.vs,r=void 0===n?"":n,i=e.fs,o=void 0===i?"":i,a=e.uniforms,s=p(r),u=s.content,c=s.uniforms,f=p(o),l=f.content,h=f.uniforms;this.rawContentCache[t]={fs:l,uniforms:v(v(v({},c),h),a),vs:u}}}},{key:"destroy",value:function(){this.moduleCache={},this.rawContentCache={}}},{key:"getModule",value:function(t){var e=this;if(this.moduleCache[t])return this.moduleCache[t];var n=this.rawContentCache[t].vs||"",r=this.rawContentCache[t].fs||"",i=this.processModule(n,[],"vs"),o=i.content,a=i.includeList,s=this.processModule(r,[],"fs"),u=s.content,c=s.includeList,l=u,h=f()(a.concat(c).concat(t)).reduce((function(t,n){return v(v({},t),e.rawContentCache[n].uniforms)}),{});return y.test(u)||(l="#ifdef GL_FRAGMENT_PRECISION_HIGH\\n precision highp float;\\n #else\\n precision mediump float;\\n#endif\\n"+u),this.moduleCache[t]={fs:l.trim(),uniforms:h,vs:o.trim()},this.moduleCache[t]}},{key:"processModule",value:function(t,e,n){var r=this;return{content:t.replace(m,(function(t,i){var o=i.split(" ")[0].replace(/"/g,"");if(e.indexOf(o)>-1)return"";var a=r.rawContentCache[o][n];return e.push(o),r.processModule(a||"",e,n).content})),includeList:e}}}]),t}())||h},function(t,e,n){"use strict";var r=function(){function t(){this._events={}}return t.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},t.prototype.once=function(t,e){return this.on(t,e,!0),this},t.prototype.emit=function(t){for(var e=this,n=[],r=1;r0)}));return s.length>0?(Object(o.a)(s,(function(t){var e=t.getBBox();i.push(e.minX,e.maxX),a.push(e.minY,e.maxY)})),t=Math.min.apply(null,i),e=Math.max.apply(null,i),n=Math.min.apply(null,a),r=Math.max.apply(null,a)):(t=0,e=0,n=0,r=0),{x:t,y:n,minX:t,minY:n,maxX:e,maxY:r,width:e-t,height:r-n}},e.prototype.getCanvasBBox=function(){var t=1/0,e=-1/0,n=1/0,r=-1/0,i=[],a=[],s=this.getChildren().filter((function(t){return t.get("visible")&&(!t.isGroup()||t.isGroup()&&t.getChildren().length>0)}));return s.length>0?(Object(o.a)(s,(function(t){var e=t.getCanvasBBox();i.push(e.minX,e.maxX),a.push(e.minY,e.maxY)})),t=Math.min.apply(null,i),e=Math.max.apply(null,i),n=Math.min.apply(null,a),r=Math.max.apply(null,a)):(t=0,e=0,n=0,r=0),{x:t,y:n,minX:t,minY:n,maxX:e,maxY:r,width:e-t,height:r-n}},e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.children=[],e},e.prototype.onAttrChange=function(e,n,r){if(t.prototype.onAttrChange.call(this,e,n,r),"matrix"===e){var i=this.getTotalMatrix();this._applyChildrenMarix(i)}},e.prototype.applyMatrix=function(e){var n=this.getTotalMatrix();t.prototype.applyMatrix.call(this,e);var r=this.getTotalMatrix();r!==n&&this._applyChildrenMarix(r)},e.prototype._applyChildrenMarix=function(t){var e=this.getChildren();Object(o.a)(e,(function(e){e.applyMatrix(t)}))},e.prototype.addShape=function(){for(var t=[],e=0;e=0;a--){var s=t[a];if(Object(o.b)(s)&&(s.isGroup()?i=s.getShape(e,n,r):s.isHit(e,n)&&(i=s)),i)break}return i},e.prototype.add=function(t){var e=this.getCanvas(),n=this.getChildren(),r=this.get("timeline"),i=t.getParent();i&&function(t,e,n){void 0===n&&(n=!0),n?e.destroy():(e.set("parent",null),e.set("canvas",null)),Object(o.j)(t.getChildren(),e)}(i,t,!1),t.set("parent",this),e&&function t(e,n){if(e.set("canvas",n),e.isGroup()){var r=e.get("children");r.length&&r.forEach((function(e){t(e,n)}))}}(t,e),r&&function t(e,n){if(e.set("timeline",n),e.isGroup()){var r=e.get("children");r.length&&r.forEach((function(e){t(e,n)}))}}(t,r),n.push(t),t.onCanvasChange("add"),this._applyElementMatrix(t)},e.prototype._applyElementMatrix=function(t){var e=this.getTotalMatrix();e&&t.applyMatrix(e)},e.prototype.getChildren=function(){return this.get("children")},e.prototype.sort=function(){var t,e=this.getChildren();Object(o.a)(e,(function(t,e){return t._INDEX=e,t})),e.sort((t=function(t,e){return t.get("zIndex")-e.get("zIndex")},function(e,n){var r=t(e,n);return 0===r?e._INDEX-n._INDEX:r})),this.onCanvasChange("sort")},e.prototype.clear=function(){if(this.set("clearing",!0),!this.destroyed){for(var t=this.getChildren(),e=t.length-1;e>=0;e--)t[e].destroy();this.set("children",[]),this.onCanvasChange("clear"),this.set("clearing",!1)}},e.prototype.destroy=function(){this.get("destroyed")||(this.clear(),t.prototype.destroy.call(this))},e.prototype.getFirst=function(){return this.getChildByIndex(0)},e.prototype.getLast=function(){var t=this.getChildren();return this.getChildByIndex(t.length-1)},e.prototype.getChildByIndex=function(t){return this.getChildren()[t]},e.prototype.getCount=function(){return this.getChildren().length},e.prototype.contain=function(t){return this.getChildren().indexOf(t)>-1},e.prototype.removeChild=function(t,e){void 0===e&&(e=!0),this.contain(t)&&t.remove(e)},e.prototype.findAll=function(t){var e=[],n=this.getChildren();return Object(o.a)(n,(function(n){t(n)&&e.push(n),n.isGroup()&&(e=e.concat(n.findAll(t)))})),e},e.prototype.find=function(t){var e=null,n=this.getChildren();return Object(o.a)(n,(function(n){if(t(n)?e=n:n.isGroup()&&(e=n.find(t)),e)return!1})),e},e.prototype.findById=function(t){return this.find((function(e){return e.get("id")===t}))},e.prototype.findByClassName=function(t){return this.find((function(e){return e.get("className")===t}))},e.prototype.findAllByName=function(t){return this.findAll((function(e){return e.get("name")===t}))},e}(i.a);e.a=s},function(t,e,n){"use strict";var r=n(1),i=n(0),o=n(18),a=n(19),s=n(39),u=n(117),c=o.a.transform,f=["zIndex","capture","visible","type"],l=["repeat"];function h(t,e){var n={},r=e.attrs;for(var i in t)n[i]=r[i];return n}function d(t,e){var n={},r=e.attr();return Object(i.f)(t,(function(t,e){-1!==l.indexOf(e)||Object(i.q)(r[e],t)||(n[e]=t)})),n}function p(t,e){if(e.onFrame)return t;var n=e.startTime,r=e.delay,o=e.duration,a=Object.prototype.hasOwnProperty;return Object(i.f)(t,(function(t){n+rt.delay&&Object(i.f)(e.toAttrs,(function(e,n){a.call(t.toAttrs,n)&&(delete t.toAttrs[n],delete t.fromAttrs[n])}))})),t}var g=function(t){function e(e){var n=t.call(this,e)||this;n.attrs={};var r=n.getDefaultAttrs();return Object(i.A)(r,e.attrs),n.attrs=r,n.initAttrs(r),n.initAnimate(),n}return Object(r.b)(e,t),e.prototype.getDefaultCfg=function(){return{visible:!0,capture:!0,zIndex:0}},e.prototype.getDefaultAttrs=function(){return{matrix:this.getDefaultMatrix(),opacity:1}},e.prototype.onCanvasChange=function(t){},e.prototype.initAttrs=function(t){},e.prototype.initAnimate=function(){this.set("animable",!0),this.set("animating",!1)},e.prototype.isGroup=function(){return!1},e.prototype.getParent=function(){return this.get("parent")},e.prototype.getCanvas=function(){return this.get("canvas")},e.prototype.attr=function(){for(var t,e=[],n=0;n0?o=p(o,E):r.addAnimator(this),o.push(E),this.set("animations",o),this.set("_pause",{isPaused:!1})}},e.prototype.stopAnimate=function(t){var e=this;void 0===t&&(t=!0);var n=this.get("animations");Object(i.f)(n,(function(n){t&&(n.onFrame?e.attr(n.onFrame(1)):e.attr(n.toAttrs)),n.callback&&n.callback()})),this.set("animating",!1),this.set("animations",[])},e.prototype.pauseAnimate=function(){var t=this.get("timeline"),e=this.get("animations"),n=t.getTime();return Object(i.f)(e,(function(t){t._paused=!0,t._pauseTime=n,t.pauseCallback&&t.pauseCallback()})),this.set("_pause",{isPaused:!0,pauseTime:n}),this},e.prototype.resumeAnimate=function(){var t=this.get("timeline").getTime(),e=this.get("animations"),n=this.get("_pause").pauseTime;return Object(i.f)(e,(function(e){e.startTime=e.startTime+(t-n),e._paused=!1,e._pauseTime=null,e.resumeCallback&&e.resumeCallback()})),this.set("_pause",{isPaused:!1}),this.set("animations",e),this},e.prototype.emitDelegation=function(t,e){var n,r=this,o=e.propagationPath;this.getEvents();"mouseenter"===t?n=e.fromShape:"mouseleave"===t&&(n=e.toShape);for(var s=function(t){var s=o[t],c=s.get("name");if(c){if((s.isGroup()||s.isCanvas&&s.isCanvas())&&n&&Object(a.g)(s,n))return"break";Object(i.m)(c)?Object(i.f)(c,(function(t){r.emitDelegateEvent(s,t,e)})):u.emitDelegateEvent(s,c,e)}},u=this,c=0;c=0&&s<.5*Math.PI?(r={x:f.minX,y:f.minY},o={x:f.maxX,y:f.maxY}):.5*Math.PI<=s&&sa){var s=o;o=a,a=s}return o+""+a+""+(i.isUndefined(r)?"\\0":r)}function c(t,e,n,r){var i=""+e,o=""+n;if(!t&&i>o){var a=i;i=o,o=a}var s={v:i,w:o};return r&&(s.name=r),s}function f(t,e){return u(t,e.v,e.w,e.name)}o.prototype._nodeCount=0,o.prototype._edgeCount=0,o.prototype.isDirected=function(){return this._isDirected},o.prototype.isMultigraph=function(){return this._isMultigraph},o.prototype.isCompound=function(){return this._isCompound},o.prototype.setGraph=function(t){return this._label=t,this},o.prototype.graph=function(){return this._label},o.prototype.setDefaultNodeLabel=function(t){return i.isFunction(t)||(t=i.constant(t)),this._defaultNodeLabelFn=t,this},o.prototype.nodeCount=function(){return this._nodeCount},o.prototype.nodes=function(){return i.keys(this._nodes)},o.prototype.sources=function(){var t=this;return i.filter(this.nodes(),(function(e){return i.isEmpty(t._in[e])}))},o.prototype.sinks=function(){var t=this;return i.filter(this.nodes(),(function(e){return i.isEmpty(t._out[e])}))},o.prototype.setNodes=function(t,e){var n=arguments,r=this;return i.each(t,(function(t){n.length>1?r.setNode(t,e):r.setNode(t)})),this},o.prototype.setNode=function(t,e){return i.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]="\\0",this._children[t]={},this._children["\\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},o.prototype.node=function(t){return this._nodes[t]},o.prototype.hasNode=function(t){return i.has(this._nodes,t)},o.prototype.removeNode=function(t){var e=this;if(i.has(this._nodes,t)){var n=function(t){e.removeEdge(e._edgeObjs[t])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],i.each(this.children(t),(function(t){e.setParent(t)})),delete this._children[t]),i.each(i.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],i.each(i.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},o.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(i.isUndefined(e))e="\\0";else{for(var n=e+="";!i.isUndefined(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this},o.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},o.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if("\\0"!==e)return e}},o.prototype.children=function(t){if(i.isUndefined(t)&&(t="\\0"),this._isCompound){var e=this._children[t];if(e)return i.keys(e)}else{if("\\0"===t)return this.nodes();if(this.hasNode(t))return[]}},o.prototype.predecessors=function(t){var e=this._preds[t];if(e)return i.keys(e)},o.prototype.successors=function(t){var e=this._sucs[t];if(e)return i.keys(e)},o.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return i.union(e,this.successors(t))},o.prototype.isLeaf=function(t){return 0===(this.isDirected()?this.successors(t):this.neighbors(t)).length},o.prototype.filterNodes=function(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var n=this;i.each(this._nodes,(function(n,r){t(r)&&e.setNode(r,n)})),i.each(this._edgeObjs,(function(t){e.hasNode(t.v)&&e.hasNode(t.w)&&e.setEdge(t,n.edge(t))}));var r={};return this._isCompound&&i.each(e.nodes(),(function(t){e.setParent(t,function t(i){var o=n.parent(i);return void 0===o||e.hasNode(o)?(r[i]=o,o):o in r?r[o]:t(o)}(t))})),e},o.prototype.setDefaultEdgeLabel=function(t){return i.isFunction(t)||(t=i.constant(t)),this._defaultEdgeLabelFn=t,this},o.prototype.edgeCount=function(){return this._edgeCount},o.prototype.edges=function(){return i.values(this._edgeObjs)},o.prototype.setPath=function(t,e){var n=this,r=arguments;return i.reduce(t,(function(t,i){return r.length>1?n.setEdge(t,i,e):n.setEdge(t,i),i})),this},o.prototype.setEdge=function(){var t,e,n,o,s=!1,f=arguments[0];"object"===r(f)&&null!==f&&"v"in f?(t=f.v,e=f.w,n=f.name,2===arguments.length&&(o=arguments[1],s=!0)):(t=f,e=arguments[1],n=arguments[3],arguments.length>2&&(o=arguments[2],s=!0)),t=""+t,e=""+e,i.isUndefined(n)||(n=""+n);var l=u(this._isDirected,t,e,n);if(i.has(this._edgeLabels,l))return s&&(this._edgeLabels[l]=o),this;if(!i.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[l]=s?o:this._defaultEdgeLabelFn(t,e,n);var h=c(this._isDirected,t,e,n);return t=h.v,e=h.w,Object.freeze(h),this._edgeObjs[l]=h,a(this._preds[e],t),a(this._sucs[t],e),this._in[e][l]=h,this._out[t][l]=h,this._edgeCount++,this},o.prototype.edge=function(t,e,n){var r=1===arguments.length?f(this._isDirected,arguments[0]):u(this._isDirected,t,e,n);return this._edgeLabels[r]},o.prototype.hasEdge=function(t,e,n){var r=1===arguments.length?f(this._isDirected,arguments[0]):u(this._isDirected,t,e,n);return i.has(this._edgeLabels,r)},o.prototype.removeEdge=function(t,e,n){var r=1===arguments.length?f(this._isDirected,arguments[0]):u(this._isDirected,t,e,n),i=this._edgeObjs[r];return i&&(t=i.v,e=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],s(this._preds[e],t),s(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this},o.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var r=i.values(n);return e?i.filter(r,(function(t){return t.v===e})):r}},o.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var r=i.values(n);return e?i.filter(r,(function(t){return t.w===e})):r}},o.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))}},function(t,e,n){var r=n(65)(n(45),"Map");t.exports=r},function(t,e,n){var r=n(307),i=n(314),o=n(316),a=n(317),s=n(318);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t<=9007199254740991}},function(t,e,n){(function(t){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=n(178),o="object"==r(e)&&e&&!e.nodeType&&e,a=o&&"object"==r(t)&&t&&!t.nodeType&&t,s=a&&a.exports===o&&i.process,u=function(){try{var t=a&&a.require&&a.require("util").types;return t||s&&s.binding&&s.binding("util")}catch(t){}}();t.exports=u}).call(this,n(72)(t))},function(t,e,n){var r=n(106),i=n(324),o=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return i(t);var e=[];for(var n in Object(t))o.call(t,n)&&"constructor"!=n&&e.push(n);return e}},function(t,e,n){var r=n(186),i=n(187),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(t){return null==t?[]:(t=Object(t),r(a(t),(function(e){return o.call(t,e)})))}:i;t.exports=s},function(t,e){t.exports=function(t,e){for(var n=-1,r=e.length,i=t.length;++n0&&o(f)?n>1?t(f,n-1,o,a,s):r(s,f):a||(s[s.length]=f)}return s}},function(t,e,n){var r=n(77);t.exports=function(t,e,n){for(var i=-1,o=t.length;++i-1}},function(t,e,n){"use strict";e.a=function(t){var e=a(t);return null!==t&&"object"===e||"function"===e}},function(t,e,n){"use strict";var r=n(2),i=n(1);e.a=function(t,e){if(!Object(i.a)(t))return t;var n=[];return Object(r.a)(t,(function(t,r){e(t,r)&&n.push(t)})),n}},function(t,e,n){"use strict";e.a=function(t){return"object"===a(t)&&null!==t}},function(t,e,n){"use strict";function r(t,e){for(var n in e)e.hasOwnProperty(n)&&"constructor"!==n&&void 0!==e[n]&&(t[n]=e[n])}e.a=function(t,e,n,i){return e&&r(t,e),n&&r(t,n),i&&r(t,i),t}},function(t,e,n){var r=n(30),i=["LR","RL","TB","BT","H","V"],o=["LR","RL","H"],a=i[0];t.exports=function(t,e,n){var s=e.direction||a;if(e.isHorizontal=function(t){return o.indexOf(t)>-1}(s),s&&-1===i.indexOf(s))throw new TypeError("Invalid direction: "+s);if(s===i[0])n(t,e);else if(s===i[1])n(t,e),t.right2left();else if(s===i[2])n(t,e);else if(s===i[3])n(t,e),t.bottom2top();else if(s===i[4]||s===i[5]){var u=r(t,e),c=u.left,f=u.right;n(c,e),n(f,e),e.isHorizontal?c.right2left():c.bottom2top(),f.translate(c.x-f.x,c.y-f.y),t.x=c.x,t.y=f.y;var l=t.getBoundingBox();e.isHorizontal?l.top<0&&t.translate(0,-l.top):l.left<0&&t.translate(-l.left,0)}var h=e.fixedRoot;return void 0===h&&(h=!0),h&&t.translate(-(t.x+t.width/2+t.hgap),-(t.y+t.height/2+t.vgap)),t}},function(t,e,n){var r=n(7),i={getId:function(t){return t.id||t.name},getHGap:function(t){return t.hgap||18},getVGap:function(t){return t.vgap||18},getChildren:function(t){return t.children},getHeight:function(t){return t.height||36},getWidth:function(t){var e=t.label||" ";return t.width||18*e.split("").length}};function o(t,e){var n=this;if(n.vgap=n.hgap=0,t instanceof o)return t;n.data=t;var r=e.getHGap(t),i=e.getVGap(t);return n.width=e.getWidth(t),n.height=e.getHeight(t),n.id=e.getId(t),n.x=n.y=0,n.depth=0,n.children||(n.children=[]),n.addGap(r,i),n}r.assign(o.prototype,{isRoot:function(){return 0===this.depth},isLeaf:function(){return 0===this.children.length},addGap:function(t,e){this.hgap+=t,this.vgap+=e,this.width+=2*t,this.height+=2*e},eachNode:function(t){for(var e,n=[this];e=n.shift();)t(e),n=e.children.concat(n)},DFTraverse:function(t){this.eachNode(t)},BFTraverse:function(t){for(var e,n=[this];e=n.shift();)t(e),n=n.concat(e.children)},getBoundingBox:function(){var t={left:Number.MAX_VALUE,top:Number.MAX_VALUE,width:0,height:0};return this.eachNode((function(e){t.left=Math.min(t.left,e.x),t.top=Math.min(t.top,e.y),t.width=Math.max(t.width,e.x+e.width),t.height=Math.max(t.height,e.y+e.height)})),t},translate:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.eachNode((function(n){n.x+=t,n.y+=e}))},right2left:function(){var t=this.getBoundingBox();this.eachNode((function(e){e.x=e.x-2*(e.x-t.left)-e.width})),this.translate(t.width,0)},bottom2top:function(){var t=this.getBoundingBox();this.eachNode((function(e){e.y=e.y-2*(e.y-t.top)-e.height})),this.translate(0,t.height)}}),t.exports=function(t,e,n){void 0===e&&(e={});var a,s=new o(t,e=r.assign({},i,e)),u=[s];if(!n&&!t.collapsed)for(;a=u.shift();)if(!a.data.collapsed){var c=e.getChildren(a.data),f=c?c.length:0;if(a.children=new Array(f),c&&f)for(var l=0;l-1;)i.call(t,s,1);return t}},function(t,e,n){"use strict";var r=n(2),i=n(0),o=n(9);e.a=function(t,e,n){if(!Object(i.a)(t)&&!Object(o.a)(t))return t;var a=n;return Object(r.a)(t,(function(t,n){a=e(a,t,n)})),a}},function(t,e,n){"use strict";var r=n(1),i=n(21);e.a=function(t,e){var n=[];if(!Object(r.a)(t))return n;for(var o=-1,a=[],s=t.length;++oe[r])return 1;if(t[r]n?n:t}},function(t,e,n){"use strict";e.a=function(t,e){var n=e.toString(),r=n.indexOf(".");if(-1===r)return Math.round(t);var i=n.substr(r+1).length;return i>20&&(i=20),parseFloat(t.toFixed(i))}},function(t,e,n){"use strict";var r=n(5);e.a=function(t){return Object(r.a)(t)&&t%1!=0}},function(t,e,n){"use strict";var r=n(5);e.a=function(t){return Object(r.a)(t)&&t%2==0}},function(t,e,n){"use strict";var r=n(5),i=Number.isInteger?Number.isInteger:function(t){return Object(r.a)(t)&&t%1==0};e.a=i},function(t,e,n){"use strict";var r=n(5);e.a=function(t){return Object(r.a)(t)&&t<0}},function(t,e,n){"use strict";e.a=function(t,e,n){return void 0===n&&(n=1e-5),Math.abs(t-e)0}},function(t,e,n){"use strict";var r=n(2),i=n(0),o=n(3);e.a=function(t,e){if(Object(i.a)(t)){var n,a,s=t[0];return n=Object(o.a)(e)?e(t[0]):t[0][e],Object(r.a)(t,(function(t){(a=Object(o.a)(e)?e(t):t[e])>n&&(s=t,n=a)})),s}}},function(t,e,n){"use strict";var r=n(2),i=n(0),o=n(3);e.a=function(t,e){if(Object(i.a)(t)){var n,a,s=t[0];return n=Object(o.a)(e)?e(t[0]):t[0][e],Object(r.a)(t,(function(t){(a=Object(o.a)(e)?e(t):t[e])e?(r&&(clearTimeout(r),r=null),s=c,a=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(u,f)),a};return c.cancel=function(){clearTimeout(r),s=0,r=i=o=null},c}},function(t,e,n){"use strict";var r=n(1);e.a=function(t){return Object(r.a)(t)?Array.prototype.slice.call(t):[]}},function(t,e,n){"use strict";var r={};e.a=function(t){return r[t=t||"g"]?r[t]+=1:r[t]=1,t+r[t]}},function(t,e,n){"use strict";e.a=function(){}},function(t,e,n){"use strict";e.a=function(t){return t}},function(t,e,n){"use strict";e.a=function(t){return Object(r.a)(t)?0:Object(i.a)(t)?t.length:Object.keys(t).length};var r=n(6),i=n(1)},function(t,e,n){"use strict";var r=function(){function t(){this.map={}}return t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,e){var n=this.map[t];return void 0===n?e:n},t.prototype.set=function(t,e){this.map[t]=e},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length},t}();e.a=r},function(t,e){function n(t,e,n,r){void 0===r&&(r=[]);var i=this;i.w=t||0,i.h=e||0,i.y=n||0,i.x=0,i.c=r||[],i.cs=r.length,i.prelim=0,i.mod=0,i.shift=0,i.change=0,i.tl=null,i.tr=null,i.el=null,i.er=null,i.msel=0,i.mser=0}function r(t,e){var n=function t(e,n){var r=n?e.y:e.x;return e.children.forEach((function(e){r=Math.min(t(e,n),r)})),r}(t,e);!function t(e,n,r){r?e.y+=n:e.x+=n,e.children.forEach((function(e){t(e,n,r)}))}(t,-n,e)}n.fromNode=function(t,e){if(!t)return null;var r=[];return t.children.forEach((function(t){r.push(n.fromNode(t,e))})),e?new n(t.height,t.width,t.x,r):new n(t.width,t.height,t.y,r)},t.exports=function(t,e){void 0===e&&(e={});var i=e.isHorizontal;function o(t){0===t.cs?(t.el=t,t.er=t,t.msel=t.mser=0):(t.el=t.c[0].el,t.msel=t.c[0].msel,t.er=t.c[t.cs-1].er,t.mser=t.c[t.cs-1].mser)}function a(t,e,n){for(var r=t.c[e-1],i=r.mod,o=t.c[e],a=o.mod;null!==r&&null!==o;){f(r)>n.low&&(n=n.nxt);var l=i+r.prelim+r.w-(a+o.prelim);l>0&&(a+=l,s(t,e,n.index,l));var h=f(r),d=f(o);h<=d&&null!==(r=c(r))&&(i+=r.mod),h>=d&&null!==(o=u(o))&&(a+=o.mod)}!r&&o?function(t,e,n,r){var i=t.c[0].el;i.tl=n;var o=r-n.mod-t.c[0].msel;i.mod+=o,i.prelim-=o,t.c[0].el=t.c[e].el,t.c[0].msel=t.c[e].msel}(t,e,o,a):r&&!o&&function(t,e,n,r){var i=t.c[e].er;i.tr=n;var o=r-n.mod-t.c[e].mser;i.mod+=o,i.prelim-=o,t.c[e].er=t.c[e-1].er,t.c[e].mser=t.c[e-1].mser}(t,e,r,i)}function s(t,e,n,r){t.c[e].mod+=r,t.c[e].msel+=r,t.c[e].mser+=r,function(t,e,n,r){if(n!==e-1){var i=e-n;t.c[n+1].shift+=r/i,t.c[e].shift-=r/i,t.c[e].change-=r-r/i}}(t,e,n,r)}function u(t){return 0===t.cs?t.tl:t.c[0]}function c(t){return 0===t.cs?t.tr:t.c[t.cs-1]}function f(t){return t.y+t.h}function l(t,e,n){for(;null!==n&&t>=n.low;)n=n.nxt;return{low:t,index:e,nxt:n}}!function t(e,n,r){void 0===r&&(r=0),n?(e.x=r,r+=e.width):(e.y=r,r+=e.height),e.children.forEach((function(e){t(e,n,r)}))}(t,i);var h=n.fromNode(t,i);return function t(e){if(0!==e.cs){t(e.c[0]);for(var n=l(f(e.c[0].el),0,null),r=1;ra&&(a=e.depth);var n=e.children,r=n.length,o=new i(e.height,[]);return n.forEach((function(e,n){var i=t(e);o.children.push(i),0===n&&(o.leftChild=i),n===r-1&&(o.rightChild=i)})),o.originNode=e,o.isLeaf=e.isLeaf(),o}(t);return function t(e){if(e.isLeaf||0===e.children.length)e.drawingDepth=a;else{var n=e.children.map((function(e){return t(e)})),r=Math.min.apply(null,n);e.drawingDepth=r-1}return e.drawingDepth}(s),function t(r){r.x=r.drawingDepth*e.rankSep,r.isLeaf?(r.y=0,n&&(r.y=n.y+n.height+e.nodeSep,r.originNode.parent!==n.originNode.parent&&(r.y+=e.subTreeSep)),n=r):(r.children.forEach((function(e){t(e)})),r.y=(r.leftChild.y+r.rightChild.y)/2)}(s),function t(e,n,r){r?(n.x=e.x,n.y=e.y):(n.x=e.y,n.y=e.x),e.children.forEach((function(e,i){t(e,n.children[i],r)}))}(s,t,e.isHorizontal),t}},function(t,e,n){var r=n(11),i=n(117),o=n(30),a=n(7),s=["LR","RL","H"],u=s[0],c=function(t){var e,n;function r(){return t.apply(this,arguments)||this}return n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,r.prototype.execute=function(){var t=this.options,e=this.rootNode;t.isHorizontal=!0;var n=t.indent,r=void 0===n?20:n,a=t.dropCap,c=void 0===a||a,f=t.direction||u;if(f&&-1===s.indexOf(f))throw new TypeError("Invalid direction: "+f);if(f===s[0])i(e,r,c);else if(f===s[1])i(e,r,c),e.right2left();else if(f===s[2]){var l=o(e,t),h=l.left,d=l.right;i(h,r,c),h.right2left(),i(d,r,c);var p=h.getBoundingBox();d.translate(p.width,0),e.x=d.x-e.width/2}return e},r}(r),f={};t.exports=function(t,e){return e=a.assign({},f,e),new c(t,e).execute()}},function(t,e){t.exports=function(t,e,n){var r=null;t.eachNode((function(t){!function(t,e,n,r){if(!r)try{if(t.id===t.parent.children[0].id)return t.x+=n*t.depth,void(t.y=e?e.y:0)}catch(t){}t.x+=n*t.depth,t.y=e?e.y+e.height:0}(t,r,e,n),r=t}))}},function(t,e,n){var r=n(11),i=n(119),o=n(17),a=n(7),s=function(t){var e,n;function r(){return t.apply(this,arguments)||this}return n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,r.prototype.execute=function(){return o(this.rootNode,this.options,i)},r}(r),u={};t.exports=function(t,e){return e=a.assign({},u,e),new s(t,e).execute()}},function(t,e,n){var r=n(7),i={getSubTreeSep:function(){return 0}};t.exports=function(t,e){void 0===e&&(e={}),e=r.assign({},i,e),t.parent={x:0,width:0,height:0,y:0},t.BFTraverse((function(t){t.x=t.parent.x+t.parent.width})),t.parent=null,function t(e,n){var r=0;return e.children.length?e.children.forEach((function(e){r+=t(e,n)})):r=e.height,e._subTreeSep=n.getSubTreeSep(e.data),e.totalHeight=Math.max(e.height,r)+2*e._subTreeSep,e.totalHeight}(t,e),t.startY=0,t.y=t.totalHeight/2-t.height/2,t.eachNode((function(t){var e=t.children,n=e.length;if(n){var r=e[0];if(r.startY=t.startY+t._subTreeSep,1===n)r.y=t.y+t.height/2-r.height/2;else{r.y=r.startY+r.totalHeight/2-r.height/2;for(var i=1;ie.height)e.y=i.y+a/2-e.height/2;else if(1!==n.length||e.height>s){var u=e.y+(e.height-a)/2-i.y;n.forEach((function(t){t.translate(0,u)}))}else e.y=(i.y+i.height/2+o.y+o.height/2)/2-e.height/2}}(t)}}])},"object"===a(e)&&"object"===a(t)?t.exports=o():(r=[],void 0===(i="function"==typeof(n=o)?n.apply(e,r):n)||(t.exports=i))}).call(this,n(72)(t))},function(t,e){},function(t,e){},function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var u,c=[],f=!1,l=-1;function h(){f&&u&&(f=!1,u.length?c=u.concat(c):l=-1,c.length&&d())}function d(){if(!f){var t=s(h);f=!0;for(var e=c.length;e;){for(u=c,c=[];++l1)for(var n=1;n=t&&n.minY<=e&&n.maxY>=e},e.prototype.afterAttrsChange=function(e){t.prototype.afterAttrsChange.call(this,e),this.clearCacheBBox()},e.prototype.getBBox=function(){var t=this.cfg.bbox;return t||(t=this.calculateBBox(),this.set("bbox",t)),t},e.prototype.getCanvasBBox=function(){var t=this.cfg.canvasBBox;return t||(t=this.calculateCanvasBBox(),this.set("canvasBBox",t)),t},e.prototype.applyMatrix=function(e){t.prototype.applyMatrix.call(this,e),this.set("canvasBBox",null)},e.prototype.calculateCanvasBBox=function(){var t=this.getBBox(),e=this.getTotalMatrix(),n=t.minX,r=t.minY,i=t.maxX,a=t.maxY;if(e){var s=Object(o.c)(e,[t.minX,t.minY]),u=Object(o.c)(e,[t.maxX,t.minY]),c=Object(o.c)(e,[t.minX,t.maxY]),f=Object(o.c)(e,[t.maxX,t.maxY]);n=Math.min(s[0],u[0],c[0],f[0]),i=Math.max(s[0],u[0],c[0],f[0]),r=Math.min(s[1],u[1],c[1],f[1]),a=Math.max(s[1],u[1],c[1],f[1])}var l=this.attrs;if(l.shadowColor){var h=l.shadowBlur,d=void 0===h?0:h,p=l.shadowOffsetX,g=void 0===p?0:p,v=l.shadowOffsetY,y=void 0===v?0:v,m=n-d+g,b=i+d+g,x=r-d+y,w=a+d+y;n=Math.min(n,m),i=Math.max(i,b),r=Math.min(r,x),a=Math.max(a,w)}return{x:n,y:r,minX:n,minY:r,maxX:i,maxY:a,width:i-n,height:a-r}},e.prototype.clearCacheBBox=function(){this.set("bbox",null),this.set("canvasBBox",null)},e.prototype.isClipShape=function(){return this.get("isClipShape")},e.prototype.isInShape=function(t,e){return!1},e.prototype.isOnlyHitBox=function(){return!1},e.prototype.isHit=function(t,e){var n=this.get("startArrowShape"),r=this.get("endArrowShape"),i=[t,e,1],o=(i=this.invertFromMatrix(i))[0],a=i[1],s=this._isInBBox(o,a);if(this.isOnlyHitBox())return s;if(s&&!this.isClipped(o,a)){if(this.isInShape(o,a))return!0;if(n&&n.isHit(o,a))return!0;if(r&&r.isHit(o,a))return!0}return!1},e}(i.a);e.a=a},function(t,e,n){var r=n(286),i={};for(var o in r)r.hasOwnProperty(o)&&(i[r[o]]=o);var a=t.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var s in a)if(a.hasOwnProperty(s)){if(!("channels"in a[s]))throw new Error("missing channels property: "+s);if(!("labels"in a[s]))throw new Error("missing channel labels property: "+s);if(a[s].labels.length!==a[s].channels)throw new Error("channel and label counts mismatch: "+s);var u=a[s].channels,c=a[s].labels;delete a[s].channels,delete a[s].labels,Object.defineProperty(a[s],"channels",{value:u}),Object.defineProperty(a[s],"labels",{value:c})}a.rgb.hsl=function(t){var e,n,r=t[0]/255,i=t[1]/255,o=t[2]/255,a=Math.min(r,i,o),s=Math.max(r,i,o),u=s-a;return s===a?e=0:r===s?e=(i-o)/u:i===s?e=2+(o-r)/u:o===s&&(e=4+(r-i)/u),(e=Math.min(60*e,360))<0&&(e+=360),n=(a+s)/2,[e,100*(s===a?0:n<=.5?u/(s+a):u/(2-s-a)),100*n]},a.rgb.hsv=function(t){var e,n,r,i,o,a=t[0]/255,s=t[1]/255,u=t[2]/255,c=Math.max(a,s,u),f=c-Math.min(a,s,u),l=function(t){return(c-t)/6/f+.5};return 0===f?i=o=0:(o=f/c,e=l(a),n=l(s),r=l(u),a===c?i=r-n:s===c?i=1/3+e-r:u===c&&(i=2/3+n-e),i<0?i+=1:i>1&&(i-=1)),[360*i,100*o,100*c]},a.rgb.hwb=function(t){var e=t[0],n=t[1],r=t[2];return[a.rgb.hsl(t)[0],100*(1/255*Math.min(e,Math.min(n,r))),100*(r=1-1/255*Math.max(e,Math.max(n,r)))]},a.rgb.cmyk=function(t){var e,n=t[0]/255,r=t[1]/255,i=t[2]/255;return[100*((1-n-(e=Math.min(1-n,1-r,1-i)))/(1-e)||0),100*((1-r-e)/(1-e)||0),100*((1-i-e)/(1-e)||0),100*e]},a.rgb.keyword=function(t){var e=i[t];if(e)return e;var n,o,a,s=1/0;for(var u in r)if(r.hasOwnProperty(u)){var c=r[u],f=(o=t,a=c,Math.pow(o[0]-a[0],2)+Math.pow(o[1]-a[1],2)+Math.pow(o[2]-a[2],2));f.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)),100*(.2126*e+.7152*n+.0722*r),100*(.0193*e+.1192*n+.9505*r)]},a.rgb.lab=function(t){var e=a.rgb.xyz(t),n=e[0],r=e[1],i=e[2];return r/=100,i/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(n-r),200*(r-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},a.hsl.rgb=function(t){var e,n,r,i,o,a=t[0]/360,s=t[1]/100,u=t[2]/100;if(0===s)return[o=255*u,o,o];e=2*u-(n=u<.5?u*(1+s):u+s-u*s),i=[0,0,0];for(var c=0;c<3;c++)(r=a+1/3*-(c-1))<0&&r++,r>1&&r--,o=6*r<1?e+6*(n-e)*r:2*r<1?n:3*r<2?e+(n-e)*(2/3-r)*6:e,i[c]=255*o;return i},a.hsl.hsv=function(t){var e=t[0],n=t[1]/100,r=t[2]/100,i=n,o=Math.max(r,.01);return n*=(r*=2)<=1?r:2-r,i*=o<=1?o:2-o,[e,100*(0===r?2*i/(o+i):2*n/(r+n)),100*((r+n)/2)]},a.hsv.rgb=function(t){var e=t[0]/60,n=t[1]/100,r=t[2]/100,i=Math.floor(e)%6,o=e-Math.floor(e),a=255*r*(1-n),s=255*r*(1-n*o),u=255*r*(1-n*(1-o));switch(r*=255,i){case 0:return[r,u,a];case 1:return[s,r,a];case 2:return[a,r,u];case 3:return[a,s,r];case 4:return[u,a,r];case 5:return[r,a,s]}},a.hsv.hsl=function(t){var e,n,r,i=t[0],o=t[1]/100,a=t[2]/100,s=Math.max(a,.01);return r=(2-o)*a,n=o*s,[i,100*(n=(n/=(e=(2-o)*s)<=1?e:2-e)||0),100*(r/=2)]},a.hwb.rgb=function(t){var e,n,r,i,o,a,s,u=t[0]/360,c=t[1]/100,f=t[2]/100,l=c+f;switch(l>1&&(c/=l,f/=l),r=6*u-(e=Math.floor(6*u)),0!=(1&e)&&(r=1-r),i=c+r*((n=1-f)-c),e){default:case 6:case 0:o=n,a=i,s=c;break;case 1:o=i,a=n,s=c;break;case 2:o=c,a=n,s=i;break;case 3:o=c,a=i,s=n;break;case 4:o=i,a=c,s=n;break;case 5:o=n,a=c,s=i}return[255*o,255*a,255*s]},a.cmyk.rgb=function(t){var e=t[0]/100,n=t[1]/100,r=t[2]/100,i=t[3]/100;return[255*(1-Math.min(1,e*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i))]},a.xyz.rgb=function(t){var e,n,r,i=t[0]/100,o=t[1]/100,a=t[2]/100;return n=-.9689*i+1.8758*o+.0415*a,r=.0557*i+-.204*o+1.057*a,e=(e=3.2406*i+-1.5372*o+-.4986*a)>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,[255*(e=Math.min(Math.max(0,e),1)),255*(n=Math.min(Math.max(0,n),1)),255*(r=Math.min(Math.max(0,r),1))]},a.xyz.lab=function(t){var e=t[0],n=t[1],r=t[2];return n/=100,r/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(e-n),200*(n-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},a.lab.xyz=function(t){var e,n,r,i=t[0];e=t[1]/500+(n=(i+16)/116),r=n-t[2]/200;var o=Math.pow(n,3),a=Math.pow(e,3),s=Math.pow(r,3);return n=o>.008856?o:(n-16/116)/7.787,e=a>.008856?a:(e-16/116)/7.787,r=s>.008856?s:(r-16/116)/7.787,[e*=95.047,n*=100,r*=108.883]},a.lab.lch=function(t){var e,n=t[0],r=t[1],i=t[2];return(e=360*Math.atan2(i,r)/2/Math.PI)<0&&(e+=360),[n,Math.sqrt(r*r+i*i),e]},a.lch.lab=function(t){var e,n=t[0],r=t[1];return e=t[2]/360*2*Math.PI,[n,r*Math.cos(e),r*Math.sin(e)]},a.rgb.ansi16=function(t){var e=t[0],n=t[1],r=t[2],i=1 in arguments?arguments[1]:a.rgb.hsv(t)[2];if(0===(i=Math.round(i/50)))return 30;var o=30+(Math.round(r/255)<<2|Math.round(n/255)<<1|Math.round(e/255));return 2===i&&(o+=60),o},a.hsv.ansi16=function(t){return a.rgb.ansi16(a.hsv.rgb(t),t[2])},a.rgb.ansi256=function(t){var e=t[0],n=t[1],r=t[2];return e===n&&n===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},a.ansi16.rgb=function(t){var e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),[e=e/10.5*255,e,e];var n=.5*(1+~~(t>50));return[(1&e)*n*255,(e>>1&1)*n*255,(e>>2&1)*n*255]},a.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}var n;return t-=16,[Math.floor(t/36)/5*255,Math.floor((n=t%36)/6)/5*255,n%6/5*255]},a.rgb.hex=function(t){var e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},a.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var n=e[0];3===e[0].length&&(n=n.split("").map((function(t){return t+t})).join(""));var r=parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},a.rgb.hcg=function(t){var e,n=t[0]/255,r=t[1]/255,i=t[2]/255,o=Math.max(Math.max(n,r),i),a=Math.min(Math.min(n,r),i),s=o-a;return e=s<=0?0:o===n?(r-i)/s%6:o===r?2+(i-n)/s:4+(n-r)/s+4,e/=6,[360*(e%=1),100*s,100*(s<1?a/(1-s):0)]},a.hsl.hcg=function(t){var e=t[1]/100,n=t[2]/100,r=1,i=0;return(r=n<.5?2*e*n:2*e*(1-n))<1&&(i=(n-.5*r)/(1-r)),[t[0],100*r,100*i]},a.hsv.hcg=function(t){var e=t[1]/100,n=t[2]/100,r=e*n,i=0;return r<1&&(i=(n-r)/(1-r)),[t[0],100*r,100*i]},a.hcg.rgb=function(t){var e=t[0]/360,n=t[1]/100,r=t[2]/100;if(0===n)return[255*r,255*r,255*r];var i,o=[0,0,0],a=e%1*6,s=a%1,u=1-s;switch(Math.floor(a)){case 0:o[0]=1,o[1]=s,o[2]=0;break;case 1:o[0]=u,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=s;break;case 3:o[0]=0,o[1]=u,o[2]=1;break;case 4:o[0]=s,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=u}return i=(1-n)*r,[255*(n*o[0]+i),255*(n*o[1]+i),255*(n*o[2]+i)]},a.hcg.hsv=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e),r=0;return n>0&&(r=e/n),[t[0],100*r,100*n]},a.hcg.hsl=function(t){var e=t[1]/100,n=t[2]/100*(1-e)+.5*e,r=0;return n>0&&n<.5?r=e/(2*n):n>=.5&&n<1&&(r=e/(2*(1-n))),[t[0],100*r,100*n]},a.hcg.hwb=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e);return[t[0],100*(n-e),100*(1-n)]},a.hwb.hcg=function(t){var e=t[1]/100,n=1-t[2]/100,r=n-e,i=0;return r<1&&(i=(n-r)/(1-r)),[t[0],100*r,100*i]},a.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},a.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},a.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},a.gray.hsl=a.gray.hsv=function(t){return[0,0,t[0]]},a.gray.hwb=function(t){return[0,100,t[0]]},a.gray.cmyk=function(t){return[0,0,0,t[0]]},a.gray.lab=function(t){return[t[0],0,0]},a.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n},a.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}},function(t,e,n){var r=n(97),i=n(145),o=n(102),a=n(319),s=n(325),u=n(184),c=n(185),f=n(328),l=n(329),h=n(189),d=n(330),p=n(76),g=n(334),v=n(335),y=n(194),m=n(29),b=n(75),x=n(339),w=n(43),S=n(341),E=n(60),_=n(66),O={};O["[object Arguments]"]=O["[object Array]"]=O["[object ArrayBuffer]"]=O["[object DataView]"]=O["[object Boolean]"]=O["[object Date]"]=O["[object Float32Array]"]=O["[object Float64Array]"]=O["[object Int8Array]"]=O["[object Int16Array]"]=O["[object Int32Array]"]=O["[object Map]"]=O["[object Number]"]=O["[object Object]"]=O["[object RegExp]"]=O["[object Set]"]=O["[object String]"]=O["[object Symbol]"]=O["[object Uint8Array]"]=O["[object Uint8ClampedArray]"]=O["[object Uint16Array]"]=O["[object Uint32Array]"]=!0,O["[object Error]"]=O["[object Function]"]=O["[object WeakMap]"]=!1,t.exports=function t(e,n,k,M,A,T){var C,I=1&n,P=2&n,j=4&n;if(k&&(C=A?k(e,M,A,T):k(e)),void 0!==C)return C;if(!w(e))return e;var D=m(e);if(D){if(C=g(e),!I)return c(e,C)}else{var N=p(e),R="[object Function]"==N||"[object GeneratorFunction]"==N;if(b(e))return u(e,I);if("[object Object]"==N||"[object Arguments]"==N||R&&!A){if(C=P||R?{}:y(e),!I)return P?l(e,s(C,e)):f(e,a(C,e))}else{if(!O[N])return A?e:{};C=v(e,N,I)}}T||(T=new r);var L=T.get(e);if(L)return L;T.set(e,C),S(e)?e.forEach((function(r){C.add(t(r,n,k,r,e,T))})):x(e)&&e.forEach((function(r,i){C.set(i,t(r,n,k,i,e,T))}));var B=D?void 0:(j?P?d:h:P?_:E)(e);return i(B||e,(function(r,i){B&&(r=e[i=r]),o(C,i,t(r,n,k,i,e,T))})),C}},function(t,e,n){(function(e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var r="object"==(void 0===e?"undefined":n(e))&&e&&e.Object===Object&&e;t.exports=r}).call(this,n(179))},function(t,e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"===("undefined"==typeof window?"undefined":n(window))&&(r=window)}t.exports=r},function(t,e){var n=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return n.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},function(t,e,n){var r=n(65),i=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=i},function(t,e,n){var r=n(320),i=n(88),o=n(29),a=n(75),s=n(104),u=n(32),c=Object.prototype.hasOwnProperty;t.exports=function(t,e){var n=o(t),f=!n&&i(t),l=!n&&!f&&a(t),h=!n&&!f&&!l&&u(t),d=n||f||l||h,p=d?r(t.length,String):[],g=p.length;for(var v in t)!e&&!c.call(t,v)||d&&("length"==v||l&&("offset"==v||"parent"==v)||h&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||s(v,g))||p.push(v);return p}},function(t,e){t.exports=function(t,e){return function(n){return t(e(n))}}},function(t,e,n){(function(t){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=n(45),o="object"==r(e)&&e&&!e.nodeType&&e,a=o&&"object"==r(t)&&t&&!t.nodeType&&t,s=a&&a.exports===o?i.Buffer:void 0,u=s?s.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var n=t.length,r=u?u(n):new t.constructor(n);return t.copy(r),r}}).call(this,n(72)(t))},function(t,e){t.exports=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++nf))return!1;var h=u.get(t),d=u.get(e);if(h&&d)return h==e&&d==t;var p=-1,g=!0,v=2&n?new r:void 0;for(u.set(t,e),u.set(e,t);++p=200){var g=e?null:s(t);if(g)return u(g);h=!1,f=a,p=new r}else p=e?[]:d;t:for(;++c0&&(o=u.removeMin(),(a=s[o]).distance!==Number.POSITIVE_INFINITY);)r(o).forEach(c);return s}(t,String(e),n||o,r||function(e){return t.outEdges(e)})};var o=r.constant(1)},function(t,e,n){var r=n(42);function i(){this._arr=[],this._keyIndices={}}t.exports=i,i.prototype.size=function(){return this._arr.length},i.prototype.keys=function(){return this._arr.map((function(t){return t.key}))},i.prototype.has=function(t){return r.has(this._keyIndices,t)},i.prototype.priority=function(t){var e=this._keyIndices[t];if(void 0!==e)return this._arr[e].priority},i.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},i.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!r.has(n,t)){var i=this._arr,o=i.length;return n[t]=o,i.push({key:t,priority:e}),this._decrease(o),!0}return!1},i.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},i.prototype.decrease=function(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)},i.prototype._heapify=function(t){var e=this._arr,n=2*t,r=n+1,i=t;n>1].priority=0&&t=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){var e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){var n=this._find(t,!0);return this._values[n]=e,this},e.prototype.delete=function(e){var n=this._find(e,!1);if(n>=0){for(var r=this._keys.length,i=n+1;i=0;--n){var r=(0,t[n])(e);if(!S(r)&&!E(r)){if(!T(r))throw new TypeError;e=r}}return e}(t,e)}if(!M(t))throw new TypeError;if(!_(e))throw new TypeError;if(!_(r)&&!S(r)&&!E(r))throw new TypeError;return E(r)&&(r=void 0),function(t,e,n,r){for(var i=t.length-1;i>=0;--i){var o=(0,t[i])(e,n,r);if(!S(o)&&!E(o)){if(!_(o))throw new TypeError;r=o}}return r}(t,e,n=k(n),r)})),e("metadata",(function(t,e){return function(n,r){if(!_(n))throw new TypeError;if(!S(r)&&!function(t){switch(w(t)){case 3:case 4:return!0;default:return!1}}(r))throw new TypeError;b(t,e,n,r)}})),e("defineMetadata",(function(t,e,n,r){if(!_(n))throw new TypeError;return S(r)||(r=k(r)),b(t,e,n,r)})),e("hasMetadata",(function(t,e,n){if(!_(e))throw new TypeError;return S(n)||(n=k(n)),function t(e,n,r){if(y(e,n,r))return!0;var i=j(n);return!E(i)&&t(e,i,r)}(t,e,n)})),e("hasOwnMetadata",(function(t,e,n){if(!_(e))throw new TypeError;return S(n)||(n=k(n)),y(t,e,n)})),e("getMetadata",(function(t,e,n){if(!_(e))throw new TypeError;return S(n)||(n=k(n)),function t(e,n,r){if(y(e,n,r))return m(e,n,r);var i=j(n);return E(i)?void 0:t(e,i,r)}(t,e,n)})),e("getOwnMetadata",(function(t,e,n){if(!_(e))throw new TypeError;return S(n)||(n=k(n)),m(t,e,n)})),e("getMetadataKeys",(function(t,e){if(!_(t))throw new TypeError;return S(e)||(e=k(e)),function t(e,n){var r=x(e,n),i=j(e);if(null===i)return r;var o=t(i,n);if(o.length<=0)return r;if(r.length<=0)return o;for(var a=new p,s=[],u=0,c=r;u0)return!0;var i=g.get(e);return i.delete(n),i.size>0||g.delete(e),!0}))}(a)}()}(r||(r={}))}).call(this,n(173),n(179))},function(t,e,n){var r=n(234);t.exports=function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);no[0]&&(o[0]=s),u>o[1]&&(o[1]=u),c>o[2]&&(o[2]=c)}return e.setMinMax(n,o),e}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r="undefined"!=typeof navigator&&/Version\\/[\\d\\.]+.*Safari/.test(navigator.userAgent)},function(t,e,n){"use strict";var r=n(249);n.o(r,"AABB")&&n.d(e,"AABB",(function(){return r.AABB})),n.o(r,"Frustum")&&n.d(e,"Frustum",(function(){return r.Frustum}));n(270);var i=n(251);n.o(i,"AABB")&&n.d(e,"AABB",(function(){return i.AABB})),n.o(i,"Frustum")&&n.d(e,"Frustum",(function(){return i.Frustum}))},function(t,e,n){"use strict";n(132);var r=n(250);n.o(r,"AABB")&&n.d(e,"AABB",(function(){return r.AABB})),n.o(r,"Frustum")&&n.d(e,"Frustum",(function(){return r.Frustum}))},function(t,e){},function(t,e,n){"use strict";var r=n(252);n.o(r,"AABB")&&n.d(e,"AABB",(function(){return r.AABB})),n.o(r,"Frustum")&&n.d(e,"Frustum",(function(){return r.Frustum}));n(135)},function(t,e){},function(t,e){t.exports=1e-6},function(t,e){t.exports=function(){var t=new Float32Array(2);return t[0]=0,t[1]=0,t}},function(t,e){t.exports=function(t,e,n){return t[0]=e,t[1]=n,t}},function(t,e){t.exports=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}},function(t,e){t.exports=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}},function(t,e){t.exports=function(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}},function(t,e){t.exports=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(n*n+r*r)}},function(t,e){t.exports=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}},function(t,e){t.exports=function(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)}},function(t,e){t.exports=function(t){var e=t[0],n=t[1];return e*e+n*n}},function(t,e){t.exports=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);return t}},function(t,e){t.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]}},function(t,e,n){"use strict";var r={};n.r(r),n.d(r,"easeLinear",(function(){return M})),n.d(r,"easeQuad",(function(){return C})),n.d(r,"easeQuadIn",(function(){return A})),n.d(r,"easeQuadOut",(function(){return T})),n.d(r,"easeQuadInOut",(function(){return C})),n.d(r,"easeCubic",(function(){return j})),n.d(r,"easeCubicIn",(function(){return I})),n.d(r,"easeCubicOut",(function(){return P})),n.d(r,"easeCubicInOut",(function(){return j})),n.d(r,"easePoly",(function(){return R})),n.d(r,"easePolyIn",(function(){return D})),n.d(r,"easePolyOut",(function(){return N})),n.d(r,"easePolyInOut",(function(){return R})),n.d(r,"easeSin",(function(){return U})),n.d(r,"easeSinIn",(function(){return G})),n.d(r,"easeSinOut",(function(){return F})),n.d(r,"easeSinInOut",(function(){return U})),n.d(r,"easeExp",(function(){return X})),n.d(r,"easeExpIn",(function(){return V})),n.d(r,"easeExpOut",(function(){return W})),n.d(r,"easeExpInOut",(function(){return X})),n.d(r,"easeCircle",(function(){return q})),n.d(r,"easeCircleIn",(function(){return Y})),n.d(r,"easeCircleOut",(function(){return H})),n.d(r,"easeCircleInOut",(function(){return q})),n.d(r,"easeBounce",(function(){return Q})),n.d(r,"easeBounceIn",(function(){return Z})),n.d(r,"easeBounceOut",(function(){return Q})),n.d(r,"easeBounceInOut",(function(){return J})),n.d(r,"easeBack",(function(){return et})),n.d(r,"easeBackIn",(function(){return $})),n.d(r,"easeBackOut",(function(){return tt})),n.d(r,"easeBackInOut",(function(){return et})),n.d(r,"easeElastic",(function(){return it})),n.d(r,"easeElasticIn",(function(){return rt})),n.d(r,"easeElasticOut",(function(){return it})),n.d(r,"easeElasticInOut",(function(){return ot}));var i=n(1),o=n(139),a=n(137),s=n(19),u=n(0);function c(t){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var f,l,h=0,d=0,p=0,g=0,v=0,y=0,m="object"===("undefined"==typeof performance?"undefined":c(performance))&&performance.now?performance:Date,b="object"===("undefined"==typeof window?"undefined":c(window))&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function x(){return v||(b(w),v=m.now()+y)}function w(){v=0}function S(){this._call=this._time=this._next=null}function E(t,e,n){var r=new S;return r.restart(t,e,n),r}function _(){v=(g=m.now())+y,h=d=0;try{!function(){x(),++h;for(var t,e=f;e;)(t=v-e._time)>=0&&e._call.call(null,t),e=e._next;--h}()}finally{h=0,function(){var t,e,n=f,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:f=e);l=t,k(r)}(),v=0}}function O(){var t=m.now(),e=t-g;e>1e3&&(y-=e,g=t)}function k(t){h||(d&&(d=clearTimeout(d)),t-v>24?(t<1/0&&(d=setTimeout(_,t-m.now()-y)),p&&(p=clearInterval(p))):(p||(g=m.now(),p=setInterval(O,1e3)),h=1,b(_)))}function M(t){return+t}function A(t){return t*t}function T(t){return t*(2-t)}function C(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}function I(t){return t*t*t}function P(t){return--t*t*t+1}function j(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}S.prototype=E.prototype={constructor:S,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?x():+n)+(null==e?0:+e),this._next||l===this||(l?l._next=this:f=this,l=this),this._call=t,this._time=n,k()},stop:function(){this._call&&(this._call=null,this._time=1/0,k())}};var D=function t(e){function n(t){return Math.pow(t,e)}return e=+e,n.exponent=t,n}(3),N=function t(e){function n(t){return 1-Math.pow(1-t,e)}return e=+e,n.exponent=t,n}(3),R=function t(e){function n(t){return((t*=2)<=1?Math.pow(t,e):2-Math.pow(2-t,e))/2}return e=+e,n.exponent=t,n}(3),L=Math.PI,B=L/2;function G(t){return 1==+t?1:1-Math.cos(t*B)}function F(t){return Math.sin(t*B)}function U(t){return(1-Math.cos(L*t))/2}function z(t){return 1.0009775171065494*(Math.pow(2,-10*t)-.0009765625)}function V(t){return z(1-+t)}function W(t){return 1-z(t)}function X(t){return((t*=2)<=1?z(1-t):2-z(t-1))/2}function Y(t){return 1-Math.sqrt(1-t*t)}function H(t){return Math.sqrt(1- --t*t)}function q(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}var K=7.5625;function Z(t){return 1-Q(1-t)}function Q(t){return(t=+t)<4/11?K*t*t:t<8/11?K*(t-=6/11)*t+3/4:t<10/11?K*(t-=9/11)*t+15/16:K*(t-=21/22)*t+63/64}function J(t){return((t*=2)<=1?1-Q(1-t):Q(t-1)+1)/2}var $=function t(e){function n(t){return(t=+t)*t*(e*(t-1)+t)}return e=+e,n.overshoot=t,n}(1.70158),tt=function t(e){function n(t){return--t*t*((t+1)*e+t)+1}return e=+e,n.overshoot=t,n}(1.70158),et=function t(e){function n(t){return((t*=2)<1?t*t*((e+1)*t-e):(t-=2)*t*((e+1)*t+e)+2)/2}return e=+e,n.overshoot=t,n}(1.70158),nt=2*Math.PI,rt=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=nt);function i(t){return e*z(- --t)*Math.sin((r-t)/n)}return i.amplitude=function(e){return t(e,n*nt)},i.period=function(n){return t(e,n)},i}(1,.3),it=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=nt);function i(t){return 1-e*z(t=+t)*Math.sin((t+r)/n)}return i.amplitude=function(e){return t(e,n*nt)},i.period=function(n){return t(e,n)},i}(1,.3),ot=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=nt);function i(t){return((t=2*t-1)<0?e*z(-t)*Math.sin((r-t)/n):2-e*z(t)*Math.sin((r+t)/n))/2}return i.amplitude=function(e){return t(e,n*nt)},i.period=function(n){return t(e,n)},i}(1,.3),at=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t};function st(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function ut(){}var ct="\\\\s*([+-]?\\\\d+)\\\\s*",ft="\\\\s*([+-]?\\\\d*\\\\.?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*",lt="\\\\s*([+-]?\\\\d*\\\\.?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*",ht=/^#([0-9a-f]{3,8})$/,dt=new RegExp("^rgb\\\\("+[ct,ct,ct]+"\\\\)$"),pt=new RegExp("^rgb\\\\("+[lt,lt,lt]+"\\\\)$"),gt=new RegExp("^rgba\\\\("+[ct,ct,ct,ft]+"\\\\)$"),vt=new RegExp("^rgba\\\\("+[lt,lt,lt,ft]+"\\\\)$"),yt=new RegExp("^hsl\\\\("+[ft,lt,lt]+"\\\\)$"),mt=new RegExp("^hsla\\\\("+[ft,lt,lt,ft]+"\\\\)$"),bt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function xt(){return this.rgb().formatHex()}function wt(){return this.rgb().formatRgb()}function St(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=ht.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Et(e):3===n?new Mt(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?_t(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?_t(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=dt.exec(t))?new Mt(e[1],e[2],e[3],1):(e=pt.exec(t))?new Mt(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=gt.exec(t))?_t(e[1],e[2],e[3],e[4]):(e=vt.exec(t))?_t(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=yt.exec(t))?It(e[1],e[2]/100,e[3]/100,1):(e=mt.exec(t))?It(e[1],e[2]/100,e[3]/100,e[4]):bt.hasOwnProperty(t)?Et(bt[t]):"transparent"===t?new Mt(NaN,NaN,NaN,0):null}function Et(t){return new Mt(t>>16&255,t>>8&255,255&t,1)}function _t(t,e,n,r){return r<=0&&(t=e=n=NaN),new Mt(t,e,n,r)}function Ot(t){return t instanceof ut||(t=St(t)),t?new Mt((t=t.rgb()).r,t.g,t.b,t.opacity):new Mt}function kt(t,e,n,r){return 1===arguments.length?Ot(t):new Mt(t,e,n,null==r?1:r)}function Mt(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function At(){return"#"+Ct(this.r)+Ct(this.g)+Ct(this.b)}function Tt(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Ct(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function It(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new jt(t,e,n,r)}function Pt(t){if(t instanceof jt)return new jt(t.h,t.s,t.l,t.opacity);if(t instanceof ut||(t=St(t)),!t)return new jt;if(t instanceof jt)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n0&&u<1?0:a,new jt(a,s,u,t.opacity)}function jt(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Dt(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function Nt(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}at(ut,St,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:xt,formatHex:xt,formatHsl:function(){return Pt(this).formatHsl()},formatRgb:wt,toString:wt}),at(Mt,kt,st(ut,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Mt(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Mt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:At,formatHex:At,formatRgb:Tt,toString:Tt})),at(jt,(function(t,e,n,r){return 1===arguments.length?Pt(t):new jt(t,e,n,null==r?1:r)}),st(ut,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new jt(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new jt(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Mt(Dt(t>=240?t-240:t+120,i,r),Dt(t,i,r),Dt(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var Rt=function(t){return function(){return t}};function Lt(t,e){return function(n){return t+n*e}}function Bt(t){return 1==(t=+t)?Gt:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):Rt(isNaN(e)?n:e)}}function Gt(t,e){var n=e-t;return n?Lt(t,n):Rt(isNaN(t)?e:t)}var Ft=function t(e){var n=Bt(e);function r(t,e){var r=n((t=kt(t)).r,(e=kt(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=Gt(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function Ut(t){return function(e){var n,r,i=e.length,o=new Array(i),a=new Array(i),s=new Array(i);for(n=0;n=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=ro&&(i=e.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:Yt(n,r)})),o=Zt.lastIndex;return od.length?(h=te.parsePathString(o[l]),d=te.parsePathString(i[l]),d=te.fillPathByDiff(d,h),d=te.formatPath(d,h),e.fromAttrs.path=d,e.toAttrs.path=h):e.pathFormatted||(h=te.parsePathString(o[l]),d=te.parsePathString(i[l]),d=te.formatPath(d,h),e.fromAttrs.path=d,e.toAttrs.path=h,e.pathFormatted=!0),r[l]=[];for(var p=0;p0){for(var o=r.animators.length-1;o>=0;o--)if((t=r.animators[o]).destroyed)r.removeAnimator(o);else{if(!t.isAnimatePaused())for(var a=(e=t.get("animations")).length-1;a>=0;a--)n=e[a],ne(t,n,i)&&(e.splice(a,1),!1,n.callback&&n.callback());0===e.length&&r.removeAnimator(o)}r.canvas.get("autoDraw")||r.canvas.draw()}}))},t.prototype.addAnimator=function(t){this.animators.push(t)},t.prototype.removeAnimator=function(t){this.animators.splice(t,1)},t.prototype.isAnimating=function(){return!!this.animators.length},t.prototype.stop=function(){this.timer&&this.timer.stop()},t.prototype.stopAllAnimations=function(t){void 0===t&&(t=!0),this.animators.forEach((function(e){e.stopAnimate(t)})),this.animators=[],this.canvas.draw()},t.prototype.getTime=function(){return this.current},t}(),ie=n(116),oe=["mousedown","mouseup","dblclick","mouseout","mouseover","mousemove","mouseleave","mouseenter","touchstart","touchmove","touchend","dragenter","dragover","dragleave","drop","contextmenu","mousewheel"];function ae(t,e,n){n.name=e,n.target=t,n.currentTarget=t,n.delegateTarget=t,t.emit(e,n)}function se(t,e,n){if(n.bubbles){var r=void 0,i=!1;if("mouseenter"===e?(r=n.fromShape,i=!0):"mouseleave"===e&&(i=!0,r=n.toShape),t.isCanvas()&&i)return;if(r&&Object(s.g)(t,r))return void(n.bubbles=!1);n.name=e,n.currentTarget=t,n.delegateTarget=t,t.emit(e,n)}}var ue=function(){function t(t){var e=this;this.draggingShape=null,this.dragging=!1,this.currentShape=null,this.mousedownShape=null,this.mousedownPoint=null,this._eventCallback=function(t){var n=t.type;e._triggerEvent(n,t)},this._onDocumentMove=function(t){if(e.canvas.get("el")!==t.target&&(e.dragging||e.currentShape)){var n=e._getPointInfo(t);e.dragging&&e._emitEvent("drag",t,n,e.draggingShape)}},this._onDocumentMouseUp=function(t){if(e.canvas.get("el")!==t.target&&e.dragging){var n=e._getPointInfo(t);e.draggingShape&&e._emitEvent("drop",t,n,null),e._emitEvent("dragend",t,n,e.draggingShape),e._afterDrag(e.draggingShape,n,t)}},this.canvas=t.canvas}return t.prototype.init=function(){this._bindEvents()},t.prototype._bindEvents=function(){var t=this,e=this.canvas.get("el");Object(s.a)(oe,(function(n){e.addEventListener(n,t._eventCallback)})),document&&(document.addEventListener("mousemove",this._onDocumentMove),document.addEventListener("mouseup",this._onDocumentMouseUp))},t.prototype._clearEvents=function(){var t=this,e=this.canvas.get("el");Object(s.a)(oe,(function(n){e.removeEventListener(n,t._eventCallback)})),document&&(document.removeEventListener("mousemove",this._onDocumentMove),document.removeEventListener("mouseup",this._onDocumentMouseUp))},t.prototype._getEventObj=function(t,e,n,r,i,o){var a=new ie.a(t,e);return a.fromShape=i,a.toShape=o,a.x=n.x,a.y=n.y,a.clientX=n.clientX,a.clientY=n.clientY,a.propagationPath.push(r),a},t.prototype._getShape=function(t,e){return this.canvas.getShape(t.x,t.y,e)},t.prototype._getPointInfo=function(t){var e=this.canvas,n=e.getClientByEvent(t),r=e.getPointByEvent(t);return{x:r.x,y:r.y,clientX:n.x,clientY:n.y}},t.prototype._triggerEvent=function(t,e){var n=this._getPointInfo(e),r=this._getShape(n,e),i=this["_on"+t],o=!1;if(i)i.call(this,n,r,e);else{var a=this.currentShape;"mouseenter"===t||"dragenter"===t||"mouseover"===t?(this._emitEvent(t,e,n,null,null,r),r&&this._emitEvent(t,e,n,r,null,r),"mouseenter"===t&&this.draggingShape&&this._emitEvent("dragenter",e,n,null)):"mouseleave"===t||"dragleave"===t||"mouseout"===t?(o=!0,a&&this._emitEvent(t,e,n,a,a,null),this._emitEvent(t,e,n,null,a,null),"mouseleave"===t&&this.draggingShape&&this._emitEvent("dragleave",e,n,null)):this._emitEvent(t,e,n,r,null,null)}if(o||(this.currentShape=r),r&&!r.get("destroyed")){var s=this.canvas;s.get("el").style.cursor=r.attr("cursor")||s.get("cursor")}},t.prototype._onmousedown=function(t,e,n){0===n.button&&(this.mousedownShape=e,this.mousedownPoint=t,this.mousedownTimeStamp=n.timeStamp),this._emitEvent("mousedown",n,t,e,null,null)},t.prototype._emitMouseoverEvents=function(t,e,n,r){var i=this.canvas.get("el");n!==r&&(n&&(this._emitEvent("mouseout",t,e,n,n,r),this._emitEvent("mouseleave",t,e,n,n,r),r&&!r.get("destroyed")||(i.style.cursor=this.canvas.get("cursor"))),r&&(this._emitEvent("mouseover",t,e,r,n,r),this._emitEvent("mouseenter",t,e,r,n,r)))},t.prototype._emitDragoverEvents=function(t,e,n,r,i){r?(r!==n&&(n&&this._emitEvent("dragleave",t,e,n,n,r),this._emitEvent("dragenter",t,e,r,n,r)),i||this._emitEvent("dragover",t,e,r)):n&&this._emitEvent("dragleave",t,e,n,n,r),i&&this._emitEvent("dragover",t,e,r)},t.prototype._afterDrag=function(t,e,n){t&&(t.set("capture",!0),this.draggingShape=null),this.dragging=!1;var r=this._getShape(e,n);r!==t&&this._emitMouseoverEvents(n,e,t,r),this.currentShape=r},t.prototype._onmouseup=function(t,e,n){if(0===n.button){var r=this.draggingShape;this.dragging?(r&&this._emitEvent("drop",n,t,e),this._emitEvent("dragend",n,t,r),this._afterDrag(r,t,n)):(this._emitEvent("mouseup",n,t,e),e===this.mousedownShape&&this._emitEvent("click",n,t,e),this.mousedownShape=null,this.mousedownPoint=null)}},t.prototype._ondragover=function(t,e,n){n.preventDefault();var r=this.currentShape;this._emitDragoverEvents(n,t,r,e,!0)},t.prototype._onmousemove=function(t,e,n){var r=this.canvas,i=this.currentShape,o=this.draggingShape;if(this.dragging)o&&this._emitDragoverEvents(n,t,i,e,!1),this._emitEvent("drag",n,t,o);else{var a=this.mousedownPoint;if(a){var s=this.mousedownShape,u=n.timeStamp-this.mousedownTimeStamp,c=a.clientX-t.clientX,f=a.clientY-t.clientY;u>120||c*c+f*f>40?s&&s.get("draggable")?((o=this.mousedownShape).set("capture",!1),this.draggingShape=o,this.dragging=!0,this._emitEvent("dragstart",n,t,o),this.mousedownShape=null,this.mousedownPoint=null):!s&&r.get("draggable")?(this.dragging=!0,this._emitEvent("dragstart",n,t,null),this.mousedownShape=null,this.mousedownPoint=null):(this._emitMouseoverEvents(n,t,i,e),this._emitEvent("mousemove",n,t,e)):(this._emitMouseoverEvents(n,t,i,e),this._emitEvent("mousemove",n,t,e))}else this._emitMouseoverEvents(n,t,i,e),this._emitEvent("mousemove",n,t,e)}},t.prototype._emitEvent=function(t,e,n,r,i,o){var a=this._getEventObj(t,e,n,r,i,o);if(r){a.shape=r,ae(r,t,a);for(var s=r.getParent();s;)s.emitDelegation(t,a),a.propagationStopped||se(s,t,a),a.propagationPath.push(s),s=s.getParent()}else{ae(this.canvas,t,a)}},t.prototype.destroy=function(){this._clearEvents(),this.canvas=null,this.currentShape=null,this.draggingShape=null,this.mousedownPoint=null,this.mousedownShape=null,this.mousedownTimeStamp=null},t}(),ce=Object(o.a)(),fe=ce&&"firefox"===ce.name,le=function(t){function e(e){var n=t.call(this,e)||this;return n.initContainer(),n.initDom(),n.initEvents(),n.initTimeline(),n}return Object(i.b)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.cursor="default",e.supportCSSTransform=!1,e},e.prototype.initContainer=function(){var t=this.get("container");Object(s.h)(t)&&(t=document.getElementById(t),this.set("container",t))},e.prototype.initDom=function(){var t=this.createDom();this.set("el",t),this.get("container").appendChild(t),this.setDOMSize(this.get("width"),this.get("height"))},e.prototype.initEvents=function(){var t=new ue({canvas:this});t.init(),this.set("eventController",t)},e.prototype.initTimeline=function(){var t=new re(this);this.set("timeline",t)},e.prototype.setDOMSize=function(t,e){var n=this.get("el");s.c&&(n.style.width=t+"px",n.style.height=e+"px")},e.prototype.changeSize=function(t,e){this.setDOMSize(t,e),this.set("width",t),this.set("height",e),this.onCanvasChange("changeSize")},e.prototype.getRenderer=function(){return this.get("renderer")},e.prototype.getCursor=function(){return this.get("cursor")},e.prototype.setCursor=function(t){this.set("cursor",t);var e=this.get("el");s.c&&e&&(e.style.cursor=t)},e.prototype.getPointByEvent=function(t){if(this.get("supportCSSTransform")){if(fe&&!Object(s.e)(t.layerX)&&t.layerX!==t.offsetX)return{x:t.layerX,y:t.layerY};if(!Object(s.e)(t.offsetX))return{x:t.offsetX,y:t.offsetY}}var e=this.getClientByEvent(t),n=e.x,r=e.y;return this.getPointByClient(n,r)},e.prototype.getClientByEvent=function(t){var e=t;return t.touches&&(e="touchend"===t.type?t.changedTouches[0]:t.touches[0]),{x:e.clientX,y:e.clientY}},e.prototype.getPointByClient=function(t,e){var n=this.get("el").getBoundingClientRect();return{x:t-n.left,y:e-n.top}},e.prototype.getClientByPoint=function(t,e){var n=this.get("el").getBoundingClientRect();return{x:t+n.left,y:e+n.top}},e.prototype.draw=function(){},e.prototype.removeDom=function(){var t=this.get("el");t.parentNode.removeChild(t)},e.prototype.clearEvents=function(){this.get("eventController").destroy()},e.prototype.isCanvas=function(){return!0},e.prototype.getParent=function(){return null},e.prototype.destroy=function(){var e=this.get("timeline");this.get("destroyed")||(this.clear(),e&&e.stop(),this.clearEvents(),this.removeDom(),t.prototype.destroy.call(this))},e}(a.a);e.a=le},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=new Map;function i(t,e){r.set(t,e)}function o(t){return r.get(t)}var a=function(t){var e=t.attr();return{x:e.x,y:e.y,width:e.width,height:e.height}},s=function(t){var e=t.attr(),n=e.x,r=e.y,i=e.r;return{x:n-i,y:r-i,width:2*i,height:2*i}},u=n(20);function c(t,e){return t&&e?{minX:Math.min(t.minX,e.minX),minY:Math.min(t.minY,e.minY),maxX:Math.max(t.maxX,e.maxX),maxY:Math.max(t.maxY,e.maxY)}:t||e}function f(t,e){var n=t.get("startArrowShape"),r=t.get("endArrowShape");return n&&(e=c(e,n.getCanvasBBox())),r&&(e=c(e,r.getCanvasBBox())),e}var l=n(69),h=n(38),d=n(0);function p(t,e){var n=t.prePoint,r=t.currentPoint,i=t.nextPoint,o=Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2),a=Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2),s=Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2),u=Math.acos((o+a-s)/(2*Math.sqrt(o)*Math.sqrt(a)));if(!u||0===Math.sin(u)||Object(d.u)(u,0))return{xExtra:0,yExtra:0};var c=Math.abs(Math.atan2(i[1]-r[1],i[0]-r[0])),f=Math.abs(Math.atan2(i[0]-r[0],i[1]-r[1]));return c=c>Math.PI/2?Math.PI-c:c,f=f>Math.PI/2?Math.PI-f:f,{xExtra:Math.cos(u/2-c)*(e/2*(1/Math.sin(u/2)))-e/2||0,yExtra:Math.cos(f-u/2)*(e/2*(1/Math.sin(u/2)))-e/2||0}}i("rect",a),i("image",a),i("circle",s),i("marker",s),i("polyline",(function(t){for(var e=t.attr().points,n=[],r=[],i=0;i\'})),n}var v=function(){function t(t){this.cfg={};var e=null,n=Object(l.H)("gradient_");return"l"===t.toLowerCase()[0]?function(t,e){var n,r,i=h.exec(t),o=Object(l.B)(Object(l.G)(parseFloat(i[1])),2*Math.PI),a=i[2];o>=0&&o<.5*Math.PI?(n={x:0,y:0},r={x:1,y:1}):.5*Math.PI<=o&&o\';e.innerHTML=n},t}(),x=function(){function t(t,e){this.cfg={};var n=Object(u.b)("marker"),r=Object(l.H)("marker_");n.setAttribute("id",r);var i=Object(u.b)("path");i.setAttribute("stroke",t.stroke||"none"),i.setAttribute("fill",t.fill||"none"),n.appendChild(i),n.setAttribute("overflow","visible"),n.setAttribute("orient","auto-start-reverse"),this.el=n,this.child=i,this.id=r;var o=t["marker-start"===e?"startArrow":"endArrow"];return this.stroke=t.stroke||"#000",!0===o?this._setDefaultPath(e,i):(this.cfg=o,this._setMarker(t.lineWidth,i)),this}return t.prototype.match=function(){return!1},t.prototype._setDefaultPath=function(t,e){var n=this.el;e.setAttribute("d","M0,0 L"+10*Math.cos(Math.PI/6)+",5 L0,10"),n.setAttribute("refX",""+10*Math.cos(Math.PI/6)),n.setAttribute("refY","5")},t.prototype._setMarker=function(t,e){var n=this.el,r=this.cfg.path,i=this.cfg.d;Object(l.m)(r)&&(r=r.map((function(t){return t.join(" ")})).join("")),e.setAttribute("d",r),n.appendChild(e),i&&n.setAttribute("refX",""+i/t)},t.prototype.update=function(t){var e=this.child;e.attr?e.attr("fill",t):e.setAttribute("fill",t)},t}(),w=function(){function t(t){this.type="clip",this.cfg={};var e=Object(u.b)("clipPath");this.el=e,this.id=Object(l.H)("clip_"),e.id=this.id;var n=t.cfg.el;return e.appendChild(n),this.cfg=t,this}return t.prototype.match=function(){return!1},t.prototype.remove=function(){var t=this.el;t.parentNode.removeChild(t)},t}(),S=/^p\\s*\\(\\s*([axyn])\\s*\\)\\s*(.*)/i,E=function(){function t(t){this.cfg={};var e=Object(u.b)("pattern");e.setAttribute("patternUnits","userSpaceOnUse");var n=Object(u.b)("image");e.appendChild(n);var r=Object(l.H)("pattern_");e.id=r,this.el=e,this.id=r,this.cfg=t;var i=S.exec(t)[2];n.setAttribute("href",i);var o=new Image;function a(){e.setAttribute("width",""+o.width),e.setAttribute("height",""+o.height)}return i.match(/^data:/i)||(o.crossOrigin="Anonymous"),o.src=i,o.complete?a():(o.onload=a,o.src=o.src),this}return t.prototype.match=function(t,e){return this.cfg===e},t}(),_=function(){function t(t){var e=Object(u.b)("defs"),n=Object(l.H)("defs_");e.id=n,t.appendChild(e),this.children=[],this.defaultArrow={},this.el=e,this.canvas=t}return t.prototype.find=function(t,e){for(var n=this.children,r=null,i=0;i=u.minX&&e<=u.maxX&&n>=u.minY&&n<=u.maxY}var s=n(57),u=n(78),c=n(16),f=n(30),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(r.b)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.renderer="canvas",e.autoDraw=!0,e.localRefresh=!0,e.refreshElements=[],e.clipView=!0,e.quickHit=!1,e},e.prototype.onCanvasChange=function(t){"attr"!==t&&"sort"!==t&&"changeSize"!==t||(this.set("refreshElements",[this]),this.draw())},e.prototype.getShapeBase=function(){return s},e.prototype.getGroupBase=function(){return u.a},e.prototype.getPixelRatio=function(){var t=this.get("pixelRatio")||Object(c.d)();return t>=1?Math.ceil(t):1},e.prototype.getViewRange=function(){return{minX:0,minY:0,maxX:this.cfg.width,maxY:this.cfg.height}},e.prototype.createDom=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return this.set("context",e),t},e.prototype.setDOMSize=function(e,n){t.prototype.setDOMSize.call(this,e,n);var r=this.get("context"),i=this.get("el"),o=this.getPixelRatio();i.width=o*e,i.height=o*n,o>1&&r.scale(o,o)},e.prototype.clear=function(){t.prototype.clear.call(this),this._clearFrame();var e=this.get("context"),n=this.get("el");e.clearRect(0,0,n.width,n.height)},e.prototype.getShape=function(e,n){return this.get("quickHit")?function t(e,n,r){if(!a(e,n,r))return null;for(var i=null,s=e.getChildren(),u=s.length-1;u>=0;u--){var c=s[u];if(c.isGroup())i=t(c,n,r);else if(a(c,n,r)){var f=c,l=o(c,n,r),h=l[0],d=l[1];f.isInShape(h,d)&&(i=c)}if(i)break}return i}(this,e,n):t.prototype.getShape.call(this,e,n,null)},e.prototype._getRefreshRegion=function(){var t,e=this.get("refreshElements"),n=this.getViewRange();e.length&&e[0]===this?t=n:(t=Object(f.f)(e))&&(t.minX=Math.floor(t.minX),t.minY=Math.floor(t.minY),t.maxX=Math.ceil(t.maxX),t.maxY=Math.ceil(t.maxY),t.maxY+=1,this.get("clipView")&&(t=Object(f.g)(t,n)));return t},e.prototype.refreshElement=function(t){this.get("refreshElements").push(t)},e.prototype._clearFrame=function(){var t=this.get("drawFrame");t&&(Object(c.a)(t),this.set("drawFrame",null),this.set("refreshElements",[]))},e.prototype.draw=function(){var t=this.get("drawFrame");this.get("autoDraw")&&t||this._startDraw()},e.prototype._drawAll=function(){var t=this.get("context"),e=this.get("el"),n=this.getChildren();t.clearRect(0,0,e.width,e.height),Object(f.a)(t,this),Object(f.d)(t,n),this.set("refreshElements",[])},e.prototype._drawRegion=function(){var t=this.get("context"),e=this.get("refreshElements"),n=this.getChildren(),r=this._getRefreshRegion();r?(t.clearRect(r.minX,r.minY,r.maxX-r.minX,r.maxY-r.minY),t.save(),t.beginPath(),t.rect(r.minX,r.minY,r.maxX-r.minX,r.maxY-r.minY),t.clip(),Object(f.a)(t,this),Object(f.b)(this,n,r),Object(f.d)(t,n,r),t.restore()):e.length&&Object(f.c)(e),Object(c.c)(e,(function(t){t.get("hasChanged")&&t.set("hasChanged",!1)})),this.set("refreshElements",[])},e.prototype._startDraw=function(){var t=this,e=this.get("drawFrame");e||(e=Object(c.n)((function(){t.get("localRefresh")?t._drawRegion():t._drawAll(),t.set("drawFrame",null)})),this.set("drawFrame",e))},e.prototype.skipDraw=function(){},e}(i.AbstractCanvas);e.a=l},function(t,e,n){"use strict";var r;!function(t){t.PANSTART="PANSTART",t.PANEND="PANEND",t.PANMOVE="PANMOVE",t.PINCH="PINCH",t.KEYDOWN="KEYDOWN",t.KEYUP="KEYUP",t.HOVER="HOVER"}(r||(r={}));n(133)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(493);e.default=function(t,e){return void 0===e&&(e=!0),{lazyInject:r.makePropertyInjectDecorator(t,e),lazyInjectNamed:r.makePropertyInjectNamedDecorator(t,e),lazyInjectTagged:r.makePropertyInjectTaggedDecorator(t,e),lazyMultiInject:r.makePropertyMultiInjectDecorator(t,e)}}},function(t,e,n){var r=n(217);t.exports=function(t){return t&&t.length?r(t):[]}},function(t,e,n){var r,i,o;function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}o=function(){"use strict";var t=function(t){return t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Float32Array||t instanceof Float64Array||t instanceof Uint8ClampedArray},e=function(t,e){for(var n=Object.keys(e),r=0;r=0&&(0|t)===t||n("invalid parameter type, ("+t+")"+i(e)+". must be a nonnegative integer")},oneOf:s,shaderError:function(t,e,n,i,o){if(!t.getShaderParameter(e,t.COMPILE_STATUS)){var a=t.getShaderInfoLog(e),s=i===t.FRAGMENT_SHADER?"fragment":"vertex";m(n,"string",s+" shader source must be a string",o);var u=g(n,o),f=function(t){var e=[];return t.split("\\n").forEach((function(t){if(!(t.length<5)){var n=/^ERROR:\\s+(\\d+):(\\d+):\\s*(.*)$/.exec(t);n?e.push(new h(0|n[1],0|n[2],n[3].trim())):t.length>0&&e.push(new h("unknown",0,t))}})),e}(a);!function(t,e){e.forEach((function(e){var n=t[e.file];if(n){var r=n.index[e.line];if(r)return r.errors.push(e),void(n.hasErrors=!0)}t.unknown.hasErrors=!0,t.unknown.lines[0].errors.push(e)}))}(u,f),Object.keys(u).forEach((function(t){var e=u[t];if(e.hasErrors){var n=[""],r=[""];i("file number "+t+": "+e.name+"\\n","color:red;text-decoration:underline;font-weight:bold"),e.lines.forEach((function(t){if(t.errors.length>0){i(c(t.number,4)+"| ","background-color:yellow; font-weight:bold"),i(t.line+"\\n","color:red; background-color:yellow; font-weight:bold");var e=0;t.errors.forEach((function(n){var r=n.message,o=/^\\s*\'(.*)\'\\s*:\\s*(.*)$/.exec(r);if(o){var a=o[1];switch(r=o[2],a){case"assign":a="="}e=Math.max(t.line.indexOf(a,e),0)}else e=0;i(c("| ",6)),i(c("^^^",e+3)+"\\n","font-weight:bold"),i(c("| ",6)),i(r+"\\n","font-weight:bold")})),i(c("| ",6)+"\\n")}else i(c(t.number,4)+"| "),i(t.line+"\\n","color:red")})),"undefined"==typeof document||window.chrome?console.log(n.join("")):(r[0]=n.join("%c"),console.log.apply(console,r))}function i(t,e){n.push(t),r.push(e||"")}})),r.raise("Error compiling "+s+" shader, "+u[0].name)}},linkError:function(t,e,n,i,o){if(!t.getProgramParameter(e,t.LINK_STATUS)){var a=t.getProgramInfoLog(e),s=g(n,o),u=\'Error linking program with vertex shader, "\'+g(i,o)[0].name+\'", and fragment shader "\'+s[0].name+\'"\';"undefined"!=typeof document?console.log("%c"+u+"\\n%c"+a,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(u+"\\n"+a),r.raise(u)}},callSite:p,saveCommandRef:v,saveDrawInfo:function(t,e,n,r){function i(t){return t?r.id(t):0}function o(t,e){Object.keys(e).forEach((function(e){t[r.id(e)]=!0}))}v(t),t._fragId=i(t.static.frag),t._vertId=i(t.static.vert);var a=t._uniformSet={};o(a,e.static),o(a,e.dynamic);var s=t._attributeSet={};o(s,n.static),o(s,n.dynamic),t._hasCount="count"in t.static||"count"in t.dynamic||"elements"in t.static||"elements"in t.dynamic},framebufferFormat:function(t,e,n){t.texture?s(t.texture._texture.internalformat,e,"unsupported texture format for attachment"):s(t.renderbuffer._renderbuffer.format,n,"unsupported renderbuffer format for attachment")},guessCommand:d,texture2D:function(t,e,n){var i,o=e.width,a=e.height,s=e.channels;r(o>0&&o<=n.maxTextureSize&&a>0&&a<=n.maxTextureSize,"invalid texture shape"),33071===t.wrapS&&33071===t.wrapT||r(w(o)&&w(a),"incompatible wrap mode for texture, both width and height must be power of 2"),1===e.mipmask?1!==o&&1!==a&&r(9984!==t.minFilter&&9986!==t.minFilter&&9985!==t.minFilter&&9987!==t.minFilter,"min filter requires mipmap"):(r(w(o)&&w(a),"texture must be a square power of 2 to support mipmapping"),r(e.mipmask===(o<<1)-1,"missing or incomplete mipmap data")),5126===e.type&&(n.extensions.indexOf("oes_texture_float_linear")<0&&r(9728===t.minFilter&&9728===t.magFilter,"filter not supported, must enable oes_texture_float_linear"),r(!t.genMipmaps,"mipmap generation not supported with float textures"));var u=e.images;for(i=0;i<16;++i)if(u[i]){var c=o>>i,f=a>>i;r(e.mipmask&1<0&&o<=i.maxTextureSize&&a>0&&a<=i.maxTextureSize,"invalid texture shape"),r(o===a,"cube map must be square"),r(33071===e.wrapS&&33071===e.wrapT,"wrap mode not supported by cube map");for(var u=0;u>l,p=a>>l;r(c.mipmask&1<1&&n===r&&(\'"\'===n||"\'"===n))return[\'"\'+O(e.substr(1,e.length-2))+\'"\'];var i=/\\[(false|true|null|\\d+|\'[^\']*\'|"[^"]*")\\]/.exec(e);if(i)return t(e.substr(0,i.index)).concat(t(i[1])).concat(t(e.substr(i.index+i[0].length)));var o=e.split(".");if(1===o.length)return[\'"\'+O(e)+\'"\'];for(var a=[],s=0;s0,"invalid pixel ratio"))):S.raise("invalid arguments to regl"),n&&("canvas"===n.nodeName.toLowerCase()?i=n:r=n),!o){if(!i){S("undefined"!=typeof document,"must manually specify webgl context outside of DOM environments");var v=function(t,n,r){var i,o=document.createElement("canvas");function a(){var n=window.innerWidth,i=window.innerHeight;if(t!==document.body){var a=t.getBoundingClientRect();n=a.right-a.left,i=a.bottom-a.top}o.width=r*n,o.height=r*i,e(o.style,{width:n+"px",height:i+"px"})}return e(o.style,{border:0,margin:0,padding:0,top:0,left:0}),t.appendChild(o),t===document.body&&(o.style.position="absolute",e(t.style,{margin:0,padding:0})),t!==document.body&&"function"==typeof ResizeObserver?(i=new ResizeObserver((function(){setTimeout(a)}))).observe(t):window.addEventListener("resize",a,!1),a(),{canvas:o,onDestroy:function(){i?i.disconnect():window.removeEventListener("resize",a),t.removeChild(o)}}}(r||document.body,0,h);if(!v)return null;i=v.canvas,g=v.onDestroy}void 0===c.premultipliedAlpha&&(c.premultipliedAlpha=!0),o=function(t,e){function n(n){try{return t.getContext(n,e)}catch(t){return null}}return n("webgl")||n("experimental-webgl")||n("webgl-experimental")}(i,c)}return o?{gl:o,canvas:i,container:r,extensions:f,optionalExtensions:l,pixelRatio:h,profile:d,onDone:p,onDestroy:g}:(g(),p("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function j(t,e){for(var n=Array(t),r=0;r65535)<<4,e|=n=((t>>>=e)>255)<<3,e|=n=((t>>>=n)>15)<<2,(e|=n=((t>>>=n)>3)<<1)|(t>>>=n)>>1}function N(){var t=j(8,(function(){return[]}));function e(e){var n=function(t){for(var e=16;e<=1<<28;e*=16)if(t<=e)return e;return 0}(e),r=t[D(n)>>2];return r.length>0?r.pop():new ArrayBuffer(n)}function n(e){t[D(e.byteLength)>>2].push(e)}return{alloc:e,free:n,allocType:function(t,n){var r=null;switch(t){case 5120:r=new Int8Array(e(n),0,n);break;case 5121:r=new Uint8Array(e(n),0,n);break;case 5122:r=new Int16Array(e(2*n),0,n);break;case 5123:r=new Uint16Array(e(2*n),0,n);break;case 5124:r=new Int32Array(e(4*n),0,n);break;case 5125:r=new Uint32Array(e(4*n),0,n);break;case 5126:r=new Float32Array(e(4*n),0,n);break;default:return null}return r.length!==n?r.subarray(0,n):r},freeType:function(t){n(t.buffer)}}}var R=N();function L(e){return!!e&&"object"===a(e)&&Array.isArray(e.shape)&&Array.isArray(e.stride)&&"number"==typeof e.offset&&e.shape.length===e.stride.length&&(Array.isArray(e.data)||t(e.data))}R.zero=N();var B=function(t){return Object.keys(t).map((function(e){return t[e]}))},G={shape:function(t){for(var e=[],n=t;n.length;n=n[0])e.push(n.length);return e},flatten:function(t,e,n,r){var i=1;if(e.length)for(var o=0;o>>31<<15,o=(r<<1>>>24)-127,a=r>>13&1023;if(o<-24)e[n]=i;else if(o<-14){var s=-14-o;e[n]=i+(a+1024>>s)}else e[n]=o>15?i+31744:i+(o+15<<10)+a}return e}function tt(e){return Array.isArray(e)||t(e)}var et=function(t){return!(t&t-1||!t)},nt=[9984,9986,9985,9987],rt=[0,6409,6410,6407,6408],it={};function ot(t){return"[object "+t+"]"}it[6409]=it[6406]=it[6402]=1,it[34041]=it[6410]=2,it[6407]=it[35904]=3,it[6408]=it[35906]=4;var at=ot("HTMLCanvasElement"),st=ot("OffscreenCanvas"),ut=ot("CanvasRenderingContext2D"),ct=ot("ImageBitmap"),ft=ot("HTMLImageElement"),lt=ot("HTMLVideoElement"),ht=Object.keys(U).concat([at,st,ut,ct,ft,lt]),dt=[];dt[5121]=1,dt[5126]=4,dt[36193]=2,dt[5123]=2,dt[5125]=4;var pt=[];function gt(t){return Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}function vt(t){return!!Array.isArray(t)&&!(0===t.length||!tt(t[0]))}function yt(t){return Object.prototype.toString.call(t)}function mt(t){return yt(t)===at}function bt(t){return yt(t)===st}function xt(t){if(!t)return!1;var e=yt(t);return ht.indexOf(e)>=0||gt(t)||vt(t)||L(t)}function wt(t){return 0|U[Object.prototype.toString.call(t)]}function St(t,e){return R.allocType(36193===t.type?5126:t.type,e)}function Et(t,e){36193===t.type?(t.data=$(e),R.freeType(e)):t.data=e}function _t(t,e,n,r,i,o){var a;if(a=void 0!==pt[t]?pt[t]:it[t]*dt[e],o&&(a*=6),i){for(var s=0,u=n;u>=1;)s+=a*u*u,u/=2;return s}return a*n*r}function Ot(n,r,i,o,s,u,c){var f={"don\'t care":4352,"dont care":4352,nice:4354,fast:4353},l={repeat:10497,clamp:33071,mirror:33648},h={nearest:9728,linear:9729},d=e({mipmap:9987,"nearest mipmap nearest":9984,"linear mipmap nearest":9985,"nearest mipmap linear":9986,"linear mipmap linear":9987},h),p={none:0,browser:37444},g={uint8:5121,rgba4:32819,rgb565:33635,"rgb5 a1":32820},v={alpha:6406,luminance:6409,"luminance alpha":6410,rgb:6407,rgba:6408,rgba4:32854,"rgb5 a1":32855,rgb565:36194},y={};r.ext_srgb&&(v.srgb=35904,v.srgba=35906),r.oes_texture_float&&(g.float32=g.float=5126),r.oes_texture_half_float&&(g.float16=g["half float"]=36193),r.webgl_depth_texture&&(e(v,{depth:6402,"depth stencil":34041}),e(g,{uint16:5123,uint32:5125,"depth stencil":34042})),r.webgl_compressed_texture_s3tc&&e(y,{"rgb s3tc dxt1":33776,"rgba s3tc dxt1":33777,"rgba s3tc dxt3":33778,"rgba s3tc dxt5":33779}),r.webgl_compressed_texture_atc&&e(y,{"rgb atc":35986,"rgba atc explicit alpha":35987,"rgba atc interpolated alpha":34798}),r.webgl_compressed_texture_pvrtc&&e(y,{"rgb pvrtc 4bppv1":35840,"rgb pvrtc 2bppv1":35841,"rgba pvrtc 4bppv1":35842,"rgba pvrtc 2bppv1":35843}),r.webgl_compressed_texture_etc1&&(y["rgb etc1"]=36196);var m=Array.prototype.slice.call(n.getParameter(34467));Object.keys(y).forEach((function(t){var e=y[t];m.indexOf(e)>=0&&(v[t]=e)}));var b=Object.keys(v);i.textureFormats=b;var x=[];Object.keys(v).forEach((function(t){var e=v[t];x[e]=t}));var w=[];Object.keys(g).forEach((function(t){var e=g[t];w[e]=t}));var E=[];Object.keys(h).forEach((function(t){E[h[t]]=t}));var _=[];Object.keys(d).forEach((function(t){var e=d[t];_[e]=t}));var O=[];Object.keys(l).forEach((function(t){O[l[t]]=t}));var k=b.reduce((function(t,e){var n=v[e];return 6409===n||6406===n||6409===n||6410===n||6402===n||34041===n||r.ext_srgb&&(35904===n||35906===n)?t[n]=n:32855===n||e.indexOf("rgba")>=0?t[n]=6408:t[n]=6407,t}),{});function M(){this.internalformat=6408,this.format=6408,this.type=5121,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=37444,this.width=0,this.height=0,this.channels=0}function A(t,e){t.internalformat=e.internalformat,t.format=e.format,t.type=e.type,t.compressed=e.compressed,t.premultiplyAlpha=e.premultiplyAlpha,t.flipY=e.flipY,t.unpackAlignment=e.unpackAlignment,t.colorSpace=e.colorSpace,t.width=e.width,t.height=e.height,t.channels=e.channels}function T(t,e){if("object"===a(e)&&e){if("premultiplyAlpha"in e&&(S.type(e.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),t.premultiplyAlpha=e.premultiplyAlpha),"flipY"in e&&(S.type(e.flipY,"boolean","invalid texture flip"),t.flipY=e.flipY),"alignment"in e&&(S.oneOf(e.alignment,[1,2,4,8],"invalid texture unpack alignment"),t.unpackAlignment=e.alignment),"colorSpace"in e&&(S.parameter(e.colorSpace,p,"invalid colorSpace"),t.colorSpace=p[e.colorSpace]),"type"in e){var n=e.type;S(r.oes_texture_float||!("float"===n||"float32"===n),"you must enable the OES_texture_float extension in order to use floating point textures."),S(r.oes_texture_half_float||!("half float"===n||"float16"===n),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),S(r.webgl_depth_texture||!("uint16"===n||"uint32"===n||"depth stencil"===n),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),S.parameter(n,g,"invalid texture type"),t.type=g[n]}var o=t.width,s=t.height,u=t.channels,c=!1;"shape"in e?(S(Array.isArray(e.shape)&&e.shape.length>=2,"shape must be an array"),o=e.shape[0],s=e.shape[1],3===e.shape.length&&(u=e.shape[2],S(u>0&&u<=4,"invalid number of channels"),c=!0),S(o>=0&&o<=i.maxTextureSize,"invalid width"),S(s>=0&&s<=i.maxTextureSize,"invalid height")):("radius"in e&&(o=s=e.radius,S(o>=0&&o<=i.maxTextureSize,"invalid radius")),"width"in e&&(o=e.width,S(o>=0&&o<=i.maxTextureSize,"invalid width")),"height"in e&&(s=e.height,S(s>=0&&s<=i.maxTextureSize,"invalid height")),"channels"in e&&(u=e.channels,S(u>0&&u<=4,"invalid number of channels"),c=!0)),t.width=0|o,t.height=0|s,t.channels=0|u;var f=!1;if("format"in e){var l=e.format;S(r.webgl_depth_texture||!("depth"===l||"depth stencil"===l),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),S.parameter(l,v,"invalid texture format");var h=t.internalformat=v[l];t.format=k[h],l in g&&("type"in e||(t.type=g[l])),l in y&&(t.compressed=!0),f=!0}!c&&f?t.channels=it[t.format]:c&&!f?t.channels!==rt[t.format]&&(t.format=t.internalformat=rt[t.channels]):f&&c&&S(t.channels===it[t.format],"number of channels inconsistent with specified format")}}function C(t){n.pixelStorei(37440,t.flipY),n.pixelStorei(37441,t.premultiplyAlpha),n.pixelStorei(37443,t.colorSpace),n.pixelStorei(3317,t.unpackAlignment)}function I(){M.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function P(e,n){var r=null;if(xt(n)?r=n:n&&(S.type(n,"object","invalid pixel data type"),T(e,n),"x"in n&&(e.xOffset=0|n.x),"y"in n&&(e.yOffset=0|n.y),xt(n.data)&&(r=n.data)),S(!e.compressed||r instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),n.copy){S(!r,"can not specify copy and data field for the same texture");var o=s.viewportWidth,a=s.viewportHeight;e.width=e.width||o-e.xOffset,e.height=e.height||a-e.yOffset,e.needsCopy=!0,S(e.xOffset>=0&&e.xOffset=0&&e.yOffset0&&e.width<=o&&e.height>0&&e.height<=a,"copy texture read out of bounds")}else if(r){if(t(r))e.channels=e.channels||4,e.data=r,"type"in n||5121!==e.type||(e.type=wt(r));else if(gt(r))e.channels=e.channels||4,function(t,e){var n=e.length;switch(t.type){case 5121:case 5123:case 5125:case 5126:var r=R.allocType(t.type,n);r.set(e),t.data=r;break;case 36193:t.data=$(e);break;default:S.raise("unsupported texture type, must specify a typed array")}}(e,r),e.alignment=1,e.needsFree=!0;else if(L(r)){var u=r.data;Array.isArray(u)||5121!==e.type||(e.type=wt(u));var c,f,l,h,d,p,g=r.shape,v=r.stride;3===g.length?(l=g[2],p=v[2]):(S(2===g.length,"invalid ndarray pixel data, must be 2 or 3D"),l=1,p=1),c=g[0],f=g[1],h=v[0],d=v[1],e.alignment=1,e.width=c,e.height=f,e.channels=l,e.format=e.internalformat=rt[l],e.needsFree=!0,function(t,e,n,r,i,o){for(var a=t.width,s=t.height,u=t.channels,c=St(t,a*s*u),f=0,l=0;l=0,"oes_texture_float extension not enabled"):36193===e.type&&S(i.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function j(t,e,r){var i=t.element,a=t.data,s=t.internalformat,u=t.format,c=t.type,f=t.width,l=t.height;C(t),i?n.texImage2D(e,r,u,u,c,i):t.compressed?n.compressedTexImage2D(e,r,s,f,l,0,a):t.needsCopy?(o(),n.copyTexImage2D(e,r,u,t.xOffset,t.yOffset,f,l,0)):n.texImage2D(e,r,u,f,l,0,u,c,a||null)}function D(t,e,r,i,a){var s=t.element,u=t.data,c=t.internalformat,f=t.format,l=t.type,h=t.width,d=t.height;C(t),s?n.texSubImage2D(e,a,r,i,f,l,s):t.compressed?n.compressedTexSubImage2D(e,a,r,i,c,h,d,u):t.needsCopy?(o(),n.copyTexSubImage2D(e,a,r,i,t.xOffset,t.yOffset,h,d)):n.texSubImage2D(e,a,r,i,h,d,f,l,u)}var N=[];function F(){return N.pop()||new I}function U(t){t.needsFree&&R.freeType(t.data),I.call(t),N.push(t)}function z(){M.call(this),this.genMipmaps=!1,this.mipmapHint=4352,this.mipmask=0,this.images=Array(16)}function V(t,e,n){var r=t.images[0]=F();t.mipmask=1,r.width=t.width=e,r.height=t.height=n,r.channels=t.channels=4}function W(t,e){var n=null;if(xt(e))A(n=t.images[0]=F(),t),P(n,e),t.mipmask=1;else if(T(t,e),Array.isArray(e.mipmap))for(var r=e.mipmap,i=0;i>=i,n.height>>=i,P(n,r[i]),t.mipmask|=1<=0&&!("faces"in e)&&(t.genMipmaps=!0)}if("mag"in e){var r=e.mag;S.parameter(r,h),t.magFilter=h[r]}var o=t.wrapS,s=t.wrapT;if("wrap"in e){var u=e.wrap;"string"==typeof u?(S.parameter(u,l),o=s=l[u]):Array.isArray(u)&&(S.parameter(u[0],l),S.parameter(u[1],l),o=l[u[0]],s=l[u[1]])}else{if("wrapS"in e){var c=e.wrapS;S.parameter(c,l),o=l[c]}if("wrapT"in e){var p=e.wrapT;S.parameter(p,l),s=l[p]}}if(t.wrapS=o,t.wrapT=s,"anisotropic"in e){var g=e.anisotropic;S("number"==typeof g&&g>=1&&g<=i.maxAnisotropic,"aniso samples must be between 1 and "),t.anisotropic=e.anisotropic}if("mipmap"in e){var v=!1;switch(a(e.mipmap)){case"string":S.parameter(e.mipmap,f,"invalid mipmap hint"),t.mipmapHint=f[e.mipmap],t.genMipmaps=!0,v=!0;break;case"boolean":v=t.genMipmaps=e.mipmap;break;case"object":S(Array.isArray(e.mipmap),"invalid mipmap type"),t.genMipmaps=!1,v=!0;break;default:S.raise("invalid mipmap type")}v&&!("min"in e)&&(t.minFilter=9984)}}function Q(t,e){n.texParameteri(e,10241,t.minFilter),n.texParameteri(e,10240,t.magFilter),n.texParameteri(e,10242,t.wrapS),n.texParameteri(e,10243,t.wrapT),r.ext_texture_filter_anisotropic&&n.texParameteri(e,34046,t.anisotropic),t.genMipmaps&&(n.hint(33170,t.mipmapHint),n.generateMipmap(e))}var J=0,ot={},at=i.maxTextureUnits,st=Array(at).map((function(){return null}));function ht(t){M.call(this),this.mipmask=0,this.internalformat=6408,this.id=J++,this.refCount=1,this.target=t,this.texture=n.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new K,c.profile&&(this.stats={size:0})}function dt(t){n.activeTexture(33984),n.bindTexture(t.target,t.texture)}function pt(){var t=st[0];t?n.bindTexture(t.target,t.texture):n.bindTexture(3553,null)}function Ot(t){var e=t.texture;S(e,"must not double destroy texture");var r=t.unit,i=t.target;r>=0&&(n.activeTexture(33984+r),n.bindTexture(i,null),st[r]=null),n.deleteTexture(e),t.texture=null,t.params=null,t.pixels=null,t.refCount=0,delete ot[t.id],u.textureCount--}return e(ht.prototype,{bind:function(){this.bindCount+=1;var t=this.unit;if(t<0){for(var e=0;e0)continue;r.unit=-1}st[e]=this,t=e;break}t>=at&&S.raise("insufficient number of texture units"),c.profile&&u.maxTextureUnits>u)-a,c.height=c.height||(r.height>>u)-s,S(r.type===c.type&&r.format===c.format&&r.internalformat===c.internalformat,"incompatible format for texture.subimage"),S(a>=0&&s>=0&&a+c.width<=r.width&&s+c.height<=r.height,"texture.subimage write out of bounds"),S(r.mipmask&1<>s;++s){var u=i>>s,f=a>>s;if(!u||!f)break;n.texImage2D(3553,s,r.format,u,f,0,r.format,r.type,null)}return pt(),c.profile&&(r.stats.size=_t(r.internalformat,r.type,i,a,!1,!1)),o},o._reglType="texture2d",o._texture=r,c.profile&&(o.stats=r.stats),o.destroy=function(){r.decRef()},o},createCube:function(t,e,r,o,s,f){var l=new ht(34067);ot[l.id]=l,u.cubeCount++;var h=new Array(6);function d(t,e,n,r,o,s){var u,f=l.texInfo;for(K.call(f),u=0;u<6;++u)h[u]=H();if("number"!=typeof t&&t)if("object"===a(t))if(e)W(h[0],t),W(h[1],e),W(h[2],n),W(h[3],r),W(h[4],o),W(h[5],s);else if(Z(f,t),T(l,t),"faces"in t){var p=t.faces;for(S(Array.isArray(p)&&6===p.length,"cube faces must be a length 6 array"),u=0;u<6;++u)S("object"===a(p[u])&&!!p[u],"invalid input for cube map face"),A(h[u],l),W(h[u],p[u])}else for(u=0;u<6;++u)W(h[u],t);else S.raise("invalid arguments to cube map");else{var g=0|t||1;for(u=0;u<6;++u)V(h[u],g,g)}for(A(l,h[0]),i.npotTextureCube||S(et(l.width)&&et(l.height),"your browser does not support non power or two texture dimensions"),f.genMipmaps?l.mipmask=(h[0].width<<1)-1:l.mipmask=h[0].mipmask,S.textureCube(l,f,h,i),l.internalformat=h[0].internalformat,d.width=h[0].width,d.height=h[0].height,dt(l),u=0;u<6;++u)X(h[u],34069+u);for(Q(f,34067),pt(),c.profile&&(l.stats.size=_t(l.internalformat,l.type,d.width,d.height,f.genMipmaps,!0)),d.format=x[l.internalformat],d.type=w[l.type],d.mag=E[f.magFilter],d.min=_[f.minFilter],d.wrapS=O[f.wrapS],d.wrapT=O[f.wrapT],u=0;u<6;++u)q(h[u]);return d}return d(t,e,r,o,s,f),d.subimage=function(t,e,n,r,i){S(!!e,"must specify image data"),S("number"==typeof t&&t===(0|t)&&t>=0&&t<6,"invalid face");var o=0|n,a=0|r,s=0|i,u=F();return A(u,l),u.width=0,u.height=0,P(u,e),u.width=u.width||(l.width>>s)-o,u.height=u.height||(l.height>>s)-a,S(l.type===u.type&&l.format===u.format&&l.internalformat===u.internalformat,"incompatible format for texture.subimage"),S(o>=0&&a>=0&&o+u.width<=l.width&&a+u.height<=l.height,"texture.subimage write out of bounds"),S(l.mipmask&1<>i;++i)n.texImage2D(34069+r,i,l.format,e>>i,e>>i,0,l.format,l.type,null);return pt(),c.profile&&(l.stats.size=_t(l.internalformat,l.type,d.width,d.height,!1,!0)),d}},d._reglType="textureCube",d._texture=l,c.profile&&(d.stats=l.stats),d.destroy=function(){l.decRef()},d},clear:function(){for(var t=0;t>e,t.height>>e,0,t.internalformat,t.type,null);else for(var r=0;r<6;++r)n.texImage2D(34069+r,e,t.internalformat,t.width>>e,t.height>>e,0,t.internalformat,t.type,null);Q(t.texInfo,t.target)}))},refresh:function(){for(var t=0;t=0&&f=0&&l0&&h+f<=i.framebufferWidth,"invalid width for read pixels"),S(d>0&&d+l<=i.framebufferHeight,"invalid height for read pixels"),r();var g=h*d*4;return p||(5121===c?p=new Uint8Array(g):5126===c&&(p=p||new Float32Array(g))),S.isTypedArray(p,"data buffer for regl.read() must be a typedarray"),S(p.byteLength>=g,"data buffer for regl.read() too small"),e.pixelStorei(3333,4),e.readPixels(f,l,h,d,6408,c,p),p}return function(t){return t&&"framebuffer"in t?function(t){var e;return n.setFBO({framebuffer:t.framebuffer},(function(){e=u(t)})),e}(t):u(t)}}function Nt(t){return Array.prototype.slice.call(t)}function Rt(t){return Nt(t).join("")}Pt[36053]="complete",Pt[36054]="incomplete attachment",Pt[36057]="incomplete dimensions",Pt[36055]="incomplete, missing attachment",Pt[36061]="unsupported";var Lt="xyzw".split(""),Bt="profile",Gt="framebuffer",Ft="vert",Ut="frag",zt="elements",Vt="primitive",Wt="count",Xt="offset",Yt="instances",Ht="vao",qt=Gt+"Width",Kt=Gt+"Height",Zt=["blend.func","blend.equation","stencil.func","stencil.opFront","stencil.opBack","sample.coverage","viewport","scissor.box","polygonOffset.offset"],Qt={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},Jt=["constant color, constant alpha","one minus constant color, constant alpha","constant color, one minus constant alpha","one minus constant color, one minus constant alpha","constant alpha, constant color","constant alpha, one minus constant color","one minus constant alpha, constant color","one minus constant alpha, one minus constant color"],$t={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},te={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},ee={frag:35632,vert:35633},ne={cw:2304,ccw:2305};function re(e){return Array.isArray(e)||t(e)||L(e)}function ie(t){return t.sort((function(t,e){return"viewport"===t?-1:"viewport"===e?1:t=1,r>=2,e)}if(4===n){var i=t.data;return new oe(i.thisDep,i.contextDep,i.propDep,e)}if(5===n)return new oe(!1,!1,!1,e);if(6===n){for(var o=!1,a=!1,s=!1,u=0;u=1&&(a=!0),f>=2&&(s=!0)}else 4===c.type&&(o=o||c.data.thisDep,a=a||c.data.contextDep,s=s||c.data.propDep)}return new oe(o,a,s,e)}return new oe(3===n,2===n,1===n,e)}var ce=new oe(!1,!1,!1,(function(){}));function fe(t,n,r,i,o,s,u,c,f,l,h,d,p,g,v){var y=l.Record,m={add:32774,subtract:32778,"reverse subtract":32779};r.ext_blend_minmax&&(m.min=32775,m.max=32776);var b=r.angle_instanced_arrays,x=r.webgl_draw_buffers,w={dirty:!0,profile:v.profile},E={},_=[],O={},k={};function A(t){return t.replace(".","_")}function T(t,e,n){var r=A(t);_.push(t),E[r]=w[r]=!!n,O[r]=e}function C(t,e,n){var r=A(t);_.push(t),Array.isArray(n)?(w[r]=n.slice(),E[r]=n.slice()):w[r]=E[r]=n,k[r]=e}T("dither",3024),T("blend.enable",3042),C("blend.color","blendColor",[0,0,0,0]),C("blend.equation","blendEquationSeparate",[32774,32774]),C("blend.func","blendFuncSeparate",[1,0,1,0]),T("depth.enable",2929,!0),C("depth.func","depthFunc",513),C("depth.range","depthRange",[0,1]),C("depth.mask","depthMask",!0),C("colorMask","colorMask",[!0,!0,!0,!0]),T("cull.enable",2884),C("cull.face","cullFace",1029),C("frontFace","frontFace",2305),C("lineWidth","lineWidth",1),T("polygonOffset.enable",32823),C("polygonOffset.offset","polygonOffset",[0,0]),T("sample.alpha",32926),T("sample.enable",32928),C("sample.coverage","sampleCoverage",[1,!1]),T("stencil.enable",2960),C("stencil.mask","stencilMask",-1),C("stencil.func","stencilFunc",[519,0,-1]),C("stencil.opFront","stencilOpSeparate",[1028,7680,7680,7680]),C("stencil.opBack","stencilOpSeparate",[1029,7680,7680,7680]),T("scissor.enable",3089),C("scissor.box","scissor",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]),C("viewport","viewport",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]);var I={gl:t,context:p,strings:n,next:E,current:w,draw:d,elements:s,buffer:o,shader:h,attributes:l.state,vao:l,uniforms:f,framebuffer:c,extensions:r,timer:g,isBufferArgs:re},P={primTypes:Z,compareFuncs:$t,blendFuncs:Qt,blendEquations:m,stencilOps:te,glTypes:z,orientationType:ne};S.optional((function(){I.isArrayLike=tt})),x&&(P.backBuffer=[1029],P.drawBuffer=j(i.maxDrawbuffers,(function(t){return 0===t?[0]:j(t,(function(t){return 36064+t}))})));var D=0;function N(){var t=function(){var t=0,n=[],r=[];function i(){var n=[],r=[];return e((function(){n.push.apply(n,Nt(arguments))}),{def:function(){var e="v"+t++;return r.push(e),arguments.length>0&&(n.push(e,"="),n.push.apply(n,Nt(arguments)),n.push(";")),e},toString:function(){return Rt([r.length>0?"var "+r.join(",")+";":"",Rt(n)])}})}function o(){var t=i(),n=i(),r=t.toString,o=n.toString;function a(e,r){n(e,r,"=",t.def(e,r),";")}return e((function(){t.apply(t,Nt(arguments))}),{def:t.def,entry:t,exit:n,save:a,set:function(e,n,r){a(e,n),t(e,n,"=",r,";")},toString:function(){return r()+o()}})}var a=i(),s={};return{global:a,link:function(e){for(var i=0;i=0,\'unknown parameter "\'+e+\'"\',d.commandStr)}))}e(p),e(g)}));var v=function(t,e){var n=t.static;if("string"==typeof n[Ut]&&"string"==typeof n[Ft]){if(Object.keys(e.dynamic).length>0)return null;var r=e.static,i=Object.keys(r);if(i.length>0&&"number"==typeof r[i[0]]){for(var o=[],a=0;a=0,"invalid "+t,n.commandStr)):u=!1,"height"in o?(s=0|o.height,S.command(s>=0,"invalid "+t,n.commandStr)):u=!1,new oe(!u&&e&&e.thisDep,!u&&e&&e.contextDep,!u&&e&&e.propDep,(function(t,e){var n=t.shared.context,r=a;"width"in o||(r=e.def(n,".",qt,"-",c));var i=s;return"height"in o||(i=e.def(n,".",Kt,"-",f)),[c,f,r,i]}))}if(t in i){var l=i[t],h=ue(l,(function(e,n){var r=e.invoke(n,l);S.optional((function(){e.assert(n,r+"&&typeof "+r+\'==="object"\',"invalid "+t)}));var i=e.shared.context,o=n.def(r,".x|0"),a=n.def(r,".y|0"),s=n.def(\'"width" in \',r,"?",r,".width|0:","(",i,".",qt,"-",o,")"),u=n.def(\'"height" in \',r,"?",r,".height|0:","(",i,".",Kt,"-",a,")");return S.optional((function(){e.assert(n,s+">=0&&"+u+">=0","invalid "+t)})),[o,a,s,u]}));return e&&(h.thisDep=h.thisDep||e.thisDep,h.contextDep=h.contextDep||e.contextDep,h.propDep=h.propDep||e.propDep),h}return e?new oe(e.thisDep,e.contextDep,e.propDep,(function(t,e){var n=t.shared.context;return[0,0,e.def(n,".",qt),e.def(n,".",Kt)]})):null}var a=o("viewport");if(a){var s=a;a=new oe(a.thisDep,a.contextDep,a.propDep,(function(t,e){var n=s.append(t,e),r=t.shared.context;return e.set(r,".viewportWidth",n[2]),e.set(r,".viewportHeight",n[3]),n}))}return{viewport:a,scissor_box:o("scissor.box")}}(t,x,d),E=function(t,e){var n=t.static,r=t.dynamic,i=function(){if(zt in n){var t=n[zt];re(t)?t=s.getElements(s.create(t,!0)):t&&(t=s.getElements(t),S.command(t,"invalid elements",e.commandStr));var i=se((function(e,n){if(t){var r=e.link(t);return e.ELEMENTS=r,r}return e.ELEMENTS=null,null}));return i.value=t,i}if(zt in r){var o=r[zt];return ue(o,(function(t,e){var n=t.shared,r=n.isBufferArgs,i=n.elements,a=t.invoke(e,o),s=e.def("null"),u=e.def(r,"(",a,")"),c=t.cond(u).then(s,"=",i,".createStream(",a,");").else(s,"=",i,".getElements(",a,");");return S.optional((function(){t.assert(c.else,"!"+a+"||"+s,"invalid elements")})),e.entry(c),e.exit(t.cond(u).then(i,".destroyStream(",s,");")),t.ELEMENTS=s,s}))}return null}();function o(t,o){if(t in n){var a=0|n[t];return S.command(!o||a>=0,"invalid "+t,e.commandStr),se((function(t,e){return o&&(t.OFFSET=a),a}))}if(t in r){var s=r[t];return ue(s,(function(e,n){var r=e.invoke(n,s);return o&&(e.OFFSET=r,S.optional((function(){e.assert(n,r+">=0","invalid "+t)}))),r}))}return o&&i?se((function(t,e){return t.OFFSET="0",0})):null}var a=o(Xt,!0);return{elements:i,primitive:function(){if(Vt in n){var t=n[Vt];return S.commandParameter(t,Z,"invalid primitve",e.commandStr),se((function(e,n){return Z[t]}))}if(Vt in r){var o=r[Vt];return ue(o,(function(t,e){var n=t.constants.primTypes,r=t.invoke(e,o);return S.optional((function(){t.assert(e,r+" in "+n,"invalid primitive, must be one of "+Object.keys(Z))})),e.def(n,"[",r,"]")}))}return i?ae(i)?i.value?se((function(t,e){return e.def(t.ELEMENTS,".primType")})):se((function(){return 4})):new oe(i.thisDep,i.contextDep,i.propDep,(function(t,e){var n=t.ELEMENTS;return e.def(n,"?",n,".primType:",4)})):null}(),count:function(){if(Wt in n){var t=0|n[Wt];return S.command("number"==typeof t&&t>=0,"invalid vertex count",e.commandStr),se((function(){return t}))}if(Wt in r){var o=r[Wt];return ue(o,(function(t,e){var n=t.invoke(e,o);return S.optional((function(){t.assert(e,"typeof "+n+\'==="number"&&\'+n+">=0&&"+n+"===("+n+"|0)","invalid vertex count")})),n}))}if(i){if(ae(i)){if(i)return a?new oe(a.thisDep,a.contextDep,a.propDep,(function(t,e){var n=e.def(t.ELEMENTS,".vertCount-",t.OFFSET);return S.optional((function(){t.assert(e,n+">=0","invalid vertex offset/element buffer too small")})),n})):se((function(t,e){return e.def(t.ELEMENTS,".vertCount")}));var s=se((function(){return-1}));return S.optional((function(){s.MISSING=!0})),s}var u=new oe(i.thisDep||a.thisDep,i.contextDep||a.contextDep,i.propDep||a.propDep,(function(t,e){var n=t.ELEMENTS;return t.OFFSET?e.def(n,"?",n,".vertCount-",t.OFFSET,":-1"):e.def(n,"?",n,".vertCount:-1")}));return S.optional((function(){u.DYNAMIC=!0})),u}return null}(),instances:o(Yt,!1),offset:a}}(t,d),O=function(t,e){var n=t.static,r=t.dynamic,o={};return _.forEach((function(t){var s=A(t);function u(e,i){if(t in n){var a=e(n[t]);o[s]=se((function(){return a}))}else if(t in r){var u=r[t];o[s]=ue(u,(function(t,e){return i(t,e,t.invoke(e,u))}))}}switch(t){case"cull.enable":case"blend.enable":case"dither":case"stencil.enable":case"depth.enable":case"scissor.enable":case"polygonOffset.enable":case"sample.alpha":case"sample.enable":case"depth.mask":return u((function(n){return S.commandType(n,"boolean",t,e.commandStr),n}),(function(e,n,r){return S.optional((function(){e.assert(n,"typeof "+r+\'==="boolean"\',"invalid flag "+t,e.commandStr)})),r}));case"depth.func":return u((function(n){return S.commandParameter(n,$t,"invalid "+t,e.commandStr),$t[n]}),(function(e,n,r){var i=e.constants.compareFuncs;return S.optional((function(){e.assert(n,r+" in "+i,"invalid "+t+", must be one of "+Object.keys($t))})),n.def(i,"[",r,"]")}));case"depth.range":return u((function(t){return S.command(tt(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]&&t[0]<=t[1],"depth range is 2d array",e.commandStr),t}),(function(t,e,n){return S.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===2&&typeof "+n+\'[0]==="number"&&typeof \'+n+\'[1]==="number"&&\'+n+"[0]<="+n+"[1]","depth range must be a 2d array")})),[e.def("+",n,"[0]"),e.def("+",n,"[1]")]}));case"blend.func":return u((function(t){S.commandType(t,"object","blend.func",e.commandStr);var n="srcRGB"in t?t.srcRGB:t.src,r="srcAlpha"in t?t.srcAlpha:t.src,i="dstRGB"in t?t.dstRGB:t.dst,o="dstAlpha"in t?t.dstAlpha:t.dst;return S.commandParameter(n,Qt,s+".srcRGB",e.commandStr),S.commandParameter(r,Qt,s+".srcAlpha",e.commandStr),S.commandParameter(i,Qt,s+".dstRGB",e.commandStr),S.commandParameter(o,Qt,s+".dstAlpha",e.commandStr),S.command(-1===Jt.indexOf(n+", "+i),"unallowed blending combination (srcRGB, dstRGB) = ("+n+", "+i+")",e.commandStr),[Qt[n],Qt[i],Qt[r],Qt[o]]}),(function(e,n,r){var i=e.constants.blendFuncs;function o(o,a){var s=n.def(\'"\',o,a,\'" in \',r,"?",r,".",o,a,":",r,".",o);return S.optional((function(){e.assert(n,s+" in "+i,"invalid "+t+"."+o+a+", must be one of "+Object.keys(Qt))})),s}S.optional((function(){e.assert(n,r+"&&typeof "+r+\'==="object"\',"invalid blend func, must be an object")}));var a=o("src","RGB"),s=o("dst","RGB");S.optional((function(){var t=e.constants.invalidBlendCombinations;e.assert(n,t+".indexOf("+a+\'+", "+\'+s+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")}));var u=n.def(i,"[",a,"]"),c=n.def(i,"[",o("src","Alpha"),"]");return[u,n.def(i,"[",s,"]"),c,n.def(i,"[",o("dst","Alpha"),"]")]}));case"blend.equation":return u((function(n){return"string"==typeof n?(S.commandParameter(n,m,"invalid "+t,e.commandStr),[m[n],m[n]]):"object"===a(n)?(S.commandParameter(n.rgb,m,t+".rgb",e.commandStr),S.commandParameter(n.alpha,m,t+".alpha",e.commandStr),[m[n.rgb],m[n.alpha]]):void S.commandRaise("invalid blend.equation",e.commandStr)}),(function(e,n,r){var i=e.constants.blendEquations,o=n.def(),a=n.def(),s=e.cond("typeof ",r,\'==="string"\');return S.optional((function(){function n(t,n,r){e.assert(t,r+" in "+i,"invalid "+n+", must be one of "+Object.keys(m))}n(s.then,t,r),e.assert(s.else,r+"&&typeof "+r+\'==="object"\',"invalid "+t),n(s.else,t+".rgb",r+".rgb"),n(s.else,t+".alpha",r+".alpha")})),s.then(o,"=",a,"=",i,"[",r,"];"),s.else(o,"=",i,"[",r,".rgb];",a,"=",i,"[",r,".alpha];"),n(s),[o,a]}));case"blend.color":return u((function(t){return S.command(tt(t)&&4===t.length,"blend.color must be a 4d array",e.commandStr),j(4,(function(e){return+t[e]}))}),(function(t,e,n){return S.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===4","blend.color must be a 4d array")})),j(4,(function(t){return e.def("+",n,"[",t,"]")}))}));case"stencil.mask":return u((function(t){return S.commandType(t,"number",s,e.commandStr),0|t}),(function(t,e,n){return S.optional((function(){t.assert(e,"typeof "+n+\'==="number"\',"invalid stencil.mask")})),e.def(n,"|0")}));case"stencil.func":return u((function(n){S.commandType(n,"object",s,e.commandStr);var r=n.cmp||"keep",i=n.ref||0,o="mask"in n?n.mask:-1;return S.commandParameter(r,$t,t+".cmp",e.commandStr),S.commandType(i,"number",t+".ref",e.commandStr),S.commandType(o,"number",t+".mask",e.commandStr),[$t[r],i,o]}),(function(t,e,n){var r=t.constants.compareFuncs;return S.optional((function(){function i(){t.assert(e,Array.prototype.join.call(arguments,""),"invalid stencil.func")}i(n+"&&typeof ",n,\'==="object"\'),i(\'!("cmp" in \',n,")||(",n,".cmp in ",r,")")})),[e.def(\'"cmp" in \',n,"?",r,"[",n,".cmp]",":",7680),e.def(n,".ref|0"),e.def(\'"mask" in \',n,"?",n,".mask|0:-1")]}));case"stencil.opFront":case"stencil.opBack":return u((function(n){S.commandType(n,"object",s,e.commandStr);var r=n.fail||"keep",i=n.zfail||"keep",o=n.zpass||"keep";return S.commandParameter(r,te,t+".fail",e.commandStr),S.commandParameter(i,te,t+".zfail",e.commandStr),S.commandParameter(o,te,t+".zpass",e.commandStr),["stencil.opBack"===t?1029:1028,te[r],te[i],te[o]]}),(function(e,n,r){var i=e.constants.stencilOps;function o(o){return S.optional((function(){e.assert(n,\'!("\'+o+\'" in \'+r+")||("+r+"."+o+" in "+i+")","invalid "+t+"."+o+", must be one of "+Object.keys(te))})),n.def(\'"\',o,\'" in \',r,"?",i,"[",r,".",o,"]:",7680)}return S.optional((function(){e.assert(n,r+"&&typeof "+r+\'==="object"\',"invalid "+t)})),["stencil.opBack"===t?1029:1028,o("fail"),o("zfail"),o("zpass")]}));case"polygonOffset.offset":return u((function(t){S.commandType(t,"object",s,e.commandStr);var n=0|t.factor,r=0|t.units;return S.commandType(n,"number",s+".factor",e.commandStr),S.commandType(r,"number",s+".units",e.commandStr),[n,r]}),(function(e,n,r){return S.optional((function(){e.assert(n,r+"&&typeof "+r+\'==="object"\',"invalid "+t)})),[n.def(r,".factor|0"),n.def(r,".units|0")]}));case"cull.face":return u((function(t){var n=0;return"front"===t?n=1028:"back"===t&&(n=1029),S.command(!!n,s,e.commandStr),n}),(function(t,e,n){return S.optional((function(){t.assert(e,n+\'==="front"||\'+n+\'==="back"\',"invalid cull.face")})),e.def(n,\'==="front"?\',1028,":",1029)}));case"lineWidth":return u((function(t){return S.command("number"==typeof t&&t>=i.lineWidthDims[0]&&t<=i.lineWidthDims[1],"invalid line width, must be a positive number between "+i.lineWidthDims[0]+" and "+i.lineWidthDims[1],e.commandStr),t}),(function(t,e,n){return S.optional((function(){t.assert(e,"typeof "+n+\'==="number"&&\'+n+">="+i.lineWidthDims[0]+"&&"+n+"<="+i.lineWidthDims[1],"invalid line width")})),n}));case"frontFace":return u((function(t){return S.commandParameter(t,ne,s,e.commandStr),ne[t]}),(function(t,e,n){return S.optional((function(){t.assert(e,n+\'==="cw"||\'+n+\'==="ccw"\',"invalid frontFace, must be one of cw,ccw")})),e.def(n+\'==="cw"?2304:2305\')}));case"colorMask":return u((function(t){return S.command(tt(t)&&4===t.length,"color.mask must be length 4 array",e.commandStr),t.map((function(t){return!!t}))}),(function(t,e,n){return S.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===4","invalid color.mask")})),j(4,(function(t){return"!!"+n+"["+t+"]"}))}));case"sample.coverage":return u((function(t){S.command("object"===a(t)&&t,s,e.commandStr);var n="value"in t?t.value:1,r=!!t.invert;return S.command("number"==typeof n&&n>=0&&n<=1,"sample.coverage.value must be a number between 0 and 1",e.commandStr),[n,r]}),(function(t,e,n){return S.optional((function(){t.assert(e,n+"&&typeof "+n+\'==="object"\',"invalid sample.coverage")})),[e.def(\'"value" in \',n,"?+",n,".value:1"),e.def("!!",n,".invert")]}))}})),o}(t,d),k=function(t,e,r){var i=t.static,o=t.dynamic;function a(t){if(t in i){var e=n.id(i[t]);S.optional((function(){h.shader(ee[t],e,S.guessCommand())}));var r=se((function(){return e}));return r.id=e,r}if(t in o){var a=o[t];return ue(a,(function(e,n){var r=e.invoke(n,a),i=n.def(e.shared.strings,".id(",r,")");return S.optional((function(){n(e.shared.shader,".shader(",ee[t],",",i,",",e.command,");")})),i}))}return null}var s,u=a(Ut),c=a(Ft),f=null;return ae(u)&&ae(c)?(f=h.program(c.id,u.id,null,r),s=se((function(t,e){return t.link(f)}))):s=new oe(u&&u.thisDep||c&&c.thisDep,u&&u.contextDep||c&&c.contextDep,u&&u.propDep||c&&c.propDep,(function(t,e){var n,r=t.shared.shader;n=u?u.append(t,e):e.def(r,".",Ut);var i=r+".program("+(c?c.append(t,e):e.def(r,".",Ft))+","+n;return S.optional((function(){i+=","+t.command})),e.def(i+")")})),{frag:u,vert:c,progVar:s,program:f}}(t,0,v);function M(t){var e=w[t];e&&(O[t]=e)}M("viewport"),M(A("scissor.box"));var T=Object.keys(O).length>0,C={framebuffer:x,draw:E,shader:k,state:O,dirty:T,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(C.profile=function(t){var e,n=t.static,r=t.dynamic;if(Bt in n){var i=!!n[Bt];(e=se((function(t,e){return i}))).enable=i}else if(Bt in r){var o=r[Bt];e=ue(o,(function(t,e){return t.invoke(e,o)}))}return e}(t),C.uniforms=function(t,e){var n=t.static,r=t.dynamic,i={};return Object.keys(n).forEach((function(t){var r,o=n[t];if("number"==typeof o||"boolean"==typeof o)r=se((function(){return o}));else if("function"==typeof o){var a=o._reglType;"texture2d"===a||"textureCube"===a?r=se((function(t){return t.link(o)})):"framebuffer"===a||"framebufferCube"===a?(S.command(o.color.length>0,\'missing color attachment for framebuffer sent to uniform "\'+t+\'"\',e.commandStr),r=se((function(t){return t.link(o.color[0])}))):S.commandRaise(\'invalid data for uniform "\'+t+\'"\',e.commandStr)}else tt(o)?r=se((function(e){return e.global.def("[",j(o.length,(function(n){return S.command("number"==typeof o[n]||"boolean"==typeof o[n],"invalid uniform "+t,e.commandStr),o[n]})),"]")})):S.commandRaise(\'invalid or missing data for uniform "\'+t+\'"\',e.commandStr);r.value=o,i[t]=r})),Object.keys(r).forEach((function(t){var e=r[t];i[t]=ue(e,(function(t,n){return t.invoke(n,e)}))})),i}(u,d),C.drawVAO=C.scopeVAO=function(t,e){var n=t.static,r=t.dynamic;if(Ht in n){var i=n[Ht];return null!==i&&null===l.getVAO(i)&&(i=l.createVAO(i)),se((function(t){return t.link(l.getVAO(i))}))}if(Ht in r){var o=r[Ht];return ue(o,(function(t,e){var n=t.invoke(e,o);return e.def(t.shared.vao+".getVAO("+n+")")}))}return null}(t),!C.drawVAO&&k.program&&!v&&r.angle_instanced_arrays){var I=!0,P=k.program.attributes.map((function(t){var n=e.static[t];return I=I&&!!n,n}));if(I&&P.length>0){var D=l.getVAO(l.createVAO(P));C.drawVAO=new oe(null,null,null,(function(t,e){return t.link(D)})),C.useVAO=!0}}return v?C.useVAO=!0:C.attributes=function(t,e){var r=t.static,i=t.dynamic,s={};return Object.keys(r).forEach((function(t){var i=r[t],u=n.id(t),c=new y;if(re(i))c.state=1,c.buffer=o.getBuffer(o.create(i,34962,!1,!0)),c.type=0;else{var f=o.getBuffer(i);if(f)c.state=1,c.buffer=f,c.type=0;else if(S.command("object"===a(i)&&i,"invalid data for attribute "+t,e.commandStr),"constant"in i){var l=i.constant;c.buffer="null",c.state=2,"number"==typeof l?c.x=l:(S.command(tt(l)&&l.length>0&&l.length<=4,"invalid constant for attribute "+t,e.commandStr),Lt.forEach((function(t,e){e=0,\'invalid offset for attribute "\'+t+\'"\',e.commandStr);var d=0|i.stride;S.command(d>=0&&d<256,\'invalid stride for attribute "\'+t+\'", must be integer betweeen [0, 255]\',e.commandStr);var p=0|i.size;S.command(!("size"in i)||p>0&&p<=4,\'invalid size for attribute "\'+t+\'", must be 1,2,3,4\',e.commandStr);var g=!!i.normalized,v=0;"type"in i&&(S.commandParameter(i.type,z,"invalid type for attribute "+t,e.commandStr),v=z[i.type]);var m=0|i.divisor;"divisor"in i&&(S.command(0===m||b,\'cannot specify divisor for attribute "\'+t+\'", instancing not supported\',e.commandStr),S.command(m>=0,\'invalid divisor for attribute "\'+t+\'"\',e.commandStr)),S.optional((function(){var n=e.commandStr,r=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(i).forEach((function(e){S.command(r.indexOf(e)>=0,\'unknown parameter "\'+e+\'" for attribute pointer "\'+t+\'" (valid parameters are \'+r+")",n)}))})),c.buffer=f,c.state=1,c.size=p,c.normalized=g,c.type=v||f.dtype,c.offset=h,c.stride=d,c.divisor=m}}s[t]=se((function(t,e){var n=t.attribCache;if(u in n)return n[u];var r={isStream:!1};return Object.keys(c).forEach((function(t){r[t]=c[t]})),c.buffer&&(r.buffer=t.link(c.buffer),r.type=r.type||r.buffer+".dtype"),n[u]=r,r}))})),Object.keys(i).forEach((function(t){var e=i[t];s[t]=ue(e,(function(n,r){var i=n.invoke(r,e),o=n.shared,a=n.constants,s=o.isBufferArgs,u=o.buffer;S.optional((function(){n.assert(r,i+"&&(typeof "+i+\'==="object"||typeof \'+i+\'==="function")&&(\'+s+"("+i+")||"+u+".getBuffer("+i+")||"+u+".getBuffer("+i+".buffer)||"+s+"("+i+\'.buffer)||("constant" in \'+i+"&&(typeof "+i+\'.constant==="number"||\'+o.isArrayLike+"("+i+".constant))))",\'invalid dynamic attribute "\'+t+\'"\')}));var c={isStream:r.def(!1)},f=new y;f.state=1,Object.keys(f).forEach((function(t){c[t]=r.def(""+f[t])}));var l=c.buffer,h=c.type;function d(t){r(c[t],"=",i,".",t,"|0;")}return r("if(",s,"(",i,")){",c.isStream,"=true;",l,"=",u,".createStream(",34962,",",i,");",h,"=",l,".dtype;","}else{",l,"=",u,".getBuffer(",i,");","if(",l,"){",h,"=",l,".dtype;",\'}else if("constant" in \',i,"){",c.state,"=",2,";","if(typeof "+i+\'.constant === "number"){\',c[Lt[0]],"=",i,".constant;",Lt.slice(1).map((function(t){return c[t]})).join("="),"=0;","}else{",Lt.map((function(t,e){return c[t]+"="+i+".constant.length>"+e+"?"+i+".constant["+e+"]:0;"})).join(""),"}}else{","if(",s,"(",i,".buffer)){",l,"=",u,".createStream(",34962,",",i,".buffer);","}else{",l,"=",u,".getBuffer(",i,".buffer);","}",h,\'="type" in \',i,"?",a.glTypes,"[",i,".type]:",l,".dtype;",c.normalized,"=!!",i,".normalized;"),d("size"),d("offset"),d("stride"),d("divisor"),r("}}"),r.exit("if(",c.isStream,"){",u,".destroyStream(",l,");","}"),c}))})),s}(e,d),C.context=function(t){var e=t.static,n=t.dynamic,r={};return Object.keys(e).forEach((function(t){var n=e[t];r[t]=se((function(t,e){return"number"==typeof n||"boolean"==typeof n?""+n:t.link(n)}))})),Object.keys(n).forEach((function(t){var e=n[t];r[t]=ue(e,(function(t,n){return t.invoke(n,e)}))})),r}(f),C}function L(t,e,n){var r=t.shared.context,i=t.scope();Object.keys(n).forEach((function(o){e.save(r,"."+o);var a=n[o].append(t,e);Array.isArray(a)?i(r,".",o,"=[",a.join(),"];"):i(r,".",o,"=",a,";")})),e(i)}function B(t,e,n,r){var i,o=t.shared,a=o.gl,s=o.framebuffer;x&&(i=e.def(o.extensions,".webgl_draw_buffers"));var u,c=t.constants,f=c.drawBuffer,l=c.backBuffer;u=n?n.append(t,e):e.def(s,".next"),r||e("if(",u,"!==",s,".cur){"),e("if(",u,"){",a,".bindFramebuffer(",36160,",",u,".framebuffer);"),x&&e(i,".drawBuffersWEBGL(",f,"[",u,".colorAttachments.length]);"),e("}else{",a,".bindFramebuffer(",36160,",null);"),x&&e(i,".drawBuffersWEBGL(",l,");"),e("}",s,".cur=",u,";"),r||e("}")}function G(t,e,n){var r=t.shared,i=r.gl,o=t.current,a=t.next,s=r.current,u=r.next,c=t.cond(s,".dirty");_.forEach((function(e){var r,f,l=A(e);if(!(l in n.state))if(l in a){r=a[l],f=o[l];var h=j(w[l].length,(function(t){return c.def(r,"[",t,"]")}));c(t.cond(h.map((function(t,e){return t+"!=="+f+"["+e+"]"})).join("||")).then(i,".",k[l],"(",h,");",h.map((function(t,e){return f+"["+e+"]="+t})).join(";"),";"))}else{r=c.def(u,".",l);var d=t.cond(r,"!==",s,".",l);c(d),l in O?d(t.cond(r).then(i,".enable(",O[l],");").else(i,".disable(",O[l],");"),s,".",l,"=",r,";"):d(i,".",k[l],"(",r,");",s,".",l,"=",r,";")}})),0===Object.keys(n.state).length&&c(s,".dirty=false;"),e(c)}function F(t,e,n,r){var i=t.shared,o=t.current,a=i.current,s=i.gl;ie(Object.keys(n)).forEach((function(i){var u=n[i];if(!r||r(u)){var c=u.append(t,e);if(O[i]){var f=O[i];ae(u)?e(s,c?".enable(":".disable(",f,");"):e(t.cond(c).then(s,".enable(",f,");").else(s,".disable(",f,");")),e(a,".",i,"=",c,";")}else if(tt(c)){var l=o[i];e(s,".",k[i],"(",c,");",c.map((function(t,e){return l+"["+e+"]="+t})).join(";"),";")}else e(s,".",k[i],"(",c,");",a,".",i,"=",c,";")}}))}function U(t,e){b&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function V(t,e,n,r,i){var o,a,s,u=t.shared,c=t.stats,f=u.current,l=u.timer,h=n.profile;function d(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function p(t){t(o=e.def(),"=",d(),";"),"string"==typeof i?t(c,".count+=",i,";"):t(c,".count++;"),g&&(r?t(a=e.def(),"=",l,".getNumPendingQueries();"):t(l,".beginQuery(",c,");"))}function v(t){t(c,".cpuTime+=",d(),"-",o,";"),g&&(r?t(l,".pushScopeStats(",a,",",l,".getNumPendingQueries(),",c,");"):t(l,".endQuery();"))}function y(t){var n=e.def(f,".profile");e(f,".profile=",t,";"),e.exit(f,".profile=",n,";")}if(h){if(ae(h))return void(h.enable?(p(e),v(e.exit),y("true")):y("false"));y(s=h.append(t,e))}else s=e.def(f,".profile");var m=t.block();p(m),e("if(",s,"){",m,"}");var b=t.block();v(b),e.exit("if(",s,"){",b,"}")}function W(t,e,n,r,i){var o=t.shared;r.forEach((function(r){var a,s=r.name,u=n.attributes[s];if(u){if(!i(u))return;a=u.append(t,e)}else{if(!i(ce))return;var c=t.scopeAttrib(s);S.optional((function(){t.assert(e,c+".state","missing attribute "+s)})),a={},Object.keys(new y).forEach((function(t){a[t]=e.def(c,".",t)}))}!function(n,r,i){var a=o.gl,s=e.def(n,".location"),u=e.def(o.attributes,"[",s,"]"),c=i.state,f=i.buffer,l=[i.x,i.y,i.z,i.w],h=["buffer","normalized","offset","stride"];function d(){e("if(!",u,".buffer){",a,".enableVertexAttribArray(",s,");}");var n,o=i.type;if(n=i.size?e.def(i.size,"||",r):r,e("if(",u,".type!==",o,"||",u,".size!==",n,"||",h.map((function(t){return u+"."+t+"!=="+i[t]})).join("||"),"){",a,".bindBuffer(",34962,",",f,".buffer);",a,".vertexAttribPointer(",[s,n,o,i.normalized,i.stride,i.offset],");",u,".type=",o,";",u,".size=",n,";",h.map((function(t){return u+"."+t+"="+i[t]+";"})).join(""),"}"),b){var c=i.divisor;e("if(",u,".divisor!==",c,"){",t.instancing,".vertexAttribDivisorANGLE(",[s,c],");",u,".divisor=",c,";}")}}function p(){e("if(",u,".buffer){",a,".disableVertexAttribArray(",s,");",u,".buffer=null;","}if(",Lt.map((function(t,e){return u+"."+t+"!=="+l[e]})).join("||"),"){",a,".vertexAttrib4f(",s,",",l,");",Lt.map((function(t,e){return u+"."+t+"="+l[e]+";"})).join(""),"}")}1===c?d():2===c?p():(e("if(",c,"===",1,"){"),d(),e("}else{"),p(),e("}"))}(t.link(r),function(t){switch(t){case 35664:case 35667:case 35671:return 2;case 35665:case 35668:case 35672:return 3;case 35666:case 35669:case 35673:return 4;default:return 1}}(r.info.type),a)}))}function X(t,e,r,i,o){for(var a,s=t.shared,u=s.gl,c=0;c1?e(j(x,(function(t){return Array.isArray(f)?f[t]:f+"["+t+"]"}))):(S(!Array.isArray(f),"uniform value must not be an array"),e(f));e(");")}}function Y(t,e,n,r){var i=t.shared,o=i.gl,a=i.draw,s=r.draw,u=function(){var i,u=s.elements,c=e;return u?((u.contextDep&&r.contextDynamic||u.propDep)&&(c=n),i=u.append(t,c)):i=c.def(a,".",zt),i&&c("if("+i+")"+o+".bindBuffer(34963,"+i+".buffer.buffer);"),i}();function c(i){var o=s[i];return o?o.contextDep&&r.contextDynamic||o.propDep?o.append(t,n):o.append(t,e):e.def(a,".",i)}var f,l,h=c(Vt),d=c(Xt),p=function(){var i,o=s.count,u=e;return o?((o.contextDep&&r.contextDynamic||o.propDep)&&(u=n),i=o.append(t,u),S.optional((function(){o.MISSING&&t.assert(e,"false","missing vertex count"),o.DYNAMIC&&t.assert(u,i+">=0","missing vertex count")}))):(i=u.def(a,".",Wt),S.optional((function(){t.assert(u,i+">=0","missing vertex count")}))),i}();if("number"==typeof p){if(0===p)return}else n("if(",p,"){"),n.exit("}");b&&(f=c(Yt),l=t.instancing);var g=u+".type",v=s.elements&&ae(s.elements);function y(){function t(){n(l,".drawElementsInstancedANGLE(",[h,p,g,d+"<<(("+g+"-5121)>>1)",f],");")}function e(){n(l,".drawArraysInstancedANGLE(",[h,d,p,f],");")}u?v?t():(n("if(",u,"){"),t(),n("}else{"),e(),n("}")):e()}function m(){function t(){n(o+".drawElements("+[h,p,g,d+"<<(("+g+"-5121)>>1)"]+");")}function e(){n(o+".drawArrays("+[h,d,p]+");")}u?v?t():(n("if(",u,"){"),t(),n("}else{"),e(),n("}")):e()}b&&("number"!=typeof f||f>=0)?"string"==typeof f?(n("if(",f,">0){"),y(),n("}else if(",f,"<0){"),m(),n("}")):y():m()}function H(t,e,n,r,i){var o=N(),a=o.proc("body",i);return S.optional((function(){o.commandStr=e.commandStr,o.command=o.link(e.commandStr)})),b&&(o.instancing=a.def(o.shared.extensions,".angle_instanced_arrays")),t(o,a,n,r),o.compile().body}function q(t,e,n,r){U(t,e),n.useVAO?n.drawVAO?e(t.shared.vao,".setVAO(",n.drawVAO.append(t,e),");"):e(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(e(t.shared.vao,".setVAO(null);"),W(t,e,n,r.attributes,(function(){return!0}))),X(t,e,n,r.uniforms,(function(){return!0})),Y(t,e,e,n)}function K(t,e,n,r){function i(){return!0}t.batchId="a1",U(t,e),W(t,e,n,r.attributes,i),X(t,e,n,r.uniforms,i),Y(t,e,e,n)}function Q(t,e,n,r){U(t,e);var i=n.contextDep,o=e.def(),a=e.def();t.shared.props=a,t.batchId=o;var s=t.scope(),u=t.scope();function c(t){return t.contextDep&&i||t.propDep}function f(t){return!c(t)}if(e(s.entry,"for(",o,"=0;",o,"<","a1",";++",o,"){",a,"=","a0","[",o,"];",u,"}",s.exit),n.needsContext&&L(t,u,n.context),n.needsFramebuffer&&B(t,u,n.framebuffer),F(t,u,n.state,c),n.profile&&c(n.profile)&&V(t,u,n,!1,!0),r)n.useVAO?n.drawVAO?c(n.drawVAO)?u(t.shared.vao,".setVAO(",n.drawVAO.append(t,u),");"):s(t.shared.vao,".setVAO(",n.drawVAO.append(t,s),");"):s(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(s(t.shared.vao,".setVAO(null);"),W(t,s,n,r.attributes,f),W(t,u,n,r.attributes,c)),X(t,s,n,r.uniforms,f),X(t,u,n,r.uniforms,c),Y(t,s,u,n);else{var l=t.global.def("{}"),h=n.shader.progVar.append(t,u),d=u.def(h,".id"),p=u.def(l,"[",d,"]");u(t.shared.gl,".useProgram(",h,".program);","if(!",p,"){",p,"=",l,"[",d,"]=",t.link((function(e){return H(K,t,n,e,2)})),"(",h,");}",p,".call(this,a0[",o,"],",o,");")}}function J(t,e,n){var r=e.static[n];if(r&&function(t){if("object"===a(t)&&!tt(t)){for(var e=Object.keys(t),n=0;n0&&n(t.shared.current,".dirty=true;")}(s,u),function(t,e){var r=t.proc("scope",3);t.batchId="a2";var i=t.shared,o=i.current;function a(n){var o=e.shader[n];o&&r.set(i.shader,"."+n,o.append(t,r))}L(t,r,e.context),e.framebuffer&&e.framebuffer.append(t,r),ie(Object.keys(e.state)).forEach((function(n){var o=e.state[n].append(t,r);tt(o)?o.forEach((function(e,i){r.set(t.next[n],"["+i+"]",e)})):r.set(i.next,"."+n,o)})),V(t,r,e,!0,!0),[zt,Xt,Wt,Yt,Vt].forEach((function(n){var o=e.draw[n];o&&r.set(i.draw,"."+n,""+o.append(t,r))})),Object.keys(e.uniforms).forEach((function(o){var a=e.uniforms[o].append(t,r);Array.isArray(a)&&(a="["+a.join()+"]"),r.set(i.uniforms,"["+n.id(o)+"]",a)})),Object.keys(e.attributes).forEach((function(n){var i=e.attributes[n].append(t,r),o=t.scopeAttrib(n);Object.keys(new y).forEach((function(t){r.set(o,"."+t,i[t])}))})),e.scopeVAO&&r.set(i.vao,".targetVAO",e.scopeVAO.append(t,r)),a(Ft),a(Ut),Object.keys(e.state).length>0&&(r(o,".dirty=true;"),r.exit(o,".dirty=true;")),r("a1(",t.shared.context,",a0,",t.batchId,");")}(s,u),function(t,e){var n=t.proc("batch",2);t.batchId="0",U(t,n);var r=!1,i=!0;Object.keys(e.context).forEach((function(t){r=r||e.context[t].propDep})),r||(L(t,n,e.context),i=!1);var o=e.framebuffer,a=!1;function s(t){return t.contextDep&&r||t.propDep}o?(o.propDep?r=a=!0:o.contextDep&&r&&(a=!0),a||B(t,n,o)):B(t,n,null),e.state.viewport&&e.state.viewport.propDep&&(r=!0),G(t,n,e),F(t,n,e.state,(function(t){return!s(t)})),e.profile&&s(e.profile)||V(t,n,e,!1,"a1"),e.contextDep=r,e.needsContext=i,e.needsFramebuffer=a;var u=e.shader.progVar;if(u.contextDep&&r||u.propDep)Q(t,n,e,null);else{var c=u.append(t,n);if(n(t.shared.gl,".useProgram(",c,".program);"),e.shader.program)Q(t,n,e,e.shader.program);else{n(t.shared.vao,".setVAO(null);");var f=t.global.def("{}"),l=n.def(c,".id"),h=n.def(f,"[",l,"]");n(t.cond(h).then(h,".call(this,a0,a1);").else(h,"=",f,"[",l,"]=",t.link((function(n){return H(Q,t,e,n,2)})),"(",c,");",h,".call(this,a0,a1);"))}}Object.keys(e.state).length>0&&n(t.shared.current,".dirty=true;")}(s,u),e(s.compile(),{destroy:function(){u.shader.program.destroy()}})}}}var le=function(t,e){if(!e.ext_disjoint_timer_query)return null;var n=[];function r(t){n.push(t)}var i=[];function o(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var a=[];function s(t){a.push(t)}var u=[];function c(t,e,n){var r=a.pop()||new o;r.startQueryIndex=t,r.endQueryIndex=e,r.sum=0,r.stats=n,u.push(r)}var f=[],l=[];return{beginQuery:function(t){var r=n.pop()||e.ext_disjoint_timer_query.createQueryEXT();e.ext_disjoint_timer_query.beginQueryEXT(35007,r),i.push(r),c(i.length-1,i.length,t)},endQuery:function(){e.ext_disjoint_timer_query.endQueryEXT(35007)},pushScopeStats:c,update:function(){var t,n,o=i.length;if(0!==o){l.length=Math.max(l.length,o+1),f.length=Math.max(f.length,o+1),f[0]=0,l[0]=0;var a=0;for(t=0,n=0;n0)if(Array.isArray(n[0])){s=X(n);for(var f=1,l=1;l0)if("number"==typeof e[0]){var o=R.allocType(h.dtype,e.length);q(o,e),p(o,i),R.freeType(o)}else if(Array.isArray(e[0])||t(e[0])){r=X(e);var a=W(e,r,h.dtype);p(a,i),R.freeType(a)}else S.raise("invalid buffer data")}else if(L(e)){r=e.shape;var s=e.stride,u=0,c=0,f=0,l=0;1===r.length?(u=r[0],c=1,f=s[0],l=0):2===r.length?(u=r[0],c=r[1],f=s[0],l=s[1]):S.raise("invalid shape");var g=Array.isArray(e.data)?h.dtype:H(e.data),v=R.allocType(g,u*c);K(v,e.data,u,c,f,l,e.offset),p(v,i),R.freeType(v)}else S.raise("invalid data for buffer subdata");return d},r.profile&&(d.stats=h.stats),d.destroy=function(){l(h)},d},createStream:function(t,e){var n=u.pop();return n||(n=new s(t)),n.bind(),f(n,e,35040,0,1,!1),n},destroyStream:function(t){u.push(t)},clear:function(){B(a).forEach(l),u.forEach(l)},getBuffer:function(t){return t&&t._buffer instanceof s?t._buffer:null},restore:function(){B(a).forEach((function(t){t.buffer=e.createBuffer(),e.bindBuffer(t.type,t.buffer),e.bufferData(t.type,t.persistentData||t.byteLength,t.usage)}))},_initBuffer:f}}(i,h,r,(function(t){return w.destroyBuffer(t)})),w=function(e,n,r,i,o){for(var a=r.maxAttributes,s=new Array(a),u=0;u0,"must specify at least one attribute");var i={},u=r.attributes;u.length=e.length;for(var c=0;c=d.byteLength?f.subdata(d):(f.destroy(),r.buffers[c]=null)),r.buffers[c]||(f=r.buffers[c]=o.create(l,34962,!1,!0)),h.buffer=o.getBuffer(f),h.size=0|h.buffer.dimension,h.normalized=!1,h.type=h.buffer.dtype,h.offset=0,h.stride=0,h.divisor=0,h.state=1,i[c]=1):o.getBuffer(l)?(h.buffer=o.getBuffer(l),h.size=0|h.buffer.dimension,h.normalized=!1,h.type=h.buffer.dtype,h.offset=0,h.stride=0,h.divisor=0,h.state=1):o.getBuffer(l.buffer)?(h.buffer=o.getBuffer(l.buffer),h.size=0|(+l.size||h.buffer.dimension),h.normalized=!!l.normalized||!1,"type"in l?(S.parameter(l.type,z,"invalid buffer type"),h.type=z[l.type]):h.type=h.buffer.dtype,h.offset=0|(l.offset||0),h.stride=0|(l.stride||0),h.divisor=0|(l.divisor||0),h.state=1,S(h.size>=1&&h.size<=4,"size must be between 1 and 4"),S(h.offset>=0,"invalid offset"),S(h.stride>=0&&h.stride<=255,"stride must be between 0 and 255"),S(h.divisor>=0,"divisor must be positive"),S(!h.divisor||!!n.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in l?(S(c>0,"first attribute must not be a constant"),h.x=+l.x||0,h.y=+l.y||0,h.z=+l.z||0,h.w=+l.w||0,h.state=2):S(!1,"invalid attribute spec for location "+c)}for(var p=0;p>=1:5125===l&&(d>>=2)),i.vertCount=d;var p=s;if(s<0){p=4;var g=i.buffer.dimension;1===g&&(p=0),2===g&&(p=1),3===g&&(p=4)}i.primType=p}function l(t){i.elementsCount--,S(null!==t.buffer,"must not double destroy elements"),delete o[t.id],t.buffer.destroy(),t.buffer=null}return{create:function(e,n){var o=r.create(null,34963,!0),a=new u(o._buffer);function c(e){if(e)if("number"==typeof e)o(e),a.primType=4,a.vertCount=0|e,a.type=5121;else{var n=null,r=35044,i=-1,u=-1,l=0,h=0;Array.isArray(e)||t(e)||L(e)?n=e:(S.type(e,"object","invalid arguments for elements"),"data"in e&&(n=e.data,S(Array.isArray(n)||t(n)||L(n),"invalid data for element buffer")),"usage"in e&&(S.parameter(e.usage,V,"invalid element buffer usage"),r=V[e.usage]),"primitive"in e&&(S.parameter(e.primitive,Z,"invalid element buffer primitive"),i=Z[e.primitive]),"count"in e&&(S("number"==typeof e.count&&e.count>=0,"invalid vertex count for elements"),u=0|e.count),"type"in e&&(S.parameter(e.type,s,"invalid buffer type"),h=s[e.type]),"length"in e?l=0|e.length:(l=u,5123===h||5122===h?l*=2:5125!==h&&5124!==h||(l*=4))),f(a,n,r,i,u,l,h)}else o(),a.primType=4,a.vertCount=0,a.type=5121;return c}return i.elementsCount++,c(e),c._reglType="elements",c._elements=a,c.subdata=function(t,e){return o.subdata(t,e),c},c.destroy=function(){l(a)},c},createStream:function(t){var e=c.pop();return e||(e=new u(r.create(null,34963,!0,!1)._buffer)),f(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){c.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof u?t._elements:null},clear:function(){B(o).forEach(l)}}}(i,d,x,h),_=function(t,n,r,i){var o={},a={};function s(t,e,n,r){this.name=t,this.id=e,this.location=n,this.info=r}function u(t,e){for(var n=0;n1)for(var y=0;yt&&(t=e.stats.uniformsCount)})),t},r.getMaxAttributesCount=function(){var t=0;return l.forEach((function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)})),t}),{clear:function(){var e=t.deleteShader.bind(t);B(o).forEach(e),o={},B(a).forEach(e),a={},l.forEach((function(e){t.deleteProgram(e.program)})),l.length=0,f={},r.shaderCount=0},program:function(n,i,s,u){S.command(n>=0,"missing vertex shader",s),S.command(i>=0,"missing fragment shader",s);var c=f[i];c||(c=f[i]={});var h=c[n];if(h&&(h.refCount++,!u))return h;var g=new d(i,n);return r.shaderCount++,p(g,s,u),h||(c[n]=g),l.push(g),e(g,{destroy:function(){if(g.refCount--,g.refCount<=0){t.deleteProgram(g.program);var e=l.indexOf(g);l.splice(e,1),r.shaderCount--}c[g.vertId].refCount<=0&&(t.deleteShader(a[g.vertId]),delete a[g.vertId],delete f[g.fragId][g.vertId]),Object.keys(f[g.fragId]).length||(t.deleteShader(o[g.fragId]),delete o[g.fragId],delete f[g.fragId])}})},restore:function(){o={},a={};for(var t=0;t=2,"invalid renderbuffer shape"),u=0|p[0],c=0|p[1]}else"radius"in d&&(u=c=0|d.radius),"width"in d&&(u=0|d.width),"height"in d&&(c=0|d.height);"format"in d&&(S.parameter(d.format,o,"invalid renderbuffer format"),f=o[d.format])}else"number"==typeof e?(u=0|e,c="number"==typeof r?0|r:u):e?S.raise("invalid arguments to renderbuffer constructor"):u=c=1;if(S(u>0&&c>0&&u<=n.maxRenderbufferSize&&c<=n.maxRenderbufferSize,"invalid renderbuffer size"),u!==l.width||c!==l.height||f!==l.format)return h.width=l.width=u,h.height=l.height=c,l.format=f,t.bindRenderbuffer(36161,l.renderbuffer),t.renderbufferStorage(36161,f,u,c),S(0===t.getError(),"invalid render buffer format"),i.profile&&(l.stats.size=Mt(l.format,l.width,l.height)),h.format=s[l.format],h}return c[l.id]=l,r.renderbufferCount++,h(e,u),h.resize=function(e,r){var o=0|e,a=0|r||o;return o===l.width&&a===l.height||(S(o>0&&a>0&&o<=n.maxRenderbufferSize&&a<=n.maxRenderbufferSize,"invalid renderbuffer size"),h.width=l.width=o,h.height=l.height=a,t.bindRenderbuffer(36161,l.renderbuffer),t.renderbufferStorage(36161,l.format,o,a),S(0===t.getError(),"invalid render buffer format"),i.profile&&(l.stats.size=Mt(l.format,l.width,l.height))),h},h._reglType="renderbuffer",h._renderbuffer=l,i.profile&&(h.stats=l.stats),h.destroy=function(){l.decRef()},h},clear:function(){B(c).forEach(l)},restore:function(){B(c).forEach((function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,e.renderbuffer),t.renderbufferStorage(36161,e.format,e.width,e.height)})),t.bindRenderbuffer(36161,null)}}}(i,d,b,h,r),C=function(t,n,r,i,o,s){var u={cur:null,next:null,dirty:!1,setFBO:null},c=["rgba"],f=["rgba4","rgb565","rgb5 a1"];n.ext_srgb&&f.push("srgba"),n.ext_color_buffer_half_float&&f.push("rgba16f","rgb16f"),n.webgl_color_buffer_float&&f.push("rgba32f");var l=["uint8"];function h(t,e,n){this.target=t,this.texture=e,this.renderbuffer=n;var r=0,i=0;e?(r=e.width,i=e.height):n&&(r=n.width,i=n.height),this.width=r,this.height=i}function d(t){t&&(t.texture&&t.texture._texture.decRef(),t.renderbuffer&&t.renderbuffer._renderbuffer.decRef())}function p(t,e,n){if(t)if(t.texture){var r=t.texture._texture,i=Math.max(1,r.width),o=Math.max(1,r.height);S(i===e&&o===n,"inconsistent width/height for supplied texture"),r.refCount+=1}else{var a=t.renderbuffer._renderbuffer;S(a.width===e&&a.height===n,"inconsistent width/height for renderbuffer"),a.refCount+=1}}function g(e,n){n&&(n.texture?t.framebufferTexture2D(36160,e,n.target,n.texture._texture.texture,0):t.framebufferRenderbuffer(36160,e,36161,n.renderbuffer._renderbuffer.renderbuffer))}function v(t){var e=3553,n=null,r=null,i=t;"object"===a(t)&&(i=t.data,"target"in t&&(e=0|t.target)),S.type(i,"function","invalid attachment data");var o=i._reglType;return"texture2d"===o?(n=i,S(3553===e)):"textureCube"===o?(n=i,S(e>=34069&&e<34075,"invalid cube map target")):"renderbuffer"===o?(r=i,e=36161):S.raise("invalid regl object for attachment"),new h(e,n,r)}function y(t,e,n,r,a){if(n){var s=i.create2D({width:t,height:e,format:r,type:a});return s._texture.refCount=0,new h(3553,s,null)}var u=o.create({width:t,height:e,format:r});return u._renderbuffer.refCount=0,new h(36161,null,u)}function m(t){return t&&(t.texture||t.renderbuffer)}function b(t,e,n){t&&(t.texture?t.texture.resize(e,n):t.renderbuffer&&t.renderbuffer.resize(e,n),t.width=e,t.height=n)}n.oes_texture_half_float&&l.push("half float","float16"),n.oes_texture_float&&l.push("float","float32");var x=0,w={};function E(){this.id=x++,w[this.id]=this,this.framebuffer=t.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function _(t){t.colorAttachments.forEach(d),d(t.depthAttachment),d(t.stencilAttachment),d(t.depthStencilAttachment)}function O(e){var n=e.framebuffer;S(n,"must not double destroy framebuffer"),t.deleteFramebuffer(n),e.framebuffer=null,s.framebufferCount--,delete w[e.id]}function k(e){var n;t.bindFramebuffer(36160,e.framebuffer);var i=e.colorAttachments;for(n=0;n=2,"invalid shape for framebuffer"),s=P[0],h=P[1]}else"radius"in I&&(s=h=I.radius),"width"in I&&(s=I.width),"height"in I&&(h=I.height);("color"in I||"colors"in I)&&(b=I.color||I.colors,Array.isArray(b)&&S(1===b.length||n.webgl_draw_buffers,"multiple render targets not supported")),b||("colorCount"in I&&(O=0|I.colorCount,S(O>0,"invalid color buffer count")),"colorTexture"in I&&(x=!!I.colorTexture,w="rgba4"),"colorType"in I&&(E=I.colorType,x?(S(n.oes_texture_float||!("float"===E||"float32"===E),"you must enable OES_texture_float in order to use floating point framebuffer objects"),S(n.oes_texture_half_float||!("half float"===E||"float16"===E),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):"half float"===E||"float16"===E?(S(n.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),w="rgba16f"):"float"!==E&&"float32"!==E||(S(n.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),w="rgba32f"),S.oneOf(E,l,"invalid color type")),"colorFormat"in I&&(w=I.colorFormat,c.indexOf(w)>=0?x=!0:f.indexOf(w)>=0?x=!1:x?S.oneOf(I.colorFormat,c,"invalid color format for texture"):S.oneOf(I.colorFormat,f,"invalid color format for renderbuffer"))),("depthTexture"in I||"depthStencilTexture"in I)&&(C=!(!I.depthTexture&&!I.depthStencilTexture),S(!C||n.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in I&&("boolean"==typeof I.depth?d=I.depth:(M=I.depth,g=!1)),"stencil"in I&&("boolean"==typeof I.stencil?g=I.stencil:(A=I.stencil,d=!1)),"depthStencil"in I&&("boolean"==typeof I.depthStencil?d=g=I.depthStencil:(T=I.depthStencil,d=!1,g=!1))}else s=h=1;var j=null,D=null,N=null,R=null;if(Array.isArray(b))j=b.map(v);else if(b)j=[v(b)];else for(j=new Array(O),i=0;i=0||j[i].renderbuffer&&It.indexOf(j[i].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+i+" is invalid"),j[i]&&j[i].texture){var B=Tt[j[i].texture._texture.format]*Ct[j[i].texture._texture.type];null===L?L=B:S(L===B,"all color attachments much have the same number of bits per pixel.")}return p(D,s,h),S(!D||D.texture&&6402===D.texture._texture.format||D.renderbuffer&&33189===D.renderbuffer._renderbuffer.format,"invalid depth attachment for framebuffer object"),p(N,s,h),S(!N||N.renderbuffer&&36168===N.renderbuffer._renderbuffer.format,"invalid stencil attachment for framebuffer object"),p(R,s,h),S(!R||R.texture&&34041===R.texture._texture.format||R.renderbuffer&&34041===R.renderbuffer._renderbuffer.format,"invalid depth-stencil attachment for framebuffer object"),_(o),o.width=s,o.height=h,o.colorAttachments=j,o.depthAttachment=D,o.stencilAttachment=N,o.depthStencilAttachment=R,a.color=j.map(m),a.depth=m(D),a.stencil=m(N),a.depthStencil=m(R),a.width=o.width,a.height=o.height,k(o),a}return s.framebufferCount++,a(t,i),e(a,{resize:function(t,e){S(u.next!==o,"can not resize a framebuffer which is currently in use");var n=Math.max(0|t,1),r=Math.max(0|e||n,1);if(n===o.width&&r===o.height)return a;for(var i=o.colorAttachments,s=0;s=2,"invalid shape for framebuffer"),S(m[0]===m[1],"cube framebuffer must be square"),h=m[0]}else"radius"in y&&(h=0|y.radius),"width"in y?(h=0|y.width,"height"in y&&S(y.height===h,"must be square")):"height"in y&&(h=0|y.height);("color"in y||"colors"in y)&&(d=y.color||y.colors,Array.isArray(d)&&S(1===d.length||n.webgl_draw_buffers,"multiple render targets not supported")),d||("colorCount"in y&&(v=0|y.colorCount,S(v>0,"invalid color buffer count")),"colorType"in y&&(S.oneOf(y.colorType,l,"invalid color type"),g=y.colorType),"colorFormat"in y&&(p=y.colorFormat,S.oneOf(y.colorFormat,c,"invalid color format for texture"))),"depth"in y&&(f.depth=y.depth),"stencil"in y&&(f.stencil=y.stencil),"depthStencil"in y&&(f.depthStencil=y.depthStencil)}else h=1;if(d)if(Array.isArray(d))for(s=[],r=0;r0&&(f.depth=o[0].depth,f.stencil=o[0].stencil,f.depthStencil=o[0].depthStencil),o[r]?o[r](f):o[r]=M(f)}return e(a,{width:h,height:h,color:s})}return a(t),e(a,{faces:o,resize:function(t){var e,n=0|t;if(S(n>0&&n<=r.maxCubeMapSize,"invalid radius for cube fbo"),n===a.width)return a;var i=a.color;for(e=0;e=0;--t){var e=G[t];e&&e(m,null,0)}i.flush(),p&&p.update()}function tt(){!J&&G.length>0&&(J=A.next($))}function et(){J&&(A.cancel($),J=null)}function nt(t){t.preventDefault(),s=!0,et(),F.forEach((function(t){t()}))}function rt(t){i.getError(),s=!1,u.restore(),_.restore(),x.restore(),O.restore(),k.restore(),C.restore(),w.restore(),p&&p.restore(),I.procs.refresh(),tt(),U.forEach((function(t){t()}))}function it(t){function n(t,e){var n={},r={};return Object.keys(t).forEach((function(i){var o=t[i];if(M.isDynamic(o))r[i]=M.unbox(o,i);else{if(e&&Array.isArray(o))for(var a=0;a0)return l.call(this,function(t){for(;d.length=0,"cannot cancel a frame twice"),G[e]=function t(){var e=he(G,t);G[e]=G[G.length-1],G.length-=1,G.length<=0&&et()}}}}function ut(){var t=D.viewport,e=D.scissor_box;t[0]=t[1]=e[0]=e[1]=0,m.viewportWidth=m.framebufferWidth=m.drawingBufferWidth=t[2]=e[2]=i.drawingBufferWidth,m.viewportHeight=m.framebufferHeight=m.drawingBufferHeight=t[3]=e[3]=i.drawingBufferHeight}function ct(){m.tick+=1,m.time=lt(),ut(),I.procs.poll()}function ft(){O.refresh(),ut(),I.procs.refresh(),p&&p.update()}function lt(){return(T()-g)/1e3}ft();var ht=e(it,{clear:function(t){if(S("object"===a(t)&&t,"regl.clear() takes an object as input"),"framebuffer"in t)if(t.framebuffer&&"framebufferCube"===t.framebuffer_reglType)for(var n=0;n<6;++n)ot(e({framebuffer:t.framebuffer.faces[n]},t),at);else ot(t,at);else at(0,t)},prop:M.define.bind(null,1),context:M.define.bind(null,2),this:M.define.bind(null,3),draw:it({}),buffer:function(t){return x.create(t,34962,!1,!1)},elements:function(t){return E.create(t,!1)},texture:O.create2D,cube:O.createCube,renderbuffer:k.create,framebuffer:C.create,framebufferCube:C.createCube,vao:w.createVAO,attributes:o,frame:st,on:function(t,e){var n;switch(S.type(e,"function","listener callback must be a function"),t){case"frame":return st(e);case"lost":n=F;break;case"restore":n=U;break;case"destroy":n=Q;break;default:S.raise("invalid event, must be one of frame,lost,restore,destroy")}return n.push(e),{cancel:function(){for(var t=0;t=0},read:j,destroy:function(){G.length=0,et(),N&&(N.removeEventListener("webglcontextlost",nt),N.removeEventListener("webglcontextrestored",rt)),_.clear(),C.clear(),k.clear(),O.clear(),E.clear(),x.clear(),w.clear(),p&&p.clear(),Q.forEach((function(t){t()}))},_gl:i,_refresh:ft,poll:function(){ct(),p&&p.update()},now:lt,stats:h});return r.onDone(null,ht),ht}},"object"===a(e)&&void 0!==t?t.exports=o():void 0===(i="function"==typeof(r=o)?r.call(e,n,e,t):r)||(t.exports=i)},,,,,,,,function(t,e,n){var r=n(282),i=n(283),o={};for(var a in r)r.hasOwnProperty(a)&&(o[r[a]]=a);var s=t.exports={to:{},get:{}};function u(t,e,n){return Math.min(Math.max(e,t),n)}function c(t){var e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}s.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=s.get.hsl(t),n="hsl";break;case"hwb":e=s.get.hwb(t),n="hwb";break;default:e=s.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},s.get.rgb=function(t){if(!t)return null;var e,n,i,o=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(i=e[2],e=e[1],n=0;n<3;n++){var a=2*n;o[n]=parseInt(e.slice(a,a+2),16)}i&&(o[3]=parseInt(i,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(i=(e=e[1])[3],n=0;n<3;n++)o[n]=parseInt(e[n]+e[n],16);i&&(o[3]=parseInt(i+i,16)/255)}else if(e=t.match(/^rgba?\\(\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*(?:,\\s*([+-]?[\\d\\.]+)\\s*)?\\)$/)){for(n=0;n<3;n++)o[n]=parseInt(e[n+1],0);e[4]&&(o[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\\(\\s*([+-]?[\\d\\.]+)\\%\\s*,\\s*([+-]?[\\d\\.]+)\\%\\s*,\\s*([+-]?[\\d\\.]+)\\%\\s*(?:,\\s*([+-]?[\\d\\.]+)\\s*)?\\)$/)))return(e=t.match(/(\\D+)/))?"transparent"===e[1]?[0,0,0,0]:(o=r[e[1]])?(o[3]=1,o):null:null;for(n=0;n<3;n++)o[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(o[3]=parseFloat(e[4]))}for(n=0;n<3;n++)o[n]=u(o[n],0,255);return o[3]=u(o[3],0,1),o},s.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\\(\\s*([+-]?(?:\\d*\\.)?\\d+)(?:deg)?\\s*,\\s*([+-]?[\\d\\.]+)%\\s*,\\s*([+-]?[\\d\\.]+)%\\s*(?:,\\s*([+-]?[\\d\\.]+)\\s*)?\\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])+360)%360,u(parseFloat(e[2]),0,100),u(parseFloat(e[3]),0,100),u(isNaN(n)?1:n,0,1)]}return null},s.get.hwb=function(t){if(!t)return null;var e=t.match(/^hwb\\(\\s*([+-]?\\d*[\\.]?\\d+)(?:deg)?\\s*,\\s*([+-]?[\\d\\.]+)%\\s*,\\s*([+-]?[\\d\\.]+)%\\s*(?:,\\s*([+-]?[\\d\\.]+)\\s*)?\\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,u(parseFloat(e[2]),0,100),u(parseFloat(e[3]),0,100),u(isNaN(n)?1:n,0,1)]}return null},s.to.hex=function(){var t=i(arguments);return"#"+c(t[0])+c(t[1])+c(t[2])+(t[3]<1?c(Math.round(255*t[3])):"")},s.to.rgb=function(){var t=i(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},s.to.rgb.percent=function(){var t=i(arguments),e=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),r=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+n+"%, "+r+"%)":"rgba("+e+"%, "+n+"%, "+r+"%, "+t[3]+")"},s.to.hsl=function(){var t=i(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},s.to.hwb=function(){var t=i(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},s.to.keyword=function(t){return o[t.slice(0,3)]}},function(t,e,n){"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},function(t,e,n){"use strict";var r=n(284),i=Array.prototype.concat,o=Array.prototype.slice,a=t.exports=function(t){for(var e=[],n=0,a=t.length;n=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}},function(t,e,n){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=n(176),o=n(287),a={};Object.keys(i).forEach((function(t){a[t]={},Object.defineProperty(a[t],"channels",{value:i[t].channels}),Object.defineProperty(a[t],"labels",{value:i[t].labels});var e=o(t);Object.keys(e).forEach((function(n){var i=e[n];a[t][n]=function(t){var e=function(e){if(null==e)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var n=t(e);if("object"===r(n))for(var i=n.length,o=0;o1&&(e=Array.prototype.slice.call(arguments)),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(i)}))})),t.exports=a},function(t,e,n){"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},function(t,e,n){var r=n(176);function i(t){var e=function(){for(var t={},e=Object.keys(r),n=e.length,i=0;i-1}},function(t,e,n){var r=n(99);t.exports=function(t,e){var n=this.__data__,i=r(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}},function(t,e,n){var r=n(98);t.exports=function(){this.__data__=new r,this.size=0}},function(t,e){t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},function(t,e){t.exports=function(t){return this.__data__.get(t)}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,n){var r=n(98),i=n(143),o=n(144);t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([t,e]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(t,e),this.size=n.size,this}},function(t,e,n){var r=n(86),i=n(304),o=n(43),a=n(180),s=/^\\[object .+?Constructor\\]$/,u=Function.prototype,c=Object.prototype,f=u.toString,l=c.hasOwnProperty,h=RegExp("^"+f.call(l).replace(/[\\\\^$.*+?()[\\]{}|]/g,"\\\\$&").replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!o(t)||i(t))&&(r(t)?h:s).test(a(t))}},function(t,e,n){var r=n(74),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r?r.toStringTag:void 0;t.exports=function(t){var e=o.call(t,s),n=t[s];try{t[s]=void 0;var r=!0}catch(t){}var i=a.call(t);return r&&(e?t[s]=n:delete t[s]),i}},function(t,e){var n=Object.prototype.toString;t.exports=function(t){return n.call(t)}},function(t,e,n){var r,i=n(305),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(t){return!!o&&o in t}},function(t,e,n){var r=n(45)["__core-js_shared__"];t.exports=r},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e,n){var r=n(308),i=n(98),o=n(143);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},function(t,e,n){var r=n(309),i=n(310),o=n(311),a=n(312),s=n(313);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}},function(t,e,n){var r=n(382);t.exports=function(t,e){return!!(null==t?0:t.length)&&r(t,e,0)>-1}},function(t,e,n){var r=n(218),i=n(383),o=n(384);t.exports=function(t,e,n){return e==e?o(t,e,n):r(t,i,n)}},function(t,e){t.exports=function(t){return t!=t}},function(t,e){t.exports=function(t,e,n){for(var r=n-1,i=t.length;++r1||1===e.length&&t.hasEdge(e[0],e[0])}))}},function(t,e,n){var r=n(42);t.exports=function(t,e,n){return function(t,e,n){var r={},i=t.nodes();return i.forEach((function(t){r[t]={},r[t][t]={distance:0},i.forEach((function(e){t!==e&&(r[t][e]={distance:Number.POSITIVE_INFINITY})})),n(t).forEach((function(n){var i=n.v===t?n.w:n.v,o=e(n);r[t][i]={distance:o,predecessor:t}}))})),i.forEach((function(t){var e=r[t];i.forEach((function(n){var o=r[n];i.forEach((function(n){var r=o[t],i=e[n],a=o[n],s=r.distance+i.distance;s0;){if(n=u.removeMin(),r.has(s,n))a.setEdge(n,s[n]);else{if(f)throw new Error("Input graph is not connected: "+t);f=!0}t.nodeEdges(n).forEach(c)}return a}},function(t,e,n){"use strict";var r=n(27),i=n(439),o=n(442),a=n(443),s=n(37).normalizeRanks,u=n(445),c=n(37).removeEmptyRanks,f=n(446),l=n(447),h=n(448),d=n(449),p=n(458),g=n(37),v=n(44).Graph;t.exports=function(t,e){var n=e&&e.debugTiming?g.time:g.notime;n("layout",(function(){var e=n(" buildLayoutGraph",(function(){return function(t){var e=new v({multigraph:!0,compound:!0}),n=k(t.graph());return e.setGraph(r.merge({},m,O(n,y),r.pick(n,b))),r.forEach(t.nodes(),(function(n){var i=k(t.node(n));e.setNode(n,r.defaults(O(i,x),w)),e.setParent(n,t.parent(n))})),r.forEach(t.edges(),(function(n){var i=k(t.edge(n));e.setEdge(n,r.merge({},E,O(i,S),r.pick(i,_)))})),e}(t)}));n(" runLayout",(function(){!function(t,e){e(" makeSpaceForEdgeLabels",(function(){!function(t){var e=t.graph();e.ranksep/=2,r.forEach(t.edges(),(function(n){var r=t.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(t)})),e(" removeSelfEdges",(function(){!function(t){r.forEach(t.edges(),(function(e){if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}}))}(t)})),e(" acyclic",(function(){i.run(t)})),e(" nestingGraph.run",(function(){f.run(t)})),e(" rank",(function(){a(g.asNonCompoundGraph(t))})),e(" injectEdgeLabelProxies",(function(){!function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);if(n.width&&n.height){var r=t.node(e.v),i={rank:(t.node(e.w).rank-r.rank)/2+r.rank,e:e};g.addDummyNode(t,"edge-proxy",i,"_ep")}}))}(t)})),e(" removeEmptyRanks",(function(){c(t)})),e(" nestingGraph.cleanup",(function(){f.cleanup(t)})),e(" normalizeRanks",(function(){s(t)})),e(" assignRankMinMax",(function(){!function(t){var e=0;r.forEach(t.nodes(),(function(n){var i=t.node(n);i.borderTop&&(i.minRank=t.node(i.borderTop).rank,i.maxRank=t.node(i.borderBottom).rank,e=r.max(e,i.maxRank))})),t.graph().maxRank=e}(t)})),e(" removeEdgeLabelProxies",(function(){!function(t){r.forEach(t.nodes(),(function(e){var n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))}))}(t)})),e(" normalize.run",(function(){o.run(t)})),e(" parentDummyChains",(function(){u(t)})),e(" addBorderSegments",(function(){l(t)})),e(" order",(function(){d(t)})),e(" insertSelfEdges",(function(){!function(t){var e=g.buildLayerMatrix(t);r.forEach(e,(function(e){var n=0;r.forEach(e,(function(e,i){var o=t.node(e);o.order=i+n,r.forEach(o.selfEdges,(function(e){g.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:o.rank,order:i+ ++n,e:e.e,label:e.label},"_se")})),delete o.selfEdges}))}))}(t)})),e(" adjustCoordinateSystem",(function(){h.adjust(t)})),e(" position",(function(){p(t)})),e(" positionSelfEdges",(function(){!function(t){r.forEach(t.nodes(),(function(e){var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),i=r.x+r.width/2,o=r.y,a=n.x-i,s=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:i+2*a/3,y:o-s},{x:i+5*a/6,y:o-s},{x:i+a,y:o},{x:i+5*a/6,y:o+s},{x:i+2*a/3,y:o+s}],n.label.x=n.x,n.label.y=n.y}}))}(t)})),e(" removeBorderNodes",(function(){!function(t){r.forEach(t.nodes(),(function(e){if(t.children(e).length){var n=t.node(e),i=t.node(n.borderTop),o=t.node(n.borderBottom),a=t.node(r.last(n.borderLeft)),s=t.node(r.last(n.borderRight));n.width=Math.abs(s.x-a.x),n.height=Math.abs(o.y-i.y),n.x=a.x+n.width/2,n.y=i.y+n.height/2}})),r.forEach(t.nodes(),(function(e){"border"===t.node(e).dummy&&t.removeNode(e)}))}(t)})),e(" normalize.undo",(function(){o.undo(t)})),e(" fixupEdgeLabelCoords",(function(){!function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);if(r.has(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))}(t)})),e(" undoCoordinateSystem",(function(){h.undo(t)})),e(" translateGraph",(function(){!function(t){var e=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,o=0,a=t.graph(),s=a.marginx||0,u=a.marginy||0;function c(t){var r=t.x,a=t.y,s=t.width,u=t.height;e=Math.min(e,r-s/2),n=Math.max(n,r+s/2),i=Math.min(i,a-u/2),o=Math.max(o,a+u/2)}r.forEach(t.nodes(),(function(e){c(t.node(e))})),r.forEach(t.edges(),(function(e){var n=t.edge(e);r.has(n,"x")&&c(n)})),e-=s,i-=u,r.forEach(t.nodes(),(function(n){var r=t.node(n);r.x-=e,r.y-=i})),r.forEach(t.edges(),(function(n){var o=t.edge(n);r.forEach(o.points,(function(t){t.x-=e,t.y-=i})),r.has(o,"x")&&(o.x-=e),r.has(o,"y")&&(o.y-=i)})),a.width=n-e+s,a.height=o-i+u}(t)})),e(" assignNodeIntersects",(function(){!function(t){r.forEach(t.edges(),(function(e){var n,r,i=t.edge(e),o=t.node(e.v),a=t.node(e.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=a,r=o),i.points.unshift(g.intersectRect(o,n)),i.points.push(g.intersectRect(a,r))}))}(t)})),e(" reversePoints",(function(){!function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);n.reversed&&n.points.reverse()}))}(t)})),e(" acyclic.undo",(function(){i.undo(t)}))}(e,n)})),n(" updateInputGraph",(function(){!function(t,e){r.forEach(t.nodes(),(function(n){var r=t.node(n),i=e.node(n);r&&(r.x=i.x,r.y=i.y,e.children(n).length&&(r.width=i.width,r.height=i.height))})),r.forEach(t.edges(),(function(n){var i=t.edge(n),o=e.edge(n);i.points=o.points,r.has(o,"x")&&(i.x=o.x,i.y=o.y)})),t.graph().width=e.graph().width,t.graph().height=e.graph().height}(t,e)}))}))};var y=["nodesep","edgesep","ranksep","marginx","marginy"],m={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},b=["acyclicer","ranker","rankdir","align"],x=["width","height"],w={width:0,height:0},S=["minlen","weight","width","height","labeloffset"],E={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},_=["labelpos"];function O(t,e){return r.mapValues(r.pick(t,e),Number)}function k(t){var e={};return r.forEach(t,(function(t,n){e[n.toLowerCase()]=t})),e}},function(t,e,n){var r=n(177);t.exports=function(t){return r(t,5)}},function(t,e,n){var r=n(112),i=n(73),o=n(113),a=n(66),s=Object.prototype,u=s.hasOwnProperty,c=r((function(t,e){t=Object(t);var n=-1,r=e.length,c=r>2?e[2]:void 0;for(c&&o(e[0],e[1],c)&&(r=1);++n-1?s[u?e[c]:c]:void 0}}},function(t,e,n){var r=n(218),i=n(55),o=n(406),a=Math.max;t.exports=function(t,e,n){var s=null==t?0:t.length;if(!s)return-1;var u=null==n?0:o(n);return u<0&&(u=a(s+u,0)),r(t,i(e,3),u)}},function(t,e,n){var r=n(226);t.exports=function(t){var e=r(t),n=e%1;return e==e?n?e-n:e:0}},function(t,e,n){var r=n(408),i=n(43),o=n(77),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(o(t))return NaN;if(i(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=i(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=r(t);var n=s.test(t);return n||u.test(t)?c(t.slice(2),n?2:8):a.test(t)?NaN:+t}},function(t,e,n){var r=n(409),i=/^\\s+/;t.exports=function(t){return t?t.slice(0,r(t)+1).replace(i,""):t}},function(t,e){var n=/\\s/;t.exports=function(t){for(var e=t.length;e--&&n.test(t.charAt(e)););return e}},function(t,e,n){var r=n(154),i=n(198),o=n(66);t.exports=function(t,e){return null==t?t:r(t,i(e),o)}},function(t,e){t.exports=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}},function(t,e,n){var r=n(103),i=n(153),o=n(55);t.exports=function(t,e){var n={};return e=o(e,3),i(t,(function(t,i,o){r(n,i,e(t,i,o))})),n}},function(t,e,n){var r=n(158),i=n(414),o=n(67);t.exports=function(t){return t&&t.length?r(t,o,i):void 0}},function(t,e){t.exports=function(t,e){return t>e}},function(t,e,n){var r=n(416),i=n(419)((function(t,e,n){r(t,e,n)}));t.exports=i},function(t,e,n){var r=n(97),i=n(228),o=n(154),a=n(417),s=n(43),u=n(66),c=n(229);t.exports=function t(e,n,f,l,h){e!==n&&o(n,(function(o,u){if(h||(h=new r),s(o))a(e,n,u,f,t,l,h);else{var d=l?l(c(e,u),o,u+"",e,n,h):void 0;void 0===d&&(d=o),i(e,u,d)}}),u)}},function(t,e,n){var r=n(228),i=n(184),o=n(193),a=n(185),s=n(194),u=n(88),c=n(29),f=n(219),l=n(75),h=n(86),d=n(43),p=n(168),g=n(32),v=n(229),y=n(418);t.exports=function(t,e,n,m,b,x,w){var S=v(t,n),E=v(e,n),_=w.get(E);if(_)r(t,n,_);else{var O=x?x(S,E,n+"",t,e,w):void 0,k=void 0===O;if(k){var M=c(E),A=!M&&l(E),T=!M&&!A&&g(E);O=E,M||A||T?c(S)?O=S:f(S)?O=a(S):A?(k=!1,O=i(E,!0)):T?(k=!1,O=o(E,!0)):O=[]:p(E)||u(E)?(O=S,u(S)?O=y(S):d(S)&&!h(S)||(O=s(E))):k=!1}k&&(w.set(E,O),b(O,E,m,x,w),w.delete(E)),r(t,n,O)}}},function(t,e,n){var r=n(87),i=n(66);t.exports=function(t){return r(t,i(t))}},function(t,e,n){var r=n(112),i=n(113);t.exports=function(t){return r((function(e,n){var r=-1,o=n.length,a=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(a=t.length>3&&"function"==typeof a?(o--,a):void 0,s&&i(n[0],n[1],s)&&(a=o<3?void 0:a,o=1),e=Object(e);++r1&&a(t,e[0],e[1])?e=[]:n>2&&a(e[0],e[1],e[2])&&(e=[e[0]]),i(t,r(e,1),[])}));t.exports=s},function(t,e,n){var r=n(111),i=n(109),o=n(55),a=n(213),s=n(433),u=n(105),c=n(434),f=n(67),l=n(29);t.exports=function(t,e,n){e=e.length?r(e,(function(t){return l(t)?function(e){return i(e,1===t.length?t[0]:t)}:t})):[f];var h=-1;e=r(e,u(o));var d=a(t,(function(t,n,i){return{criteria:r(e,(function(e){return e(t)})),index:++h,value:t}}));return s(d,(function(t,e){return c(t,e,n)}))}},function(t,e){t.exports=function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}},function(t,e,n){var r=n(435);t.exports=function(t,e,n){for(var i=-1,o=t.criteria,a=e.criteria,s=o.length,u=n.length;++i=u?c:c*("desc"==n[i]?-1:1)}return t.index-e.index}},function(t,e,n){var r=n(77);t.exports=function(t,e){if(t!==e){var n=void 0!==t,i=null===t,o=t==t,a=r(t),s=void 0!==e,u=null===e,c=e==e,f=r(e);if(!u&&!f&&!a&&t>e||a&&s&&c&&!u&&!f||i&&s&&c||!n&&c||!o)return 1;if(!i&&!a&&!f&&t