0)return{antialiased:!0};return{}}drawScene(e,r,s){const a=this.getLayer(),l=e||a&&a.getCanvas();return this._fire(Q0,{node:this}),this.clearBeforeDraw()&&l.getContext().clear(),Co.Container.prototype.drawScene.call(this,l,r,s),this._fire(J0,{node:this}),this}drawHit(e,r){const s=this.getLayer(),a=e||s&&s.hitCanvas;return s&&s.clearBeforeDraw()&&s.getHitCanvas().getContext().clear(),Co.Container.prototype.drawHit.call(this,a,r),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(e){sn.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(e)}getHitGraphEnabled(e){return sn.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;const e=this.parent;!!this.hitCanvas._canvas.parentNode?e.content.removeChild(this.hitCanvas._canvas):e.content.appendChild(this.hitCanvas._canvas)}destroy(){return sn.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};ii.Layer=xr;xr.prototype.nodeType="Layer";(0,X0._registerNode)(xr);jo.Factory.addGetterSetter(xr,"imageSmoothingEnabled",!0);jo.Factory.addGetterSetter(xr,"clearBeforeDraw",!0);jo.Factory.addGetterSetter(xr,"hitGraphEnabled",!0,(0,K0.getBooleanValidator)());var ys={};Object.defineProperty(ys,"__esModule",{value:!0});ys.FastLayer=void 0;const $0=Gt,tf=ii,ef=lt;class Ko extends tf.Layer{constructor(e){super(e),this.listening(!1),$0.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}ys.FastLayer=Ko;Ko.prototype.nodeType="FastLayer";(0,ef._registerNode)(Ko);var Pr={};Object.defineProperty(Pr,"__esModule",{value:!0});Pr.Group=void 0;const nf=Gt,rf=Kn,sf=lt;class Yo extends rf.Container{_validateAdd(e){const r=e.getType();r!=="Group"&&r!=="Shape"&&nf.Util.throw("You may only add groups and shapes to groups.")}}Pr.Group=Yo;Yo.prototype.nodeType="Group";(0,sf._registerNode)(Yo);var Er={};Object.defineProperty(Er,"__esModule",{value:!0});Er.Animation=void 0;const wo=lt,eh=Gt,xo=function(){return wo.glob.performance&&wo.glob.performance.now?function(){return wo.glob.performance.now()}:function(){return new Date().getTime()}}();class Ye{constructor(e,r){this.id=Ye.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:xo(),frameRate:0},this.func=e,this.setLayers(r)}setLayers(e){let r=[];return e&&(r=Array.isArray(e)?e:[e]),this.layers=r,this}getLayers(){return this.layers}addLayer(e){const r=this.layers,s=r.length;for(let a=0;athis.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():y<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=y,this.update())}getTime(){return this._time}setPosition(y){this.prevPos=this._pos,this.propFunc(y),this._pos=y}getPosition(y){return y===void 0&&(y=this._time),this.func(y,this.begin,this._change,this.duration)}play(){this.state=c,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=f,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(y){this.pause(),this._time=y,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){const y=this.getTimer()-this._startTime;this.state===c?this.setTime(y):this.state===f&&this.setTime(this.duration-y)}pause(){this.state=h,this.fire("onPause")}getTimer(){return new Date().getTime()}}class w{constructor(y){const P=this,E=y.node,R=E._id,L=y.easing||d.Easings.Linear,p=!!y.yoyo;let v,k;typeof y.duration>"u"?v=.3:y.duration===0?v=.001:v=y.duration,this.node=E,this._id=_++;const M=E.getLayer()||(E instanceof a.Konva.Stage?E.getLayers():null);M||e.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new r.Animation(function(){P.tween.onEnterFrame()},M),this.tween=new x(k,function(I){P._tweenFunc(I)},L,0,1,v*1e3,p),this._addListeners(),w.attrs[R]||(w.attrs[R]={}),w.attrs[R][this._id]||(w.attrs[R][this._id]={}),w.tweens[R]||(w.tweens[R]={});for(k in y)l[k]===void 0&&this._addAttr(k,y[k]);this.reset(),this.onFinish=y.onFinish,this.onReset=y.onReset,this.onUpdate=y.onUpdate}_addAttr(y,P){const E=this.node,R=E._id;let L,p,v,k,M;const I=w.tweens[R][y];I&&delete w.attrs[R][I][y];let T=E.getAttr(y);if(e.Util._isArray(P))if(L=[],p=Math.max(P.length,T.length),y==="points"&&P.length!==T.length&&(P.length>T.length?(k=T,T=e.Util._prepareArrayForTween(T,P,E.closed())):(v=P,P=e.Util._prepareArrayForTween(P,T,E.closed()))),y.indexOf("fill")===0)for(let U=0;U{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{const y=this.node,P=w.attrs[y._id][this._id];P.points&&P.points.trueEnd&&y.setAttr("points",P.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{const y=this.node,P=w.attrs[y._id][this._id];P.points&&P.points.trueStart&&y.points(P.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(y){return this.tween.seek(y*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){const y=this.node._id,P=this._id,E=w.tweens[y];this.pause(),this.anim&&this.anim.stop();for(const R in E)delete w.tweens[y][R];delete w.attrs[y][P],w.tweens[y]&&(Object.keys(w.tweens[y]).length===0&&delete w.tweens[y],Object.keys(w.attrs[y]).length===0&&delete w.attrs[y])}}d.Tween=w,w.attrs={},w.tweens={},s.Node.prototype.to=function(C){const y=C.onFinish;C.node=this,C.onFinish=function(){this.destroy(),y&&y()},new w(C).play()},d.Easings={BackEaseIn(C,y,P,E){return P*(C/=E)*C*((1.70158+1)*C-1.70158)+y},BackEaseOut(C,y,P,E){return P*((C=C/E-1)*C*((1.70158+1)*C+1.70158)+1)+y},BackEaseInOut(C,y,P,E){let R=1.70158;return(C/=E/2)<1?P/2*(C*C*(((R*=1.525)+1)*C-R))+y:P/2*((C-=2)*C*(((R*=1.525)+1)*C+R)+2)+y},ElasticEaseIn(C,y,P,E,R,L){let p=0;return C===0?y:(C/=E)===1?y+P:(L||(L=E*.3),!R||R0?e:r),_=h*r,x=c*(c>0?e:r),w=f*(f>0?r:e);return{x:m,y:s?-1*w:x,width:_-m,height:w-x}}}_s.Arc=hn;hn.prototype._centroid=!0;hn.prototype.className="Arc";hn.prototype._attrsAffectingSize=["innerRadius","outerRadius","angle","clockwise"];(0,of._registerNode)(hn);vs.Factory.addGetterSetter(hn,"innerRadius",0,(0,Ss.getNumberValidator)());vs.Factory.addGetterSetter(hn,"outerRadius",0,(0,Ss.getNumberValidator)());vs.Factory.addGetterSetter(hn,"angle",0,(0,Ss.getNumberValidator)());vs.Factory.addGetterSetter(hn,"clockwise",!1,(0,Ss.getBooleanValidator)());var Cs={},si={};Object.defineProperty(si,"__esModule",{value:!0});si.Line=void 0;const ws=ht,lf=lt,uf=Kt,Hh=et;function Lo(d,e,r,s,a,l,h){const c=Math.sqrt(Math.pow(r-d,2)+Math.pow(s-e,2)),f=Math.sqrt(Math.pow(a-r,2)+Math.pow(l-s,2)),m=h*c/(c+f),_=h*f/(c+f),x=r-m*(a-d),w=s-m*(l-e),C=r+_*(a-d),y=s+_*(l-e);return[x,w,C,y]}function rh(d,e){const r=d.length,s=[];for(let a=2;a4){const f=this.getTensionPoints(),m=f.length;for(c=l?0:4,l||e.quadraticCurveTo(f[0],f[1],f[2],f[3]);c{let m,_;const w=f/2;m=0;for(let C=0;C<20;C++)_=w*d.tValues[20][C]+w,m+=d.cValues[20][C]*s(h,c,_);return w*m};d.getCubicArcLength=e;const r=(h,c,f)=>{f===void 0&&(f=1);const m=h[0]-2*h[1]+h[2],_=c[0]-2*c[1]+c[2],x=2*h[1]-2*h[0],w=2*c[1]-2*c[0],C=4*(m*m+_*_),y=4*(m*x+_*w),P=x*x+w*w;if(C===0)return f*Math.sqrt(Math.pow(h[2]-h[0],2)+Math.pow(c[2]-c[0],2));const E=y/(2*C),R=P/C,L=f+E,p=R-E*E,v=L*L+p>0?Math.sqrt(L*L+p):0,k=E*E+p>0?Math.sqrt(E*E+p):0,M=E+Math.sqrt(E*E+p)!==0?p*Math.log(Math.abs((L+v)/(E+k))):0;return Math.sqrt(C)/2*(L*v-E*k+M)};d.getQuadraticArcLength=r;function s(h,c,f){const m=a(1,f,h),_=a(1,f,c),x=m*m+_*_;return Math.sqrt(x)}const a=(h,c,f)=>{const m=f.length-1;let _,x;if(m===0)return 0;if(h===0){x=0;for(let w=0;w<=m;w++)x+=d.binomialCoefficients[m][w]*Math.pow(1-c,m-w)*Math.pow(c,w)*f[w];return x}else{_=new Array(m);for(let w=0;w{let m=1,_=h/c,x=(h-f(_))/c,w=0;for(;m>.001;){const C=f(_+x),y=Math.abs(h-C)/c;if(y500)break}return _};d.t2length=l})(Wh);Object.defineProperty(kr,"__esModule",{value:!0});kr.Path=void 0;const hf=ht,cf=lt,df=Kt,yr=Wh;class jt extends df.Shape{constructor(e){super(e),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=jt.parsePathData(this.data()),this.pathLength=jt.getPathLength(this.dataArray)}_sceneFunc(e){const r=this.dataArray;e.beginPath();let s=!1;for(let a=0;a_?m:_,E=m>_?1:m/_,R=m>_?_/m:1;e.translate(c,f),e.rotate(C),e.scale(E,R),e.arc(0,0,P,x,x+w,1-y),e.scale(1/E,1/R),e.rotate(-C),e.translate(-c,-f);break;case"z":s=!0,e.closePath();break}}!s&&!this.hasFill()?e.strokeShape(this):e.fillStrokeShape(this)}getSelfRect(){let e=[];this.dataArray.forEach(function(f){if(f.command==="A"){const m=f.points[4],_=f.points[5],x=f.points[4]+_;let w=Math.PI/180;if(Math.abs(m-x)x;C-=w){const y=jt.getPointOnEllipticalArc(f.points[0],f.points[1],f.points[2],f.points[3],C,0);e.push(y.x,y.y)}else for(let C=m+w;Cr[a].pathLength;)e-=r[a].pathLength,++a;if(a===l)return s=r[a-1].points.slice(-2),{x:s[0],y:s[1]};if(e<.01)return r[a].command==="M"?(s=r[a].points.slice(0,2),{x:s[0],y:s[1]}):{x:r[a].start.x,y:r[a].start.y};const h=r[a],c=h.points;switch(h.command){case"L":return jt.getPointOnLine(e,h.start.x,h.start.y,c[0],c[1]);case"C":return jt.getPointOnCubicBezier((0,yr.t2length)(e,jt.getPathLength(r),P=>(0,yr.getCubicArcLength)([h.start.x,c[0],c[2],c[4]],[h.start.y,c[1],c[3],c[5]],P)),h.start.x,h.start.y,c[0],c[1],c[2],c[3],c[4],c[5]);case"Q":return jt.getPointOnQuadraticBezier((0,yr.t2length)(e,jt.getPathLength(r),P=>(0,yr.getQuadraticArcLength)([h.start.x,c[0],c[2]],[h.start.y,c[1],c[3]],P)),h.start.x,h.start.y,c[0],c[1],c[2],c[3]);case"A":const f=c[0],m=c[1],_=c[2],x=c[3],w=c[5],C=c[6];let y=c[4];return y+=w*e/h.pathLength,jt.getPointOnEllipticalArc(f,m,_,x,y,C)}return null}static getPointOnLine(e,r,s,a,l,h,c){h=h??r,c=c??s;const f=this.getLineLength(r,s,a,l);if(f<1e-10)return{x:r,y:s};if(a===r)return{x:h,y:c+(l>s?e:-e)};const m=(l-s)/(a-r),_=Math.sqrt(e*e/(1+m*m))*(a0&&!isNaN(y[0]);){let P="",E=[];const R=c,L=f;let p,v,k,M,I,T,U,b,z,B;switch(C){case"l":c+=y.shift(),f+=y.shift(),P="L",E.push(c,f);break;case"L":c=y.shift(),f=y.shift(),E.push(c,f);break;case"m":const W=y.shift(),Z=y.shift();if(c+=W,f+=Z,P="M",l.length>2&&l[l.length-1].command==="z"){for(let j=l.length-2;j>=0;j--)if(l[j].command==="M"){c=l[j].points[0]+W,f=l[j].points[1]+Z;break}}E.push(c,f),C="l";break;case"M":c=y.shift(),f=y.shift(),P="M",E.push(c,f),C="L";break;case"h":c+=y.shift(),P="L",E.push(c,f);break;case"H":c=y.shift(),P="L",E.push(c,f);break;case"v":f+=y.shift(),P="L",E.push(c,f);break;case"V":f=y.shift(),P="L",E.push(c,f);break;case"C":E.push(y.shift(),y.shift(),y.shift(),y.shift()),c=y.shift(),f=y.shift(),E.push(c,f);break;case"c":E.push(c+y.shift(),f+y.shift(),c+y.shift(),f+y.shift()),c+=y.shift(),f+=y.shift(),P="C",E.push(c,f);break;case"S":v=c,k=f,p=l[l.length-1],p.command==="C"&&(v=c+(c-p.points[2]),k=f+(f-p.points[3])),E.push(v,k,y.shift(),y.shift()),c=y.shift(),f=y.shift(),P="C",E.push(c,f);break;case"s":v=c,k=f,p=l[l.length-1],p.command==="C"&&(v=c+(c-p.points[2]),k=f+(f-p.points[3])),E.push(v,k,c+y.shift(),f+y.shift()),c+=y.shift(),f+=y.shift(),P="C",E.push(c,f);break;case"Q":E.push(y.shift(),y.shift()),c=y.shift(),f=y.shift(),E.push(c,f);break;case"q":E.push(c+y.shift(),f+y.shift()),c+=y.shift(),f+=y.shift(),P="Q",E.push(c,f);break;case"T":v=c,k=f,p=l[l.length-1],p.command==="Q"&&(v=c+(c-p.points[0]),k=f+(f-p.points[1])),c=y.shift(),f=y.shift(),P="Q",E.push(v,k,c,f);break;case"t":v=c,k=f,p=l[l.length-1],p.command==="Q"&&(v=c+(c-p.points[0]),k=f+(f-p.points[1])),c+=y.shift(),f+=y.shift(),P="Q",E.push(v,k,c,f);break;case"A":M=y.shift(),I=y.shift(),T=y.shift(),U=y.shift(),b=y.shift(),z=c,B=f,c=y.shift(),f=y.shift(),P="A",E=this.convertEndpointToCenterParameterization(z,B,c,f,U,b,M,I,T);break;case"a":M=y.shift(),I=y.shift(),T=y.shift(),U=y.shift(),b=y.shift(),z=c,B=f,c+=y.shift(),f+=y.shift(),P="A",E=this.convertEndpointToCenterParameterization(z,B,c,f,U,b,M,I,T);break}l.push({command:P||C,points:E,start:{x:R,y:L},pathLength:this.calcLength(R,L,P||C,E)})}(C==="z"||C==="Z")&&l.push({command:"z",points:[],start:void 0,pathLength:0})}return l}static calcLength(e,r,s,a){let l,h,c,f;const m=jt;switch(s){case"L":return m.getLineLength(e,r,a[0],a[1]);case"C":return(0,yr.getCubicArcLength)([e,a[0],a[2],a[4]],[r,a[1],a[3],a[5]],1);case"Q":return(0,yr.getQuadraticArcLength)([e,a[0],a[2]],[r,a[1],a[3]],1);case"A":l=0;const _=a[4],x=a[5],w=a[4]+x;let C=Math.PI/180;if(Math.abs(_-w)w;f-=C)c=m.getPointOnEllipticalArc(a[0],a[1],a[2],a[3],f,0),l+=m.getLineLength(h.x,h.y,c.x,c.y),h=c;else for(f=_+C;f1&&(c*=Math.sqrt(C),f*=Math.sqrt(C));let y=Math.sqrt((c*c*(f*f)-c*c*(w*w)-f*f*(x*x))/(c*c*(w*w)+f*f*(x*x)));l===h&&(y*=-1),isNaN(y)&&(y=0);const P=y*c*w/f,E=y*-f*x/c,R=(e+s)/2+Math.cos(_)*P-Math.sin(_)*E,L=(r+a)/2+Math.sin(_)*P+Math.cos(_)*E,p=function(b){return Math.sqrt(b[0]*b[0]+b[1]*b[1])},v=function(b,z){return(b[0]*z[0]+b[1]*z[1])/(p(b)*p(z))},k=function(b,z){return(b[0]*z[1]=1&&(U=0),h===0&&U>0&&(U=U-2*Math.PI),h===1&&U<0&&(U=U+2*Math.PI),[R,L,c,f,M,U,_,h]}}kr.Path=jt;jt.prototype.className="Path";jt.prototype._attrsAffectingSize=["data"];(0,cf._registerNode)(jt);hf.Factory.addGetterSetter(jt,"data");Object.defineProperty(Cs,"__esModule",{value:!0});Cs.Arrow=void 0;const xs=ht,ff=si,jh=et,gf=lt,ih=kr;class Xn extends ff.Line{_sceneFunc(e){super._sceneFunc(e);const r=Math.PI*2,s=this.points();let a=s;const l=this.tension()!==0&&s.length>4;l&&(a=this.getTensionPoints());const h=this.pointerLength(),c=s.length;let f,m;if(l){const w=[a[a.length-4],a[a.length-3],a[a.length-2],a[a.length-1],s[c-2],s[c-1]],C=ih.Path.calcLength(a[a.length-4],a[a.length-3],"C",w),y=ih.Path.getPointOnQuadraticBezier(Math.min(1,1-h/C),w[0],w[1],w[2],w[3],w[4],w[5]);f=s[c-2]-y.x,m=s[c-1]-y.y}else f=s[c-2]-s[c-4],m=s[c-1]-s[c-3];const _=(Math.atan2(m,f)+r)%r,x=this.pointerWidth();this.pointerAtEnding()&&(e.save(),e.beginPath(),e.translate(s[c-2],s[c-1]),e.rotate(_),e.moveTo(0,0),e.lineTo(-h,x/2),e.lineTo(-h,-x/2),e.closePath(),e.restore(),this.__fillStroke(e)),this.pointerAtBeginning()&&(e.save(),e.beginPath(),e.translate(s[0],s[1]),l?(f=(a[0]+a[2])/2-s[0],m=(a[1]+a[3])/2-s[1]):(f=s[2]-s[0],m=s[3]-s[1]),e.rotate((Math.atan2(-m,-f)+r)%r),e.moveTo(0,0),e.lineTo(-h,x/2),e.lineTo(-h,-x/2),e.closePath(),e.restore(),this.__fillStroke(e))}__fillStroke(e){const r=this.dashEnabled();r&&(this.attrs.dashEnabled=!1,e.setLineDash([])),e.fillStrokeShape(this),r&&(this.attrs.dashEnabled=!0)}getSelfRect(){const e=super.getSelfRect(),r=this.pointerWidth()/2;return{x:e.x,y:e.y-r,width:e.width,height:e.height+r*2}}}Cs.Arrow=Xn;Xn.prototype.className="Arrow";(0,gf._registerNode)(Xn);xs.Factory.addGetterSetter(Xn,"pointerLength",10,(0,jh.getNumberValidator)());xs.Factory.addGetterSetter(Xn,"pointerWidth",10,(0,jh.getNumberValidator)());xs.Factory.addGetterSetter(Xn,"pointerAtBeginning",!1);xs.Factory.addGetterSetter(Xn,"pointerAtEnding",!0);var Ps={};Object.defineProperty(Ps,"__esModule",{value:!0});Ps.Circle=void 0;const pf=ht,mf=Kt,yf=et,_f=lt;class Tr extends mf.Shape{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius()!==e/2&&this.radius(e/2)}setHeight(e){this.radius()!==e/2&&this.radius(e/2)}}Ps.Circle=Tr;Tr.prototype._centroid=!0;Tr.prototype.className="Circle";Tr.prototype._attrsAffectingSize=["radius"];(0,_f._registerNode)(Tr);pf.Factory.addGetterSetter(Tr,"radius",0,(0,yf.getNumberValidator)());var Es={};Object.defineProperty(Es,"__esModule",{value:!0});Es.Ellipse=void 0;const Xo=ht,vf=Kt,Kh=et,Sf=lt;class Rn extends vf.Shape{_sceneFunc(e){const r=this.radiusX(),s=this.radiusY();e.beginPath(),e.save(),r!==s&&e.scale(1,s/r),e.arc(0,0,r,0,Math.PI*2,!1),e.restore(),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(e){this.radiusX(e/2)}setHeight(e){this.radiusY(e/2)}}Es.Ellipse=Rn;Rn.prototype.className="Ellipse";Rn.prototype._centroid=!0;Rn.prototype._attrsAffectingSize=["radiusX","radiusY"];(0,Sf._registerNode)(Rn);Xo.Factory.addComponentsGetterSetter(Rn,"radius",["x","y"]);Xo.Factory.addGetterSetter(Rn,"radiusX",0,(0,Kh.getNumberValidator)());Xo.Factory.addGetterSetter(Rn,"radiusY",0,(0,Kh.getNumberValidator)());var ks={};Object.defineProperty(ks,"__esModule",{value:!0});ks.Image=void 0;const Po=Gt,qn=ht,Cf=Kt,wf=lt,ai=et;let Xe=class Yh extends Cf.Shape{constructor(e){super(e),this._loadListener=()=>{this._requestDraw()},this.on("imageChange.konva",r=>{this._removeImageLoad(r.oldVal),this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const e=this.image();e&&e.complete||e&&e.readyState===4||e&&e.addEventListener&&e.addEventListener("load",this._loadListener)}_removeImageLoad(e){e&&e.removeEventListener&&e.removeEventListener("load",this._loadListener)}destroy(){return this._removeImageLoad(this.image()),super.destroy(),this}_useBufferCanvas(){const e=!!this.cornerRadius(),r=this.hasShadow();return e&&r?!0:super._useBufferCanvas(!0)}_sceneFunc(e){const r=this.getWidth(),s=this.getHeight(),a=this.cornerRadius(),l=this.attrs.image;let h;if(l){const c=this.attrs.cropWidth,f=this.attrs.cropHeight;c&&f?h=[l,this.cropX(),this.cropY(),c,f,0,0,r,s]:h=[l,0,0,r,s]}(this.hasFill()||this.hasStroke()||a)&&(e.beginPath(),a?Po.Util.drawRoundedRectPath(e,r,s,a):e.rect(0,0,r,s),e.closePath(),e.fillStrokeShape(this)),l&&(a&&e.clip(),e.drawImage.apply(e,h))}_hitFunc(e){const r=this.width(),s=this.height(),a=this.cornerRadius();e.beginPath(),a?Po.Util.drawRoundedRectPath(e,r,s,a):e.rect(0,0,r,s),e.closePath(),e.fillStrokeShape(this)}getWidth(){var e,r;return(e=this.attrs.width)!==null&&e!==void 0?e:(r=this.image())===null||r===void 0?void 0:r.width}getHeight(){var e,r;return(e=this.attrs.height)!==null&&e!==void 0?e:(r=this.image())===null||r===void 0?void 0:r.height}static fromURL(e,r,s=null){const a=Po.Util.createImageElement();a.onload=function(){const l=new Yh({image:a});r(l)},a.onerror=s,a.crossOrigin="Anonymous",a.src=e}};ks.Image=Xe;Xe.prototype.className="Image";(0,wf._registerNode)(Xe);qn.Factory.addGetterSetter(Xe,"cornerRadius",0,(0,ai.getNumberOrArrayOfNumbersValidator)(4));qn.Factory.addGetterSetter(Xe,"image");qn.Factory.addComponentsGetterSetter(Xe,"crop",["x","y","width","height"]);qn.Factory.addGetterSetter(Xe,"cropX",0,(0,ai.getNumberValidator)());qn.Factory.addGetterSetter(Xe,"cropY",0,(0,ai.getNumberValidator)());qn.Factory.addGetterSetter(Xe,"cropWidth",0,(0,ai.getNumberValidator)());qn.Factory.addGetterSetter(Xe,"cropHeight",0,(0,ai.getNumberValidator)());var vr={};Object.defineProperty(vr,"__esModule",{value:!0});vr.Tag=vr.Label=void 0;const Ts=ht,xf=Kt,Pf=Pr,qo=et,Xh=lt,qh=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],Ef="Change.konva",kf="none",bo="up",Oo="right",Do="down",Go="left",Tf=qh.length;class Qo extends Pf.Group{constructor(e){super(e),this.on("add.konva",function(r){this._addListeners(r.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(e){let r=this,s;const a=function(){r._sync()};for(s=0;s{r=Math.min(r,h.x),s=Math.max(s,h.x),a=Math.min(a,h.y),l=Math.max(l,h.y)}),{x:r,y:a,width:s-r,height:l-a}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}Rs.RegularPolygon=Jn;Jn.prototype.className="RegularPolygon";Jn.prototype._centroid=!0;Jn.prototype._attrsAffectingSize=["radius"];(0,bf._registerNode)(Jn);Qh.Factory.addGetterSetter(Jn,"radius",0,(0,Jh.getNumberValidator)());Qh.Factory.addGetterSetter(Jn,"sides",0,(0,Jh.getNumberValidator)());var Fs={};Object.defineProperty(Fs,"__esModule",{value:!0});Fs.Ring=void 0;const Zh=ht,Of=Kt,$h=et,Df=lt,sh=Math.PI*2;class Zn extends Of.Shape{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.innerRadius(),0,sh,!1),e.moveTo(this.outerRadius(),0),e.arc(0,0,this.outerRadius(),sh,0,!0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}}Fs.Ring=Zn;Zn.prototype.className="Ring";Zn.prototype._centroid=!0;Zn.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,Df._registerNode)(Zn);Zh.Factory.addGetterSetter(Zn,"innerRadius",0,(0,$h.getNumberValidator)());Zh.Factory.addGetterSetter(Zn,"outerRadius",0,(0,$h.getNumberValidator)());var As={};Object.defineProperty(As,"__esModule",{value:!0});As.Sprite=void 0;const $n=ht,Gf=Kt,If=Er,tc=et,Uf=lt;class qe extends Gf.Shape{constructor(e){super(e),this._updated=!0,this.anim=new If.Animation(()=>{const r=this._updated;return this._updated=!1,r}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(e){const r=this.animation(),s=this.frameIndex(),a=s*4,l=this.animations()[r],h=this.frameOffsets(),c=l[a+0],f=l[a+1],m=l[a+2],_=l[a+3],x=this.image();if((this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,m,_),e.closePath(),e.fillStrokeShape(this)),x)if(h){const w=h[r],C=s*2;e.drawImage(x,c,f,m,_,w[C+0],w[C+1],m,_)}else e.drawImage(x,c,f,m,_,0,0,m,_)}_hitFunc(e){const r=this.animation(),s=this.frameIndex(),a=s*4,l=this.animations()[r],h=this.frameOffsets(),c=l[a+2],f=l[a+3];if(e.beginPath(),h){const m=h[r],_=s*2;e.rect(m[_+0],m[_+1],c,f)}else e.rect(0,0,c,f);e.closePath(),e.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){const e=this;this.interval=setInterval(function(){e._updateIndex()},1e3/this.frameRate())}start(){if(this.isRunning())return;const e=this.getLayer();this.anim.setLayers(e),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){const e=this.frameIndex(),r=this.animation(),s=this.animations(),a=s[r],l=a.length/4;e{if(new RegExp("\\p{Emoji}","u").test(r)){const l=a[s+1];l&&new RegExp("\\p{Emoji_Modifier}|\\u200D","u").test(l)?(e.push(r+l),a[s+1]=""):e.push(r)}else new RegExp("\\p{Regional_Indicator}{2}","u").test(r+(a[s+1]||""))?e.push(r+a[s+1]):s>0&&new RegExp("\\p{Mn}|\\p{Me}|\\p{Mc}","u").test(r)?e[e.length-1]+=r:r&&e.push(r);return e},[])}const _r="auto",Wf="center",ec="inherit",Qr="justify",jf="Change.konva",Kf="2d",ah="-",nc="left",Yf="text",Xf="Text",qf="top",Qf="bottom",oh="middle",rc="normal",Jf="px ",ns=" ",Zf="right",lh="rtl",$f="word",t1="char",uh="none",ko="…",ic=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],e1=ic.length;function n1(d){return d.split(",").map(e=>{e=e.trim();const r=e.indexOf(" ")>=0,s=e.indexOf('"')>=0||e.indexOf("'")>=0;return r&&!s&&(e=`"${e}"`),e}).join(", ")}let rs;function To(){return rs||(rs=Io.Util.createCanvasElement().getContext(Kf),rs)}function r1(d){d.fillText(this._partialText,this._partialTextX,this._partialTextY)}function i1(d){d.setAttr("miterLimit",2),d.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function s1(d){return d=d||{},!d.fillLinearGradientColorStops&&!d.fillRadialGradientColorStops&&!d.fillPatternImage&&(d.fill=d.fill||"black"),d}let Ut=class extends Vf.Shape{constructor(e){super(s1(e)),this._partialTextX=0,this._partialTextY=0;for(let r=0;r1&&(L+=h)}}_hitFunc(e){const r=this.getWidth(),s=this.getHeight();e.beginPath(),e.rect(0,0,r,s),e.closePath(),e.fillStrokeShape(this)}setText(e){const r=Io.Util._isString(e)?e:e==null?"":e+"";return this._setAttr(Yf,r),this}getWidth(){return this.attrs.width===_r||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===_r||this.attrs.height===void 0?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return Io.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(e){var r,s,a,l,h,c,f,m,_,x,w;let C=To(),y=this.fontSize(),P;C.save(),C.font=this._getContextFont(),P=C.measureText(e),C.restore();const E=y/100;return{actualBoundingBoxAscent:(r=P.actualBoundingBoxAscent)!==null&&r!==void 0?r:71.58203125*E,actualBoundingBoxDescent:(s=P.actualBoundingBoxDescent)!==null&&s!==void 0?s:0,actualBoundingBoxLeft:(a=P.actualBoundingBoxLeft)!==null&&a!==void 0?a:-7.421875*E,actualBoundingBoxRight:(l=P.actualBoundingBoxRight)!==null&&l!==void 0?l:75.732421875*E,alphabeticBaseline:(h=P.alphabeticBaseline)!==null&&h!==void 0?h:0,emHeightAscent:(c=P.emHeightAscent)!==null&&c!==void 0?c:100*E,emHeightDescent:(f=P.emHeightDescent)!==null&&f!==void 0?f:-20*E,fontBoundingBoxAscent:(m=P.fontBoundingBoxAscent)!==null&&m!==void 0?m:91*E,fontBoundingBoxDescent:(_=P.fontBoundingBoxDescent)!==null&&_!==void 0?_:21*E,hangingBaseline:(x=P.hangingBaseline)!==null&&x!==void 0?x:72.80000305175781*E,ideographicBaseline:(w=P.ideographicBaseline)!==null&&w!==void 0?w:-21*E,width:P.width,height:y}}_getContextFont(){return this.fontStyle()+ns+this.fontVariant()+ns+(this.fontSize()+Jf)+n1(this.fontFamily())}_addTextLine(e){this.align()===Qr&&(e=e.trim());const s=this._getTextWidth(e);return this.textArr.push({text:e,width:s,lastInParagraph:!1})}_getTextWidth(e){const r=this.letterSpacing(),s=e.length;return To().measureText(e).width+r*s}_setTextData(){let e=this.text().split(`
+`),r=+this.fontSize(),s=0,a=this.lineHeight()*r,l=this.attrs.width,h=this.attrs.height,c=l!==_r&&l!==void 0,f=h!==_r&&h!==void 0,m=this.padding(),_=l-m*2,x=h-m*2,w=0,C=this.wrap(),y=C!==uh,P=C!==t1&&y,E=this.ellipsis();this.textArr=[],To().font=this._getContextFont();const R=E?this._getTextWidth(ko):0;for(let L=0,p=e.length;L_)for(;v.length>0;){let M=0,I=jn(v).length,T="",U=0;for(;M>>1,z=jn(v),B=z.slice(0,b+1).join(""),W=this._getTextWidth(B);(E&&f&&w+a>x?W+R:W)<=_?(M=b+1,T=B,U=W):I=b}if(T){if(P){const B=jn(v),W=jn(T),Z=B[W.length],j=Z===ns||Z===ah;let _t;if(j&&U<=_)_t=W.length;else{const St=W.lastIndexOf(ns),tt=W.lastIndexOf(ah);_t=Math.max(St,tt)+1}_t>0&&(M=_t,T=B.slice(0,M).join(""),U=this._getTextWidth(T))}if(T=T.trimRight(),this._addTextLine(T),s=Math.max(s,U),w+=a,this._shouldHandleEllipsis(w)){this._tryToAddEllipsisToLastLine();break}if(v=jn(v).slice(M).join("").trimLeft(),v.length>0&&(k=this._getTextWidth(v),k<=_)){this._addTextLine(v),w+=a,s=Math.max(s,k);break}}else break}else this._addTextLine(v),w+=a,s=Math.max(s,k),this._shouldHandleEllipsis(w)&&Lx)break}this.textHeight=r,this.textWidth=s}_shouldHandleEllipsis(e){const r=+this.fontSize(),s=this.lineHeight()*r,a=this.attrs.height,l=a!==_r&&a!==void 0,h=this.padding(),c=a-h*2;return!(this.wrap()!==uh)||l&&e+s>c}_tryToAddEllipsisToLastLine(){const e=this.attrs.width,r=e!==_r&&e!==void 0,s=this.padding(),a=e-s*2,l=this.ellipsis(),h=this.textArr[this.textArr.length-1];!h||!l||(r&&(this._getTextWidth(h.text+ko)r?null:Jr.Path.getPointAtLengthOfDataArray(e,this.dataArray)}_readDataAttribute(){this.dataArray=Jr.Path.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(e){e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",this.textBaseline()),e.setAttr("textAlign","left"),e.save();const r=this.textDecoration(),s=this.fill(),a=this.fontSize(),l=this.glyphInfo;r==="underline"&&e.beginPath();for(let h=0;h=1){const s=r[0].p0;e.moveTo(s.x,s.y)}for(let s=0;sd+`.${uc}`).join(" "),dh="nodesRect",f1=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],g1={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},p1="ontouchstart"in Oe.Konva._global;function m1(d,e,r){if(d==="rotater")return r;e+=wt.Util.degToRad(g1[d]||0);const s=(wt.Util.radToDeg(e)%360+360)%360;return wt.Util._inRange(s,315+22.5,360)||wt.Util._inRange(s,0,22.5)?"ns-resize":wt.Util._inRange(s,45-22.5,45+22.5)?"nesw-resize":wt.Util._inRange(s,90-22.5,90+22.5)?"ew-resize":wt.Util._inRange(s,135-22.5,135+22.5)?"nwse-resize":wt.Util._inRange(s,180-22.5,180+22.5)?"ns-resize":wt.Util._inRange(s,225-22.5,225+22.5)?"nesw-resize":wt.Util._inRange(s,270-22.5,270+22.5)?"ew-resize":wt.Util._inRange(s,315-22.5,315+22.5)?"nwse-resize":(wt.Util.error("Transformer has unknown angle for cursor detection: "+s),"pointer")}const hs=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function y1(d){return{x:d.x+d.width/2*Math.cos(d.rotation)+d.height/2*Math.sin(-d.rotation),y:d.y+d.height/2*Math.cos(d.rotation)+d.width/2*Math.sin(d.rotation)}}function hc(d,e,r){const s=r.x+(d.x-r.x)*Math.cos(e)-(d.y-r.y)*Math.sin(e),a=r.y+(d.x-r.x)*Math.sin(e)+(d.y-r.y)*Math.cos(e);return{...d,rotation:d.rotation+e,x:s,y:a}}function _1(d,e){const r=y1(d);return hc(d,e,r)}function v1(d,e,r){let s=e;for(let a=0;aa.isAncestorOf(this)?(wt.Util.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);return this._nodes=e=r,e.length===1&&this.useSingleNodeRotation()?this.rotation(e[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(a=>{const l=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()};if(a._attrsAffectingSize.length){const h=a._attrsAffectingSize.map(c=>c+"Change."+this._getEventNamespace()).join(" ");a.on(h,l)}a.on(f1.map(h=>h+`.${this._getEventNamespace()}`).join(" "),l),a.on(`absoluteTransformChange.${this._getEventNamespace()}`,l),this._proxyDrag(a)}),this._resetTransformCache(),!!this.findOne(".top-left")&&this.update(),this}_proxyDrag(e){let r;e.on(`dragstart.${this._getEventNamespace()}`,s=>{r=e.getAbsolutePosition(),!this.isDragging()&&e!==this.findOne(".back")&&this.startDrag(s,!1)}),e.on(`dragmove.${this._getEventNamespace()}`,s=>{if(!r)return;const a=e.getAbsolutePosition(),l=a.x-r.x,h=a.y-r.y;this.nodes().forEach(c=>{if(c===e||c.isDragging())return;const f=c.getAbsolutePosition();c.setAbsolutePosition({x:f.x+l,y:f.y+h}),c.startDrag(s)}),r=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(e=>{e.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(dh),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(dh,this.__getNodeRect)}__getNodeShape(e,r=this.rotation(),s){const a=e.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),l=e.getAbsoluteScale(s),h=e.getAbsolutePosition(s),c=a.x*l.x-e.offsetX()*l.x,f=a.y*l.y-e.offsetY()*l.y,m=(Oe.Konva.getAngle(e.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),_={x:h.x+c*Math.cos(m)+f*Math.sin(-m),y:h.y+f*Math.cos(m)+c*Math.sin(m),width:a.width*l.x,height:a.height*l.y,rotation:m};return hc(_,-Oe.Konva.getAngle(r),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const r=[];this.nodes().map(m=>{const _=m.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),x=[{x:_.x,y:_.y},{x:_.x+_.width,y:_.y},{x:_.x+_.width,y:_.y+_.height},{x:_.x,y:_.y+_.height}],w=m.getAbsoluteTransform();x.forEach(function(C){const y=w.point(C);r.push(y)})});const s=new wt.Transform;s.rotate(-Oe.Konva.getAngle(this.rotation()));let a=1/0,l=1/0,h=-1/0,c=-1/0;r.forEach(function(m){const _=s.point(m);a===void 0&&(a=h=_.x,l=c=_.y),a=Math.min(a,_.x),l=Math.min(l,_.y),h=Math.max(h,_.x),c=Math.max(c,_.y)}),s.invert();const f=s.point({x:a,y:l});return{x:f.x,y:f.y,width:h-a,height:c-l,rotation:Oe.Konva.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),hs.forEach(e=>{this._createAnchor(e)}),this._createAnchor("rotater")}_createAnchor(e){const r=new h1.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:e+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:p1?10:"auto"}),s=this;r.on("mousedown touchstart",function(a){s._handleMouseDown(a)}),r.on("dragstart",a=>{r.stopDrag(),a.cancelBubble=!0}),r.on("dragend",a=>{a.cancelBubble=!0}),r.on("mouseenter",()=>{const a=Oe.Konva.getAngle(this.rotation()),l=this.rotateAnchorCursor(),h=m1(e,a,l);r.getStage().content&&(r.getStage().content.style.cursor=h),this._cursorChange=!0}),r.on("mouseout",()=>{r.getStage().content&&(r.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(r)}_createBack(){const e=new u1.Shape({name:"back",width:0,height:0,draggable:!0,sceneFunc(r,s){const a=s.getParent(),l=a.padding();r.beginPath(),r.rect(-l,-l,s.width()+l*2,s.height()+l*2),r.moveTo(s.width()/2,-l),a.rotateEnabled()&&a.rotateLineVisible()&&r.lineTo(s.width()/2,-a.rotateAnchorOffset()*wt.Util._sign(s.height())-l),r.fillStrokeShape(s)},hitFunc:(r,s)=>{if(!this.shouldOverdrawWholeArea())return;const a=this.padding();r.beginPath(),r.rect(-a,-a,s.width()+a*2,s.height()+a*2),r.fillStrokeShape(s)}});this.add(e),this._proxyDrag(e),e.on("dragstart",r=>{r.cancelBubble=!0}),e.on("dragmove",r=>{r.cancelBubble=!0}),e.on("dragend",r=>{r.cancelBubble=!0}),this.on("dragmove",r=>{this.update()})}_handleMouseDown(e){if(this._transforming)return;this._movingAnchorName=e.target.name().split(" ")[0];const r=this._getNodeRect(),s=r.width,a=r.height,l=Math.sqrt(Math.pow(s,2)+Math.pow(a,2));this.sin=Math.abs(a/l),this.cos=Math.abs(s/l),typeof window<"u"&&(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;const h=e.target.getAbsolutePosition(),c=e.target.getStage().getPointerPosition();this._anchorDragOffset={x:c.x-h.x,y:c.y-h.y},Uo++,this._fire("transformstart",{evt:e.evt,target:this.getNode()}),this._nodes.forEach(f=>{f._fire("transformstart",{evt:e.evt,target:f})})}_handleMouseMove(e){let r,s,a;const l=this.findOne("."+this._movingAnchorName),h=l.getStage();h.setPointersPositions(e);const c=h.getPointerPosition();let f={x:c.x-this._anchorDragOffset.x,y:c.y-this._anchorDragOffset.y};const m=l.getAbsolutePosition();this.anchorDragBoundFunc()&&(f=this.anchorDragBoundFunc()(m,f,e)),l.setAbsolutePosition(f);const _=l.getAbsolutePosition();if(m.x===_.x&&m.y===_.y)return;if(this._movingAnchorName==="rotater"){const L=this._getNodeRect();r=l.x()-L.width/2,s=-l.y()+L.height/2;let p=Math.atan2(-s,r)+Math.PI/2;L.height<0&&(p-=Math.PI);const k=Oe.Konva.getAngle(this.rotation())+p,M=Oe.Konva.getAngle(this.rotationSnapTolerance()),T=v1(this.rotationSnaps(),k,M)-L.rotation,U=_1(L,T);this._fitNodesInto(U,e);return}const x=this.shiftBehavior();let w;x==="inverted"?w=this.keepRatio()&&!e.shiftKey:x==="none"?w=this.keepRatio():w=this.keepRatio()||e.shiftKey;let C=this.centeredScaling()||e.altKey;if(this._movingAnchorName==="top-left"){if(w){const L=C?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};a=Math.sqrt(Math.pow(L.x-l.x(),2)+Math.pow(L.y-l.y(),2));const p=this.findOne(".top-left").x()>L.x?-1:1,v=this.findOne(".top-left").y()>L.y?-1:1;r=a*this.cos*p,s=a*this.sin*v,this.findOne(".top-left").x(L.x-r),this.findOne(".top-left").y(L.y-s)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(l.y());else if(this._movingAnchorName==="top-right"){if(w){const L=C?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};a=Math.sqrt(Math.pow(l.x()-L.x,2)+Math.pow(L.y-l.y(),2));const p=this.findOne(".top-right").x()L.y?-1:1;r=a*this.cos*p,s=a*this.sin*v,this.findOne(".top-right").x(L.x+r),this.findOne(".top-right").y(L.y-s)}var y=l.position();this.findOne(".top-left").y(y.y),this.findOne(".bottom-right").x(y.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(l.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(l.x());else if(this._movingAnchorName==="bottom-left"){if(w){const L=C?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};a=Math.sqrt(Math.pow(L.x-l.x(),2)+Math.pow(l.y()-L.y,2));const p=L.x{var l;a._fire("transformend",{evt:e,target:a}),(l=a.getLayer())===null||l===void 0||l.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(e,r){const s=this._getNodeRect(),a=1;if(wt.Util._inRange(e.width,-this.padding()*2-a,a)){this.update();return}if(wt.Util._inRange(e.height,-this.padding()*2-a,a)){this.update();return}const l=new wt.Transform;if(l.rotate(Oe.Konva.getAngle(this.rotation())),this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("left")>=0){const w=l.point({x:-this.padding()*2,y:0});e.x+=w.x,e.y+=w.y,e.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=w.x,this._anchorDragOffset.y-=w.y}else if(this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("right")>=0){const w=l.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=w.x,this._anchorDragOffset.y-=w.y,e.width+=this.padding()*2}if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("top")>=0){const w=l.point({x:0,y:-this.padding()*2});e.x+=w.x,e.y+=w.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=w.x,this._anchorDragOffset.y-=w.y,e.height+=this.padding()*2}else if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const w=l.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=w.x,this._anchorDragOffset.y-=w.y,e.height+=this.padding()*2}if(this.boundBoxFunc()){const w=this.boundBoxFunc()(s,e);w?e=w:wt.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const h=1e7,c=new wt.Transform;c.translate(s.x,s.y),c.rotate(s.rotation),c.scale(s.width/h,s.height/h);const f=new wt.Transform,m=e.width/h,_=e.height/h;this.flipEnabled()===!1?(f.translate(e.x,e.y),f.rotate(e.rotation),f.translate(e.width<0?e.width:0,e.height<0?e.height:0),f.scale(Math.abs(m),Math.abs(_))):(f.translate(e.x,e.y),f.rotate(e.rotation),f.scale(m,_));const x=f.multiply(c.invert());this._nodes.forEach(w=>{var C;const y=w.getParent().getAbsoluteTransform(),P=w.getTransform().copy();P.translate(w.offsetX(),w.offsetY());const E=new wt.Transform;E.multiply(y.copy().invert()).multiply(x).multiply(y).multiply(P);const R=E.decompose();w.setAttrs(R),(C=w.getLayer())===null||C===void 0||C.batchDraw()}),this.rotation(wt.Util._getRotation(e.rotation)),this._nodes.forEach(w=>{this._fire("transform",{evt:r,target:w}),w._fire("transform",{evt:r,target:w})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(e,r){this.findOne(e).setAttrs(r)}update(){var e;const r=this._getNodeRect();this.rotation(wt.Util._getRotation(r.rotation));const s=r.width,a=r.height,l=this.enabledAnchors(),h=this.resizeEnabled(),c=this.padding(),f=this.anchorSize(),m=this.find("._anchor");m.forEach(x=>{x.setAttrs({width:f,height:f,offsetX:f/2,offsetY:f/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:f/2+c,offsetY:f/2+c,visible:h&&l.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:s/2,y:0,offsetY:f/2+c,visible:h&&l.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:s,y:0,offsetX:f/2-c,offsetY:f/2+c,visible:h&&l.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:a/2,offsetX:f/2+c,visible:h&&l.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:s,y:a/2,offsetX:f/2-c,visible:h&&l.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:a,offsetX:f/2+c,offsetY:f/2-c,visible:h&&l.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:s/2,y:a,offsetY:f/2-c,visible:h&&l.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:s,y:a,offsetX:f/2-c,offsetY:f/2-c,visible:h&&l.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:s/2,y:-this.rotateAnchorOffset()*wt.Util._sign(a)-c,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:s,height:a,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0});const _=this.anchorStyleFunc();_&&m.forEach(x=>{_(x)}),(e=this.getLayer())===null||e===void 0||e.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();const e=this.findOne("."+this._movingAnchorName);e&&e.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),ch.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return hh.Node.prototype.toObject.call(this)}clone(e){return hh.Node.prototype.clone.call(this,e)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};bs.Transformer=ft;ft.isTransforming=()=>Uo>0;function S1(d){return d instanceof Array||wt.Util.warn("enabledAnchors value should be an array"),d instanceof Array&&d.forEach(function(e){hs.indexOf(e)===-1&&wt.Util.warn("Unknown anchor name: "+e+". Available names are: "+hs.join(", "))}),d||[]}ft.prototype.className="Transformer";(0,c1._registerNode)(ft);vt.Factory.addGetterSetter(ft,"enabledAnchors",hs,S1);vt.Factory.addGetterSetter(ft,"flipEnabled",!0,(0,Mn.getBooleanValidator)());vt.Factory.addGetterSetter(ft,"resizeEnabled",!0);vt.Factory.addGetterSetter(ft,"anchorSize",10,(0,Mn.getNumberValidator)());vt.Factory.addGetterSetter(ft,"rotateEnabled",!0);vt.Factory.addGetterSetter(ft,"rotateLineVisible",!0);vt.Factory.addGetterSetter(ft,"rotationSnaps",[]);vt.Factory.addGetterSetter(ft,"rotateAnchorOffset",50,(0,Mn.getNumberValidator)());vt.Factory.addGetterSetter(ft,"rotateAnchorCursor","crosshair");vt.Factory.addGetterSetter(ft,"rotationSnapTolerance",5,(0,Mn.getNumberValidator)());vt.Factory.addGetterSetter(ft,"borderEnabled",!0);vt.Factory.addGetterSetter(ft,"anchorStroke","rgb(0, 161, 255)");vt.Factory.addGetterSetter(ft,"anchorStrokeWidth",1,(0,Mn.getNumberValidator)());vt.Factory.addGetterSetter(ft,"anchorFill","white");vt.Factory.addGetterSetter(ft,"anchorCornerRadius",0,(0,Mn.getNumberValidator)());vt.Factory.addGetterSetter(ft,"borderStroke","rgb(0, 161, 255)");vt.Factory.addGetterSetter(ft,"borderStrokeWidth",1,(0,Mn.getNumberValidator)());vt.Factory.addGetterSetter(ft,"borderDash");vt.Factory.addGetterSetter(ft,"keepRatio",!0);vt.Factory.addGetterSetter(ft,"shiftBehavior","default");vt.Factory.addGetterSetter(ft,"centeredScaling",!1);vt.Factory.addGetterSetter(ft,"ignoreStroke",!1);vt.Factory.addGetterSetter(ft,"padding",0,(0,Mn.getNumberValidator)());vt.Factory.addGetterSetter(ft,"nodes");vt.Factory.addGetterSetter(ft,"node");vt.Factory.addGetterSetter(ft,"boundBoxFunc");vt.Factory.addGetterSetter(ft,"anchorDragBoundFunc");vt.Factory.addGetterSetter(ft,"anchorStyleFunc");vt.Factory.addGetterSetter(ft,"shouldOverdrawWholeArea",!1);vt.Factory.addGetterSetter(ft,"useSingleNodeRotation",!0);vt.Factory.backCompat(ft,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});var Os={};Object.defineProperty(Os,"__esModule",{value:!0});Os.Wedge=void 0;const Ds=ht,C1=Kt,w1=lt,cc=et,x1=lt;class cn extends C1.Shape{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.radius(),0,w1.Konva.getAngle(this.angle()),this.clockwise()),e.lineTo(0,0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}Os.Wedge=cn;cn.prototype.className="Wedge";cn.prototype._centroid=!0;cn.prototype._attrsAffectingSize=["radius"];(0,x1._registerNode)(cn);Ds.Factory.addGetterSetter(cn,"radius",0,(0,cc.getNumberValidator)());Ds.Factory.addGetterSetter(cn,"angle",0,(0,cc.getNumberValidator)());Ds.Factory.addGetterSetter(cn,"clockwise",!1);Ds.Factory.backCompat(cn,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var Gs={};Object.defineProperty(Gs,"__esModule",{value:!0});Gs.Blur=void 0;const fh=ht,P1=bt,E1=et;function gh(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}const k1=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],T1=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function N1(d,e){const r=d.data,s=d.width,a=d.height;let l,h,c,f,m,_,x,w,C,y,P,E,R,L,p,v,k,M,I,T;const U=e+e+1,b=s-1,z=a-1,B=e+1,W=B*(B+1)/2,Z=new gh,j=k1[e],_t=T1[e];let St=null,tt=Z,gt=null,rt=null;for(let J=1;J>_t,I!==0?(I=255/I,r[h]=(f*j>>_t)*I,r[h+1]=(m*j>>_t)*I,r[h+2]=(_*j>>_t)*I):r[h]=r[h+1]=r[h+2]=0,f-=w,m-=C,_-=y,x-=P,w-=gt.r,C-=gt.g,y-=gt.b,P-=gt.a,l=c+((l=ct+e+1)>_t,I>0?(I=255/I,r[l]=(f*j>>_t)*I,r[l+1]=(m*j>>_t)*I,r[l+2]=(_*j>>_t)*I):r[l]=r[l+1]=r[l+2]=0,f-=w,m-=C,_-=y,x-=P,w-=gt.r,C-=gt.g,y-=gt.b,P-=gt.a,l=J+((l=kt+B)0&&N1(e,r)};Gs.Blur=R1;fh.Factory.addGetterSetter(P1.Node,"blurRadius",0,(0,E1.getNumberValidator)(),fh.Factory.afterSetFilter);var Is={};Object.defineProperty(Is,"__esModule",{value:!0});Is.Brighten=void 0;const ph=ht,F1=bt,A1=et,M1=function(d){const e=this.brightness()*255,r=d.data,s=r.length;for(let a=0;a255?255:a,l=l<0?0:l>255?255:l,h=h<0?0:h>255?255:h,r[c]=a,r[c+1]=l,r[c+2]=h};Us.Contrast=O1;mh.Factory.addGetterSetter(L1.Node,"contrast",0,(0,b1.getNumberValidator)(),mh.Factory.afterSetFilter);var zs={};Object.defineProperty(zs,"__esModule",{value:!0});zs.Emboss=void 0;const kn=ht,Bs=bt,D1=Gt,dc=et,G1=function(d){const e=this.embossStrength()*10,r=this.embossWhiteLevel()*255,s=this.embossDirection(),a=this.embossBlend(),l=d.data,h=d.width,c=d.height,f=h*4;let m=0,_=0,x=c;switch(s){case"top-left":m=-1,_=-1;break;case"top":m=-1,_=0;break;case"top-right":m=-1,_=1;break;case"right":m=0,_=1;break;case"bottom-right":m=1,_=1;break;case"bottom":m=1,_=0;break;case"bottom-left":m=1,_=-1;break;case"left":m=0,_=-1;break;default:D1.Util.error("Unknown emboss direction: "+s)}do{const w=(x-1)*f;let C=m;x+C<1&&(C=0),x+C>c&&(C=0);const y=(x-1+C)*h*4;let P=h;do{const E=w+(P-1)*4;let R=_;P+R<1&&(R=0),P+R>h&&(R=0);const L=y+(P-1+R)*4,p=l[E]-l[L],v=l[E+1]-l[L+1],k=l[E+2]-l[L+2];let M=p;const I=M>0?M:-M,T=v>0?v:-v,U=k>0?k:-k;if(T>I&&(M=v),U>I&&(M=k),M*=e,a){const b=l[E]+M,z=l[E+1]+M,B=l[E+2]+M;l[E]=b>255?255:b<0?0:b,l[E+1]=z>255?255:z<0?0:z,l[E+2]=B>255?255:B<0?0:B}else{let b=r-M;b<0?b=0:b>255&&(b=255),l[E]=l[E+1]=l[E+2]=b}}while(--P)}while(--x)};zs.Emboss=G1;kn.Factory.addGetterSetter(Bs.Node,"embossStrength",.5,(0,dc.getNumberValidator)(),kn.Factory.afterSetFilter);kn.Factory.addGetterSetter(Bs.Node,"embossWhiteLevel",.5,(0,dc.getNumberValidator)(),kn.Factory.afterSetFilter);kn.Factory.addGetterSetter(Bs.Node,"embossDirection","top-left",void 0,kn.Factory.afterSetFilter);kn.Factory.addGetterSetter(Bs.Node,"embossBlend",!1,void 0,kn.Factory.afterSetFilter);var Vs={};Object.defineProperty(Vs,"__esModule",{value:!0});Vs.Enhance=void 0;const yh=ht,I1=bt,U1=et;function Fo(d,e,r,s,a){const l=r-e,h=a-s;if(l===0)return s+h/2;if(h===0)return s;let c=(d-e)/l;return c=h*c+s,c}const z1=function(d){const e=d.data,r=e.length;let s=e[0],a=s,l,h=e[1],c=h,f,m=e[2],_=m,x;const w=this.enhance();if(w===0)return;for(let p=0;pa&&(a=l),f=e[p+1],fc&&(c=f),x=e[p+2],x_&&(_=x);a===s&&(a=255,s=0),c===h&&(c=255,h=0),_===m&&(_=255,m=0);let C,y,P,E,R,L;if(w>0)C=a+w*(255-a),y=s-w*(s-0),P=c+w*(255-c),E=h-w*(h-0),R=_+w*(255-_),L=m-w*(m-0);else{const p=(a+s)*.5;C=a+w*(a-p),y=s+w*(s-p);const v=(c+h)*.5;P=c+w*(c-v),E=h+w*(h-v);const k=(_+m)*.5;R=_+w*(_-k),L=m+w*(m-k)}for(let p=0;pm?w:m;const C=h,y=l,P=360/y*Math.PI/180;for(let E=0;Em?w:m;const C=h,y=l,P=0;let E,R;for(_=0;_e&&(v=p,k=0,M=-1),a=0;a=0&&C=0&&y=0&&C=0&&y=255*4?255:0}return h}function e2(d,e,r){const s=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],a=Math.round(Math.sqrt(s.length)),l=Math.floor(a/2),h=[];for(let c=0;c=0&&C=0&&y=r))for(let p=P;p=s)continue;const v=(r*p+L)*4;m+=h[v+0],_+=h[v+1],x+=h[v+2],w+=h[v+3],R+=1}m=m/R,_=_/R,x=x/R,w=w/R;for(let L=C;L=r))for(let p=P;p=s)continue;const v=(r*p+L)*4;h[v+0]=m,h[v+1]=_,h[v+2]=x,h[v+3]=w}}};Qs.Pixelate=u2;Ch.Factory.addGetterSetter(o2.Node,"pixelSize",8,(0,l2.getNumberValidator)(),Ch.Factory.afterSetFilter);var Js={};Object.defineProperty(Js,"__esModule",{value:!0});Js.Posterize=void 0;const wh=ht,h2=bt,c2=et,d2=function(d){const e=Math.round(this.levels()*254)+1,r=d.data,s=r.length,a=255/e;for(let l=0;l255?255:d<0?0:Math.round(d)});ds.Factory.addGetterSetter(rl.Node,"green",0,function(d){return this._filterUpToDate=!1,d>255?255:d<0?0:Math.round(d)});ds.Factory.addGetterSetter(rl.Node,"blue",0,f2.RGBComponent,ds.Factory.afterSetFilter);var $s={};Object.defineProperty($s,"__esModule",{value:!0});$s.RGBA=void 0;const ei=ht,ta=bt,p2=et,m2=function(d){const e=d.data,r=e.length,s=this.red(),a=this.green(),l=this.blue(),h=this.alpha();for(let c=0;c255?255:d<0?0:Math.round(d)});ei.Factory.addGetterSetter(ta.Node,"green",0,function(d){return this._filterUpToDate=!1,d>255?255:d<0?0:Math.round(d)});ei.Factory.addGetterSetter(ta.Node,"blue",0,p2.RGBComponent,ei.Factory.afterSetFilter);ei.Factory.addGetterSetter(ta.Node,"alpha",1,function(d){return this._filterUpToDate=!1,d>1?1:d<0?0:d});var ea={};Object.defineProperty(ea,"__esModule",{value:!0});ea.Sepia=void 0;const y2=function(d){const e=d.data,r=e.length;for(let s=0;s127&&(m=255-m),_>127&&(_=255-_),x>127&&(x=255-x),e[f]=m,e[f+1]=_,e[f+2]=x}while(--c)}while(--l)};na.Solarize=_2;var ra={};Object.defineProperty(ra,"__esModule",{value:!0});ra.Threshold=void 0;const xh=ht,v2=bt,S2=et,C2=function(d){const e=this.threshold()*255,r=d.data,s=r.length;for(let a=0;aN||u[S]!==g[N]){var D=`
+`+u[S].replace(" at new "," at ");return t.displayName&&D.includes("")&&(D=D.replace("",t.displayName)),D}while(1<=S&&0<=N);break}}}finally{la=!1,Error.prepareStackTrace=i}return(t=t?t.displayName||t.name:"")?Ar(t):""}var cd=Object.prototype.hasOwnProperty,ha=[],er=-1;function gn(t){return{current:t}}function Ft(t){0>er||(t.current=ha[er],ha[er]=null,er--)}function Nt(t,n){er++,ha[er]=t.current,t.current=n}var pn={},ee=gn(pn),he=gn(!1),bn=pn;function nr(t,n){var i=t.type.contextTypes;if(!i)return pn;var o=t.stateNode;if(o&&o.__reactInternalMemoizedUnmaskedChildContext===n)return o.__reactInternalMemoizedMaskedChildContext;var u={},g;for(g in i)u[g]=n[g];return o&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=n,t.__reactInternalMemoizedMaskedChildContext=u),u}function ce(t){return t=t.childContextTypes,t!=null}function ui(){Ft(he),Ft(ee)}function dl(t,n,i){if(ee.current!==pn)throw Error(h(168));Nt(ee,n),Nt(he,i)}function fl(t,n,i){var o=t.stateNode;if(n=n.childContextTypes,typeof o.getChildContext!="function")return i;o=o.getChildContext();for(var u in o)if(!(u in n))throw Error(h(108,T(t)||"Unknown",u));return l({},i,o)}function hi(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||pn,bn=ee.current,Nt(ee,t),Nt(he,he.current),!0}function gl(t,n,i){var o=t.stateNode;if(!o)throw Error(h(169));i?(t=fl(t,n,bn),o.__reactInternalMemoizedMergedChildContext=t,Ft(he),Ft(ee),Nt(ee,t)):Ft(he),Nt(he,i)}var Re=Math.clz32?Math.clz32:gd,dd=Math.log,fd=Math.LN2;function gd(t){return t>>>=0,t===0?32:31-(dd(t)/fd|0)|0}var ci=64,di=4194304;function Mr(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function fi(t,n){var i=t.pendingLanes;if(i===0)return 0;var o=0,u=t.suspendedLanes,g=t.pingedLanes,S=i&268435455;if(S!==0){var N=S&~u;N!==0?o=Mr(N):(g&=S,g!==0&&(o=Mr(g)))}else S=i&~u,S!==0?o=Mr(S):g!==0&&(o=Mr(g));if(o===0)return 0;if(n!==0&&n!==o&&!(n&u)&&(u=o&-o,g=n&-n,u>=g||u===16&&(g&4194240)!==0))return n;if(o&4&&(o|=i&16),n=t.entangledLanes,n!==0)for(t=t.entanglements,n&=o;0i;i++)n.push(t);return n}function Lr(t,n,i){t.pendingLanes|=n,n!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,n=31-Re(n),t[n]=i}function yd(t,n){var i=t.pendingLanes&~n;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=n,t.mutableReadLanes&=n,t.entangledLanes&=n,n=t.entanglements;var o=t.eventTimes;for(t=t.expirationTimes;0>=S,u-=S,Ze=1<<32-Re(n)+u|i<mt?(Jt=st,st=null):Jt=st.sibling;var yt=K(O,st,G[mt],Y);if(yt===null){st===null&&(st=Jt);break}t&&st&&yt.alternate===null&&n(O,st),A=g(yt,A,mt),ot===null?$=yt:ot.sibling=yt,ot=yt,st=Jt}if(mt===G.length)return i(O,st),Mt&&Dn(O,mt),$;if(st===null){for(;mtmt?(Jt=st,st=null):Jt=st.sibling;var xn=K(O,st,yt.value,Y);if(xn===null){st===null&&(st=Jt);break}t&&st&&xn.alternate===null&&n(O,st),A=g(xn,A,mt),ot===null?$=xn:ot.sibling=xn,ot=xn,st=Jt}if(yt.done)return i(O,st),Mt&&Dn(O,mt),$;if(st===null){for(;!yt.done;mt++,yt=G.next())yt=it(O,yt.value,Y),yt!==null&&(A=g(yt,A,mt),ot===null?$=yt:ot.sibling=yt,ot=yt);return Mt&&Dn(O,mt),$}for(st=o(O,st);!yt.done;mt++,yt=G.next())yt=At(st,O,mt,yt.value,Y),yt!==null&&(t&&yt.alternate!==null&&st.delete(yt.key===null?mt:yt.key),A=g(yt,A,mt),ot===null?$=yt:ot.sibling=yt,ot=yt);return t&&st.forEach(function(n0){return n(O,n0)}),Mt&&Dn(O,mt),$}function rn(O,A,G,Y){if(typeof G=="object"&&G!==null&&G.type===_&&G.key===null&&(G=G.props.children),typeof G=="object"&&G!==null){switch(G.$$typeof){case f:t:{for(var $=G.key,ot=A;ot!==null;){if(ot.key===$){if($=G.type,$===_){if(ot.tag===7){i(O,ot.sibling),A=u(ot,G.props.children),A.return=O,O=A;break t}}else if(ot.elementType===$||typeof $=="object"&&$!==null&&$.$$typeof===p&&Pl($)===ot.type){i(O,ot.sibling),A=u(ot,G.props),A.ref=Or(O,ot,G),A.return=O,O=A;break t}i(O,ot);break}else n(O,ot);ot=ot.sibling}G.type===_?(A=Hn(G.props.children,O.mode,Y,G.key),A.return=O,O=A):(Y=Ji(G.type,G.key,G.props,null,O.mode,Y),Y.ref=Or(O,A,G),Y.return=O,O=Y)}return S(O);case m:t:{for(ot=G.key;A!==null;){if(A.key===ot)if(A.tag===4&&A.stateNode.containerInfo===G.containerInfo&&A.stateNode.implementation===G.implementation){i(O,A.sibling),A=u(A,G.children||[]),A.return=O,O=A;break t}else{i(O,A);break}else n(O,A);A=A.sibling}A=vo(G,O.mode,Y),A.return=O,O=A}return S(O);case p:return ot=G._init,rn(O,A,ot(G._payload),Y)}if(j(G))return Pt(O,A,G,Y);if(M(G))return pe(O,A,G,Y);Si(O,G)}return typeof G=="string"&&G!==""||typeof G=="number"?(G=""+G,A!==null&&A.tag===6?(i(O,A.sibling),A=u(A,G),A.return=O,O=A):(i(O,A),A=_o(G,O.mode,Y),A.return=O,O=A),S(O)):i(O,A)}return rn}var ar=El(!0),kl=El(!1),Ci=gn(null),wi=null,or=null,xa=null;function Pa(){xa=or=wi=null}function Tl(t,n,i){Ct?(Nt(Ci,n._currentValue),n._currentValue=i):(Nt(Ci,n._currentValue2),n._currentValue2=i)}function Ea(t){var n=Ci.current;Ft(Ci),Ct?t._currentValue=n:t._currentValue2=n}function ka(t,n,i){for(;t!==null;){var o=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,o!==null&&(o.childLanes|=n)):o!==null&&(o.childLanes&n)!==n&&(o.childLanes|=n),t===i)break;t=t.return}}function lr(t,n){wi=t,xa=or=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&n&&(de=!0),t.firstContext=null)}function we(t){var n=Ct?t._currentValue:t._currentValue2;if(xa!==t)if(t={context:t,memoizedValue:n,next:null},or===null){if(wi===null)throw Error(h(308));or=t,wi.dependencies={lanes:0,firstContext:t}}else or=or.next=t;return n}var Gn=null;function Ta(t){Gn===null?Gn=[t]:Gn.push(t)}function Nl(t,n,i,o){var u=n.interleaved;return u===null?(i.next=i,Ta(n)):(i.next=u.next,u.next=i),n.interleaved=i,Be(t,o)}function Be(t,n){t.lanes|=n;var i=t.alternate;for(i!==null&&(i.lanes|=n),i=t,t=t.return;t!==null;)t.childLanes|=n,i=t.alternate,i!==null&&(i.childLanes|=n),i=t,t=t.return;return i.tag===3?i.stateNode:null}var mn=!1;function Na(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Rl(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function tn(t,n){return{eventTime:t,lane:n,tag:0,payload:null,callback:null,next:null}}function yn(t,n,i){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,ut&2){var u=o.pending;return u===null?n.next=n:(n.next=u.next,u.next=n),o.pending=n,Be(t,i)}return u=o.interleaved,u===null?(n.next=n,Ta(o)):(n.next=u.next,u.next=n),o.interleaved=n,Be(t,i)}function xi(t,n,i){if(n=n.updateQueue,n!==null&&(n=n.shared,(i&4194240)!==0)){var o=n.lanes;o&=t.pendingLanes,i|=o,n.lanes=i,fa(t,i)}}function Fl(t,n){var i=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,i===o)){var u=null,g=null;if(i=i.firstBaseUpdate,i!==null){do{var S={eventTime:i.eventTime,lane:i.lane,tag:i.tag,payload:i.payload,callback:i.callback,next:null};g===null?u=g=S:g=g.next=S,i=i.next}while(i!==null);g===null?u=g=n:g=g.next=n}else u=g=n;i={baseState:o.baseState,firstBaseUpdate:u,lastBaseUpdate:g,shared:o.shared,effects:o.effects},t.updateQueue=i;return}t=i.lastBaseUpdate,t===null?i.firstBaseUpdate=n:t.next=n,i.lastBaseUpdate=n}function Pi(t,n,i,o){var u=t.updateQueue;mn=!1;var g=u.firstBaseUpdate,S=u.lastBaseUpdate,N=u.shared.pending;if(N!==null){u.shared.pending=null;var D=N,H=D.next;D.next=null,S===null?g=H:S.next=H,S=D;var q=t.alternate;q!==null&&(q=q.updateQueue,N=q.lastBaseUpdate,N!==S&&(N===null?q.firstBaseUpdate=H:N.next=H,q.lastBaseUpdate=D))}if(g!==null){var it=u.baseState;S=0,q=H=D=null,N=g;do{var K=N.lane,At=N.eventTime;if((o&K)===K){q!==null&&(q=q.next={eventTime:At,lane:0,tag:N.tag,payload:N.payload,callback:N.callback,next:null});t:{var Pt=t,pe=N;switch(K=n,At=i,pe.tag){case 1:if(Pt=pe.payload,typeof Pt=="function"){it=Pt.call(At,it,K);break t}it=Pt;break t;case 3:Pt.flags=Pt.flags&-65537|128;case 0:if(Pt=pe.payload,K=typeof Pt=="function"?Pt.call(At,it,K):Pt,K==null)break t;it=l({},it,K);break t;case 2:mn=!0}}N.callback!==null&&N.lane!==0&&(t.flags|=64,K=u.effects,K===null?u.effects=[N]:K.push(N))}else At={eventTime:At,lane:K,tag:N.tag,payload:N.payload,callback:N.callback,next:null},q===null?(H=q=At,D=it):q=q.next=At,S|=K;if(N=N.next,N===null){if(N=u.shared.pending,N===null)break;K=N,N=K.next,K.next=null,u.lastBaseUpdate=K,u.shared.pending=null}}while(!0);if(q===null&&(D=it),u.baseState=D,u.firstBaseUpdate=H,u.lastBaseUpdate=q,n=u.shared.interleaved,n!==null){u=n;do S|=u.lane,u=u.next;while(u!==n)}else g===null&&(u.shared.lanes=0);Un|=S,t.lanes=S,t.memoizedState=it}}function Al(t,n,i){if(t=n.effects,n.effects=null,t!==null)for(n=0;ni?i:4,t(!0);var o=La.transition;La.transition={};try{t(!1),n()}finally{pt=i,La.transition=o}}function Ql(){return Pe().memoizedState}function Rd(t,n,i){var o=Sn(t);if(i={lane:o,action:i,hasEagerState:!1,eagerState:null,next:null},Jl(t))Zl(n,i);else if(i=Nl(t,n,i,o),i!==null){var u=se();Ee(i,t,o,u),$l(i,n,o)}}function Fd(t,n,i){var o=Sn(t),u={lane:o,action:i,hasEagerState:!1,eagerState:null,next:null};if(Jl(t))Zl(n,u);else{var g=t.alternate;if(t.lanes===0&&(g===null||g.lanes===0)&&(g=n.lastRenderedReducer,g!==null))try{var S=n.lastRenderedState,N=g(S,i);if(u.hasEagerState=!0,u.eagerState=N,Fe(N,S)){var D=n.interleaved;D===null?(u.next=u,Ta(n)):(u.next=D.next,D.next=u),n.interleaved=u;return}}catch{}finally{}i=Nl(t,n,u,o),i!==null&&(u=se(),Ee(i,t,o,u),$l(i,n,o))}}function Jl(t){var n=t.alternate;return t===Dt||n!==null&&n===Dt}function Zl(t,n){Ir=Ti=!0;var i=t.pending;i===null?n.next=n:(n.next=i.next,i.next=n),t.pending=n}function $l(t,n,i){if(i&4194240){var o=n.lanes;o&=t.pendingLanes,i|=o,n.lanes=i,fa(t,i)}}var Fi={readContext:we,useCallback:ne,useContext:ne,useEffect:ne,useImperativeHandle:ne,useInsertionEffect:ne,useLayoutEffect:ne,useMemo:ne,useReducer:ne,useRef:ne,useState:ne,useDebugValue:ne,useDeferredValue:ne,useTransition:ne,useMutableSource:ne,useSyncExternalStore:ne,useId:ne,unstable_isNewReconciler:!1},Ad={readContext:we,useCallback:function(t,n){return He().memoizedState=[t,n===void 0?null:n],t},useContext:we,useEffect:Vl,useImperativeHandle:function(t,n,i){return i=i!=null?i.concat([t]):null,Ni(4194308,4,jl.bind(null,n,t),i)},useLayoutEffect:function(t,n){return Ni(4194308,4,t,n)},useInsertionEffect:function(t,n){return Ni(4,2,t,n)},useMemo:function(t,n){var i=He();return n=n===void 0?null:n,t=t(),i.memoizedState=[t,n],t},useReducer:function(t,n,i){var o=He();return n=i!==void 0?i(n):n,o.memoizedState=o.baseState=n,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:n},o.queue=t,t=t.dispatch=Rd.bind(null,Dt,t),[o.memoizedState,t]},useRef:function(t){var n=He();return t={current:t},n.memoizedState=t},useState:zl,useDebugValue:za,useDeferredValue:function(t){return He().memoizedState=t},useTransition:function(){var t=zl(!1),n=t[0];return t=Nd.bind(null,t[1]),He().memoizedState=t,[n,t]},useMutableSource:function(){},useSyncExternalStore:function(t,n,i){var o=Dt,u=He();if(Mt){if(i===void 0)throw Error(h(407));i=i()}else{if(i=n(),Qt===null)throw Error(h(349));In&30||Ol(o,n,i)}u.memoizedState=i;var g={value:i,getSnapshot:n};return u.queue=g,Vl(Gl.bind(null,o,g,t),[t]),o.flags|=2048,Br(9,Dl.bind(null,o,g,i,n),void 0,null),i},useId:function(){var t=He(),n=Qt.identifierPrefix;if(Mt){var i=$e,o=Ze;i=(o&~(1<<32-Re(o)-1)).toString(32)+i,n=":"+n+"R"+i,i=Ur++,0uo&&(n.flags|=128,o=!0,Wr(u,!1),n.lanes=4194304)}else{if(!o)if(t=Ei(g),t!==null){if(n.flags|=128,o=!0,t=t.updateQueue,t!==null&&(n.updateQueue=t,n.flags|=4),Wr(u,!0),u.tail===null&&u.tailMode==="hidden"&&!g.alternate&&!Mt)return re(n),null}else 2*Xt()-u.renderingStartTime>uo&&i!==1073741824&&(n.flags|=128,o=!0,Wr(u,!1),n.lanes=4194304);u.isBackwards?(g.sibling=n.child,n.child=g):(t=u.last,t!==null?t.sibling=g:n.child=g,u.last=g)}return u.tail!==null?(n=u.tail,u.rendering=n,u.tail=n.sibling,u.renderingStartTime=Xt(),n.sibling=null,t=Ot.current,Nt(Ot,o?t&1|2:t&1),n):(re(n),null);case 22:case 23:return po(),i=n.memoizedState!==null,t!==null&&t.memoizedState!==null!==i&&(n.flags|=8192),i&&n.mode&1?_e&1073741824&&(re(n),at&&n.subtreeFlags&6&&(n.flags|=8192)):re(n),null;case 24:return null;case 25:return null}throw Error(h(156,n.tag))}function Ud(t,n){switch(va(n),n.tag){case 1:return ce(n.type)&&ui(),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return hr(),Ft(he),Ft(ee),Ma(),t=n.flags,t&65536&&!(t&128)?(n.flags=t&-65537|128,n):null;case 5:return Fa(n),null;case 13:if(Ft(Ot),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(h(340));sr()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return Ft(Ot),null;case 4:return hr(),null;case 10:return Ea(n.type._context),null;case 22:case 23:return po(),null;case 24:return null;default:return null}}var Di=!1,ie=!1,zd=typeof WeakSet=="function"?WeakSet:Set,X=null;function dr(t,n){var i=t.ref;if(i!==null)if(typeof i=="function")try{i(null)}catch(o){Lt(t,n,o)}else i.current=null}function Ja(t,n,i){try{i()}catch(o){Lt(t,n,o)}}var Cu=!1;function Bd(t,n){for(gt(t.containerInfo),X=n;X!==null;)if(t=X,n=t.child,(t.subtreeFlags&1028)!==0&&n!==null)n.return=t,X=n;else for(;X!==null;){t=X;try{var i=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(i!==null){var o=i.memoizedProps,u=i.memoizedState,g=t.stateNode,S=g.getSnapshotBeforeUpdate(t.elementType===t.type?o:Me(t.type,o),u);g.__reactInternalSnapshotBeforeUpdate=S}break;case 3:at&&Hc(t.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(h(163))}}catch(N){Lt(t,t.return,N)}if(n=t.sibling,n!==null){n.return=t.return,X=n;break}X=t.return}return i=Cu,Cu=!1,i}function jr(t,n,i){var o=n.updateQueue;if(o=o!==null?o.lastEffect:null,o!==null){var u=o=o.next;do{if((u.tag&t)===t){var g=u.destroy;u.destroy=void 0,g!==void 0&&Ja(n,i,g)}u=u.next}while(u!==o)}}function Gi(t,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&t)===t){var o=i.create;i.destroy=o()}i=i.next}while(i!==n)}}function Za(t){var n=t.ref;if(n!==null){var i=t.stateNode;switch(t.tag){case 5:t=_t(i);break;default:t=i}typeof n=="function"?n(t):n.current=t}}function wu(t){var n=t.alternate;n!==null&&(t.alternate=null,wu(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&Ne(n)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function xu(t){return t.tag===5||t.tag===3||t.tag===4}function Pu(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||xu(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function $a(t,n,i){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?Dc(i,t,n):Ac(i,t);else if(o!==4&&(t=t.child,t!==null))for($a(t,n,i),t=t.sibling;t!==null;)$a(t,n,i),t=t.sibling}function to(t,n,i){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?Oc(i,t,n):Fc(i,t);else if(o!==4&&(t=t.child,t!==null))for(to(t,n,i),t=t.sibling;t!==null;)to(t,n,i),t=t.sibling}var $t=null,Le=!1;function je(t,n,i){for(i=i.child;i!==null;)eo(t,n,i),i=i.sibling}function eo(t,n,i){if(Ue&&typeof Ue.onCommitFiberUnmount=="function")try{Ue.onCommitFiberUnmount(gi,i)}catch{}switch(i.tag){case 5:ie||dr(i,n);case 6:if(at){var o=$t,u=Le;$t=null,je(t,n,i),$t=o,Le=u,$t!==null&&(Le?Ic($t,i.stateNode):Gc($t,i.stateNode))}else je(t,n,i);break;case 18:at&&$t!==null&&(Le?od($t,i.stateNode):ad($t,i.stateNode));break;case 4:at?(o=$t,u=Le,$t=i.stateNode.containerInfo,Le=!0,je(t,n,i),$t=o,Le=u):(Tt&&(o=i.stateNode.containerInfo,u=ol(o),sa(o,u)),je(t,n,i));break;case 0:case 11:case 14:case 15:if(!ie&&(o=i.updateQueue,o!==null&&(o=o.lastEffect,o!==null))){u=o=o.next;do{var g=u,S=g.destroy;g=g.tag,S!==void 0&&(g&2||g&4)&&Ja(i,n,S),u=u.next}while(u!==o)}je(t,n,i);break;case 1:if(!ie&&(dr(i,n),o=i.stateNode,typeof o.componentWillUnmount=="function"))try{o.props=i.memoizedProps,o.state=i.memoizedState,o.componentWillUnmount()}catch(N){Lt(i,n,N)}je(t,n,i);break;case 21:je(t,n,i);break;case 22:i.mode&1?(ie=(o=ie)||i.memoizedState!==null,je(t,n,i),ie=o):je(t,n,i);break;default:je(t,n,i)}}function Eu(t){var n=t.updateQueue;if(n!==null){t.updateQueue=null;var i=t.stateNode;i===null&&(i=t.stateNode=new zd),n.forEach(function(o){var u=Qd.bind(null,t,o);i.has(o)||(i.add(o),o.then(u,u))})}}function be(t,n){var i=n.deletions;if(i!==null)for(var o=0;o";case Ui:return":has("+(io(t)||"")+")";case zi:return'[role="'+t.value+'"]';case Vi:return'"'+t.value+'"';case Bi:return'[data-testname="'+t.value+'"]';default:throw Error(h(365))}}function Au(t,n){var i=[];t=[t,0];for(var o=0;ou&&(u=S),o&=~g}if(o=u,o=Xt()-o,o=(120>o?120:480>o?480:1080>o?1080:1920>o?1920:3e3>o?3e3:4320>o?4320:1960*Hd(o/1960))-o,10t?16:t,vn===null)var o=!1;else{if(t=vn,vn=null,Yi=0,ut&6)throw Error(h(331));var u=ut;for(ut|=4,X=t.current;X!==null;){var g=X,S=g.child;if(X.flags&16){var N=g.deletions;if(N!==null){for(var D=0;DXt()-lo?zn(t,0):oo|=i),ge(t,n)}function zu(t,n){n===0&&(t.mode&1?(n=di,di<<=1,!(di&130023424)&&(di=4194304)):n=1);var i=se();t=Be(t,n),t!==null&&(Lr(t,n,i),ge(t,i))}function qd(t){var n=t.memoizedState,i=0;n!==null&&(i=n.retryLane),zu(t,i)}function Qd(t,n){var i=0;switch(t.tag){case 13:var o=t.stateNode,u=t.memoizedState;u!==null&&(i=u.retryLane);break;case 19:o=t.stateNode;break;default:throw Error(h(314))}o!==null&&o.delete(n),zu(t,i)}var Bu;Bu=function(t,n,i){if(t!==null)if(t.memoizedProps!==n.pendingProps||he.current)de=!0;else{if(!(t.lanes&i)&&!(n.flags&128))return de=!1,Gd(t,n,i);de=!!(t.flags&131072)}else de=!1,Mt&&n.flags&1048576&&vl(n,yi,n.index);switch(n.lanes=0,n.tag){case 2:var o=n.type;Li(t,n),t=n.pendingProps;var u=nr(n,ee.current);lr(n,i),u=Oa(null,n,o,t,u,i);var g=Da();return n.flags|=1,typeof u=="object"&&u!==null&&typeof u.render=="function"&&u.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,ce(o)?(g=!0,hi(n)):g=!1,n.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,Na(n),u.updater=Ai,n.stateNode=u,u._reactInternals=n,Va(n,o,t,i),n=Ka(null,n,o,!0,g,i)):(n.tag=0,Mt&&g&&_a(n),oe(null,n,u,i),n=n.child),n;case 16:o=n.elementType;t:{switch(Li(t,n),t=n.pendingProps,u=o._init,o=u(o._payload),n.type=o,u=n.tag=Zd(o),t=Me(o,t),u){case 0:n=ja(null,n,o,t,i);break t;case 1:n=fu(null,n,o,t,i);break t;case 11:n=lu(null,n,o,t,i);break t;case 14:n=uu(null,n,o,Me(o.type,t),i);break t}throw Error(h(306,o,""))}return n;case 0:return o=n.type,u=n.pendingProps,u=n.elementType===o?u:Me(o,u),ja(t,n,o,u,i);case 1:return o=n.type,u=n.pendingProps,u=n.elementType===o?u:Me(o,u),fu(t,n,o,u,i);case 3:t:{if(gu(n),t===null)throw Error(h(387));o=n.pendingProps,g=n.memoizedState,u=g.element,Rl(t,n),Pi(n,o,null,i);var S=n.memoizedState;if(o=S.element,Rt&&g.isDehydrated)if(g={element:o,isDehydrated:!1,cache:S.cache,pendingSuspenseBoundaries:S.pendingSuspenseBoundaries,transitions:S.transitions},n.updateQueue.baseState=g,n.memoizedState=g,n.flags&256){u=cr(Error(h(423)),n),n=pu(t,n,o,i,u);break t}else if(o!==u){u=cr(Error(h(424)),n),n=pu(t,n,o,i,u);break t}else for(Rt&&(Ce=Zc(n.stateNode.containerInfo),ye=n,Mt=!0,Ae=null,br=!1),i=kl(n,null,o,i),n.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(sr(),o===u){n=en(t,n,i);break t}oe(t,n,o,i)}n=n.child}return n;case 5:return Ml(n),t===null&&Ca(n),o=n.type,u=n.pendingProps,g=t!==null?t.memoizedProps:null,S=u.children,me(o,u)?S=null:g!==null&&me(o,g)&&(n.flags|=32),du(t,n),oe(t,n,S,i),n.child;case 6:return t===null&&Ca(n),null;case 13:return mu(t,n,i);case 4:return Ra(n,n.stateNode.containerInfo),o=n.pendingProps,t===null?n.child=ar(n,null,o,i):oe(t,n,o,i),n.child;case 11:return o=n.type,u=n.pendingProps,u=n.elementType===o?u:Me(o,u),lu(t,n,o,u,i);case 7:return oe(t,n,n.pendingProps,i),n.child;case 8:return oe(t,n,n.pendingProps.children,i),n.child;case 12:return oe(t,n,n.pendingProps.children,i),n.child;case 10:t:{if(o=n.type._context,u=n.pendingProps,g=n.memoizedProps,S=u.value,Tl(n,o,S),g!==null)if(Fe(g.value,S)){if(g.children===u.children&&!he.current){n=en(t,n,i);break t}}else for(g=n.child,g!==null&&(g.return=n);g!==null;){var N=g.dependencies;if(N!==null){S=g.child;for(var D=N.firstContext;D!==null;){if(D.context===o){if(g.tag===1){D=tn(-1,i&-i),D.tag=2;var H=g.updateQueue;if(H!==null){H=H.shared;var q=H.pending;q===null?D.next=D:(D.next=q.next,q.next=D),H.pending=D}}g.lanes|=i,D=g.alternate,D!==null&&(D.lanes|=i),ka(g.return,i,n),N.lanes|=i;break}D=D.next}}else if(g.tag===10)S=g.type===n.type?null:g.child;else if(g.tag===18){if(S=g.return,S===null)throw Error(h(341));S.lanes|=i,N=S.alternate,N!==null&&(N.lanes|=i),ka(S,i,n),S=g.sibling}else S=g.child;if(S!==null)S.return=g;else for(S=g;S!==null;){if(S===n){S=null;break}if(g=S.sibling,g!==null){g.return=S.return,S=g;break}S=S.return}g=S}oe(t,n,u.children,i),n=n.child}return n;case 9:return u=n.type,o=n.pendingProps.children,lr(n,i),u=we(u),o=o(u),n.flags|=1,oe(t,n,o,i),n.child;case 14:return o=n.type,u=Me(o,n.pendingProps),u=Me(o.type,u),uu(t,n,o,u,i);case 15:return hu(t,n,n.type,n.pendingProps,i);case 17:return o=n.type,u=n.pendingProps,u=n.elementType===o?u:Me(o,u),Li(t,n),n.tag=1,ce(o)?(t=!0,hi(n)):t=!1,lr(n,i),eu(n,o,u),Va(n,o,u,i),Ka(null,n,o,!0,t,i);case 19:return _u(t,n,i);case 22:return cu(t,n,i)}throw Error(h(156,n.tag))};function Vu(t,n){return ga(t,n)}function Jd(t,n,i,o){this.tag=t,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ke(t,n,i,o){return new Jd(t,n,i,o)}function yo(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Zd(t){if(typeof t=="function")return yo(t)?1:0;if(t!=null){if(t=t.$$typeof,t===P)return 11;if(t===L)return 14}return 2}function wn(t,n){var i=t.alternate;return i===null?(i=ke(t.tag,n,t.key,t.mode),i.elementType=t.elementType,i.type=t.type,i.stateNode=t.stateNode,i.alternate=t,t.alternate=i):(i.pendingProps=n,i.type=t.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=t.flags&14680064,i.childLanes=t.childLanes,i.lanes=t.lanes,i.child=t.child,i.memoizedProps=t.memoizedProps,i.memoizedState=t.memoizedState,i.updateQueue=t.updateQueue,n=t.dependencies,i.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},i.sibling=t.sibling,i.index=t.index,i.ref=t.ref,i}function Ji(t,n,i,o,u,g){var S=2;if(o=t,typeof t=="function")yo(t)&&(S=1);else if(typeof t=="string")S=5;else t:switch(t){case _:return Hn(i.children,u,g,n);case x:S=8,u|=8;break;case w:return t=ke(12,i,n,u|2),t.elementType=w,t.lanes=g,t;case E:return t=ke(13,i,n,u),t.elementType=E,t.lanes=g,t;case R:return t=ke(19,i,n,u),t.elementType=R,t.lanes=g,t;case v:return Zi(i,u,g,n);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case C:S=10;break t;case y:S=9;break t;case P:S=11;break t;case L:S=14;break t;case p:S=16,o=null;break t}throw Error(h(130,t==null?t:typeof t,""))}return n=ke(S,i,n,u),n.elementType=t,n.type=o,n.lanes=g,n}function Hn(t,n,i,o){return t=ke(7,t,o,n),t.lanes=i,t}function Zi(t,n,i,o){return t=ke(22,t,o,n),t.elementType=v,t.lanes=i,t.stateNode={isHidden:!1},t}function _o(t,n,i){return t=ke(6,t,null,n),t.lanes=i,t}function vo(t,n,i){return n=ke(4,t.children!==null?t.children:[],t.key,n),n.lanes=i,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}function $d(t,n,i,o,u){this.tag=n,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Q,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=da(0),this.expirationTimes=da(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=da(0),this.identifierPrefix=o,this.onRecoverableError=u,Rt&&(this.mutableSourceEagerHydrationData=null)}function Hu(t,n,i,o,u,g,S,N,D){return t=new $d(t,n,i,N,D),n===1?(n=1,g===!0&&(n|=8)):n=0,g=ke(3,null,null,n),t.current=g,g.stateNode=t,g.memoizedState={element:o,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},Na(g),t}function Wu(t){if(!t)return pn;t=t._reactInternals;t:{if(U(t)!==t||t.tag!==1)throw Error(h(170));var n=t;do{switch(n.tag){case 3:n=n.stateNode.context;break t;case 1:if(ce(n.type)){n=n.stateNode.__reactInternalMemoizedMergedChildContext;break t}}n=n.return}while(n!==null);throw Error(h(171))}if(t.tag===1){var i=t.type;if(ce(i))return fl(t,i,n)}return n}function ju(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(h(188)):(t=Object.keys(t).join(","),Error(h(268,t)));return t=B(n),t===null?null:t.stateNode}function Ku(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var i=t.retryLane;t.retryLane=i!==0&&i=H&&g>=it&&u<=q&&S<=K){t.splice(n,1);break}else if(o!==H||i.width!==D.width||KS){if(!(g!==it||i.height!==D.height||qu)){H>o&&(D.width+=H-o,D.x=o),qg&&(D.height+=it-g,D.y=g),Ki&&(i=S)),S ")+`
+
+No matching component was found for:
+ `)+t.join(" > ")}return null},r.getPublicRootInstance=function(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return _t(t.child.stateNode);default:return t.child.stateNode}},r.injectIntoDevTools=function(t){if(t={bundleType:t.bundleType,version:t.version,rendererPackageName:t.rendererPackageName,rendererConfig:t.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:c.ReactCurrentDispatcher,findHostInstanceByFiber:t0,findFiberByHostInstance:t.findFiberByHostInstance||e0,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")t=!1;else{var n=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(n.isDisabled||!n.supportsFiber)t=!0;else{try{gi=n.inject(t),Ue=n}catch{}t=!!n.checkDCE}}return t},r.isAlreadyRendering=function(){return!1},r.observeVisibleRects=function(t,n,i,o){if(!Rr)throw Error(h(363));t=so(t,n);var u=Rc(t,i,o).disconnect;return{disconnect:function(){u()}}},r.registerMutableSourceForHydration=function(t,n){var i=n._getVersion;i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i)},r.runWithPriority=function(t,n){var i=pt;try{return pt=t,n()}finally{pt=i}},r.shouldError=function(){return null},r.shouldSuspend=function(){return!1},r.updateContainer=function(t,n,i,o){var u=n.current,g=se(),S=Sn(u);return i=Wu(i),n.context===null?n.context=i:n.pendingContext=i,n=tn(g,S),n.payload={element:t},o=o===void 0?null:o,o!==null&&(n.callback=o),t=yn(u,n,S),t!==null&&(Ee(t,u,S,g),xi(t,u,S)),S},r};pc.exports=og;var lg=pc.exports;const ug=Bo(lg);var mc={exports:{}},tr={};/**
+ * @license React
+ * react-reconciler-constants.production.min.js
+ *
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */tr.ConcurrentRoot=1;tr.ContinuousEventPriority=4;tr.DefaultEventPriority=16;tr.DiscreteEventPriority=1;tr.IdleEventPriority=536870912;tr.LegacyRoot=0;mc.exports=tr;var yc=mc.exports;const kh={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let Th=!1,Nh=!1;const il=".react-konva-event",hg=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.
+Position of a node will be changed during drag&drop, so you should update state of the react app as well.
+Consider to add onDragMove or onDragEnd events.
+For more info see: https://github.com/konvajs/react-konva/issues/256
+`,cg=`ReactKonva: You are using "zIndex" attribute for a Konva node.
+react-konva may get confused with ordering. Just define correct order of elements in your render function of a component.
+For more info see: https://github.com/konvajs/react-konva/issues/194
+`,dg={};function ia(d,e,r=dg){if(!Th&&"zIndex"in e&&(console.warn(cg),Th=!0),!Nh&&e.draggable){var s=e.x!==void 0||e.y!==void 0,a=e.onDragEnd||e.onDragMove;s&&!a&&(console.warn(hg),Nh=!0)}for(var l in r)if(!kh[l]){var h=l.slice(0,2)==="on",c=r[l]!==e[l];if(h&&c){var f=l.substr(2).toLowerCase();f.substr(0,7)==="content"&&(f="content"+f.substr(7,1).toUpperCase()+f.substr(8)),d.off(f,r[l])}var m=!e.hasOwnProperty(l);m&&d.setAttr(l,void 0)}var _=e._useStrictMode,x={},w=!1;const C={};for(var l in e)if(!kh[l]){var h=l.slice(0,2)==="on",y=r[l]!==e[l];if(h&&y){var f=l.substr(2).toLowerCase();f.substr(0,7)==="content"&&(f="content"+f.substr(7,1).toUpperCase()+f.substr(8)),e[l]&&(C[f]=e[l])}!h&&(e[l]!==r[l]||_&&e[l]!==d.getAttr(l))&&(w=!0,x[l]=e[l])}w&&(d.setAttrs(x),Ln(d));for(var f in C)d.on(f+il,C[f])}function Ln(d){if(!lt.Konva.autoDrawEnabled){var e=d.getLayer()||d.getStage();e&&e.batchDraw()}}const _c={},fg={};ni.Node.prototype._applyProps=ia;function gg(d,e){if(typeof e=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${e}`);return}d.add(e),Ln(d)}function pg(d,e,r){let s=ni[d];s||(console.error(`Konva has no node with the type ${d}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${d}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),s=ni.Group);const a={},l={};for(var h in e){var c=h.slice(0,2)==="on";c?l[h]=e[h]:a[h]=e[h]}const f=new s(a);return ia(f,l),f}function mg(d,e,r){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${d}"`)}function yg(d,e,r){return!1}function _g(d){return d}function vg(){return null}function Sg(){return null}function Cg(d,e,r,s){return fg}function wg(){}function xg(d){}function Pg(d,e){return!1}function Eg(){return _c}function kg(){return _c}const Tg=setTimeout,Ng=clearTimeout,Rg=-1;function Fg(d,e){return!1}const Ag=!1,Mg=!0,Lg=!0;function bg(d,e){e.parent===d?e.moveToTop():d.add(e),Ln(d)}function Og(d,e){e.parent===d?e.moveToTop():d.add(e),Ln(d)}function vc(d,e,r){e._remove(),d.add(e),e.setZIndex(r.getZIndex()),Ln(d)}function Dg(d,e,r){vc(d,e,r)}function Gg(d,e){e.destroy(),e.off(il),Ln(d)}function Ig(d,e){e.destroy(),e.off(il),Ln(d)}function Ug(d,e,r){console.error(`Text components are not yet supported in ReactKonva. You text is: "${r}"`)}function zg(d,e,r){}function Bg(d,e,r,s,a){ia(d,a,s)}function Vg(d){d.hide(),Ln(d)}function Hg(d){}function Wg(d,e){(e.visible==null||e.visible)&&d.show()}function jg(d,e){}function Kg(d){}function Yg(){}const Xg=()=>yc.DefaultEventPriority,qg=Object.freeze(Object.defineProperty({__proto__:null,appendChild:bg,appendChildToContainer:Og,appendInitialChild:gg,cancelTimeout:Ng,clearContainer:Kg,commitMount:zg,commitTextUpdate:Ug,commitUpdate:Bg,createInstance:pg,createTextInstance:mg,detachDeletedInstance:Yg,finalizeInitialChildren:yg,getChildHostContext:kg,getCurrentEventPriority:Xg,getPublicInstance:_g,getRootHostContext:Eg,hideInstance:Vg,hideTextInstance:Hg,idlePriority:ss.unstable_IdlePriority,insertBefore:vc,insertInContainerBefore:Dg,isPrimaryRenderer:Ag,noTimeout:Rg,now:ss.unstable_now,prepareForCommit:vg,preparePortalMount:Sg,prepareUpdate:Cg,removeChild:Gg,removeChildFromContainer:Ig,resetAfterCommit:wg,resetTextContent:xg,run:ss.unstable_runWithPriority,scheduleTimeout:Tg,shouldDeprioritizeSubtree:Pg,shouldSetTextContent:Fg,supportsMutation:Lg,unhideInstance:Wg,unhideTextInstance:jg,warnsIfNotActing:Mg},Symbol.toStringTag,{value:"Module"}));var Qg=Object.defineProperty,Jg=Object.defineProperties,Zg=Object.getOwnPropertyDescriptors,Rh=Object.getOwnPropertySymbols,$g=Object.prototype.hasOwnProperty,t5=Object.prototype.propertyIsEnumerable,Fh=(d,e,r)=>e in d?Qg(d,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):d[e]=r,Ah=(d,e)=>{for(var r in e||(e={}))$g.call(e,r)&&Fh(d,r,e[r]);if(Rh)for(var r of Rh(e))t5.call(e,r)&&Fh(d,r,e[r]);return d},e5=(d,e)=>Jg(d,Zg(e)),Mh,Lh;typeof window<"u"&&((Mh=window.document)!=null&&Mh.createElement||((Lh=window.navigator)==null?void 0:Lh.product)==="ReactNative")?ue.useLayoutEffect:ue.useEffect;function Sc(d,e,r){if(!d)return;if(r(d)===!0)return d;let s=d.child;for(;s;){const a=Sc(s,e,r);if(a)return a;s=s.sibling}}function Cc(d){try{return Object.defineProperties(d,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return d}}const bh=console.error;console.error=function(){const d=[...arguments].join("");if(d!=null&&d.startsWith("Warning:")&&d.includes("useContext")){console.error=bh;return}return bh.apply(this,arguments)};const sl=Cc(ue.createContext(null));class wc extends ue.Component{render(){return ue.createElement(sl.Provider,{value:this._reactInternals},this.props.children)}}function n5(){const d=ue.useContext(sl);if(d===null)throw new Error("its-fine: useFiber must be called within a !");const e=ue.useId();return ue.useMemo(()=>{for(const s of[d,d==null?void 0:d.alternate]){if(!s)continue;const a=Sc(s,!1,l=>{let h=l.memoizedState;for(;h;){if(h.memoizedState===e)return!0;h=h.next}});if(a)return a}},[d,e])}function r5(){const d=n5(),[e]=ue.useState(()=>new Map);e.clear();let r=d;for(;r;){if(r.type&&typeof r.type=="object"){const a=r.type._context===void 0&&r.type.Provider===r.type?r.type:r.type._context;a&&a!==sl&&!e.has(a)&&e.set(a,ue.useContext(Cc(a)))}r=r.return}return e}function i5(){const d=r5();return ue.useMemo(()=>Array.from(d.keys()).reduce((e,r)=>s=>ue.createElement(e,null,ue.createElement(r.Provider,e5(Ah({},s),{value:d.get(r)}))),e=>ue.createElement(wc,Ah({},e))),[d])}function s5(d){const e=le.useRef({});return le.useLayoutEffect(()=>{e.current=d}),le.useLayoutEffect(()=>()=>{e.current={}},[]),e.current}const a5=d=>{const e=le.useRef(null),r=le.useRef(null),s=le.useRef(null),a=s5(d),l=i5(),h=c=>{const{forwardedRef:f}=d;f&&(typeof f=="function"?f(c):f.current=c)};return le.useLayoutEffect(()=>(r.current=new ni.Stage({width:d.width,height:d.height,container:e.current}),h(r.current),s.current=$r.createContainer(r.current,yc.LegacyRoot,!1,null),$r.updateContainer(le.createElement(l,{},d.children),s.current),()=>{ni.isBrowser&&(h(null),$r.updateContainer(null,s.current,null),r.current.destroy())}),[]),le.useLayoutEffect(()=>{h(r.current),ia(r.current,d,a),$r.updateContainer(le.createElement(l,{},d.children),s.current,null)}),le.createElement("div",{ref:e,id:d.id,accessKey:d.accessKey,className:d.className,role:d.role,style:d.style,tabIndex:d.tabIndex,title:d.title})},f5="Layer",g5="Rect",p5="Image",m5="Text",y5="Transformer",$r=ug(qg);$r.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:le.version,rendererPackageName:"react-konva"});const _5=le.forwardRef((d,e)=>le.createElement(wc,{},le.createElement(a5,{...d,forwardedRef:e})));export{p5 as I,d5 as K,f5 as L,g5 as R,_5 as S,m5 as T,y5 as a};