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 ,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 +”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;ie
'” 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;it.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;it
” 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;ei
'“ 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;oh
'“. Fallback to ”Shape“.‘),h=”Shape“),n=new(0,a._NODES_REGISTRY)(e.attrs),c)for(o=c.length,s=0;st.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;ot.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).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=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);rr
” 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;tt
”. 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)<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,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