webpackJsonp([5],{"/p1R":function(t,e){},"5R7W":function(t,e){},GRR7:function(t,e,i){"use strict";(function(t,r){var n,s,a;(this||window).Two=function(e){var n="undefined"!=typeof window?window:void 0!==t?t:null,s=Object.prototype.toString,a={_indexAmount:0,natural:{slice:Array.prototype.slice,indexOf:Array.prototype.indexOf,keys:Object.keys,bind:Function.prototype.bind,create:Object.create},identity:function(t){return t},isArguments:function(t){return"[object Arguments]"===s.call(t)},isFunction:function(t){return"[object Function]"===s.call(t)},isString:function(t){return"[object String]"===s.call(t)},isNumber:function(t){return"[object Number]"===s.call(t)},isDate:function(t){return"[object Date]"===s.call(t)},isRegExp:function(t){return"[object RegExp]"===s.call(t)},isError:function(t){return"[object Error]"===s.call(t)},isFinite:function(t){return isFinite(t)&&!isNaN(parseFloat(t))},isNaN:function(t){return a.isNumber(t)&&t!==+t},isBoolean:function(t){return!0===t||!1===t||"[object Boolean]"===s.call(t)},isNull:function(t){return null===t},isUndefined:function(t){return void 0===t},isEmpty:function(t){return null==t||(x&&(a.isArray(t)||a.isString(t)||a.isArguments(t))?0===t.length:0===a.keys(t).length)},isElement:function(t){return!(!t||1!==t.nodeType)},isArray:Array.isArray||function(t){return"[object Array]"===s.call(t)},isObject:function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},toArray:function(t){return t?a.isArray(t)?m.call(t):x(t)?a.map(t,a.identity):a.values(t):[]},range:function(t,e,i){null==e&&(e=t||0,t=0),i=i||1;for(var r=Math.max(Math.ceil((e-t)/i),0),n=Array(r),s=0;s<r;s++,t+=i)n[s]=t;return n},indexOf:function(t,e){if(a.natural.indexOf)return a.natural.indexOf.call(t,e);for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1},has:function(t,e){return null!=t&&hasOwnProperty.call(t,e)},bind:function(t,e){var i=a.natural.bind;if(i&&t.bind===i)return i.apply(t,m.call(arguments,1));var r=m.call(arguments,2);return function(){t.apply(e,r)}},extend:function(t){for(var e=m.call(arguments,1),i=0;i<e.length;i++){var r=e[i];for(var n in r)t[n]=r[n]}return t},defaults:function(t){for(var e=m.call(arguments,1),i=0;i<e.length;i++){var r=e[i];for(var n in r)void 0===t[n]&&(t[n]=r[n])}return t},keys:function(t){if(!a.isObject(t))return[];if(a.natural.keys)return a.natural.keys(t);var e=[];for(var i in t)a.has(t,i)&&e.push(i);return e},values:function(t){for(var e=a.keys(t),i=[],r=0;r<e.length;r++){var n=e[r];i.push(t[n])}return i},each:function(t,e,i){for(var r=i||this,n=!x(t)&&a.keys(t),s=(n||t).length,o=0;o<s;o++){var l=n?n[o]:o;e.call(r,t[l],l,t)}return t},map:function(t,e,i){for(var r=i||this,n=!x(t)&&a.keys(t),s=(n||t).length,o=[],l=0;l<s;l++){var h=n?n[l]:l;o[l]=e.call(r,t[h],h,t)}return o},once:function(t){var e=!1;return function(){return e?t:(e=!0,t.apply(this,arguments))}},after:function(t,e){return function(){for(;--t<1;)return e.apply(this,arguments)}},uniqueId:function(t){var e=++a._indexAmount+"";return t?t+e:e}},o=Math.sin,l=Math.cos,h=(Math.acos,Math.atan2,Math.sqrt),c=(Math.round,Math.abs),d=Math.PI,u=d/2,f=Math.pow,g=Math.min,_=Math.max,p=0,m=a.natural.slice,v=n.performance&&n.performance.now?n.performance:Date,y=Math.pow(2,53)-1,x=function(t){var e,i=null==(e=t)?void 0:e.length;return"number"==typeof i&&i>=0&&i<=y},b={temp:n.document?n.document.createElement("div"):{},hasEventListeners:a.isFunction(n.addEventListener),bind:function(t,e,i,r){return this.hasEventListeners?t.addEventListener(e,i,!!r):t.attachEvent("on"+e,i),b},unbind:function(t,e,i,r){return b.hasEventListeners?t.removeEventListeners(e,i,!!r):t.detachEvent("on"+e,i),b},getRequestAnimationFrame:function(){var t,e=0,i=["ms","moz","webkit","o"],r=n.requestAnimationFrame;if(!r){for(var s=0;s<i.length;s++)r=n[i[s]+"RequestAnimationFrame"]||r,t=n[i[s]+"CancelAnimationFrame"]||n[i[s]+"CancelRequestAnimationFrame"]||t;r=r||function(t,i){var r=(new Date).getTime(),s=Math.max(0,16-(r-e)),a=n.setTimeout(function(){t(r+s)},s);return e=r+s,a}}return r.init=a.once(P),r}},w=n.Two=function(t){var e=a.defaults(t||{},{fullscreen:!1,width:640,height:480,type:w.Types.svg,autostart:!1});if(a.each(e,function(t,e){/fullscreen/i.test(e)||/autostart/i.test(e)||(this[e]=t)},this),a.isElement(e.domElement)){var i=e.domElement.tagName.toLowerCase();/^(CanvasRenderer-canvas|WebGLRenderer-canvas|SVGRenderer-svg)$/.test(this.type+"-"+i)||(this.type=w.Types[i])}if(this.renderer=new w[this.type](this),w.Utils.setPlaying.call(this,e.autostart),this.frameCount=0,e.fullscreen){var r=a.bind(F,this);a.extend(document.body.style,{overflow:"hidden",margin:0,padding:0,top:0,left:0,right:0,bottom:0,position:"fixed"}),a.extend(this.renderer.domElement.style,{display:"block",top:0,left:0,right:0,bottom:0,position:"fixed"}),b.bind(n,"resize",r),r()}else a.isElement(e.domElement)||(this.renderer.setSize(e.width,e.height,this.ratio),this.width=e.width,this.height=e.height);this.renderer.bind(w.Events.resize,a.bind(O,this)),this.scene=this.renderer.scene,w.Instances.push(this),e.autostart&&T.init()};a.extend(w,{root:n,nextFrameID:null,Array:n.Float32Array||Array,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"v0.7.0-beta.3",PublishDate:"2018-12-08T22:41:43+01:00",Identifier:"two-",Events:{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"},Commands:{move:"M",line:"L",curve:"C",arc:"A",close:"Z"},Resolution:12,Instances:[],noConflict:function(){return n.Two=e,w},uniqueId:function(){var t=p;return p++,t},Utils:a.extend(a,{performance:v,defineProperty:function(t){var e="_"+t,i="_flag"+t.charAt(0).toUpperCase()+t.slice(1);Object.defineProperty(this,t,{enumerable:!0,get:function(){return this[e]},set:function(t){this[e]=t,this[i]=!0}})},Image:null,isHeadless:!1,shim:function(t,e){return w.CanvasRenderer.Utils.shim(t),a.isUndefined(e)||(w.Utils.Image=e),w.Utils.isHeadless=!0,t},release:function(t){if(a.isObject(t))return a.isFunction(t.unbind)&&t.unbind(),t.vertices&&(a.isFunction(t.vertices.unbind)&&t.vertices.unbind(),a.each(t.vertices,function(t){a.isFunction(t.unbind)&&t.unbind()})),t.children&&a.each(t.children,function(t){w.Utils.release(t)}),t},xhr:function(t,e){var i=new XMLHttpRequest;return i.open("GET",t),i.onreadystatechange=function(){4===i.readyState&&200===i.status&&e(i.responseText)},i.send(),i},Curve:{CollinearityEpsilon:f(10,-30),RecursionLimit:16,CuspLimit:0,Tolerance:{distance:.25,angle:0,epsilon:Number.EPSILON},abscissas:[[.5773502691896257],[0,.7745966692414834],[.33998104358485626,.8611363115940526],[0,.5384693101056831,.906179845938664],[.2386191860831969,.6612093864662645,.932469514203152],[0,.4058451513773972,.7415311855993945,.9491079123427585],[.1834346424956498,.525532409916329,.7966664774136267,.9602898564975363],[0,.3242534234038089,.6133714327005904,.8360311073266358,.9681602395076261],[.14887433898163122,.4333953941292472,.6794095682990244,.8650633666889845,.9739065285171717],[0,.26954315595234496,.5190961292068118,.7301520055740494,.8870625997680953,.978228658146057],[.1252334085114689,.3678314989981802,.5873179542866175,.7699026741943047,.9041172563704749,.9815606342467192],[0,.2304583159551348,.44849275103644687,.6423493394403402,.8015780907333099,.9175983992229779,.9841830547185881],[.10805494870734367,.31911236892788974,.5152486363581541,.6872929048116855,.827201315069765,.9284348836635735,.9862838086968123],[0,.20119409399743451,.3941513470775634,.5709721726085388,.7244177313601701,.8482065834104272,.937273392400706,.9879925180204854],[.09501250983763744,.2816035507792589,.45801677765722737,.6178762444026438,.755404408355003,.8656312023878318,.9445750230732326,.9894009349916499]],weights:[[1],[.8888888888888888,.5555555555555556],[.6521451548625461,.34785484513745385],[.5688888888888889,.47862867049936647,.23692688505618908],[.46791393457269104,.3607615730481386,.17132449237917036],[.4179591836734694,.3818300505051189,.27970539148927664,.1294849661688697],[.362683783378362,.31370664587788727,.22238103445337448,.10122853629037626],[.3302393550012598,.31234707704000286,.26061069640293544,.1806481606948574,.08127438836157441],[.29552422471475287,.26926671930999635,.21908636251598204,.1494513491505806,.06667134430868814],[.2729250867779006,.26280454451024665,.23319376459199048,.18629021092773426,.1255803694649046,.05566856711617366],[.24914704581340277,.2334925365383548,.20316742672306592,.16007832854334622,.10693932599531843,.04717533638651183],[.2325515532308739,.22628318026289723,.2078160475368885,.17814598076194574,.13887351021978725,.09212149983772845,.04048400476531588],[.2152638534631578,.2051984637212956,.18553839747793782,.15720316715819355,.12151857068790319,.08015808715976021,.03511946033175186],[.2025782419255613,.19843148532711158,.1861610000155622,.16626920581699392,.13957067792615432,.10715922046717194,.07036604748810812,.03075324199611727],[.1894506104550685,.18260341504492358,.16915651939500254,.14959598881657674,.12462897125553388,.09515851168249279,.062253523938647894,.027152459411754096]]},devicePixelRatio:n.devicePixelRatio||1,getBackingStoreRatio:function(t){return t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1},getRatio:function(t){return w.Utils.devicePixelRatio/k(t)},setPlaying:function(t){return this.playing=!!t,this},getComputedMatrix:function(t,e){e=e&&e.identity()||new w.Matrix;for(var i=t,r=[];i&&i._matrix;)r.push(i._matrix),i=i.parent;r.reverse();for(var n=0;n<r.length;n++){var s=r[n].elements;e.multiply(s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7],s[8],s[9])}return e},deltaTransformPoint:function(t,e,i){var r=e*t.a+i*t.c+0,n=e*t.b+i*t.d+0;return new w.Vector(r,n)},decomposeMatrix:function(t){var e=w.Utils.deltaTransformPoint(t,0,1),i=w.Utils.deltaTransformPoint(t,1,0),r=180/Math.PI*Math.atan2(e.y,e.x)-90,n=180/Math.PI*Math.atan2(i.y,i.x);return{translateX:t.e,translateY:t.f,scaleX:Math.sqrt(t.a*t.a+t.b*t.b),scaleY:Math.sqrt(t.c*t.c+t.d*t.d),skewX:r,skewY:n,rotation:r}},extractCSSText:function(t,e){var i,r,n,s;e||(e={}),i=t.split(";");for(var o=0;o<i.length;o++)n=(r=i[o].split(":"))[0],s=r[1],a.isUndefined(n)||a.isUndefined(s)||(e[n]=s.replace(/\s/,""));return e},getSvgStyles:function(t){for(var e={},i=0;i<t.style.length;i++){var r=t.style[i];e[r]=t.style[r]}return e},applySvgViewBox:function(t,e){var i=e.split(/\s/),r=parseFloat(i[0]),n=parseFloat(i[1]),s=parseFloat(i[2]),a=parseFloat(i[3]),o=Math.min(this.width/s,this.height/a);return t.translation.x-=r*o,t.translation.y-=n*o,t.scale=o,t},applySvgAttributes:function(t,e,i){var r,s,o,l,h={},c={},d={};if(n.getComputedStyle){var u=n.getComputedStyle(t);for(r=u.length;r--;)o=u[s=u[r]],a.isUndefined(o)||(h[s]=o)}for(r=0;r<t.attributes.length;r++)l=t.attributes[r],/style/i.test(l.nodeName)?w.Utils.extractCSSText(l.value,d):c[l.nodeName]=l.value;for(s in a.isUndefined(h.opacity)||(h["stroke-opacity"]=h.opacity,h["fill-opacity"]=h.opacity,delete h.opacity),i&&a.defaults(h,i),a.extend(h,c,d),h.visible=!(a.isUndefined(h.display)&&/none/i.test(h.display))||a.isUndefined(h.visibility)&&/hidden/i.test(h.visibility),h)switch(o=h[s],s){case"transform":if(/none/i.test(o))break;var f=t.transform&&t.transform.baseVal&&t.transform.baseVal.length>0?t.transform.baseVal[0].matrix:t.getCTM?t.getCTM():null;if(a.isNull(f))break;var g=w.Utils.decomposeMatrix(f);e.translation.set(g.translateX,g.translateY),e.rotation=g.rotation,e.scale=new w.Vector(g.scaleX,g.scaleY);var _=parseFloat((h.x+"").replace("px")),p=parseFloat((h.y+"").replace("px"));_&&(e.translation.x=_),p&&(e.translation.y=p);break;case"viewBox":w.Utils.applySvgViewBox.call(this,e,o);break;case"visible":e.visible=o;break;case"stroke-linecap":e.cap=o;break;case"stroke-linejoin":e.join=o;break;case"stroke-miterlimit":e.miter=o;break;case"stroke-width":e.linewidth=parseFloat(o);break;case"opacity":case"stroke-opacity":case"fill-opacity":e instanceof w.Group||(e.opacity=parseFloat(o));break;case"fill":case"stroke":/url\(\#.*\)/i.test(o)?e[s]=this.getById(o.replace(/url\(\#(.*)\)/i,"$1")):e[s]=/none/i.test(o)?"transparent":o;break;case"id":e.id=o;break;case"class":case"className":e.classList=o.split(" ")}return h},read:{svg:function(t){var e=w.Utils.read.g.call(this,t);t.getAttribute("viewBox");return e},g:function(t){var e,i=new w.Group;e=w.Utils.getSvgStyles.call(this,t);for(var r=0,n=t.childNodes.length;r<n;r++){var s=t.childNodes[r],a=s.nodeName;if(!a)return;var o=a.replace(/svg\:/gi,"").toLowerCase();if(o in w.Utils.read){var l=w.Utils.read[o].call(i,s,e);i.add(l)}}return i},polygon:function(t,e){var i=[];t.getAttribute("points").replace(/(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g,function(t,e,r){i.push(new w.Anchor(parseFloat(e),parseFloat(r)))});var r=new w.Path(i,!0).noStroke();return r.fill="black",w.Utils.applySvgAttributes.call(this,t,r,e),r},polyline:function(t,e){var i=w.Utils.read.polygon.call(this,t,e);return i.closed=!1,i},path:function(t,e){var i,r,n=t.getAttribute("d"),s=new w.Anchor,o=!1,l=!1,h=n.match(/[a-df-z][^a-df-z]*/gi),c=h.length-1;a.each(h.slice(0),function(t,e){var i,r,n,s,a,o,l,c,d,u=t[0],f=u.toLowerCase(),g=t.slice(1).trim().split(/[\s,]+|(?=\s?[+\-])/),_=[],p=!1;for(a=0;a<g.length;a++)if((i=g[a]).indexOf(".")!==i.lastIndexOf(".")){for(n=(r=i.split("."))[0]+"."+r[1],g.splice(a,1,n),s=2;s<r.length;s++)g.splice(a+s-1,0,"0."+r[s]);p=!0}switch(p&&(t=u+g.join(",")),e<=0&&(h=[]),f){case"h":case"v":g.length>1&&(d=1);break;case"m":case"l":case"t":g.length>2&&(d=2);break;case"s":case"q":g.length>4&&(d=4);break;case"c":g.length>6&&(d=6);break;case"a":g.length>7&&(d=7)}if(d){for(a=0,l=g.length,c=0;a<l;a+=d){if(o=u,c>0)switch(u){case"m":o="l";break;case"M":o="L"}_.push(o+g.slice(a,a+d).join(" ")),c++}h=Array.prototype.concat.apply(h,_)}else h.push(t)});var d=[];if(a.each(h,function(t,e){var n,h,u,g,_,p,m,v,y,x,b,S,A=t[0],C=A.toLowerCase();switch(r=(r=(r=t.slice(1).trim()).replace(/(-?\d+(?:\.\d*)?)[eE]([+\-]?\d+)/g,function(t,e,i){return parseFloat(e)*f(10,i)})).split(/[\s,]+|(?=\s?[+\-])/),l=A===C,C){case"z":if(e>=c)o=!0;else{h=s.x,u=s.y,n=new w.Anchor(h,u,void 0,void 0,void 0,void 0,w.Commands.close);for(e=d.length-1;e>=0;e--){var k=d[e];if(/m/i.test(k.command)){s=k;break}}}break;case"m":case"l":i=void 0,h=parseFloat(r[0]),u=parseFloat(r[1]),n=new w.Anchor(h,u,void 0,void 0,void 0,void 0,/m/i.test(C)?w.Commands.move:w.Commands.line),l&&n.addSelf(s),s=n;break;case"h":case"v":var E=/h/i.test(C)?"x":"y",R=/x/i.test(E)?"y":"x";(n=new w.Anchor(void 0,void 0,void 0,void 0,void 0,void 0,w.Commands.line))[E]=parseFloat(r[0]),n[R]=s[R],l&&(n[E]+=s[E]),s=n;break;case"c":case"s":g=s.x,_=s.y,i||(i=new w.Vector),/c/i.test(C)?(p=parseFloat(r[0]),m=parseFloat(r[1]),v=parseFloat(r[2]),y=parseFloat(r[3]),x=parseFloat(r[4]),b=parseFloat(r[5])):(p=(S=M(s,i,l)).x,m=S.y,v=parseFloat(r[0]),y=parseFloat(r[1]),x=parseFloat(r[2]),b=parseFloat(r[3])),l&&(p+=g,m+=_,v+=g,y+=_,x+=g,b+=_),a.isObject(s.controls)||w.Anchor.AppendCurveProperties(s),s.controls.right.set(p-s.x,m-s.y),n=new w.Anchor(x,b,v-x,y-b,void 0,void 0,w.Commands.curve),s=n,i=n.controls.left;break;case"t":case"q":g=s.x,_=s.y,i||(i=new w.Vector),i.isZero()?(p=g,m=_):(p=i.x,m=i.y),/q/i.test(C)?(v=parseFloat(r[0]),y=parseFloat(r[1]),x=parseFloat(r[2]),b=parseFloat(r[3])):(v=(S=M(s,i,l)).x,y=S.y,x=parseFloat(r[0]),b=parseFloat(r[1])),l&&(p+=g,m+=_,v+=g,y+=_,x+=g,b+=_),a.isObject(s.controls)||w.Anchor.AppendCurveProperties(s),s.controls.right.set(p-s.x,m-s.y),n=new w.Anchor(x,b,v-x,y-b,void 0,void 0,w.Commands.curve),s=n,i=n.controls.left;break;case"a":g=s.x,_=s.y;var F=parseFloat(r[0]),O=parseFloat(r[1]),T=parseFloat(r[2]),P=parseFloat(r[3]),L=parseFloat(r[4]);x=parseFloat(r[5]),b=parseFloat(r[6]),l&&(x+=g,b+=_);var N=new w.Anchor(x,b);N.command=w.Commands.arc,N.rx=F,N.ry=O,N.xAxisRotation=T,N.largeArcFlag=P,N.sweepFlag=L,n=N,s=N,i=void 0}n&&(a.isArray(n)?d=d.concat(n):d.push(n))}),!(d.length<=1)){(n=new w.Path(d,o,void 0,!0).noStroke()).fill="black";var u=n.getBoundingClientRect(!0);return u.centroid={x:u.left+u.width/2,y:u.top+u.height/2},a.each(n.vertices,function(t){t.subSelf(u.centroid)}),n.translation.addSelf(u.centroid),w.Utils.applySvgAttributes.call(this,t,n,e),n}},circle:function(t,e){var i=parseFloat(t.getAttribute("cx")),r=parseFloat(t.getAttribute("cy")),n=parseFloat(t.getAttribute("r")),s=new w.Circle(i,r,n).noStroke();return s.fill="black",w.Utils.applySvgAttributes.call(this,t,s,e),s},ellipse:function(t,e){var i=parseFloat(t.getAttribute("cx")),r=parseFloat(t.getAttribute("cy")),n=parseFloat(t.getAttribute("rx")),s=parseFloat(t.getAttribute("ry")),a=new w.Ellipse(i,r,n,s).noStroke();return a.fill="black",w.Utils.applySvgAttributes.call(this,t,a,e),a},rect:function(t,e){var i=parseFloat(t.getAttribute("rx")),r=parseFloat(t.getAttribute("ry"));if(!a.isNaN(i)||!a.isNaN(r))return w.Utils.read["rounded-rect"](t);var n=parseFloat(t.getAttribute("x"))||0,s=parseFloat(t.getAttribute("y"))||0,o=parseFloat(t.getAttribute("width")),l=parseFloat(t.getAttribute("height")),h=o/2,c=l/2,d=new w.Rectangle(n+h,s+c,o,l).noStroke();return d.fill="black",w.Utils.applySvgAttributes.call(this,t,d,e),d},"rounded-rect":function(t,e){var i=parseFloat(t.getAttribute("x"))||0,r=parseFloat(t.getAttribute("y"))||0,n=parseFloat(t.getAttribute("rx"))||0,s=parseFloat(t.getAttribute("ry"))||0,a=parseFloat(t.getAttribute("width")),o=parseFloat(t.getAttribute("height")),l=a/2,h=o/2,c=new w.Vector(n,s),d=new w.RoundedRectangle(i+l,r+h,a,o,c).noStroke();return d.fill="black",w.Utils.applySvgAttributes.call(this,t,d,e),d},line:function(t,e){var i=parseFloat(t.getAttribute("x1")),r=parseFloat(t.getAttribute("y1")),n=parseFloat(t.getAttribute("x2")),s=parseFloat(t.getAttribute("y2")),a=new w.Line(i,r,n,s).noFill();return w.Utils.applySvgAttributes.call(this,t,a,e),a},lineargradient:function(t,e){for(var i=parseFloat(t.getAttribute("x1")),r=parseFloat(t.getAttribute("y1")),n=parseFloat(t.getAttribute("x2")),s=parseFloat(t.getAttribute("y2")),o=(n+i)/2,l=(s+r)/2,h=[],c=0;c<t.children.length;c++){var d,u=t.children[c],f=parseFloat(u.getAttribute("offset")),g=u.getAttribute("stop-color"),_=u.getAttribute("stop-opacity"),p=u.getAttribute("style");if(a.isNull(g))g=(d=!!p&&p.match(/stop\-color\:\s?([\#a-fA-F0-9]*)/))&&d.length>1?d[1]:void 0;if(a.isNull(_))_=(d=!!p&&p.match(/stop\-opacity\:\s?([0-9\.\-]*)/))&&d.length>1?parseFloat(d[1]):1;h.push(new w.Gradient.Stop(f,g,_))}var m=new w.LinearGradient(i-o,r-l,n-o,s-l,h);return w.Utils.applySvgAttributes.call(this,t,m,e),m},radialgradient:function(t,e){var i=parseFloat(t.getAttribute("cx"))||0,r=parseFloat(t.getAttribute("cy"))||0,n=parseFloat(t.getAttribute("r")),s=parseFloat(t.getAttribute("fx")),o=parseFloat(t.getAttribute("fy"));a.isNaN(s)&&(s=i),a.isNaN(o)&&(o=r);for(var l=c(i+s)/2,h=c(r+o)/2,d=[],u=0;u<t.children.length;u++){var f,g=t.children[u],_=parseFloat(g.getAttribute("offset")),p=g.getAttribute("stop-color"),m=g.getAttribute("stop-opacity"),v=g.getAttribute("style");if(a.isNull(p))p=(f=!!v&&v.match(/stop\-color\:\s?([\#a-fA-F0-9]*)/))&&f.length>1?f[1]:void 0;if(a.isNull(m))m=(f=!!v&&v.match(/stop\-opacity\:\s?([0-9\.\-]*)/))&&f.length>1?parseFloat(f[1]):1;d.push(new w.Gradient.Stop(_,p,m))}var y=new w.RadialGradient(i-l,r-h,n,d,s-l,o-h);return w.Utils.applySvgAttributes.call(this,t,y,e),y}},subdivide:function(t,e,i,r,n,s,a,o,l){var h=(l=l||w.Utils.Curve.RecursionLimit)+1;if(c(t-a)<.001&&c(e-o)<.001)return[new w.Anchor(a,o)];for(var d=[],u=0;u<h;u++){var f=u/h,g=E(f,t,i,n,a),_=E(f,e,r,s,o);d.push(new w.Anchor(g,_))}return d},getComponentOnCubicBezier:function(t,e,i,r,n){var s=1-t;return s*s*s*e+3*s*s*t*i+3*s*t*t*r+t*t*t*n},getCurveLength:function(t,e,i,r,n,s,a,o,l){if(t===i&&e===r&&n===a&&s===o){var c=a-t,d=o-e;return h(c*c+d*d)}var u=9*(i-n)+3*(a-t),f=6*(t+n)-12*i,g=3*(i-t),_=9*(r-s)+3*(o-e),p=6*(e+s)-12*r,m=3*(r-e);return R(function(t){var e=(u*t+f)*t+g,i=(_*t+p)*t+m;return h(e*e+i*i)},0,1,l||w.Utils.Curve.RecursionLimit)},getCurveBoundingBox:function(t,e,i,r,n,s,a,o){for(var l,h,d,u,f,g,_,p,m=[],v=[[],[]],y=0;y<2;++y)if(0==y?(h=6*t-12*i+6*n,l=-3*t+9*i-9*n+3*a,d=3*i-3*t):(h=6*e-12*r+6*s,l=-3*e+9*r-9*s+3*o,d=3*r-3*e),c(l)<1e-12){if(c(h)<1e-12)continue;0<(u=-d/h)&&u<1&&m.push(u)}else _=h*h-4*d*l,p=Math.sqrt(_),_<0||(0<(f=(-h+p)/(2*l))&&f<1&&m.push(f),0<(g=(-h-p)/(2*l))&&g<1&&m.push(g));for(var x,b=m.length,w=b;b--;)x=1-(u=m[b]),v[0][b]=x*x*x*t+3*x*x*u*i+3*x*u*u*n+u*u*u*a,v[1][b]=x*x*x*e+3*x*x*u*r+3*x*u*u*s+u*u*u*o;return v[0][w]=t,v[1][w]=e,v[0][w+1]=a,v[1][w+1]=o,v[0].length=v[1].length=w+2,{min:{x:Math.min.apply(0,v[0]),y:Math.min.apply(0,v[1])},max:{x:Math.max.apply(0,v[0]),y:Math.max.apply(0,v[1])}}},integrate:function(t,e,i,r){for(var n=w.Utils.Curve.abscissas[r-2],s=w.Utils.Curve.weights[r-2],a=.5*(i-e),o=a+e,l=0,h=r+1>>1,c=1&r?s[l++]*t(o):0;l<h;){var d=a*n[l];c+=s[l++]*(t(o+d)+t(o-d))}return a*c},getCurveFromPoints:function(t,e){for(var i=t.length,r=i-1,n=0;n<i;n++){var s=t[n];a.isObject(s.controls)||w.Anchor.AppendCurveProperties(s);var o=e?C(n-1,i):_(n-1,0),l=e?C(n+1,i):g(n+1,r),h=t[o],c=s,d=t[l];A(h,c,d),c.command=0===n?w.Commands.move:w.Commands.curve}},getControlPoints:function(t,e,i){var r=w.Vector.angleBetween(t,e),n=w.Vector.angleBetween(i,e),s=w.Vector.distanceBetween(t,e),h=w.Vector.distanceBetween(i,e),c=(r+n)/2;return s<1e-4||h<1e-4?(a.isBoolean(e.relative)&&!e.relative&&(e.controls.left.copy(e),e.controls.right.copy(e)),e):(s*=.33,h*=.33,n<r?c+=u:c-=u,e.controls.left.x=l(c)*s,e.controls.left.y=o(c)*s,c-=d,e.controls.right.x=l(c)*h,e.controls.right.y=o(c)*h,a.isBoolean(e.relative)&&!e.relative&&(e.controls.left.x+=e.x,e.controls.left.y+=e.y,e.controls.right.x+=e.x,e.controls.right.y+=e.y),e)},getReflection:function(t,e,i){return new w.Vector(2*t.x-(e.x+t.x)-(i?t.x:0),2*t.y-(e.y+t.y)-(i?t.y:0))},getAnchorsFromArcData:function(t,e,i,r,n,s,o){(new w.Matrix).translate(t.x,t.y).rotate(e);var l=w.Resolution;return a.map(a.range(l),function(t){var e=(t+1)/l;o&&(e=1-e);var a=e*s+n,h=i*Math.cos(a),c=r*Math.sin(a),d=new w.Anchor(h,c);return w.Anchor.AppendCurveProperties(d),d.command=w.Commands.line,d})},lerp:function(t,e,i){return i*(e-t)+t},toFixed:function(t){return Math.floor(1e3*t)/1e3},mod:function(t,e){for(;t<0;)t+=e;return t%e},Collection:function(){Array.call(this),arguments.length>1?Array.prototype.push.apply(this,arguments):arguments[0]&&Array.isArray(arguments[0])&&Array.prototype.push.apply(this,arguments[0])},Error:function(t){this.name="two.js",this.message=t},Events:{on:function(t,e){return this._events||(this._events={}),(this._events[t]||(this._events[t]=[])).push(e),this},off:function(t,e){if(!this._events)return this;if(!t&&!e)return this._events={},this;for(var i=t?[t]:a.keys(this._events),r=0,n=i.length;r<n;r++){t=i[r];var s=this._events[t];if(s){var o=[];if(e)for(var l=0,h=s.length;l<h;l++){var c=s[l];c=c.handler?c.handler:c,e&&e!==c&&o.push(c)}this._events[t]=o}}return this},trigger:function(t){if(!this._events)return this;var e=m.call(arguments,1),i=this._events[t];return i&&S(this,i,e),this},listen:function(t,e,i){var r=this;if(t){var n=function(){i.apply(r,arguments)};n.obj=t,n.name=e,n.handler=i,t.on(e,ev)}return this},ignore:function(t,e,i){return t.off(e,i),this}}})}),w.Utils.Events.bind=w.Utils.Events.on,w.Utils.Events.unbind=w.Utils.Events.off;var S=function(t,e,i){var r;switch(i.length){case 0:r=function(r){e[r].call(t,i[0])};break;case 1:r=function(r){e[r].call(t,i[0],i[1])};break;case 2:r=function(r){e[r].call(t,i[0],i[1],i[2])};break;case 3:r=function(r){e[r].call(t,i[0],i[1],i[2],i[3])};break;default:r=function(r){e[r].apply(t,i)}}for(var n=0;n<e.length;n++)r(n)};w.Utils.Error.prototype=new Error,w.Utils.Error.prototype.constructor=w.Utils.Error,w.Utils.Collection.prototype=new Array,w.Utils.Collection.prototype.constructor=w.Utils.Collection,a.extend(w.Utils.Collection.prototype,w.Utils.Events,{pop:function(){var t=Array.prototype.pop.apply(this,arguments);return this.trigger(w.Events.remove,[t]),t},shift:function(){var t=Array.prototype.shift.apply(this,arguments);return this.trigger(w.Events.remove,[t]),t},push:function(){var t=Array.prototype.push.apply(this,arguments);return this.trigger(w.Events.insert,arguments),t},unshift:function(){var t=Array.prototype.unshift.apply(this,arguments);return this.trigger(w.Events.insert,arguments),t},splice:function(){var t,e=Array.prototype.splice.apply(this,arguments);return this.trigger(w.Events.remove,e),arguments.length>2&&(t=this.slice(arguments[0],arguments[0]+arguments.length-2),this.trigger(w.Events.insert,t),this.trigger(w.Events.order)),e},sort:function(){return Array.prototype.sort.apply(this,arguments),this.trigger(w.Events.order),this},reverse:function(){return Array.prototype.reverse.apply(this,arguments),this.trigger(w.Events.order),this}});w.Utils.getAnchorsFromArcData;var A=w.Utils.getControlPoints,C=(w.Utils.getCurveFromPoints,w.Utils.solveSegmentIntersection,w.Utils.decoupleShapes,w.Utils.mod),k=w.Utils.getBackingStoreRatio,E=w.Utils.getComponentOnCubicBezier,R=(w.Utils.getCurveLength,w.Utils.integrate),M=w.Utils.getReflection;function F(){var t=document.body.getBoundingClientRect(),e=this.width=t.width,i=this.height=t.height;this.renderer.setSize(e,i,this.ratio)}function O(t,e){this.width=t,this.height=e,this.trigger(w.Events.resize,t,e)}a.extend(w.prototype,w.Utils.Events,{constructor:w,appendTo:function(t){return t.appendChild(this.renderer.domElement),this},play:function(){return w.Utils.setPlaying.call(this,!0),T.init(),this.trigger(w.Events.play)},pause:function(){return this.playing=!1,this.trigger(w.Events.pause)},update:function(){var t=!!this._lastFrame,e=v.now();t&&(this.timeDelta=parseFloat((e-this._lastFrame).toFixed(3))),this._lastFrame=e;var i=this.width,r=this.height,n=this.renderer;return i===n.width&&r===n.height||n.setSize(i,r,this.ratio),this.trigger(w.Events.update,this.frameCount,this.timeDelta),this.render()},render:function(){return this.renderer.render(),this.trigger(w.Events.render,this.frameCount++)},add:function(t){var e=t;return e instanceof Array||(e=a.toArray(arguments)),this.scene.add(e),this},remove:function(t){var e=t;return e instanceof Array||(e=a.toArray(arguments)),this.scene.remove(e),this},clear:function(){return this.scene.remove(this.scene.children),this},makeLine:function(t,e,i,r){var n=new w.Line(t,e,i,r);return this.scene.add(n),n},makeRectangle:function(t,e,i,r){var n=new w.Rectangle(t,e,i,r);return this.scene.add(n),n},makeRoundedRectangle:function(t,e,i,r,n){var s=new w.RoundedRectangle(t,e,i,r,n);return this.scene.add(s),s},makeCircle:function(t,e,i){var r=new w.Circle(t,e,i);return this.scene.add(r),r},makeEllipse:function(t,e,i,r){var n=new w.Ellipse(t,e,i,r);return this.scene.add(n),n},makeStar:function(t,e,i,r,n){var s=new w.Star(t,e,i,r,n);return this.scene.add(s),s},makeCurve:function(t){var e=arguments.length,i=t;if(!a.isArray(t)){i=[];for(var r=0;r<e;r+=2){var n=arguments[r];if(!a.isNumber(n))break;var s=arguments[r+1];i.push(new w.Anchor(n,s))}}var o=arguments[e-1],l=new w.Path(i,!(a.isBoolean(o)?o:void 0),!0),h=l.getBoundingClientRect();return l.center().translation.set(h.left+h.width/2,h.top+h.height/2),this.scene.add(l),l},makePolygon:function(t,e,i,r){var n=new w.Polygon(t,e,i,r);return this.scene.add(n),n},makeArcSegment:function(t,e,i,r,n,s,a){var o=new w.ArcSegment(t,e,i,r,n,s,a);return this.scene.add(o),o},makePath:function(t){var e=arguments.length,i=t;if(!a.isArray(t)){i=[];for(var r=0;r<e;r+=2){var n=arguments[r];if(!a.isNumber(n))break;var s=arguments[r+1];i.push(new w.Anchor(n,s))}}var o=arguments[e-1],l=new w.Path(i,!(a.isBoolean(o)?o:void 0)),h=l.getBoundingClientRect();return l.center().translation.set(h.left+h.width/2,h.top+h.height/2),this.scene.add(l),l},makeText:function(t,e,i,r){var n=new w.Text(t,e,i,r);return this.add(n),n},makeLinearGradient:function(t,e,i,r){var n=m.call(arguments,4),s=new w.LinearGradient(t,e,i,r,n);return this.add(s),s},makeRadialGradient:function(t,e,i){var r=m.call(arguments,3),n=new w.RadialGradient(t,e,i,r);return this.add(n),n},makeSprite:function(t,e,i,r,n,s,a){var o=new w.Sprite(t,e,i,r,n,s);return a&&o.play(),this.add(o),o},makeImageSequence:function(t,e,i,r,n){var s=new w.ImageSequence(t,e,i,r);return n&&s.play(),this.add(s),s},makeTexture:function(t,e){return new w.Texture(t,e)},makeGroup:function(t){var e=t;e instanceof Array||(e=a.toArray(arguments));var i=new w.Group;return this.scene.add(i),i.add(e),i},interpret:function(t,e,i){var r=t.tagName.toLowerCase();i=void 0===i||i;if(!(r in w.Utils.read))return null;var n=w.Utils.read[r].call(this,t);return i&&this.add(e&&n instanceof w.Group?n.children:n),n},load:function(t,e){var i,r,n,s=new w.Group,o=a.bind(function(t){for(b.temp.innerHTML=t,r=0;r<b.temp.children.length;r++)if(i=b.temp.children[r],/svg/i.test(i.nodeName))for(n=0;n<i.children.length;n++)s.add(this.interpret(i.children[n]));else s.add(this.interpret(i));if(a.isFunction(e)){var o=b.temp.children.length<=1?b.temp.children[0]:b.temp.children;e(s,o)}},this);return/.*\.svg$/gi.test(t)?(w.Utils.xhr(t,o),s):(o(t),s)}});var T=b.getRequestAnimationFrame();function P(){for(var t=0;t<w.Instances.length;t++){var e=w.Instances[t];e.playing&&e.update()}w.nextFrameID=T(P)}return"function"==typeof define&&i("nErl")?define("two",[],function(){return w}):void 0!==r&&r.exports&&(r.exports=w),w}((void 0!==t?t:this||window).Two),n=(void 0!==t?t:this||window).Two,s=n.Utils,a=n.Registry=function(){this.map={}},s.extend(a.prototype,{constructor:a,add:function(t,e){return this.map[t]=e,this},remove:function(t){return delete this.map[t],this},get:function(t){return this.map[t]},contains:function(t){return t in this.map}}),function(t){var e=t.Utils,i=t.Vector=function(t,e){this.x=t||0,this.y=e||0};e.extend(i,{zero:new t.Vector,add:function(t,e){return new i(t.x+e.x,t.y+e.y)},sub:function(t,e){return new i(t.x-e.x,t.y-e.y)},subtract:function(t,e){return i.sub(t,e)},ratioBetween:function(t,e){return(t.x*e.x+t.y*e.y)/(t.length()*e.length())},angleBetween:function(t,e){var i,r;return arguments.length>=4?(i=arguments[0]-arguments[2],r=arguments[1]-arguments[3],Math.atan2(r,i)):(i=t.x-e.x,r=t.y-e.y,Math.atan2(r,i))},distanceBetween:function(t,e){return Math.sqrt(i.distanceBetweenSquared(t,e))},distanceBetweenSquared:function(t,e){var i=t.x-e.x,r=t.y-e.y;return i*i+r*r},MakeObservable:function(i){i.bind=i.on=function(){return this._bound||(this._x=this.x,this._y=this.y,Object.defineProperty(this,"x",n),Object.defineProperty(this,"y",s),e.extend(this,r),this._bound=!0),t.Utils.Events.bind.apply(this,arguments),this}}}),e.extend(i.prototype,t.Utils.Events,{constructor:i,set:function(t,e){return this.x=t,this.y=e,this},copy:function(t){return this.x=t.x,this.y=t.y,this},clear:function(){return this.x=0,this.y=0,this},clone:function(){return new i(this.x,this.y)},add:function(t,i){return arguments.length<=0?this:(arguments.length<=1?e.isNumber(t)?(this.x+=t,this.y+=t):t&&e.isNumber(t.x)&&e.isNumber(t.y)&&(this.x+=t.x,this.y+=t.y):(this.x+=t,this.y+=i),this)},addSelf:function(t){return this.add.apply(this,arguments)},sub:function(t,i){return arguments.length<=0?this:(arguments.length<=1?e.isNumber(t)?(this.x-=t,this.y-=t):t&&e.isNumber(t.x)&&e.isNumber(t.y)&&(this.x-=t.x,this.y-=t.y):(this.x-=t,this.y-=i),this)},subtract:function(){return this.sub.apply(this,arguments)},subSelf:function(t){return this.sub.apply(this,arguments)},subtractSelf:function(t){return this.sub.apply(this,arguments)},multiply:function(t,i){return arguments.length<=0?this:(arguments.length<=1?e.isNumber(t)?(this.x*=t,this.y*=t):t&&e.isNumber(t.x)&&e.isNumber(t.y)&&(this.x*=t.x,this.y*=t.y):(this.x*=t,this.y*=i),this)},multiplySelf:function(t){return this.multiply.apply(this,arguments)},multiplyScalar:function(t){return this.multiply(t)},divide:function(t,i){return arguments.length<=0?this:(arguments.length<=1?e.isNumber(t)?(this.x/=t,this.y/=t):t&&e.isNumber(t.x)&&e.isNumber(t.y)&&(this.x/=t.x,this.y/=t.y):(this.x/=t,this.y/=i),e.isNaN(this.x)&&(this.x=0),e.isNaN(this.y)&&(this.y=0),this)},divideSelf:function(t){return this.divide.apply(this,arguments)},divideScalar:function(t){return this.divide(t)},negate:function(){return this.multiply(-1)},dot:function(t){return this.x*t.x+this.y*t.y},length:function(){return Math.sqrt(this.lengthSquared())},lengthSquared:function(){return this.x*this.x+this.y*this.y},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,i=this.y-t.y;return e*e+i*i},setLength:function(t){return this.normalize().multiplyScalar(t)},equals:function(t,e){return e=void 0===e?1e-4:e,this.distanceTo(t)<e},lerp:function(t,e){var i=(t.x-this.x)*e+this.x,r=(t.y-this.y)*e+this.y;return this.set(i,r)},isZero:function(t){return t=void 0===t?1e-4:t,this.length()<t},toString:function(){return this.x+", "+this.y},toObject:function(){return{x:this.x,y:this.y}},rotate:function(t){var e=Math.cos(t),i=Math.sin(t);return this.x=this.x*e-this.y*i,this.y=this.x*i+this.y*e,this}});var r={constructor:i,set:function(e,i){return this._x=e,this._y=i,this.trigger(t.Events.change)},copy:function(e){return this._x=e.x,this._y=e.y,this.trigger(t.Events.change)},clear:function(){return this._x=0,this._y=0,this.trigger(t.Events.change)},clone:function(){return new i(this._x,this._y)},add:function(i,r){return arguments.length<=0?this:(arguments.length<=1?e.isNumber(i)?(this._x+=i,this._y+=i):i&&e.isNumber(i.x)&&e.isNumber(i.y)&&(this._x+=i.x,this._y+=i.y):(this._x+=i,this._y+=r),this.trigger(t.Events.change))},sub:function(i,r){return arguments.length<=0?this:(arguments.length<=1?e.isNumber(i)?(this._x-=i,this._y-=i):i&&e.isNumber(i.x)&&e.isNumber(i.y)&&(this._x-=i.x,this._y-=i.y):(this._x-=i,this._y-=r),this.trigger(t.Events.change))},multiply:function(i,r){return arguments.length<=0?this:(arguments.length<=1?e.isNumber(i)?(this._x*=i,this._y*=i):i&&e.isNumber(i.x)&&e.isNumber(i.y)&&(this._x*=i.x,this._y*=i.y):(this._x*=i,this._y*=r),this.trigger(t.Events.change))},divide:function(i,r){return arguments.length<=0?this:(arguments.length<=1?e.isNumber(i)?(this._x/=i,this._y/=i):i&&e.isNumber(i.x)&&e.isNumber(i.y)&&(this._x/=i.x,this._y/=i.y):(this._x/=i,this._y/=r),e.isNaN(this._x)&&(this._x=0),e.isNaN(this._y)&&(this._y=0),this.trigger(t.Events.change))},dot:function(t){return this._x*t.x+this._y*t.y},lengthSquared:function(){return this._x*this._x+this._y*this._y},distanceToSquared:function(t){var e=this._x-t.x,i=this._y-t.y;return e*e+i*i},lerp:function(t,e){var i=(t.x-this._x)*e+this._x,r=(t.y-this._y)*e+this._y;return this.set(i,r)},toString:function(){return this._x+", "+this._y},toObject:function(){return{x:this._x,y:this._y}},rotate:function(t){var e=Math.cos(t),i=Math.sin(t);return this._x=this._x*e-this._y*i,this._y=this._x*i+this._y*e,this}},n={enumerable:!0,get:function(){return this._x},set:function(e){this._x=e,this.trigger(t.Events.change,"x")}},s={enumerable:!0,get:function(){return this._y},set:function(e){this._y=e,this.trigger(t.Events.change,"y")}};i.MakeObservable(i.prototype)}((void 0!==t?t:this||window).Two),function(t){var e=t.Commands,i=t.Utils,r=t.Anchor=function(r,n,s,a,o,l,h){t.Vector.call(this,r,n),this._broadcast=i.bind(function(){this.trigger(t.Events.change)},this),this._command=h||e.move,this._relative=!0;var c=i.isNumber(s),d=i.isNumber(a),u=i.isNumber(o),f=i.isNumber(l);(c||d||u||f)&&t.Anchor.AppendCurveProperties(this),c&&(this.controls.left.x=s),d&&(this.controls.left.y=a),u&&(this.controls.right.x=o),f&&(this.controls.right.y=l)};i.extend(t.Anchor,{AppendCurveProperties:function(e){e.relative=!0,e.controls={},e.controls.left=new t.Vector(0,0),e.controls.right=new t.Vector(0,0)},MakeObservable:function(s){Object.defineProperty(s,"command",{enumerable:!0,get:function(){return this._command},set:function(n){return this._command=n,this._command!==e.curve||i.isObject(this.controls)||r.AppendCurveProperties(this),this.trigger(t.Events.change)}}),Object.defineProperty(s,"relative",{enumerable:!0,get:function(){return this._relative},set:function(e){return this._relative==e?this:(this._relative=!!e,this.trigger(t.Events.change))}}),i.extend(s,t.Vector.prototype,n),s.bind=s.on=function(){var e=this._bound;t.Vector.prototype.bind.apply(this,arguments),e||i.extend(this,n)}}});var n={constructor:t.Anchor,listen:function(){return i.isObject(this.controls)||t.Anchor.AppendCurveProperties(this),this.controls.left.bind(t.Events.change,this._broadcast),this.controls.right.bind(t.Events.change,this._broadcast),this},ignore:function(){return this.controls.left.unbind(t.Events.change,this._broadcast),this.controls.right.unbind(t.Events.change,this._broadcast),this},copy:function(e){return this.x=e.x,this.y=e.y,i.isString(e.command)&&(this.command=e.command),i.isObject(e.controls)&&(i.isObject(this.controls)||t.Anchor.AppendCurveProperties(this),this.controls.left.copy(e.controls.left),this.controls.right.copy(e.controls.right)),i.isBoolean(e.relative)&&(this.relative=e.relative),this.command===t.Commands.arc&&(this.rx=e.rx,this.ry=e.ry,this.xAxisRotation=e.xAxisRotation,this.largeArcFlag=e.largeArcFlag,this.sweepFlag=e.sweepFlag),this},clone:function(){var e=this.controls,i=new t.Anchor(this.x,this.y,e&&e.left.x,e&&e.left.y,e&&e.right.x,e&&e.right.y,this.command);return i.relative=this._relative,i},toObject:function(){var t={x:this.x,y:this.y};return this._command&&(t.command=this._command),this._relative&&(t.relative=this._relative),this.controls&&(t.controls={left:this.controls.left.toObject(),right:this.controls.right.toObject()}),t},toString:function(){return this.controls?[this._x,this._y,this.controls.left.x,this.controls.left.y,this.controls.right.x,this.controls.right.y,this._command,this._relative?1:0].join(", "):[this._x,this._y].join(", ")}};t.Anchor.MakeObservable(t.Anchor.prototype)}((void 0!==t?t:this||window).Two),function(t){var e=Math.cos,i=Math.sin,r=Math.tan,n=t.Utils,s=n.toFixed,a=[],o=t.Matrix=function(e,i,r,s,a,o){this.elements=new t.Array(9);var l=e;n.isArray(l)||(l=n.toArray(arguments)),this.identity(),l.length>0&&this.set(l)};n.extend(o,{Identity:[1,0,0,0,1,0,0,0,1],Multiply:function(e,i,r){if(i.length<=3){var n=e,s=i[0]||0,a=i[1]||0,o=i[2]||0;return{x:n[0]*s+n[1]*a+n[2]*o,y:n[3]*s+n[4]*a+n[5]*o,z:n[6]*s+n[7]*a+n[8]*o}}var l=e[0],h=e[1],c=e[2],d=e[3],u=e[4],f=e[5],g=e[6],_=e[7],p=e[8],m=i[0],v=i[1],y=i[2],x=i[3],b=i[4],w=i[5],S=i[6],A=i[7],C=i[8];return(r=r||new t.Array(9))[0]=l*m+h*x+c*S,r[1]=l*v+h*b+c*A,r[2]=l*y+h*w+c*C,r[3]=d*m+u*x+f*S,r[4]=d*v+u*b+f*A,r[5]=d*y+u*w+f*C,r[6]=g*m+_*x+p*S,r[7]=g*v+_*b+p*A,r[8]=g*y+_*w+p*C,r}}),n.extend(o.prototype,t.Utils.Events,{constructor:o,manual:!1,set:function(e){var i=e;return arguments.length>1&&(i=n.toArray(arguments)),this.elements[0]=i[0],this.elements[1]=i[1],this.elements[2]=i[2],this.elements[3]=i[3],this.elements[4]=i[4],this.elements[5]=i[5],this.elements[6]=i[6],this.elements[7]=i[7],this.elements[8]=i[8],this.trigger(t.Events.change)},identity:function(){return this.elements[0]=o.Identity[0],this.elements[1]=o.Identity[1],this.elements[2]=o.Identity[2],this.elements[3]=o.Identity[3],this.elements[4]=o.Identity[4],this.elements[5]=o.Identity[5],this.elements[6]=o.Identity[6],this.elements[7]=o.Identity[7],this.elements[8]=o.Identity[8],this.trigger(t.Events.change)},multiply:function(e,i,r,n,s,a,o,l,h){var c=arguments,d=c.length;if(d<=1)return this.elements[0]*=e,this.elements[1]*=e,this.elements[2]*=e,this.elements[3]*=e,this.elements[4]*=e,this.elements[5]*=e,this.elements[6]*=e,this.elements[7]*=e,this.elements[8]*=e,this.trigger(t.Events.change);if(d<=3)return e=e||0,i=i||0,r=r||0,{x:(s=this.elements)[0]*e+s[1]*i+s[2]*r,y:s[3]*e+s[4]*i+s[5]*r,z:s[6]*e+s[7]*i+s[8]*r};var u=this.elements,f=c,g=u[0],_=u[1],p=u[2],m=u[3],v=u[4],y=u[5],x=u[6],b=u[7],w=u[8],S=f[0],A=f[1],C=f[2],k=f[3],E=f[4],R=f[5],M=f[6],F=f[7],O=f[8];return this.elements[0]=g*S+_*k+p*M,this.elements[1]=g*A+_*E+p*F,this.elements[2]=g*C+_*R+p*O,this.elements[3]=m*S+v*k+y*M,this.elements[4]=m*A+v*E+y*F,this.elements[5]=m*C+v*R+y*O,this.elements[6]=x*S+b*k+w*M,this.elements[7]=x*A+b*E+w*F,this.elements[8]=x*C+b*R+w*O,this.trigger(t.Events.change)},inverse:function(e){var i=this.elements;e=e||new t.Matrix;var r=i[0],n=i[1],s=i[2],a=i[3],o=i[4],l=i[5],h=i[6],c=i[7],d=i[8],u=d*o-l*c,f=-d*a+l*h,g=c*a-o*h,_=r*u+n*f+s*g;return _?(_=1/_,e.elements[0]=u*_,e.elements[1]=(-d*n+s*c)*_,e.elements[2]=(l*n-s*o)*_,e.elements[3]=f*_,e.elements[4]=(d*r-s*h)*_,e.elements[5]=(-l*r+s*a)*_,e.elements[6]=g*_,e.elements[7]=(-c*r+n*h)*_,e.elements[8]=(o*r-n*a)*_,e):null},scale:function(t,e){return arguments.length<=1&&(e=t),this.multiply(t,0,0,0,e,0,0,0,1)},rotate:function(t){var r=e(t),n=i(t);return this.multiply(r,-n,0,n,r,0,0,0,1)},translate:function(t,e){return this.multiply(1,0,t,0,1,e,0,0,1)},skewX:function(t){var e=r(t);return this.multiply(1,e,0,0,1,0,0,0,1)},skewY:function(t){var e=r(t);return this.multiply(1,0,0,e,1,0,0,0,1)},toString:function(t){return a.length=0,this.toArray(t,a),a.join(" ")},toArray:function(t,e){var i=this.elements,r=!!e,n=s(i[0]),a=s(i[1]),o=s(i[2]),l=s(i[3]),h=s(i[4]),c=s(i[5]);if(t){var d=s(i[6]),u=s(i[7]),f=s(i[8]);return r?(e[0]=n,e[1]=l,e[2]=d,e[3]=a,e[4]=h,e[5]=u,e[6]=o,e[7]=c,void(e[8]=f)):[n,l,d,a,h,u,o,c,f]}return r?(e[0]=n,e[1]=l,e[2]=a,e[3]=h,e[4]=o,void(e[5]=c)):[n,l,a,h,o,c]},clone:function(){var e,i,r,n,s,a,o,l,h;e=this.elements[0],i=this.elements[1],r=this.elements[2],n=this.elements[3],s=this.elements[4],a=this.elements[5],o=this.elements[6],l=this.elements[7],h=this.elements[8];var c=new t.Matrix(e,i,r,n,s,a,o,l,h);return c.manual=this.manual,c}})}((void 0!==t?t:this||window).Two),function(t){var e=t.Utils.mod,i=t.Utils.toFixed,r=t.Utils,n={version:1.1,ns:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",alignments:{left:"start",center:"middle",right:"end"},createElement:function(t,e){var i=t,s=document.createElementNS(n.ns,i);return"svg"===i&&(e=r.defaults(e||{},{version:n.version})),r.isEmpty(e)||n.setAttributes(s,e),s},setAttributes:function(t,e){for(var i=Object.keys(e),r=0;r<i.length;r++)/href/.test(i[r])?t.setAttributeNS(n.xlink,i[r],e[i[r]]):t.setAttribute(i[r],e[i[r]]);return this},removeAttributes:function(t,e){for(var i in e)t.removeAttribute(i);return this},toString:function(r,n){for(var s,a=r.length,o=a-1,l="",h=0;h<a;h++){var c,d,u,f,g,_,p,m,v,y,x,b,w,S,A=r[h],C=n?e(h-1,a):Math.max(h-1,0),k=n?e(h+1,a):Math.min(h+1,o),E=r[C],R=r[k],M=i(A.x),F=i(A.y);switch(A.command){case t.Commands.close:c=t.Commands.close;break;case t.Commands.arc:y=A.rx,x=A.ry,b=A.xAxisRotation,w=A.largeArcFlag,S=A.sweepFlag,c=t.Commands.arc+" "+y+" "+x+" "+b+" "+w+" "+S+" "+M+" "+F;break;case t.Commands.curve:_=E.controls&&E.controls.right||t.Vector.zero,p=A.controls&&A.controls.left||t.Vector.zero,E.relative?(d=i(_.x+E.x),u=i(_.y+E.y)):(d=i(_.x),u=i(_.y)),A.relative?(f=i(p.x+A.x),g=i(p.y+A.y)):(f=i(p.x),g=i(p.y)),c=(0===h?t.Commands.move:t.Commands.curve)+" "+d+" "+u+" "+f+" "+g+" "+M+" "+F;break;case t.Commands.move:s=A,c=t.Commands.move+" "+M+" "+F;break;default:c=A.command+" "+M+" "+F}h>=o&&n&&(A.command===t.Commands.curve&&(R=s,m=A.controls&&A.controls.right||A,v=R.controls&&R.controls.left||R,A.relative?(d=i(m.x+A.x),u=i(m.y+A.y)):(d=i(m.x),u=i(m.y)),R.relative?(f=i(v.x+R.x),g=i(v.y+R.y)):(f=i(v.x),g=i(v.y)),c+=" C "+d+" "+u+" "+f+" "+g+" "+(M=i(R.x))+" "+(F=i(R.y))),A.command!==t.Commands.close&&(c+=" Z")),l+=c+" "}return l},getClip:function(t){var e=t._renderer.clip;if(!e){for(var i=t;i.parent;)i=i.parent;e=t._renderer.clip=n.createElement("clipPath"),i.defs.appendChild(e)}return e},group:{appendChild:function(t){var e=t._renderer.elem;if(e){var i=e.nodeName;!i||/(radial|linear)gradient/i.test(i)||t._clip||this.elem.appendChild(e)}},removeChild:function(t){var e=t._renderer.elem;e&&e.parentNode==this.elem&&(e.nodeName&&(t._clip||this.elem.removeChild(e)))},orderChild:function(t){this.elem.appendChild(t._renderer.elem)},renderChild:function(t){n[t._renderer.type].render.call(t,this)},render:function(t){if(this._update(),0===this._opacity&&!this._flagOpacity)return this;this._renderer.elem||(this._renderer.elem=n.createElement("g",{id:this.id}),t.appendChild(this._renderer.elem));var e=this._matrix.manual||this._flagMatrix,i={domElement:t,elem:this._renderer.elem};e&&this._renderer.elem.setAttribute("transform","matrix("+this._matrix.toString()+")");for(var r=0;r<this.children.length;r++){var s=this.children[r];n[s._renderer.type].render.call(s,t)}return this._flagOpacity&&this._renderer.elem.setAttribute("opacity",this._opacity),this._flagClassName&&this._renderer.elem.setAttribute("class",this._className),this._flagAdditions&&this.additions.forEach(n.group.appendChild,i),this._flagSubtractions&&this.subtractions.forEach(n.group.removeChild,i),this._flagOrder&&this.children.forEach(n.group.orderChild,i),this._flagMask&&(this._mask?this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")"):this._renderer.elem.removeAttribute("clip-path")),this.flagReset()}},path:{render:function(t){if(this._update(),0===this._opacity&&!this._flagOpacity)return this;var e={};if((this._matrix.manual||this._flagMatrix)&&(e.transform="matrix("+this._matrix.toString()+")"),this._flagVertices){var i=n.toString(this._renderer.vertices,this._closed);e.d=i}if(this._fill&&this._fill._renderer&&(this._fill._update(),n[this._fill._renderer.type].render.call(this._fill,t,!0)),this._flagFill&&(e.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill),this._stroke&&this._stroke._renderer&&(this._stroke._update(),n[this._stroke._renderer.type].render.call(this._stroke,t,!0)),this._flagStroke&&(e.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke),this._flagLinewidth&&(e["stroke-width"]=this._linewidth),this._flagOpacity&&(e["stroke-opacity"]=this._opacity,e["fill-opacity"]=this._opacity),this._flagClassName&&(e.class=this._className),this._flagVisible&&(e.visibility=this._visible?"visible":"hidden"),this._flagCap&&(e["stroke-linecap"]=this._cap),this._flagJoin&&(e["stroke-linejoin"]=this._join),this._flagMiter&&(e["stroke-miterlimit"]=this._miter),this.dashes&&this.dashes.length>0&&(e["stroke-dasharray"]=this.dashes.join(" ")),this._renderer.elem?n.setAttributes(this._renderer.elem,e):(e.id=this.id,this._renderer.elem=n.createElement("path",e),t.appendChild(this._renderer.elem)),this._flagClip){var r=n.getClip(this),s=this._renderer.elem;this._clip?(s.removeAttribute("id"),r.setAttribute("id",this.id),r.appendChild(s)):(r.removeAttribute("id"),s.setAttribute("id",this.id),this.parent._renderer.elem.appendChild(s))}return this.flagReset()}},text:{render:function(t){this._update();var e={};if((this._matrix.manual||this._flagMatrix)&&(e.transform="matrix("+this._matrix.toString()+")"),this._flagFamily&&(e["font-family"]=this._family),this._flagSize&&(e["font-size"]=this._size),this._flagLeading&&(e["line-height"]=this._leading),this._flagAlignment&&(e["text-anchor"]=n.alignments[this._alignment]||this._alignment),this._flagBaseline&&(e["alignment-baseline"]=e["dominant-baseline"]=this._baseline),this._flagStyle&&(e["font-style"]=this._style),this._flagWeight&&(e["font-weight"]=this._weight),this._flagDecoration&&(e["text-decoration"]=this._decoration),this._fill&&this._fill._renderer&&(this._fill._update(),n[this._fill._renderer.type].render.call(this._fill,t,!0)),this._flagFill&&(e.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill),this._stroke&&this._stroke._renderer&&(this._stroke._update(),n[this._stroke._renderer.type].render.call(this._stroke,t,!0)),this._flagStroke&&(e.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke),this._flagLinewidth&&(e["stroke-width"]=this._linewidth),this._flagOpacity&&(e.opacity=this._opacity),this._flagClassName&&(e.class=this._className),this._flagVisible&&(e.visibility=this._visible?"visible":"hidden"),this.dashes&&this.dashes.length>0&&(e["stroke-dasharray"]=this.dashes.join(" ")),this._renderer.elem?n.setAttributes(this._renderer.elem,e):(e.id=this.id,this._renderer.elem=n.createElement("text",e),t.defs.appendChild(this._renderer.elem)),this._flagClip){var i=n.getClip(this),r=this._renderer.elem;this._clip?(r.removeAttribute("id"),i.setAttribute("id",this.id),i.appendChild(r)):(i.removeAttribute("id"),r.setAttribute("id",this.id),this.parent._renderer.elem.appendChild(r))}return this._flagValue&&(this._renderer.elem.textContent=this._value),this.flagReset()}},"linear-gradient":{render:function(t,e){e||this._update();var i={};if(this._flagEndPoints&&(i.x1=this.left._x,i.y1=this.left._y,i.x2=this.right._x,i.y2=this.right._y),this._flagSpread&&(i.spreadMethod=this._spread),this._renderer.elem?n.setAttributes(this._renderer.elem,i):(i.id=this.id,i.gradientUnits="userSpaceOnUse",this._renderer.elem=n.createElement("linearGradient",i),t.defs.appendChild(this._renderer.elem)),this._flagStops){var r=this._renderer.elem.childNodes.length!==this.stops.length;r&&(this._renderer.elem.childNodes.length=0);for(var s=0;s<this.stops.length;s++){var a=this.stops[s],o={};a._flagOffset&&(o.offset=100*a._offset+"%"),a._flagColor&&(o["stop-color"]=a._color),a._flagOpacity&&(o["stop-opacity"]=a._opacity),a._renderer.elem?n.setAttributes(a._renderer.elem,o):a._renderer.elem=n.createElement("stop",o),r&&this._renderer.elem.appendChild(a._renderer.elem),a.flagReset()}}return this.flagReset()}},"radial-gradient":{render:function(t,e){e||this._update();var i={};if(this._flagCenter&&(i.cx=this.center._x,i.cy=this.center._y),this._flagFocal&&(i.fx=this.focal._x,i.fy=this.focal._y),this._flagRadius&&(i.r=this._radius),this._flagSpread&&(i.spreadMethod=this._spread),this._renderer.elem?n.setAttributes(this._renderer.elem,i):(i.id=this.id,i.gradientUnits="userSpaceOnUse",this._renderer.elem=n.createElement("radialGradient",i),t.defs.appendChild(this._renderer.elem)),this._flagStops){var r=this._renderer.elem.childNodes.length!==this.stops.length;r&&(this._renderer.elem.childNodes.length=0);for(var s=0;s<this.stops.length;s++){var a=this.stops[s],o={};a._flagOffset&&(o.offset=100*a._offset+"%"),a._flagColor&&(o["stop-color"]=a._color),a._flagOpacity&&(o["stop-opacity"]=a._opacity),a._renderer.elem?n.setAttributes(a._renderer.elem,o):a._renderer.elem=n.createElement("stop",o),r&&this._renderer.elem.appendChild(a._renderer.elem),a.flagReset()}}return this.flagReset()}},texture:{render:function(e,i){i||this._update();var s={},a={x:0,y:0},o=this.image;if(this._flagLoaded&&this.loaded)switch(o.nodeName.toLowerCase()){case"canvas":a.href=a["xlink:href"]=o.toDataURL("image/png");break;case"img":case"image":a.href=a["xlink:href"]=this.src}if((this._flagOffset||this._flagLoaded||this._flagScale)&&(s.x=this._offset.x,s.y=this._offset.y,o&&(s.x-=o.width/2,s.y-=o.height/2,this._scale instanceof t.Vector?(s.x*=this._scale.x,s.y*=this._scale.y):(s.x*=this._scale,s.y*=this._scale)),s.x>0&&(s.x*=-1),s.y>0&&(s.y*=-1)),(this._flagScale||this._flagLoaded||this._flagRepeat)&&(s.width=0,s.height=0,o)){switch(a.width=s.width=o.width,a.height=s.height=o.height,this._repeat){case"no-repeat":s.width+=1,s.height+=1}this._scale instanceof t.Vector?(s.width*=this._scale.x,s.height*=this._scale.y):(s.width*=this._scale,s.height*=this._scale)}return(this._flagScale||this._flagLoaded)&&(this._renderer.image?r.isEmpty(a)||n.setAttributes(this._renderer.image,a):this._renderer.image=n.createElement("image",a)),this._renderer.elem?r.isEmpty(s)||n.setAttributes(this._renderer.elem,s):(s.id=this.id,s.patternUnits="userSpaceOnUse",this._renderer.elem=n.createElement("pattern",s),e.defs.appendChild(this._renderer.elem)),this._renderer.elem&&this._renderer.image&&!this._renderer.appended&&(this._renderer.elem.appendChild(this._renderer.image),this._renderer.appended=!0),this.flagReset()}}},s=t[t.Types.svg]=function(e){this.domElement=e.domElement||n.createElement("svg"),this.scene=new t.Group,this.scene.parent=this,this.defs=n.createElement("defs"),this.domElement.appendChild(this.defs),this.domElement.defs=this.defs,this.domElement.style.overflow="hidden"};r.extend(s,{Utils:n}),r.extend(s.prototype,t.Utils.Events,{constructor:s,setSize:function(e,i){return this.width=e,this.height=i,n.setAttributes(this.domElement,{width:e,height:i}),this.trigger(t.Events.resize,e,i)},render:function(){return n.group.render.call(this.scene,this.domElement),this}})}((void 0!==t?t:this||window).Two),function(t){var e=t.Utils.mod,i=t.Utils.toFixed,r=t.Utils.getRatio,n=t.Utils,s=[],a=2*Math.PI,o=Math.max,l=Math.min,h=Math.abs,c=Math.sin,d=Math.cos,u=Math.acos,f=Math.sqrt,g=function(t){return 1==t[0]&&0==t[3]&&0==t[1]&&1==t[4]&&0==t[2]&&0==t[5]},_={isHidden:/(none|transparent)/i,alignments:{left:"start",middle:"center",right:"end"},shim:function(t,e){return t.tagName=t.nodeName=e||"canvas",t.nodeType=1,t.getAttribute=function(t){return this[t]},t.setAttribute=function(t,e){return this[t]=e,this},t},group:{renderChild:function(t){_[t._renderer.type].render.call(t,this.ctx,!0,this.clip)},render:function(t){this._update();var e=this._matrix.elements,i=this.parent;this._renderer.opacity=this._opacity*(i&&i._renderer?i._renderer.opacity:1);var r=g(e),n=this._mask;if(this._renderer.context||(this._renderer.context={}),this._renderer.context.ctx=t,r||(t.save(),t.transform(e[0],e[3],e[1],e[4],e[2],e[5])),n&&_[n._renderer.type].render.call(n,t,!0),this.opacity>0&&0!==this.scale)for(var s=0;s<this.children.length;s++){var a=this.children[s];_[a._renderer.type].render.call(a,t)}return r||t.restore(),this.flagReset()}},path:{render:function(r,a,l){var h,c,d,u,f,p,m,v,y,x,b,w,S,A,C,k,E,R,M,F,O,T,P,L,N,U,I,j,D,B,V,G,z;if(this._update(),h=this._matrix.elements,c=this._stroke,d=this._linewidth,u=this._fill,f=this._opacity*this.parent._renderer.opacity,p=this._visible,m=this._cap,v=this._join,y=this._miter,x=this._closed,S=(w=(b=this._renderer.vertices).length)-1,V=g(h),z=this.dashes,B=this._clip,!a&&(!p||B))return this;V||(r.save(),r.transform(h[0],h[3],h[1],h[4],h[2],h[5])),u&&(n.isString(u)?r.fillStyle=u:(_[u._renderer.type].render.call(u,r),r.fillStyle=u._renderer.effect)),c&&(n.isString(c)?r.strokeStyle=c:(_[c._renderer.type].render.call(c,r),r.strokeStyle=c._renderer.effect)),d&&(r.lineWidth=d),y&&(r.miterLimit=y),v&&(r.lineJoin=v),m&&(r.lineCap=m),n.isNumber(f)&&(r.globalAlpha=f),z&&z.length>0&&r.setLineDash(z),r.beginPath();for(var q=0;q<b.length;q++)switch(E=b[q],j=i(E.x),D=i(E.y),E.command){case t.Commands.close:r.closePath();break;case t.Commands.arc:var H=E.rx,$=E.ry,Y=E.xAxisRotation,X=E.largeArcFlag,W=E.sweepFlag;k=b[C=x?e(q-1,w):o(q-1,0)];var J=i(k.x),K=i(k.y);_.renderSvgArcCommand(r,J,K,H,$,X,W,Y,j,D);break;case t.Commands.curve:C=x?e(q-1,w):Math.max(q-1,0),A=x?e(q+1,w):Math.min(q+1,S),k=b[C],R=b[A],L=k.controls&&k.controls.right||t.Vector.zero,N=E.controls&&E.controls.left||t.Vector.zero,k._relative?(T=L.x+i(k.x),P=L.y+i(k.y)):(T=i(L.x),P=i(L.y)),E._relative?(F=N.x+i(E.x),O=N.y+i(E.y)):(F=i(N.x),O=i(N.y)),r.bezierCurveTo(T,P,F,O,j,D),q>=S&&x&&(R=M,U=E.controls&&E.controls.right||t.Vector.zero,I=R.controls&&R.controls.left||t.Vector.zero,E._relative?(T=U.x+i(E.x),P=U.y+i(E.y)):(T=i(U.x),P=i(U.y)),R._relative?(F=I.x+i(R.x),O=I.y+i(R.y)):(F=i(I.x),O=i(I.y)),j=i(R.x),D=i(R.y),r.bezierCurveTo(T,P,F,O,j,D));break;case t.Commands.line:r.lineTo(j,D);break;case t.Commands.move:M=E,r.moveTo(j,D)}return x&&r.closePath(),z&&z.length>0&&r.setLineDash(s),B||l||(_.isHidden.test(u)||((G=u._renderer&&u._renderer.offset)&&(r.save(),r.translate(-u._renderer.offset.x,-u._renderer.offset.y),r.scale(u._renderer.scale.x,u._renderer.scale.y)),r.fill(),G&&r.restore()),_.isHidden.test(c)||((G=c._renderer&&c._renderer.offset)&&(r.save(),r.translate(-c._renderer.offset.x,-c._renderer.offset.y),r.scale(c._renderer.scale.x,c._renderer.scale.y),r.lineWidth=d/c._renderer.scale.x),r.stroke(),G&&r.restore())),V||r.restore(),B&&!l&&r.clip(),this.flagReset()}},text:{render:function(t,e,r){this._update();var s,a,o,l,h,c,d,u=this._matrix.elements,f=this._stroke,p=this._linewidth,m=this._fill,v=this._opacity*this.parent._renderer.opacity,y=this._visible,x=g(u),b=m._renderer&&m._renderer.offset&&f._renderer&&f._renderer.offset,w=this.dashes,S=this._clip;return e||y&&!S?(x||(t.save(),t.transform(u[0],u[3],u[1],u[4],u[2],u[5])),b||(t.font=[this._style,this._weight,this._size+"px/"+this._leading+"px",this._family].join(" ")),t.textAlign=_.alignments[this._alignment]||this._alignment,t.textBaseline=this._baseline,m&&(n.isString(m)?t.fillStyle=m:(_[m._renderer.type].render.call(m,t),t.fillStyle=m._renderer.effect)),f&&(n.isString(f)?t.strokeStyle=f:(_[f._renderer.type].render.call(f,t),t.strokeStyle=f._renderer.effect)),p&&(t.lineWidth=p),n.isNumber(v)&&(t.globalAlpha=v),w&&w.length>0&&t.setLineDash(w),S||r||(_.isHidden.test(m)||(m._renderer&&m._renderer.offset?(c=i(m._renderer.scale.x),d=i(m._renderer.scale.y),t.save(),t.translate(-i(m._renderer.offset.x),-i(m._renderer.offset.y)),t.scale(c,d),s=this._size/m._renderer.scale.y,a=this._leading/m._renderer.scale.y,t.font=[this._style,this._weight,i(s)+"px/",i(a)+"px",this._family].join(" "),o=m._renderer.offset.x/m._renderer.scale.x,l=m._renderer.offset.y/m._renderer.scale.y,t.fillText(this.value,i(o),i(l)),t.restore()):t.fillText(this.value,0,0)),_.isHidden.test(f)||(f._renderer&&f._renderer.offset?(c=i(f._renderer.scale.x),d=i(f._renderer.scale.y),t.save(),t.translate(-i(f._renderer.offset.x),-i(f._renderer.offset.y)),t.scale(c,d),s=this._size/f._renderer.scale.y,a=this._leading/f._renderer.scale.y,t.font=[this._style,this._weight,i(s)+"px/",i(a)+"px",this._family].join(" "),o=f._renderer.offset.x/f._renderer.scale.x,l=f._renderer.offset.y/f._renderer.scale.y,h=p/f._renderer.scale.x,t.lineWidth=i(h),t.strokeText(this.value,i(o),i(l)),t.restore()):t.strokeText(this.value,0,0))),x||t.restore(),S&&!r&&t.clip(),this.flagReset()):this}},"linear-gradient":{render:function(t){if(this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops){this._renderer.effect=t.createLinearGradient(this.left._x,this.left._y,this.right._x,this.right._y);for(var e=0;e<this.stops.length;e++){var i=this.stops[e];this._renderer.effect.addColorStop(i._offset,i._color)}}return this.flagReset()}},"radial-gradient":{render:function(t){if(this._update(),!this._renderer.effect||this._flagCenter||this._flagFocal||this._flagRadius||this._flagStops){this._renderer.effect=t.createRadialGradient(this.center._x,this.center._y,0,this.focal._x,this.focal._y,this._radius);for(var e=0;e<this.stops.length;e++){var i=this.stops[e];this._renderer.effect.addColorStop(i._offset,i._color)}}return this.flagReset()}},texture:{render:function(e){this._update();var i=this.image;return(!this._renderer.effect||(this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)&&(this._renderer.effect=e.createPattern(this.image,this._repeat)),(this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof t.Vector||(this._renderer.offset=new t.Vector),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,i&&(this._renderer.offset.x+=i.width/2,this._renderer.offset.y+=i.height/2,this._scale instanceof t.Vector?(this._renderer.offset.x*=this._scale.x,this._renderer.offset.y*=this._scale.y):(this._renderer.offset.x*=this._scale,this._renderer.offset.y*=this._scale))),(this._flagScale||this._flagLoaded)&&(this._renderer.scale instanceof t.Vector||(this._renderer.scale=new t.Vector),this._scale instanceof t.Vector?this._renderer.scale.copy(this._scale):this._renderer.scale.set(this._scale,this._scale)),this.flagReset()}},renderSvgArcCommand:function(i,r,n,s,l,u,g,_,p,v){_=_*Math.PI/180,s=h(s),l=h(l);var y=(r-p)/2,x=(n-v)/2,b=d(_)*y+c(_)*x,w=-c(_)*y+d(_)*x,S=s*s,A=l*l,C=b*b,k=w*w,E=C/S+k/A;if(E>1){var R=f(E);S=(s*=R)*s,A=(l*=R)*l}var M=S*k+A*C,F=f(o(0,(S*A-M)/M));u===g&&(F=-F);var O=F*s*w/l,T=-F*l*b/s,P=d(_)*O-c(_)*T+(r+p)/2,L=c(_)*O+d(_)*T+(n+v)/2,N=m(1,0,(b-O)/s,(w-T)/l);!function(i,r,n,s,o,l,h,c,d){var u=t.Utils.Curve.Tolerance.epsilon,f=h-l,g=Math.abs(f)<u;(f=e(f,a))<u&&(f=g?0:a);!0!==c||g||(f===a?f=-a:f-=a);for(var _=0;_<t.Resolution;_++){var p=_/(t.Resolution-1),m=l+p*f,v=r+s*Math.cos(m),y=n+o*Math.sin(m);if(0!==d){var x=Math.cos(d),b=Math.sin(d),w=v-r,S=y-n;v=w*x-S*b+r,y=w*b+S*x+n}i.lineTo(v,y)}}(i,P,L,s,l,N,N+m((b-O)/s,(w-T)/l,(-b-O)/s,(-w-T)/l)%a,0===g,_)}},p=t[t.Types.canvas]=function(e){var i=!1!==e.smoothing;this.domElement=e.domElement||document.createElement("canvas"),this.ctx=this.domElement.getContext("2d"),this.overdraw=e.overdraw||!1,n.isUndefined(this.ctx.imageSmoothingEnabled)||(this.ctx.imageSmoothingEnabled=i),this.scene=new t.Group,this.scene.parent=this};function m(t,e,i,r){var n=t*i+e*r,s=f(t*t+e*e)*f(i*i+r*r),a=u(o(-1,l(1,n/s)));return t*r-e*i<0&&(a=-a),a}n.extend(p,{Utils:_}),n.extend(p.prototype,t.Utils.Events,{constructor:p,setSize:function(e,i,s){return this.width=e,this.height=i,this.ratio=n.isUndefined(s)?r(this.ctx):s,this.domElement.width=e*this.ratio,this.domElement.height=i*this.ratio,this.domElement.style&&n.extend(this.domElement.style,{width:e+"px",height:i+"px"}),this.trigger(t.Events.resize,e,i,s)},render:function(){var t=1===this.ratio;return t||(this.ctx.save(),this.ctx.scale(this.ratio,this.ratio)),this.overdraw||this.ctx.clearRect(0,0,this.width,this.height),_.group.render.call(this.scene,this.ctx),t||this.ctx.restore(),this}})}((void 0!==t?t:this||window).Two),function(t){var e=t.root,i=t.Matrix.Multiply,r=t.Utils.mod,n=[1,0,0,0,1,0,0,0,1],s=new t.Array(9),a=t.Utils.getRatio,o=(t.Utils.getComputedMatrix,t.Utils.toFixed),l=t[t.Types.canvas].Utils,h=t.Utils,c={isHidden:/(none|transparent)/i,canvas:e.document?e.document.createElement("canvas"):{getContext:h.identity},alignments:{left:"start",middle:"center",right:"end"},matrix:new t.Matrix,uv:new t.Array([0,0,1,0,0,1,0,1,1,0,1,1]),group:{removeChild:function(t,e){if(t.children)for(var i=0;i<t.children.length;i++)c.group.removeChild(t.children[i],e);else e.deleteTexture(t._renderer.texture),delete t._renderer.texture},renderChild:function(t){c[t._renderer.type].render.call(t,this.gl,this.program)},render:function(e,r){this._update();var n=this.parent,a=n._matrix&&n._matrix.manual||n._flagMatrix,o=this._matrix.manual||this._flagMatrix;if((a||o)&&(this._renderer.matrix||(this._renderer.matrix=new t.Array(9)),this._matrix.toArray(!0,s),i(s,n._renderer.matrix,this._renderer.matrix),this._renderer.scale=this._scale*n._renderer.scale,a&&(this._flagMatrix=!0)),this._mask&&(e.enable(e.STENCIL_TEST),e.stencilFunc(e.ALWAYS,1,1),e.colorMask(!1,!1,!1,!0),e.stencilOp(e.KEEP,e.KEEP,e.INCR),c[this._mask._renderer.type].render.call(this._mask,e,r,this),e.colorMask(!0,!0,!0,!0),e.stencilFunc(e.NOTEQUAL,0,1),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)),this._flagOpacity=n._flagOpacity||this._flagOpacity,this._renderer.opacity=this._opacity*(n&&n._renderer?n._renderer.opacity:1),this._flagSubtractions)for(var l=0;l<this.subtractions.length;l++)c.group.removeChild(this.subtractions[l],e);for(l=0;l<this.children.length;l++){var h=this.children[l];c[h._renderer.type].render.call(h,e,r)}return this.children.forEach(c.group.renderChild,{gl:e,program:r}),this._mask&&(e.colorMask(!1,!1,!1,!1),e.stencilOp(e.KEEP,e.KEEP,e.DECR),c[this._mask._renderer.type].render.call(this._mask,e,r,this),e.colorMask(!0,!0,!0,!0),e.stencilFunc(e.NOTEQUAL,0,1),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.disable(e.STENCIL_TEST)),this.flagReset()}},path:{updateCanvas:function(e){var i,n,s,a,d,u,f,g,_,p,m,v,y,x,b,w=e._renderer.vertices,S=this.canvas,A=this.ctx,C=e._renderer.scale,k=e._stroke,E=e._linewidth,R=e._fill,M=e._renderer.opacity||e._opacity,F=e._cap,O=e._join,T=e._miter,P=e._closed,L=e.dashes,N=w.length,U=N-1;S.width=Math.max(Math.ceil(e._renderer.rect.width*C),1),S.height=Math.max(Math.ceil(e._renderer.rect.height*C),1);var I,j=e._renderer.rect.centroid,D=j.x,B=j.y;A.clearRect(0,0,S.width,S.height),R&&(h.isString(R)?A.fillStyle=R:(c[R._renderer.type].render.call(R,A,e),A.fillStyle=R._renderer.effect)),k&&(h.isString(k)?A.strokeStyle=k:(c[k._renderer.type].render.call(k,A,e),A.strokeStyle=k._renderer.effect)),E&&(A.lineWidth=E),T&&(A.miterLimit=T),O&&(A.lineJoin=O),F&&(A.lineCap=F),h.isNumber(M)&&(A.globalAlpha=M),L&&L.length>0&&A.setLineDash(L),A.save(),A.scale(C,C),A.translate(D,B),A.beginPath();for(var V=0;V<w.length;V++){var G=w[V];switch(y=o(G.x),x=o(G.y),G.command){case t.Commands.close:A.closePath();break;case t.Commands.arc:var z=G.rx,q=G.ry,H=G.xAxisRotation,$=G.largeArcFlag,Y=G.sweepFlag;s=w[n=P?r(V-1,N):max(V-1,0)];var X=o(s.x),W=o(s.y);l.renderSvgArcCommand(A,X,W,z,q,$,Y,H,y,x);break;case t.Commands.curve:n=P?r(V-1,N):Math.max(V-1,0),i=P?r(V+1,N):Math.min(V+1,U),s=w[n],a=w[i],_=s.controls&&s.controls.right||t.Vector.zero,p=G.controls&&G.controls.left||t.Vector.zero,s._relative?(f=o(_.x+s.x),g=o(_.y+s.y)):(f=o(_.x),g=o(_.y)),G._relative?(d=o(p.x+G.x),u=o(p.y+G.y)):(d=o(p.x),u=o(p.y)),A.bezierCurveTo(f,g,d,u,y,x),V>=U&&P&&(a=I,m=G.controls&&G.controls.right||t.Vector.zero,v=a.controls&&a.controls.left||t.Vector.zero,G._relative?(f=o(m.x+G.x),g=o(m.y+G.y)):(f=o(m.x),g=o(m.y)),a._relative?(d=o(v.x+a.x),u=o(v.y+a.y)):(d=o(v.x),u=o(v.y)),y=o(a.x),x=o(a.y),A.bezierCurveTo(f,g,d,u,y,x));break;case t.Commands.line:A.lineTo(y,x);break;case t.Commands.move:I=G,A.moveTo(y,x)}}P&&A.closePath(),c.isHidden.test(R)||((b=R._renderer&&R._renderer.offset)&&(A.save(),A.translate(-R._renderer.offset.x,-R._renderer.offset.y),A.scale(R._renderer.scale.x,R._renderer.scale.y)),A.fill(),b&&A.restore()),c.isHidden.test(k)||((b=k._renderer&&k._renderer.offset)&&(A.save(),A.translate(-k._renderer.offset.x,-k._renderer.offset.y),A.scale(k._renderer.scale.x,k._renderer.scale.y),A.lineWidth=E/k._renderer.scale.x),A.stroke(),b&&A.restore()),A.restore()},getBoundingClientRect:function(t,e,i){var r,n,s=1/0,a=-1/0,o=1/0,l=-1/0;t.forEach(function(t){var e,i,r,n,h,c,d=t.x,u=t.y,f=t.controls;o=Math.min(u,o),s=Math.min(d,s),a=Math.max(d,a),l=Math.max(u,l),t.controls&&(h=f.left,c=f.right,h&&c&&(e=t._relative?h.x+d:h.x,i=t._relative?h.y+u:h.y,r=t._relative?c.x+d:c.x,n=t._relative?c.y+u:c.y,e&&i&&r&&n&&(o=Math.min(i,n,o),s=Math.min(e,r,s),a=Math.max(e,r,a),l=Math.max(i,n,l))))}),h.isNumber(e)&&(o-=e,s-=e,a+=e,l+=e),r=a-s,n=l-o,i.top=o,i.left=s,i.right=a,i.bottom=l,i.width=r,i.height=n,i.centroid||(i.centroid={}),i.centroid.x=-s,i.centroid.y=-o},render:function(e,r,n){if(!this._visible||!this._opacity)return this;this._update();var a=this.parent,o=a._matrix.manual||a._flagMatrix,l=this._matrix.manual||this._flagMatrix,d=this._flagVertices||this._flagFill||this._fill instanceof t.LinearGradient&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof t.RadialGradient&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof t.Texture&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof t.LinearGradient&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof t.RadialGradient&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof t.Texture&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||a._flagOpacity||this._flagVisible||this._flagCap||this._flagJoin||this._flagMiter||this._flagScale||this.dashes&&this.dashes.length>0||!this._renderer.texture;return(o||l)&&(this._renderer.matrix||(this._renderer.matrix=new t.Array(9)),this._matrix.toArray(!0,s),i(s,a._renderer.matrix,this._renderer.matrix),this._renderer.scale=this._scale*a._renderer.scale),d?(this._renderer.rect||(this._renderer.rect={}),this._renderer.triangles||(this._renderer.triangles=new t.Array(12)),this._renderer.opacity=this._opacity*a._renderer.opacity,c.path.getBoundingClientRect(this._renderer.vertices,this._linewidth,this._renderer.rect),c.getTriangles(this._renderer.rect,this._renderer.triangles),c.updateBuffer.call(c,e,this,r),c.updateTexture.call(c,e,this)):(h.isString(this._fill)||this._fill._update(),h.isString(this._stroke)||this._stroke._update()),!this._clip||n?(e.bindBuffer(e.ARRAY_BUFFER,this._renderer.textureCoordsBuffer),e.vertexAttribPointer(r.textureCoords,2,e.FLOAT,!1,0,0),e.bindTexture(e.TEXTURE_2D,this._renderer.texture),e.uniformMatrix3fv(r.matrix,!1,this._renderer.matrix),e.bindBuffer(e.ARRAY_BUFFER,this._renderer.buffer),e.vertexAttribPointer(r.position,2,e.FLOAT,!1,0,0),e.drawArrays(e.TRIANGLES,0,6),this.flagReset()):void 0}},text:{updateCanvas:function(t){var e=this.canvas,i=this.ctx,r=t._renderer.scale,n=t._stroke,s=t._linewidth*r,a=t._fill,l=t._renderer.opacity||t._opacity,d=t.dashes;e.width=Math.max(Math.ceil(t._renderer.rect.width*r),1),e.height=Math.max(Math.ceil(t._renderer.rect.height*r),1);var u,f,g,_,p,m,v,y=t._renderer.rect.centroid,x=y.x,b=y.y,w=a._renderer&&a._renderer.offset&&n._renderer&&n._renderer.offset;i.clearRect(0,0,e.width,e.height),w||(i.font=[t._style,t._weight,t._size+"px/"+t._leading+"px",t._family].join(" ")),i.textAlign="center",i.textBaseline="middle",a&&(h.isString(a)?i.fillStyle=a:(c[a._renderer.type].render.call(a,i,t),i.fillStyle=a._renderer.effect)),n&&(h.isString(n)?i.strokeStyle=n:(c[n._renderer.type].render.call(n,i,t),i.strokeStyle=n._renderer.effect)),s&&(i.lineWidth=s),h.isNumber(l)&&(i.globalAlpha=l),d&&d.length>0&&i.setLineDash(d),i.save(),i.scale(r,r),i.translate(x,b),c.isHidden.test(a)||(a._renderer&&a._renderer.offset?(m=o(a._renderer.scale.x),v=o(a._renderer.scale.y),i.save(),i.translate(-o(a._renderer.offset.x),-o(a._renderer.offset.y)),i.scale(m,v),u=t._size/a._renderer.scale.y,f=t._leading/a._renderer.scale.y,i.font=[t._style,t._weight,o(u)+"px/",o(f)+"px",t._family].join(" "),g=a._renderer.offset.x/a._renderer.scale.x,_=a._renderer.offset.y/a._renderer.scale.y,i.fillText(t.value,o(g),o(_)),i.restore()):i.fillText(t.value,0,0)),c.isHidden.test(n)||(n._renderer&&n._renderer.offset?(m=o(n._renderer.scale.x),v=o(n._renderer.scale.y),i.save(),i.translate(-o(n._renderer.offset.x),-o(n._renderer.offset.y)),i.scale(m,v),u=t._size/n._renderer.scale.y,f=t._leading/n._renderer.scale.y,i.font=[t._style,t._weight,o(u)+"px/",o(f)+"px",t._family].join(" "),g=n._renderer.offset.x/n._renderer.scale.x,_=n._renderer.offset.y/n._renderer.scale.y,p=s/n._renderer.scale.x,i.lineWidth=o(p),i.strokeText(t.value,o(g),o(_)),i.restore()):i.strokeText(t.value,0,0)),i.restore()},getBoundingClientRect:function(t,e){var i=c.ctx;i.font=[t._style,t._weight,t._size+"px/"+t._leading+"px",t._family].join(" "),i.textAlign="center",i.textBaseline=t._baseline;var r=i.measureText(t._value).width,n=Math.max(t._size||t._leading);this._linewidth&&!c.isHidden.test(this._stroke)&&(n+=this._linewidth);var s=r/2,a=n/2;switch(c.alignments[t._alignment]||t._alignment){case c.alignments.left:e.left=0,e.right=r;break;case c.alignments.right:e.left=-r,e.right=0;break;default:e.left=-s,e.right=s}switch(t._baseline){case"bottom":e.top=-n,e.bottom=0;break;case"top":e.top=0,e.bottom=n;break;default:e.top=-a,e.bottom=a}e.width=r,e.height=n,e.centroid||(e.centroid={}),e.centroid.x=s,e.centroid.y=a},render:function(e,r,n){if(!this._visible||!this._opacity)return this;this._update();var a=this.parent,o=a._matrix.manual||a._flagMatrix,l=this._matrix.manual||this._flagMatrix,d=this._flagVertices||this._flagFill||this._fill instanceof t.LinearGradient&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof t.RadialGradient&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof t.Texture&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof t.LinearGradient&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof t.RadialGradient&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof t.Texture&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||a._flagOpacity||this._flagVisible||this._flagScale||this._flagValue||this._flagFamily||this._flagSize||this._flagLeading||this._flagAlignment||this._flagBaseline||this._flagStyle||this._flagWeight||this._flagDecoration||this.dashes&&this.dashes.length>0||!this._renderer.texture;return(o||l)&&(this._renderer.matrix||(this._renderer.matrix=new t.Array(9)),this._matrix.toArray(!0,s),i(s,a._renderer.matrix,this._renderer.matrix),this._renderer.scale=this._scale*a._renderer.scale),d?(this._renderer.rect||(this._renderer.rect={}),this._renderer.triangles||(this._renderer.triangles=new t.Array(12)),this._renderer.opacity=this._opacity*a._renderer.opacity,c.text.getBoundingClientRect(this,this._renderer.rect),c.getTriangles(this._renderer.rect,this._renderer.triangles),c.updateBuffer.call(c,e,this,r),c.updateTexture.call(c,e,this)):(h.isString(this._fill)||this._fill._update(),h.isString(this._stroke)||this._stroke._update()),!this._clip||n?(e.bindBuffer(e.ARRAY_BUFFER,this._renderer.textureCoordsBuffer),e.vertexAttribPointer(r.textureCoords,2,e.FLOAT,!1,0,0),e.bindTexture(e.TEXTURE_2D,this._renderer.texture),e.uniformMatrix3fv(r.matrix,!1,this._renderer.matrix),e.bindBuffer(e.ARRAY_BUFFER,this._renderer.buffer),e.vertexAttribPointer(r.position,2,e.FLOAT,!1,0,0),e.drawArrays(e.TRIANGLES,0,6),this.flagReset()):void 0}},"linear-gradient":{render:function(t,e){if(t.canvas.getContext("2d")){if(this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops){this._renderer.effect=t.createLinearGradient(this.left._x,this.left._y,this.right._x,this.right._y);for(var i=0;i<this.stops.length;i++){var r=this.stops[i];this._renderer.effect.addColorStop(r._offset,r._color)}}return this.flagReset()}}},"radial-gradient":{render:function(t,e){if(t.canvas.getContext("2d")){if(this._update(),!this._renderer.effect||this._flagCenter||this._flagFocal||this._flagRadius||this._flagStops){this._renderer.effect=t.createRadialGradient(this.center._x,this.center._y,0,this.focal._x,this.focal._y,this._radius);for(var i=0;i<this.stops.length;i++){var r=this.stops[i];this._renderer.effect.addColorStop(r._offset,r._color)}}return this.flagReset()}}},texture:{render:function(e,i){if(e.canvas.getContext("2d")){this._update();var r=this.image;if((this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)this._renderer.effect=e.createPattern(r,this._repeat);else if(!this._renderer.effect)return this.flagReset();return(this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof t.Vector||(this._renderer.offset=new t.Vector),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,r&&(this._renderer.offset.x+=r.width/2,this._renderer.offset.y+=r.height/2,this._scale instanceof t.Vector?(this._renderer.offset.x*=this._scale.x,this._renderer.offset.y*=this._scale.y):(this._renderer.offset.x*=this._scale,this._renderer.offset.y*=this._scale))),(this._flagScale||this._flagLoaded)&&(this._renderer.scale instanceof t.Vector||(this._renderer.scale=new t.Vector),this._scale instanceof t.Vector?this._renderer.scale.copy(this._scale):this._renderer.scale.set(this._scale,this._scale)),this.flagReset()}}},getTriangles:function(t,e){var i=t.top,r=t.left,n=t.right,s=t.bottom;e[0]=r,e[1]=i,e[2]=n,e[3]=i,e[4]=r,e[5]=s,e[6]=r,e[7]=s,e[8]=n,e[9]=i,e[10]=n,e[11]=s},updateTexture:function(t,e){this[e._renderer.type].updateCanvas.call(c,e),e._renderer.texture&&t.deleteTexture(e._renderer.texture),t.bindBuffer(t.ARRAY_BUFFER,e._renderer.textureCoordsBuffer),e._renderer.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,e._renderer.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),this.canvas.width<=0||this.canvas.height<=0||t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,this.canvas)},updateBuffer:function(t,e,i){h.isObject(e._renderer.buffer)&&t.deleteBuffer(e._renderer.buffer),e._renderer.buffer=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,e._renderer.buffer),t.enableVertexAttribArray(i.position),t.bufferData(t.ARRAY_BUFFER,e._renderer.triangles,t.STATIC_DRAW),h.isObject(e._renderer.textureCoordsBuffer)&&t.deleteBuffer(e._renderer.textureCoordsBuffer),e._renderer.textureCoordsBuffer=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,e._renderer.textureCoordsBuffer),t.enableVertexAttribArray(i.textureCoords),t.bufferData(t.ARRAY_BUFFER,this.uv,t.STATIC_DRAW)},program:{create:function(e,i){var r,n;if(r=e.createProgram(),h.each(i,function(t){e.attachShader(r,t)}),e.linkProgram(r),!e.getProgramParameter(r,e.LINK_STATUS))throw n=e.getProgramInfoLog(r),e.deleteProgram(r),new t.Utils.Error("unable to link program: "+n);return r}},shaders:{create:function(e,i,r){var n,s;if(n=e.createShader(e[r]),e.shaderSource(n,i),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))throw s=e.getShaderInfoLog(n),e.deleteShader(n),new t.Utils.Error("unable to compile shader "+n+": "+s);return n},types:{vertex:"VERTEX_SHADER",fragment:"FRAGMENT_SHADER"},vertex:["attribute vec2 a_position;","attribute vec2 a_textureCoords;","","uniform mat3 u_matrix;","uniform vec2 u_resolution;","","varying vec2 v_textureCoords;","","void main() {"," vec2 projected = (u_matrix * vec3(a_position, 1.0)).xy;"," vec2 normal = projected / u_resolution;"," vec2 clipspace = (normal * 2.0) - 1.0;",""," gl_Position = vec4(clipspace * vec2(1.0, -1.0), 0.0, 1.0);"," v_textureCoords = a_textureCoords;","}"].join("\n"),fragment:["precision mediump float;","","uniform sampler2D u_image;","varying vec2 v_textureCoords;","","void main() {"," gl_FragColor = texture2D(u_image, v_textureCoords);","}"].join("\n")},TextureRegistry:new t.Registry};c.ctx=c.canvas.getContext("2d");var d=t[t.Types.webgl]=function(e){var i,r,s,a;if(this.domElement=e.domElement||document.createElement("canvas"),this.scene=new t.Group,this.scene.parent=this,this._renderer={matrix:new t.Array(n),scale:1,opacity:1},this._flagMatrix=!0,i=h.defaults(e||{},{antialias:!1,alpha:!0,premultipliedAlpha:!0,stencil:!0,preserveDrawingBuffer:!0,overdraw:!1}),this.overdraw=i.overdraw,r=this.ctx=this.domElement.getContext("webgl",i)||this.domElement.getContext("experimental-webgl",i),!this.ctx)throw new t.Utils.Error("unable to create a webgl context. Try using another renderer.");s=c.shaders.create(r,c.shaders.vertex,c.shaders.types.vertex),a=c.shaders.create(r,c.shaders.fragment,c.shaders.types.fragment),this.program=c.program.create(r,[s,a]),r.useProgram(this.program),this.program.position=r.getAttribLocation(this.program,"a_position"),this.program.matrix=r.getUniformLocation(this.program,"u_matrix"),this.program.textureCoords=r.getAttribLocation(this.program,"a_textureCoords"),r.disable(r.DEPTH_TEST),r.enable(r.BLEND),r.blendEquationSeparate(r.FUNC_ADD,r.FUNC_ADD),r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA)};h.extend(d,{Utils:c}),h.extend(d.prototype,t.Utils.Events,{constructor:d,setSize:function(e,i,r){this.width=e,this.height=i,this.ratio=h.isUndefined(r)?a(this.ctx):r,this.domElement.width=e*this.ratio,this.domElement.height=i*this.ratio,h.extend(this.domElement.style,{width:e+"px",height:i+"px"}),e*=this.ratio,i*=this.ratio,this._renderer.matrix[0]=this._renderer.matrix[4]=this._renderer.scale=this.ratio,this._flagMatrix=!0,this.ctx.viewport(0,0,e,i);var n=this.ctx.getUniformLocation(this.program,"u_resolution");return this.ctx.uniform2f(n,e,i),this.trigger(t.Events.resize,e,i,r)},render:function(){var t=this.ctx;return this.overdraw||t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),c.group.render.call(this.scene,t,this.program),this._flagMatrix=!1,this}})}((void 0!==t?t:this||window).Two),function(t){var e=t.Utils,i=t.Shape=function(){this._renderer={},this._renderer.flagMatrix=e.bind(i.FlagMatrix,this),this.isShape=!0,this.id=t.Identifier+t.uniqueId(),this.classList=[],this._matrix=new t.Matrix,this.translation=new t.Vector,this.rotation=0,this.scale=1};e.extend(i,{FlagMatrix:function(){this._flagMatrix=!0},MakeObservable:function(e){Object.defineProperty(e,"translation",{enumerable:!0,get:function(){return this._translation},set:function(e){this._translation&&this._translation.unbind(t.Events.change,this._renderer.flagMatrix),this._translation=e,this._translation.bind(t.Events.change,this._renderer.flagMatrix),i.FlagMatrix.call(this)}}),Object.defineProperty(e,"rotation",{enumerable:!0,get:function(){return this._rotation},set:function(t){this._rotation=t,this._flagMatrix=!0}}),Object.defineProperty(e,"scale",{enumerable:!0,get:function(){return this._scale},set:function(e){this._scale instanceof t.Vector&&this._scale.unbind(t.Events.change,this._renderer.flagMatrix),this._scale=e,this._scale instanceof t.Vector&&this._scale.bind(t.Events.change,this._renderer.flagMatrix),this._flagMatrix=!0,this._flagScale=!0}})}}),e.extend(i.prototype,t.Utils.Events,{_flagMatrix:!0,_flagScale:!1,_translation:null,_rotation:0,_scale:1,constructor:i,addTo:function(t){return t.add(this),this},clone:function(t){var e=new i;return e.translation.copy(this.translation),e.rotation=this.rotation,e.scale=this.scale,t&&t.add(e),e._update()},_update:function(e){return!this._matrix.manual&&this._flagMatrix&&(this._matrix.identity().translate(this.translation.x,this.translation.y),this._scale instanceof t.Vector?this._matrix.scale(this._scale.x,this._scale.y):this._matrix.scale(this._scale),this._matrix.rotate(this.rotation)),e&&this.parent&&this.parent._update&&this.parent._update(),this},flagReset:function(){return this._flagMatrix=this._flagScale=!1,this}}),i.MakeObservable(i.prototype)}((void 0!==t?t:this||window).Two),function(t){var e=Math.min,i=Math.max,r=(Math.round,Math.ceil),n=Math.floor,s=t.Utils.getComputedMatrix,a={},o=t.Utils;o.each(t.Commands,function(t,e){a[e]=new RegExp(t)});var l=t.Path=function(e,i,r,n){t.Shape.call(this),this._renderer.type="path",this._renderer.flagVertices=o.bind(l.FlagVertices,this),this._renderer.bindVertices=o.bind(l.BindVertices,this),this._renderer.unbindVertices=o.bind(l.UnbindVertices,this),this._renderer.flagFill=o.bind(l.FlagFill,this),this._renderer.flagStroke=o.bind(l.FlagStroke,this),this._renderer.vertices=[],this._renderer.collection=[],this._closed=!!i,this._curved=!!r,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.cap="butt",this.join="miter",this.miter=4,this.vertices=e,this.automatic=!n,this.dashes=[]};function h(t,e){if(0===e||1===e)return!0;for(var i=t._length*e,r=0,n=0;n<t._lengths.length;n++){var s=t._lengths[n];if(r>=i)return i-r>=0;r+=s}return!1}function c(t,e){var i=t._length;if(e<=0)return 0;if(e>=i)return t._lengths.length-1;for(var r=0,n=0;r<t._lengths.length;r++){if(n+t._lengths[r]>=e)return e-=n,Math.max(r-1,0)+e/t._lengths[r];n+=t._lengths[r]}return-1}function d(e,i,r){var n,s,a,o,l,h,c,d,u=i.controls&&i.controls.right,f=e.controls&&e.controls.left;return n=i.x,l=i.y,s=(u||i).x,h=(u||i).y,a=(f||e).x,c=(f||e).y,o=e.x,d=e.y,u&&i._relative&&(s+=i.x,h+=i.y),f&&e._relative&&(a+=e.x,c+=e.y),t.Utils.getCurveLength(n,l,s,h,a,c,o,d,r)}function u(e,i,r){var n,s,a,o,l,h,c,d,u=i.controls&&i.controls.right,f=e.controls&&e.controls.left;return n=i.x,l=i.y,s=(u||i).x,h=(u||i).y,a=(f||e).x,c=(f||e).y,o=e.x,d=e.y,u&&i._relative&&(s+=i.x,h+=i.y),f&&e._relative&&(a+=e.x,c+=e.y),t.Utils.subdivide(n,l,s,h,a,c,o,d,r)}o.extend(l,{Properties:["fill","stroke","linewidth","opacity","className","visible","cap","join","miter","closed","curved","automatic","beginning","ending"],Utils:{getCurveLength:d},FlagVertices:function(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)},BindVertices:function(e){for(var i=e.length;i--;)e[i].bind(t.Events.change,this._renderer.flagVertices);this._renderer.flagVertices()},UnbindVertices:function(e){for(var i=e.length;i--;)e[i].unbind(t.Events.change,this._renderer.flagVertices);this._renderer.flagVertices()},FlagFill:function(){this._flagFill=!0},FlagStroke:function(){this._flagStroke=!0},MakeObservable:function(e){t.Shape.MakeObservable(e),o.each(l.Properties.slice(2,9),t.Utils.defineProperty,e),Object.defineProperty(e,"fill",{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof t.Gradient||this._fill instanceof t.LinearGradient||this._fill instanceof t.RadialGradient||this._fill instanceof t.Texture)&&this._fill.unbind(t.Events.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof t.Gradient||this._fill instanceof t.LinearGradient||this._fill instanceof t.RadialGradient||this._fill instanceof t.Texture)&&this._fill.bind(t.Events.change,this._renderer.flagFill)}}),Object.defineProperty(e,"stroke",{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof t.Gradient||this._stroke instanceof t.LinearGradient||this._stroke instanceof t.RadialGradient||this._stroke instanceof t.Texture)&&this._stroke.unbind(t.Events.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof t.Gradient||this._stroke instanceof t.LinearGradient||this._stroke instanceof t.RadialGradient||this._stroke instanceof t.Texture)&&this._stroke.bind(t.Events.change,this._renderer.flagStroke)}}),Object.defineProperty(e,"length",{get:function(){return this._flagLength&&this._updateLength(),this._length}}),Object.defineProperty(e,"closed",{enumerable:!0,get:function(){return this._closed},set:function(t){this._closed=!!t,this._flagVertices=!0}}),Object.defineProperty(e,"curved",{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=!!t,this._flagVertices=!0}}),Object.defineProperty(e,"automatic",{enumerable:!0,get:function(){return this._automatic},set:function(t){if(t!==this._automatic){this._automatic=!!t;var e=this._automatic?"ignore":"listen";o.each(this.vertices,function(t){t[e]()})}}}),Object.defineProperty(e,"beginning",{enumerable:!0,get:function(){return this._beginning},set:function(t){this._beginning=t,this._flagVertices=!0}}),Object.defineProperty(e,"ending",{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}}),Object.defineProperty(e,"vertices",{enumerable:!0,get:function(){return this._collection},set:function(e){this._renderer.flagVertices;var i=this._renderer.bindVertices,r=this._renderer.unbindVertices;this._collection&&this._collection.unbind(t.Events.insert,i).unbind(t.Events.remove,r),e instanceof t.Utils.Collection?this._collection=e:this._collection=new t.Utils.Collection(e||[]),this._collection.bind(t.Events.insert,i).bind(t.Events.remove,r),i(this._collection)}}),Object.defineProperty(e,"clip",{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}})}}),o.extend(l.prototype,t.Shape.prototype,{_flagVertices:!0,_flagLength:!0,_flagFill:!0,_flagStroke:!0,_flagLinewidth:!0,_flagOpacity:!0,_flagVisible:!0,_flagClassName:!0,_flagCap:!0,_flagJoin:!0,_flagMiter:!0,_flagClip:!1,_length:0,_fill:"#fff",_stroke:"#000",_linewidth:1,_opacity:1,_className:"",_visible:!0,_cap:"round",_join:"round",_miter:4,_closed:!0,_curved:!1,_automatic:!0,_beginning:0,_ending:1,_clip:!1,constructor:l,clone:function(t){var e=new l;e.vertices=this.vertices;for(var i=0;i<l.Properties.length;i++){var r=l.Properties[i];e[r]=this[r]}return e.translation.copy(this.translation),e.rotation=this.rotation,e.scale=this.scale,t&&t.add(e),e._update()},toObject:function(){var e={vertices:o.map(this.vertices,function(t){return t.toObject()})};return o.each(t.Shape.Properties,function(t){e[t]=this[t]},this),e.translation=this.translation.toObject(),e.rotation=this.rotation,e.scale=this.scale instanceof t.Vector?this.scale.toObject():this.scale,e},noFill:function(){return this.fill="transparent",this},noStroke:function(){return this.stroke="transparent",this},corner:function(){var t=this.getBoundingClientRect(!0);return t.centroid={x:t.left+t.width/2,y:t.top+t.height/2},o.each(this.vertices,function(e){e.addSelf(t.centroid)}),this},center:function(){var t=this.getBoundingClientRect(!0);return t.centroid={x:t.left+t.width/2,y:t.top+t.height/2},o.each(this.vertices,function(e){e.subSelf(t.centroid)}),this},remove:function(){return this.parent?(this.parent.remove(this),this):this},getBoundingClientRect:function(r){var n,a,o,l,h,c,d,u,f=1/0,g=-1/0,_=1/0,p=-1/0;if(this._update(!0),n=r?this._matrix:s(this),a=this.linewidth/2,(o=this._renderer.vertices.length)<=0)return v=n.multiply(0,0,1),{top:v.y,left:v.x,right:v.x,bottom:v.y,width:0,height:0};for(l=1;l<o;l++)if(u=this._renderer.vertices[l],(h=this._renderer.vertices[l-1]).controls&&u.controls){c=h.relative?n.multiply(h.controls.right.x+h.x,h.controls.right.y+h.y,1):n.multiply(h.controls.right.x,h.controls.right.y,1),h=n.multiply(h.x,h.y,1),d=u.relative?n.multiply(u.controls.left.x+u.x,u.controls.left.y+u.y,1):n.multiply(u.controls.left.x,u.controls.left.y,1),u=n.multiply(u.x,u.y,1);var m=t.Utils.getCurveBoundingBox(h.x,h.y,c.x,c.y,d.x,d.y,u.x,u.y);_=e(m.min.y-a,_),f=e(m.min.x-a,f),g=i(m.max.x+a,g),p=i(m.max.y+a,p)}else l<=1&&(h=n.multiply(h.x,h.y,1),_=e(h.y-a,_),f=e(h.x-a,f),g=i(h.x+a,g),p=i(h.y+a,p)),u=n.multiply(u.x,u.y,1),_=e(u.y-a,_),f=e(u.x-a,f),g=i(u.x+a,g),p=i(u.y+a,p);return{top:_,left:f,right:g,bottom:p,width:g-f,height:p-_}},getPointAt:function(e,i){for(var r,n,s,a,l,h,c,d,u,f,g,_,p,m,v,y=this.length*Math.min(Math.max(e,0),1),x=this.vertices.length,b=x-1,w=null,S=null,A=0,C=this._lengths.length,k=0;A<C;A++){if(k+this._lengths[A]>=y){this._closed?(r=t.Utils.mod(A,x),n=t.Utils.mod(A-1,x),0===A&&(r=n,n=A)):(r=A,n=Math.min(Math.max(A-1,0),b)),w=this.vertices[r],S=this.vertices[n],y-=k,e=0!==this._lengths[A]?y/this._lengths[A]:0;break}k+=this._lengths[A]}if(o.isNull(w)||o.isNull(S))return null;if(!w)return S;if(!S)return w;v=S.controls&&S.controls.right,m=w.controls&&w.controls.left,l=S.x,f=S.y,h=(v||S).x,g=(v||S).y,c=(m||w).x,_=(m||w).y,d=w.x,p=w.y,v&&S.relative&&(h+=S.x,g+=S.y),m&&w.relative&&(c+=w.x,_+=w.y),a=t.Utils.getComponentOnCubicBezier(e,l,h,c,d),u=t.Utils.getComponentOnCubicBezier(e,f,g,_,p);var E=t.Utils.lerp(l,h,e),R=t.Utils.lerp(f,g,e),M=t.Utils.lerp(h,c,e),F=t.Utils.lerp(g,_,e),O=t.Utils.lerp(c,d,e),T=t.Utils.lerp(_,p,e),P=t.Utils.lerp(E,M,e),L=t.Utils.lerp(R,F,e),N=t.Utils.lerp(M,O,e),U=t.Utils.lerp(F,T,e);return o.isObject(i)?(i.x=a,i.y=u,o.isObject(i.controls)||t.Anchor.AppendCurveProperties(i),i.controls.left.x=P,i.controls.left.y=L,i.controls.right.x=N,i.controls.right.y=U,o.isBoolean(i.relative)&&!i.relative||(i.controls.left.x-=a,i.controls.left.y-=u,i.controls.right.x-=a,i.controls.right.y-=u),i.t=e,i):((s=new t.Anchor(a,u,P-a,L-u,N-a,U-u,this._curved?t.Commands.curve:t.Commands.line)).t=e,s)},plot:function(){if(this.curved)return t.Utils.getCurveFromPoints(this._collection,this.closed),this;for(var e=0;e<this._collection.length;e++)this._collection[e].command=0===e?t.Commands.move:t.Commands.line;return this},subdivide:function(e){this._update();var i=this.vertices.length-1,r=this.vertices[i],n=this._closed||this.vertices[i]._command===t.Commands.close,s=[];return o.each(this.vertices,function(a,l){if(l<=0&&!n)r=a;else{if(a.command===t.Commands.move)return s.push(new t.Anchor(r.x,r.y)),l>0&&(s[s.length-1].command=t.Commands.line),void(r=a);var h=u(a,r,e);s=s.concat(h),o.each(h,function(e,i){i<=0&&r.command===t.Commands.move?e.command=t.Commands.move:e.command=t.Commands.line}),l>=i&&(this._closed&&this._automatic?(h=u(a,r=a,e),s=s.concat(h),o.each(h,function(e,i){i<=0&&r.command===t.Commands.move?e.command=t.Commands.move:e.command=t.Commands.line})):n&&s.push(new t.Anchor(a.x,a.y)),s[s.length-1].command=n?t.Commands.close:t.Commands.line),r=a}},this),this._automatic=!1,this._curved=!1,this.vertices=s,this},_updateLength:function(e,i){i||this._update();var r=this.vertices.length,n=r-1,s=this.vertices[n],a=0;return o.isUndefined(this._lengths)&&(this._lengths=[]),o.each(this.vertices,function(i,r){if(r<=0||i.command===t.Commands.move)return s=i,void(this._lengths[r]=0);this._lengths[r]=d(i,s,e),this._lengths[r]=t.Utils.toFixed(this._lengths[r]),a+=this._lengths[r],s=i},this),this._length=a,this._flagLength=!1,this},_update:function(){if(this._flagVertices){this._automatic&&this.plot(),this._flagLength&&this._updateLength(void 0,!0);var e,i,s,a,o,l=this._collection.length,d=this._closed,u=Math.min(this._beginning,this._ending),f=Math.max(this._beginning,this._ending),g=c(this,u*this._length),_=c(this,f*this._length),p=r(g),m=n(_);this._renderer.vertices.length=0;for(var v=0;v<l;v++)this._renderer.collection.length<=v&&this._renderer.collection.push(new t.Anchor),v>m&&!i?((o=this._renderer.collection[v]).copy(this._collection[v]),this.getPointAt(f,o),o.command=this._renderer.collection[v].command,this._renderer.vertices.push(o),i=o,(s=this._collection[v-1])&&s.controls&&(o.controls.right.clear(),this._renderer.collection[v-1].controls.right.clear().lerp(s.controls.right,o.t))):v>=p&&v<=m&&(o=this._renderer.collection[v].copy(this._collection[v]),this._renderer.vertices.push(o),v===m&&h(this,f)?(i=o,!d&&i.controls&&i.controls.right.clear()):v===p&&h(this,u)&&((e=o).command=t.Commands.move,!d&&e.controls&&e.controls.left.clear()));p>0&&!e&&(v=p-1,(o=this._renderer.collection[v]).copy(this._collection[v]),this.getPointAt(u,o),o.command=t.Commands.move,this._renderer.vertices.unshift(o),e=o,(a=this._collection[v+1])&&a.controls&&(o.controls.left.clear(),this._renderer.collection[v+1].controls.left.copy(a.controls.left).lerp(t.Vector.zero,o.t)))}return t.Shape.prototype._update.apply(this,arguments),this},flagReset:function(){return this._flagVertices=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagCap=this._flagJoin=this._flagMiter=this._flagClassName=this._flagClip=!1,t.Shape.prototype.flagReset.call(this),this}}),l.MakeObservable(l.prototype)}((void 0!==t?t:this||window).Two),function(t){var e=t.Path,i=t.Utils,r=t.Line=function(i,r,n,s){e.call(this,[new t.Anchor(i,r),new t.Anchor(n,s)]),this.vertices[0].command=t.Commands.move,this.vertices[1].command=t.Commands.line,this.automatic=!1};i.extend(r.prototype,e.prototype),r.prototype.constructor=r,e.MakeObservable(r.prototype)}((void 0!==t?t:this||window).Two),function(t){var e=t.Path,i=t.Utils,r=t.Rectangle=function(i,r,n,s){e.call(this,[new t.Anchor,new t.Anchor,new t.Anchor,new t.Anchor],!0,!1,!0),this.width=n,this.height=s,this.origin=new t.Vector,this.translation.set(i,r),this._update()};i.extend(r,{Properties:["width","height"],MakeObservable:function(n){e.MakeObservable(n),i.each(r.Properties,t.Utils.defineProperty,n),Object.defineProperty(n,"origin",{enumerable:!0,get:function(){return this._origin},set:function(e){this._origin&&this._origin.unbind(t.Events.change,this._renderer.flagVertices),this._origin=e,this._origin.bind(t.Events.change,this._renderer.flagVertices),this._renderer.flagVertices()}})}}),i.extend(r.prototype,e.prototype,{_width:0,_height:0,_flagWidth:0,_flagHeight:0,_origin:null,constructor:r,_update:function(){if(this._flagWidth||this._flagHeight){var i=this._width/2,r=this._height/2;this.vertices[0].set(-i,-r).add(this._origin).command=t.Commands.move,this.vertices[1].set(i,-r).add(this._origin).command=t.Commands.line,this.vertices[2].set(i,r).add(this._origin).command=t.Commands.line,this.vertices[3].set(-i,r).add(this._origin).command=t.Commands.line,this.vertices[4]&&(this.vertices[4].set(-i,-r).add(this._origin).command=t.Commands.line)}return e.prototype._update.call(this),this},flagReset:function(){return this._flagWidth=this._flagHeight=!1,e.prototype.flagReset.call(this),this},clone:function(e){var n=new r(0,0,this.width,this.height);return n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,i.each(t.Path.Properties,function(t){n[t]=this[t]},this),e&&e.add(n),n}}),r.MakeObservable(r.prototype)}((void 0!==t?t:this||window).Two),function(t){var e=t.Path,i=2*Math.PI,r=Math.PI/2,n=Math.cos,s=Math.sin,a=t.Utils,o=4/3*Math.tan(Math.PI/8),l=t.Ellipse=function(i,r,n,s,o){a.isNumber(s)||(s=n);var l=o||5,h=a.map(a.range(l),function(e){return new t.Anchor},this);e.call(this,h,!0,!0,!0),this.width=2*n,this.height=2*s,this._update(),this.translation.set(i,r)};a.extend(l,{Properties:["width","height"],MakeObservable:function(i){e.MakeObservable(i),a.each(l.Properties,t.Utils.defineProperty,i)}}),a.extend(l.prototype,e.prototype,{_width:0,_height:0,_flagWidth:!1,_flagHeight:!1,constructor:l,_update:function(){if(this._flagWidth||this._flagHeight)for(var a=0,l=this.vertices.length,h=l-1;a<l;a++){var c=a/h*i,d=this._width/2,u=this._height/2,f=(n(c),s(c),d*n(c)),g=u*s(c),_=0===a?0:d*o*n(c-r),p=0===a?0:u*o*s(c-r),m=(d=a===h?0:d*o*n(c+r),u=a===h?0:u*o*s(c+r),this.vertices[a]);m.command=0===a?t.Commands.move:t.Commands.curve,m.set(f,g),m.controls.left.set(_,p),m.controls.right.set(d,u)}return e.prototype._update.call(this),this},flagReset:function(){return this._flagWidth=this._flagHeight=!1,e.prototype.flagReset.call(this),this},clone:function(e){var i=this.width/2,r=this.height/2,n=this.vertices.length,s=new l(0,0,i,r,n);return s.translation.copy(this.translation),s.rotation=this.rotation,s.scale=this.scale,a.each(t.Path.Properties,function(t){s[t]=this[t]},this),e&&e.add(s),s}}),l.MakeObservable(l.prototype)}((void 0!==t?t:this||window).Two),function(t){var e=t.Path,i=2*Math.PI,r=Math.PI/2,n=Math.cos,s=Math.sin,a=t.Utils,o=4/3*Math.tan(Math.PI/8),l=t.Circle=function(i,r,n,s){var o=s||5,l=a.map(a.range(o),function(e){return new t.Anchor},this);e.call(this,l,!0,!0,!0),this.radius=n,this._update(),this.translation.set(i,r)};a.extend(l,{Properties:["radius"],MakeObservable:function(i){e.MakeObservable(i),a.each(l.Properties,t.Utils.defineProperty,i)}}),a.extend(l.prototype,e.prototype,{_radius:0,_flagRadius:!1,constructor:l,_update:function(){if(this._flagRadius)for(var a=0,l=this.vertices.length,h=l-1;a<l;a++){var c=a/h*i,d=this._radius,u=(n(c),s(c),d*o),f=d*n(c),g=d*s(c),_=0===a?0:u*n(c-r),p=0===a?0:u*s(c-r),m=a===h?0:u*n(c+r),v=a===h?0:u*s(c+r),y=this.vertices[a];y.command=0===a?t.Commands.move:t.Commands.curve,y.set(f,g),y.controls.left.set(_,p),y.controls.right.set(m,v)}return e.prototype._update.call(this),this},flagReset:function(){return this._flagRadius=!1,e.prototype.flagReset.call(this),this},clone:function(e){var i=new l(0,0,this.radius,this.vertices.length);return i.translation.copy(this.translation),i.rotation=this.rotation,i.scale=this.scale,a.each(t.Path.Properties,function(t){i[t]=this[t]},this),e&&e.add(i),i}}),l.MakeObservable(l.prototype)}((void 0!==t?t:this||window).Two),function(t){var e=t.Path,i=2*Math.PI,r=Math.cos,n=Math.sin,s=t.Utils,a=t.Polygon=function(t,i,r,n){n=Math.max(n||0,3),e.call(this),this.closed=!0,this.automatic=!1,this.width=2*r,this.height=2*r,this.sides=n,this._update(),this.translation.set(t,i)};s.extend(a,{Properties:["width","height","sides"],MakeObservable:function(i){e.MakeObservable(i),s.each(a.Properties,t.Utils.defineProperty,i)}}),s.extend(a.prototype,e.prototype,{_width:0,_height:0,_sides:0,_flagWidth:!1,_flagHeight:!1,_flagSides:!1,constructor:a,_update:function(){if(this._flagWidth||this._flagHeight||this._flagSides){var s=this._sides,a=s+1,o=this.vertices.length;o>s&&(this.vertices.splice(s-1,o-s),o=s);for(var l=0;l<a;l++){var h=i*((l+.5)/s)+Math.PI/2,c=this._width*r(h)/2,d=this._height*n(h)/2;l>=o?this.vertices.push(new t.Anchor(c,d)):this.vertices[l].set(c,d),this.vertices[l].command=0===l?t.Commands.move:t.Commands.line}}return e.prototype._update.call(this),this},flagReset:function(){return this._flagWidth=this._flagHeight=this._flagSides=!1,e.prototype.flagReset.call(this),this},clone:function(e){var i=new a(0,0,this.radius,this.sides);return i.translation.copy(this.translation),i.rotation=this.rotation,i.scale=this.scale,s.each(t.Path.Properties,function(t){i[t]=this[t]},this),e&&e.add(i),i}}),a.MakeObservable(a.prototype)}((void 0!==t?t:this||window).Two),function(t){var e=t.Path,i=(Math.PI,2*Math.PI),r=Math.PI/2,n=(Math.cos,Math.sin,Math.abs,t.Utils),s=t.ArcSegment=function(i,r,s,a,o,l,h){var c=h||3*t.Resolution,d=n.map(n.range(c),function(){return new t.Anchor});e.call(this,d,!0,!1,!0),this.innerRadius=s,this.outerRadius=a,this.startAngle=o,this.endAngle=l,this._update(),this.translation.set(i,r)};function a(t,e){for(;t<0;)t+=e;return t%e}n.extend(s,{Properties:["startAngle","endAngle","innerRadius","outerRadius"],MakeObservable:function(i){e.MakeObservable(i),n.each(s.Properties,t.Utils.defineProperty,i)}}),n.extend(s.prototype,e.prototype,{_flagStartAngle:!1,_flagEndAngle:!1,_flagInnerRadius:!1,_flagOuterRadius:!1,_startAngle:0,_endAngle:i,_innerRadius:0,_outerRadius:0,constructor:s,_update:function(){if(this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){var n,s=this._startAngle,o=this._endAngle,l=this._innerRadius,h=this._outerRadius,c=a(s,i)===a(o,i),d=l>0,u=this.vertices,f=d?u.length/2:u.length,g=0;c?f--:d||(f-=2);for(var _=0,p=f-1;_<f;_++){var m=_/p,v=u[g],y=m*(o-s)+s,x=(o-s)/f,b=h*Math.cos(y),w=h*Math.sin(y);switch(_){case 0:n=t.Commands.move;break;default:n=t.Commands.curve}if(v.command=n,v.x=b,v.y=w,v.controls.left.clear(),v.controls.right.clear(),v.command===t.Commands.curve){var S=h*x/Math.PI;v.controls.left.x=S*Math.cos(y-r),v.controls.left.y=S*Math.sin(y-r),v.controls.right.x=S*Math.cos(y+r),v.controls.right.y=S*Math.sin(y+r),1===_&&v.controls.left.multiplyScalar(2),_===p&&v.controls.right.multiplyScalar(2)}g++}if(d){for(c?(u[g].command=t.Commands.close,g++):p=--f-1,_=0;_<f;_++)m=_/p,v=u[g],y=(1-m)*(o-s)+s,x=(o-s)/f,b=l*Math.cos(y),w=l*Math.sin(y),n=t.Commands.curve,_<=0&&(n=c?t.Commands.move:t.Commands.line),v.command=n,v.x=b,v.y=w,v.controls.left.clear(),v.controls.right.clear(),v.command===t.Commands.curve&&(S=l*x/Math.PI,v.controls.left.x=S*Math.cos(y+r),v.controls.left.y=S*Math.sin(y+r),v.controls.right.x=S*Math.cos(y-r),v.controls.right.y=S*Math.sin(y-r),1===_&&v.controls.left.multiplyScalar(2),_===p&&v.controls.right.multiplyScalar(2)),g++;u[g].copy(u[0]),u[g].command=t.Commands.line}else c||(u[g].command=t.Commands.line,u[g].x=0,u[g].y=0,u[++g].copy(u[0]),u[g].command=t.Commands.line)}return e.prototype._update.call(this),this},flagReset:function(){return e.prototype.flagReset.call(this),this._flagStartAngle=this._flagEndAngle=this._flagInnerRadius=this._flagOuterRadius=!1,this},clone:function(e){var i=this.innerRadius,r=this.outerradius,a=this.startAngle,o=this.endAngle,l=this.vertices.length,h=new s(0,0,i,r,a,o,l);return h.translation.copy(this.translation),h.rotation=this.rotation,h.scale=this.scale,n.each(t.Path.Properties,function(t){h[t]=this[t]},this),e&&e.add(h),h}}),s.MakeObservable(s.prototype)}((void 0!==t?t:this||window).Two),function(t){var e=t.Path,i=2*Math.PI,r=Math.cos,n=Math.sin,s=t.Utils,a=t.Star=function(t,i,r,n,a){arguments.length<=3&&(r=(n=r)/2),(!s.isNumber(a)||a<=0)&&(a=5);e.call(this),this.closed=!0,this.automatic=!1,this.innerRadius=r,this.outerRadius=n,this.sides=a,this._update(),this.translation.set(t,i)};s.extend(a,{Properties:["innerRadius","outerRadius","sides"],MakeObservable:function(i){e.MakeObservable(i),s.each(a.Properties,t.Utils.defineProperty,i)}}),s.extend(a.prototype,e.prototype,{_innerRadius:0,_outerRadius:0,_sides:0,_flagInnerRadius:!1,_flagOuterRadius:!1,_flagSides:!1,constructor:a,_update:function(){if(this._flagInnerRadius||this._flagOuterRadius||this._flagSides){var s=2*this._sides,a=s+1,o=this.vertices.length;o>s&&(this.vertices.splice(s-1,o-s),o=s);for(var l=0;l<a;l++){var h=i*((l+.5)/s),c=(l%2?this._outerRadius:this._innerRadius)/2,d=c*r(h),u=c*n(h);l>=o?this.vertices.push(new t.Anchor(d,u)):this.vertices[l].set(d,u),this.vertices[l].command=0===l?t.Commands.move:t.Commands.line}}return e.prototype._update.call(this),this},flagReset:function(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,e.prototype.flagReset.call(this),this},clone:function(e){var i=this.innerRadius,r=this.outerRadius,n=this.sides,o=new a(0,0,i,r,n);return o.translation.copy(this.translation),o.rotation=this.rotation,o.scale=this.scale,s.each(t.Path.Properties,function(t){o[t]=this[t]},this),e&&e.add(o),o}}),a.MakeObservable(a.prototype)}((void 0!==t?t:this||window).Two),function(t){var e=t.Path,i=t.Utils,r=t.RoundedRectangle=function(n,s,a,o,l){i.isUndefined(l)&&(l=Math.floor(Math.min(a,o)/12));var h=i.map(i.range(10),function(e){return new t.Anchor(0,0,0,0,0,0,0===e?t.Commands.move:t.Commands.curve)});e.call(this,h),this.closed=!0,this.automatic=!1,this._renderer.flagRadius=i.bind(r.FlagRadius,this),this.width=a,this.height=o,this.radius=l,this._update(),this.translation.set(n,s)};i.extend(r,{Properties:["width","height"],FlagRadius:function(){this._flagRadius=!0},MakeObservable:function(n){e.MakeObservable(n),i.each(r.Properties,t.Utils.defineProperty,n),Object.defineProperty(n,"radius",{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius instanceof t.Vector&&this._radius.unbind(t.Events.change,this._renderer.flagRadius),this._radius=e,this._radius instanceof t.Vector&&this._radius.bind(t.Events.change,this._renderer.flagRadius),this._flagRadius=!0}})}}),i.extend(r.prototype,e.prototype,{_width:0,_height:0,_radius:0,_flagWidth:!1,_flagHeight:!1,_flagRadius:!1,constructor:r,_update:function(){if(this._flagWidth||this._flagHeight||this._flagRadius){var i,r,n,s=this._width,a=this._height;this._radius instanceof t.Vector?(i=this._radius.x,r=this._radius.y):(i=this._radius,r=this._radius);var o=s/2,l=a/2;(n=this.vertices[0]).x=-(o-i),n.y=-l,(n=this.vertices[1]).x=o-i,n.y=-l,n.controls.left.clear(),n.controls.right.x=i,n.controls.right.y=0,(n=this.vertices[2]).x=o,n.y=-(l-r),n.controls.right.clear(),n.controls.left.clear(),(n=this.vertices[3]).x=o,n.y=l-r,n.controls.left.clear(),n.controls.right.x=0,n.controls.right.y=r,(n=this.vertices[4]).x=o-i,n.y=l,n.controls.right.clear(),n.controls.left.clear(),(n=this.vertices[5]).x=-(o-i),n.y=l,n.controls.left.clear(),n.controls.right.x=-i,n.controls.right.y=0,(n=this.vertices[6]).x=-o,n.y=l-r,n.controls.left.clear(),n.controls.right.clear(),(n=this.vertices[7]).x=-o,n.y=-(l-r),n.controls.left.clear(),n.controls.right.x=0,n.controls.right.y=-r,(n=this.vertices[8]).x=-(o-i),n.y=-l,n.controls.left.clear(),n.controls.right.clear(),(n=this.vertices[9]).copy(this.vertices[8])}return e.prototype._update.call(this),this},flagReset:function(){return this._flagWidth=this._flagHeight=this._flagRadius=!1,e.prototype.flagReset.call(this),this},clone:function(e){var n=this.width,s=this.height,a=this.radius,o=new r(0,0,n,s,a);return o.translation.copy(this.translation),o.rotation=this.rotation,o.scale=this.scale,i.each(t.Path.Properties,function(t){o[t]=this[t]},this),e&&e.add(o),o}}),r.MakeObservable(r.prototype)}((void 0!==t?t:this||window).Two),function(t){var e=t.root,i=t.Utils.getComputedMatrix,r=t.Utils,n=((e.document?e.document.createElement("canvas"):(console.warn("Two.js: Unable to create canvas for Two.Text measurements."),{getContext:r.identity})).getContext("2d"),t.Text=function(e,i,n,s){if(t.Shape.call(this),this._renderer.type="text",this._renderer.flagFill=r.bind(t.Text.FlagFill,this),this._renderer.flagStroke=r.bind(t.Text.FlagStroke,this),this.value=e,r.isNumber(i)&&(this.translation.x=i),r.isNumber(n)&&(this.translation.y=n),this.dashes=[],!r.isObject(s))return this;r.each(t.Text.Properties,function(t){t in s&&(this[t]=s[t])},this)});r.extend(t.Text,{Ratio:.6,Properties:["value","family","size","leading","alignment","linewidth","style","className","weight","decoration","baseline","opacity","visible","fill","stroke"],FlagFill:function(){this._flagFill=!0},FlagStroke:function(){this._flagStroke=!0},MakeObservable:function(e){t.Shape.MakeObservable(e),r.each(t.Text.Properties.slice(0,13),t.Utils.defineProperty,e),Object.defineProperty(e,"fill",{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof t.Gradient||this._fill instanceof t.LinearGradient||this._fill instanceof t.RadialGradient||this._fill instanceof t.Texture)&&this._fill.unbind(t.Events.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof t.Gradient||this._fill instanceof t.LinearGradient||this._fill instanceof t.RadialGradient||this._fill instanceof t.Texture)&&this._fill.bind(t.Events.change,this._renderer.flagFill)}}),Object.defineProperty(e,"stroke",{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof t.Gradient||this._stroke instanceof t.LinearGradient||this._stroke instanceof t.RadialGradient||this._stroke instanceof t.Texture)&&this._stroke.unbind(t.Events.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof t.Gradient||this._stroke instanceof t.LinearGradient||this._stroke instanceof t.RadialGradient||this._stroke instanceof t.Texture)&&this._stroke.bind(t.Events.change,this._renderer.flagStroke)}}),Object.defineProperty(e,"clip",{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}})}}),r.extend(t.Text.prototype,t.Shape.prototype,{_flagValue:!0,_flagFamily:!0,_flagSize:!0,_flagLeading:!0,_flagAlignment:!0,_flagBaseline:!0,_flagStyle:!0,_flagWeight:!0,_flagDecoration:!0,_flagFill:!0,_flagStroke:!0,_flagLinewidth:!0,_flagOpacity:!0,_flagClassName:!0,_flagVisible:!0,_flagClip:!1,_value:"",_family:"sans-serif",_size:13,_leading:17,_alignment:"center",_baseline:"middle",_style:"normal",_weight:500,_decoration:"none",_fill:"#000",_stroke:"transparent",_linewidth:1,_opacity:1,_className:"",_visible:!0,_clip:!1,constructor:t.Text,remove:function(){return this.parent?(this.parent.remove(this),this):this},clone:function(e){var i=new t.Text(this.value);return i.translation.copy(this.translation),i.rotation=this.rotation,i.scale=this.scale,r.each(t.Text.Properties,function(t){i[t]=this[t]},this),e&&e.add(i),i._update()},toObject:function(){var e={translation:this.translation.toObject(),rotation:this.rotation,scale:this.scale};return r.each(t.Text.Properties,function(t){e[t]=this[t]},this),e},noStroke:function(){return this.stroke="transparent",this},noFill:function(){return this.fill="transparent",this},getBoundingClientRect:function(t){var e,r,s,a,o,l;this._update(!0),e=t?this._matrix:i(this);var h=this.leading,c=this.value.length*this.size*n.Ratio;switch(this.alignment){case"left":s=0,a=c;break;case"right":s=-c,a=0;break;default:s=-c/2,a=c/2}switch(this.baseline){case"top":o=0,l=h;break;case"bottom":o=-h,l=0;break;default:o=-h/2,l=h/2}return{top:o=(r=e.multiply(s,o,1)).y,left:s=r.x,right:a=(r=e.multiply(a,l,1)).x,bottom:l=r.y,width:a-s,height:l-o}},flagReset:function(){return this._flagValue=this._flagFamily=this._flagSize=this._flagLeading=this._flagAlignment=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagClip=this._flagDecoration=this._flagClassName=this._flagBaseline=!1,t.Shape.prototype.flagReset.call(this),this}}),t.Text.MakeObservable(t.Text.prototype)}((void 0!==t?t:this||window).Two),function(t){var e=t.Utils,i=t.Stop=function(t,r,n){this._renderer={},this._renderer.type="stop",this.offset=e.isNumber(t)?t:i.Index<=0?0:1,this.opacity=e.isNumber(n)?n:1,this.color=e.isString(r)?r:i.Index<=0?"#fff":"#000",i.Index=(i.Index+1)%2};e.extend(i,{Index:0,Properties:["offset","opacity","color"],MakeObservable:function(t){e.each(i.Properties,function(t){var e="_"+t,i="_flag"+t.charAt(0).toUpperCase()+t.slice(1);Object.defineProperty(this,t,{enumerable:!0,get:function(){return this[e]},set:function(t){this[e]=t,this[i]=!0,this.parent&&(this.parent._flagStops=!0)}})},t)}}),e.extend(i.prototype,t.Utils.Events,{constructor:i,clone:function(){var t=new i;return e.each(i.Properties,function(e){t[e]=this[e]},this),t},toObject:function(){var t={};return e.each(i.Properties,function(e){t[e]=this[e]},this),t},flagReset:function(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,this}}),i.MakeObservable(i.prototype),i.prototype.constructor=i;var r=t.Gradient=function(i){this._renderer={},this._renderer.type="gradient",this.id=t.Identifier+t.uniqueId(),this.classList=[],this._renderer.flagStops=e.bind(r.FlagStops,this),this._renderer.bindStops=e.bind(r.BindStops,this),this._renderer.unbindStops=e.bind(r.UnbindStops,this),this.spread="pad",this.stops=i};e.extend(r,{Stop:i,Properties:["spread"],MakeObservable:function(i){e.each(r.Properties,t.Utils.defineProperty,i),Object.defineProperty(i,"stops",{enumerable:!0,get:function(){return this._stops},set:function(e){this._renderer.flagStops;var i=this._renderer.bindStops,r=this._renderer.unbindStops;this._stops&&this._stops.unbind(t.Events.insert,i).unbind(t.Events.remove,r),this._stops=new t.Utils.Collection((e||[]).slice(0)),this._stops.bind(t.Events.insert,i).bind(t.Events.remove,r),i(this._stops)}})},FlagStops:function(){this._flagStops=!0},BindStops:function(e){for(var i=e.length;i--;)e[i].bind(t.Events.change,this._renderer.flagStops),e[i].parent=this;this._renderer.flagStops()},UnbindStops:function(e){for(var i=e.length;i--;)e[i].unbind(t.Events.change,this._renderer.flagStops),delete e[i].parent;this._renderer.flagStops()}}),e.extend(r.prototype,t.Utils.Events,{_flagStops:!1,_flagSpread:!1,clone:function(i){var n=e.map(this.stops,function(t){return t.clone()}),s=new r(n);return e.each(t.Gradient.Properties,function(t){s[t]=this[t]},this),i&&i.add(s),s},toObject:function(){var t={stops:e.map(this.stops,function(t){return t.toObject()})};return e.each(r.Properties,function(e){t[e]=this[e]},this),t},_update:function(){return(this._flagSpread||this._flagStops)&&this.trigger(t.Events.change),this},flagReset:function(){return this._flagSpread=this._flagStops=!1,this}}),r.MakeObservable(r.prototype)}((void 0!==t?t:this||window).Two),function(t){var e=t.Utils,i=t.LinearGradient=function(r,n,s,a,o){t.Gradient.call(this,o),this._renderer.type="linear-gradient";var l=e.bind(i.FlagEndPoints,this);this.left=(new t.Vector).bind(t.Events.change,l),this.right=(new t.Vector).bind(t.Events.change,l),e.isNumber(r)&&(this.left.x=r),e.isNumber(n)&&(this.left.y=n),e.isNumber(s)&&(this.right.x=s),e.isNumber(a)&&(this.right.y=a)};e.extend(i,{Stop:t.Gradient.Stop,MakeObservable:function(e){t.Gradient.MakeObservable(e)},FlagEndPoints:function(){this._flagEndPoints=!0}}),e.extend(i.prototype,t.Gradient.prototype,{_flagEndPoints:!1,constructor:i,clone:function(r){var n=e.map(this.stops,function(t){return t.clone()}),s=new i(this.left._x,this.left._y,this.right._x,this.right._y,n);return e.each(t.Gradient.Properties,function(t){s[t]=this[t]},this),r&&r.add(s),s},toObject:function(){var e=t.Gradient.prototype.toObject.call(this);return e.left=this.left.toObject(),e.right=this.right.toObject(),e},_update:function(){return(this._flagEndPoints||this._flagSpread||this._flagStops)&&this.trigger(t.Events.change),this},flagReset:function(){return this._flagEndPoints=!1,t.Gradient.prototype.flagReset.call(this),this}}),i.MakeObservable(i.prototype)}((void 0!==t?t:this||window).Two),function(t){var e=t.Utils,i=t.RadialGradient=function(i,r,n,s,a,o){t.Gradient.call(this,s),this._renderer.type="radial-gradient",this.center=(new t.Vector).bind(t.Events.change,e.bind(function(){this._flagCenter=!0},this)),this.radius=e.isNumber(n)?n:20,this.focal=(new t.Vector).bind(t.Events.change,e.bind(function(){this._flagFocal=!0},this)),e.isNumber(i)&&(this.center.x=i),e.isNumber(r)&&(this.center.y=r),this.focal.copy(this.center),e.isNumber(a)&&(this.focal.x=a),e.isNumber(o)&&(this.focal.y=o)};e.extend(i,{Stop:t.Gradient.Stop,Properties:["radius"],MakeObservable:function(r){t.Gradient.MakeObservable(r),e.each(i.Properties,t.Utils.defineProperty,r)}}),e.extend(i.prototype,t.Gradient.prototype,{_flagRadius:!1,_flagCenter:!1,_flagFocal:!1,constructor:i,clone:function(r){var n=e.map(this.stops,function(t){return t.clone()}),s=new i(this.center._x,this.center._y,this._radius,n,this.focal._x,this.focal._y);return e.each(t.Gradient.Properties.concat(i.Properties),function(t){s[t]=this[t]},this),r&&r.add(s),s},toObject:function(){var r=t.Gradient.prototype.toObject.call(this);return e.each(i.Properties,function(t){r[t]=this[t]},this),r.center=this.center.toObject(),r.focal=this.focal.toObject(),r},_update:function(){return(this._flagRadius||this._flatCenter||this._flagFocal||this._flagSpread||this._flagStops)&&this.trigger(t.Events.change),this},flagReset:function(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,t.Gradient.prototype.flagReset.call(this),this}}),i.MakeObservable(i.prototype)}((void 0!==t?t:this||window).Two),function(t){var e,i=t.root,r=t.Utils,n={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff)$/i,effect:/texture|gradient/i};i.document&&(e=document.createElement("a"));var s=t.Texture=function(e,i){if(this._renderer={},this._renderer.type="texture",this._renderer.flagOffset=r.bind(s.FlagOffset,this),this._renderer.flagScale=r.bind(s.FlagScale,this),this.id=t.Identifier+t.uniqueId(),this.classList=[],this.offset=new t.Vector,r.isFunction(i)){var n=r.bind(function(){this.unbind(t.Events.load,n),r.isFunction(i)&&i()},this);this.bind(t.Events.load,n)}r.isString(e)?this.src=e:r.isElement(e)&&(this.image=e),this._update()};r.extend(s,{Properties:["src","loaded","repeat"],RegularExpressions:n,ImageRegistry:new t.Registry,getAbsoluteURL:function(t){return e?(e.href=t,e.href):t},loadHeadlessBuffer:new Function("texture","loaded",['var fs = require("fs");',"var buffer = fs.readFileSync(texture.src);","texture.image.src = buffer;","loaded();"].join("\n")),getImage:function(e){var r,a=s.getAbsoluteURL(e);return s.ImageRegistry.contains(a)?s.ImageRegistry.get(a):(t.Utils.Image?(r=new t.Utils.Image,t.CanvasRenderer.Utils.shim(r,"img")):i.document?r=n.video.test(a)?document.createElement("video"):document.createElement("img"):console.warn("Two.js: no prototypical image defined for Two.Texture"),r.crossOrigin="anonymous",r)},Register:{canvas:function(t,e){t._src="#"+t.id,s.ImageRegistry.add(t.src,t.image),r.isFunction(e)&&e()},img:function(e,i){var n=function(t){r.isFunction(e.image.removeEventListener)&&(e.image.removeEventListener("load",n,!1),e.image.removeEventListener("error",a,!1)),r.isFunction(i)&&i()},a=function(i){throw r.isFunction(e.image.removeEventListener)&&(e.image.removeEventListener("load",n,!1),e.image.removeEventListener("error",a,!1)),new t.Utils.Error("unable to load "+e.src)};r.isNumber(e.image.width)&&e.image.width>0&&r.isNumber(e.image.height)&&e.image.height>0?n():r.isFunction(e.image.addEventListener)&&(e.image.addEventListener("load",n,!1),e.image.addEventListener("error",a,!1)),e._src=s.getAbsoluteURL(e._src),e.image&&e.image.getAttribute("two-src")||(e.image.setAttribute("two-src",e.src),s.ImageRegistry.add(e.src,e.image),t.Utils.isHeadless?s.loadHeadlessBuffer(e,n):e.image.src=e.src)},video:function(e,i){var n=function(t){e.image.removeEventListener("canplaythrough",n,!1),e.image.removeEventListener("error",a,!1),e.image.width=e.image.videoWidth,e.image.height=e.image.videoHeight,e.image.play(),r.isFunction(i)&&i()},a=function(i){throw e.image.removeEventListener("canplaythrough",n,!1),e.image.removeEventListener("error",a,!1),new t.Utils.Error("unable to load "+e.src)};if(e._src=s.getAbsoluteURL(e._src),e.image.addEventListener("canplaythrough",n,!1),e.image.addEventListener("error",a,!1),!e.image||!e.image.getAttribute("two-src")){if(t.Utils.isHeadless)throw new t.Utils.Error("video textures are not implemented in headless environments.");e.image.setAttribute("two-src",e.src),s.ImageRegistry.add(e.src,e.image),e.image.src=e.src,e.image.loop=!0,e.image.load()}}},load:function(t,e){t.src;var i=t.image,r=i&&i.nodeName.toLowerCase();t._flagImage&&(/canvas/i.test(r)?s.Register.canvas(t,e):(t._src=i.getAttribute("two-src")||i.src,s.Register[r](t,e))),t._flagSrc&&(i||(t.image=s.getImage(t.src)),r=t.image.nodeName.toLowerCase(),s.Register[r](t,e))},FlagOffset:function(){this._flagOffset=!0},FlagScale:function(){this._flagScale=!0},MakeObservable:function(e){r.each(s.Properties,t.Utils.defineProperty,e),Object.defineProperty(e,"image",{enumerable:!0,get:function(){return this._image},set:function(t){var e;switch(t&&t.nodeName.toLowerCase()){case"canvas":e="#"+t.id;break;default:e=t.src}s.ImageRegistry.contains(e)?this._image=s.ImageRegistry.get(t.src):this._image=t,this._flagImage=!0}}),Object.defineProperty(e,"offset",{enumerable:!0,get:function(){return this._offset},set:function(e){this._offset&&this._offset.unbind(t.Events.change,this._renderer.flagOffset),this._offset=e,this._offset.bind(t.Events.change,this._renderer.flagOffset),this._flagOffset=!0}}),Object.defineProperty(e,"scale",{enumerable:!0,get:function(){return this._scale},set:function(e){this._scale instanceof t.Vector&&this._scale.unbind(t.Events.change,this._renderer.flagScale),this._scale=e,this._scale instanceof t.Vector&&this._scale.bind(t.Events.change,this._renderer.flagScale),this._flagScale=!0}})}}),r.extend(s.prototype,t.Utils.Events,t.Shape.prototype,{_flagSrc:!1,_flagImage:!1,_flagVideo:!1,_flagLoaded:!1,_flagRepeat:!1,_flagOffset:!1,_flagScale:!1,_src:"",_image:null,_loaded:!1,_repeat:"no-repeat",_scale:1,_offset:null,constructor:s,clone:function(){return new s(this.src)},toObject:function(){return{src:this.src,image:this.image}},_update:function(){return(this._flagSrc||this._flagImage)&&(this.trigger(t.Events.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,s.load(this,r.bind(function(){this.loaded=!0,this.trigger(t.Events.change).trigger(t.Events.load)},this)))),this._image&&this._image.readyState>=4&&(this._flagVideo=!0),this},flagReset:function(){return this._flagSrc=this._flagImage=this._flagLoaded=this._flagVideo=this._flagScale=this._flagOffset=!1,this}}),s.MakeObservable(s.prototype)}((void 0!==t?t:this||window).Two),function(t){var e=t.Utils,i=t.Path,r=t.Rectangle,n=t.Sprite=function(r,n,s,a,o,l){i.call(this,[new t.Anchor,new t.Anchor,new t.Anchor,new t.Anchor],!0),this.noStroke(),this.noFill(),r instanceof t.Texture?this.texture=r:e.isString(r)&&(this.texture=new t.Texture(r)),this.origin=new t.Vector,this._update(),this.translation.set(n||0,s||0),e.isNumber(a)&&(this.columns=a),e.isNumber(o)&&(this.rows=o),e.isNumber(l)&&(this.frameRate=l)};e.extend(n,{Properties:["texture","columns","rows","frameRate","index"],MakeObservable:function(i){r.MakeObservable(i),e.each(n.Properties,t.Utils.defineProperty,i)}}),e.extend(n.prototype,r.prototype,{_flagTexture:!1,_flagColumns:!1,_flagRows:!1,_flagFrameRate:!1,flagIndex:!1,_amount:1,_duration:0,_startTime:0,_playing:!1,_firstFrame:0,_lastFrame:0,_loop:!0,_texture:null,_columns:1,_rows:1,_frameRate:0,_index:0,_origin:null,constructor:n,play:function(t,i,r){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=e.performance.now(),e.isNumber(t)&&(this._firstFrame=t),e.isNumber(i)&&(this._lastFrame=i),e.isFunction(r)?this._onLastFrame=r:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this},pause:function(){return this._playing=!1,this},stop:function(){return this._playing=!1,this._index=0,this},clone:function(t){var e=new n(this.texture,this.translation.x,this.translation.y,this.columns,this.rows,this.frameRate);return this.playing&&(e.play(this._firstFrame,this._lastFrame),e._loop=this._loop),t&&t.add(e),e},_update:function(){var t,i,n,s,a,o,l,h,c,d=this._texture,u=this._columns,f=this._rows;if((this._flagColumns||this._flagRows)&&(this._amount=this._columns*this._rows),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._flagTexture&&(this.fill=this._texture),this._texture.loaded){t=(l=d.image.width)/u,i=(h=d.image.height)/f,s=this._amount,this.width!==t&&(this.width=t),this.height!==i&&(this.height=i),this._playing&&this._frameRate>0&&(e.isNaN(this._lastFrame)&&(this._lastFrame=s-1),n=e.performance.now()-this._startTime,a=1e3*((c=this._lastFrame+1)-this._firstFrame)/this._frameRate,this._loop?n%=a:n=Math.min(n,a),o=e.lerp(this._firstFrame,c,n/a),(o=Math.floor(o))!==this._index&&(this._index=o,o>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));var g=-t*(this._index%u)+(l-t)/2,_=-i*Math.floor(this._index/u)+(h-i)/2;g!==d.offset.x&&(d.offset.x=g),_!==d.offset.y&&(d.offset.y=_)}return r.prototype._update.call(this),this},flagReset:function(){return this._flagTexture=this._flagColumns=this._flagRows=this._flagFrameRate=!1,r.prototype.flagReset.call(this),this}}),n.MakeObservable(n.prototype)}((void 0!==t?t:this||window).Two),function(t){var e=t.Utils,i=t.Path,r=t.Rectangle,n=t.ImageSequence=function(r,s,a,o){i.call(this,[new t.Anchor,new t.Anchor,new t.Anchor,new t.Anchor],!0),this._renderer.flagTextures=e.bind(n.FlagTextures,this),this._renderer.bindTextures=e.bind(n.BindTextures,this),this._renderer.unbindTextures=e.bind(n.UnbindTextures,this),this.noStroke(),this.noFill(),this.textures=e.map(r,n.GenerateTexture,this),this.origin=new t.Vector,this._update(),this.translation.set(s||0,a||0),e.isNumber(o)?this.frameRate=o:this.frameRate=n.DefaultFrameRate};e.extend(n,{Properties:["frameRate","index"],DefaultFrameRate:30,FlagTextures:function(){this._flagTextures=!0},BindTextures:function(e){for(var i=e.length;i--;)e[i].bind(t.Events.change,this._renderer.flagTextures);this._renderer.flagTextures()},UnbindTextures:function(e){for(var i=e.length;i--;)e[i].unbind(t.Events.change,this._renderer.flagTextures);this._renderer.flagTextures()},MakeObservable:function(i){r.MakeObservable(i),e.each(n.Properties,t.Utils.defineProperty,i),Object.defineProperty(i,"textures",{enumerable:!0,get:function(){return this._textures},set:function(e){this._renderer.flagTextures;var i=this._renderer.bindTextures,r=this._renderer.unbindTextures;this._textures&&this._textures.unbind(t.Events.insert,i).unbind(t.Events.remove,r),this._textures=new t.Utils.Collection((e||[]).slice(0)),this._textures.bind(t.Events.insert,i).bind(t.Events.remove,r),i(this._textures)}})},GenerateTexture:function(i){return i instanceof t.Texture?i:e.isString(i)?new t.Texture(i):void 0}}),e.extend(n.prototype,r.prototype,{_flagTextures:!1,_flagFrameRate:!1,_flagIndex:!1,_amount:1,_duration:0,_index:0,_startTime:0,_playing:!1,_firstFrame:0,_lastFrame:0,_loop:!0,_textures:null,_frameRate:0,_origin:null,constructor:n,play:function(t,i,r){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=e.performance.now(),e.isNumber(t)&&(this._firstFrame=t),e.isNumber(i)&&(this._lastFrame=i),e.isFunction(r)?this._onLastFrame=r:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this},pause:function(){return this._playing=!1,this},stop:function(){return this._playing=!1,this._index=0,this},clone:function(t){var e=new n(this.textures,this.translation.x,this.translation.y,this.frameRate);return e._loop=this._loop,this._playing&&e.play(),t&&t.add(e),e},_update:function(){var i,n,s,a,o,l,h,c,d=this._textures;return this._flagTextures&&(this._amount=d.length),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._playing&&this._frameRate>0?(a=this._amount,e.isNaN(this._lastFrame)&&(this._lastFrame=a-1),s=e.performance.now()-this._startTime,o=1e3*((c=this._lastFrame+1)-this._firstFrame)/this._frameRate,this._loop?s%=o:s=Math.min(s,o),h=e.lerp(this._firstFrame,c,s/o),(h=Math.floor(h))!==this._index&&(this._index=h,(l=d[this._index]).loaded&&(i=l.image.width,n=l.image.height,this.width!==i&&(this.width=i),this.height!==n&&(this.height=n),this.fill=l,h>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()))):!this._flagIndex&&this.fill instanceof t.Texture||((l=d[this._index]).loaded&&(i=l.image.width,n=l.image.height,this.width!==i&&(this.width=i),this.height!==n&&(this.height=n)),this.fill=l),r.prototype._update.call(this),this},flagReset:function(){return this._flagTextures=this._flagFrameRate=!1,r.prototype.flagReset.call(this),this}}),n.MakeObservable(n.prototype)}((void 0!==t?t:this||window).Two),function(t){var e=Math.min,i=Math.max,r=t.Utils,n=function(){t.Utils.Collection.apply(this,arguments),Object.defineProperty(this,"_events",{value:{},enumerable:!1}),this.ids={},this.on(t.Events.insert,this.attach),this.on(t.Events.remove,this.detach),n.prototype.attach.apply(this,arguments)};n.prototype=new t.Utils.Collection,r.extend(n.prototype,{constructor:n,attach:function(t){for(var e=0;e<t.length;e++)this.ids[t[e].id]=t[e];return this},detach:function(t){for(var e=0;e<t.length;e++)delete this.ids[t[e].id];return this}});var s=t.Group=function(e){t.Shape.call(this,!0),this._renderer.type="group",this.additions=[],this.subtractions=[],this.children=r.isArray(e)?e:arguments};function a(t,e){var i,n=t.parent;return n===e?(this.additions.push(t),void(this._flagAdditions=!0)):(n&&n.children.ids[t.id]&&(i=r.indexOf(n.children,t),n.children.splice(i,1),(i=r.indexOf(n.additions,t))>=0?n.additions.splice(i,1):(n.subtractions.push(t),n._flagSubtractions=!0)),e?(t.parent=e,this.additions.push(t),void(this._flagAdditions=!0)):((i=r.indexOf(this.additions,t))>=0?this.additions.splice(i,1):(this.subtractions.push(t),this._flagSubtractions=!0),void delete t.parent))}r.extend(s,{Children:n,InsertChildren:function(t){for(var e=0;e<t.length;e++)a.call(this,t[e],this)},RemoveChildren:function(t){for(var e=0;e<t.length;e++)a.call(this,t[e])},OrderChildren:function(t){this._flagOrder=!0},Properties:["fill","stroke","linewidth","visible","cap","join","miter"],MakeObservable:function(e){var i=t.Group.Properties;Object.defineProperty(e,"opacity",{enumerable:!0,get:function(){return this._opacity},set:function(t){this._flagOpacity=this._opacity!==t,this._opacity=t}}),Object.defineProperty(e,"className",{enumerable:!0,get:function(){return this._className},set:function(t){this._flagClassName=this._className!==t,this._className=t}}),Object.defineProperty(e,"beginning",{enumerable:!0,get:function(){return this._beginning},set:function(t){this._flagBeginning=this._beginning!==t,this._beginning=t}}),Object.defineProperty(e,"ending",{enumerable:!0,get:function(){return this._ending},set:function(t){this._flagEnding=this._ending!==t,this._ending=t}}),Object.defineProperty(e,"length",{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){this._length=0;for(var t=0;t<this.children.length;t++){var e=this.children[t];this._length+=e.length}}return this._length}}),t.Shape.MakeObservable(e),s.MakeGetterSetters(e,i),Object.defineProperty(e,"children",{enumerable:!0,get:function(){return this._children},set:function(e){var i=r.bind(s.InsertChildren,this),a=r.bind(s.RemoveChildren,this),o=r.bind(s.OrderChildren,this);this._children&&this._children.unbind(),this._children=new n(e),this._children.bind(t.Events.insert,i),this._children.bind(t.Events.remove,a),this._children.bind(t.Events.order,o)}}),Object.defineProperty(e,"mask",{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,t.clip||(t.clip=!0)}})},MakeGetterSetters:function(t,e){r.isArray(e)||(e=[e]),r.each(e,function(e){s.MakeGetterSetter(t,e)})},MakeGetterSetter:function(t,e){var i="_"+e;Object.defineProperty(t,e,{enumerable:!0,get:function(){return this[i]},set:function(t){this[i]=t,r.each(this.children,function(i){i[e]=t})}})}}),r.extend(s.prototype,t.Shape.prototype,{_flagAdditions:!1,_flagSubtractions:!1,_flagOrder:!1,_flagOpacity:!0,_flagClassName:!1,_flagBeginning:!1,_flagEnding:!1,_flagLength:!1,_flagMask:!1,_fill:"#fff",_stroke:"#000",_linewidth:1,_opacity:1,_className:"",_visible:!0,_cap:"round",_join:"round",_miter:4,_closed:!0,_curved:!1,_automatic:!0,_beginning:0,_ending:1,_length:0,_mask:null,constructor:s,clone:function(t){var e=new s,i=r.map(this.children,function(t){return t.clone()});return e.add(i),e.opacity=this.opacity,this.mask&&(e.mask=this.mask),e.translation.copy(this.translation),e.rotation=this.rotation,e.scale=this.scale,e.className=this.className,t&&t.add(e),e._update()},toObject:function(){var e={children:[],translation:this.translation.toObject(),rotation:this.rotation,scale:this.scale instanceof t.Vector?this.scale.toObject():this.scale,opacity:this.opacity,className:this.className,mask:this.mask?this.mask.toObject():null};return r.each(this.children,function(t,i){e.children[i]=t.toObject()},this),e},corner:function(){var t=this.getBoundingClientRect(!0),e={x:t.left,y:t.top};return this.children.forEach(function(t){t.translation.sub(e)}),this},center:function(){var t=this.getBoundingClientRect(!0);return t.centroid={x:t.left+t.width/2,y:t.top+t.height/2},this.children.forEach(function(e){e.isShape&&e.translation.sub(t.centroid)}),this},getById:function(t){var e=function(t,i){if(t.id===i)return t;if(t.children)for(var r=t.children.length;r--;){var n=e(t.children[r],i);if(n)return n}};return e(this,t)||null},getByClassName:function(t){var e=[],i=function(t,r){return-1!=t.classList.indexOf(r)?e.push(t):t.children&&t.children.forEach(function(t){i(t,r)}),e};return i(this,t)},getByType:function(e){var i=[],r=function(e,n){for(var s in e.children)e.children[s]instanceof n?i.push(e.children[s]):e.children[s]instanceof t.Group&&r(e.children[s],n);return i};return r(this,e)},add:function(t){t=t instanceof Array?t.slice():r.toArray(arguments);for(var e=0;e<t.length;e++)t[e]&&t[e].id&&this.children.push(t[e]);return this},remove:function(t){var e=arguments.length,i=this.parent;if(e<=0&&i)return i.remove(this),this;t=t instanceof Array?t.slice():r.toArray(arguments);for(var n=0;n<t.length;n++)t[n]&&this.children.ids[t[n].id]&&this.children.splice(r.indexOf(this.children,t[n]),1);return this},getBoundingClientRect:function(n){var s;this._update(!0);for(var a=1/0,o=-1/0,l=1/0,h=-1/0,c=t.Texture.RegularExpressions.effect,d=0;d<this.children.length;d++){var u=this.children[d];u.visible&&!c.test(u._renderer.type)&&(s=u.getBoundingClientRect(n),r.isNumber(s.top)&&r.isNumber(s.left)&&r.isNumber(s.right)&&r.isNumber(s.bottom)&&(l=e(s.top,l),a=e(s.left,a),o=i(s.right,o),h=i(s.bottom,h)))}return{top:l,left:a,right:o,bottom:h,width:o-a,height:h-l}},noFill:function(){return this.children.forEach(function(t){t.noFill()}),this},noStroke:function(){return this.children.forEach(function(t){t.noStroke()}),this},subdivide:function(){var t=arguments;return this.children.forEach(function(e){e.subdivide.apply(e,t)}),this},_update:function(){if(this._flagBeginning||this._flagEnding)for(var e=Math.min(this._beginning,this._ending),i=Math.max(this._beginning,this._ending),r=this.length,n=0,s=e*r,a=i*r,o=0;o<this.children.length;o++){var l=this.children[o],h=l.length;s>n+h?(l.beginning=1,l.ending=1):a<n?(l.beginning=0,l.ending=0):s>n&&s<n+h?(l.beginning=(s-n)/h,l.ending=1):a>n&&a<n+h?(l.beginning=0,l.ending=(a-n)/h):(l.beginning=0,l.ending=1),n+=h}return t.Shape.prototype._update.apply(this,arguments)},flagReset:function(){return this._flagAdditions&&(this.additions.length=0,this._flagAdditions=!1),this._flagSubtractions&&(this.subtractions.length=0,this._flagSubtractions=!1),this._flagOrder=this._flagMask=this._flagOpacity=this._flagClassName,this._flagBeginning=this._flagEnding=!1,t.Shape.prototype.flagReset.call(this),this}}),s.MakeObservable(s.prototype)}((void 0!==t?t:this||window).Two),e.a=(this||window).Two}).call(e,i("DuR2"),i("f1Eh")(t))},f1Eh:function(t,e){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(e,"exports",{enumerable:!0}),e.webpackPolyfill=1}return e}},nErl:function(t,e){(function(e){t.exports=e}).call(e,{})},u33e:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});i("XPMo"),i("+BTi");var r=i("uEG6"),n=i.n(r),s=(i("8mNY"),i("YnkO")),a=i.n(s),o=i("qaB4"),l=i("cCw9"),h=i("6/IS"),c=i("GRR7"),d=i("nznj"),u=function(t,e,i){t.addEventListener?t.addEventListener(e,i,!1):t.attachEvent("on"+e,i)},f=function(t,e,i){document.querySelector("#"+t._renderer.elem.id).onmousedown=function(e){var r=e||event;r.preventDefault();var n=r.clientX-t.translation.x,s=r.clientY-t.translation.y;r.stopPropagation?r.stopPropagation():r.cancelBubble=!0,document.onmousemove=function(t){var e={x:t.clientX-n,y:t.clientY-s};i(e)},document.onmouseup=function(t){document.onmousemove=document.onmouseup=null}}},g={name:"svgDIYMapModel",props:{mapInfo:{default:null,type:Object},iconArr:{default:null,type:Array},iconSize:{default:function(){return{width:50,height:50}},type:Object},delIconSize:{default:20,type:Number},isIconEdit:{default:!1,type:Boolean},alarmDeviceList:{default:null,type:Array},unonlineDeviceList:{default:null,type:Array}},data:function(){return{svgMap:null,mapLayer:null,mapImg:null,iconLayer:null,iconObjArr:[]}},computed:{mapUrl:function(){return this.mapInfo&&this.mapInfo.url?this.mapInfo.url:""},imgSize:function(){return this.mapInfo&&this.mapInfo.revJson?JSON.parse(this.mapInfo.revJson):null}},methods:{svgMapInit:function(){var t=this;this.$refs.drawMap.innerHTML="",this.$store.commit("HANDLE_LOADING_OPEN");var e={width:this.$refs.drawMap.scrollWidth,height:this.$refs.drawMap.scrollHeight},i=this.imgSize&&this.imgSize.height?this.imgSize.height:"0",r=this.imgSize&&this.imgSize.width?this.imgSize.width:"0";this.svgMap=new c.a(e).appendTo(this.$refs.drawMap);this.mapImg=document.createElementNS("http://www.w3.org/2000/svg","image"),this.mapImg.href.baseVal="httpImage/"+this.mapUrl,this.mapImg.setAttributeNS(null,"x",0),this.mapImg.setAttributeNS(null,"y",0),this.mapImg.setAttributeNS(null,"height",i),this.mapImg.setAttributeNS(null,"width",r),this.mapLayer=this.svgMap.makeGroup(),this.iconLayer=this.svgMap.makeGroup(),this.svgMap.update(),document.querySelector("#"+this.mapLayer._renderer.elem.id).appendChild(this.mapImg),document.querySelector("#"+this.mapLayer._renderer.elem.id).style.cursor="all-scroll",this.mapImg.onload=function(e){t.$store.commit("HANDLE_LOADING_CLOSE")},function(t,e){function i(t){var i=t||event,r=i.wheelDelta?i.wheelDelta<0:i.detail>0;return e(r),i.preventDefault&&i.preventDefault(),!1}-1!==window.navigator.userAgent.indexOf("Firefox")?u(t,"DOMMouseScroll",i):u(t,"mousewheel",i)}(document.querySelector("#drawMap svg"),function(e){e?t.zoomSmall():t.zoomBig()}),f(this.mapLayer,0,function(e){t.mapLayer.translation.set(e.x,e.y),t.iconLayer.translation.set(e.x,e.y),t.svgMap.update(),t.$emit("dragMapLayerFn",e)})},zoomBig:function(){var t=this;this.mapLayer.scale+=.1,this.iconObjArr.map(function(e){e.translation.set(e.x*t.mapLayer.scale-t.iconSize.width/2,e.y*t.mapLayer.scale-t.iconSize.height/2)}),this.svgMap.update(),this.$emit("zoomMapLayerFn",this.mapLayer.scale)},zoomSmall:function(){var t=this;this.mapLayer.scale>.3?(this.mapLayer.scale-=.1,this.iconObjArr.map(function(e){e.translation.set(e.x*t.mapLayer.scale-t.iconSize.width/2,e.y*t.mapLayer.scale-t.iconSize.height/2)}),this.svgMap.update(),this.$emit("zoomMapLayerFn",this.mapLayer.scale)):this.$notify({group:"foo",type:"warn",title:"抱歉,真的不能再小了",text:"地图已经缩到最小,不能再小了"})},pantoHome:function(){var t=this;this.mapLayer.scale=1,this.iconObjArr.map(function(e){e.translation.set(1*e.x-t.iconSize.width/2,1*e.y-t.iconSize.height/2)}),this.mapLayer.translation.set(0,0),this.iconLayer.translation.set(0,0),this.svgMap.update()},iconListInit:function(t){var e=this;if(t&&this.svgMap&&this.mapLayer&&this.mapImg&&this.iconLayer){var i=[],r=[],n=[];this.iconObjArr=this.iconObjArr.reduce(function(e,i){return-1!==Object(d.c)(i.data.id,t,"id")?(e.push(i),n.push(i.data)):document.querySelector("#"+i._renderer.elem.id).remove(),e},[]);var s=!0,a=!1,o=void 0;try{for(var l,h=t[Symbol.iterator]();!(s=(l=h.next()).done);s=!0){var c=l.value;-1===Object(d.c)(c.id,n,"id")?r.push(c):i.push(c)}}catch(t){a=!0,o=t}finally{try{!s&&h.return&&h.return()}finally{if(a)throw o}}if(0===this.iconObjArr.length){var u=!0,f=!1,g=void 0;try{for(var _,p=t[Symbol.iterator]();!(u=(_=p.next()).done);u=!0){var m=_.value;this.drawIcon(m)}}catch(t){f=!0,g=t}finally{try{!u&&p.return&&p.return()}finally{if(f)throw g}}}else{var v=!0,y=!1,x=void 0;try{for(var b,w=r[Symbol.iterator]();!(v=(b=w.next()).done);v=!0){var S=b.value;this.drawIcon(S)}}catch(t){y=!0,x=t}finally{try{!v&&w.return&&w.return()}finally{if(y)throw x}}}var A=function(t){e.iconObjArr.map(function(e){if(t.id===e.data.id){var i=t&&t.position?JSON.parse(t.position):{x:0,y:0};e.data=t,e.x=i.x,e.y=i.y}})},C=!0,k=!1,E=void 0;try{for(var R,M=i[Symbol.iterator]();!(C=(R=M.next()).done);C=!0){A(R.value)}}catch(t){k=!0,E=t}finally{try{!C&&M.return&&M.return()}finally{if(k)throw E}}}},drawIcon:function(t){var e=this;if(!t||!t.position)return!1;var i=document.createElementNS("http://www.w3.org/2000/svg","image");i.href.baseVal=t&&t.icon?"/static/img/map/"+t.icon+".png":"/static/img/map/camera_device.png",i.setAttributeNS(null,"x",0),i.setAttributeNS(null,"y",-this.iconSize.height/2),i.setAttributeNS(null,"height",this.iconSize.height),i.setAttributeNS(null,"width",this.iconSize.width);var r=t&&t.position?JSON.parse(t.position):{x:0,y:0},n=this.svgMap.makeGroup(i);if(n.data=t,n.x=r.x,n.y=r.y,n.state="_unonline",n.translation.set(r.x*this.mapLayer.scale-this.iconSize.width/2,r.y*this.mapLayer.scale-this.iconSize.height/2),this.iconLayer.add(n),this.iconObjArr.push(n),this.svgMap.update(),document.querySelector("#"+n._renderer.elem.id).appendChild(i),document.querySelector("#"+n._renderer.elem.id).style.cursor="pointer",this.isIconEdit){var s=document.createElementNS("http://www.w3.org/2000/svg","image");s.href.baseVal="/static/img/map/mapDel.png",s.setAttributeNS(null,"x",this.iconSize.width-this.delIconSize),s.setAttributeNS(null,"y",-this.iconSize.height/2),s.setAttributeNS(null,"height",this.delIconSize),s.setAttributeNS(null,"width",this.delIconSize),document.querySelector("#"+n._renderer.elem.id).appendChild(s),u(s,"click",function(t){e.$emit("iconIteamDelFn",{data:n.data,id:n.data.id})}),f(n,0,function(t){n.translation.set(t.x,t.y),e.svgMap.update(),e.$emit("iconIteamDragFn",{x:(t.x+e.iconSize.width/2)/e.mapLayer.scale,y:(t.y+e.iconSize.height/2)/e.mapLayer.scale,iconGroup:n,data:n.data})})}else u(document.querySelector("#"+n._renderer.elem.id),"click",function(t){e.$emit("iconIteamFn",n)})},initIcon:function(t){if(!t)return!1;var e=[];this.unonlineDeviceList&&(e=this.unonlineDeviceList.map(function(t){return t.deviceId}));var i=t.data&&t.data.id?t.data.id:null,r=document.querySelector("#"+t._renderer.elem.id);this.unonlineDeviceList&&-1!==e.indexOf(i)?r&&"_unonline"!==t.state&&(t.state="_unonline",r.getElementsByTagNameNS("http://www.w3.org/2000/svg","image")[0].setAttributeNS(null,"href",t.data&&t.data.icon?"/static/img/map/"+t.data.icon+".png":"/static/img/map/camera_device.png")):r&&"_online"!==t.state&&(t.state="_online",r.getElementsByTagNameNS("http://www.w3.org/2000/svg","image")[0].setAttributeNS(null,"href",t.data&&t.data.icon?"/static/img/map/"+t.data.icon+"_online.png":"/static/img/map/camera_device.png"))}},created:function(){},mounted:function(){},watch:{mapInfo:{handler:function(t,e){var i=this;this.$nextTick(function(){i.svgMapInit()})},deep:!0,immediate:!0},iconArr:{handler:function(t,e){t&&t!==e&&this.iconListInit(t)},deep:!0,immediate:!0},alarmDeviceList:{handler:function(t,e){var i=this;if(t&&t!==e){var r=t.map(function(t){return t.deviceId});this.iconObjArr.map(function(t){var e=t.data&&t.data.id?t.data.id:null,n=document.querySelector("#"+t._renderer.elem.id);-1!==r.indexOf(e)?n&&"_alarm"!==t.state&&(t.state="_alarm",n.getElementsByTagNameNS("http://www.w3.org/2000/svg","image")[0].setAttributeNS(null,"href",t.data&&t.data.icon?"/static/img/map/"+t.data.icon+"_alarm.png":"/static/img/map/camera_device.png")):i.initIcon(t)})}},immediate:!0}}},_=i("XyMi");var p=function(t){i("5R7W")},m=Object(_.a)(g,function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"position-box pr p10"},[i("div",{ref:"drawMap",staticClass:"position-box",attrs:{id:"drawMap"}}),t._v(" "),i("b-button-group",{staticClass:"zoomBtnGroup",attrs:{vertical:"",size:"sm"}},[i("b-button",{attrs:{variant:"primary",title:"放大"},on:{click:t.zoomBig}},[i("span",{staticClass:"fa fa-plus"})]),t._v(" "),i("div",{staticClass:"border-top"}),t._v(" "),i("b-button",{attrs:{variant:"primary",title:"重置位置"},on:{click:t.pantoHome}},[i("span",{staticClass:"fa fa-circle"})]),t._v(" "),i("div",{staticClass:"border-top"}),t._v(" "),i("b-button",{attrs:{variant:"primary",title:"缩小"},on:{click:t.zoomSmall}},[i("span",{staticClass:"fa fa-minus"})])],1)],1)},[],!1,p,"data-v-4473dcf7",null).exports,v=i("Ls4C"),y={props:{index:{type:Number,default:0},w:{type:Number,default:100},h:{type:Number,default:100},data:{type:Object,default:null},tags:{type:Object,default:null},toDOMId:{type:String,default:""}},data:function(){return{grabEvents:["mousedown","touchstart"],moveEvents:["mousemove","touchmove"],releaseEvents:["mouseup","touchend"],isAdd:!1,isOnDowm:!1,boxContent:{},beginx:0,beginy:0,item:"",CloneDom:null}},mounted:function(){this.item=this.$refs.box,this.listenEvents()},methods:{_addGrabListeners:function(){var t=this;this.grabEvents.forEach(function(e){window.addEventListener(e,t._onMouseDown,{passive:!1})}),this.moveEvents.forEach(function(e){window.document.addEventListener(e,t._onMouseMove,{passive:!1})}),this.releaseEvents.forEach(function(e){window.document.addEventListener(e,t._onMouseUp,{passive:!1})})},listenEvents:function(){this._addGrabListeners()},_onMouseDown:function(t){this.boxContent=this._getContainerRect(this.item),this.isAdd=this._current(this.boxContent,t),!this.isOnDowm&&this.isAdd&&(this.isOnDowm=!0,this.$emit("down",{index:this.index,data:this.data,tags:this.tags}),this.beginx=t.clientX||t.changedTouches[0].clientX,this.beginy=t.clientY||t.changedTouches[0].clientY,this.CloneDom=this.item.cloneNode(!0),document.getElementsByTagName("body")[0].append(this.CloneDom),this.CloneDom.style.position="absolute",this.CloneDom.style.width=this.w+"px",this.CloneDom.style.height=this.h+"px",this.CloneDom.style.top=this.beginy-20+"px",this.CloneDom.style.left=this.beginx-20+"px",this.CloneDom.style.opacity=.4)},_onMouseMove:function(t){if(this.isOnDowm){var e=this._getContainerRect(this.item);this.boxContent=e;var i=t.clientX||t.changedTouches[0].clientX,r=t.clientY||t.changedTouches[0].clientY,n=i-this.beginx,s=r-this.beginy;if(this.beginy=r,this.beginx=i,this.isAdd&&this.CloneDom){var a=n+this.CloneDom.offsetLeft,o=s+this.CloneDom.offsetTop;this.CloneDom&&(this.CloneDom.style.position="absolute",this.CloneDom.style.top=o+"px",this.CloneDom.style.left=a+"px")}}},_onMouseUp:function(t){if(this.CloneDom&&document.getElementsByTagName("body")[0].removeChild(this.CloneDom),this.CloneDom=null,this.isOnDowm&&this.isAdd){var e=t.clientX||t.changedTouches[0].clientX,i=t.clientY||t.changedTouches[0].clientY;if(this.isOnDowm=!1,""!==this.toDOMId){var r=document.getElementById(this.toDOMId),n=this._getContainerRect(r);if(!(i>=n.top&&i<=n.bottom&&e>=n.left&&e<=n.right))return!1;e-=n.left,i-=n.top}this.$emit("_getContainerRect",{x:e,y:i,index:this.index,data:this.data,tags:this.tags})}return!1},_current:function(t,e){return t.left<=(e.clientX||e.changedTouches[0].clientX)&&t.right>=(e.clientX||e.changedTouches[0].clientX)&&t.top<=(e.clientY||e.changedTouches[0].clientY)&&t.bottom>=(e.clientY||e.changedTouches[0].clientY)},_getContainerRect:function(t){var e=t.getBoundingClientRect();return{left:e.left,right:e.right,top:e.top,bottom:e.bottom,width:e.width,height:e.height}},reset:function(){this.item.style.position&&(this.item.style.position="static")}}};var x=function(t){i("/p1R")},b=Object(_.a)(y,function(){var t=this.$createElement;return(this._self._c||t)("div",{ref:"box"},[this._t("default")],2)},[],!1,x,"data-v-f55f5b66",null).exports,w=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t};function S(t){return function(){var e=t.apply(this,arguments);return new Promise(function(t,i){return function r(n,s){try{var a=e[n](s),o=a.value}catch(t){return void i(t)}if(!a.done)return Promise.resolve(o).then(function(t){r("next",t)},function(t){r("throw",t)});t(o)}("next")})}}function A(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)}var C={name:"mapDeviceAdd",metaInfo:{title:"设备地图添加"},data:function(){return{noneImg:'this.src="'+i("FiMw")+'"',userInfo:this.$store.getters.basicUserInfo,form:{deviceType:"",authorizationSystem:"",deviceName:""},deviceTypeDicts:[],sysDicts:[],listType:"未描点",deviceList:[],activeCollapse:"",mapInfo:null,deviceArr:[],mapLayerX:0,mapLayerY:0,mapLayerScale:1,saveLoading:!1,isEdit:!1}},computed:{newSysDicts:function(){return[{value:"",lable:"全部"}].concat(A(this.sysDicts))},newDeviceTypeDicts:function(){return[{value:"",lable:"全部"}].concat(A(this.deviceTypeDicts))},newDeviceList:function(){if(!this.deviceArr.length)return this.deviceList;var t=[],e=!0,i=!1,r=void 0;try{for(var n,s=this.deviceList[Symbol.iterator]();!(e=(n=s.next()).done);e=!0){var a=n.value;if(a.dataList.length){var o=[],l=!0,h=!1,c=void 0;try{for(var d,u=a.dataList[Symbol.iterator]();!(l=(d=u.next()).done);l=!0){var f=d.value;f.id&&!this.isMapHas(f.id)&&o.push(f)}}catch(t){h=!0,c=t}finally{try{!l&&u.return&&u.return()}finally{if(h)throw c}}if(o.length){var g={};g.deviceType=a.deviceType,g.deviceTypeName=a.deviceTypeName,g.dataList=o,t.push(g)}}}}catch(t){i=!0,r=t}finally{try{!e&&s.return&&s.return()}finally{if(i)throw r}}return t}},methods:{getSysDicts:function(){var t=this;return S(regeneratorRuntime.mark(function e(){var i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(l.f)({orgId:t.userInfo.orgId,userId:t.userInfo.id,tags:"device"});case 2:(i=e.sent)&&!i.error&&(t.sysDicts=i);case 4:case"end":return e.stop()}},e,t)}))()},getDeviceTypeDicts:function(){var t=this;return S(regeneratorRuntime.mark(function e(){var i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(l.d)({type:"DEVICE_TYPE"});case 2:(i=e.sent)&&i.data&&(t.deviceTypeDicts=i.data);case 4:case"end":return e.stop()}},e,t)}))()},getMapInfo:function(t){var e=this;return S(regeneratorRuntime.mark(function i(){var r;return regeneratorRuntime.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,Object(h.e)({orgId:e.userInfo.orgId,id:t});case 2:(r=i.sent)&&!r.error?(e.mapInfo=r,e.getMapDeviceInfo(e.$route.query.id)):e.$toast({type:"error",message:r.message});case 4:case"end":return i.stop()}},i,e)}))()},getNoDrawPointList:function(){var t=this;return S(regeneratorRuntime.mark(function e(){var i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(h.g)(w({orgId:t.userInfo.orgId},t.form));case 2:(i=e.sent)&&!i.error&&(t.deviceList=i);case 4:case"end":return e.stop()}},e,t)}))()},getDrawPointList:function(){var t=this;return S(regeneratorRuntime.mark(function e(){var i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(h.c)(w({orgId:t.userInfo.orgId},t.form));case 2:(i=e.sent)&&!i.error&&(t.deviceList=i);case 4:case"end":return e.stop()}},e,t)}))()},getMapDeviceInfo:function(t){var e=this;return S(regeneratorRuntime.mark(function i(){var r;return regeneratorRuntime.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,Object(h.d)({orgId:e.userInfo.orgId,mapId:t});case 2:(r=i.sent)&&(e.deviceArr=r);case 4:case"end":return i.stop()}},i,e)}))()},saveMapDevice:function(t){var e=this;return S(regeneratorRuntime.mark(function i(){var r;return regeneratorRuntime.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,Object(h.h)(t);case 2:(r=i.sent)&&!r.error&&(e.saveLoading=!1,e.$toast({type:"success",message:"保存成功"}),e.$router.push({path:"/mapdevice"}));case 4:case"end":return i.stop()}},i,e)}))()},_initDeviceList:function(){"未描点"===this.listType&&this.getNoDrawPointList(),"已描点"===this.listType&&this.getDrawPointList()},saveDevice:function(t){if(t.preventDefault(),!this.$route.query.id)return this.$notify({group:"foo",type:"error",title:"抱歉,缺少重要参数,无法保存",text:"地图id是重要参数"}),!1;if(0===this.deviceArr.length)return this.$notify({group:"foo",type:"error",title:"抱歉,设备地图为空,无法保存",text:"必须在地图中添加设备,才能保存"}),!1;var e=this.deviceArr.map(function(t){var e={};return e.deviceId=t.id,e.position=t.position,e}),i={orgId:this.userInfo.orgId,id:this.$route.query.id,detailList:e};this.saveLoading=!0,this.saveMapDevice(i)},isMapHas:function(t){var e=!0,i=!1,r=void 0;try{for(var n,s=this.deviceArr[Symbol.iterator]();!(e=(n=s.next()).done);e=!0){if(n.value.id===t)return!0}}catch(t){i=!0,r=t}finally{try{!e&&s.return&&s.return()}finally{if(i)throw r}}return!1},addMapIconIteam:function(t){var e=t.x,i=t.y,r=t.data,n=(t.index,t.tags,{}),s=(e-this.mapLayerX)/this.mapLayerScale,a=(i-this.mapLayerY)/this.mapLayerScale;(n=r).position=JSON.stringify({x:s,y:a}),n.icon=r.icon,n.id=r.id,Object(d.c)(r.id,this.deviceArr,"id")&&(this.deviceArr=[].concat(A(this.deviceArr),[n]))},iconIteamDrag:function(t){var e=t.x,i=t.y,r=t.data,n=this.deviceArr.map(function(t){return t.id===r.id&&(t.position=JSON.stringify({x:e,y:i})),t});this.deviceArr=n},iconIteamDel:function(t){var e=this,i=t.id;t.data;this.$swal({title:"确定删除吗?",type:"warning",showCancelButton:!0,allowOutsideClick:!0,confirmButtonText:"确定删除!",cancelButtonText:"取消删除!",closeOnConfirm:!0},function(){var t=[];e.deviceArr.map(function(e){e.id!==i&&t.push(e)}),e.deviceArr=t,setTimeout(function(){e.$toast({type:"success",message:"删除成功"})},500)})}},created:function(){this.getSysDicts(),this.getDeviceTypeDicts(),this.$route.query.id&&"edit"===this.$route.query.type&&(this.isEdit=!0),this.$route.query.id&&""!==this.$route.query.id&&this.getMapInfo(this.$route.query.id)},mounted:function(){this.layoutHelpers.setCollapsed(!0,!1)},components:{svgDIYMapModelEdit:m,LaddaBtn:o.a,draggerBox:b,elCollapse:a.a,elCollapseItem:n.a,PerfectScrollbar:v.a}};var k=function(t){i("x3N2")},E=Object(_.a)(C,function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("h4",{staticClass:"font-weight-bold py-3 mb-0"},[i("router-link",{attrs:{to:"/mapdevice"}},[i("span",{staticClass:"text-muted font-weight-light"},[t._v("设备地图管理 /")])]),t._v("\n 设备地图"+t._s(t.isEdit?"编辑":"查看")+"\n ")],1),t._v(" "),i("b-card",{staticClass:"pl20 pr20 pt20 pb20",attrs:{"no-body":""}},[i("div",{staticClass:"row"},[i("div",{class:t.isEdit?"col-sm-6 col-md-8 mb-2":"col-12"},[i("b-card",{staticStyle:{height:"70vh"},attrs:{"no-body":""}},[i("svgDIYMapModelEdit",{attrs:{isIconEdit:t.isEdit,mapInfo:t.mapInfo,iconArr:t.deviceArr},on:{dragMapLayerFn:function(e){var i=e.x,r=e.y;t.mapLayerX=i,t.mapLayerY=r},zoomMapLayerFn:function(e){t.mapLayerScale=e},iconIteamDragFn:t.iconIteamDrag,iconIteamDelFn:t.iconIteamDel}})],1)],1),t._v(" "),t.isEdit?i("div",{staticClass:"col-sm-6 col-md-4 mb-2 border-right-0 pr"},[i("div",{staticClass:"mr20 pr10 pl10 pt10 pb10 border",staticStyle:{height:"70vh"}},[i("b-tabs",{attrs:{pills:""}},[i("b-tab",{attrs:{title:"未描点设备",active:"未描点"===t.listType},on:{click:function(e){t.listType="未描点",t._initDeviceList()}}}),t._v(" "),i("b-tab",{attrs:{title:"已描点设备",active:"已描点"===t.listType},on:{click:function(e){t.listType="已描点",t._initDeviceList()}}})],1),t._v(" "),i("hr",{staticClass:"mb-0 mt-2"}),t._v(" "),i("div",{staticClass:"pt10 pb10"},[i("b-input-group",[i("b-input-group-prepend",[i("b-form-select",{attrs:{"text-field":"lable",required:"",options:t.newDeviceTypeDicts},model:{value:t.form.deviceType,callback:function(e){t.$set(t.form,"deviceType",e)},expression:"form.deviceType"}})],1),t._v(" "),i("b-input",{attrs:{type:"text",autocomplete:"off"},nativeOn:{keyup:function(e){if(!("button"in e)&&t._k(e.keyCode,"enter",13,e.key,"Enter"))return null;t._initDeviceList()}},model:{value:t.form.deviceName,callback:function(e){t.$set(t.form,"deviceName",e)},expression:"form.deviceName"}}),t._v(" "),i("b-input-group-append",[i("b-btn",{attrs:{variant:"primary"},on:{click:function(e){t._initDeviceList()}}},[t._v("搜索")])],1)],1),t._v(" "),i("div",{staticClass:"pt10",staticStyle:{height:"58vh"}},[i("perfect-scrollbar",{staticStyle:{height:"100%"},attrs:{options:{suppressScrollX:!0,wheelPropagation:!0}}},[i("div",{staticClass:"pr"},[i("el-collapse",{staticClass:"pl5 pr5",staticStyle:{"border-top":"0"},model:{value:t.activeCollapse,callback:function(e){t.activeCollapse=e},expression:"activeCollapse"}},t._l(t.newDeviceList,function(e,r){return i("el-collapse-item",{key:r,attrs:{title:e.deviceTypeName,name:e.deviceType}},[i("div",{staticClass:"kanban-box pt-2"},t._l(e.dataList,function(r){return i("dragger-box",{key:r.id,attrs:{data:r,toDOMId:"drawMap",tags:{deviceTypeName:e.deviceTypeName,deviceType:e.deviceType}},on:{_getContainerRect:t.addMapIconIteam}},[i("div",{staticClass:"ui-bordered p-2 mb-2 dragger-li flex-box cursor-move"},[i("div",{staticClass:"img-icon mr10",style:"background-image:url("+(r.icon?"/static/img/map/"+r.icon+".png":"")+")"}),t._v(" "),i("div",{staticClass:"dragger-content"},[t._v("\n "+t._s(r.deviceName)+"\n ")])])])}))])})),t._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:!t.newDeviceList.length,expression:"!newDeviceList.length"}],staticClass:"text-center pt-4 pb-4 text-muted font-weight-light"},[t._v("\n 暂无数据\n ")])],1)])],1)],1)],1),t._v(" "),i("div",{staticClass:"verticalTabs"},[i("perfect-scrollbar",{staticStyle:{height:"100%"},attrs:{options:{suppressScrollX:!0,wheelPropagation:!0}}},[i("ul",{staticClass:"verticalTabs"},t._l(t.newSysDicts,function(e){return i("li",{key:e.id,class:t.form.authorizationSystem===e.value?"active":"",on:{click:function(i){t.form.authorizationSystem=e.value,t._initDeviceList()}}},[i("a",{attrs:{href:"javascript:;"}},[t._v(t._s(e.lable))])])}))])],1)]):t._e()]),t._v(" "),i("div",{staticClass:"text-right mt-1"},[t.isEdit?i("ladda-btn",{staticClass:"btn btn-primary",attrs:{loading:t.saveLoading,"data-style":"slide-down"},nativeOn:{click:function(e){return t.saveDevice(e)}}},[t._v("保存")]):t._e(),t._v("\n \n "),i("b-btn",{attrs:{variant:"default"},on:{click:function(e){t.$router.push({path:"/mapdevice"})}}},[t._v("返回")])],1)])],1)},[],!1,k,null,null);e.default=E.exports},x3N2:function(t,e){}});
|