!function(t){"use strict";vare=Math.PI/180,n={version:"1.4.0",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;return!!t&&t.isDragging},isDragReady:function(){vart=n.DD;return!!t&&!!t.node},_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)},_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"!=typeoft?t:"undefined"!=typeofwindow?window:"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"!=typeofglobal?global:window),function(){"use strict";Konva.Collection=function(){vart=[].slice.call(arguments),e=t.length,n=0;for(this.length=e;n<e;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;t<n;t++)e.push(this[t]);returne},Konva.Collection.toCollection=function(t){vare,n=newKonva.Collection,i=t.length;for(e=0;e<i;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;e<n;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=this.m
t._setChildrenIndices(),deletethis.parent),this._clearSelfAndDescendantCache(_),this._clearSelfAndDescendantCache(n),this._clearSelfAndDescendantCache(S),this._clearSelfAndDescendantCache(d),this._clearSelfAndDescendantCache(e),this},destroy:function(){t._removeId(this.getId());for(vare=(this.getName()||"").split(/\s/g),n=0;n<e.length;n++){vari=e[n];t._removeName(i,this._id)}returnthis.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():t},isVisible:function(){returnthis._getCache(S,this._isVisible)},_isVisible:function(){vart=this.getVisible(),e=this.getParent();return"inherit"===t?!e||e.isVisible():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;i<n;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;i<n;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;returne<n-1&&(this.parent.children.splice(e,1),this.parent.children.splice(e+1,0,this),this.parent._setChildrenIndices(),!0)},moveDown:function(){if(!this.parent)returnt.Util.warn("Nodehasnoparent.moveDownfunctioni
Konva.Collection.mapMethods(Konva.Layer)}(),function(){"use strict";Konva.FastLayer=function(t){this.____init(t)},Konva.Util.addMethods(Konva.FastLayer,{____init:function(t){this.nodeType="Layer",this.canvas=newKonva.SceneCanvas,Konva.BaseLayer.call(this,t)},_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;e<i;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;e<a;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;e<a;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)for(r=0;r<o;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