var headbreaker=function(t){var e={};function i®{if(e)return e.exports;var n=e={i:r,l:!1,exports:{}};return t.call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,r){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},i.r=function(t){“undefined”!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:“Module”}),Object.defineProperty(t,“__esModule”,{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&“object”==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(i.r®,Object.defineProperty(r,“default”,{enumerable:!0,value:t}),2&e&&“string”!=typeof t)for(var n in t)i.d(r,n,function(e){return t}.bind(null,n));return r},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,“a”,e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p=“”,i(i.s=37)}([function(t,e,i){“use strict”;Object.defineProperty(e,“__esModule”,{value:!0});var r=i(3),n=i(2);e.Factory={addGetterSetter:function(t,e,i,r,n){this.addGetter(t,e,i),this.addSetter(t,e,r,n),this.addOverloadedGetterSetter(t,e)},addGetter:function(t,e,i){var n=“get”+r.Util._capitalize(e);t.prototype=t.prototype||function(){var t=this.attrs;return void 0===t?i:t}},addSetter:function(t,i,n,o){var a=“set”+r.Util._capitalize(i);t.prototype||e.Factory.overWriteSetter(t,i,n,o)},overWriteSetter:function(t,e,i,n){var o=“set”+r.Util._capitalize(e);t.prototype=function(t){return i&&null!=t&&(t=i.call(this,t,e)),this._setAttr(e,t),n&&n.call(this),this}},addComponentsGetterSetter:function(t,e,i,o,a){var s,h,c=i.length,l=r.Util._capitalize,u=“get”+l(e),d=“set”+l(e);t.prototype=function(){var t={};for(s=0;s]=this.getAttr(e+l(h));return t};var p=n.getComponentValidator(i);t.prototype=function(t){var i,r=this.attrs;for(i in o&&(t=o.call(this,t)),p&&p.call(this,t,e),t)t.hasOwnProperty(i)&&this._setAttr(e+l(i),t);return this._fireChangeEvent(e,r,t),a&&a.call(this),this},this.addOverloadedGetterSetter(t,e)},addOverloadedGetterSetter:function(t,e){var i=r.Util._capitalize(e),n=“set”+i,o=“get”+i;t.prototype=function(){return arguments.length?(this(arguments),this):this()}},addDeprecatedGetterSetter:function(t,e,i,n){r.Util.error(“Adding deprecated ”+e);var o=“get”+r.Util._capitalize(e),a=e+“ property is deprecated and will be removed soon. Look at Konva change log for more information.”;t.prototype=function(){r.Util.error(a);var t=this.attrs;return void 0===t?i:t},this.addSetter(t,e,n,(function(){r.Util.error(a)})),this.addOverloadedGetterSetter(t,e)},backCompat:function(t,e){r.Util.each(e,(function(e,i){var n=t.prototype,o=“get”+r.Util._capitalize(e),a=“set”+r.Util._capitalize(e);function s(){n.apply(this,arguments),r.Util.error('“'e'” method is deprecated and will be removed soon. Use “”'i'“ instead.')}t.prototype=s,t.prototype=s,t.prototype=s}))},afterSetFilter:function(){this._filterUpToDate=!1}}},function(t,e,i){”use strict“;(function(t){Object.defineProperty(e,”__esModule“,{value:!0});var i=Math.PI/180;var r=function(t){var e=t.indexOf(”msie “);if(e>0)return parseInt(t.substring(e+5,t.indexOf(”.“,e)),10);if(t.indexOf(”trident/“)>0){var i=t.indexOf(”rv:“);return parseInt(t.substring(i+3,t.indexOf(”.“,i)),10)}var r=t.indexOf(”edge/“);return r>0&&parseInt(t.substring(r+5,t.indexOf(”.“,r)),10)};e._parseUA=function(t){var e=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:(+)|)/.exec(e)||[],n=!!t.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i),o=!!t.match(/IEMobile/i);return{browser:i||”“,version:i||”0“,isIE:r(e),mobile:n,ieMobile:o}},e.glob=void 0!==t?t:”undefined“!=typeof window?window:”undefined“!=typeof WorkerGlobalScope?self:{},e.Konva={_global:e.glob,version:”6.0.0“,isBrowser:”undefined“!=typeof window&&(”[object Window]“==={}.toString.call(window)||”[object global]“==={}.toString.call(window)),isUnminified:/param/.test(function(t){}.toString()),dblClickWindow:400,getAngle:function(t){return e.Konva.angleDeg?t*i:t},enableTrace:!1,_pointerEventsEnabled:!1,hitOnDragEnabled:!1,captureTouchEventsEnabled:!1,listenClickTap:!1,inDblClickWindow:!1,pixelRatio:void 0,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:,isDragging:function(){return e.Konva.DD.isDragging},isDragReady:function(){return!!e.Konva.DD.node},UA:e._parseUA(e.glob.navigator&&e.glob.navigator.userAgent||”“),document:e.glob.document,_injectGlobal:function(t){e.glob.Konva=t},_parseUA:e._parseUA},e._NODES_REGISTRY={},e._registerNode=function(t){e._NODES_REGISTRY=t,e.Konva=t}}).call(this,i(46))},function(t,e,i){”use strict“;Object.defineProperty(e,”__esModule“,{value:!0});var r=i(1),n=i(3);function o(t){return n.Util._isString(t)?'”'t'“':”[object Number]“===Object.prototype.toString.call(t)||n.Util._isBoolean(t)?t:Object.prototype.toString.call(t)}e.RGBComponent=function(t){return t>255?255:t<0?0:Math.round(t)},e.alphaComponent=function(t){return t>1?1:t<1e-4?1e-4:t},e.getNumberValidator=function(){if(r.Konva.isUnminified)return function(t,e){return n.Util._isNumber(t)||n.Util.warn(o(t)+' is a not valid value for ”'e'“ attribute. The value should be a number.'),t}},e.getNumberOrAutoValidator=function(){if(r.Konva.isUnminified)return function(t,e){return n.Util._isNumber(t)||”auto“===t||n.Util.warn(o(t)+' is a not valid value for ”'e'“ attribute. The value should be a number or ”auto“.'),t}},e.getStringValidator=function(){if(r.Konva.isUnminified)return function(t,e){return n.Util._isString(t)||n.Util.warn(o(t)+' is a not valid value for ”'e'“ attribute. The value should be a string.'),t}},e.getFunctionValidator=function(){if(r.Konva.isUnminified)return function(t,e){return n.Util._isFunction(t)||n.Util.warn(o(t)+' is a not valid value for ”'e'“ attribute. The value should be a function.'),t}},e.getNumberArrayValidator=function(){if(r.Konva.isUnminified)return function(t,e){return n.Util._isArray(t)?t.forEach((function(t){n.Util._isNumber(t)||n.Util.warn('”'e'“ attribute has non numeric element 't”. Make sure that all elements are numbers.“)})):n.Util.warn(o(t)+' is a not valid value for ”'e'“ attribute. The value should be a array of numbers.'),t}},e.getBooleanValidator=function(){if(r.Konva.isUnminified)return function(t,e){return!0===t||!1===t||n.Util.warn(o(t)+' is a not valid value for ”'e'“ attribute. The value should be a boolean.'),t}},e.getComponentValidator=function(t){if(r.Konva.isUnminified)return function(e,i){return n.Util.isObject(e)||n.Util.warn(o(e)+' is a not valid value for ”'i'“ attribute. The value should be an object with properties '+t),e}}},function(t,e,i){”use strict“;Object.defineProperty(e,”__esModule“,{value:!0});var r=i(1),n=function(){function t(){}return t.toCollection=function(e){var i,r=new t,n=e.length;for(i=0;i);return r},t._mapMethod=function(e){t.prototype=function(){var t,i=this.length,r=[].slice.call(arguments);for(t=0;t[e].apply(this,r);return this}},t.mapMethods=function(e){var i=e.prototype;for(var r in i)t._mapMethod®},t}();e.Collection=n,n.prototype=[],n.prototype.each=function(t){for(var e=0;e,e)},n.prototype.toArray=function(){var t,e=[],i=this.length;for(t=0;t);return e};var o=function(){function t(t){void 0===t&&(t=),this.m=t&&t.slice()||}return t.prototype.copy=function(){return new t(this.m)},t.prototype.point=function(t){var e=this.m;return{x:e*t.x+e*t.y+e,y:e*t.x+e*t.y+e}},t.prototype.translate=function(t,e){return this.m+=this.m*t+this.m*e,this.m+=this.m*t+this.m*e,this},t.prototype.scale=function(t,e){return this.m*=t,this.m*=t,this.m*=e,this.m*=e,this},t.prototype.rotate=function(t){var e=Math.cos(t),i=Math.sin(t),r=this.m*e+this.m*i,n=this.m*e+this.m*i,o=this.m*-i+this.m*e,a=this.m*-i+this.m*e;return this.m=r,this.m=n,this.m=o,this.m=a,this},t.prototype.getTranslation=function(){return{x:this.m,y:this.m}},t.prototype.skew=function(t,e){var i=this.m+this.m*e,r=this.m+this.m*e,n=this.m+this.m*t,o=this.m+this.m*t;return this.m=i,this.m=r,this.m=n,this.m=o,this},t.prototype.multiply=function(t){var e=this.m*t.m+this.m*t.m,i=this.m*t.m+this.m*t.m,r=this.m*t.m+this.m*t.m,n=this.m*t.m+this.m*t.m,o=this.m*t.m+this.m*t.m+this.m,a=this.m*t.m+this.m*t.m+this.m;return this.m=e,this.m=i,this.m=r,this.m=n,this.m=o,this.m=a,this},t.prototype.invert=function(){var t=1/(this.m*this.m-this.m*this.m),e=this.m*t,i=-this.m*t,r=-this.m*t,n=this.m*t,o=t*(this.m*this.m-this.m*this.m),a=t*(this.m*this.m-this.m*this.m);return this.m=e,this.m=i,this.m=r,this.m=n,this.m=o,this.m=a,this},t.prototype.getMatrix=function(){return this.m},t.prototype.setAbsolutePosition=function(t,e){var i=this.m,r=this.m,n=this.m,o=this.m,a=this.m,s=(i*(e-this.m)-r*(t-a))/(i*o-r*n),h=(t-a-n*s)/i;return this.translate(h,s)},t.prototype.decompose=function(){var t=this.m,i=this.m,r=this.m,n=this.m,o=t*n-i*r,a={x:this.m,y:this.m,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!=t||0!=i){var s=Math.sqrt(t*t+i*i);a.rotation=i>0?Math.acos(t/s):-Math.acos(t/s),a.scaleX=s,a.scaleY=o/s,a.skewX=(t*r+i*n)/o,a.skewY=0}else if(0!=r||0!=n){var h=Math.sqrt(r*r+n*n);a.rotation=Math.PI/2-(n>0?Math.acos(-r/h):-Math.acos(r/h)),a.scaleX=o/h,a.scaleY=h,a.skewX=0,a.skewY=(t*r+i*n)/o}return a.rotation=e.Util._getRotation(a.rotation),a},t}();e.Transform=o;var a=Math.PI/180,s=180/Math.PI,h={aliceblue:,antiquewhite:,aqua:,aquamarine:,azure:,beige:,bisque:,black:,blanchedalmond:,blue:,blueviolet:,brown:,burlywood:,cadetblue:,chartreuse:,chocolate:,coral:,cornflowerblue:,cornsilk:,crimson:,cyan:,darkblue:,darkcyan:,darkgoldenrod:,darkgray:,darkgreen:,darkgrey:,darkkhaki:,darkmagenta:,darkolivegreen:,darkorange:,darkorchid:,darkred:,darksalmon:,darkseagreen:,darkslateblue:,darkslategray:,darkslategrey:,darkturquoise:,darkviolet:,deeppink:,deepskyblue:,dimgray:,dimgrey:,dodgerblue:,firebrick:,floralwhite:,forestgreen:,fuchsia:,gainsboro:,ghostwhite:,gold:,goldenrod:,gray:,green:,greenyellow:,grey:,honeydew:,hotpink:,indianred:,indigo:,ivory:,khaki:,lavender:,lavenderblush:,lawngreen:,lemonchiffon:,lightblue:,lightcoral:,lightcyan:,lightgoldenrodyellow:,lightgray:,lightgreen:,lightgrey:,lightpink:,lightsalmon:,lightseagreen:,lightskyblue:,lightslategray:,lightslategrey:,lightsteelblue:,lightyellow:,lime:,limegreen:,linen:,magenta:,maroon:,mediumaquamarine:,mediumblue:,mediumorchid:,mediumpurple:,mediumseagreen:,mediumslateblue:,mediumspringgreen:,mediumturquoise:,mediumvioletred:,midnightblue:,mintcream:,mistyrose:,moccasin:,navajowhite:,navy:,oldlace:,olive:,olivedrab:,orange:,orangered:,orchid:,palegoldenrod:,palegreen:,paleturquoise:,palevioletred:,papayawhip:,peachpuff:,peru:,pink:,plum:,powderblue:,purple:,rebeccapurple:,red:,rosybrown:,royalblue:,saddlebrown:,salmon:,sandybrown:,seagreen:,seashell:,sienna:,silver:,skyblue:,slateblue:,slategray:,slategrey:,snow:,springgreen:,steelblue:,tan:,teal:,thistle:,transparent:,tomato:,turquoise:,violet:,wheat:,white:,whitesmoke:,yellow:,yellowgreen:},c=/rgb((d{1,3}),(d{1,3}),(d{1,3}))/,l=[];e.Util={_isElement:function(t){return!(!t||1!=t.nodeType)},_isFunction:function(t){return!!(t&&t.constructor&&t.call&&t.apply)},_isPlainObject:function(t){return!!t&&t.constructor===Object},_isArray:function(t){return”[object Array]“===Object.prototype.toString.call(t)},_isNumber:function(t){return”[object Number]“===Object.prototype.toString.call(t)&&!isNaN(t)&&isFinite(t)},_isString:function(t){return”[object String]“===Object.prototype.toString.call(t)},_isBoolean:function(t){return”[object Boolean]“===Object.prototype.toString.call(t)},isObject:function(t){return t instanceof Object},isValidSelector:function(t){if(”string“!=typeof t)return!1;var e=t;return”#“===e||”.“===e||e===e.toUpperCase()},_sign:function(t){return 0===t?0:t>0?1:-1},requestAnimFrame:function(t){l.push(t),1===l.length&&requestAnimationFrame((function(){var t=l;l=[],t.forEach((function(t){t()}))}))},createCanvasElement:function(){var t=document.createElement(”canvas“);try{t.style=t.style||{}}catch(t){}return t},createImageElement:function(){return document.createElement(”img“)},_isInDocument:function(t){for(;t=t.parentNode;)if(t==document)return!0;return!1},_simplifyArray:function(t){var i,r,n=[],o=t.length,a=e.Util;for(i=0;i,a._isNumber®?r=Math.round(1e3*r)/1e3:a._isString®||(r=r.toString()),n.push®;return n},_urlToImage:function(t,e){var i=new r.glob.Image;i.onload=function(){e(i)},i.src=t},_rgbToHex:function(t,e,i){return((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1)},_hexToRgb:function(t){t=t.replace(”#“,”“);var e=parseInt(t,16);return{r:e>>16&255,g:e>>8&255,b:255&e}},getRandomColor:function(){for(var t=(16777215*Math.random()<<0).toString(16);t.length<6;)t=”0“+t;return”#“+t},get:function(t,e){return void 0===t?e:t},getRGB:function(t){var e;return t in h?{r:(e=h)[0],g:e,b:e}:”#“===t?this._hexToRgb(t.substring(1)):”rgb(“===t.substr(0,4)?(e=c.exec(t.replace(/ /g,”“)),{r:parseInt(e,10),g:parseInt(e,10),b:parseInt(e,10)}):{r:0,g:0,b:0}},colorToRGBA:function(t){return t=t||”black“,e.Util._namedColorToRBA(t)||e.Util._hex3ColorToRGBA(t)||e.Util._hex6ColorToRGBA(t)||e.Util._rgbColorToRGBA(t)||e.Util._rgbaColorToRGBA(t)||e.Util._hslColorToRGBA(t)},_namedColorToRBA:function(t){var e=h;return e?{r:e,g:e,b:e,a:1}:null},_rgbColorToRGBA:function(t){if(0===t.indexOf(”rgb(“)){var e=(t=t.match(/rgb((+))/)[1]).split(/ *, */).map(Number);return{r:e,g:e,b:e,a:1}}},_rgbaColorToRGBA:function(t){if(0===t.indexOf(”rgba(“)){var e=(t=t.match(/rgba((+))/)[1]).split(/ *, */).map(Number);return{r:e,g:e,b:e,a:e}}},_hex6ColorToRGBA:function(t){if(”#“===t&&7===t.length)return{r:parseInt(t.slice(1,3),16),g:parseInt(t.slice(3,5),16),b:parseInt(t.slice(5,7),16),a:1}},_hex3ColorToRGBA:function(t){if(”#“===t&&4===t.length)return{r:parseInt(t+t,16),g:parseInt(t+t,16),b:parseInt(t+t,16),a:1}},_hslColorToRGBA:function(t){if(/hsl((d+),s*(+)%,s*(+)%)/g.test(t)){var e=/hsl((d+),s*(+)%,s*(+)%)/g.exec(t),i=(e[0],e.slice(1)),r=Number(i)/360,n=Number(i)/100,o=Number(i)/100,a=void 0,s=void 0,h=void 0;if(0===n)return h=255*o,{r:Math.round(h),g:Math.round(h),b:Math.round(h),a:1};for(var c=2*o-(a=o<.5?o*(1+n):o+n-o*n),l=,u=0;u<3;u++)(s=r+1/3*-(u-1))<0&&s++,s>1&&s–,h=6*s<1?c+6*(a-c)*s:2*s<1?a:3*s<2?c+(a-c)*(2/3-s)*6:c,l=255*h;return{r:Math.round(l),g:Math.round(l),b:Math.round(l),a:1}}},haveIntersection:function(t,e){return!(e.x>t.x+t.width||e.x+e.width<t.x||e.y>t.y+t.height||e.y+e.height<t.y)},cloneObject:function(t){var e={};for(var i in t)this._isPlainObject(t)?e=this.cloneObject(t):this._isArray(t)?e=this.cloneArray(t):e=t;return e},cloneArray:function(t){return t.slice(0)},_degToRad:function(t){return t*a},_radToDeg:function(t){return t*s},_getRotation:function(t){return r.Konva.angleDeg?e.Util._radToDeg(t):t},_capitalize:function(t){return t.charAt(0).toUpperCase()+t.slice(1)},throw:function(t){throw new Error(”Konva error: “+t)},error:function(t){console.error(”Konva error: “+t)},warn:function(t){r.Konva.showWarnings&&console.warn(”Konva warning: “+t)},extend:function(t,e){function i(){this.constructor=t}i.prototype=e.prototype;var r=t.prototype;for(var n in t.prototype=new i,r)r.hasOwnProperty(n)&&(t.prototype=r);t.__super__=e.prototype,t.super=e},_getControlPoints:function(t,e,i,r,n,o,a){var s=Math.sqrt(Math.pow(i-t,2)+Math.pow(r-e,2)),h=Math.sqrt(Math.pow(n-i,2)+Math.pow(o-r,2)),c=a*s/(s+h),l=a*h/(s+h);return},_expandPoints:function(t,i){var r,n,o=t.length,a=[];for(r=2;r,t,t,t,t,t,i),a.push(n),a.push(n),a.push(t),a.push(t),a.push(n),a.push(n);return a},each:function(t,e){for(var i in t)e(i,t)},_inRange:function(t,e,i){return e<=t&&t<i},_getProjectionToSegment:function(t,e,i,r,n,o){var a,s,h,c=(t-i)*(t-i)+(e-r)*(e-r);if(0==c)a=t,s=e,h=(n-i)*(n-i)+(o-r)*(o-r);else{var l=((n-t)*(i-t)+(o-e)*(r-e))/c;l<0?(a=t,s=e,h=(t-n)*(t-n)+(e-o)*(e-o)):l>1?(a=i,s=r,h=(i-n)*(i-n)+(r-o)*(r-o)):h=((a=t+l*(i-t))-n)*(a-n)+((s=e+l*(r-e))-o)*(s-o)}return},_getProjectionToLine:function(t,i,r){var n=e.Util.cloneObject(t),o=Number.MAX_VALUE;return i.forEach((function(a,s){if(r||s!==i.length-1){var h=i,c=e.Util._getProjectionToSegment(a.x,a.y,h.x,h.y,t.x,t.y),l=c,u=c,d=c;d<o&&(n.x=l,n.y=u,o=d)}})),n},_prepareArrayForTween:function(t,i,r){var n,o=[],a=;if(t.length>i.length){var s=i;i=t,t=s}for(n=0;n<t.length;n+=2)o.push({x:t,y:t});for(n=0;n<i.length;n+=2)a.push({x:i,y:i});var h=[];return a.forEach((function(t){var i=e.Util._getProjectionToLine(t,o,r);h.push(i.x),h.push(i.y)})),h},_prepareToStringify:function(t){var i;for(var r in t.visitedByCircularReferenceRemoval=!0,t)if(t.hasOwnProperty®&&t&&”object“==typeof t)if(i=Object.getOwnPropertyDescriptor(t,r),t.visitedByCircularReferenceRemoval||e.Util._isElement(t)){if(!i.configurable)return null;delete t}else if(null===e.Util._prepareToStringify(t)){if(!i.configurable)return null;delete t}return delete t.visitedByCircularReferenceRemoval,t},_assign:function(t,e){for(var i in e)t=e;return t},_getFirstPointerId:function(t){return t.touches?t.changedTouches.identifier:999}}},function(t,e,i){”use strict“;Object.defineProperty(e,”__esModule“,{value:!0});var r=i(3),n=i(0),o=i(11),a=i(1),s=i(18),h=i(2);e.ids={},e.names={};e._removeId=function(t,i){t&&e.ids===i&&delete e.ids},e._addName=function(t,i){i&&(e.names||(e.names=[]),e.names.push(t))},e._removeName=function(t,i){if(t){var r=e.names;if®{for(var n=0;n<r.length;n++){r._id===i&&r.splice(n,1)}0===r.length&&delete e.names}}};var c=.join(” “),l=(.join(” “),new r.Collection),u=1,d=function(){function t(t){var e=this;this._id=u++,this.eventListeners={},this.attrs={},this.index=0,this.parent=null,this._cache=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this.children=l,this._dragEventId=null,this.setAttrs(t),this.on(c,(function(){e._batchingTransformChange?e._needClearTransformCache=!0:(e._clearCache(”transform“),e._clearSelfAndDescendantCache(”absoluteTransform“))})),this.on(”visibleChange.konva“,(function(){e._clearSelfAndDescendantCache(”visible“)})),this.on(”listeningChange.konva“,(function(){e._clearSelfAndDescendantCache(”listening“)})),this.on(”opacityChange.konva“,(function(){e._clearSelfAndDescendantCache(”absoluteOpacity“)}))}return t.prototype.hasChildren=function(){return!1},t.prototype.getChildren=function(){return l},t.prototype._clearCache=function(t){t?this._cache.delete(t):this._cache.clear()},t.prototype._getCache=function(t,e){var i=this._cache.get(t);return void 0===i&&(i=e.call(this),this._cache.set(t,i)),i},t.prototype._getCanvasCache=function(){return this._cache.get(”canvas“)},t.prototype._clearSelfAndDescendantCache=function(t,e){this._clearCache(t),e&&”absoluteTransform“===t&&this.fire(”_clearTransformCache“),this.isCached()||this.children&&this.children.each((function(e){e._clearSelfAndDescendantCache(t,!0)}))},t.prototype.clearCache=function(){return this._cache.delete(”canvas“),this._clearSelfAndDescendantCache(),this},t.prototype.cache=function(t){var e=t||{},i={};void 0!==e.x&&void 0!==e.y&&void 0!==e.width&&void 0!==e.height||(i=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()}));var n=Math.ceil(e.width||i.width),a=Math.ceil(e.height||i.height),s=e.pixelRatio,h=void 0===e.x?i.x:e.x,c=void 0===e.y?i.y:e.y,l=e.offset||0,u=e.drawBorder||!1;if(n&&a){n+=2*l,a+=2*l,h-=l,c-=l;var d=new o.SceneCanvas({pixelRatio:s,width:n,height:a}),p=new o.SceneCanvas({pixelRatio:s,width:0,height:0}),f=new o.HitCanvas({pixelRatio:1,width:n,height:a}),g=d.getContext(),y=f.getContext();return f.isCache=!0,this._cache.delete(”canvas“),this._filterUpToDate=!1,!1===e.imageSmoothingEnabled&&(d.getContext()._context.imageSmoothingEnabled=!1,p.getContext()._context.imageSmoothingEnabled=!1),g.save(),y.save(),g.translate(-h,-c),y.translate(-h,-c),this._isUnderCache=!0,this._clearSelfAndDescendantCache(”absoluteOpacity“),this._clearSelfAndDescendantCache(”absoluteScale“),this.drawScene(d,this,!0),this.drawHit(f,this,!0),this._isUnderCache=!1,g.restore(),y.restore(),u&&(g.save(),g.beginPath(),g.rect(0,0,n,a),g.closePath(),g.setAttr(”strokeStyle“,”red“),g.setAttr(”lineWidth“,5),g.stroke(),g.restore()),this._cache.set(”canvas“,{scene:d,filter:p,hit:f,x:h,y:c}),this}r.Util.error(”Can not cache the node. Width or height of the node equals 0. Caching is skipped.“)},t.prototype.isCached=function(){return this._cache.has(”canvas“)},t.prototype.getClientRect=function(t){throw new Error('abstract ”getClientRect“ method call')},t.prototype._transformedRect=function(t,e){var i,r,n,o,a=,s=this.getAbsoluteTransform(e);return a.forEach((function(t){var e=s.point(t);void 0===i&&(i=n=e.x,r=o=e.y),i=Math.min(i,e.x),r=Math.min(r,e.y),n=Math.max(n,e.x),o=Math.max(o,e.y)})),{x:i,y:r,width:n-i,height:o-r}},t.prototype._drawCachedSceneCanvas=function(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);var e=this._getCanvasCache();t.translate(e.x,e.y);var i=this._getCachedSceneCanvas(),r=i.pixelRatio;t.drawImage(i._canvas,0,0,i.width/r,i.height/r),t.restore()},t.prototype._drawCachedHitCanvas=function(t){var e=this._getCanvasCache(),i=e.hit;t.save(),t.translate(e.x,e.y),t.drawImage(i._canvas,0,0),t.restore()},t.prototype._getCachedSceneCanvas=function(){var t,e,i,n,o=this.filters(),a=this._getCanvasCache(),s=a.scene,h=a.filter,c=h.getContext();if(o){if(!this._filterUpToDate){var l=s.pixelRatio;h.setSize(s.width/s.pixelRatio,s.height/s.pixelRatio);try{for(t=o.length,c.clear(),c.drawImage(s._canvas,0,0,s.getWidth()/l,s.getHeight()/l),e=c.getImageData(0,0,h.getWidth(),h.getHeight()),i=0;i)?(n.call(this,e),c.putImageData(e,0,0)):r.Util.error(”Filter should be type of function, but got “+typeof n+” instead. Please check correct filters“)}catch(t){r.Util.error(”Unable to apply filter. “t.message” This post my help you konvajs.org/docs/posts/Tainted_Canvas.html.“)}this._filterUpToDate=!0}return h}return s},t.prototype.on=function(t,e){if(3===arguments.length)return this._delegate.apply(this,arguments);var i,r,n,o,a=t.split(” “),s=a.length;for(i=0;i.split(”.“)),o=r||”“,this.eventListeners||(this.eventListeners=[]),this.eventListeners.push({name:o,handler:e});return this},t.prototype.off=function(t,e){var i,r,n,o,a,s=(t||”“).split(” “),h=s.length;if(!t)for(r in this.eventListeners)this._off®;for(i=0;i.split(”.“)),a=n,o)this.eventListeners&&this._off(o,a,e);else for(r in this.eventListeners)this._off(r,a,e);return this},t.prototype.dispatchEvent=function(t){var e={target:this,type:t.type,evt:t};return this.fire(t.type,e),this},t.prototype.addEventListener=function(t,e){return this.on(t,(function(t){e.call(this,t.evt)})),this},t.prototype.removeEventListener=function(t){return this.off(t),this},t.prototype._delegate=function(t,e,i){var n=this;this.on(t,(function(t){for(var o=t.target.findAncestors(e,!0,n),a=0;a,i.call(o,t)}))},t.prototype.remove=function(){return this.isDragging()&&this.stopDrag(),s.DD._dragElements.delete(this._id),this._remove(),this},t.prototype._clearCaches=function(){this._clearSelfAndDescendantCache(”absoluteTransform“),this._clearSelfAndDescendantCache(”absoluteOpacity“),this._clearSelfAndDescendantCache(”absoluteScale“),this._clearSelfAndDescendantCache(”stage“),this._clearSelfAndDescendantCache(”visible“),this._clearSelfAndDescendantCache(”listening“)},t.prototype._remove=function(){this._clearCaches();var t=this.getParent();t&&t.children&&(t.children.splice(this.index,1),t._setChildrenIndices(),this.parent=null)},t.prototype.destroy=function(){e._removeId(this.id(),this);for(var t=(this.name()||”“).split(/s/g),i=0;i<t.length;i++){var r=t;e._removeName(r,this._id)}return this.remove(),this},t.prototype.getAttr=function(t){var e=”get“+r.Util._capitalize(t);return r.Util._isFunction(this)?this():this.attrs},t.prototype.getAncestors=function(){for(var t=this.getParent(),e=new r.Collection;t;)e.push(t),t=t.getParent();return e},t.prototype.getAttrs=function(){return this.attrs||{}},t.prototype.setAttrs=function(t){var e,i;if(!t)return this;for(e in t)”children“!==e&&(i=”set“+r.Util._capitalize(e),r.Util._isFunction(this)?this(t):this._setAttr(e,t));return this},t.prototype.isListening=function(){return this._getCache(”listening“,this._isListening)},t.prototype._isListening=function(){var t=this.listening(),e=this.getParent();return”inherit“===t?!e||e.isListening():t},t.prototype.isVisible=function(){return this._getCache(”visible“,this._isVisible)},t.prototype._isVisible=function(t){var e=this.visible(),i=this.getParent();return”inherit“===e?!i||i===t||i._isVisible(t):t&&t!==i?e&&i._isVisible(t):e},t.prototype.shouldDrawHit=function(){var t=this.getLayer();return!t&&this.isListening()&&this.isVisible()||t&&t.hitGraphEnabled()&&this.isListening()&&this.isVisible()},t.prototype.show=function(){return this.visible(!0),this},t.prototype.hide=function(){return this.visible(!1),this},t.prototype.getZIndex=function(){return this.index||0},t.prototype.getAbsoluteZIndex=function(){var t,e,i,r,n=this.getDepth(),o=this,a=0;return”Stage“!==o.nodeType&&function s(h){for(t=[],e=h.length,i=0;i,a++,”Shape“!==r.nodeType&&(t=t.concat(r.getChildren().toArray())),r._id===o._id&&(i=e);t.length>0&&t.getDepth()<=n&&s(t)}(o.getStage().getChildren()),a},t.prototype.getDepth=function(){for(var t=0,e=this.parent;e;)t++,e=e.parent;return t},t.prototype._batchTransformChanges=function(t){this._batchingTransformChange=!0,t(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(”transform“),this._clearSelfAndDescendantCache(”absoluteTransform“,!0)),this._needClearTransformCache=!1},t.prototype.setPosition=function(t){var e=this;return this._batchTransformChanges((function(){e.x(t.x),e.y(t.y)})),this},t.prototype.getPosition=function(){return{x:this.x(),y:this.y()}},t.prototype.getAbsolutePosition=function(t){for(var e=!1,i=this.parent;i;){if(i.isCached()){e=!0;break}i=i.parent}e&&!t&&(t=!0);var n=this.getAbsoluteTransform(t).getMatrix(),o=new r.Transform,a=this.offset();return o.m=n.slice(),o.translate(a.x,a.y),o.getTranslation()},t.prototype.setAbsolutePosition=function(t){var e,i=this._clearTransform();return this.attrs.x=i.x,this.attrs.y=i.y,delete i.x,delete i.y,this._clearCache(”transform“),(e=this._getAbsoluteTransform()).invert(),e.translate(t.x,t.y),t={x:this.attrs.x+e.getTranslation().x,y:this.attrs.y+e.getTranslation().y},this._setTransform(i),this.setPosition({x:t.x,y:t.y}),this},t.prototype._setTransform=function(t){var e;for(e in t)this.attrs=t},t.prototype._clearTransform=function(){var t={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.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,t},t.prototype.move=function(t){var e=t.x,i=t.y,r=this.x(),n=this.y();return void 0!==e&&(r+=e),void 0!==i&&(n+=i),this.setPosition({x:r,y:n}),this},t.prototype._eachAncestorReverse=function(t,e){var i,r,n=[],o=this.getParent();if(e&&e._id===this._id)t(this);else{for(n.unshift(this);o&&(!e||o._id!==e._id);)n.unshift(o),o=o.parent;for(i=n.length,r=0;r)}},t.prototype.rotate=function(t){return this.rotation(this.rotation()+t),this},t.prototype.moveToTop=function(){if(!this.parent)return r.Util.warn(”Node has no parent. moveToTop function is ignored.“),!1;var t=this.index;return this.parent.children.splice(t,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0},t.prototype.moveUp=function(){if(!this.parent)return r.Util.warn(”Node has no parent. moveUp function is ignored.“),!1;var t=this.index;return t<this.parent.getChildren().length-1&&(this.parent.children.splice(t,1),this.parent.children.splice(t+1,0,this),this.parent._setChildrenIndices(),!0)},t.prototype.moveDown=function(){if(!this.parent)return r.Util.warn(”Node has no parent. moveDown function is ignored.“),!1;var t=this.index;return t>0&&(this.parent.children.splice(t,1),this.parent.children.splice(t-1,0,this),this.parent._setChildrenIndices(),!0)},t.prototype.moveToBottom=function(){if(!this.parent)return r.Util.warn(”Node has no parent. moveToBottom function is ignored.“),!1;var t=this.index;return t>0&&(this.parent.children.splice(t,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0)},t.prototype.setZIndex=function(t){if(!this.parent)return r.Util.warn(”Node has no parent. zIndex parameter is ignored.“),this;(t<0||t>=this.parent.children.length)&&r.Util.warn(”Unexpected value “t” for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to “+(this.parent.children.length-1)+”.“);var e=this.index;return this.parent.children.splice(e,1),this.parent.children.splice(t,0,this),this.parent._setChildrenIndices(),this},t.prototype.getAbsoluteOpacity=function(){return this._getCache(”absoluteOpacity“,this._getAbsoluteOpacity)},t.prototype._getAbsoluteOpacity=function(){var t=this.opacity(),e=this.getParent();return e&&!e._isUnderCache&&(t*=e.getAbsoluteOpacity()),t},t.prototype.moveTo=function(t){return this.getParent()!==t&&(this._remove(),t.add(this)),this},t.prototype.toObject=function(){var t,e,i,n,o={},a=this.getAttrs();for(t in o.attrs={},a)e=a,r.Util.isObject(e)&&!r.Util._isPlainObject(e)&&!r.Util._isArray(e)||(i=”function“==typeof this&&this,delete a,n=i?i.call(this):null,a=e,n!==e&&(o.attrs=e));return o.className=this.getClassName(),r.Util._prepareToStringify(o)},t.prototype.toJSON=function(){return JSON.stringify(this.toObject())},t.prototype.getParent=function(){return this.parent},t.prototype.findAncestors=function(t,e,i){var r=[];e&&this._isMatch(t)&&r.push(this);for(var n=this.parent;n;){if(n===i)return r;n._isMatch(t)&&r.push(n),n=n.parent}return r},t.prototype.isAncestorOf=function(t){return!1},t.prototype.findAncestor=function(t,e,i){return this.findAncestors(t,e,i)},t.prototype._isMatch=function(t){if(!t)return!1;if(”function“==typeof t)return t(this);var e,i,n=t.replace(/ /g,”“).split(”,“),o=n.length;for(e=0;e,r.Util.isValidSelector(i)||(r.Util.warn('Selector ”'i'“ is invalid. Allowed selectors examples are ”#foo“, ”.bar“ or ”Group“.'),r.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like ”Triangle“.'),r.Util.warn(”Konva is awesome, right?“)),”#“===i.charAt(0)){if(this.id()===i.slice(1))return!0}else if(”.“===i.charAt(0)){if(this.hasName(i.slice(1)))return!0}else if(this.className===i||this.nodeType===i)return!0;return!1},t.prototype.getLayer=function(){var t=this.getParent();return t?t.getLayer():null},t.prototype.getStage=function(){return this._getCache(”stage“,this._getStage)},t.prototype._getStage=function(){var t=this.getParent();return t?t.getStage():void 0},t.prototype.fire=function(t,e,i){return void 0===e&&(e={}),e.target=e.target||this,i?this._fireAndBubble(t,e):this._fire(t,e),this},t.prototype.getAbsoluteTransform=function(t){return t?this._getAbsoluteTransform(t):this._getCache(”absoluteTransform“,this._getAbsoluteTransform)},t.prototype._getAbsoluteTransform=function(t){var e;if(t)return e=new r.Transform,this._eachAncestorReverse((function(t){var i=t.transformsEnabled();”all“===i?e.multiply(t.getTransform()):”position“===i&&e.translate(t.x()-t.offsetX(),t.y()-t.offsetY())}),t),e;e=this.parent?this.parent.getAbsoluteTransform().copy():new r.Transform;var i=this.transformsEnabled();return”all“===i?e.multiply(this.getTransform()):”position“===i&&e.translate(this.x()-this.offsetX(),this.y()-this.offsetY()),e},t.prototype.getAbsoluteScale=function(t){for(var e=this;e;)e._isUnderCache&&(t=e),e=e.getParent();var i=this.getAbsoluteTransform(t).decompose();return{x:i.scaleX,y:i.scaleY}},t.prototype.getAbsoluteRotation=function(){return this.getAbsoluteTransform().decompose().rotation},t.prototype.getTransform=function(){return this._getCache(”transform“,this._getTransform)},t.prototype._getTransform=function(){var t=new r.Transform,e=this.x(),i=this.y(),n=a.Konva.getAngle(this.rotation()),o=this.scaleX(),s=this.scaleY(),h=this.skewX(),c=this.skewY(),l=this.offsetX(),u=this.offsetY();return 0===e&&0===i||t.translate(e,i),0!==n&&t.rotate(n),0===h&&0===c||t.skew(h,c),1===o&&1===s||t.scale(o,s),0===l&&0===u||t.translate(-1*l,-1*u),t},t.prototype.clone=function(t){var e,i,n,o,a,s=r.Util.cloneObject(this.attrs);for(e in t)s=t;var h=new this.constructor(s);for(e in this.eventListeners)for(n=(i=this.eventListeners).length,o=0;o).name.indexOf(”konva“)<0&&(h.eventListeners||(h.eventListeners=[]),h.eventListeners.push(a));return h},t.prototype._toKonvaCanvas=function(t){t=t||{};var e=this.getClientRect(),i=this.getStage(),r=void 0!==t.x?t.x:e.x,n=void 0!==t.y?t.y:e.y,a=t.pixelRatio||1,s=new o.SceneCanvas({width:t.width||e.width||(i?i.width():0),height:t.height||e.height||(i?i.height():0),pixelRatio:a}),h=s.getContext();return h.save(),(r||n)&&h.translate(-1*r,-1*n),this.drawScene(s),h.restore(),s},t.prototype.toCanvas=function(t){return this._toKonvaCanvas(t)._canvas},t.prototype.toDataURL=function(t){var e=(t=t||{}).mimeType||null,i=t.quality||null,r=this._toKonvaCanvas(t).toDataURL(e,i);return t.callback&&t.callback®,r},t.prototype.toImage=function(t){if(!t||!t.callback)throw”callback required for toImage method config argument“;var e=t.callback;delete t.callback,r.Util._urlToImage(this.toDataURL(t),(function(t){e(t)}))},t.prototype.setSize=function(t){return this.width(t.width),this.height(t.height),this},t.prototype.getSize=function(){return{width:this.width(),height:this.height()}},t.prototype.getClassName=function(){return this.className||this.nodeType},t.prototype.getType=function(){return this.nodeType},t.prototype.getDragDistance=function(){return void 0!==this.attrs.dragDistance?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():a.Konva.dragDistance},t.prototype._off=function(t,e,i){var r,n,o,a=this.eventListeners;for(r=0;r.name,o=a.handler,!(”konva“===n&&”konva“!==e||e&&n!==e||i&&i!==o)){if(a.splice(r,1),0===a.length){delete this.eventListeners;break}r–}},t.prototype._fireChangeEvent=function(t,e,i){this._fire(t+”Change“,{oldVal:e,newVal:i})},t.prototype.setId=function(t){var i=this.id();return e._removeId(i,this),function(t,i){i&&(e.ids=t)}(this,t),this._setAttr(”id“,t),this},t.prototype.setName=function(t){var i,r,n=(this.name()||”“).split(/s/g),o=(t||”“).split(/s/g);for(r=0;r,-1===o.indexOf(i)&&i&&e._removeName(i,this._id);for(r=0;r,-1===n.indexOf(i)&&i&&e._addName(this,i);return this._setAttr(”name“,t),this},t.prototype.addName=function(t){if(!this.hasName(t)){var e=this.name(),i=e?e+” “+t:t;this.setName(i)}return this},t.prototype.hasName=function(t){if(!t)return!1;var e=this.name();return!!e&&-1!==(e||”“).split(/s/g).indexOf(t)},t.prototype.removeName=function(t){var e=(this.name()||”“).split(/s/g),i=e.indexOf(t);return-1!==i&&(e.splice(i,1),this.setName(e.join(” “))),this},t.prototype.setAttr=function(t,e){var i=this;return r.Util._isFunction(i)?i.call(this,e):this._setAttr(t,e),this},t.prototype._setAttr=function(t,e){var i=this.attrs;(i!==e||r.Util.isObject(e))&&(null==e?delete this.attrs:this.attrs=e,this._fireChangeEvent(t,i,e))},t.prototype._setComponentAttr=function(t,e,i){var r;void 0!==i&&((r=this.attrs)||(this.attrs=this.getAttr(t)),this.attrs[e]=i,this._fireChangeEvent(t,r,i))},t.prototype._fireAndBubble=function(t,e,i){if(e&&”Shape“===this.nodeType&&(e.target=this),!((”mouseenter“===t||”mouseleave“===t)&&(i&&(this===i||this.isAncestorOf&&this.isAncestorOf(i))||”Stage“===this.nodeType&&!i))){this._fire(t,e);var r=(”mouseenter“===t||”mouseleave“===t)&&i&&i.isAncestorOf&&i.isAncestorOf(this)&&!i.isAncestorOf(this.parent);(e&&!e.cancelBubble||!e)&&this.parent&&this.parent.isListening()&&!r&&(i&&i.parent?this._fireAndBubble.call(this.parent,t,e,i):this._fireAndBubble.call(this.parent,t,e))}},t.prototype._fire=function(t,e){var i,r=this.eventListeners;if®for((e=e||{}).currentTarget=this,e.type=t,i=0;i.handler.call(this,e)},t.prototype.draw=function(){return this.drawScene(),this.drawHit(),this},t.prototype._createDragElement=function(t){var e=t?t.pointerId:void 0,i=this.getStage(),r=this.getAbsolutePosition(),n=i._getPointerById(e)||i._changedPointerPositions||r;s.DD._dragElements.set(this._id,{node:this,startPointerPos:n,offset:{x:n.x-r.x,y:n.y-r.y},dragStatus:”ready“,pointerId:e})},t.prototype.startDrag=function(t){s.DD._dragElements.has(this._id)||this._createDragElement(t),s.DD._dragElements.get(this._id).dragStatus=”dragging“,this.fire(”dragstart“,{type:”dragstart“,target:this,evt:t&&t.evt},!0)},t.prototype._setDragPosition=function(t,e){var i=this.getStage()._getPointerById(e.pointerId);if(i){var n={x:i.x-e.offset.x,y:i.y-e.offset.y},o=this.dragBoundFunc();if(void 0!==o){var a=o.call(this,n,t);a?n=a:r.Util.warn(”dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.“)}this._lastPos&&this._lastPos.x===n.x&&this._lastPos.y===n.y||(this.setAbsolutePosition(n),this.getLayer()?this.getLayer().batchDraw():this.getStage()&&this.getStage().batchDraw()),this._lastPos=n}},t.prototype.stopDrag=function(t){var e=s.DD._dragElements.get(this._id);e&&(e.dragStatus=”stopped“),s.DD._endDragBefore(t),s.DD._endDragAfter(t)},t.prototype.setDraggable=function(t){this._setAttr(”draggable“,t),this._dragChange()},t.prototype.isDragging=function(){var t=s.DD._dragElements.get(this._id);return!!t&&”dragging“===t.dragStatus},t.prototype._listenDrag=function(){this._dragCleanup(),this.on(”mousedown.konva touchstart.konva“,(function(t){var e=this;if((!(void 0!==t.evt.button)||a.Konva.dragButtons.indexOf(t.evt.button)>=0)&&!this.isDragging()){var i=!1;s.DD._dragElements.forEach((function(t){e.isAncestorOf(t.node)&&(i=!0)})),i||this._createDragElement(t)}}))},t.prototype._dragChange=function(){this.attrs.draggable?this._listenDrag():(this._dragCleanup(),this.getStage()&&s.DD._dragElements.has(this._id)&&this.stopDrag())},t.prototype._dragCleanup=function(){this.off(”mousedown.konva“),this.off(”touchstart.konva“)},t.create=function(t,e){return r.Util._isString(t)&&(t=JSON.parse(t)),this._createNode(t,e)},t._createNode=function(e,i){var n,o,s,h=t.prototype.getClassName.call(e),c=e.children;if(i&&(e.attrs.container=i),a._NODES_REGISTRY||(r.Util.warn('Can not find a node with class name ”'h'“. Fallback to ”Shape“.‘),h=”Shape“),n=new(0,a._NODES_REGISTRY)(e.attrs),c)for(o=c.length,s=0;s));return n},t}();e.Node=d,d.prototype.nodeType=”Node“,d.prototype._attrsAffectingSize=[],n.Factory.addGetterSetter(d,”zIndex“),n.Factory.addGetterSetter(d,”absolutePosition“),n.Factory.addGetterSetter(d,”position“),n.Factory.addGetterSetter(d,”x“,0,h.getNumberValidator()),n.Factory.addGetterSetter(d,”y“,0,h.getNumberValidator()),n.Factory.addGetterSetter(d,”globalCompositeOperation“,”source-over“,h.getStringValidator()),n.Factory.addGetterSetter(d,”opacity“,1,h.getNumberValidator()),n.Factory.addGetterSetter(d,”name“,”“,h.getStringValidator()),n.Factory.addGetterSetter(d,”id“,”“,h.getStringValidator()),n.Factory.addGetterSetter(d,”rotation“,0,h.getNumberValidator()),n.Factory.addComponentsGetterSetter(d,”scale“,),n.Factory.addGetterSetter(d,”scaleX“,1,h.getNumberValidator()),n.Factory.addGetterSetter(d,”scaleY“,1,h.getNumberValidator()),n.Factory.addComponentsGetterSetter(d,”skew“,),n.Factory.addGetterSetter(d,”skewX“,0,h.getNumberValidator()),n.Factory.addGetterSetter(d,”skewY“,0,h.getNumberValidator()),n.Factory.addComponentsGetterSetter(d,”offset“,),n.Factory.addGetterSetter(d,”offsetX“,0,h.getNumberValidator()),n.Factory.addGetterSetter(d,”offsetY“,0,h.getNumberValidator()),n.Factory.addGetterSetter(d,”dragDistance“,null,h.getNumberValidator()),n.Factory.addGetterSetter(d,”width“,0,h.getNumberValidator()),n.Factory.addGetterSetter(d,”height“,0,h.getNumberValidator()),n.Factory.addGetterSetter(d,”listening“,”inherit“,(function(t){return!0===t||!1===t||”inherit“===t||r.Util.warn(t+' is a not valid value for ”listening“ attribute. The value may be true, false or ”inherit“.'),t})),n.Factory.addGetterSetter(d,”preventDefault“,!0,h.getBooleanValidator()),n.Factory.addGetterSetter(d,”filters“,null,(function(t){return this._filterUpToDate=!1,t})),n.Factory.addGetterSetter(d,”visible“,”inherit“,(function(t){return!0===t||!1===t||”inherit“===t||r.Util.warn(t+' is a not valid value for ”visible“ attribute. The value may be true, false or ”inherit“.'),t})),n.Factory.addGetterSetter(d,”transformsEnabled“,”all“,h.getStringValidator()),n.Factory.addGetterSetter(d,”size“),n.Factory.addGetterSetter(d,”dragBoundFunc“),n.Factory.addGetterSetter(d,”draggable“,!1,h.getBooleanValidator()),n.Factory.backCompat(d,{rotateDeg:”rotate“,setRotationDeg:”setRotation“,getRotationDeg:”getRotation“}),r.Collection.mapMethods(d)},function(t,e,i){”use strict“;var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t=e)})(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,”__esModule“,{value:!0});var o,a=i(3),s=i(0),h=i(4),c=i(2),l=i(1),u=i(31);function d(){return o||(o=a.Util.createCanvasElement().getContext(”2d“))}function p(){this._clearCache(”hasShadow“)}function f(){this._clearCache(”shadowRGBA“)}function g(){this._clearCache(”patternImage“)}function y(){this._clearCache(”linearGradient“)}function v(){this._clearCache(”radialGradient“)}e.shapes={};var _=function(t){function i(i){for(var r,n=t.call(this,i)||this;!(r=a.Util.getRandomColor())||r in e.shapes;);return n.colorKey=r,e.shapes=n,n.on(”shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva“,p),n.on(”shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva“,f),n.on(”fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva“,g),n.on(”fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva“,y),n.on(”fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva“,v),n}return n(i,t),i.prototype.getContext=function(){return this.getLayer().getContext()},i.prototype.getCanvas=function(){return this.getLayer().getCanvas()},i.prototype.getSceneFunc=function(){return this.attrs.sceneFunc||this._sceneFunc},i.prototype.getHitFunc=function(){return this.attrs.hitFunc||this._hitFunc},i.prototype.hasShadow=function(){return this._getCache(”hasShadow“,this._hasShadow)},i.prototype._hasShadow=function(){return this.shadowEnabled()&&0!==this.shadowOpacity()&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())},i.prototype._getFillPattern=function(){return this._getCache(”patternImage“,this.__getFillPattern)},i.prototype.__getFillPattern=function(){if(this.fillPatternImage())return d().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||”repeat“)},i.prototype._getLinearGradient=function(){return this._getCache(”linearGradient“,this.__getLinearGradient)},i.prototype.__getLinearGradient=function(){var t=this.fillLinearGradientColorStops();if(t){for(var e=d(),i=this.fillLinearGradientStartPoint(),r=this.fillLinearGradientEndPoint(),n=e.createLinearGradient(i.x,i.y,r.x,r.y),o=0;o,t);return n}},i.prototype._getRadialGradient=function(){return this._getCache(”radialGradient“,this.__getRadialGradient)},i.prototype.__getRadialGradient=function(){var t=this.fillRadialGradientColorStops();if(t){for(var e=d(),i=this.fillRadialGradientStartPoint(),r=this.fillRadialGradientEndPoint(),n=e.createRadialGradient(i.x,i.y,this.fillRadialGradientStartRadius(),r.x,r.y,this.fillRadialGradientEndRadius()),o=0;o,t);return n}},i.prototype.getShadowRGBA=function(){return this._getCache(”shadowRGBA“,this._getShadowRGBA)},i.prototype._getShadowRGBA=function(){if(this.hasShadow()){var t=a.Util.colorToRGBA(this.shadowColor());return”rgba(“t.r”,“t.g”,“t.b”,“+t.a*(this.shadowOpacity()||1)+”)“}},i.prototype.hasFill=function(){return this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops())},i.prototype.hasStroke=function(){return this.strokeEnabled()&&this.strokeWidth()&&!(!this.stroke()&&!this.strokeLinearGradientColorStops())},i.prototype.hasHitStroke=function(){var t=this.hitStrokeWidth();return”auto“===t?this.hasStroke():this.strokeEnabled()&&!!t},i.prototype.intersects=function(t){var e=this.getStage().bufferHitCanvas;return e.getContext().clear(),this.drawHit(e),e.context.getImageData(Math.round(t.x),Math.round(t.y),1,1).data>0},i.prototype.destroy=function(){return h.Node.prototype.destroy.call(this),delete e.shapes,delete this.colorKey,this},i.prototype._useBufferCanvas=function(t){return!(t&&!this.hasShadow()||!this.perfectDrawEnabled()||1===this.getAbsoluteOpacity()||!this.hasFill()||!this.hasStroke()||!this.getStage())},i.prototype.setStrokeHitEnabled=function(t){a.Util.warn(”strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead.“),t?this.hitStrokeWidth(”auto“):this.hitStrokeWidth(0)},i.prototype.getStrokeHitEnabled=function(){return 0!==this.hitStrokeWidth()},i.prototype.getSelfRect=function(){var t=this.size();return{x:this._centroid?-t.width/2:0,y:this._centroid?-t.height/2:0,width:t.width,height:t.height}},i.prototype.getClientRect=function(t){var e=(t=t||{}).skipTransform,i=t.relativeTo,r=this.getSelfRect(),n=!t.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,o=r.width+n,a=r.height+n,s=!t.skipShadow&&this.hasShadow(),h=s?this.shadowOffsetX():0,c=s?this.shadowOffsetY():0,l=o+Math.abs(h),u=a+Math.abs©,d=s&&this.shadowBlur()||0,p=l+2*d,f=u+2*d,g=0;Math.round(n/2)!==n/2&&(g=1);var y={width:p+g,height:f+g,x:-Math.round(n/2+d)+Math.min(h,0)+r.x,y:-Math.round(n/2+d)+Math.min(c,0)+r.y};return e?y:this._transformedRect(y,i)},i.prototype.drawScene=function(t,e,i,r){var n,o,a=this.getLayer(),s=t||a.getCanvas(),h=s.getContext(),c=this._getCanvasCache(),l=this.sceneFunc(),u=this.hasShadow(),d=this.hasStroke();if(!this.isVisible()&&!i)return this;if©return h.save(),a._applyTransform(this,h,e),this._drawCachedSceneCanvas(h),h.restore(),this;if(!l)return this;if(h.save(),this._useBufferCanvas(i)&&!r){if((o=(n=this.getStage().bufferCanvas).getContext()).clear(),o.save(),o._applyLineJoin(this),!i)if(a)a._applyTransform(this,o,e);else{var p=this.getAbsoluteTransform(e).getMatrix();h.transform(p,p,p,p,p,p)}l.call(this,o,this),o.restore();var f=n.pixelRatio;u&&!s.hitCanvas?(h.save(),h._applyShadow(this),h._applyOpacity(this),h._applyGlobalCompositeOperation(this),h.drawImage(n._canvas,0,0,n.width/f,n.height/f),h.restore()):(h._applyOpacity(this),h._applyGlobalCompositeOperation(this),h.drawImage(n._canvas,0,0,n.width/f,n.height/f))}else{if(h._applyLineJoin(this),!i)if(a)a._applyTransform(this,h,e);else{var g=this.getAbsoluteTransform(e).getMatrix();h.transform(g,g,g,g,g,g)}u&&d&&!s.hitCanvas?(h.save(),i||(h._applyOpacity(this),h._applyGlobalCompositeOperation(this)),h._applyShadow(this),l.call(this,h,this),h.restore(),this.hasFill()&&this.shadowForStrokeEnabled()&&l.call(this,h,this)):u&&!s.hitCanvas?(h.save(),i||(h._applyOpacity(this),h._applyGlobalCompositeOperation(this)),h._applyShadow(this),l.call(this,h,this),h.restore()):(i||(h._applyOpacity(this),h._applyGlobalCompositeOperation(this)),l.call(this,h,this))}return h.restore(),this},i.prototype.drawHit=function(t,e,i){var r=this.getLayer(),n=t||r.hitCanvas,o=n&&n.getContext(),s=this.hitFunc()||this.sceneFunc(),h=this._getCanvasCache(),c=h&&h.hit;if(this.colorKey||(console.log(this),a.Util.warn(”Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. See the shape in logs above. If you want to reuse shape you should call remove() instead of destroy()“)),!this.shouldDrawHit()&&!i)return this;if©return o.save(),r._applyTransform(this,o,e),this._drawCachedHitCanvas(o),o.restore(),this;if(!s)return this;if(o.save(),o._applyLineJoin(this),!i)if®r._applyTransform(this,o,e);else{var l=this.getAbsoluteTransform(e).getMatrix();o.transform(l,l,l,l,l,l)}return s.call(this,o,this),o.restore(),this},i.prototype.drawHitFromCache=function(t){void 0===t&&(t=0);var e,i,r,n,o,s=this._getCanvasCache(),h=this._getCachedSceneCanvas(),c=s.hit,l=c.getContext(),u=c.getWidth(),d=c.getHeight();l.clear(),l.drawImage(h._canvas,0,0,u,d);try{for(r=(i=(e=l.getImageData(0,0,u,d)).data).length,n=a.Util._hexToRgb(this.colorKey),o=0;o>t?(i=n.r,i=n.g,i=n.b,i=255):i=0;l.putImageData(e,0,0)}catch(t){a.Util.error(”Unable to draw hit graph from cached scene canvas. “+t.message)}return this},i.prototype.hasPointerCapture=function(t){return u.hasPointerCapture(t,this)},i.prototype.setPointerCapture=function(t){u.setPointerCapture(t,this)},i.prototype.releaseCapture=function(t){u.releaseCapture(t,this)},i}(h.Node);e.Shape=_,_.prototype._fillFunc=function(t){t.fill()},_.prototype._strokeFunc=function(t){t.stroke()},_.prototype._fillFuncHit=function(t){t.fill()},_.prototype._strokeFuncHit=function(t){t.stroke()},_.prototype._centroid=!1,_.prototype.nodeType=”Shape“,l.registerNode(),s.Factory.addGetterSetter(_,”stroke“,void 0,c.getStringValidator()),s.Factory.addGetterSetter(_,”strokeWidth“,2,c.getNumberValidator()),s.Factory.addGetterSetter(_,”hitStrokeWidth“,”auto“,c.getNumberOrAutoValidator()),s.Factory.addGetterSetter(_,”strokeHitEnabled“,!0,c.getBooleanValidator()),s.Factory.addGetterSetter(_,”perfectDrawEnabled“,!0,c.getBooleanValidator()),s.Factory.addGetterSetter(_,”shadowForStrokeEnabled“,!0,c.getBooleanValidator()),s.Factory.addGetterSetter(_,”lineJoin“),s.Factory.addGetterSetter(_,”lineCap“),s.Factory.addGetterSetter(_,”sceneFunc“),s.Factory.addGetterSetter(_,”hitFunc“),s.Factory.addGetterSetter(_,”dash“),s.Factory.addGetterSetter(_,”dashOffset“,0,c.getNumberValidator()),s.Factory.addGetterSetter(_,”shadowColor“,void 0,c.getStringValidator()),s.Factory.addGetterSetter(_,”shadowBlur“,0,c.getNumberValidator()),s.Factory.addGetterSetter(_,”shadowOpacity“,1,c.getNumberValidator()),s.Factory.addComponentsGetterSetter(_,”shadowOffset“,),s.Factory.addGetterSetter(_,”shadowOffsetX“,0,c.getNumberValidator()),s.Factory.addGetterSetter(_,”shadowOffsetY“,0,c.getNumberValidator()),s.Factory.addGetterSetter(_,”fillPatternImage“),s.Factory.addGetterSetter(_,”fill“,void 0,c.getStringValidator()),s.Factory.addGetterSetter(_,”fillPatternX“,0,c.getNumberValidator()),s.Factory.addGetterSetter(_,”fillPatternY“,0,c.getNumberValidator()),s.Factory.addGetterSetter(_,”fillLinearGradientColorStops“),s.Factory.addGetterSetter(_,”strokeLinearGradientColorStops“),s.Factory.addGetterSetter(_,”fillRadialGradientStartRadius“,0),s.Factory.addGetterSetter(_,”fillRadialGradientEndRadius“,0),s.Factory.addGetterSetter(_,”fillRadialGradientColorStops“),s.Factory.addGetterSetter(_,”fillPatternRepeat“,”repeat“),s.Factory.addGetterSetter(_,”fillEnabled“,!0),s.Factory.addGetterSetter(_,”strokeEnabled“,!0),s.Factory.addGetterSetter(_,”shadowEnabled“,!0),s.Factory.addGetterSetter(_,”dashEnabled“,!0),s.Factory.addGetterSetter(_,”strokeScaleEnabled“,!0),s.Factory.addGetterSetter(_,”fillPriority“,”color“),s.Factory.addComponentsGetterSetter(_,”fillPatternOffset“,),s.Factory.addGetterSetter(_,”fillPatternOffsetX“,0,c.getNumberValidator()),s.Factory.addGetterSetter(_,”fillPatternOffsetY“,0,c.getNumberValidator()),s.Factory.addComponentsGetterSetter(_,”fillPatternScale“,),s.Factory.addGetterSetter(_,”fillPatternScaleX“,1,c.getNumberValidator()),s.Factory.addGetterSetter(_,”fillPatternScaleY“,1,c.getNumberValidator()),s.Factory.addComponentsGetterSetter(_,”fillLinearGradientStartPoint“,),s.Factory.addComponentsGetterSetter(_,”strokeLinearGradientStartPoint“,),s.Factory.addGetterSetter(_,”fillLinearGradientStartPointX“,0),s.Factory.addGetterSetter(_,”strokeLinearGradientStartPointX“,0),s.Factory.addGetterSetter(_,”fillLinearGradientStartPointY“,0),s.Factory.addGetterSetter(_,”strokeLinearGradientStartPointY“,0),s.Factory.addComponentsGetterSetter(_,”fillLinearGradientEndPoint“,),s.Factory.addComponentsGetterSetter(_,”strokeLinearGradientEndPoint“,),s.Factory.addGetterSetter(_,”fillLinearGradientEndPointX“,0),s.Factory.addGetterSetter(_,”strokeLinearGradientEndPointX“,0),s.Factory.addGetterSetter(_,”fillLinearGradientEndPointY“,0),s.Factory.addGetterSetter(_,”strokeLinearGradientEndPointY“,0),s.Factory.addComponentsGetterSetter(_,”fillRadialGradientStartPoint“,),s.Factory.addGetterSetter(_,”fillRadialGradientStartPointX“,0),s.Factory.addGetterSetter(_,”fillRadialGradientStartPointY“,0),s.Factory.addComponentsGetterSetter(_,”fillRadialGradientEndPoint“,),s.Factory.addGetterSetter(_,”fillRadialGradientEndPointX“,0),s.Factory.addGetterSetter(_,”fillRadialGradientEndPointY“,0),s.Factory.addGetterSetter(_,”fillPatternRotation“,0),s.Factory.backCompat(_,{dashArray:”dash“,getDashArray:”getDash“,setDashArray:”getDash“,drawFunc:”sceneFunc“,getDrawFunc:”getSceneFunc“,setDrawFunc:”setSceneFunc“,drawHitFunc:”hitFunc“,getDrawHitFunc:”getHitFunc“,setDrawHitFunc:”setHitFunc“}),a.Collection.mapMethods(_)},function(t,e,i){const r=i(8),{anchor:n,Anchor:o}=i(9),{None:a}=i(13),s=i(39),h=i(19),{itself:c,orthogonalTransform:l}=i(14);class u{constructor({up:t=a,down:e=a,left:i=a,right:r=a}={},n={}){this.up=t,this.down=e,this.left=i,this.right=r,this.metadata={},this.centralAnchor=null,this._size=null,this._initializeListeners(),this.configure(n)}_initializeListeners(){this.translateListeners=[],this.connectListeners=,this.disconnectListeners=[]}configure(t){t.centralAnchor&&this.centerAround(o.import(t.centralAnchor)),t.metadata&&this.annotate(t.metadata),t.size&&this.resize(t.size)}annotate(t){Object.assign(this.metadata,t)}reannotate(t){this.metadata=t}belongTo(t){this.puzzle=t}get presentConnections(){return this.connections.filter©}get connections(){return}get inserts(){return}onTranslate(t){this.translateListeners.push(t)}onConnect(t){this.connectListeners.push(t)}onDisconnect(t){this.disconnectListeners.push(t)}fireTranslate(t,e){this.translateListeners.forEach(i=>i(this,t,e))}fireConnect(t){this.connectListeners.forEach(e=>e(this,t))}fireDisconnect(t){t.forEach(t=>{this.disconnectListeners.forEach(e=>e(this,t))})}connectVerticallyWith(t,e=!1){s.vertical.connectWith(this,t,this.proximity,e)}attractVertically(t,e=!1){s.vertical.attract(this,t,e)}connectHorizontallyWith(t,e=!1){s.horizontal.connectWith(this,t,this.proximity,e)}attractHorizontally(t,e=!1){s.horizontal.attract(this,t,e)}tryConnectWith(t,e=!1){this.tryConnectHorizontallyWith(t,e),this.tryConnectVerticallyWith(t,e)}tryConnectHorizontallyWith(t,e=!1){this.canConnectHorizontallyWith(t)&&this.connectHorizontallyWith(t,e)}tryConnectVerticallyWith(t,e=!1){this.canConnectVerticallyWith(t)&&this.connectVerticallyWith(t,e)}disconnect(){if(!this.connected)return;const t=this.presentConnections;this.upConnection&&(this.upConnection.downConnection=null,this.upConnection=null),this.downConnection&&(this.downConnection.upConnection=null,this.downConnection=null),this.leftConnection&&(this.leftConnection.rightConnection=null,this.leftConnection=null),this.rightConnection&&(this.rightConnection.leftConnection=null,this.rightConnection=null),this.fireDisconnect(t)}centerAround(t){if(this.centralAnchor)throw new Error(”this pieces has already being centered. Use recenterAround instead“);this.centralAnchor=t}locateAt(t,e){this.centerAround(n(t,e))}isAt(t,e){return this.centralAnchor.isAt(t,e)}recenterAround(t,e=!1){const=t.diff(this.centralAnchor);this.translate(i,r,e)}relocateTo(t,e,i=!1){this.recenterAround(n(t,e),i)}translate(t,e,i=!1){r.isNull(t,e)||(this.centralAnchor.translate(t,e),i||this.fireTranslate(t,e))}push(t,e,i=!1,r=){this.translate(t,e,i);const n=this.presentConnections.filter(t=>-1===r.indexOf(t));r.push(…n),n.forEach(i=>i.push(t,e,!1,r))}drag(t,e,i=!1){r.isNull(t,e)||(this.horizontallyOpenMovement(t)&&this.vericallyOpenMovement(e)?(this.disconnect(),this.translate(t,e,i)):this.push(t,e,i))}drop(){this.puzzle.autoconnectWith(this)}dragAndDrop(t,e){this.drag(t,e),this.drop()}vericallyOpenMovement(t){return s.vertical.openMovement(this,t)}horizontallyOpenMovement(t){return s.horizontal.openMovement(this,t)}canConnectHorizontallyWith(t){return s.horizontal.canConnectWith(this,t,this.proximity)}canConnectVerticallyWith(t){return s.vertical.canConnectWith(this,t,this.proximity)}verticallyCloseTo(t){return s.vertical.closeTo(this,t,this.proximity)}horizontallyCloseTo(t){return s.horizontal.closeTo(this,t,this.proximity)}verticallyMatch(t){return s.vertical.match(this,t)}horizontallyMatch(t){return s.horizontal.match(this,t)}get connected(){return!!(this.upConnection||this.downConnection||this.leftConnection||this.rightConnection)}get downAnchor(){return this.centralAnchor.translated(0,this.radio.y)}get rightAnchor(){return this.centralAnchor.translated(this.radio.x,0)}get upAnchor(){return this.centralAnchor.translated(0,-this.radio.y)}get leftAnchor(){return this.centralAnchor.translated(-this.radio.x,0)}resize(t){this._size=t}get radio(){return this.size.radio}get diameter(){return this.size.diameter}get size(){return this._size||this.puzzle.pieceSize}get proximity(){return this.puzzle.proximity}get id(){return this.metadata.id}export({compact:t=!1}={}){const e={centralAnchor:this.centralAnchor&&this.centralAnchor.export(),structure:h.serialize(this),metadata:this.metadata};return this._size&&(e.size={radio:this._size.radio}),t?e:Object.assign(e,{connections:l(this.connections,t=>({id:t.id}))})}static import(t){return new u(h.deserialize(t.structure),{centralAnchor:t.centralAnchor,metadata:t.metadata,size:t.size})}}t.exports=u},function(t,e,i){const r=i(8);function n(t,e){return{x:t,y:e}}function o(t){return”number“==typeof t?n(t,t):t}function a(t,e,i){const r=o(t),n=o(e);return{x:i(r.x,n.x),y:i(r.y,n.y)}}const s={min(t){return this.apply(t,Math.min)},max(t){return this.apply(t,Math.max)},apply:(t,e)=>e(t.x,t.y)};t.exports={cast:o,vector:n,copy:function({x:t,y:e}){return{x:t,y:e}},equal:function(t,e,i=0){return r.equal(t.x,t.y,e.x,e.y,i)},zero:function(){return n(0,0)},update:function(t,e,i){t.x=e,t.y=i},diff:function(t,e){return r.diff(t.x,t.y,e.x,e.y)},multiply:function(t,e){return a(t,e,(t,e)=>t*e)},divide:function(t,e){return a(t,e,(t,e)=>t/e)},plus:function(t,e){return a(t,e,(t,e)=>t+e)},minus:function(t,e){return a(t,e,(t,e)=>t-e)},apply:a,min:function(t,e){return a(t,e,Math.min)},max:function(t,e){return a(t,e,Math.max)},inner:s}},function(t,e){function i(t,e,i,r,n=0){return Math.abs(t-i)<=n&&Math.abs(e-r)<=n}t.exports={isNull:function(t,e){return i(t,e,0,0)},diff:function(t,e,i,r){return},equal:i}},function(t,e,i){const r=i(38),n=i(8),{vector:o}=i(7);class a{constructor(t,e){this.x=t,this.y=e}equal(t){return this.isAt(t.x,t.y)}isAt(t,e){return n.equal(this.x,this.y,t,e)}translated(t,e){return this.copy().translate(t,e)}translate(t,e){return this.x+=t,this.y+=e,this}closeTo(t,e){return r(this.x,t.x-e,t.x+e)&&r(this.y,t.y-e,t.y+e)}copy(){return new a(this.x,this.y)}diff(t){return n.diff(this.x,this.y,t.x,t.y)}asPair(){return}asVector(){return o(this.x,this.y)}export(){return this.asVector()}static atRandom(t,e){return new a(Math.random()*t,Math.random()*e)}static import(t){return s(t.x,t.y)}}function s(t,e){return new a(t,e)}t.exports={anchor:s,Anchor:a}},function(t,e,i){”use strict“;var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t=e)})(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,”__esModule“,{value:!0});var o=i(3),a=i(0),s=i(4),h=i(18),c=i(2),l=i(1),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.children=new o.Collection,e}return n(e,t),e.prototype.getChildren=function(t){if(!t)return this.children;var e=new o.Collection;return this.children.each((function(i){t(i)&&e.push(i)})),e},e.prototype.hasChildren=function(){return this.getChildren().length>0},e.prototype.removeChildren=function(){for(var t,e=0;e).parent=null,t.index=0,t.remove();return this.children=new o.Collection,this},e.prototype.destroyChildren=function(){for(var t,e=0;e).parent=null,t.index=0,t.destroy();return this.children=new o.Collection,this},e.prototype.add=function(){for(var t=[],e=0;e=arguments;if(arguments.length>1){for(var i=0;i);return this}var r=t;if(r.getParent())return r.moveTo(this),this;var n=this.children;return this._validateAdd®,r._clearCaches(),r.index=n.length,r.parent=this,n.push®,this._fire(”add“,{child:r}),this},e.prototype.destroy=function(){return this.hasChildren()&&this.destroyChildren(),t.prototype.destroy.call(this),this},e.prototype.find=function(t){return this._generalFind(t,!1)},e.prototype.get=function(t){return o.Util.warn(”collection.get() method is deprecated. Please use collection.find() instead.“),this.find(t)},e.prototype.findOne=function(t){var e=this._generalFind(t,!0);return e.length>0?e:void 0},e.prototype._generalFind=function(t,e){var i=[];return this._descendants((function®{var n=r._isMatch(t);return n&&i.push®,!(!n||!e)})),o.Collection.toCollection(i)},e.prototype._descendants=function(t){for(var e=0;e<this.children.length;e++){var i=this.children;if(t(i))return!0;if(i.hasChildren()&&i._descendants(t))return!0}return!1},e.prototype.toObject=function(){var t=s.Node.prototype.toObject.call(this);t.children=[];for(var e=this.getChildren(),i=e.length,r=0;r<i;r++){var n=e;t.children.push(n.toObject())}return t},e.prototype.isAncestorOf=function(t){for(var e=t.getParent();e;){if(e._id===this._id)return!0;e=e.getParent()}return!1},e.prototype.clone=function(t){var e=s.Node.prototype.clone.call(this,t);return this.getChildren().each((function(t){e.add(t.clone())})),e},e.prototype.getAllIntersections=function(t){var e=[];return this.find(”Shape“).each((function(i){i.isVisible()&&i.intersects(t)&&e.push(i)})),e},e.prototype._setChildrenIndices=function(){this.children.each((function(t,e){t.index=e}))},e.prototype.drawScene=function(t,e,i){var r=this.getLayer(),n=t||r&&r.getCanvas(),o=n&&n.getContext(),a=this._getCanvasCache(),s=a&&a.scene;return(this.isVisible()||i)&&(!i&&s?(o.save(),r._applyTransform(this,o,e),this._drawCachedSceneCanvas(o),o.restore()):this._drawChildren(n,”drawScene“,e,!1,i,i)),this},e.prototype.drawHit=function(t,e,i){var r=this.getLayer(),n=t||r&&r.hitCanvas,o=n&&n.getContext(),a=this._getCanvasCache(),s=a&&a.hit;return(this.shouldDrawHit(n)||i)&&(!i&&s?(o.save(),r._applyTransform(this,o,e),this._drawCachedHitCanvas(o),o.restore()):this._drawChildren(n,”drawHit“,e,!1,i,i)),this},e.prototype._drawChildren=function(t,e,i,r,n,o){var a,s,h=this.getLayer(),c=t&&t.getContext(),l=this.clipWidth(),u=this.clipHeight(),d=this.clipFunc(),p=l&&u||d;if(p&&h){c.save();var f=this.getAbsoluteTransform(i),g=f.getMatrix();c.transform(g,g,g,g,g,g),c.beginPath(),d?d.call(this,c,this):(a=this.clipX(),s=this.clipY(),c.rect(a,s,l,u)),c.clip(),g=f.copy().invert().getMatrix(),c.transform(g,g,g,g,g,g)}var y=”source-over“!==this.globalCompositeOperation()&&!o&&”drawScene“===e;y&&h&&(c.save(),c._applyGlobalCompositeOperation(this)),this.children.each((function(o){o(t,i,r,n)})),y&&h&&c.restore(),p&&h&&c.restore()},e.prototype.shouldDrawHit=function(t){if(t&&t.isCache)return!0;var e=this.getLayer(),i=!1;h.DD._dragElements.forEach((function(t){”dragging“===t.dragStatus&&t.node.getLayer()===e&&(i=!0)}));var r=!l.Konva.hitOnDragEnabled&&i;return e&&e.hitGraphEnabled()&&this.isVisible()&&!r},e.prototype.getClientRect=function(t){var e,i,r,n,o=(t=t||{}).skipTransform,a=t.relativeTo,s={x:1/0,y:1/0,width:0,height:0},h=this;this.children.each((function(o){if(o.visible()){var a=o.getClientRect({relativeTo:h,skipShadow:t.skipShadow,skipStroke:t.skipStroke});0===a.width&&0===a.height||(void 0===e?(e=a.x,i=a.y,r=a.x+a.width,n=a.y+a.height):(e=Math.min(e,a.x),i=Math.min(i,a.y),r=Math.max(r,a.x+a.width),n=Math.max(n,a.y+a.height)))}}));for(var c=this.find(”Shape“),l=!1,u=0;u<c.length;u++){if(c._isVisible(this)){l=!0;break}}return s=l&&void 0!==e?{x:e,y:i,width:r-e,height:n-i}:{x:0,y:0,width:0,height:0},o?s:this._transformedRect(s,a)},e}(s.Node);e.Container=u,a.Factory.addComponentsGetterSetter(u,”clip“,),a.Factory.addGetterSetter(u,”clipX“,void 0,c.getNumberValidator()),a.Factory.addGetterSetter(u,”clipY“,void 0,c.getNumberValidator()),a.Factory.addGetterSetter(u,”clipWidth“,void 0,c.getNumberValidator()),a.Factory.addGetterSetter(u,”clipHeight“,void 0,c.getNumberValidator()),a.Factory.addGetterSetter(u,”clipFunc“),o.Collection.mapMethods(u)},function(t,e,i){”use strict“;var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t=e)})(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,”__esModule“,{value:!0});var o,a=i(3),s=i(30),h=i(1),c=i(0),l=i(2);var u=function(){function t(t){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;var e=(t||{}).pixelRatio||h.Konva.pixelRatio||function(){if(o)return o;var t=a.Util.createCanvasElement().getContext(”2d“);return o=(h.Konva._global.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)}();this.pixelRatio=e,this._canvas=a.Util.createCanvasElement(),this._canvas.style.padding=”0“,this._canvas.style.margin=”0“,this._canvas.style.border=”0“,this._canvas.style.background=”transparent“,this._canvas.style.position=”absolute“,this._canvas.style.top=”0“,this._canvas.style.left=”0“}return t.prototype.getContext=function(){return this.context},t.prototype.getPixelRatio=function(){return this.pixelRatio},t.prototype.setPixelRatio=function(t){var e=this.pixelRatio;this.pixelRatio=t,this.setSize(this.getWidth()/e,this.getHeight()/e)},t.prototype.setWidth=function(t){this.width=this._canvas.width=t*this.pixelRatio,this._canvas.style.width=t+”px“;var e=this.pixelRatio;this.getContext()._context.scale(e,e)},t.prototype.setHeight=function(t){this.height=this._canvas.height=t*this.pixelRatio,this._canvas.style.height=t+”px“;var e=this.pixelRatio;this.getContext()._context.scale(e,e)},t.prototype.getWidth=function(){return this.width},t.prototype.getHeight=function(){return this.height},t.prototype.setSize=function(t,e){this.setWidth(t||0),this.setHeight(e||0)},t.prototype.toDataURL=function(t,e){try{return this._canvas.toDataURL(t,e)}catch(t){try{return this._canvas.toDataURL()}catch(t){return a.Util.error(”Unable to get data URL. “t.message” For more info read konvajs.org/docs/posts/Tainted_Canvas.html.“),”“}}},t}();e.Canvas=u,c.Factory.addGetterSetter(u,”pixelRatio“,void 0,l.getNumberValidator());var d=function(t){function e(e){void 0===e&&(e={width:0,height:0});var i=t.call(this,e)||this;return i.context=new s.SceneContext(i),i.setSize(e.width,e.height),i}return n(e,t),e}(u);e.SceneCanvas=d;var p=function(t){function e(e){void 0===e&&(e={width:0,height:0});var i=t.call(this,e)||this;return i.hitCanvas=!0,i.context=new s.HitContext(i),i.setSize(e.width,e.height),i}return n(e,t),e}(u);e.HitCanvas=p},function(t,e,i){const{Anchor:r}=i(9),n=i(6),{NullValidator:o}=i(15),{vector:a,…s}=i(7),{radio:h}=i(20),c=i(21);class l{constructor({pieceRadio:t=2,proximity:e=1}={}){this.pieceSize=h(t),this.proximity=e,this.pieces=[],this.validator=new o}newPiece(t={},e={}){const i=new n(t,e);return this.addPiece(i),i}addPiece(t){this.pieces.push(t),t.belongTo(this)}addPieces(t){t.forEach(t=>this.addPiece(t))}annotate(t){this.pieces.forEach((e,i)=>e.annotate(t))}relocateTo(t){this.pieces.forEach((e,i)=>e.relocateTo(…t))}autoconnect(){this.pieces.forEach(t=>this.autoconnectWith(t))}disconnect(){this.pieces.forEach(t=>t.disconnect())}autoconnectWith(t){this.pieces.filter(e=>e!==t).forEach(e=>{t.tryConnectWith(e),e.tryConnectWith(t,!0)})}shuffle(t,e){this.shuffleWith(c.random(t,e))}shuffleWith(t){this.disconnect(),t(this.pieces).forEach(({x:t,y:e},i)=>{this.pieces.relocateTo(t,e)}),this.autoconnect()}translate(t,e){this.pieces.forEach(i=>i.translate(t,e))}onTranslate(t){this.pieces.forEach(e=>e.onTranslate(t))}onConnect(t){this.pieces.forEach(e=>e.onConnect(t))}onDisconnect(t){this.pieces.forEach(e=>e.onDisconnect(t))}onValid(t){this.validator.onValid(t)}get points(){return this.pieces.map(t=>t.centralAnchor.asPair())}get refs(){return this.points.map((,i)=>{const r=this.pieces.diameter;return})}get metadata(){return this.pieces.map(t=>t.metadata)}get head(){return this.pieces}get headAnchor(){return this.head.centralAnchor}attachValidator(t){this.validator=t}isValid(){return this.validator.isValid(this)}get valid(){return this.validator.valid}validate(){this.validator.validate(this)}updateValidity(){this.validator.validate(this)}get connected(){return this.pieces.every(t=>t.connected)}get pieceDiameter(){return this.pieceSize.diameter}get pieceRadio(){return this.pieceSize.radio}export(t={}){return{pieceRadio:this.pieceRadio,proximity:this.proximity,pieces:this.pieces.map(e=>e.export(t))}}static import(t){const e=new l({pieceRadio:t.pieceRadio,proximity:t.proximity});return e.addPieces(t.pieces.map(t=>n.import(t))),e.autoconnect(),e}}t.exports=l},function(t,e){const i={isSlot:()=>!1,isTab:()=>!0,isNone:()=>!1,match:t=>t.isSlot(),toString:()=>”Tab“,complement:()=>r,serialize:()=>”T“},r={isSlot:()=>!0,isTab:()=>!1,isNone:()=>!1,match:t=>t.isTab(),toString:()=>”Slot“,complement:()=>i,serialize:()=>”S“},n={isSlot:()=>!1,isTab:()=>!1,isNone:()=>!0,match:t=>!1,toString:()=>”None“,complement:()=>n,serialize:()=>”-“};t.exports={None:n,Slot:r,Tab:i}},function(t,e){function i(t,e,i=null){return t.map(t=>{const r=t||i;return r&&e®})}t.exports={pivot:function(t,e,i=!1){return i?:[e,t]},itself:function(t){return t},orthogonalMap:i,orthogonalTransform:function(t,e,r=null){const=i(t,e,r);return{right:n,down:o,left:a,up:s}}}},function(t,e,i){i(12),i(6);const r=i(8);class n{constructor(){this.validListeners=[],this._valid=void 0}validate(t){const e=this._valid;this.updateValidity(t),this._valid&&!e&&this.fireValid(t)}updateValidity(t){this._valid=this.isValid(t)}fireValid(t){this.validListeners.forEach(e=>e(t))}onValid(t){this.validListeners.push(t)}get valid(){return this._valid}get isNull(){return!1}}class o extends n{constructor(t){super(),this.condition=t}isValid(t){return this.condition(t)}static equalDiffs(,[i,n]){return r.equal(t,e,i,n,o.DIFF_DELTA)}}o.DIFF_DELTA=.01,o.connected=t=>t.connected,o.relativeRefs=t=>e=>{function i(e,i,n){return r.diff(e,i,…t)}const n=e.refs,=n,h=i(a,s,0);return n.every((,r)=>o.equalDiffs(h,i(t,e,r)))},t.exports={PuzzleValidator:o,PieceValidator:class extends n{constructor(t){super(),this.condition=t}isValid(t){return t.pieces.every(t=>this.condition(t))}},NullValidator:class extends n{isValid(t){return!1}get isNull(){return!0}}}},function(t,e,i){i(6);const{vector:r,…n}=i(7);function o(t,e,i,r){return t.isTab()?e:t.isSlot()?i:r}const a=(t,e,i,r)=>o(t.left,e,i,r),s=(t,e,i,r)=>o(t.right,e,i,r),h=(t,e,i,r)=>o(t.up,e,i,r),c=(t,e,i,r)=>o(t.down,e,i,r);class l{draw(t,e=50,i=0){const r=n.cast(e),h=n.divide(n.multiply(i,5),r);return.map((t,e)=>t*(e%2==0?r.x:r.y)/5)}isBezier(){return!1}}t.exports={Classic:new l,Squared:l,Rounded:class{constructor({bezelize:t=!1,bezelDepth:e=.4,insertDepth:i=.8,borderLength:r=1/3,referenceInsertAxis:n=null}={}){this.bezelize=t,this.bezelDepth=e,this.insertDepth=i,this.borderLength=r,this.referenceInsertAxis=n}referenceInsertAxisLength(t){return this.referenceInsertAxis?this.referenceInsertAxis.atVector(t):n.inner.min(t)}draw(t,e=150,i=0){const r=n.cast(e),o=Math.trunc(this.referenceInsertAxisLength®*(1-2*this.borderLength)*100)/100,l=n.divide(n.minus(r,o),2),u=n.multiply(o,this.insertDepth),d=n.multiply(n.inner.min(l),this.bezelDepth),=this.bezels(t),v=t=>t?d.x:0,_=t=>t?d.y:0,m=o+l.y,b=o+l.x,x=o+2*l.y,S=o+2*l.x;return[v(p),0,…p?:[],0,_(p),0,l.y,0,l.y,…a(t,,[u.x,l.y,u.x,m],),0,m,0,m,0,x,0,x-_(f),…f?:[],v(f),x,l.x,x,l.x,x,…c(t,,[l.x,x-u.y,b,x-u.y],),b,x,b,x,S,x,S-v(g),x,…g?:[],S,x-_(g),S,m,S,m,…s(t,,[S-u.x,m,S-u.x,l.y],),S,l.y,S,l.y,S,0,S,_(y),…y?:[],S-v(y),0,b,0,b,0,…h(t,,[b,u.y,l.x,u.y],),l.x,0,l.x,0,0,0,p?d.x:0,0]}bezels(t){return this.bezelize?:[!1,!1,!1,!1]}isBezier(){return!0}}}},function(t,e,i){const r=i(8),n=(i(6),i(12)),o=i(27),{twoAndTwo:a}=i(22),s=i(19),h=i(40),{vector:c,…l}=i(7),u=i(23),d=i(28),{PuzzleValidator:p,PieceValidator:f}=i(15),{Horizontal:g,Vertical:y}=i(26),v=i(21),{diameter:_}=i(20),{itself:m}=i(14),{Classic:b}=i(16);t.exports=class{constructor(t,{width:e,height:i,pieceSize:r=50,proximity:n=10,borderFill:o=0,strokeWidth:a=3,strokeColor:s=”black“,lineSoftness:c=0,preventOffstageDrag:u=!1,image:d=null,fixed:p=!1,painter:f=null,puzzleDiameter:g=null,maxPiecesCount:y=null,outline:v=null}){this.width=e,this.height=i,this.pieceSize=_®,this.borderFill=l.cast(o),this.imageMetadata=h.asImageMetadata(d),this.strokeWidth=a,this.strokeColor=s,this.lineSoftness=c,this.preventOffstageDrag=u,this.proximity=n,this.fixed=p,this._painter=f||new window.headbreaker.painters.Konva,this._initialize(),this._painter.initialize(this,t),this._maxPiecesCount=l.cast(y),this._puzzleDiameter=l.cast(g),this._imageAdjuster=m,this._outline=v||b}_initialize(){this._puzzle=null,this.figures={},this.templates={}}sketchPiece({structure:t,size:e=null,metadata:i}){d.initialize(i,l.zero()),this.renderPiece(this._newPiece(t,e,i))}renderPiece(t){const e={label:null,group:null,shape:null};this.figures=e,this._painter.sketch(this,t,e,this._outline);const i=t.metadata.label;i&&i.text&&(i.fontSize=i.fontSize||.55*t.diameter.y,i.y=i.y||(t.diameter.y-i.fontSize)/2,this._painter.label(this,t,e)),this._bindGroupToPiece(e.group,t),this._bindPieceToGroup(t,e.group)}renderPieces(t){t.forEach(t=>{this._annotatePiecePosition(t),this.renderPiece(t)})}renderPuzzle(t){this.pieceSize=t.pieceSize,this.proximity=2*t.proximity,this._puzzle=t,this.renderPieces(t.pieces)}autogenerate({horizontalPiecesCount:t=5,verticalPiecesCount:e=5,insertsGenerator:i=a,metadata:r=[]}={}){const n=new o;n.withDimmensions(t,e),n.withInsertsGenerator(i),n.withMetadata®,this.autogenerateWithManufacturer(n)}autogenerateWithManufacturer(t){t.withStructure(this.settings),this._puzzle=t.build(),this._maxPiecesCount=c(t.width,t.height),this.renderPieces(this.puzzle.pieces)}defineTemplate(t,e){this.templates=e}sketchPieceUsingTemplate(t,e){const i=this.templates;if(!i)throw new Error(”Unknown template “+t);const r=u.copy(i.metadata);r.id=t,this.sketchPiece({structure:i.structure,metadata:r})}shuffle(t=1){const e=this.pieceRadio;this.puzzle.shuffle(t*(this.width-e.x),t*(this.height-e.y)),this.puzzle.translate(e.x,e.y),this.autoconnected=!0}shuffleColumns(t=1){this.shuffleWith(t,v.columns)}shuffleGrid(t=1){this.shuffleWith(t,v.grid)}shuffleLine(t=1){this.shuffleWith(t,v.line)}shuffleWith(t,e){this.solve(),this.puzzle.shuffleWith(v.padder(3*this.proximity,this.maxPiecesCount.x,this.maxPiecesCount.y)),this.puzzle.shuffleWith(e),this.puzzle.shuffleWith(v.noise(l.cast(this.proximity*t/2))),this.autoconnected=!0}solve(){this.puzzle.pieces.forEach(t=>{const{x:e,y:i}=t.metadata.targetPosition;t.relocateTo(e,i)}),this.autoconnect()}autoconnect(){this.puzzle.autoconnect(),this.autoconnected=!0}draw(){this.autoconnected||this.autoconnect(),this.puzzle.updateValidity(),this.autoconnected=!1,this.redraw()}redraw(){this._painter.draw(this)}refill(){this.puzzle.pieces.forEach(t=>{this._painter.fill(this,t,this.getFigure(t))})}clear(){this._initialize(),this._painter.reinitialize(this)}attachValidator(t){this.puzzle.attachValidator(t)}attachSolvedValidator(){this.puzzle.attachValidator(new p(d.solved))}attachRelativePositionValidator(){this.puzzle.attachValidator(new p(d.relativePosition))}attachRelativeRefsValidator(t){this.puzzle.attachValidator(new p(p.relativeRefs(t)))}attachAbsolutePositionValidator(){this.puzzle.attachValidator(new f(d.absolutePosition))}onConnect(t){this.puzzle.onConnect((e,i)=>{t(e,this.getFigure(e),i,this.getFigure(i))})}onDisconnect(t){this.puzzle.onDisconnect((e,i)=>{t(e,this.getFigure(e),i,this.getFigure(i))})}onTranslate(t){this.puzzle.onTranslate((e,i,r)=>{t(e,this.getFigure(e),i,r)})}onValid(t){this.puzzle.onValid(t)}get valid(){return this.puzzle.valid}getFigure(t){return this.getFigureById(t.metadata.id)}getFigureById(t){return this.figures}resize(t,e){this.width=t,this.height=e,this._painter.resize(this,t,e)}scale(t){this._painter.scale(this,l.cast(t))}_annotatePiecePosition(t){const e=t.centralAnchor.asVector();d.initialize(t.metadata,e,l.copy(e))}_bindGroupToPiece(t,e){e.onTranslate((i,r)=>{this._painter.physicalTranslate(this,t,e),this._painter.logicalTranslate(this,e,t)})}_bindPieceToGroup(t,e){this._painter.onDrag(this,t,e,(i,n)=>{r.isNull(i,n)||(t.drag(i,n,!0),this._painter.logicalTranslate(this,t,e),this.redraw())}),this._painter.onDragEnd(this,t,e,()=>{t.drop(),this.puzzle.validate(),this.redraw()})}_baseImageMetadataFor(t){if(this.imageMetadata){const e=t.metadata.scale||this.imageMetadata.scale||1,i=l.plus(t.metadata.targetPosition||l.zero(),this.imageMetadata.offset||l.zero());return{content:this.imageMetadata.content,offset:i,scale:e}}return h.asImageMetadata(t.metadata.image)}imageMetadataFor(t){return this._imageAdjuster(this._baseImageMetadataFor(t))}adjustImagesToPuzzle(t){this._imageAdjuster=e=>{const i=t.atVector(this.puzzleDiameter)/t.atDimension(e.content),r=l.plus(e.offset,l.minus(this.borderFill,this.pieceDiameter));return{content:e.content,scale:i,offset:r}}}adjustImagesToPuzzleWidth(){this.adjustImagesToPuzzle(g)}adjustImagesToPuzzleHeight(){this.adjustImagesToPuzzle(y)}adjustImagesToPiece(t){this._imageAdjuster=e=>{const i=t.atVector(this.pieceDiameter)/t.atDimension(e.content),r=l.plus(e.offset,this.borderFill);return{content:e.content,scale:i,offset:r}}}adjustImagesToPieceWidth(){this.adjustImagesToPiece(g)}adjustImagesToPieceHeight(){this.adjustImagesToPiece(y)}_initializeEmptyPuzzle(){this._puzzle=new n(this.settings)}_newPiece(t,e,i){return this.puzzle.newPiece(s.asStructure(t),{centralAnchor:c(i.currentPosition.x,i.currentPosition.y),metadata:i,size:e})}get puzzleDiameter(){return this._puzzleDiameter||this.estimatedPuzzleDiameter}get estimatedPuzzleDiameter(){return l.plus(l.multiply(this.pieceDiameter,this.maxPiecesCount),2*this.strokeWidth)}get maxPiecesCount(){if(!this._maxPiecesCount)throw new Error(”max pieces count was not specified“);return this._maxPiecesCount}get pieceRadio(){return this.pieceSize.radio}get pieceDiameter(){return this.pieceSize.diameter}get puzzle(){return this._puzzle||this._initializeEmptyPuzzle(),this._puzzle}get settings(){return{pieceRadio:this.pieceRadio,proximity:this.proximity}}}},function(t,e,i){”use strict“;Object.defineProperty(e,”__esModule“,{value:!0});var r=i(1),n=i(3);e.DD={get isDragging(){var t=!1;return e.DD._dragElements.forEach((function(e){”dragging“===e.dragStatus&&(t=!0)})),t},justDragged:!1,get node(){var t;return e.DD._dragElements.forEach((function(e){t=e.node})),t},_dragElements:new Map,_drag:function(t){e.DD._dragElements.forEach((function(e,i){var r=e.node,o=r.getStage();o.setPointersPositions(t),void 0===e.pointerId&&(e.pointerId=n.Util._getFirstPointerId(t));var a=o._changedPointerPositions.find((function(t){return t.id===e.pointerId}));if(a){if(”dragging“!==e.dragStatus){var s=r.dragDistance();if(Math.max(Math.abs(a.x-e.startPointerPos.x),Math.abs(a.y-e.startPointerPos.y))<s)return;if(r.startDrag({evt:t}),!r.isDragging())return}r._setDragPosition(t,e),r.fire(”dragmove“,{type:”dragmove“,target:r,evt:t},!0)}}))},_endDragBefore:function(t){e.DD._dragElements.forEach((function(i,n){var o=i.node.getStage();if(t&&o.setPointersPositions(t),o._changedPointerPositions.find((function(t){return t.id===i.pointerId}))){”dragging“!==i.dragStatus&&”stopped“!==i.dragStatus||(e.DD.justDragged=!0,r.Konva.listenClickTap=!1,i.dragStatus=”stopped“);var a=i.node.getLayer()||i.node instanceof r.Konva.Stage&&i.node;a&&a.draw()}}))},_endDragAfter:function(t){e.DD._dragElements.forEach((function(i,r){”stopped“===i.dragStatus&&i.node.fire(”dragend“,{type:”dragend“,target:i.node,evt:t},!0),”dragging“!==i.dragStatus&&e.DD._dragElements.delete®}))}},r.Konva.isBrowser&&(window.addEventListener(”mouseup“,e.DD._endDragBefore,!0),window.addEventListener(”touchend“,e.DD._endDragBefore,!0),window.addEventListener(”mousemove“,e.DD._drag),window.addEventListener(”touchmove“,e.DD._drag),window.addEventListener(”mouseup“,e.DD._endDragAfter,!1),window.addEventListener(”touchend“,e.DD._endDragAfter,!1))},function(t,e,i){const{Slot:r,Tab:n,None:o}=i(13),{orthogonalMap:a}=i(14);function s(t){return”S“===t?r:”T“===t?n:o}function h(t){if(4!==t.length)throw new Error(”structure string must be 4-chars long“);return{right:s(t),down:s(t),left:s(t),up:s(t)}}t.exports={serialize:function(t){return a(,t=>t.serialize(),o).join(”“)},deserialize:h,asStructure:function(t){return”string“==typeof t?h(t):t}}},function(t,e,i){const r=i(7);t.exports={radio:function(t){const e=r.cast(t);return{radio:e,diameter:r.multiply(e,2)}},diameter:function(t){const e=r.cast(t);return{radio:r.multiply(e,.5),diameter:e}}}},function(t,e,i){const{Anchor:r}=i(9);function n(t){return Math.round(Math.random()*(t.length-1))}t.exports={random:function(t,e){return i=>i.map(i=>r.atRandom(t,e))},grid:t=>{const e=t.map(t=>t.centralAnchor.asVector());for(let t=0;t<e.length;t++){const i=n(e),r=e;e=e,e=r}return e},columns:t=>{const e=t.map(t=>t.centralAnchor.asVector()),i=new Map;for(let t of e){i.get(t.x)||i.set(t.x,e.filter(e=>e.x==t.x));const r=i.get(t.x),o=n®,a=r.y;r.y=t.y,t.y=a}return e},line:t=>{const e=t.map(t=>t.centralAnchor.asVector()),i=new Set(e.map(t=>t.x)),r=Math.max(…i),o=Math.min(…i),a=(r-o)/(i.size-1),s=o+a/2,h=e.length*a,c=e.filter(t=>t.x;for(let t=0;t<c;t+=a)l.push(t);for(let t=l+a;t<h;t+=a)u.push(t);for(let t of e){const e=t.x,e.splice(i,1)}return e},noop:t=>t.map(t=>t.centralAnchor),padder:function(t,e,i){return r=>{const n=r.map(t=>t.centralAnchor.asVector());let o=0,a=0;for(let r=0;r<i;r++){for(let i=0;i<e;i++){const s=n;s.x+=o,s.y+=a,o+=t}o=0,a+=t}return n}},noise:function(t){return e=>e.map(e=>r.atRandom(2*t.x,2*t.y).translate(-t.x,-t.y).translate(e.centralAnchor.x,e.centralAnchor.y).asVector())}}},function(t,e,i){const{Tab:r,Slot:n,None:o}=i(13);t.exports={InsertSequence:class{constructor(t){this.generator=t,this.n=0,this._previous,this._current=o}previousComplement(){return this._previous.complement()}current(t){return this.n==t?o:this._current}next(){return this._previous=this._current,this._current=this.generator(this.n++),this._current}},fixed:function(t){return r},flipflop:function(t){return t%2==0?r:n},twoAndTwo:function(t){return t%4<2?r:n},random:function(t){return Math.random()<.5?r:n}}},function(t,e){t.exports={copy:function(t){return JSON.parse(JSON.stringify(t))}}},function(t,e,i){”use strict“;var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t=e)})(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,”__esModule“,{value:!0});var o=i(3),a=i(10),s=i(1),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype._validateAdd=function(t){var e=t.getType();”Group“!==e&&”Shape“!==e&&o.Util.throw(”You may only add groups and shapes to groups.“)},e}(a.Container);e.Group=h,h.prototype.nodeType=”Group“,s._registerNode(h),o.Collection.mapMethods(h)},function(t,e,i){”use strict“;Object.defineProperty(e,”__esModule“,{value:!0});var r=i(1),n=r.glob.performance&&r.glob.performance.now?function(){return r.glob.performance.now()}:function(){return(new Date).getTime()},o=function(){function t(e,i){this.id=t.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:n(),frameRate:0},this.func=e,this.setLayers(i)}return t.prototype.setLayers=function(t){var e=[];return e=t?t.length>0?t::[],this.layers=e,this},t.prototype.getLayers=function(){return this.layers},t.prototype.addLayer=function(t){var e,i=this.layers,r=i.length;for(e=0;e._id===t._id)return!1;return this.layers.push(t),!0},t.prototype.isRunning=function(){var e,i=t.animations,r=i.length;for(e=0;e.id===this.id)return!0;return!1},t.prototype.start=function(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=n(),t._addAnimation(this),this},t.prototype.stop=function(){return t._removeAnimation(this),this},t.prototype._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._addAnimation=function(t){this.animations.push(t),this._handleAnimation()},t._removeAnimation=function(t){var e,i=t.id,r=this.animations,n=r.length;for(e=0;e.id===i){this.animations.splice(e,1);break}},t._runFrames=function(){var t,e,i,r,o,a,s,h,c={},l=this.animations;for(r=0;r).layers,i=t.func,t._updateFrameObject(n()),a=e.length,!i||!1!==i.call(t,t.frame))for(o=0;o<a;o++)void 0!==(s=e)._id&&(c=s);for(h in c)c.hasOwnProperty(h)&&c.draw()},t._animationLoop=function(){var e=t;e.animations.length?(e._runFrames(),requestAnimationFrame(e._animationLoop)):e.animRunning=!1},t._handleAnimation=function(){this.animRunning||(this.animRunning=!0,requestAnimationFrame(this._animationLoop))},t.animations=[],t.animIdCounter=0,t.animRunning=!1,t}();e.Animation=o},function(t,e){const i={atVector:t=>t.y,atDimension:t=>t.height},r={atVector:t=>t.x,atDimension:t=>t.width};t.exports={Vertical:i,Horizontal:r}},function(t,e,i){const r=i(12),{Anchor:n}=(i(6),i(9)),{anchor:o}=i(9),{fixed:a,InsertSequence:s}=i(22),h=i(23);class c{constructor(t,e){this.puzzle=t,this.initializeOffset(e)}initializeOffset(t){this.offset=t?t.asVector():this.pieceDiameter}get pieceDiameter(){return this.puzzle.pieceDiameter}naturalAnchor(t,e){return o(t*this.pieceDiameter.x+this.offset.x,e*this.pieceDiameter.y+this.offset.y)}}t.exports=class{constructor(){this.insertsGenerator=a,this.metadata=[],this.headAnchor=null}withMetadata(t){this.metadata=t}withInsertsGenerator(t){this.insertsGenerator=t||this.insertsGenerator}withHeadAt(t){this.headAnchor=t}withStructure(t){this.structure=t}withDimmensions(t,e){this.width=t,this.height=e}build(){const t=new r(this.structure),e=new c(t,this.headAnchor);let i,n=this._newSequence();for(let r=0;r<this.height;r++){i=this._newSequence(),n.next();for(let o=0;o<this.width;o++){i.next();this._buildPiece(t,i,n).centerAround(e.naturalAnchor(o,r))}}return this._annotateAll(t.pieces),t}_annotateAll(t){t.forEach((t,e)=>this._annotate(t,e))}_annotate(t,e){const i=this.metadata,r=i?h.copy(i):{};r.id=r.id||String(e+1),t.annotate®}_newSequence(){return new s(this.insertsGenerator)}_buildPiece(t,e,i){return t.newPiece({left:e.previousComplement(),up:i.previousComplement(),right:e.current(this.width),down:i.current(this.height)})}}},function(t,e,i){const r=i(7),{PuzzleValidator:n}=(i(6),i(8),i(15));function o(t){return r.diff(t.metadata.targetPosition,t.centralAnchor.asVector())}const a=t=>{const e=o(t.head);return t.pieces.every(t=>n.equalDiffs(e,o(t)))};t.exports={initialize:function(t,e,i){t.targetPosition=t.targetPosition||e,t.currentPosition=t.currentPosition||i||r.copy(t.targetPosition)},solved:t=>a(t)&&n.connected(t),relativePosition:a,absolutePosition:t=>r.equal(t.centralAnchor.asVector(),t.metadata.targetPosition)}},function(t,e,i){i(17),i(6);t.exports=class{resize(t,e,i){}initialize(t,e){}reinitialize(t){}draw(t){}scale(t,e){}sketch(t,e,i,r){}fill(t,e,i){}label(t,e,i){}physicalTranslate(t,e,i){}logicalTranslate(t,e,i){}onDrag(t,e,i,r){}onDragEnd(t,e,i,r){}}},function(t,e,i){”use strict“;var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t=e)})(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,”__esModule“,{value:!0});var o=i(3),a=i(1),s=,h=function(){function t(t){this.canvas=t,this._context=t._canvas.getContext(”2d“),a.Konva.enableTrace&&(this.traceArr=[],this._enableTrace())}return t.prototype.fillShape=function(t){t.fillEnabled()&&this._fill(t)},t.prototype._fill=function(t){},t.prototype.strokeShape=function(t){t.hasStroke()&&this._stroke(t)},t.prototype._stroke=function(t){},t.prototype.fillStrokeShape=function(t){this.fillShape(t),this.strokeShape(t)},t.prototype.getTrace=function(t){var e,i,r,n,a=this.traceArr,s=a.length,h=”“;for(e=0;e).method)?(n=i.args,h+=r,t?h+=”()“:o.Util._isArray(n)?h+=”()“:h+=”(“+n.join(”,“)+”)“):(h+=i.property,t||(h+=”=“+i.val)),h+=”;“;return h},t.prototype.clearTrace=function(){this.traceArr=[]},t.prototype._trace=function(t){var e=this.traceArr;e.push(t),e.length>=100&&e.shift()},t.prototype.reset=function(){var t=this.getCanvas().getPixelRatio();this.setTransform(1*t,0,0,1*t,0,0)},t.prototype.getCanvas=function(){return this.canvas},t.prototype.clear=function(t){var e=this.getCanvas();t?this.clearRect(t.x||0,t.y||0,t.width||0,t.height||0):this.clearRect(0,0,e.getWidth()/e.pixelRatio,e.getHeight()/e.pixelRatio)},t.prototype._applyLineCap=function(t){var e=t.getLineCap();e&&this.setAttr(”lineCap“,e)},t.prototype._applyOpacity=function(t){var e=t.getAbsoluteOpacity();1!==e&&this.setAttr(”globalAlpha“,e)},t.prototype._applyLineJoin=function(t){var e=t.getLineJoin();e&&this.setAttr(”lineJoin“,e)},t.prototype.setAttr=function(t,e){this._context=e},t.prototype.arc=function(t,e,i,r,n,o){this._context.arc(t,e,i,r,n,o)},t.prototype.arcTo=function(t,e,i,r,n){this._context.arcTo(t,e,i,r,n)},t.prototype.beginPath=function(){this._context.beginPath()},t.prototype.bezierCurveTo=function(t,e,i,r,n,o){this._context.bezierCurveTo(t,e,i,r,n,o)},t.prototype.clearRect=function(t,e,i,r){this._context.clearRect(t,e,i,r)},t.prototype.clip=function(){this._context.clip()},t.prototype.closePath=function(){this._context.closePath()},t.prototype.createImageData=function(t,e){var i=arguments;return 2===i.length?this._context.createImageData(t,e):1===i.length?this._context.createImageData(t):void 0},t.prototype.createLinearGradient=function(t,e,i,r){return this._context.createLinearGradient(t,e,i,r)},t.prototype.createPattern=function(t,e){return this._context.createPattern(t,e)},t.prototype.createRadialGradient=function(t,e,i,r,n,o){return this._context.createRadialGradient(t,e,i,r,n,o)},t.prototype.drawImage=function(t,e,i,r,n,o,a,s,h){var c=arguments,l=this._context;3===c.length?l.drawImage(t,e,i):5===c.length?l.drawImage(t,e,i,r,n):9===c.length&&l.drawImage(t,e,i,r,n,o,a,s,h)},t.prototype.ellipse=function(t,e,i,r,n,o,a,s){this._context.ellipse(t,e,i,r,n,o,a,s)},t.prototype.isPointInPath=function(t,e){return this._context.isPointInPath(t,e)},t.prototype.fill=function(){this._context.fill()},t.prototype.fillRect=function(t,e,i,r){this._context.fillRect(t,e,i,r)},t.prototype.strokeRect=function(t,e,i,r){this._context.strokeRect(t,e,i,r)},t.prototype.fillText=function(t,e,i){this._context.fillText(t,e,i)},t.prototype.measureText=function(t){return this._context.measureText(t)},t.prototype.getImageData=function(t,e,i,r){return this._context.getImageData(t,e,i,r)},t.prototype.lineTo=function(t,e){this._context.lineTo(t,e)},t.prototype.moveTo=function(t,e){this._context.moveTo(t,e)},t.prototype.rect=function(t,e,i,r){this._context.rect(t,e,i,r)},t.prototype.putImageData=function(t,e,i){this._context.putImageData(t,e,i)},t.prototype.quadraticCurveTo=function(t,e,i,r){this._context.quadraticCurveTo(t,e,i,r)},t.prototype.restore=function(){this._context.restore()},t.prototype.rotate=function(t){this._context.rotate(t)},t.prototype.save=function(){this._context.save()},t.prototype.scale=function(t,e){this._context.scale(t,e)},t.prototype.setLineDash=function(t){this._context.setLineDash?this._context.setLineDash(t):”mozDash“in this._context?this._context.mozDash=t:”webkitLineDash“in this._context&&(this._context.webkitLineDash=t)},t.prototype.getLineDash=function(){return this._context.getLineDash()},t.prototype.setTransform=function(t,e,i,r,n,o){this._context.setTransform(t,e,i,r,n,o)},t.prototype.stroke=function(){this._context.stroke()},t.prototype.strokeText=function(t,e,i,r){this._context.strokeText(t,e,i,r)},t.prototype.transform=function(t,e,i,r,n,o){this._context.transform(t,e,i,r,n,o)},t.prototype.translate=function(t,e){this._context.translate(t,e)},t.prototype._enableTrace=function(){var t,e,i=this,r=s.length,n=o.Util._simplifyArray,a=this.setAttr,h=function(t){var r,o=i;i=function(){return e=n(Array.prototype.slice.call(arguments,0)),r=o.apply(i,arguments),i._trace({method:t,args:e}),r}};for(t=0;t);i.setAttr=function(){a.apply(i,arguments);var t=arguments,e=arguments;”shadowOffsetX“!==t&&”shadowOffsetY“!==t&&”shadowBlur“!==t||(e/=this.canvas.getPixelRatio()),i._trace({property:t,val:e})}},t.prototype._applyGlobalCompositeOperation=function(t){var e=t.getGlobalCompositeOperation();”source-over“!==e&&this.setAttr(”globalCompositeOperation“,e)},t}();e.Context=h,.forEach((function(t){Object.defineProperty(h.prototype,t,{get:function(){return this._context},set:function(e){this._context=e}})}));var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype._fillColor=function(t){var e=t.fill();this.setAttr(”fillStyle“,e),t._fillFunc(this)},e.prototype._fillPattern=function(t){var e=t.getFillPatternX(),i=t.getFillPatternY(),r=a.Konva.getAngle(t.getFillPatternRotation()),n=t.getFillPatternOffsetX(),o=t.getFillPatternOffsetY(),s=t.getFillPatternScaleX(),h=t.getFillPatternScaleY();(e||i)&&this.translate(e||0,i||0),r&&this.rotate®,(s||h)&&this.scale(s,h),(n||o)&&this.translate(-1*n,-1*o),this.setAttr(”fillStyle“,t._getFillPattern()),t._fillFunc(this)},e.prototype._fillLinearGradient=function(t){var e=t._getLinearGradient();e&&(this.setAttr(”fillStyle“,e),t._fillFunc(this))},e.prototype._fillRadialGradient=function(t){var e=t._getRadialGradient();e&&(this.setAttr(”fillStyle“,e),t._fillFunc(this))},e.prototype._fill=function(t){var e=t.fill(),i=t.getFillPriority();if(e&&”color“===i)this._fillColor(t);else{var r=t.getFillPatternImage();if(r&&”pattern“===i)this._fillPattern(t);else{var n=t.getFillLinearGradientColorStops();if(n&&”linear-gradient“===i)this._fillLinearGradient(t);else{var o=t.getFillRadialGradientColorStops();o&&”radial-gradient“===i?this._fillRadialGradient(t):e?this._fillColor(t):r?this._fillPattern(t):n?this._fillLinearGradient(t):o&&this._fillRadialGradient(t)}}}},e.prototype._strokeLinearGradient=function(t){var e=t.getStrokeLinearGradientStartPoint(),i=t.getStrokeLinearGradientEndPoint(),r=t.getStrokeLinearGradientColorStops(),n=this.createLinearGradient(e.x,e.y,i.x,i.y);if®{for(var o=0;o,r);this.setAttr(”strokeStyle“,n)}},e.prototype._stroke=function(t){var e=t.dash(),i=t.getStrokeScaleEnabled();if(t.hasStroke()){if(!i){this.save();var r=this.getCanvas().getPixelRatio();this.setTransform(r,0,0,r,0,0)}this._applyLineCap(t),e&&t.dashEnabled()&&(this.setLineDash(e),this.setAttr(”lineDashOffset“,t.dashOffset())),this.setAttr(”lineWidth“,t.strokeWidth()),t.getShadowForStrokeEnabled()||this.setAttr(”shadowColor“,”rgba(0,0,0,0)“),t.getStrokeLinearGradientColorStops()?this._strokeLinearGradient(t):this.setAttr(”strokeStyle“,t.stroke()),t._strokeFunc(this),i||this.restore()}},e.prototype._applyShadow=function(t){var e=o.Util,i=e.get(t.getShadowRGBA(),”black“),r=e.get(t.getShadowBlur(),5),n=e.get(t.getShadowOffset(),{x:0,y:0}),a=t.getAbsoluteScale(),s=this.canvas.getPixelRatio(),h=a.x*s,c=a.y*s;this.setAttr(”shadowColor“,i),this.setAttr(”shadowBlur“,r*Math.min(Math.abs(h),Math.abs©)),this.setAttr(”shadowOffsetX“,n.x*h),this.setAttr(”shadowOffsetY“,n.y*c)},e}(h);e.SceneContext=c;var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype._fill=function(t){this.save(),this.setAttr(”fillStyle“,t.colorKey),t._fillFuncHit(this),this.restore()},e.prototype.strokeShape=function(t){t.hasHitStroke()&&this._stroke(t)},e.prototype._stroke=function(t){if(t.hasHitStroke()){var e=t.getStrokeScaleEnabled();if(!e){this.save();var i=this.getCanvas().getPixelRatio();this.setTransform(i,0,0,i,0,0)}this._applyLineCap(t);var r=t.hitStrokeWidth(),n=”auto“===r?t.strokeWidth():r;this.setAttr(”lineWidth“,n),this.setAttr(”strokeStyle“,t.colorKey),t._strokeFuncHit(this),e||this.restore()}},e}(h);e.HitContext=l},function(t,e,i){”use strict“;Object.defineProperty(e,”__esModule“,{value:!0});var r=i(1),n=new Map,o=void 0!==r.Konva._global.PointerEvent;function a(t){return{evt:t,pointerId:t.pointerId}}function s(t,e){var i=n.get(t);if(i){var r=i.getStage();r&&r.content,n.delete(t),o&&i._fire(”lostpointercapture“,a(new PointerEvent(”lostpointercapture“)))}}e.getCapturedShape=function(t){return n.get(t)},e.createEvent=a,e.hasPointerCapture=function(t,e){return n.get(t)===e},e.setPointerCapture=function(t,e){s(t),e.getStage()&&(n.set(t,e),o&&e._fire(”gotpointercapture“,a(new PointerEvent(”gotpointercapture“))))},e.releaseCapture=s},function(t,e,i){”use strict“;var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t=e)})(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,”__esModule“,{value:!0});var o=i(3),a=i(10),s=i(4),h=i(0),c=i(11),l=function(t){function e(e){var i=t.call(this,e)||this;return i.canvas=new c.SceneCanvas,i._waitingForDraw=!1,i.on(”visibleChange“,i._checkVisibility),i._checkVisibility(),i.on(”imageSmoothingEnabledChange“,i._setSmoothEnabled),i._setSmoothEnabled(),i}return n(e,t),e.prototype.createPNGStream=function(){return this.canvas._canvas.createPNGStream()},e.prototype.getCanvas=function(){return this.canvas},e.prototype.getHitCanvas=function(){return this.hitCanvas},e.prototype.getContext=function(){return this.getCanvas().getContext()},e.prototype.clear=function(t){return this.getContext().clear(t),this},e.prototype.setZIndex=function(e){t.prototype.setZIndex.call(this,e);var i=this.getStage();return i&&(i.content.removeChild(this.getCanvas()._canvas),e.getCanvas()._canvas):i.content.appendChild(this.getCanvas()._canvas)),this},e.prototype.moveToTop=function(){s.Node.prototype.moveToTop.call(this);var t=this.getStage();return t&&(t.content.removeChild(this.getCanvas()._canvas),t.content.appendChild(this.getCanvas()._canvas)),!0},e.prototype.moveUp=function(){if(!s.Node.prototype.moveUp.call(this))return!1;var t=this.getStage();return!!t&&(t.content.removeChild(this.getCanvas()._canvas),this.index.getCanvas()._canvas):t.content.appendChild(this.getCanvas()._canvas),!0)},e.prototype.moveDown=function(){if(s.Node.prototype.moveDown.call(this)){var t=this.getStage();if(t){var e=t.children;t.content.removeChild(this.getCanvas()._canvas),t.content.insertBefore(this.getCanvas()._canvas,e.getCanvas()._canvas)}return!0}return!1},e.prototype.moveToBottom=function(){if(s.Node.prototype.moveToBottom.call(this)){var t=this.getStage();if(t){var e=t.children;t.content.removeChild(this.getCanvas()._canvas),t.content.insertBefore(this.getCanvas()._canvas,e.getCanvas()._canvas)}return!0}return!1},e.prototype.getLayer=function(){return this},e.prototype.hitGraphEnabled=function(){return!0},e.prototype.remove=function(){var t=this.getCanvas()._canvas;return s.Node.prototype.remove.call(this),t&&t.parentNode&&o.Util._isInDocument(t)&&t.parentNode.removeChild(t),this},e.prototype.getStage=function(){return this.parent},e.prototype.setSize=function(t){var e=t.width,i=t.height;return this.canvas.setSize(e,i),this._setSmoothEnabled(),this},e.prototype._toKonvaCanvas=function(t){return(t=t||{}).width=t.width||this.getWidth(),t.height=t.height||this.getHeight(),t.x=void 0!==t.x?t.x:this.x(),t.y=void 0!==t.y?t.y:this.y(),s.Node.prototype._toKonvaCanvas.call(this,t)},e.prototype._checkVisibility=function(){var t=this.visible();this.canvas._canvas.style.display=t?”block“:”none“},e.prototype._setSmoothEnabled=function(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()},e.prototype.getWidth=function(){if(this.parent)return this.parent.width()},e.prototype.setWidth=function(){o.Util.warn('Can not change width of layer. Use ”stage.width(value)“ function instead.')},e.prototype.getHeight=function(){if(this.parent)return this.parent.height()},e.prototype.setHeight=function(){o.Util.warn('Can not change height of layer. Use ”stage.height(value)“ function instead.')},e.prototype.getIntersection=function(t,e){return null},e.prototype.batchDraw=function(){var t=this;return this._waitingForDraw||(this._waitingForDraw=!0,o.Util.requestAnimFrame((function(){t.draw(),t._waitingForDraw=!1}))),this},e.prototype._applyTransform=function(t,e,i){var r=t.getAbsoluteTransform(i).getMatrix();e.transform(r,r,r,r,r,r)},e}(a.Container);e.BaseLayer=l,l.prototype.nodeType=”BaseLayer“,h.Factory.addGetterSetter(l,”imageSmoothingEnabled“,!0),h.Factory.addGetterSetter(l,”clearBeforeDraw“,!0),o.Collection.mapMethods(l)},function(t,e,i){”use strict“;var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t=e)})(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),o=this&&this.__spreadArrays||function(){for(var t=0,e=0,i=arguments.length;e.length;var r=Array(t),n=0;for(e=0;e<i;e++)for(var o=arguments,a=0,s=o.length;a=o;return r};Object.defineProperty(e,”__esModule“,{value:!0});var a=i(3),s=i(0),h=i(5),c=i(2),l=i(1),u=function(t){function e(e){var i=t.call(this,e)||this;return i.on(”pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva“,(function(){this._clearCache(”tensionPoints“)})),i}return n(e,t),e.prototype._sceneFunc=function(t){var e,i,r,n=this.points(),o=n.length,a=this.tension(),s=this.closed(),h=this.bezier();if(o){if(t.beginPath(),t.moveTo(n,n),0!==a&&o>4){for(i=(e=this.getTensionPoints()).length,r=s?0:4,s||t.quadraticCurveTo(e,e,e,e);r,e,e,e,e,e);s||t.quadraticCurveTo(e,e,n,n)}else if(h)for(r=2;r,n,n,n,n,n);else for(r=2;r,n);s?(t.closePath(),t.fillStrokeShape(this)):t.strokeShape(this)}},e.prototype.getTensionPoints=function(){return this._getCache(”tensionPoints“,this._getTensionPoints)},e.prototype._getTensionPoints=function(){return this.closed()?this._getTensionPointsClosed():a.Util._expandPoints(this.points(),this.tension())},e.prototype._getTensionPointsClosed=function(){var t=this.points(),e=t.length,i=this.tension(),r=a.Util._getControlPoints(t,t,t,t,t,t,i),n=a.Util._getControlPoints(t,t,t,t,t,t,i),o=a.Util._expandPoints(t,i);return[r,r].concat(o).concat([n,n,t,t,n,n,r,r,t,t])},e.prototype.getWidth=function(){return this.getSelfRect().width},e.prototype.getHeight=function(){return this.getSelfRect().height},e.prototype.getSelfRect=function(){var t=this.points();if(t.length<4)return{x:t||0,y:t||0,width:0,height:0};for(var e,i,r=(t=0!==this.tension()?o([t,t],this._getTensionPoints(),[t,t]):this.points()),n=t,a=t,s=t,h=0;h,i=t,r=Math.min(r,e),n=Math.max(n,e),a=Math.min(a,i),s=Math.max(s,i);return{x:r,y:a,width:n-r,height:s-a}},e}(h.Shape);e.Line=u,u.prototype.className=”Line“,u.prototype._attrsAffectingSize=,l._registerNode(u),s.Factory.addGetterSetter(u,”closed“,!1),s.Factory.addGetterSetter(u,”bezier“,!1),s.Factory.addGetterSetter(u,”tension“,0,c.getNumberValidator()),s.Factory.addGetterSetter(u,”points“,[],c.getNumberArrayValidator()),a.Collection.mapMethods(u)},function(t,e,i){”use strict“;var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t=e)})(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,”__esModule“,{value:!0});var o=i(3),a=i(0),s=i(5),h=i(1),c=function(t){function e(i){var r=t.call(this,i)||this;r.dataArray=[],r.pathLength=0,r.dataArray=e.parsePathData(r.data()),r.pathLength=0;for(var n=0;n.pathLength;return r.on(”dataChange.konva“,(function(){this.dataArray=e.parsePathData(this.data()),this.pathLength=0;for(var t=0;t.pathLength})),r}return n(e,t),e.prototype._sceneFunc=function(t){var e=this.dataArray;t.beginPath();for(var i=!1,r=0;r<e.length;r++){var n=e.command,o=e.points;switch(n){case”L“:t.lineTo(o,o);break;case”M“:t.moveTo(o,o);break;case”C“:t.bezierCurveTo(o,o,o,o,o,o);break;case”Q“:t.quadraticCurveTo(o,o,o,o);break;case”A“:var a=o,s=o,h=o,c=o,l=o,u=o,d=o,p=o,f=h>c?h:c,g=h>c?1:h/c,y=h>c?c/h:1;t.translate(a,s),t.rotate(d),t.scale(g,y),t.arc(0,0,f,l,l+u,1-p),t.scale(1/g,1/y),t.rotate(-d),t.translate(-a,-s);break;case”z“:i=!0,t.closePath()}}i||this.hasFill()?t.fillStrokeShape(this):t.strokeShape(this)},e.prototype.getSelfRect=function(){var t=[];this.dataArray.forEach((function(i){if(”A“===i.command){var r=i.points,n=i.points,o=i.points+n,a=Math.PI/180;if(Math.abs(r-o)<a&&(a=Math.abs(r-o)),n<0)for(var s=r-a;s>o;s-=a){var h=e.getPointOnEllipticalArc(i.points,i.points,i.points,i.points,s,0);t.push(h.x,h.y)}else for(s=r+a;s<o;s+=a){h=e.getPointOnEllipticalArc(i.points,i.points,i.points,i.points,s,0);t.push(h.x,h.y)}}else if(”C“===i.command)for(s=0;s<=1;s+=.01){h=e.getPointOnCubicBezier(s,i.start.x,i.start.y,i.points,i.points,i.points,i.points,i.points,i.points);t.push(h.x,h.y)}else t=t.concat(i.points)}));for(var i,r,n=t,o=t,a=t,s=t,h=0;h,r=t,isNaN(i)||(n=Math.min(n,i),o=Math.max(o,i)),isNaN®||(a=Math.min(a,r),s=Math.max(s,r));return{x:Math.round(n),y:Math.round(a),width:Math.round(o-n),height:Math.round(s-a)}},e.prototype.getLength=function(){return this.pathLength},e.prototype.getPointAtLength=function(t){var i,r=0,n=this.dataArray.length;if(!n)return null;for(;rthis.dataArray.pathLength;)t-=this.dataArray.pathLength,++r;if(r===n)return{x:(i=this.dataArray.points.slice(-2)),y:i};if(t<.01)return{x:(i=this.dataArray.points.slice(0,2)),y:i};var o=this.dataArray,a=o.points;switch(o.command){case”L“:return e.getPointOnLine(t,o.start.x,o.start.y,a,a);case”C“:return e.getPointOnCubicBezier(t/o.pathLength,o.start.x,o.start.y,a,a,a,a,a,a);case”Q“:return e.getPointOnQuadraticBezier(t/o.pathLength,o.start.x,o.start.y,a,a,a,a);case”A“:var s=a,h=a,c=a,l=a,u=a,d=a,p=a;return u+=d*t/o.pathLength,e.getPointOnEllipticalArc(s,h,c,l,u,p)}return null},e.getLineLength=function(t,e,i,r){return Math.sqrt((i-t)*(i-t)+(r-e)*(r-e))},e.getPointOnLine=function(t,e,i,r,n,o,a){void 0===o&&(o=e),void 0===a&&(a=i);var s=(n-i)/(r-e+1e-8),h=Math.sqrt(t*t/(1+s*s));r<e&&(h*=-1);var c,l=s*h;if(r===e)c={x:o,y:a+l};else if((a-i)/(o-e+1e-8)===s)c={x:o+h,y:a+l};else{var u,d,p=this.getLineLength(e,i,r,n);if(p<1e-8)return;var f=(o-e)*(r-e)+(a-i)*(n-i);u=e+(f/=p*p)*(r-e),d=i+f*(n-i);var g=this.getLineLength(o,a,u,d),y=Math.sqrt(t*t-g*g);h=Math.sqrt(y*y/(1+s*s)),r<e&&(h*=-1),c={x:u+h,y:d+(l=s*h)}}return c},e.getPointOnCubicBezier=function(t,e,i,r,n,o,a,s,h){function c(t){return t*t*t}function l(t){return 3*t*t*(1-t)}function u(t){return 3*t*(1-t)*(1-t)}function d(t){return(1-t)*(1-t)*(1-t)}return{x:s*c(t)+o*l(t)+r*u(t)+e*d(t),y:h*c(t)+a*l(t)+n*u(t)+i*d(t)}},e.getPointOnQuadraticBezier=function(t,e,i,r,n,o,a){function s(t){return t*t}function h(t){return 2*t*(1-t)}function c(t){return(1-t)*(1-t)}return{x:o*s(t)+r*h(t)+e*c(t),y:a*s(t)+n*h(t)+i*c(t)}},e.getPointOnEllipticalArc=function(t,e,i,r,n,o){var a=Math.cos(o),s=Math.sin(o),h=i*Math.cos(n),c=r*Math.sin(n);return{x:t+(h*a-c*s),y:e+(h*s+c*a)}},e.parsePathData=function(t){if(!t)return[];var e=t,i=;e=e.replace(new RegExp(” “,”g“),”,“);for(var r=0;r<i.length;r++)e=e.replace(new RegExp(i,”g“),”|“+i);var n,o=e.split(”|“),a=[],s=,h=0,c=0,l=/(?((d+.d+)|((d+)|(.d+)))(?:e[-+]?d+)?)/gi;for(r=1;r<o.length;r++){var u=o,d=u.charAt(0);for(u=u.slice(1),s.length=0;n=l.exec(u);)s.push(n);for(var p=[],f=0,g=s.length;f<g;f++){var y=parseFloat(s);isNaN(y)?p.push(0):p.push(y)}for(;p.length>0&&!isNaN(p);){var v,_,m,b,x,S,w,C,P,A,T=null,k=[],M=h,F=c;switch(d){case”l“:h+=p.shift(),c+=p.shift(),T=”L“,k.push(h,c);break;case”L“:h=p.shift(),c=p.shift(),k.push(h,c);break;case”m“:var O=p.shift(),G=p.shift();if(h+=O,c+=G,T=”M“,a.length>2&&”z“===a.command)for(var D=a.length-2;D>=0;D–)if(”M“===a.command){h=a.points+O,c=a.points+G;break}k.push(h,c),d=”l“;break;case”M“:h=p.shift(),c=p.shift(),T=”M“,k.push(h,c),d=”L“;break;case”h“:h+=p.shift(),T=”L“,k.push(h,c);break;case”H“:h=p.shift(),T=”L“,k.push(h,c);break;case”v“:c+=p.shift(),T=”L“,k.push(h,c);break;case”V“:c=p.shift(),T=”L“,k.push(h,c);break;case”C“:k.push(p.shift(),p.shift(),p.shift(),p.shift()),h=p.shift(),c=p.shift(),k.push(h,c);break;case”c“:k.push(h+p.shift(),c+p.shift(),h+p.shift(),c+p.shift()),h+=p.shift(),c+=p.shift(),T=”C“,k.push(h,c);break;case”S“:_=h,m=c,”C“===(v=a).command&&(_=h+(h-v.points),m=c+(c-v.points)),k.push(_,m,p.shift(),p.shift()),h=p.shift(),c=p.shift(),T=”C“,k.push(h,c);break;case”s“:_=h,m=c,”C“===(v=a).command&&(_=h+(h-v.points),m=c+(c-v.points)),k.push(_,m,h+p.shift(),c+p.shift()),h+=p.shift(),c+=p.shift(),T=”C“,k.push(h,c);break;case”Q“:k.push(p.shift(),p.shift()),h=p.shift(),c=p.shift(),k.push(h,c);break;case”q“:k.push(h+p.shift(),c+p.shift()),h+=p.shift(),c+=p.shift(),T=”Q“,k.push(h,c);break;case”T“:_=h,m=c,”Q“===(v=a).command&&(_=h+(h-v.points),m=c+(c-v.points)),h=p.shift(),c=p.shift(),T=”Q“,k.push(_,m,h,c);break;case”t“:_=h,m=c,”Q“===(v=a).command&&(_=h+(h-v.points),m=c+(c-v.points)),h+=p.shift(),c+=p.shift(),T=”Q“,k.push(_,m,h,c);break;case”A“:b=p.shift(),x=p.shift(),S=p.shift(),w=p.shift(),C=p.shift(),P=h,A=c,h=p.shift(),c=p.shift(),T=”A“,k=this.convertEndpointToCenterParameterization(P,A,h,c,w,C,b,x,S);break;case”a“:b=p.shift(),x=p.shift(),S=p.shift(),w=p.shift(),C=p.shift(),P=h,A=c,h+=p.shift(),c+=p.shift(),T=”A“,k=this.convertEndpointToCenterParameterization(P,A,h,c,w,C,b,x,S)}a.push({command:T||d,points:k,start:{x:M,y:F},pathLength:this.calcLength(M,F,T||d,k)})}”z“!==d&&”Z“!==d||a.push({command:”z“,points:[],start:void 0,pathLength:0})}return a},e.calcLength=function(t,i,r,n){var o,a,s,h,c=e;switch®{case”L“:return c.getLineLength(t,i,n,n);case”C“:for(o=0,a=c.getPointOnCubicBezier(0,t,i,n,n,n,n,n,n),h=.01;h<=1;h+=.01)s=c.getPointOnCubicBezier(h,t,i,n,n,n,n,n,n),o+=c.getLineLength(a.x,a.y,s.x,s.y),a=s;return o;case”Q“:for(o=0,a=c.getPointOnQuadraticBezier(0,t,i,n,n,n,n),h=.01;h<=1;h+=.01)s=c.getPointOnQuadraticBezier(h,t,i,n,n,n,n),o+=c.getLineLength(a.x,a.y,s.x,s.y),a=s;return o;case”A“:o=0;var l=n,u=n,d=n+u,p=Math.PI/180;if(Math.abs(l-d),n,n,n,l,0),u<0)for(h=l-p;h>d;h-=p)s=c.getPointOnEllipticalArc(n,n,n,n,h,0),o+=c.getLineLength(a.x,a.y,s.x,s.y),a=s;else for(h=l+p;h,n,n,n,h,0),o+=c.getLineLength(a.x,a.y,s.x,s.y),a=s;return s=c.getPointOnEllipticalArc(n,n,n,n,d,0),o+=c.getLineLength(a.x,a.y,s.x,s.y)}return 0},e.convertEndpointToCenterParameterization=function(t,e,i,r,n,o,a,s,h){var c=h*(Math.PI/180),l=Math.cos©*(t-i)/2+Math.sin©*(e-r)/2,u=-1*Math.sin©*(t-i)/2+Math.cos©*(e-r)/2,d=l*l/(a*a)+u*u/(s*s);d>1&&(a*=Math.sqrt(d),s*=Math.sqrt(d));var p=Math.sqrt((a*a*(s*s)-a*a*(u*u)-s*s*(l*l))/(a*a*(u*u)+s*s*(l*l)));n===o&&(p*=-1),isNaN(p)&&(p=0);var f=p*a*u/s,g=p*-s*l/a,y=(t+i)/2+Math.cos©*f-Math.sin©*g,v=(e+r)/2+Math.sin©*f+Math.cos©*g,_=function(t){return Math.sqrt(t*t+t*t)},m=function(t,e){return(t*e+t*e)/(_(t)*_(e))},b=function(t,e){return(t*e<t*e?-1:1)*Math.acos(m(t,e))},x=b(,[(l-f)/a,(u-g)/s]),S=,w=,C=b(S,w);return m(S,w)<=-1&&(C=Math.PI),m(S,w)>=1&&(C=0),0===o&&C>0&&(C-=2*Math.PI),1===o&&C<0&&(C+=2*Math.PI),},e}(s.Shape);e.Path=c,c.prototype.className=”Path“,c.prototype._attrsAffectingSize=,h._registerNode©,a.Factory.addGetterSetter(c,”data“),o.Collection.mapMethods©},function(t,e,i){”use strict“;var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t=e)})(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,”__esModule“,{value:!0});var o=i(3),a=i(0),s=i(5),h=i(1),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype._sceneFunc=function(t){var e=this.cornerRadius(),i=this.width(),r=this.height();if(t.beginPath(),e){var n=0,o=0,a=0,s=0;”number“==typeof e?n=o=a=s=Math.min(e,i/2,r/2):(n=Math.min(e,i/2,r/2),o=Math.min(e,i/2,r/2),s=Math.min(e,i/2,r/2),a=Math.min(e,i/2,r/2)),t.moveTo(n,0),t.lineTo(i-o,0),t.arc(i-o,o,o,3*Math.PI/2,0,!1),t.lineTo(i,r-s),t.arc(i-s,r-s,s,0,Math.PI/2,!1),t.lineTo(a,r),t.arc(a,r-a,a,Math.PI/2,Math.PI,!1),t.lineTo(0,n),t.arc(n,n,n,Math.PI,3*Math.PI/2,!1)}else t.rect(0,0,i,r);t.closePath(),t.fillStrokeShape(this)},e}(s.Shape);e.Rect=c,c.prototype.className=”Rect“,h._registerNode©,a.Factory.addGetterSetter(c,”cornerRadius“,0),o.Collection.mapMethods©},function(t,e,i){”use strict“;var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t=e)})(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,”__esModule“,{value:!0});var o,a=i(3),s=i(0),h=i(5),c=i(1),l=i(2),u=i(1),d=,p=d.length;function f(){return o||(o=a.Util.createCanvasElement().getContext(”2d“))}String.prototype.trimRight;var g=function(t){function e(e){var i=t.call(this,function(t){return(t=t||{}).fillLinearGradientColorStops||t.fillRadialGradientColorStops||t.fillPatternImage||(t.fill=t.fill||”black“),t}(e))||this;i._partialTextX=0,i._partialTextY=0;for(var r=0;r+”Change.konva“,i._setTextData);return i._setTextData(),i}return n(e,t),e.prototype._sceneFunc=function(t){var e,i=this.padding(),r=this.fontSize(),n=this.lineHeight()*r,o=this.textArr,a=o.length,s=this.verticalAlign(),h=0,c=this.align(),l=this.getWidth(),u=this.letterSpacing(),d=this.fill(),p=this.textDecoration(),f=-1!==p.indexOf(”underline“),g=-1!==p.indexOf(”line-through“),y=0,v=(y=n/2,0),_=0;for(t.setAttr(”font“,this._getContextFont()),t.setAttr(”textBaseline“,”middle“),t.setAttr(”textAlign“,”left“),”middle“===s?h=(this.getHeight()-a*n-2*i)/2:”bottom“===s&&(h=this.getHeight()-a*n-2*i),t.translate(i,h+i),e=0;e<a;e++){v=0,_=0;var m,b,x,S=o,w=S.text,C=S.width,P=e!==a-1;if(t.save(),”right“===c?v+=l-C-2*i:”center“===c&&(v+=(l-C-2*i)/2),f&&(t.save(),t.beginPath(),t.moveTo(v,y+_+Math.round(r/2)),b=0===(m=w.split(” “).length-1),x=”justify“===c&&P&&!b?l-2*i:C,t.lineTo(v+Math.round(x),y+_+Math.round(r/2)),t.lineWidth=r/15,t.strokeStyle=d,t.stroke(),t.restore()),g&&(t.save(),t.beginPath(),t.moveTo(v,y+_),b=0===(m=w.split(” “).length-1),x=”justify“===c&&P&&!b?l-2*i:C,t.lineTo(v+Math.round(x),y+_),t.lineWidth=r/15,t.strokeStyle=d,t.stroke(),t.restore()),0!==u||”justify“===c){m=w.split(” “).length-1;for(var A=0;A<w.length;A++){var T=w;” “===T&&e!==a-1&&”justify“===c&&(v+=Math.floor((l-2*i-C)/m)),this._partialTextX=v,this._partialTextY=y+_,this._partialText=T,t.fillStrokeShape(this),v+=Math.round(this.measureSize(T).width)+u}}else this._partialTextX=v,this._partialTextY=y+_,this._partialText=w,t.fillStrokeShape(this);t.restore(),a>1&&(y+=n)}},e.prototype._hitFunc=function(t){var e=this.getWidth(),i=this.getHeight();t.beginPath(),t.rect(0,0,e,i),t.closePath(),t.fillStrokeShape(this)},e.prototype.setText=function(t){var e=a.Util._isString(t)?t:null==t?”“:t+”“;return this._setAttr(”text“,e),this},e.prototype.getWidth=function(){return”auto“===this.attrs.width||void 0===this.attrs.width?this.getTextWidth()+2*this.padding():this.attrs.width},e.prototype.getHeight=function(){return”auto“===this.attrs.height||void 0===this.attrs.height?this.fontSize()*this.textArr.length*this.lineHeight()+2*this.padding():this.attrs.height},e.prototype.getTextWidth=function(){return this.textWidth},e.prototype.getTextHeight=function(){return a.Util.warn(”text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height.“),this.textHeight},e.prototype.measureSize=function(t){var e,i=f(),r=this.fontSize();return i.save(),i.font=this._getContextFont(),e=i.measureText(t),i.restore(),{width:e.width,height:r}},e.prototype._getContextFont=function(){return c.Konva.UA.isIE?this.fontStyle()+” “+this.fontSize()+”px “+this.fontFamily():this.fontStyle()+” “+this.fontVariant()+” “+this.fontSize()+”px “+this.fontFamily()},e.prototype._addTextLine=function(t){”justify“===this.align()&&(t=t.trim());var e=this._getTextWidth(t);return this.textArr.push({text:t,width:e})},e.prototype._getTextWidth=function(t){var e=this.letterSpacing(),i=t.length;return f().measureText(t).width+(i?e*(i-1):0)},e.prototype._setTextData=function(){var t=this.text().split(”n“),e=+this.fontSize(),i=0,r=this.lineHeight()*e,n=this.attrs.width,o=this.attrs.height,a=”auto“!==n&&void 0!==n,s=”auto“!==o&&void 0!==o,h=this.padding(),c=n-2*h,l=o-2*h,u=0,d=this.wrap(),p=”none“!==d,g=”char“!==d&&p,y=this.ellipsis()&&!p;this.textArr=[],f().font=this._getContextFont();for(var v=y?this._getTextWidth(”…“):0,_=0,m=t.length;_<m;++_){var b=t,x=this._getTextWidth(b);if(a&&x>c)for(;b.length>0;){for(var S=0,w=b.length,C=”“,P=0;S<w;){var A=S+w>>>1,T=b.slice(0,A+1),k=this._getTextWidth(T)+v;k<=c?(S=A+1,C=T+(y?”…“:”“),P=k):w=A}if(!C)break;if(g){var M,F=b;(M=(” “===F||”-“===F)&&P<=c?C.length:Math.max(C.lastIndexOf(” “),C.lastIndexOf(”-“))+1)>0&&(S=M,C=C.slice(0,S),P=this._getTextWidth(C))}if(C=C.trimRight(),this._addTextLine(C),i=Math.max(i,P),u+=r,!p||s&&u+r>l)break;if((b=(b=b.slice(S)).trimLeft()).length>0&&(x=this._getTextWidth(b))<=c){this._addTextLine(b),u+=r,i=Math.max(i,x);break}}else this._addTextLine(b),u+=r,i=Math.max(i,x);if(s&&u+r>l)break}this.textHeight=e,this.textWidth=i},e.prototype.getStrokeScaleEnabled=function(){return!0},e}(h.Shape);e.Text=g,g.prototype._fillFunc=function(t){t.fillText(this._partialText,this._partialTextX,this._partialTextY)},g.prototype._strokeFunc=function(t){t.strokeText(this._partialText,this._partialTextX,this._partialTextY)},g.prototype.className=”Text“,g.prototype._attrsAffectingSize=,u._registerNode(g),s.Factory.overWriteSetter(g,”width“,l.getNumberOrAutoValidator()),s.Factory.overWriteSetter(g,”height“,l.getNumberOrAutoValidator()),s.Factory.addGetterSetter(g,”fontFamily“,”Arial“),s.Factory.addGetterSetter(g,”fontSize“,12,l.getNumberValidator()),s.Factory.addGetterSetter(g,”fontStyle“,”normal“),s.Factory.addGetterSetter(g,”fontVariant“,”normal“),s.Factory.addGetterSetter(g,”padding“,0,l.getNumberValidator()),s.Factory.addGetterSetter(g,”align“,”left“),s.Factory.addGetterSetter(g,”verticalAlign“,”top“),s.Factory.addGetterSetter(g,”lineHeight“,1,l.getNumberValidator()),s.Factory.addGetterSetter(g,”wrap“,”word“),s.Factory.addGetterSetter(g,”ellipsis“,!1),s.Factory.addGetterSetter(g,”letterSpacing“,0,l.getNumberValidator()),s.Factory.addGetterSetter(g,”text“,”“,l.getStringValidator()),s.Factory.addGetterSetter(g,”textDecoration“,”“),a.Collection.mapMethods(g)},function(t,e,i){const r=i(8),{anchor:n,Anchor:o}=i(9),a=i(12),s=i(6),{Tab:h,Slot:c,None:l}=i(13),{NullValidator:u,PieceValidator:d,PuzzleValidator:p}=i(15),{Horizontal:f,Vertical:g}=i(26),y=i(19),v=i(16),_=i(17),m=i(27),{InsertSequence:b,…x}=i(22),S=i(23),w=i(28),{vector:C,…P}=i(7),{radio:A,diameter:T}=i(20),k=i(21),M=i(16);t.exports={anchor:n,vector:C,radio:A,diameter:T,Anchor:o,Puzzle:a,Piece:s,Canvas:_,Manufacturer:m,InsertSequence:b,PieceValidator:d,PuzzleValidator:p,NullValidator:u,Horizontal:f,Vertical:g,Tab:h,Slot:c,None:l,Pair:r,Metadata:S,SpatialMetadata:w,Outline:v,Structure:y,Vector:P,Shuffler:k,generators:x,outline:M,painters:{Dummy:i(41),Konva:i(42)}}},function(t,e){t.exports=function(t,e,i){return e<=t&&t<=i}},function(t,e,i){const{pivot:r}=i(14);class n{constructor(t,e,i){this.axis=t,this.forward=e,this.backward=i,this.forwardAnchor=e+”Anchor“,this.backwardAnchor=i+”Anchor“,this.forwardConnection=e+”Connection“,this.backwardConnection=i+”Connection“}attract(t,e,i=!1){const=r(t,e,i);let a,s;o.centralAnchor>n.centralAnchor?[a,s]=o.diff(n):[a,s]=o.diff(n),n.push(a,s)}openMovement(t,e){return e>0&&!t||e<0&&!t||0==e}canConnectWith(t,e,i){return this.closeTo(t,e,i)&&this.match(t,e)}closeTo(t,e,i){return t.closeTo(e,i)}match(t,e){return t.match(e)}connectWith(t,e,i,r){if(!this.canConnectWith(t,e,i))throw new Error(`can not connect ${this.forward}!`);t!==e&&(this.attract(e,t,r),t=e,e=t,t.fireConnect(e))}}t.exports={horizontal:new n(”x“,”right“,”left“),vertical:new n(”y“,”down“,”up“)}},function(t,e,i){const{vector:r}=i(7);t.exports={asImageMetadata:function(t){return t instanceof HTMLImageElement||t instanceof HTMLCanvasElement?{content:t,offset:r(1,1),scale:1}:t}}},function(t,e,i){i(17),i(6);const r=i(29);t.exports=class extends r{initialize(t,e){t.__nullLayer__={drawn:!1,figures:0}}draw(t){t.__nullLayer__.drawn=!0}sketch(t,e,i,r){t.__nullLayer__.figures++}}},function(t,e,i){let r;try{r=i(43)}catch(t){r={Stage:class{constructor(t){throw new Error(”Konva not loaded“)}}}}i(17),i(16),i(6);const n=i(8),{vector:o,…a}=i(7),s=i(29);t.exports=class extends s{initialize(t,e){var i=this._newStage({container:e,width:t.width,height:t.height,draggable:!t.fixed});this._initializeLayer(i,t)}_initializeLayer(t,e){var i=this._newLayer({});t.add(i),e.__konvaLayer__=i}draw(t){t.__konvaLayer__.draw()}reinitialize(t){const e=t.__konvaLayer__,i=e.getStage();e.destroy(),this._initializeLayer(i,t)}resize(t,e,i){const r=t.__konvaLayer__.getStage();r.width(e),r.height(i)}scale(t,e){t.__konvaLayer__.getStage().scale(e)}sketch(t,e,i,r){i.group=this._newGroup({x:e.metadata.currentPosition.x,y:e.metadata.currentPosition.y,draggable:!e.metadata.fixed,dragBoundFunc:t.preventOffstageDrag?i=>{const r=a.minus(o(t.width,t.height),e.size.radio);return a.max(a.min(i,r),e.size.radio)}:null}),i.shape=this._newLine({points:r.draw(e,e.diameter,t.borderFill),bezier:r.isBezier(),tension:r.isBezier()?null:t.lineSoftness,stroke:e.metadata.strokeColor||t.strokeColor,strokeWidth:t.strokeWidth,closed:!0,…a.multiply(e.radio,-1)}),this.fill(t,e,i),i.group.add(i.shape),t.__konvaLayer__.add(i.group)}fill(t,e,i){const r=t.imageMetadataFor(e);i.shape.fill(r?null:e.metadata.color||”black“),i.shape.fillPatternImage(r&&r.content),i.shape.fillPatternScale(r&&{x:r.scale,y:r.scale}),i.shape.fillPatternOffset(r&&a.divide(r.offset,r.scale))}label(t,e,i){i.label=this._newText({…a.minus({x:e.metadata.label.x||i.group.width()/2,y:e.metadata.label.y||i.group.height()/2},e.radio),text:e.metadata.label.text,fontSize:e.metadata.label.fontSize,fontFamily:e.metadata.label.fontFamily||”Sans Serif“,fill:e.metadata.label.color||”white“}),i.group.add(i.label)}physicalTranslate(t,e,i){e.x(i.centralAnchor.x),e.y(i.centralAnchor.y)}logicalTranslate(t,e,i){a.update(e.metadata.currentPosition,i.x(),i.y())}onDrag(t,e,i,r){i.on(”mouseover“,()=>{document.body.style.cursor=”pointer“}),i.on(”mouseout“,()=>{document.body.style.cursor=”default“}),i.on(”dragmove“,()=>{let=function(t,e){return n.diff(e.x(),e.y(),t.metadata.currentPosition.x,t.metadata.currentPosition.y)}(e,i);r(t,o)})}onDragEnd(t,e,i,r){i.on(”dragend“,()=>{r()})}_newLine(t){return new r.Line(t)}_newGroup(t){return new r.Group(t)}_newText(t){return new r.Text(t)}_newStage(t){return new r.Stage(t)}_newLayer(t){return new r.Layer(t)}}},function(t,e,i){var r=i(44).Konva;r._injectGlobal®,e.default=r,t.exports=e.default},function(t,e,i){”use strict“;Object.defineProperty(e,”__esModule“,{value:!0});var r=i(45),n=i(51),o=i(52),a=i(53),s=i(54),h=i(55),c=i(56),l=i(33),u=i(34),d=i(35),p=i(57),f=i(58),g=i(59),y=i(60),v=i(36),_=i(61),m=i(62),b=i(63),x=i(64),S=i(65),w=i(66),C=i(67),P=i(68),A=i(69),T=i(70),k=i(71),M=i(72),F=i(73),O=i(74),G=i(75),D=i(76),z=i(77),N=i(78),R=i(79),E=i(80),L=i(81),I=i(82);e.Konva=r.Konva.Util._assign(r.Konva,{Arc:n.Arc,Arrow:o.Arrow,Circle:a.Circle,Ellipse:s.Ellipse,Image:h.Image,Label:c.Label,Tag:c.Tag,Line:l.Line,Path:u.Path,Rect:d.Rect,RegularPolygon:p.RegularPolygon,Ring:f.Ring,Sprite:g.Sprite,Star:y.Star,Text:v.Text,TextPath:_.TextPath,Transformer:m.Transformer,Wedge:b.Wedge,Filters:{Blur:x.Blur,Brighten:S.Brighten,Contrast:w.Contrast,Emboss:C.Emboss,Enhance:P.Enhance,Grayscale:A.Grayscale,HSL:T.HSL,HSV:k.HSV,Invert:M.Invert,Kaleidoscope:F.Kaleidoscope,Mask:O.Mask,Noise:G.Noise,Pixelate:D.Pixelate,Posterize:z.Posterize,RGB:N.RGB,RGBA:R.RGBA,Sepia:E.Sepia,Solarize:L.Solarize,Threshold:I.Threshold}})},function(t,e,i){”use strict“;Object.defineProperty(e,”__esModule“,{value:!0});var r=i(1),n=i(3),o=i(4),a=i(10),s=i(47),h=i(48),c=i(49),l=i(24),u=i(18),d=i(5),p=i(25),f=i(50),g=i(30),y=i(11);e.Konva=n.Util._assign(r.Konva,{Collection:n.Collection,Util:n.Util,Transform:n.Transform,Node:o.Node,ids:o.ids,names:o.names,Container:a.Container,Stage:s.Stage,stages:s.stages,Layer:h.Layer,FastLayer:c.FastLayer,Group:l.Group,DD:u.DD,Shape:d.Shape,shapes:d.shapes,Animation:p.Animation,Tween:f.Tween,Easings:f.Easings,Context:g.Context,Canvas:y.Canvas})},function(t,e){var i;i=function(){return this}();try{i=i||new Function(”return this“)()}catch(t){”object“==typeof window&&(i=window)}t.exports=i},function(t,e,i){”use strict“;var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t=e)})(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,”__esModule“,{value:!0});var o=i(3),a=i(0),s=i(10),h=i(1),c=i(11),l=i(18),u=i(1),d=i(31),p=,f=p.length;function g(t,e){t.content.addEventListener(e,(function(i){t(i)}),!1)}function y(t){return void 0===t&&(t={}),(t.clipFunc||t.clipWidth||t.clipHeight)&&o.Util.warn(”Stage does not support clipping. Please use clip for Layers or Groups.“),t}e.stages=[];var v=function(t){function i(i){var r=t.call(this,y(i))||this;return r._pointerPositions=[],r._changedPointerPositions=,r._buildDOM(),r._bindContentEvents(),e.stages.push®,r.on(”widthChange.konva heightChange.konva“,r._resizeDOM),r.on(”visibleChange.konva“,r._checkVisibility),r.on(”clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva“,(function(){y(r.attrs)})),r._checkVisibility(),r}return n(i,t),i.prototype._validateAdd=function(t){var e=”Layer“===t.getType(),i=”FastLayer“===t.getType();e||i||o.Util.throw(”You may only add layers to the stage.“)},i.prototype._checkVisibility=function(){if(this.content){var t=this.visible()?”“:”none“;this.content.style.display=t}},i.prototype.setContainer=function(t){if(”string“==typeof t){if(”.“===t.charAt(0)){var e=t.slice(1);t=document.getElementsByClassName(e)}else{var i;i=”#“!==t.charAt(0)?t:t.slice(1),t=document.getElementById(i)}if(!t)throw”Can not find container in document with id “+i}return this._setAttr(”container“,t),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),t.appendChild(this.content)),this},i.prototype.shouldDrawHit=function(){return!0},i.prototype.clear=function(){var t,e=this.children,i=e.length;for(t=0;t.clear();return this},i.prototype.clone=function(t){return t||(t={}),t.container=document.createElement(”div“),s.Container.prototype.clone.call(this,t)},i.prototype.destroy=function(){t.prototype.destroy.call(this);var i=this.content;i&&o.Util._isInDocument(i)&&this.container().removeChild(i);var r=e.stages.indexOf(this);return r>-1&&e.stages.splice(r,1),this},i.prototype.getPointerPosition=function(){var t=this._pointerPositions||this._changedPointerPositions;return t?{x:t.x,y:t.y}:(o.Util.warn(”Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);“),null)},i.prototype._getPointerById=function(t){return this._pointerPositions.find((function(e){return e.id===t}))},i.prototype.getPointersPositions=function(){return this._pointerPositions},i.prototype.getStage=function(){return this},i.prototype.getContent=function(){return this.content},i.prototype._toKonvaCanvas=function(t){var e=(t=t||{}).x||0,i=t.y||0,r=new c.SceneCanvas({width:t.width||this.width(),height:t.height||this.height(),pixelRatio:t.pixelRatio||1}),n=r.getContext()._context,o=this.children;return(e||i)&&n.translate(-1*e,-1*i),o.each((function®{if(r.isVisible()){var o=r._toKonvaCanvas(t);n.drawImage(o._canvas,e,i,o.getWidth()/o.getPixelRatio(),o.getHeight()/o.getPixelRatio())}})),r},i.prototype.getIntersection=function(t,e){if(!t)return null;var i,r,n=this.children;for(i=n.length-1;i>=0;i–)if(r=n.getIntersection(t,e))return r;return null},i.prototype._resizeDOM=function(){var t=this.width(),e=this.height();this.content&&(this.content.style.width=t+”px“,this.content.style.height=e+”px“),this.bufferCanvas.setSize(t,e),this.bufferHitCanvas.setSize(t,e),this.children.each((function(i){i.setSize({width:t,height:e}),i.draw()}))},i.prototype.add=function(e){if(arguments.length>1){for(var i=0;i);return this}t.prototype.add.call(this,e);var r=this.children.length;return r>5&&o.Util.warn(”The stage has “r” layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group.“),e.setSize({width:this.width(),height:this.height()}),e.draw(),h.Konva.isBrowser&&this.content.appendChild(e.canvas._canvas),this},i.prototype.getParent=function(){return null},i.prototype.getLayer=function(){return null},i.prototype.hasPointerCapture=function(t){return d.hasPointerCapture(t,this)},i.prototype.setPointerCapture=function(t){d.setPointerCapture(t,this)},i.prototype.releaseCapture=function(t){d.releaseCapture(t,this)},i.prototype.getLayers=function(){return this.getChildren()},i.prototype._bindContentEvents=function(){if(h.Konva.isBrowser)for(var t=0;t)},i.prototype._mouseenter=function(t){this.setPointersPositions(t),this._fire(”mouseenter“,{evt:t,target:this,currentTarget:this})},i.prototype._mouseover=function(t){this.setPointersPositions(t),this._fire(”contentMouseover“,{evt:t}),this._fire(”mouseover“,{evt:t,target:this,currentTarget:this})},i.prototype._mouseout=function(t){var e;this.setPointersPositions(t);var i=(null===(e=this.targetShape)||void 0===e?void 0:e.getStage())?this.targetShape:null,r=!l.DD.isDragging||h.Konva.hitOnDragEnabled;i&&r?(i._fireAndBubble(”mouseout“,{evt:t}),i._fireAndBubble(”mouseleave“,{evt:t}),this._fire(”mouseleave“,{evt:t,target:this,currentTarget:this}),this.targetShape=null):r&&(this._fire(”mouseleave“,{evt:t,target:this,currentTarget:this}),this._fire(”mouseout“,{evt:t,target:this,currentTarget:this})),this.pointerPos=void 0,this._pointerPositions=[],this._fire(”contentMouseout“,{evt:t})},i.prototype._mousemove=function(t){var e;if(h.Konva.UA.ieMobile)return this._touchmove(t);this.setPointersPositions(t);var i,r=o.Util._getFirstPointerId(t),n=(null===(e=this.targetShape)||void 0===e?void 0:e.getStage())?this.targetShape:null,a=!l.DD.isDragging||h.Konva.hitOnDragEnabled;if(a){if((i=this.getIntersection(this.getPointerPosition()))&&i.isListening())a&&n!==i?(n&&(n._fireAndBubble(”mouseout“,{evt:t,pointerId:r},i),n._fireAndBubble(”mouseleave“,{evt:t,pointerId:r},i)),i._fireAndBubble(”mouseover“,{evt:t,pointerId:r},n),i._fireAndBubble(”mouseenter“,{evt:t,pointerId:r},n),i._fireAndBubble(”mousemove“,{evt:t,pointerId:r}),this.targetShape=i):i._fireAndBubble(”mousemove“,{evt:t,pointerId:r});else n&&a&&(n._fireAndBubble(”mouseout“,{evt:t,pointerId:r}),n._fireAndBubble(”mouseleave“,{evt:t,pointerId:r}),this._fire(”mouseover“,{evt:t,target:this,currentTarget:this,pointerId:r}),this.targetShape=null),this._fire(”mousemove“,{evt:t,target:this,currentTarget:this,pointerId:r});this._fire(”contentMousemove“,{evt:t})}t.cancelable&&t.preventDefault()},i.prototype._mousedown=function(t){if(h.Konva.UA.ieMobile)return this._touchstart(t);this.setPointersPositions(t);var e=o.Util._getFirstPointerId(t),i=this.getIntersection(this.getPointerPosition());l.DD.justDragged=!1,h.Konva.listenClickTap=!0,i&&i.isListening()?(this.clickStartShape=i,i._fireAndBubble(”mousedown“,{evt:t,pointerId:e})):this._fire(”mousedown“,{evt:t,target:this,currentTarget:this,pointerId:e}),this._fire(”contentMousedown“,{evt:t})},i.prototype._mouseup=function(t){if(h.Konva.UA.ieMobile)return this._touchend(t);this.setPointersPositions(t);var e=o.Util._getFirstPointerId(t),i=this.getIntersection(this.getPointerPosition()),r=this.clickStartShape,n=this.clickEndShape,a=!1;h.Konva.inDblClickWindow?(a=!0,clearTimeout(this.dblTimeout)):l.DD.justDragged||(h.Konva.inDblClickWindow=!0,clearTimeout(this.dblTimeout)),this.dblTimeout=setTimeout((function(){h.Konva.inDblClickWindow=!1}),h.Konva.dblClickWindow),i&&i.isListening()?(this.clickEndShape=i,i._fireAndBubble(”mouseup“,{evt:t,pointerId:e}),h.Konva.listenClickTap&&r&&r._id===i._id&&(i._fireAndBubble(”click“,{evt:t,pointerId:e}),a&&n&&n===i&&i._fireAndBubble(”dblclick“,{evt:t,pointerId:e}))):(this._fire(”mouseup“,{evt:t,target:this,currentTarget:this,pointerId:e}),h.Konva.listenClickTap&&this._fire(”click“,{evt:t,target:this,currentTarget:this,pointerId:e}),a&&this._fire(”dblclick“,{evt:t,target:this,currentTarget:this,pointerId:e})),this._fire(”contentMouseup“,{evt:t}),h.Konva.listenClickTap&&(this._fire(”contentClick“,{evt:t}),a&&this._fire(”contentDblclick“,{evt:t})),h.Konva.listenClickTap=!1,t.cancelable&&t.preventDefault()},i.prototype._contextmenu=function(t){this.setPointersPositions(t);var e=this.getIntersection(this.getPointerPosition());e&&e.isListening()?e._fireAndBubble(”contextmenu“,{evt:t}):this._fire(”contextmenu“,{evt:t,target:this,currentTarget:this}),this._fire(”contentContextmenu“,{evt:t})},i.prototype._touchstart=function(t){var e=this;this.setPointersPositions(t);var i=!1;this._changedPointerPositions.forEach((function®{var n=e.getIntersection®;h.Konva.listenClickTap=!0,l.DD.justDragged=!1,n&&n.isListening()&&(h.Konva.captureTouchEventsEnabled&&n.setPointerCapture(r.id),e.tapStartShape=n,n._fireAndBubble(”touchstart“,{evt:t,pointerId:r.id},e),i=!0,n.isListening()&&n.preventDefault()&&t.cancelable&&t.preventDefault())})),i||this._fire(”touchstart“,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions.id}),this._fire(”contentTouchstart“,{evt:t})},i.prototype._touchmove=function(t){var e=this;if(this.setPointersPositions(t),!l.DD.isDragging||h.Konva.hitOnDragEnabled){var i=!1,r={};this._changedPointerPositions.forEach((function(n){var o=d.getCapturedShape(n.id)||e.getIntersection(n);o&&o.isListening()&&(r||(r=!0,o._fireAndBubble(”touchmove“,{evt:t,pointerId:n.id}),i=!0,o.isListening()&&o.preventDefault()&&t.cancelable&&t.preventDefault()))})),i||this._fire(”touchmove“,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions.id}),this._fire(”contentTouchmove“,{evt:t})}l.DD.isDragging&&l.DD.node.preventDefault()&&t.cancelable&&t.preventDefault()},i.prototype._touchend=function(t){var e=this;this.setPointersPositions(t);var i=this.clickEndShape,r=!1;h.Konva.inDblClickWindow?(r=!0,clearTimeout(this.dblTimeout)):l.DD.justDragged||(h.Konva.inDblClickWindow=!0,clearTimeout(this.dblTimeout)),this.dblTimeout=setTimeout((function(){h.Konva.inDblClickWindow=!1}),h.Konva.dblClickWindow);var n=!1,o={},a=!1,s=!1;this._changedPointerPositions.forEach((function©{var l=d.getCapturedShape(c.id)||e.getIntersection©;l&&l.releaseCapture(c.id),l&&l.isListening()&&(o||(o=!0,e.clickEndShape=l,l._fireAndBubble(”touchend“,{evt:t,pointerId:c.id}),n=!0,h.Konva.listenClickTap&&l===e.tapStartShape&&(a=!0,l._fireAndBubble(”tap“,{evt:t,pointerId:c.id}),r&&i&&i===l&&(s=!0,l._fireAndBubble(”dbltap“,{evt:t,pointerId:c.id}))),l.isListening()&&l.preventDefault()&&t.cancelable&&t.preventDefault()))})),n||this._fire(”touchend“,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions.id}),h.Konva.listenClickTap&&!a&&this._fire(”tap“,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions.id}),r&&!s&&this._fire(”dbltap“,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions.id}),this._fire(”contentTouchend“,{evt:t}),h.Konva.listenClickTap&&(this._fire(”contentTap“,{evt:t}),r&&this._fire(”contentDbltap“,{evt:t})),h.Konva.listenClickTap=!1},i.prototype._wheel=function(t){this.setPointersPositions(t);var e=this.getIntersection(this.getPointerPosition());e&&e.isListening()?e._fireAndBubble(”wheel“,{evt:t}):this._fire(”wheel“,{evt:t,target:this,currentTarget:this}),this._fire(”contentWheel“,{evt:t})},i.prototype._pointerdown=function(t){if(h.Konva._pointerEventsEnabled){this.setPointersPositions(t);var e=d.getCapturedShape(t.pointerId)||this.getIntersection(this.getPointerPosition());e&&e._fireAndBubble(”pointerdown“,d.createEvent(t))}},i.prototype._pointermove=function(t){if(h.Konva._pointerEventsEnabled){this.setPointersPositions(t);var e=d.getCapturedShape(t.pointerId)||this.getIntersection(this.getPointerPosition());e&&e._fireAndBubble(”pointermove“,d.createEvent(t))}},i.prototype._pointerup=function(t){if(h.Konva._pointerEventsEnabled){this.setPointersPositions(t);var e=d.getCapturedShape(t.pointerId)||this.getIntersection(this.getPointerPosition());e&&e._fireAndBubble(”pointerup“,d.createEvent(t)),d.releaseCapture(t.pointerId)}},i.prototype._pointercancel=function(t){if(h.Konva._pointerEventsEnabled){this.setPointersPositions(t);var e=d.getCapturedShape(t.pointerId)||this.getIntersection(this.getPointerPosition());e&&e._fireAndBubble(”pointerup“,d.createEvent(t)),d.releaseCapture(t.pointerId)}},i.prototype._lostpointercapture=function(t){d.releaseCapture(t.pointerId)},i.prototype.setPointersPositions=function(t){var e=this,i=this._getContentPosition(),r=null,n=null;void 0!==(t=t||window.event).touches?(this._pointerPositions=[],this._changedPointerPositions=,o.Collection.prototype.each.call(t.touches,(function(t){e._pointerPositions.push({id:t.identifier,x:(t.clientX-i.left)/i.scaleX,y:(t.clientY-i.top)/i.scaleY})})),o.Collection.prototype.each.call(t.changedTouches||t.touches,(function(t){e._changedPointerPositions.push({id:t.identifier,x:(t.clientX-i.left)/i.scaleX,y:(t.clientY-i.top)/i.scaleY})}))):(r=(t.clientX-i.left)/i.scaleX,n=(t.clientY-i.top)/i.scaleY,this.pointerPos={x:r,y:n},this._pointerPositions=,this._changedPointerPositions=)},i.prototype._setPointerPosition=function(t){o.Util.warn('Method _setPointerPosition is deprecated. Use ”stage.setPointersPositions(event)“ instead.'),this.setPointersPositions(t)},i.prototype._getContentPosition=function(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var t=this.content.getBoundingClientRect();return{top:t.top,left:t.left,scaleX:t.width/this.content.clientWidth||1,scaleY:t.height/this.content.clientHeight||1}},i.prototype._buildDOM=function(){if(this.bufferCanvas=new c.SceneCanvas({width:this.width(),height:this.height()}),this.bufferHitCanvas=new c.HitCanvas({pixelRatio:1,width:this.width(),height:this.height()}),h.Konva.isBrowser){var t=this.container();if(!t)throw”Stage has no container. A container is required.“;t.innerHTML=”“,this.content=document.createElement(”div“),this.content.style.position=”relative“,this.content.style.userSelect=”none“,this.content.className=”konvajs-content“,this.content.setAttribute(”role“,”presentation“),t.appendChild(this.content),this._resizeDOM()}},i.prototype.cache=function(){return o.Util.warn(”Cache function is not allowed for stage. You may use cache only for layers, groups and shapes.“),this},i.prototype.clearCache=function(){return this},i.prototype.batchDraw=function(){return this.children.each((function(t){t.batchDraw()})),this},i}(s.Container);e.Stage=v,v.prototype.nodeType=”Stage“,u._registerNode(v),a.Factory.addGetterSetter(v,”container“)},function(t,e,i){”use strict“;var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t=e)})(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,”__esModule“,{value:!0});var o=i(3),a=i(10),s=i(0),h=i(32),c=i(11),l=i(5),u=i(2),d=i(1),p=,f=p.length,g=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.hitCanvas=new c.HitCanvas({pixelRatio:1}),e}return n(e,t),e.prototype.setSize=function(e){var i=e.width,r=e.height;return t.prototype.setSize.call(this,{width:i,height:r}),this.hitCanvas.setSize(i,r),this},e.prototype._validateAdd=function(t){var e=t.getType();”Group“!==e&&”Shape“!==e&&o.Util.throw(”You may only add groups and shapes to a layer.“)},e.prototype.getIntersection=function(t,e){var i,r,n,o;if(!this.hitGraphEnabled()||!this.isVisible())return null;for(var a=1,s=!1;;){for(r=0;r<f;r++){if(n=p,(o=(i=this._getIntersection({x:t.x+n.x*a,y:t.y+n.y*a})).shape)&&e)return o.findAncestor(e,!0);if(o)return o;if(s=!!i.antialiased,!i.antialiased)break}if(!s)return null;a+=1}},e.prototype._getIntersection=function(t){var e,i,r=this.hitCanvas.pixelRatio,n=this.hitCanvas.context.getImageData(Math.round(t.x*r),Math.round(t.y*r),1,1).data,a=n;return 255===a?(e=o.Util._rgbToHex(n,n,n),(i=l.shapes)?{shape:i}:{antialiased:!0}):a>0?{antialiased:!0}:{}},e.prototype.drawScene=function(t,e){var i=this.getLayer(),r=t||i&&i.getCanvas();return this._fire(”beforeDraw“,{node:this}),this.clearBeforeDraw()&&r.getContext().clear(),a.Container.prototype.drawScene.call(this,r,e),this._fire(”draw“,{node:this}),this},e.prototype.drawHit=function(t,e){var i=this.getLayer(),r=t||i&&i.hitCanvas;return i&&i.clearBeforeDraw()&&i.getHitCanvas().getContext().clear(),a.Container.prototype.drawHit.call(this,r,e),this},e.prototype.clear=function(t){return h.BaseLayer.prototype.clear.call(this,t),this.getHitCanvas().getContext().clear(t),this},e.prototype.enableHitGraph=function(){return this.hitGraphEnabled(!0),this},e.prototype.disableHitGraph=function(){return this.hitGraphEnabled(!1),this},e.prototype.toggleHitCanvas=function(){if(this.parent){var t=this.parent;!!this.hitCanvas._canvas.parentNode?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}},e}(h.BaseLayer);e.Layer=g,g.prototype.nodeType=”Layer“,d._registerNode(g),s.Factory.addGetterSetter(g,”hitGraphEnabled“,!0,u.getBooleanValidator()),o.Collection.mapMethods(g)},function(t,e,i){”use strict“;var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t=e)})(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,”__esModule“,{value:!0});var o=i(3),a=i(10),s=i(32),h=i(1),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype._validateAdd=function(t){”Shape“!==t.getType()&&o.Util.throw(”You may only add shapes to a fast layer.“)},e.prototype.hitGraphEnabled=function(){return!1},e.prototype.drawScene=function(t){var e=this.getLayer(),i=t||e&&e.getCanvas();return this.clearBeforeDraw()&&i.getContext().clear(),a.Container.prototype.drawScene.call(this,i),this},e.prototype.draw=function(){return this.drawScene(),this},e}(s.BaseLayer);e.FastLayer=c,c.prototype.nodeType=”FastLayer“,h._registerNode©,o.Collection.mapMethods©},function(t,e,i){”use strict“;Object.defineProperty(e,”__esModule“,{value:!0});var r=i(3),n=i(25),o=i(4),a=i(1),s={node:1,duration:1,easing:1,onFinish:1,yoyo:1},h=0,c=,l=function(){function t(t,e,i,r,n,o,a){this.prop=t,this.propFunc=e,this.begin=r,this._pos=r,this.duration=o,this._change=0,this.prevPos=0,this.yoyo=a,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=i,this._change=n-this.begin,this.pause()}return t.prototype.fire=function(t){var e=this;e&&e()},t.prototype.setTime=function(t){t>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():t<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=t,this.update())},t.prototype.getTime=function(){return this._time},t.prototype.setPosition=function(t){this.prevPos=this._pos,this.propFunc(t),this._pos=t},t.prototype.getPosition=function(t){return void 0===t&&(t=this._time),this.func(t,this.begin,this._change,this.duration)},t.prototype.play=function(){this.state=2,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire(”onPlay“)},t.prototype.reverse=function(){this.state=3,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire(”onReverse“)},t.prototype.seek=function(t){this.pause(),this._time=t,this.update(),this.fire(”onSeek“)},t.prototype.reset=function(){this.pause(),this._time=0,this.update(),this.fire(”onReset“)},t.prototype.finish=function(){this.pause(),this._time=this.duration,this.update(),this.fire(”onFinish“)},t.prototype.update=function(){this.setPosition(this.getPosition(this._time))},t.prototype.onEnterFrame=function(){var t=this.getTimer()-this._startTime;2===this.state?this.setTime(t):3===this.state&&this.setTime(this.duration-t)},t.prototype.pause=function(){this.state=1,this.fire(”onPause“)},t.prototype.getTimer=function(){return(new Date).getTime()},t}(),u=function(){function t(i){var o,c,u=this,d=i.node,p=d._id,f=i.easing||e.Easings.Linear,g=!!i.yoyo;o=void 0===i.duration?.3:0===i.duration?.001:i.duration,this.node=d,this._id=h++;var y=d.getLayer()||(d instanceof a.Konva.Stage?d.getLayers():null);for(c in y||r.Util.error(”Tween constructor have `node` that is not in a layer. Please add node into layer first.“),this.anim=new n.Animation((function(){u.tween.onEnterFrame()}),y),this.tween=new l(c,(function(t){u._tweenFunc(t)}),f,0,1,1e3*o,g),this._addListeners(),t.attrs||(t.attrs={}),t.attrs[this._id]||(t.attrs[this._id]={}),t.tweens||(t.tweens={}),i)void 0===s&&this._addAttr(c,i);this.reset(),this.onFinish=i.onFinish,this.onReset=i.onReset}return t.prototype._addAttr=function(e,i){var n,o,a,s,h,l,u,d,p=this.node,f=p._id;if((a=t.tweens[e])&&delete t.attrs[a],n=p.getAttr(e),r.Util._isArray(i))if(o=[],h=Math.max(i.length,n.length),”points“===e&&i.length!==n.length&&(i.length>n.length?(u=n,n=r.Util._prepareArrayForTween(n,i,p.closed())):(l=i,i=r.Util._prepareArrayForTween(i,n,p.closed()))),0===e.indexOf(”fill“))for(s=0;s-n);else{var g=r.Util.colorToRGBA(n);d=r.Util.colorToRGBA(i),n=g,o.push({r:d.r-g.r,g:d.g-g.g,b:d.b-g.b,a:d.a-g.a})}else for(s=0;s-n);else-1!==c.indexOf(e)?(n=r.Util.colorToRGBA(n),o={r:(d=r.Util.colorToRGBA(i)).r-n.r,g:d.g-n.g,b:d.b-n.b,a:d.a-n.a}):o=i-n;t.attrs[this._id]={start:n,diff:o,end:i,trueEnd:l,trueStart:u},t.tweens[e]=this._id},t.prototype._tweenFunc=function(e){var i,n,o,a,s,h,l,u,d=this.node,p=t.attrs[this._id];for(i in p){if(o=(n=p).start,a=n.diff,u=n.end,r.Util._isArray(o))if(s=[],l=Math.max(o.length,u.length),0===i.indexOf(”fill“))for(h=0;h||0)+a*e):s.push(”rgba(“+Math.round(o.r+a.r*e)+”,“+Math.round(o.g+a.g*e)+”,“+Math.round(o.b+a.b*e)+”,“+(o.a+a.a*e)+”)“);else for(h=0;h||0)+a*e);else s=-1!==c.indexOf(i)?”rgba(“+Math.round(o.r+a.r*e)+”,“+Math.round(o.g+a.g*e)+”,“+Math.round(o.b+a.b*e)+”,“+(o.a+a.a*e)+”)“:o+a*e;d.setAttr(i,s)}},t.prototype._addListeners=function(){var e=this;this.tween.onPlay=function(){e.anim.start()},this.tween.onReverse=function(){e.anim.start()},this.tween.onPause=function(){e.anim.stop()},this.tween.onFinish=function(){var i=e.node,r=t.attrs[e._id];r.points&&r.points.trueEnd&&i.setAttr(”points“,r.points.trueEnd),e.onFinish&&e.onFinish.call(e)},this.tween.onReset=function(){var i=e.node,r=t.attrs[e._id];r.points&&r.points.trueStart&&i.points(r.points.trueStart),e.onReset&&e.onReset()}},t.prototype.play=function(){return this.tween.play(),this},t.prototype.reverse=function(){return this.tween.reverse(),this},t.prototype.reset=function(){return this.tween.reset(),this},t.prototype.seek=function(t){return this.tween.seek(1e3*t),this},t.prototype.pause=function(){return this.tween.pause(),this},t.prototype.finish=function(){return this.tween.finish(),this},t.prototype.destroy=function(){var e,i=this.node._id,r=this._id,n=t.tweens;for(e in this.pause(),n)delete t.tweens[e];delete t.attrs[r]},t.attrs={},t.tweens={},t}();e.Tween=u,o.Node.prototype.to=function(t){var e=t.onFinish;t.node=this,t.onFinish=function(){this.destroy(),e&&e()},new u(t).play()},e.Easings={BackEaseIn:function(t,e,i,r){var n=1.70158;return i*(t/=r)t((n+1)*t-n)+e},BackEaseOut:function(t,e,i,r){var n=1.70158;return i*((t=t/r-1)t((n+1)*t+n)+1)+e},BackEaseInOut:function(t,e,i,r){var n=1.70158;return(t/=r/2)<1?i/2*(t*t*((1+(n*=1.525))*t-n))+e:i/2*((t-=2)t((1+(n*=1.525))*t+n)+2)+e},ElasticEaseIn:function(t,e,i,r,n,o){var a=0;return 0===t?e:1==(t/=r)?e+i:(o||(o=.3*r),!n||n<Math.abs(i)?(n=i,a=o/4):a=o/(2*Math.PI)*Math.asin(i/n),-n*Math.pow(2,10*(t-=1))*Math.sin((t*r-a)*(2*Math.PI)/o)+e)},ElasticEaseOut:function(t,e,i,r,n,o){var a=0;return 0===t?e:1==(t/=r)?e+i:(o||(o=.3*r),!n||n<Math.abs(i)?(n=i,a=o/4):a=o/(2*Math.PI)*Math.asin(i/n),n*Math.pow(2,-10*t)*Math.sin((t*r-a)*(2*Math.PI)/o)+i+e)},ElasticEaseInOut:function(t,e,i,r,n,o){var a=0;return 0===t?e:2==(t/=r/2)?e+i:(o||(o=r*(.3*1.5)),!n||n<Math.abs(i)?(n=i,a=o/4):a=o/(2*Math.PI)*Math.asin(i/n),t<1?n*Math.pow(2,10*(t-=1))*Math.sin((t*r-a)*(2*Math.PI)/o)*-.5+e:n*Math.pow(2,-10*(t-=1))*Math.sin((t*r-a)*(2*Math.PI)/o)*.5+i+e)},BounceEaseOut:function(t,e,i,r){return(t/=r)<1/2.75?i*(7.5625*t*t)+e:t<2/2.75?i*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?i*(7.5625*(t-=2.25/2.75)*t+.9375)+e:i*(7.5625*(t-=2.625/2.75)*t+.984375)+e},BounceEaseIn:function(t,i,r,n){return r-e.Easings.BounceEaseOut(n-t,0,r,n)+i},BounceEaseInOut:function(t,i,r,n){return t<n/2?.5*e.Easings.BounceEaseIn(2*t,0,r,n)+i:.5*e.Easings.BounceEaseOut(2*t-n,0,r,n)+.5*r+i},EaseIn:function(t,e,i,r){return i*(t/=r)*t+e},EaseOut:function(t,e,i,r){return-i*(t/=r)*(t-2)+e},EaseInOut:function(t,e,i,r){return(t/=r/2)<1?i/2*t*t+e:-i/2*(–t*(t-2)-1)+e},StrongEaseIn:function(t,e,i,r){return i*(t/=r)*t*t*t*t+e},StrongEaseOut:function(t,e,i,r){return i*((t=t/r-1)*t*t*t*t+1)+e},StrongEaseInOut:function(t,e,i,r){return(t/=r/2)<1?i/2*t*t*t*t*t+e:i/2*((t-=2)*t*t*t*t+2)+e},Linear:function(t,e,i,r){return i*t/r+e}}},function(t,e,i){”use strict“;var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t=e)})(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,”__esModule“,{value:!0});var o=i(3),a=i(0),s=i(5),h=i(1),c=i(2),l=i(1),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype._sceneFunc=function(t){var e=h.Konva.getAngle(this.angle()),i=this.clockwise();t.beginPath(),t.arc(0,0,this.outerRadius(),0,e,i),t.arc(0,0,this.innerRadius(),e,0,!i),t.closePath(),t.fillStrokeShape(this)},e.prototype.getWidth=function(){return 2*this.outerRadius()},e.prototype.getHeight=function(){return 2*this.outerRadius()},e.prototype.setWidth=function(t){this.outerRadius(t/2)},e.prototype.setHeight=function(t){this.outerRadius(t/2)},e}(s.Shape);e.Arc=u,u.prototype._centroid=!0,u.prototype.className=”Arc“,u.prototype._attrsAffectingSize=,l._registerNode(u),a.Factory.addGetterSetter(u,”innerRadius“,0,c.getNumberValidator()),a.Factory.addGetterSetter(u,”outerRadius“,0,c.getNumberValidator()),a.Factory.addGetterSetter(u,”angle“,0,c.getNumberValidator()),a.Factory.addGetterSetter(u,”clockwise“,!1,c.getBooleanValidator()),o.Collection.mapMethods(u)},function(t,e,i){”use strict“;var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t=e)})(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,”__esModule“,{value:!0});var o=i(3),a=i(0),s=i(33),h=i(2),c=i(1),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype._sceneFunc=function(e){t.prototype._sceneFunc.call(this,e);var i=2*Math.PI,r=this.points(),n=r,o=0!==this.tension()&&r.length>4;o&&(n=this.getTensionPoints());var a,s,h=r.length;o?(a=r-(n+n)/2,s=r-(n+n)/2):(a=r-r,s=r-r);var c=(Math.atan2(s,a)+i)%i,l=this.pointerLength(),u=this.pointerWidth();e.save(),e.beginPath(),e.translate(r,r),e.rotate©,e.moveTo(0,0),e.lineTo(-l,u/2),e.lineTo(-l,-u/2),e.closePath(),e.restore(),this.pointerAtBeginning()&&(e.save(),e.translate(r,r),o?(a=(n+n)/2-r,s=(n+n)/2-r):(a=r-r,s=r-r),e.rotate((Math.atan2(-s,-a)+i)%i),e.moveTo(0,0),e.lineTo(-l,u/2),e.lineTo(-l,-u/2),e.closePath(),e.restore());var d=this.dashEnabled();d&&(this.attrs.dashEnabled=!1,e.setLineDash([])),e.fillStrokeShape(this),d&&(this.attrs.dashEnabled=!0)},e.prototype.getSelfRect=function(){var e=t.prototype.getSelfRect.call(this),i=this.pointerWidth()/2;return{x:e.x-i,y:e.y-i,width:e.width+2*i,height:e.height+2*i}},e}(s.Line);e.Arrow=l,l.prototype.className=”Arrow“,c._registerNode(l),a.Factory.addGetterSetter(l,”pointerLength“,10,h.getNumberValidator()),a.Factory.addGetterSetter(l,”pointerWidth“,10,h.getNumberValidator()),a.Factory.addGetterSetter(l,”pointerAtBeginning“,!1),o.Collection.mapMethods(l)},function(t,e,i){”use strict“;var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t=e)})(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,”__esModule“,{value:!0});var o=i(3),a=i(0),s=i(5),h=i(2),c=i(1),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype._sceneFunc=function(t){t.beginPath(),t.arc(0,0,this.radius(),0,2*Math.PI,!1),t.closePath(),t.fillStrokeShape(this)},e.prototype.getWidth=function(){return 2*this.radius()},e.prototype.getHeight=function(){return 2*this.radius()},e.prototype.setWidth=function(t){this.radius()!==t/2&&this.radius(t/2)},e.prototype.setHeight=function(t){this.radius()!==t/2&&this.radius(t/2)},e}(s.Shape);e.Circle=l,l.prototype._centroid=!0,l.prototype.className=”Circle“,l.prototype._attrsAffectingSize=,c._registerNode(l),a.Factory.addGetterSetter(l,”radius“,0,h.getNumberValidator()),o.Collection.mapMethods(l)},function(t,e,i){”use strict“;var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t=e)})(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,”__esModule“,{value:!0});var o=i(3),a=i(0),s=i(5),h=i(2),c=i(1),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype._sceneFunc=function(t){var e=this.radiusX(),i=this.radiusY();t.beginPath(),t.save(),e!==i&&t.scale(1,i/e),t.arc(0,0,e,0,2*Math.PI,!1),t.restore(),t.closePath(),t.fillStrokeShape(this)},e.prototype.getWidth=function(){return 2*this.radiusX()},e.prototype.getHeight=function(){return 2*this.radiusY()},e.prototype.setWidth=function(t){this.radiusX(t/2)},e.prototype.setHeight=function(t){this.radiusY(t/2)},e}(s.Shape);e.Ellipse=l,l.prototype.className=”Ellipse“,l.prototype._centroid=!0,l.prototype._attrsAffectingSize=,c._registerNode(l),a.Factory.addComponentsGetterSetter(l,”radius“,),a.Factory.addGetterSetter(l,”radiusX“,0,h.getNumberValidator()),a.Factory.addGetterSetter(l,”radiusY“,0,h.getNumberValidator()),o.Collection.mapMethods(l)},function(t,e,i){”use strict“;var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t=e)})(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,”__esModule“,{value:!0});var o=i(3),a=i(0),s=i(5),h=i(2),c=i(1),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype._useBufferCanvas=function(){return!(!this.hasShadow()&&1===this.getAbsoluteOpacity()||!this.hasStroke()||!this.getStage())},e.prototype._sceneFunc=function(t){var e,i,r,n=this.width(),o=this.height(),a=this.image();a&&(e=this.cropWidth(),i=this.cropHeight(),r=e&&i?:[a,0,0,n,o]),(this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,n,o),t.closePath(),t.fillStrokeShape(this)),a&&t.drawImage.apply(t,r)},e.prototype._hitFunc=function(t){var e=this.width(),i=this.height();t.beginPath(),t.rect(0,0,e,i),t.closePath(),t.fillStrokeShape(this)},e.prototype.getWidth=function(){var t,e=this.image();return null!==(t=this.attrs.width)&&void 0!==t?t:e?e.width:0},e.prototype.getHeight=function(){var t,e=this.image();return null!==(t=this.attrs.height)&&void 0!==t?t:e?e.height:0},e.fromURL=function(t,i){var r=o.Util.createImageElement();r.onload=function(){var t=new e({image:r});i(t)},r.crossOrigin=”Anonymous“,r.src=t},e}(s.Shape);e.Image=l,l.prototype.className=”Image“,c._registerNode(l),a.Factory.addGetterSetter(l,”image“),a.Factory.addComponentsGetterSetter(l,”crop“,),a.Factory.addGetterSetter(l,”cropX“,0,h.getNumberValidator()),a.Factory.addGetterSetter(l,”cropY“,0,h.getNumberValidator()),a.Factory.addGetterSetter(l,”cropWidth“,0,h.getNumberValidator()),a.Factory.addGetterSetter(l,”cropHeight“,0,h.getNumberValidator()),o.Collection.mapMethods(l)},function(t,e,i){”use strict“;var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t=e)})(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,”__esModule“,{value:!0});var o=i(3),a=i(0),s=i(5),h=i(24),c=i(2),l=i(1),u=,d=u.length,p=function(t){function e(e){var i=t.call(this,e)||this;return i.on(”add.konva“,(function(t){this._addListeners(t.child),this._sync()})),i}return n(e,t),e.prototype.getText=function(){return this.find(”Text“)},e.prototype.getTag=function(){return this.find(”Tag“)},e.prototype._addListeners=function(t){var e,i=this,r=function(){i._sync()};for(e=0;e+”Change.konva“,r)},e.prototype.getWidth=function(){return this.getText().width()},e.prototype.getHeight=function(){return this.getText().height()},e.prototype._sync=function(){var t,e,i,r,n,o,a,s=this.getText(),h=this.getTag();if(s&&h){switch(t=s.width(),e=s.height(),i=h.pointerDirection(),r=h.pointerWidth(),a=h.pointerHeight(),n=0,o=0,i){case”up“:n=t/2,o=-1*a;break;case”right“:n=t+r,o=e/2;break;case”down“:n=t/2,o=e+a;break;case”left“:n=-1*r,o=e/2}h.setAttrs({x:-1*n,y:-1*o,width:t,height:e}),s.setAttrs({x:-1*n,y:-1*o})}},e}(h.Group);e.Label=p,p.prototype.className=”Label“,l._registerNode(p),o.Collection.mapMethods(p);var f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype._sceneFunc=function(t){var e=this.width(),i=this.height(),r=this.pointerDirection(),n=this.pointerWidth(),o=this.pointerHeight(),a=Math.min(this.cornerRadius(),e/2,i/2);t.beginPath(),a?t.moveTo(a,0):t.moveTo(0,0),”up“===r&&(t.lineTo((e-n)/2,0),t.lineTo(e/2,-1*o),t.lineTo((e+n)/2,0)),a?(t.lineTo(e-a,0),t.arc(e-a,a,a,3*Math.PI/2,0,!1)):t.lineTo(e,0),”right“===r&&(t.lineTo(e,(i-o)/2),t.lineTo(e+n,i/2),t.lineTo(e,(i+o)/2)),a?(t.lineTo(e,i-a),t.arc(e-a,i-a,a,0,Math.PI/2,!1)):t.lineTo(e,i),”down“===r&&(t.lineTo((e+n)/2,i),t.lineTo(e/2,i+o),t.lineTo((e-n)/2,i)),a?(t.lineTo(a,i),t.arc(a,i-a,a,Math.PI/2,Math.PI,!1)):t.lineTo(0,i),”left“===r&&(t.lineTo(0,(i+o)/2),t.lineTo(-1*n,i/2),t.lineTo(0,(i-o)/2)),a&&(t.lineTo(0,a),t.arc(a,a,a,Math.PI,3*Math.PI/2,!1)),t.closePath(),t.fillStrokeShape(this)},e.prototype.getSelfRect=function(){var t=0,e=0,i=this.pointerWidth(),r=this.pointerHeight(),n=this.pointerDirection(),o=this.width(),a=this.height();return”up“===n?(e-=r,a+=r):”down“===n?a+=r:”left“===n?(t-=1.5*i,o+=i):”right“===n&&(o+=1.5*i),{x:t,y:e,width:o,height:a}},e}(s.Shape);e.Tag=f,f.prototype.className=”Tag“,l._registerNode(f),a.Factory.addGetterSetter(f,”pointerDirection“,”none“),a.Factory.addGetterSetter(f,”pointerWidth“,0,c.getNumberValidator()),a.Factory.addGetterSetter(f,”pointerHeight“,0,c.getNumberValidator()),a.Factory.addGetterSetter(f,”cornerRadius“,0,c.getNumberValidator()),o.Collection.mapMethods(f)},function(t,e,i){”use strict“;var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t=e)})(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,”__esModule“,{value:!0});var o=i(3),a=i(0),s=i(5),h=i(2),c=i(1),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype._sceneFunc=function(t){var e,i,r,n=this.sides(),o=this.radius();for(t.beginPath(),t.moveTo(0,0-o),e=1;e<n;e++)i=o*Math.sin(2*e*Math.PI/n),r=-1*o*Math.cos(2*e*Math.PI/n),t.lineTo(i,r);t.closePath(),t.fillStrokeShape(this)},e.prototype.getWidth=function(){return 2*this.radius()},e.prototype.getHeight=function(){return 2*this.radius()},e.prototype.setWidth=function(t){this.radius(t/2)},e.prototype.setHeight=function(t){this.radius(t/2)},e}(s.Shape);e.RegularPolygon=l,l.prototype.className=”RegularPolygon“,l.prototype._centroid=!0,l.prototype._attrsAffectingSize=,c._registerNode(l),a.Factory.addGetterSetter(l,”radius“,0,h.getNumberValidator()),a.Factory.addGetterSetter(l,”sides“,0,h.getNumberValidator()),o.Collection.mapMethods(l)},function(t,e,i){”use strict“;var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t=e)})(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,”__esModule“,{value:!0});var o=i(3),a=i(0),s=i(5),h=i(2),c=i(1),l=2*Math.PI,u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype._sceneFunc=function(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,l,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),l,0,!0),t.closePath(),t.fillStrokeShape(this)},e.prototype.getWidth=function(){return 2*this.outerRadius()},e.prototype.getHeight=function(){return 2*this.outerRadius()},e.prototype.setWidth=function(t){this.outerRadius(t/2)},e.prototype.setHeight=function(t){this.outerRadius(t/2)},e}(s.Shape);e.Ring=u,u.prototype.className=”Ring“,u.prototype._centroid=!0,u.prototype._attrsAffectingSize=,c._registerNode(u),a.Factory.addGetterSetter(u,”innerRadius“,0,h.getNumberValidator()),a.Factory.addGetterSetter(u,”outerRadius“,0,h.getNumberValidator()),o.Collection.mapMethods(u)},function(t,e,i){”use strict“;var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t=e)})(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,”__esModule“,{value:!0});var o=i(3),a=i(0),s=i(5),h=i(25),c=i(2),l=i(1),u=function(t){function e(e){var i=t.call(this,e)||this;return i._updated=!0,i.anim=new h.Animation((function(){var t=i._updated;return i._updated=!1,t})),i.on(”animationChange.konva“,(function(){this.frameIndex(0)})),i.on(”frameIndexChange.konva“,(function(){this._updated=!0})),i.on(”frameRateChange.konva“,(function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})),i}return n(e,t),e.prototype._sceneFunc=function(t){var e=this.animation(),i=this.frameIndex(),r=4*i,n=this.animations(),o=this.frameOffsets(),a=n,s=n,h=n,c=n,l=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,h,c),t.closePath(),t.fillStrokeShape(this)),l)if(o){var u=o,d=2*i;t.drawImage(l,a,s,h,c,u,u,h,c)}else t.drawImage(l,a,s,h,c,0,0,h,c)},e.prototype._hitFunc=function(t){var e=this.animation(),i=this.frameIndex(),r=4*i,n=this.animations(),o=this.frameOffsets(),a=n,s=n;if(t.beginPath(),o){var h=o,c=2*i;t.rect(h,h,a,s)}else t.rect(0,0,a,s);t.closePath(),t.fillShape(this)},e.prototype._useBufferCanvas=function(){return(this.hasShadow()||1!==this.getAbsoluteOpacity())&&this.hasStroke()},e.prototype._setInterval=function(){var t=this;this.interval=setInterval((function(){t._updateIndex()}),1e3/this.frameRate())},e.prototype.start=function(){if(!this.isRunning()){var t=this.getLayer();this.anim.setLayers(t),this._setInterval(),this.anim.start()}},e.prototype.stop=function(){this.anim.stop(),clearInterval(this.interval)},e.prototype.isRunning=function(){return this.anim.isRunning()},e.prototype._updateIndex=function(){var t=this.frameIndex(),e=this.animation();t.length/4-1?this.frameIndex(t+1):this.frameIndex(0)},e}(s.Shape);e.Sprite=u,u.prototype.className=”Sprite“,l._registerNode(u),a.Factory.addGetterSetter(u,”animation“),a.Factory.addGetterSetter(u,”animations“),a.Factory.addGetterSetter(u,”frameOffsets“),a.Factory.addGetterSetter(u,”image“),a.Factory.addGetterSetter(u,”frameIndex“,0,c.getNumberValidator()),a.Factory.addGetterSetter(u,”frameRate“,17,c.getNumberValidator()),a.Factory.backCompat(u,{index:”frameIndex“,getIndex:”getFrameIndex“,setIndex:”setFrameIndex“}),o.Collection.mapMethods(u)},function(t,e,i){”use strict“;var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t=e)})(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,”__esModule“,{value:!0});var o=i(3),a=i(0),s=i(5),h=i(2),c=i(1),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype._sceneFunc=function(t){var e=this.innerRadius(),i=this.outerRadius(),r=this.numPoints();t.beginPath(),t.moveTo(0,0-i);for(var n=1;n<2*r;n++){var o=n%2==0?i:e,a=o*Math.sin(n*Math.PI/r),s=-1*o*Math.cos(n*Math.PI/r);t.lineTo(a,s)}t.closePath(),t.fillStrokeShape(this)},e.prototype.getWidth=function(){return 2*this.outerRadius()},e.prototype.getHeight=function(){return 2*this.outerRadius()},e.prototype.setWidth=function(t){this.outerRadius(t/2)},e.prototype.setHeight=function(t){this.outerRadius(t/2)},e}(s.Shape);e.Star=l,l.prototype.className=”Star“,l.prototype._centroid=!0,l.prototype._attrsAffectingSize=,c._registerNode(l),a.Factory.addGetterSetter(l,”numPoints“,5,h.getNumberValidator()),a.Factory.addGetterSetter(l,”innerRadius“,0,h.getNumberValidator()),a.Factory.addGetterSetter(l,”outerRadius“,0,h.getNumberValidator()),o.Collection.mapMethods(l)},function(t,e,i){”use strict“;var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t=e)})(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,”__esModule“,{value:!0});var o=i(3),a=i(0),s=i(5),h=i(34),c=i(36),l=i(2),u=i(1);function d(t){t.fillText(this.partialText,0,0)}function p(t){t.strokeText(this.partialText,0,0)}var f=function(t){function e(e){var i=t.call(this,e)||this;return i.dummyCanvas=o.Util.createCanvasElement(),i.dataArray=[],i.dataArray=h.Path.parsePathData(i.attrs.data),i.on(”dataChange.konva“,(function(){this.dataArray=h.Path.parsePathData(this.attrs.data),this._setTextData()})),i.on(”textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva“,i._setTextData),e&&e.getKerning&&(o.Util.warn('getKerning TextPath API is deprecated. Please use ”kerningFunc“ instead.'),i.kerningFunc(e.getKerning)),i._setTextData(),i}return n(e,t),e.prototype._sceneFunc=function(t){t.setAttr(”font“,this._getContextFont()),t.setAttr(”textBaseline“,this.textBaseline()),t.setAttr(”textAlign“,”left“),t.save();var e=this.textDecoration(),i=this.fill(),r=this.fontSize(),n=this.glyphInfo;”underline“===e&&t.beginPath();for(var o=0;o<n.length;o++){t.save();var a=n.p0;t.translate(a.x,a.y),t.rotate(n.rotation),this.partialText=n.text,t.fillStrokeShape(this),”underline“===e&&(0===o&&t.moveTo(0,r/2+1),t.lineTo(r,r/2+1)),t.restore()}”underline“===e&&(t.strokeStyle=i,t.lineWidth=r/20,t.stroke()),t.restore()},e.prototype._hitFunc=function(t){t.beginPath();var e=this.glyphInfo;if(e.length>=1){var i=e.p0;t.moveTo(i.x,i.y)}for(var r=0;r<e.length;r++){var n=e.p1;t.lineTo(n.x,n.y)}t.setAttr(”lineWidth“,this.fontSize()),t.setAttr(”strokeStyle“,this.colorKey),t.stroke()},e.prototype.getTextWidth=function(){return this.textWidth},e.prototype.getTextHeight=function(){return o.Util.warn(”text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height.“),this.textHeight},e.prototype.setText=function(t){return c.Text.prototype.setText.call(this,t)},e.prototype._getContextFont=function(){return c.Text.prototype._getContextFont.call(this)},e.prototype._getTextSize=function(t){var e=this.dummyCanvas.getContext(”2d“);e.save(),e.font=this._getContextFont();var i=e.measureText(t);return e.restore(),{width:i.width,height:parseInt(this.attrs.fontSize,10)}},e.prototype._setTextData=function(){var t=this,e=this._getTextSize(this.attrs.text),i=this.letterSpacing(),r=this.align(),n=this.kerningFunc();this.textWidth=e.width,this.textHeight=e.height;var o=Math.max(this.textWidth+((this.attrs.text||”“).length-1)*i,0);this.glyphInfo=[];for(var a=0,s=0;s.pathLength>0&&(a+=t.dataArray.pathLength);var c=0;”center“===r&&(c=Math.max(0,a/2-o/2)),”right“===r&&(c=Math.max(0,a-o));for(var l,u,d,p=this.text().split(”“),f=this.text().split(” “).length-1,g=-1,y=0,v=function(){y=0;for(var e=t.dataArray,i=g+1;i<e.length;i++){if(e.pathLength>0)return g=i,e;”M“===e.command&&(l={x:e.points,y:e.points})}return{}},_=function(e){var n=t._getTextSize(e).width+i;” “===e&&”justify“===r&&(n+=(a-o)/f);var s=0,c=0;for(u=void 0;Math.abs(n-s)/n>.01&&c<25;){c++;for(var p=s;void 0===d;)(d=v())&&p+d.pathLength<n&&(p+=d.pathLength,d=void 0);if(d==={}||void 0===l)return;var g=!1;switch(d.command){case”L“:h.Path.getLineLength(l.x,l.y,d.points,d.points)>n?u=h.Path.getPointOnLine(n,l.x,l.y,d.points,d.points,l.x,l.y):d=void 0;break;case”A“:var _=d.points,m=d.points,b=d.points+m;0===y?y=_+1e-8:n>s?y+=Math.PI/180*m/Math.abs(m):y-=Math.PI/360*m/Math.abs(m),(m<0&&y=0&&y>b)&&(y=b,g=!0),u=h.Path.getPointOnEllipticalArc(d.points,d.points,d.points,d.points,y,d.points);break;case”C“:0===y?y=n>d.pathLength?1e-8:n/d.pathLength:n>s?y+=(n-s)/d.pathLength:y-=(s-n)/d.pathLength,y>1&&(y=1,g=!0),u=h.Path.getPointOnCubicBezier(y,d.start.x,d.start.y,d.points,d.points,d.points,d.points,d.points,d.points);break;case”Q“:0===y?y=n/d.pathLength:n>s?y+=(n-s)/d.pathLength:y-=(s-n)/d.pathLength,y>1&&(y=1,g=!0),u=h.Path.getPointOnQuadraticBezier(y,d.start.x,d.start.y,d.points,d.points,d.points,d.points)}void 0!==u&&(s=h.Path.getLineLength(l.x,l.y,u.x,u.y)),g&&(g=!1,d=void 0)}},m=c/(t._getTextSize(”C“).width+i)-1,b=0;b<m&&(_(”C“),void 0!==l&&void 0!==u);b++)l=u;for(var x=0;x),void 0!==l&&void 0!==u);x++){var S=h.Path.getLineLength(l.x,l.y,u.x,u.y),w=0;if(n)try{w=n(p,p)*this.fontSize()}catch(t){w=0}l.x+=w,u.x+=w,this.textWidth+=w;var C=h.Path.getPointOnLine(w+S/2,l.x,l.y,u.x,u.y),P=Math.atan2(u.y-l.y,u.x-l.x);this.glyphInfo.push({transposeX:C.x,transposeY:C.y,text:p,rotation:P,p0:l,p1:u}),l=u}},e.prototype.getSelfRect=function(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};var t=[];this.glyphInfo.forEach((function(e){t.push(e.p0.x),t.push(e.p0.y),t.push(e.p1.x),t.push(e.p1.y)}));for(var e,i,r=t||0,n=t||0,o=t||0,a=t||0,s=0;s,i=t,r=Math.min(r,e),n=Math.max(n,e),o=Math.min(o,i),a=Math.max(a,i);var h=this.fontSize();return{x:r-h/2,y:o-h/2,width:n-r+h,height:a-o+h}},e}(s.Shape);e.TextPath=f,f.prototype._fillFunc=d,f.prototype._strokeFunc=p,f.prototype._fillFuncHit=d,f.prototype._strokeFuncHit=p,f.prototype.className=”TextPath“,f.prototype._attrsAffectingSize=,u._registerNode(f),a.Factory.addGetterSetter(f,”data“),a.Factory.addGetterSetter(f,”fontFamily“,”Arial“),a.Factory.addGetterSetter(f,”fontSize“,12,l.getNumberValidator()),a.Factory.addGetterSetter(f,”fontStyle“,”normal“),a.Factory.addGetterSetter(f,”align“,”left“),a.Factory.addGetterSetter(f,”letterSpacing“,0,l.getNumberValidator()),a.Factory.addGetterSetter(f,”textBaseline“,”middle“),a.Factory.addGetterSetter(f,”fontVariant“,”normal“),a.Factory.addGetterSetter(f,”text“,”“),a.Factory.addGetterSetter(f,”textDecoration“,null),a.Factory.addGetterSetter(f,”kerningFunc“,null),o.Collection.mapMethods(f)},function(t,e,i){”use strict“;var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t=e)})(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,i=1,r=arguments.length;i<r;i++)for(var n in e=arguments)Object.prototype.hasOwnProperty.call(e,n)&&(t=e);return t}).apply(this,arguments)};Object.defineProperty(e,”__esModule“,{value:!0});var a=i(3),s=i(0),h=i(4),c=i(5),l=i(35),u=i(24),d=i(1),p=i(2),f=i(1),g=.map((function(t){return t+”.tr-konva“})).join(” “),y=.map((function(t){return t+”.tr-konva“})).join(” “),v={”top-left“:-45,”top-center“:0,”top-right“:45,”middle-right“:-90,”middle-left“:90,”bottom-left“:-135,”bottom-center“:180,”bottom-right“:135},_=”ontouchstart“in d.Konva._global;var m=;function b(t,e,i){var r=i.x+(t.x-i.x)*Math.cos(e)-(t.y-i.y)*Math.sin(e),n=i.y+(t.x-i.x)*Math.sin(e)+(t.y-i.y)*Math.cos(e);return o(o({},t),{rotation:t.rotation+e,x:r,y:n})}function x(t,e){return b(t,e,function(t){return{x:t.x+t.width/2*Math.cos(t.rotation)+t.height/2*Math.sin(-t.rotation),y:t.y+t.height/2*Math.cos(t.rotation)+t.width/2*Math.sin(t.rotation)}}(t))}var S=function(t){function e(e){var i=t.call(this,e)||this;return i._transforming=!1,i._createElements(),i._handleMouseMove=i._handleMouseMove.bind(i),i._handleMouseUp=i._handleMouseUp.bind(i),i.update=i.update.bind(i),i.on(g,i.update),i.getNode()&&i.update(),i}return n(e,t),e.prototype.attachTo=function(t){return this.setNode(t),this},e.prototype.setNode=function(t){return a.Util.warn(”tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead.“),this.setNodes()},e.prototype.getNode=function(){return this._nodes&&this._nodes},e.prototype.setNodes=function(t){var e=this;return void 0===t&&(t=[]),this._nodes&&this._nodes.length&&this.detach(),this._nodes=t,1===t.length?this.rotation(t.rotation()):this.rotation(0),this._nodes.forEach((function(t){var i=t._attrsAffectingSize.map((function(t){return t+”Change.tr-konva“})).join(” “),r=function(){e._resetTransformCache(),e._transforming||e.update()};t.on(i,r),t.on(y,r),t.on(”_clearTransformCache.tr-konva“,r),t.on(”xChange.tr-konva yChange.tr-konva“,r),e._proxyDrag(t)})),this._resetTransformCache(),!!this.findOne(”.top-left“)&&this.update(),this},e.prototype._proxyDrag=function(t){var e,i=this;t.on(”dragstart.tr-konva“,(function(){e=t.getAbsolutePosition()})),t.on(”dragmove.tr-konva“,(function(){if(e){var r=t.getAbsolutePosition(),n=r.x-e.x,o=r.y-e.y;i.nodes().forEach((function(e){if(e!==t&&!e.isDragging()){var i=e.getAbsolutePosition();e.setAbsolutePosition({x:i.x+n,y:i.y+o}),e.startDrag()}})),e=null}}))},e.prototype.getNodes=function(){return this._nodes},e.prototype.getActiveAnchor=function(){return this._movingAnchorName},e.prototype.detach=function(){this._nodes&&this._nodes.forEach((function(t){t.off(”.tr-konva“)})),this._nodes=[],this._resetTransformCache()},e.prototype._resetTransformCache=function(){this._clearCache(”nodesRect“),this._clearCache(”transform“),this._clearSelfAndDescendantCache(”absoluteTransform“)},e.prototype._getNodeRect=function(){return this._getCache(”nodesRect“,this.__getNodeRect)},e.prototype.__getNodeShape=function(t,e,i){void 0===e&&(e=this.rotation());var r=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),n=t.getAbsoluteScale(i),o=t.getAbsolutePosition(i),a=r.x*n.x-t.offsetX()*n.x,s=r.y*n.y-t.offsetY()*n.y,h=(d.Konva.getAngle(t.getAbsoluteRotation())+2*Math.PI)%(2*Math.PI);return b({x:o.x+a*Math.cos(h)+s*Math.sin(-h),y:o.y+s*Math.cos(h)+a*Math.sin(h),width:r.width*n.x,height:r.height*n.y,rotation:h},-d.Konva.getAngle(e),{x:0,y:0})},e.prototype.__getNodeRect=function(){var t=this;if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};var e=[];this.nodes().map((function(i){var r=i.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:t.ignoreStroke()}),n=,o=i.getAbsoluteTransform();n.forEach((function(t){var i=o.point(t);e.push(i)}))}));var i,r,n,o,s=new a.Transform;s.rotate(-d.Konva.getAngle(this.rotation())),e.forEach((function(t){var e=s.point(t);void 0===i&&(i=n=e.x,r=o=e.y),i=Math.min(i,e.x),r=Math.min(r,e.y),n=Math.max(n,e.x),o=Math.max(o,e.y)})),s.invert();var h=s.point({x:i,y:r});return{x:h.x,y:h.y,width:n-i,height:o-r,rotation:d.Konva.getAngle(this.rotation())}},e.prototype.getX=function(){return this._getNodeRect().x},e.prototype.getY=function(){return this._getNodeRect().y},e.prototype.getWidth=function(){return this._getNodeRect().width},e.prototype.getHeight=function(){return this._getNodeRect().height},e.prototype._createElements=function(){this._createBack(),m.forEach(function(t){this._createAnchor(t)}.bind(this)),this._createAnchor(”rotater“)},e.prototype._createAnchor=function(t){var e=this,i=new l.Rect({stroke:”rgb(0, 161, 255)“,fill:”white“,strokeWidth:1,name:t+” _anchor“,dragDistance:0,draggable:!0,hitStrokeWidth:_?10:”auto“}),r=this;i.on(”mousedown touchstart“,(function(t){r._handleMouseDown(t)})),i.on(”dragstart“,(function(t){i.stopDrag(),t.cancelBubble=!0})),i.on(”dragend“,(function(t){t.cancelBubble=!0})),i.on(”mouseenter“,(function(){var r=d.Konva.getAngle(e.rotation()),n=function(t,e){if(”rotater“===t)return”crosshair“;e+=a.Util._degToRad(v||0);var i=(a.Util._radToDeg(e)%360+360)%360;return a.Util._inRange(i,337.5,360)||a.Util._inRange(i,0,22.5)?”ns-resize“:a.Util._inRange(i,22.5,67.5)?”nesw-resize“:a.Util._inRange(i,67.5,112.5)?”ew-resize“:a.Util._inRange(i,112.5,157.5)?”nwse-resize“:a.Util._inRange(i,157.5,202.5)?”ns-resize“:a.Util._inRange(i,202.5,247.5)?”nesw-resize“:a.Util._inRange(i,247.5,292.5)?”ew-resize“:a.Util._inRange(i,292.5,337.5)?”nwse-resize“:(a.Util.error(”Transformer has unknown angle for cursor detection: “+i),”pointer“)}(t,r);i.getStage().content.style.cursor=n,e._cursorChange=!0})),i.on(”mouseout“,(function(){i.getStage().content.style.cursor=”“,e._cursorChange=!1})),this.add(i)},e.prototype._createBack=function(){var t=this,e=new c.Shape({name:”back“,width:0,height:0,draggable:!0,sceneFunc:function(t){var e=this.getParent(),i=e.padding();t.beginPath(),t.rect(-i,-i,this.width()+2*i,this.height()+2*i),t.moveTo(this.width()/2,-i),e.rotateEnabled()&&t.lineTo(this.width()/2,-e.rotateAnchorOffset()*a.Util._sign(this.height())-i),t.fillStrokeShape(this)},hitFunc:function(e,i){if(t.shouldOverdrawWholeArea()){var r=t.padding();e.beginPath(),e.rect(-r,-r,i.width()+2*r,i.height()+2*r),e.fillStrokeShape(i)}}});this.add(e),this._proxyDrag(e)},e.prototype._handleMouseDown=function(t){this._movingAnchorName=t.target.name().split(” “)[0];var e=this._getNodeRect(),i=e.width,r=e.height,n=Math.sqrt(Math.pow(i,2)+Math.pow(r,2));this.sin=Math.abs(r/n),this.cos=Math.abs(i/n),window.addEventListener(”mousemove“,this._handleMouseMove),window.addEventListener(”touchmove“,this._handleMouseMove),window.addEventListener(”mouseup“,this._handleMouseUp,!0),window.addEventListener(”touchend“,this._handleMouseUp,!0),this._transforming=!0;var o=t.target.getAbsolutePosition(),a=t.target.getStage().getPointerPosition();this._anchorDragOffset={x:a.x-o.x,y:a.y-o.y},this._fire(”transformstart“,{evt:t,target:this.getNode()}),this.getNode()._fire(”transformstart“,{evt:t,target:this.getNode()})},e.prototype._handleMouseMove=function(t){var e,i,r,n=this.findOne(”.“+this._movingAnchorName),o=n.getStage();o.setPointersPositions(t);var a=o.getPointerPosition(),s={x:a.x-this._anchorDragOffset.x,y:a.y-this._anchorDragOffset.y},h=n.getAbsolutePosition();n.setAbsolutePosition(s);var c=n.getAbsolutePosition();if(h.x!==c.x||h.y!==c.y)if(”rotater“!==this._movingAnchorName){var l=this.keepRatio()||t.shiftKey,u=this.centeredScaling()||t.altKey;if(”top-left“===this._movingAnchorName){if(l){var p=u?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(”.bottom-right“).x(),y:this.findOne(”.bottom-right“).y()};r=Math.sqrt(Math.pow(p.x-n.x(),2)+Math.pow(p.y-n.y(),2));var f=this.findOne(”.top-left“).x()>p.x?-1:1,g=this.findOne(”.top-left“).y()>p.y?-1:1;e=r*this.cos*f,i=r*this.sin*g,this.findOne(”.top-left“).x(p.x-e),this.findOne(”.top-left“).y(p.y-i)}}else if(”top-center“===this._movingAnchorName)this.findOne(”.top-left“).y(n.y());else if(”top-right“===this._movingAnchorName){if(l){p=u?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(”.bottom-left“).x(),y:this.findOne(”.bottom-left“).y()};r=Math.sqrt(Math.pow(n.x()-p.x,2)+Math.pow(p.y-n.y(),2));f=this.findOne(”.top-right“).x()<p.x?-1:1,g=this.findOne(”.top-right“).y()>p.y?-1:1;e=r*this.cos*f,i=r*this.sin*g,this.findOne(”.top-right“).x(p.x+e),this.findOne(”.top-right“).y(p.y-i)}var y=n.position();this.findOne(”.top-left“).y(y.y),this.findOne(”.bottom-right“).x(y.x)}else if(”middle-left“===this._movingAnchorName)this.findOne(”.top-left“).x(n.x());else if(”middle-right“===this._movingAnchorName)this.findOne(”.bottom-right“).x(n.x());else if(”bottom-left“===this._movingAnchorName){if(l){p=u?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(”.top-right“).x(),y:this.findOne(”.top-right“).y()};r=Math.sqrt(Math.pow(p.x-n.x(),2)+Math.pow(n.y()-p.y,2));f=p.x<n.x()?-1:1,g=n.y()<p.y?-1:1;e=r*this.cos*f,i=r*this.sin*g,n.x(p.x-e),n.y(p.y+i)}y=n.position(),this.findOne(”.top-left“).x(y.x),this.findOne(”.bottom-right“).y(y.y)}else if(”bottom-center“===this._movingAnchorName)this.findOne(”.bottom-right“).y(n.y());else if(”bottom-right“===this._movingAnchorName){if(l){p=u?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(”.top-left“).x(),y:this.findOne(”.top-left“).y()};r=Math.sqrt(Math.pow(n.x()-p.x,2)+Math.pow(n.y()-p.y,2));f=this.findOne(”.bottom-right“).x()<p.x?-1:1,g=this.findOne(”.bottom-right“).y()<p.y?-1:1;e=r*this.cos*f,i=r*this.sin*g,this.findOne(”.bottom-right“).x(p.x+e),this.findOne(”.bottom-right“).y(p.y+i)}}else console.error(new Error(”Wrong position argument of selection resizer: “+this._movingAnchorName));if(u=this.centeredScaling()||t.altKey){var v=this.findOne(”.top-left“),_=this.findOne(”.bottom-right“),m=v.x(),b=v.y(),S=this.getWidth()-_.x(),w=this.getHeight()-_.y();_.move({x:-m,y:-b}),v.move({x:S,y:w})}var C=this.findOne(”.top-left“).getAbsolutePosition();e=C.x,i=C.y;var P=this.findOne(”.bottom-right“).x()-this.findOne(”.top-left“).x(),A=this.findOne(”.bottom-right“).y()-this.findOne(”.top-left“).y();this._fitNodesInto({x:e,y:i,width:P,height:A,rotation:d.Konva.getAngle(this.rotation())},t)}else{var T=this._getNodeRect();e=n.x()-T.width/2,i=-n.y()+T.height/2;var k=Math.atan2(-i,e)+Math.PI/2;T.height<0&&(k-=Math.PI);var M=d.Konva.getAngle(this.rotation())+k,F=d.Konva.getAngle(this.rotationSnapTolerance()),O=x(T,function(t,e,i){for(var r=e,n=0;n<t.length;n++){var o=d.Konva.getAngle(t),a=Math.abs(o-e)%(2*Math.PI);Math.min(a,2*Math.PI-a)<i&&(r=o)}return r}(this.rotationSnaps(),M,F)-T.rotation);this._fitNodesInto(O,t)}},e.prototype._handleMouseUp=function(t){this._removeEvents(t)},e.prototype.getAbsoluteTransform=function(){return this.getTransform()},e.prototype._removeEvents=function(t){if(this._transforming){this._transforming=!1,window.removeEventListener(”mousemove“,this._handleMouseMove),window.removeEventListener(”touchmove“,this._handleMouseMove),window.removeEventListener(”mouseup“,this._handleMouseUp,!0),window.removeEventListener(”touchend“,this._handleMouseUp,!0);var e=this.getNode();this._fire(”transformend“,{evt:t,target:e}),e&&e.fire(”transformend“,{evt:t,target:e}),this._movingAnchorName=null}},e.prototype._fitNodesInto=function(t,e){var i=this,r=this._getNodeRect();if(a.Util._inRange(t.width,2*-this.padding()-1,1))this.update();else if(a.Util._inRange(t.height,2*-this.padding()-1,1))this.update();else{var n=new a.Transform;if(n.rotate(d.Konva.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf(”left“)>=0){var o=n.point({x:2*-this.padding(),y:0});t.x+=o.x,t.y+=o.y,t.width+=2*this.padding(),this._movingAnchorName=this._movingAnchorName.replace(”left“,”right“),this._anchorDragOffset.x-=o.x,this._anchorDragOffset.y-=o.y}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf(”right“)>=0){o=n.point({x:2*this.padding(),y:0});this._movingAnchorName=this._movingAnchorName.replace(”right“,”left“),this._anchorDragOffset.x-=o.x,this._anchorDragOffset.y-=o.y,t.width+=2*this.padding()}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf(”top“)>=0){o=n.point({x:0,y:2*-this.padding()});t.x+=o.x,t.y+=o.y,this._movingAnchorName=this._movingAnchorName.replace(”top“,”bottom“),this._anchorDragOffset.x-=o.x,this._anchorDragOffset.y-=o.y,t.height+=2*this.padding()}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf(”bottom“)>=0){o=n.point({x:0,y:2*this.padding()});this._movingAnchorName=this._movingAnchorName.replace(”bottom“,”top“),this._anchorDragOffset.x-=o.x,this._anchorDragOffset.y-=o.y,t.height+=2*this.padding()}if(this.boundBoxFunc()){var s=this.boundBoxFunc()(r,t);s?t=s:a.Util.warn(”boundBoxFunc returned falsy. You should return new bound rect from it!“)}var h=new a.Transform;h.translate(r.x,r.y),h.rotate(r.rotation),h.scale(r.width/1e7,r.height/1e7);var c=new a.Transform;c.translate(t.x,t.y),c.rotate(t.rotation),c.scale(t.width/1e7,t.height/1e7);var l=c.multiply(h.invert());this._nodes.forEach((function(t){var r=t.getParent().getAbsoluteTransform(),n=t.getTransform().copy();n.translate(t.offsetX(),t.offsetY());var o=new a.Transform;o.multiply(r.copy().invert()).multiply(l).multiply®.multiply(n);var s=o.decompose();t._batchTransformChanges((function(){t.setAttrs(s)})),i._fire(”transform“,{evt:e,target:t}),t._fire(”transform“,{evt:e,target:t})})),this.rotation(a.Util._getRotation(t.rotation)),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}},e.prototype.forceUpdate=function(){this._resetTransformCache(),this.update()},e.prototype._batchChangeChild=function(t,e){var i=this.findOne(t);i._batchTransformChanges((function(){i.setAttrs(e)}))},e.prototype.update=function(){var t=this,e=this._getNodeRect();this.rotation(a.Util._getRotation(e.rotation));var i=e.width,r=e.height,n=this.enabledAnchors(),o=this.resizeEnabled(),s=this.padding(),h=this.anchorSize();this.find(”._anchor“).each((function(e){e._batchTransformChanges((function(){e.setAttrs({width:h,height:h,offsetX:h/2,offsetY:h/2,stroke:t.anchorStroke(),strokeWidth:t.anchorStrokeWidth(),fill:t.anchorFill(),cornerRadius:t.anchorCornerRadius()})}))})),this._batchChangeChild(”.top-left“,{x:0,y:0,offsetX:h/2+s,offsetY:h/2+s,visible:o&&n.indexOf(”top-left“)>=0}),this._batchChangeChild(”.top-center“,{x:i/2,y:0,offsetY:h/2+s,visible:o&&n.indexOf(”top-center“)>=0}),this._batchChangeChild(”.top-right“,{x:i,y:0,offsetX:h/2-s,offsetY:h/2+s,visible:o&&n.indexOf(”top-right“)>=0}),this._batchChangeChild(”.middle-left“,{x:0,y:r/2,offsetX:h/2+s,visible:o&&n.indexOf(”middle-left“)>=0}),this._batchChangeChild(”.middle-right“,{x:i,y:r/2,offsetX:h/2-s,visible:o&&n.indexOf(”middle-right“)>=0}),this._batchChangeChild(”.bottom-left“,{x:0,y:r,offsetX:h/2+s,offsetY:h/2-s,visible:o&&n.indexOf(”bottom-left“)>=0}),this._batchChangeChild(”.bottom-center“,{x:i/2,y:r,offsetY:h/2-s,visible:o&&n.indexOf(”bottom-center“)>=0}),this._batchChangeChild(”.bottom-right“,{x:i,y:r,offsetX:h/2-s,offsetY:h/2-s,visible:o&&n.indexOf(”bottom-right“)>=0}),this._batchChangeChild(”.rotater“,{x:i/2,y:-this.rotateAnchorOffset()*a.Util._sign®-s,visible:this.rotateEnabled()}),this._batchChangeChild(”.back“,{width:i,height:r,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0})},e.prototype.isTransforming=function(){return this._transforming},e.prototype.stopTransform=function(){if(this._transforming){this._removeEvents();var t=this.findOne(”.“+this._movingAnchorName);t&&t.stopDrag()}},e.prototype.destroy=function(){return this.getStage()&&this._cursorChange&&(this.getStage().content.style.cursor=”“),u.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this},e.prototype.toObject=function(){return h.Node.prototype.toObject.call(this)},e}(u.Group);e.Transformer=S,S.prototype.className=”Transformer“,f._registerNode(S),s.Factory.addGetterSetter(S,”enabledAnchors“,m,(function(t){return t instanceof Array||a.Util.warn(”enabledAnchors value should be an array“),t instanceof Array&&t.forEach((function(t){-1===m.indexOf(t)&&a.Util.warn(”Unknown anchor name: “t”. Available names are: “+m.join(”, “))})),t||[]})),s.Factory.addGetterSetter(S,”resizeEnabled“,!0),s.Factory.addGetterSetter(S,”anchorSize“,10,p.getNumberValidator()),s.Factory.addGetterSetter(S,”rotateEnabled“,!0),s.Factory.addGetterSetter(S,”rotationSnaps“,),s.Factory.addGetterSetter(S,”rotateAnchorOffset“,50,p.getNumberValidator()),s.Factory.addGetterSetter(S,”rotationSnapTolerance“,5,p.getNumberValidator()),s.Factory.addGetterSetter(S,”borderEnabled“,!0),s.Factory.addGetterSetter(S,”anchorStroke“,”rgb(0, 161, 255)“),s.Factory.addGetterSetter(S,”anchorStrokeWidth“,1,p.getNumberValidator()),s.Factory.addGetterSetter(S,”anchorFill“,”white“),s.Factory.addGetterSetter(S,”anchorCornerRadius“,0,p.getNumberValidator()),s.Factory.addGetterSetter(S,”borderStroke“,”rgb(0, 161, 255)“),s.Factory.addGetterSetter(S,”borderStrokeWidth“,1,p.getNumberValidator()),s.Factory.addGetterSetter(S,”borderDash“),s.Factory.addGetterSetter(S,”keepRatio“,!0),s.Factory.addGetterSetter(S,”centeredScaling“,!1),s.Factory.addGetterSetter(S,”ignoreStroke“,!1),s.Factory.addGetterSetter(S,”padding“,0,p.getNumberValidator()),s.Factory.addGetterSetter(S,”node“),s.Factory.addGetterSetter(S,”nodes“),s.Factory.addGetterSetter(S,”boundBoxFunc“),s.Factory.addGetterSetter(S,”shouldOverdrawWholeArea“,!1),s.Factory.backCompat(S,{lineEnabled:”borderEnabled“,rotateHandlerOffset:”rotateAnchorOffset“,enabledHandlers:”enabledAnchors“}),a.Collection.mapMethods(S)},function(t,e,i){”use strict“;var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t=e)})(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,”__esModule“,{value:!0});var o=i(3),a=i(0),s=i(5),h=i(1),c=i(2),l=i(1),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype._sceneFunc=function(t){t.beginPath(),t.arc(0,0,this.radius(),0,h.Konva.getAngle(this.angle()),this.clockwise()),t.lineTo(0,0),t.closePath(),t.fillStrokeShape(this)},e.prototype.getWidth=function(){return 2*this.radius()},e.prototype.getHeight=function(){return 2*this.radius()},e.prototype.setWidth=function(t){this.radius(t/2)},e.prototype.setHeight=function(t){this.radius(t/2)},e}(s.Shape);e.Wedge=u,u.prototype.className=”Wedge“,u.prototype._centroid=!0,u.prototype._attrsAffectingSize=,l._registerNode(u),a.Factory.addGetterSetter(u,”radius“,0,c.getNumberValidator()),a.Factory.addGetterSetter(u,”angle“,0,c.getNumberValidator()),a.Factory.addGetterSetter(u,”clockwise“,!1),a.Factory.backCompat(u,{angleDeg:”angle“,getAngleDeg:”getAngle“,setAngleDeg:”setAngle“}),o.Collection.mapMethods(u)},function(t,e,i){”use strict“;Object.defineProperty(e,”__esModule“,{value:!0});var r=i(0),n=i(4),o=i(2);function a(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var s=,h=;e.Blur=function(t){var e=Math.round(this.blurRadius());e>0&&function(t,e){var i,r,n,o,c,l,u,d,p,f,g,y,v,_,m,b,x,S,w,C,P,A,T,k,M=t.data,F=t.width,O=t.height,G=e+e+1,D=F-1,z=O-1,N=e+1,R=N*(N+1)/2,E=new a,L=null,I=E,U=null,V=null,j=s,B=h;for(n=1;n<G;n++)I=I.next=new a,n===N&&(L=I);for(I.next=E,u=l=0,r=0;r<O;r++){for(b=x=S=w=d=p=f=g=0,y=N*(C=M),v=N*(P=M),_=N*(A=M),m=N*(T=M),d+=R*C,p+=R*P,f+=R*A,g+=R*T,I=E,n=0;n)*(k=N-n),p+=(I.g=P=M)*k,f+=(I.b=A=M)*k,g+=(I.a=T=M)*k,b+=C,x+=P,S+=A,w+=T,I=I.next;for(U=E,V=L,i=0;i=T=g*j>>B,0!==T?(T=255/T,M=(d*j>>B)*T,M=(p*j>>B)*T,M=(f*j>>B)*T):M=M=M=0,d-=y,p-=v,f-=_,g-=m,y-=U.r,v-=U.g,_-=U.b,m-=U.a,o=u+((o=i+e+1),p+=x+=U.g=M,f+=S+=U.b=M,g+=w+=U.a=M,U=U.next,y+=C=V.r,v+=P=V.g,_+=A=V.b,m+=T=V.a,b-=C,x-=P,S-=A,w-=T,V=V.next,l+=4;u+=F}for(i=0;i<F;i++){for(x=S=w=b=p=f=g=d=0,y=N*(C=M),v=N*(P=M),_=N*(A=M),m=N*(T=M),d+=R*C,p+=R*P,f+=R*A,g+=R*T,I=E,n=0;n)*(k=N-n),p+=(I.g=P=M)*k,f+=(I.b=A=M)*k,g+=(I.a=T=M)*k,b+=C,x+=P,S+=A,w+=T,I=I.next,n=T=g*j>>B,T>0?(T=255/T,M=(d*j>>B)*T,M=(p*j>>B)*T,M=(f*j>>B)*T):M=M=M=0,d-=y,p-=v,f-=_,g-=m,y-=U.r,v-=U.g,_-=U.b,m-=U.a,o=i+((o=r+N),p+=x+=U.g=M,f+=S+=U.b=M,g+=w+=U.a=M,U=U.next,y+=C=V.r,v+=P=V.g,_+=A=V.b,m+=T=V.a,b-=C,x-=P,S-=A,w-=T,V=V.next,l+=F}}(t,e)},r.Factory.addGetterSetter(n.Node,”blurRadius“,0,o.getNumberValidator(),r.Factory.afterSetFilter)},function(t,e,i){”use strict“;Object.defineProperty(e,”__esModule“,{value:!0});var r=i(0),n=i(4),o=i(2);e.Brighten=function(t){var e,i=255*this.brightness(),r=t.data,n=r.length;for(e=0;e+=i,r+=i,r+=i},r.Factory.addGetterSetter(n.Node,”brightness“,0,o.getNumberValidator(),r.Factory.afterSetFilter)},function(t,e,i){”use strict“;Object.defineProperty(e,”__esModule“,{value:!0});var r=i(0),n=i(4),o=i(2);e.Contrast=function(t){var e,i=Math.pow((this.contrast()+100)/100,2),r=t.data,n=r.length,o=150,a=150,s=150;for(e=0;e,a=r,s=r,o/=255,o-=.5,o*=i,o+=.5,a/=255,a-=.5,a*=i,a+=.5,s/=255,s-=.5,s*=i,s+=.5,o=(o*=255)<0?0:o>255?255:o,a=(a*=255)<0?0:a>255?255:a,s=(s*=255)<0?0:s>255?255:s,r=o,r=a,r=s},r.Factory.addGetterSetter(n.Node,”contrast“,0,o.getNumberValidator(),r.Factory.afterSetFilter)},function(t,e,i){”use strict“;Object.defineProperty(e,”__esModule“,{value:!0});var r=i(0),n=i(4),o=i(3),a=i(2);e.Emboss=function(t){var e=10*this.embossStrength(),i=255*this.embossWhiteLevel(),r=this.embossDirection(),n=this.embossBlend(),a=0,s=0,h=t.data,c=t.width,l=t.height,u=4*c,d=l;switch®{case”top-left“:a=-1,s=-1;break;case”top“:a=-1,s=0;break;case”top-right“:a=-1,s=1;break;case”right“:a=0,s=1;break;case”bottom-right“:a=1,s=1;break;case”bottom“:a=1,s=0;break;case”bottom-left“:a=1,s=-1;break;case”left“:a=0,s=-1;break;default:o.Util.error(”Unknown emboss direction: “+r)}do{var p=(d-1)*u,f=a;d+f<1&&(f=0),d+f>l&&(f=0);var g=(d-1+f)*c*4,y=c;do{var v=p+4*(y-1),_=s;y+_<1&&(_=0),y+_>c&&(_=0);var m=g+4*(y-1+_),b=h-h,x=h-h,S=h-h,w=b,C=w>0?w:-w;if((x>0?x:-x)>C&&(w=x),(S>0?S:-S)>C&&(w=S),w*=e,n){var P=h+w,A=h+w,T=h+w;h=P>255?255:P<0?0:P,h=A>255?255:A<0?0:A,h=T>255?255:T<0?0:T}else{var k=i-w;k<0?k=0:k>255&&(k=255),h=h=h=k}}while(–y)}while(–d)},r.Factory.addGetterSetter(n.Node,”embossStrength“,.5,a.getNumberValidator(),r.Factory.afterSetFilter),r.Factory.addGetterSetter(n.Node,”embossWhiteLevel“,.5,a.getNumberValidator(),r.Factory.afterSetFilter),r.Factory.addGetterSetter(n.Node,”embossDirection“,”top-left“,null,r.Factory.afterSetFilter),r.Factory.addGetterSetter(n.Node,”embossBlend“,!1,null,r.Factory.afterSetFilter)},function(t,e,i){”use strict“;Object.defineProperty(e,”__esModule“,{value:!0});var r=i(0),n=i(4),o=i(2);function a(t,e,i,r,n){var o=i-e,a=n-r;return 0===o?r+a/2:0===a?r:a*((t-e)/o)+r}e.Enhance=function(t){var e,i,r,n,o=t.data,s=o.length,h=o,c=h,l=o,u=l,d=o,p=d,f=this.enhance();if(0!==f){for(n=0;n)<h?h=e:e>c&&(c=e),(i=o)<l?l=i:i>u&&(u=i),(r=o)<d?d=r:r>p&&(p=r);var g,y,v,_,m,b,x,S,w;for(c===h&&(c=255,h=0),u===l&&(u=255,l=0),p===d&&(p=255,d=0),f>0?(y=c+f*(255-c),v=h-f*(h-0),m=u+f*(255-u),b=l-f*(l-0),S=p+f*(255-p),w=d-f*(d-0)):(y=c+f*(c-(g=.5*(c+h))),v=h+f*(h-g),m=u+f*(u-(_=.5*(u+l))),b=l+f*(l-_),S=p+f*(p-(x=.5*(p+d))),w=d+f*(d-x)),n=0;n=a(o,h,c,v,y),o=a(o,l,u,b,m),o=a(o,d,p,w,S)}},r.Factory.addGetterSetter(n.Node,”enhance“,0,o.getNumberValidator(),r.Factory.afterSetFilter)},function(t,e,i){”use strict“;Object.defineProperty(e,”__esModule“,{value:!0}),e.Grayscale=function(t){var e,i,r=t.data,n=r.length;for(e=0;e+.5*r+.16*r,r=i,r=i,r=i}},function(t,e,i){”use strict“;Object.defineProperty(e,”__esModule“,{value:!0});var r=i(0),n=i(4),o=i(2);r.Factory.addGetterSetter(n.Node,”hue“,0,o.getNumberValidator(),r.Factory.afterSetFilter),r.Factory.addGetterSetter(n.Node,”saturation“,0,o.getNumberValidator(),r.Factory.afterSetFilter),r.Factory.addGetterSetter(n.Node,”luminance“,0,o.getNumberValidator(),r.Factory.afterSetFilter),e.HSL=function(t){var e,i,r,n,o,a=t.data,s=a.length,h=Math.pow(2,this.saturation()),c=Math.abs(this.hue()+360)%360,l=127*this.luminance(),u=1*h*Math.cos(c*Math.PI/180),d=1*h*Math.sin(c*Math.PI/180),p=.299+.701*u+.167*d,f=.587-.587*u+.33*d,g=.114-.114*u-.497*d,y=.299-.299*u-.328*d,v=.587+.413*u+.035*d,_=.114-.114*u+.293*d,m=.299-.3*u+1.25*d,b=.587-.586*u-1.05*d,x=.114+.886*u-.2*d;for(e=0;e,r=a,n=a,o=a,a=p*i+f*r+g*n+l,a=y*i+v*r+_*n+l,a=m*i+b*r+x*n+l,a=o}},function(t,e,i){”use strict“;Object.defineProperty(e,”__esModule“,{value:!0});var r=i(0),n=i(4),o=i(2);e.HSV=function(t){var e,i,r,n,o,a=t.data,s=a.length,h=Math.pow(2,this.value()),c=Math.pow(2,this.saturation()),l=Math.abs(this.hue()+360)%360,u=h*c*Math.cos(l*Math.PI/180),d=h*c*Math.sin(l*Math.PI/180),p=.299*h+.701*u+.167*d,f=.587*h-.587*u+.33*d,g=.114*h-.114*u-.497*d,y=.299*h-.299*u-.328*d,v=.587*h+.413*u+.035*d,_=.114*h-.114*u+.293*d,m=.299*h-.3*u+1.25*d,b=.587*h-.586*u-1.05*d,x=.114*h+.886*u-.2*d;for(e=0;e,r=a,n=a,o=a,a=p*i+f*r+g*n,a=y*i+v*r+_*n,a=m*i+b*r+x*n,a=o},r.Factory.addGetterSetter(n.Node,”hue“,0,o.getNumberValidator(),r.Factory.afterSetFilter),r.Factory.addGetterSetter(n.Node,”saturation“,0,o.getNumberValidator(),r.Factory.afterSetFilter),r.Factory.addGetterSetter(n.Node,”value“,0,o.getNumberValidator(),r.Factory.afterSetFilter)},function(t,e,i){”use strict“;Object.defineProperty(e,”__esModule“,{value:!0}),e.Invert=function(t){var e,i=t.data,r=i.length;for(e=0;e=255-i,i=255-i,i=255-i}},function(t,e,i){”use strict“;Object.defineProperty(e,”__esModule“,{value:!0});var r=i(0),n=i(4),o=i(3),a=i(2);e.Kaleidoscope=function(t){var e,i,r,n,a,s,h,c,l,u=t.width,d=t.height,p=Math.round(this.kaleidoscopePower()),f=Math.round(this.kaleidoscopeAngle()),g=Math.floor(u*(f%360)/360);if(!(p<1)){var y=o.Util.createCanvasElement();y.width=u,y.height=d;var v=y.getContext(”2d“).getImageData(0,0,u,d);!function(t,e,i){var r,n,o,a,s=t.data,h=e.data,c=t.width,l=t.height,u=i.polarCenterX||c/2,d=i.polarCenterY||l/2,p=0,f=0,g=0,y=0,v=Math.sqrt(u*u+d*d);n=c-u,o=l-d,v=(a=Math.sqrt(n*n+o*o))>v?a:v;var _,m,b,x,S=l,w=c,C=360/w*Math.PI/180;for(m=0;m,f=s,g=s,y=s,h=p,h=f,h=g,h=y}(t,v,{polarCenterX:u/2,polarCenterY:d/2});for(var _=u/Math.pow(2,p);_<=8;)_*=2,p-=1;var m=_=Math.ceil(_),b=0,x=m,S=1;for(g+_>u&&(b=m,x=0,S=-1),i=0;i,a=v.data,s=v.data,h=v.data,l=4*(u*i+e),v.data=n,v.data=a,v.data=s,v.data=h;for(i=0;i<d;i+=1)for(m=Math.floor(_),r=0;r<p;r+=1){for(e=0;e,a=v.data,s=v.data,h=v.data,l=4*(u*i+2*m-e-1),v.data=n,v.data=a,v.data=s,v.data=h;m*=2}!function(t,e,i){var r,n,o,a,s,h,c=t.data,l=e.data,u=t.width,d=t.height,p=i.polarCenterX||u/2,f=i.polarCenterY||d/2,g=0,y=0,v=0,_=0,m=Math.sqrt(p*p+f*f);n=u-p,o=d-f,m=(h=Math.sqrt(n*n+o*o))>m?h:m;var b,x,S,w=d,C=u,P=i.polarRotation||0;for(n=0;n,y=c,v=c,_=c,l=g,l=y,l=v,l=_}(v,t,{polarRotation:0})}},r.Factory.addGetterSetter(n.Node,”kaleidoscopePower“,2,a.getNumberValidator(),r.Factory.afterSetFilter),r.Factory.addGetterSetter(n.Node,”kaleidoscopeAngle“,0,a.getNumberValidator(),r.Factory.afterSetFilter)},function(t,e,i){”use strict“;Object.defineProperty(e,”__esModule“,{value:!0});var r=i(0),n=i(4),o=i(2);function a(t,e,i){var r=4*(i*t.width+e),n=[];return n.push(t.data,t.data,t.data,t.data),n}function s(t,e){return Math.sqrt(Math.pow(t-e,2)+Math.pow(t-e,2)+Math.pow(t-e,2))}e.Mask=function(t){var e=function(t,e){var i=a(t,0,0),r=a(t,t.width-1,0),n=a(t,0,t.height-1),o=a(t,t.width-1,t.height-1),h=e||10;if(s(i,r)<h&&s(r,o)<h&&s(o,n)<h&&s(n,i)<h){for(var c=function(t){for(var e=,i=0;i+=t[0],e+=t[1],e+=t[2];return e/=t.length,e/=t.length,e/=t.length,e}([r,i,o,n]),l=[],u=0;u<t.width*t.height;u++){var d=s(c,[t.data,t.data,t.data]);l=d<h?0:255}return l}}(t,this.threshold());return e&&function(t,e){for(var i=0;i=e}(t,e=function(t,e,i){for(var r=,n=Math.round(Math.sqrt(r.length)),o=Math.floor(n/2),a=[],s=0;s<i;s++)for(var h=0;h<e;h++){for(var c=s*e+h,l=0,u=0;u<n;u++)for(var d=0;d<n;d++){var p=s+u-o,f=h+d-o;if(p>=0&&p<i&&f>=0&&f<e){var g=r;l+=t*g}}a=l}return a}(e=function(t,e,i){for(var r=,n=Math.round(Math.sqrt(r.length)),o=Math.floor(n/2),a=[],s=0;s<i;s++)for(var h=0;h<e;h++){for(var c=s*e+h,l=0,u=0;u<n;u++)for(var d=0;d<n;d++){var p=s+u-o,f=h+d-o;if(p>=0&&p<i&&f>=0&&f<e){var g=r;l+=t*g}}a=l>=1020?255:0}return a}(e=function(t,e,i){for(var r=,n=Math.round(Math.sqrt(r.length)),o=Math.floor(n/2),a=[],s=0;s<i;s++)for(var h=0;h<e;h++){for(var c=s*e+h,l=0,u=0;u<n;u++)for(var d=0;d<n;d++){var p=s+u-o,f=h+d-o;if(p>=0&&p<i&&f>=0&&f<e){var g=r;l+=t*g}}a=2040===l?255:0}return a}(e,t.width,t.height),t.width,t.height),t.width,t.height)),t},r.Factory.addGetterSetter(n.Node,”threshold“,0,o.getNumberValidator(),r.Factory.afterSetFilter)},function(t,e,i){”use strict“;Object.defineProperty(e,”__esModule“,{value:!0});var r=i(0),n=i(4),o=i(2);e.Noise=function(t){var e,i=255*this.noise(),r=t.data,n=r.length,o=i/2;for(e=0;e+=o-2*o*Math.random(),r+=o-2*o*Math.random(),r+=o-2*o*Math.random()},r.Factory.addGetterSetter(n.Node,”noise“,.2,o.getNumberValidator(),r.Factory.afterSetFilter)},function(t,e,i){”use strict“;Object.defineProperty(e,”__esModule“,{value:!0});var r=i(0),n=i(3),o=i(4),a=i(2);e.Pixelate=function(t){var e,i,r,o,a,s,h,c,l,u,d,p,f,g,y=Math.ceil(this.pixelSize()),v=t.width,_=t.height,m=Math.ceil(v/y),b=Math.ceil(_/y),x=t.data;if(y<=0)n.Util.error(”pixelSize value can not be <= 0“);else for(p=0;p<m;p+=1)for(f=0;f<b;f+=1){for(o=0,a=0,s=0,h=0,l=(c=p*y)+y,d=(u=f*y)+y,g=0,e=c;e=v))for(i=u;i=_||(o+=x,a+=x,s+=x,h+=x,g+=1);for(o/=g,a/=g,s/=g,h/=g,e=c;e=v))for(i=u;i=_||(x=o,x=a,x=s,x=h)}},r.Factory.addGetterSetter(o.Node,”pixelSize“,8,a.getNumberValidator(),r.Factory.afterSetFilter)},function(t,e,i){”use strict“;Object.defineProperty(e,”__esModule“,{value:!0});var r=i(0),n=i(4),o=i(2);e.Posterize=function(t){var e,i=Math.round(254*this.levels())+1,r=t.data,n=r.length,o=255/i;for(e=0;e=Math.floor(r/o)*o},r.Factory.addGetterSetter(n.Node,”levels“,.5,o.getNumberValidator(),r.Factory.afterSetFilter)},function(t,e,i){”use strict“;Object.defineProperty(e,”__esModule“,{value:!0});var r=i(0),n=i(4),o=i(2);e.RGB=function(t){var e,i,r=t.data,n=r.length,o=this.red(),a=this.green(),s=this.blue();for(e=0;e+.5*r+.16*r)/255,r=i*o,r=i*a,r=i*s,r=r},r.Factory.addGetterSetter(n.Node,”red“,0,(function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)})),r.Factory.addGetterSetter(n.Node,”green“,0,(function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)})),r.Factory.addGetterSetter(n.Node,”blue“,0,o.RGBComponent,r.Factory.afterSetFilter)},function(t,e,i){”use strict“;Object.defineProperty(e,”__esModule“,{value:!0});var r=i(0),n=i(4),o=i(2);e.RGBA=function(t){var e,i,r=t.data,n=r.length,o=this.red(),a=this.green(),s=this.blue(),h=this.alpha();for(e=0;e=o*h+r*i,r=a*h+r*i,r=s*h+r*i},r.Factory.addGetterSetter(n.Node,”red“,0,(function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)})),r.Factory.addGetterSetter(n.Node,”green“,0,(function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)})),r.Factory.addGetterSetter(n.Node,”blue“,0,o.RGBComponent,r.Factory.afterSetFilter),r.Factory.addGetterSetter(n.Node,”alpha“,1,(function(t){return this._filterUpToDate=!1,t>1?1:t<0?0:t}))},function(t,e,i){”use strict“;Object.defineProperty(e,”__esModule“,{value:!0}),e.Sepia=function(t){var e,i,r,n,o=t.data,a=o.length;for(e=0;e,r=o,n=o,o=Math.min(255,.393*i+.769*r+.189*n),o=Math.min(255,.349*i+.686*r+.168*n),o=Math.min(255,.272*i+.534*r+.131*n)}},function(t,e,i){”use strict“;Object.defineProperty(e,”__esModule“,{value:!0}),e.Solarize=function(t){var e=t.data,i=t.width,r=4*i,n=t.height;do{var o=(n-1)*r,a=i;do{var s=o+4*(a-1),h=e,c=e,l=e;h>127&&(h=255-h),c>127&&(c=255-c),l>127&&(l=255-l),e=h,e=c,e=l}while(–a)}while(–n)}},function(t,e,i){”use strict“;Object.defineProperty(e,”__esModule“,{value:!0});var r=i(0),n=i(4),o=i(2);e.Threshold=function(t){var e,i=255*this.threshold(),r=t.data,n=r.length;for(e=0;e=r<i?0:255},r.Factory.addGetterSetter(n.Node,”threshold“,.5,o.getNumberValidator(),r.Factory.afterSetFilter)}]); //# sourceMappingURL=headbreaker.js.map