!function(t){"use strict";vare=Math.PI/180,n={version:"1.1.2",stages:[],idCounter:0,ids:{},names:{},shapes:{},listenClickTap:!1,inDblClickWindow:!1,enableTrace:!1,traceArrMax:100,dblClickWindow:400,pixelRatio:void0,dragDistance:0,angleDeg:!0,showWarnings:!0,Filters:{},isDragging:function(){vart=n.DD;returnt?t.isDragging:!1},isDragReady:function(){vart=n.DD;returnt?!!t.node:!1},_addId:function(t,e){void0!==e&&(this.ids[e]=t)},_removeId:function(t){void0!==t&&deletethis.ids[t]},_addName:function(t,e){e&&(this.names[e]||(this.names[e]=[]),this.names[e].push(t))},_removeName:function(t,e){if(t){varn=this.names[t];if(n){for(vari=0;i<n.length;i++){vara=n[i];a._id===e&&n.splice(i,1)}0===n.length&&deletethis.names[t]}}},getAngle:function(t){returnthis.angleDeg?t*e:t},_detectIE:function(t){vare=t.indexOf("msie ");if(e>0)returnparseInt(t.substring(e+5,t.indexOf(".",e)),10);varn=t.indexOf("trident/");if(n>0){vari=t.indexOf("rv:");returnparseInt(t.substring(i+3,t.indexOf(".",i)),10)}vara=t.indexOf("edge/");returna>0?parseInt(t.substring(a+5,t.indexOf(".",a)),10):!1},_parseUA:function(t){vare=t.toLowerCase(),i=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[],a=!!t.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i),r=!!t.match(/IEMobile/i);return{browser:i[1]||"",version:i[2]||"0",isIE:n._detectIE(e),mobile:a,ieMobile:r}},UA:void0},i="undefined"!=typeofwindow?window:"undefined"!=typeoft?t:"undefined"!=typeofWorkerGlobalScope?self:{};if(n.UA=n._parseUA(i.navigator&&i.navigator.userAgent||""),i.Konva&&console.error("Konva instance is already exist in current eviroment. Please use only one instance."),i.Konva=n,n.global=i,"object"==typeofexports){if(i.window&&i.window.document)n.document=i.window.document,n.window=i.window;else{vara=require("canvas"),r=require("jsdom").jsdom;n.window=r("<!DOCTYPE html><html><head></head><body></body></html>").defaultView,n.document=n.window.document,n.window.Image=a.Image,n._nodeCanvas=a}returnvoid(module.exports=n)}"function"==typeofdefine&&define.amd&&define(function(){returnn}),n.document=document,n.window=window}("undefined"!=typeofwindow?window:global),function(){"use strict";Konva.Collection=function(){vart=[].slice.call(arguments),e=t.length,n=0;for(this.length=e;e>n;n++)this[n]=t[n];returnthis},Konva.Collection.prototype=[],Konva.Collection.prototype.each=function(t){for(vare=0;e<this.length;e++)t(this[e],e)},Konva.Collection.prototype.toArray=function(){vart,e=[],n=this.length;for(t=0;n>t;t++)e.push(this[t]);returne},Konva.Collection.toCollection=function(t){vare,n=newKonva.Collection,i=t.length;for(e=0;i>e;e++)n.push(t[e]);returnn},Konva.Collection._mapMethod=function(t){Konva.Collection.prototype[t]=function(){vare,n=this.length,i=[].slice.call(arguments);for(e=0;n>e;e++)this[e][t].apply(this[e],i);returnthis}},Konva.Collection.mapMethods=function(t){vare=t.prototype;for(varnine)Konva.Collection._mapMethod(n)},Konva.Transform=function(t){this.m=t&&t.slice()||[1,0,0,1,0,0]},Konva.Transform.prototype={copy:function(){returnnewKonva.Transform(this.m)},point:function(t){vare=this.m;return{x:e[0]*t.x+e[2]*t.y+e[4],y:e[1]*t.x+e[3]*t.y+e[5]}},translate:function(t,e){returnthis.m[4]+=this.m[0]*t+this.m[2]*e,this.m[5]+=this.m[1]*t+this.m[3]*e,this},scale:function(t,e){returnthis.m[0]*=t,this.m[1]*=t,this.m[2]*=e,this.m[3]*=e,this},rotate:function(t){vare=Math.cos(t),n=Math.sin(t),i=this.m[0]*e+this.m[2]*n,a=this.m[1]*e+this.m[3]*n,r=this.m[0]*-n+this.m[2]*e,o=this.m[1]*-n+this.m[3]*e;returnthis.m[0]=i,this.m[1]=a,this.m[2]=r,this.m[3]=o,this},getTranslation:function(){return{x:this.m[4],y:this.m[5]}},skew:function(t,e){varn=this.m[0]+this.m[2]*e,i=this.m[1]+this.m[3]*e,a=this.m[2]+this.m[0]*t,r=this.m[3]+this.m[1]*t;returnthis.m[0]=n,this.m[1]=i,this.m[2]=a,this.m[3]=r,this},multiply:function(t){vare=this.m[0]*t.m[0]+this.m[2]*t.m[1],n=this.m[1]*t.m[0]+this.m[3]*t.m[1],i=th
this.remove(),this},getAttr:function(e){varn=h+t.Util._capitalize(e);returnt.Util._isFunction(this[n])?this[n]():this.attrs[e]},getAncestors:function(){for(vare=this.getParent(),n=newt.Collection;e;)n.push(e),e=e.getParent();returnn},getAttrs:function(){returnthis.attrs||{}},setAttrs:function(e){varn,i;if(!e)returnthis;for(nine)n!==r&&(i=g+t.Util._capitalize(n),t.Util._isFunction(this[i])?this[i](e[n]):this._setAttr(n,e[n]));returnthis},isListening:function(){returnthis._getCache(d,this._isListening)},_isListening:function(){vart=this.getListening(),e=this.getParent();return"inherit"===t?e?e.isListening():!0:t},isVisible:function(){returnthis._getCache(S,this._isVisible)},_isVisible:function(){vart=this.getVisible(),e=this.getParent();return"inherit"===t?e?e.isVisible():!0:t},shouldDrawHit:function(t){vare=this.getLayer();returnt&&t.isCache||e&&e.hitGraphEnabled()&&this.isListening()&&this.isVisible()},show:function(){returnthis.setVisible(!0),this},hide:function(){returnthis.setVisible(!1),this},getZIndex:function(){returnthis.index||0},getAbsoluteZIndex:function(){functiont(h){for(e=[],n=h.length,i=0;n>i;i++)a=h[i],s++,a.nodeType!==p&&(e=e.concat(a.getChildren().toArray())),a._id===o._id&&(i=n);e.length>0&&e[0].getDepth()<=r&&t(e)}vare,n,i,a,r=this.getDepth(),o=this,s=0;returno.nodeType!==K&&t(o.getStage().getChildren()),s},getDepth:function(){for(vart=0,e=this.parent;e;)t++,e=e.parent;returnt},setPosition:function(t){returnthis.setX(t.x),this.setY(t.y),this},getPosition:function(){return{x:this.getX(),y:this.getY()}},getAbsolutePosition:function(e){varn=this.getAbsoluteTransform(e).getMatrix(),i=newt.Transform,a=this.offset();returni.m=n.slice(),i.translate(a.x,a.y),i.getTranslation()},setAbsolutePosition:function(t){vare,n=this._clearTransform();returnthis.attrs.x=n.x,this.attrs.y=n.y,deleten.x,deleten.y,e=this.getAbsoluteTransform(),e.invert(),e.translate(t.x,t.y),t={x:this.attrs.x+e.getTranslation().x,y:this.attrs.y+e.getTranslation().y},this.setPosition({x:t.x,y:t.y}),this._setTransform(n),this},_setTransform:function(t){vare;for(eint)this.attrs[e]=t[e];this._clearCache(y),this._clearSelfAndDescendantCache(n)},_clearTransform:function(){vart={x:this.getX(),y:this.getY(),rotation:this.getRotation(),scaleX:this.getScaleX(),scaleY:this.getScaleY(),offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),skewX:this.getSkewX(),skewY:this.getSkewY()};returnthis.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,this._clearCache(y),this._clearSelfAndDescendantCache(n),t},move:function(t){vare=t.x,n=t.y,i=this.getX(),a=this.getY();returnvoid0!==e&&(i+=e),void0!==n&&(a+=n),this.setPosition({x:i,y:a}),this},_eachAncestorReverse:function(t,e){varn,i,a=[],r=this.getParent();if(e&&e._id===this._id)returnt(this),!0;for(a.unshift(this);r&&(!e||r._id!==e._id);)a.unshift(r),r=r.parent;for(n=a.length,i=0;n>i;i++)t(a[i])},rotate:function(t){returnthis.setRotation(this.getRotation()+t),this},moveToTop:function(){if(!this.parent)returnt.Util.warn("Node has no parent. moveToTop function is ignored."),!1;vare=this.index;returnthis.parent.children.splice(e,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0},moveUp:function(){if(!this.parent)returnt.Util.warn("Node has no parent. moveUp function is ignored."),!1;vare=this.index,n=this.parent.getChildren().length;returnn-1>e?(this.parent.children.splice(e,1),this.parent.children.splice(e+1,0,this),this.parent._setChildrenIndices(),!0):!1},moveDown:function(){if(!this.parent)returnt.Util.warn("Node has no parent. moveDown function is ignored."),!1;vare=this.index;returne>0?(this.parent.children.splice(e,1),this.parent.children.splice(e-1,0,this),this.parent._setChildrenIndices(),!0):!1},moveToBottom:function(){if(!this.parent)returnt.Util.warn("Node has no parent. moveToBottom function is ignored."),!1;vare=this.index;returne>0?(this.parent.children.splice(e,1),this.parent.children.unshift(this),this.par
Konva.Filters.Sepia=function(t){vare,n,i,a,r,o,s,h,c,l=t.data,d=t.width,u=t.height,v=4*d;do{e=(u-1)*v,n=d;doi=e+4*(n-1),a=l[i],r=l[i+1],o=l[i+2],s=.393*a+.769*r+.189*o,h=.349*a+.686*r+.168*o,c=.272*a+.534*r+.131*o,l[i]=s>255?255:s,l[i+1]=h>255?255:h,l[i+2]=c>255?255:c,l[i+3]=l[i+3];while(--n)}while(--u)}}(),function(){"use strict";Konva.Filters.Solarize=function(t){vare=t.data,n=t.width,i=t.height,a=4*n,r=i;do{varo=(r-1)*a,s=n;do{varh=o+4*(s-1),c=e[h],l=e[h+1],d=e[h+2];c>127&&(c=255-c),l>127&&(l=255-l),d>127&&(d=255-d),e[h]=c,e[h+1]=l,e[h+2]=d}while(--s)}while(--r)}}(),function(){"use strict";vart=function(t,e,n){vari,a,r,o,s=t.data,h=e.data,c=t.width,l=t.height,d=n.polarCenterX||c/2,u=n.polarCenterY||l/2,v=0,f=0,g=0,p=0,m=Math.sqrt(d*d+u*u);a=c-d,r=l-u,o=Math.sqrt(a*a+r*r),m=o>m?o:m;var_,y,K,S,C=l,x=c,w=360/x*Math.PI/180;for(y=0;x>y;y+=1)for(K=Math.sin(y*w),S=Math.cos(y*w),_=0;C>_;_+=1)a=Math.floor(d+m*_/C*S),r=Math.floor(u+m*_/C*K),i=4*(r*c+a),v=s[i+0],f=s[i+1],g=s[i+2],p=s[i+3],i=4*(y+_*c),h[i+0]=v,h[i+1]=f,h[i+2]=g,h[i+3]=p},e=function(t,e,n){vari,a,r,o,s,h,c=t.data,l=e.data,d=t.width,u=t.height,v=n.polarCenterX||d/2,f=n.polarCenterY||u/2,g=0,p=0,m=0,_=0,y=Math.sqrt(v*v+f*f);a=d-v,r=u-f,h=Math.sqrt(a*a+r*r),y=h>y?h:y;varK,S,C,x,w=u,b=d,F=n.polarRotation||0;for(a=0;d>a;a+=1)for(r=0;u>r;r+=1)o=a-v,s=r-f,K=Math.sqrt(o*o+s*s)*w/y,S=(180*Math.atan2(s,o)/Math.PI+360+F)%360,S=S*b/360,C=Math.floor(S),x=Math.floor(K),i=4*(x*d+C),g=c[i+0],p=c[i+1],m=c[i+2],_=c[i+3],i=4*(r*d+a),l[i+0]=g,l[i+1]=p,l[i+2]=m,l[i+3]=_},n=Konva.Util.createCanvasElement();Konva.Filters.Kaleidoscope=function(i){vara,r,o,s,h,c,l,d,u,v,f=i.width,g=i.height,p=Math.round(this.kaleidoscopePower()),m=Math.round(this.kaleidoscopeAngle()),_=Math.floor(f*(m%360)/360);if(!(1>p)){n.width=f,n.height=g;vary=n.getContext("2d").getImageData(0,0,f,g);t(i,y,{polarCenterX:f/2,polarCenterY:g/2});for(varK=f/Math.pow(2,p);8>=K;)K=2*K,p-=1;K=Math.ceil(K);varS=K,C=0,x=S,w=1;for(_+K>f&&(C=S,x=0,w=-1),r=0;g>r;r+=1)for(a=C;a!==x;a+=w)o=Math.round(a+_)%f,u=4*(f*r+o),h=y.data[u+0],c=y.data[u+1],l=y.data[u+2],d=y.data[u+3],v=4*(f*r+a),y.data[v+0]=h,y.data[v+1]=c,y.data[v+2]=l,y.data[v+3]=d;for(r=0;g>r;r+=1)for(S=Math.floor(K),s=0;p>s;s+=1){for(a=0;S+1>a;a+=1)u=4*(f*r+a),h=y.data[u+0],c=y.data[u+1],l=y.data[u+2],d=y.data[u+3],v=4*(f*r+2*S-a-1),y.data[v+0]=h,y.data[v+1]=c,y.data[v+2]=l,y.data[v+3]=d;S*=2}e(y,i,{polarRotation:0})}},Konva.Factory.addGetterSetter(Konva.Node,"kaleidoscopePower",2,null,Konva.Factory.afterSetFilter),Konva.Factory.addGetterSetter(Konva.Node,"kaleidoscopeAngle",0,null,Konva.Factory.afterSetFilter)}(),function(){"use strict";Konva.Container=function(t){this.__init(t)},Konva.Util.addMethods(Konva.Container,{__init:function(t){this.children=newKonva.Collection,Konva.Node.call(this,t)},getChildren:function(t){if(!t)returnthis.children;vare=newKonva.Collection;returnthis.children.each(function(n){t(n)&&e.push(n)}),e},hasChildren:function(){returnthis.getChildren().length>0},removeChildren:function(){for(vart,e=Konva.Collection.toCollection(this.children),n=0;n<e.length;n++)t=e[n],deletet.parent,t.index=0,t.remove();returne=null,this.children=newKonva.Collection,this},destroyChildren:function(){for(vart,e=Konva.Collection.toCollection(this.children),n=0;n<e.length;n++)t=e[n],deletet.parent,t.index=0,t.destroy();returne=null,this.children=newKonva.Collection,this},add:function(t){if(arguments.length>1){for(vare=0;e<arguments.length;e++)this.add(arguments[e]);returnthis}if(t.getParent())returnt.moveTo(this),this;varn=this.children;returnthis._validateAdd(t),t.index=n.length,t.parent=this,n.push(t),this._fire("add",{child:t}),Konva.DD&&t.isDragging()&&Konva.DD.anim.setLayers(t.getLayer()),this},destroy:function(){returnthis.hasChildren()&&this.destroyChildren(),Konva.Node.prototype.destroy.call(this),this},find:function(t){vare,n,i,a,r,o,s,h=[],c=t.replace(/ /g,"").split(","),l=c.length;for(e=0;l>e;e++)if(i=c[e],Konva.Util.isValidSelector(i)||(Konva.Util.warn('Selector "'+i+'" is invalid. Allowed selectors examples are "#foo", ".b
},_validateAdd:function(t){vare=t.getType();"Shape"!==e&&Konva.Util["throw"]("You may only add shapes to a fast layer.")},_setCanvasSize:function(t,e){this.canvas.setSize(t,e)},hitGraphEnabled:function(){return!1},getIntersection:function(){returnnull},drawScene:function(t){vare=this.getLayer(),n=t||e&&e.getCanvas();returnthis.getClearBeforeDraw()&&n.getContext().clear(),Konva.Container.prototype.drawScene.call(this,n),this},draw:function(){returnthis.drawScene(),this},setVisible:function(t){returnKonva.Node.prototype.setVisible.call(this,t),t?this.getCanvas()._canvas.style.display="block":this.getCanvas()._canvas.style.display="none",this}}),Konva.Util.extend(Konva.FastLayer,Konva.BaseLayer),Konva.Collection.mapMethods(Konva.FastLayer)}(),function(){"use strict";Konva.Group=function(t){this.___init(t)},Konva.Util.addMethods(Konva.Group,{___init:function(t){this.nodeType="Group",Konva.Container.call(this,t)},_validateAdd:function(t){vare=t.getType();"Group"!==e&&"Shape"!==e&&Konva.Util["throw"]("You may only add groups and shapes to groups.")}}),Konva.Util.extend(Konva.Group,Konva.Container),Konva.Collection.mapMethods(Konva.Group)}(),function(t){"use strict";functione(t){setTimeout(t,1e3/60)}functionn(){returna.apply(t.global,arguments)}vari=function(){returnt.global.performance&&t.global.performance.now?function(){returnt.global.performance.now()}:function(){return(newDate).getTime()}}(),a=function(){returnt.global.requestAnimationFrame||t.global.webkitRequestAnimationFrame||t.global.mozRequestAnimationFrame||t.global.oRequestAnimationFrame||t.global.msRequestAnimationFrame||e}();t.Animation=function(e,n){vara=t.Animation;this.func=e,this.setLayers(n),this.id=a.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:i()}},t.Animation.prototype={setLayers:function(t){vare=[];returne=t?t.length>0?t:[t]:[],this.layers=e,this},getLayers:function(){returnthis.layers},addLayer:function(t){vare,n=this.layers,i=n.length;for(e=0;i>e;e++)if(n[e]._id===t._id)return!1;returnthis.layers.push(t),!0},isRunning:function(){vare,n=t.Animation,i=n.animations,a=i.length;for(e=0;a>e;e++)if(i[e].id===this.id)return!0;return!1},start:function(){vare=t.Animation;returnthis.stop(),this.frame.timeDiff=0,this.frame.lastTime=i(),e._addAnimation(this),this},stop:function(){returnt.Animation._removeAnimation(this),this},_updateFrameObject:function(t){this.frame.timeDiff=t-this.frame.lastTime,this.frame.lastTime=t,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}},t.Animation.animations=[],t.Animation.animIdCounter=0,t.Animation.animRunning=!1,t.Animation._addAnimation=function(t){this.animations.push(t),this._handleAnimation()},t.Animation._removeAnimation=function(t){vare,n=t.id,i=this.animations,a=i.length;for(e=0;a>e;e++)if(i[e].id===n){this.animations.splice(e,1);break}},t.Animation._runFrames=function(){vart,e,n,a,r,o,s,h,c,l={},d=this.animations;for(a=0;a<d.length;a++)if(t=d[a],e=t.layers,n=t.func,t._updateFrameObject(i()),o=e.length,c=n?n.call(t,t.frame)!==!1:!0)for(r=0;o>r;r++)s=e[r],void0!==s._id&&(l[s._id]=s);for(hinl)l.hasOwnProperty(h)&&l[h].draw()},t.Animation._animationLoop=function(){vare=t.Animation;e.animations.length?(e._runFrames(),n(e._animationLoop)):e.animRunning=!1},t.Animation._handleAnimation=function(){this.animRunning||(this.animRunning=!0,n(this._animationLoop))},t.BaseLayer.prototype.batchDraw=function(){vare=this,n=t.Animation;returnthis.batchAnim||(this.batchAnim=newn(function(){e.batchAnim.stop()},this)),this.lastBatchDrawTime=i(),this.batchAnim.isRunning()||this.batchAnim.start(),this},t.Stage.prototype.batchDraw=function(){returnthis.getChildren().each(function(t){t.batchDraw()}),this}}(Konva),function(){"use strict";vart={node:1,duration:1,easing:1,onFinish:1,yoyo:1},e=1,n=2,i=3,a=0,r=["fill","stroke","shadowColor"],o=function(t,e,n,i,a,r,o){this.prop=t,this.propFunc=e,this.begin=i,this._pos=i,this.duration=r,this._change=0,this.prevPos=0,this.yoyo=o,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=n,this._change=a-this.be